diff --git a/extensions/package-manager/js/dist-typings/components/DiscoverSection.d.ts b/extensions/package-manager/js/dist-typings/components/DiscoverSection.d.ts new file mode 100644 index 000000000..ec799b2ec --- /dev/null +++ b/extensions/package-manager/js/dist-typings/components/DiscoverSection.d.ts @@ -0,0 +1,25 @@ +import Component, { type ComponentAttrs } from 'flarum/common/Component'; +import type Mithril from 'mithril'; +import ItemList from 'flarum/common/utils/ItemList'; +import Stream from 'flarum/common/utils/Stream'; +export interface IDiscoverSectionAttrs extends ComponentAttrs { +} +export default class DiscoverSection extends Component { + protected search: Stream; + protected warningsDismissed: Stream; + oninit(vnode: Mithril.Vnode): void; + load(page?: number): void; + view(): JSX.Element; + tabFilters(): Record boolean; + }>; + tabItems(): ItemList; + warningItems(): ItemList; + private applySearch; + toolbarPrimaryItems(): ItemList; + toolbarSecondaryItems(): ItemList; + extensionList(): JSX.Element; + footerItems(): ItemList; + private setWarningDismissed; +} diff --git a/extensions/package-manager/js/dist-typings/components/ExtensionCard.d.ts b/extensions/package-manager/js/dist-typings/components/ExtensionCard.d.ts new file mode 100644 index 000000000..450569a74 --- /dev/null +++ b/extensions/package-manager/js/dist-typings/components/ExtensionCard.d.ts @@ -0,0 +1,28 @@ +import Component, { type ComponentAttrs } from 'flarum/common/Component'; +import { type Extension as ExtensionInfo } from 'flarum/admin/AdminApplication'; +import ExternalExtension from '../models/ExternalExtension'; +import { UpdatedPackage } from '../states/ControlSectionState'; +import ItemList from 'flarum/common/utils/ItemList'; +import type Mithril from 'mithril'; +export type CommonExtension = ExternalExtension | ExtensionInfo; +export interface IExtensionAttrs extends ComponentAttrs { + extension: CommonExtension; + updates?: UpdatedPackage; + onClickUpdate?: CallableFunction | { + soft: CallableFunction; + hard: CallableFunction; + }; + whyNotWarning?: boolean; + isCore?: boolean; + updatable?: boolean; + isDanger?: boolean; +} +export default class ExtensionCard extends Component { + getExtension(): ExtensionInfo; + view(): JSX.Element; + icon(): JSX.Element; + badges(): ItemList; + metaItems(): ItemList; + actionItems(): ItemList; + version(v: string): string; +} diff --git a/extensions/package-manager/js/dist-typings/components/ExtensionItem.d.ts b/extensions/package-manager/js/dist-typings/components/ExtensionItem.d.ts deleted file mode 100644 index 0f45ff1fb..000000000 --- a/extensions/package-manager/js/dist-typings/components/ExtensionItem.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type Mithril from 'mithril'; -import Component, { ComponentAttrs } from 'flarum/common/Component'; -import { Extension } from 'flarum/admin/AdminApplication'; -import { UpdatedPackage } from '../states/ControlSectionState'; -export interface ExtensionItemAttrs extends ComponentAttrs { - extension: Extension; - updates: UpdatedPackage; - onClickUpdate: CallableFunction | { - soft: CallableFunction; - hard: CallableFunction; - }; - whyNotWarning?: boolean; - isCore?: boolean; - updatable?: boolean; - isDanger?: boolean; -} -export default class ExtensionItem extends Component { - view(vnode: Mithril.Vnode): Mithril.Children; - version(v: string): string; -} diff --git a/extensions/package-manager/js/dist-typings/components/Pagination.d.ts b/extensions/package-manager/js/dist-typings/components/Pagination.d.ts deleted file mode 100644 index 999081d75..000000000 --- a/extensions/package-manager/js/dist-typings/components/Pagination.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// -import Component, { ComponentAttrs } from 'flarum/common/Component'; -import QueueState from '../states/QueueState'; -interface PaginationAttrs extends ComponentAttrs { - list: QueueState; -} -/** - * @todo make it abstract in core for reusability. - */ -export default class Pagination extends Component { - view(): JSX.Element; -} -export {}; diff --git a/extensions/package-manager/js/dist-typings/extend.d.ts b/extensions/package-manager/js/dist-typings/extend.d.ts index 4c1b0a615..7de0fbaa6 100644 --- a/extensions/package-manager/js/dist-typings/extend.d.ts +++ b/extensions/package-manager/js/dist-typings/extend.d.ts @@ -1,2 +1,2 @@ -declare const _default: import("flarum/common/extenders/Admin").default[]; +declare const _default: (import("flarum/common/extenders/Store").default | import("flarum/common/extenders/Admin").default)[]; export default _default; diff --git a/extensions/package-manager/js/dist-typings/models/ExternalExtension.d.ts b/extensions/package-manager/js/dist-typings/models/ExternalExtension.d.ts new file mode 100644 index 000000000..dda4a0de7 --- /dev/null +++ b/extensions/package-manager/js/dist-typings/models/ExternalExtension.d.ts @@ -0,0 +1,26 @@ +import Model from 'flarum/common/Model'; +import type { Extension } from 'flarum/admin/AdminApplication'; +export default class ExternalExtension extends Model { + extensionId: () => string; + name: () => string; + title: () => string; + description: () => string; + iconUrl: () => string; + icon: () => { + [key: string]: string; + name: string; + }; + highestVersion: () => string; + httpUri: () => string; + discussUri: () => string; + vendor: () => string; + isPremium: () => boolean; + isLocale: () => boolean; + locale: () => string; + latestFlarumVersionSupported: () => string; + downloads: () => number; + readonly installed = false; + isSupported(): boolean; + isStable(): boolean; + toLocalExtension(): Extension; +} diff --git a/extensions/package-manager/js/dist-typings/states/ExtensionListState.d.ts b/extensions/package-manager/js/dist-typings/states/ExtensionListState.d.ts new file mode 100644 index 000000000..6b0ae6532 --- /dev/null +++ b/extensions/package-manager/js/dist-typings/states/ExtensionListState.d.ts @@ -0,0 +1,7 @@ +import PaginatedListState, { SortMap } from 'flarum/common/states/PaginatedListState'; +import ExternalExtension from '../models/ExternalExtension'; +export default class ExtensionListState extends PaginatedListState { + get type(): string; + constructor(); + sortMap(): SortMap; +} diff --git a/extensions/package-manager/js/dist-typings/states/ExtensionManagerState.d.ts b/extensions/package-manager/js/dist-typings/states/ExtensionManagerState.d.ts index e97eabb0f..d143c6406 100644 --- a/extensions/package-manager/js/dist-typings/states/ExtensionManagerState.d.ts +++ b/extensions/package-manager/js/dist-typings/states/ExtensionManagerState.d.ts @@ -1,6 +1,8 @@ import QueueState from './QueueState'; import ControlSectionState from './ControlSectionState'; +import ExtensionListState from './ExtensionListState'; export default class ExtensionManagerState { queue: QueueState; control: ControlSectionState; + extensions: ExtensionListState; } diff --git a/extensions/package-manager/js/dist-typings/states/QueueState.d.ts b/extensions/package-manager/js/dist-typings/states/QueueState.d.ts index a09278ab1..b57e816fd 100644 --- a/extensions/package-manager/js/dist-typings/states/QueueState.d.ts +++ b/extensions/package-manager/js/dist-typings/states/QueueState.d.ts @@ -6,14 +6,19 @@ export default class QueueState { private limit; private offset; private total; + private loading; load(params?: ApiQueryParamsPlural, actionTaken?: boolean): Promise; + isLoading(): boolean; getItems(): Task[] | null; + getTotalItems(): number; getTotalPages(): number; pageNumber(): number; + getPerPage(): number; hasPrev(): boolean; hasNext(): boolean; prev(): void; next(): void; + goto(page: number): void; pollQueue(actionTaken?: boolean): void; hasPending(): boolean; } diff --git a/extensions/package-manager/js/dist/admin.js b/extensions/package-manager/js/dist/admin.js index 51fa6ba88..6e31d5d73 100755 --- a/extensions/package-manager/js/dist/admin.js +++ b/extensions/package-manager/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var t={151:function(t){t.exports=function(){"use strict";var t,e,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(t){return t instanceof b},d=function(t,e,a){return new b(t,a,e.$l)},g=function(t){return e.p(t)+"s"},p=function(t){return t<0},h=function(t){return p(t)?Math.ceil(t):Math.floor(t)},f=function(t){return Math.abs(t)},x=function(t,e){return t?p(t)?{negative:!0,format:""+f(t)+e}:{negative:!1,format:""+t+e}:{negative:!1,format:""}},b=function(){function p(t,e,a){var n=this;if(this.$d={},this.$l=a,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),e)return d(t*u[g(e)],this);if("number"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if("object"==typeof t)return Object.keys(t).forEach((function(e){n.$d[g(e)]=t[e]})),this.calMilliseconds(),this;if("string"==typeof t){var s=t.match(m);if(s){var r=s.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 f=p.prototype;return f.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(e,a){return e+(t.$d[a]||0)*u[a]}),0)},f.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=h(t/i),t%=i,this.$d.months=h(t/l),t%=l,this.$d.days=h(t/r),t%=r,this.$d.hours=h(t/s),t%=s,this.$d.minutes=h(t/n),t%=n,this.$d.seconds=h(t/a),t%=a,this.$d.milliseconds=t},f.toISOString=function(){var t=x(this.$d.years,"Y"),e=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=t.negative||e.negative||n.negative||s.negative||r.negative||i.negative,m=s.format||r.format||i.format?"T":"",u=(l?"-":"")+"P"+t.format+e.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(t){var a=t||"YYYY-MM-DDTHH:mm:ss",n={Y:this.$d.years,YY:e.s(this.$d.years,2,"0"),YYYY:e.s(this.$d.years,4,"0"),M:this.$d.months,MM:e.s(this.$d.months,2,"0"),D:this.$d.days,DD:e.s(this.$d.days,2,"0"),H:this.$d.hours,HH:e.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:e.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:e.s(this.$d.seconds,2,"0"),SSS:e.s(this.$d.milliseconds,3,"0")};return a.replace(o,(function(t,e){return e||String(n[t])}))},f.as=function(t){return this.$ms/u[g(t)]},f.get=function(t){var e=this.$ms,a=g(t);return"milliseconds"===a?e%=1e3:e="weeks"===a?h(e/u[a]):this.$d[a],e||0},f.add=function(t,e,a){var n;return n=e?t*u[g(e)]:c(t)?t.$ms:d(t,this).$ms,d(this.$ms+n*(a?-1:1),this)},f.subtract=function(t,e){return this.add(t,e,!0)},f.locale=function(t){var e=this.clone();return e.$l=t,e},f.clone=function(){return d(this.$ms,this)},f.humanize=function(e){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!e)},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}(),y=function(t,e,a){return t.add(e.years()*a,"y").add(e.months()*a,"M").add(e.days()*a,"d").add(e.hours()*a,"h").add(e.minutes()*a,"m").add(e.seconds()*a,"s").add(e.milliseconds()*a,"ms")};return function(a,n,s){t=s,e=s().$utils(),s.duration=function(t,e){var a=s.locale();return d(t,{$l:a},e)},s.isDuration=c;var r=n.prototype.add,o=n.prototype.subtract;n.prototype.add=function(t,e){return c(t)?y(this,t,1):r.bind(this)(t,e)},n.prototype.subtract=function(t,e){return c(t)?y(this,t,-1):o.bind(this)(t,e)}}}()}},e={};function a(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={exports:{}};return t[n].call(r.exports,r,r.exports,a),r.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";a.r(n),a.d(n,{extend:()=>qt});const t=flarum.reg.get("core","common/extend"),e=flarum.reg.get("core","admin/app");var s=a.n(e);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);const p=flarum.reg.get("core","common/Model");var h=a.n(p);const f=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],x=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],b=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],y=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],v=(t,e,a)=>{let n=t;return"string"==typeof e||Array.isArray(e)?n=t.toLocaleString(e,a):!0!==e&&void 0===a||(n=t.toLocaleString(void 0,a)),n};class _ extends(h()){status(){return h().attribute("status").call(this)}operation(){return h().attribute("operation").call(this)}command(){return h().attribute("command").call(this)}package(){return h().attribute("package").call(this)}output(){return h().attribute("output").call(this)}guessedCause(){return h().attribute("guessedCause").call(this)}createdAt(){return h().attribute("createdAt",h().transformDate).call(this)}startedAt(){return h().attribute("startedAt",h().transformDate).call(this)}finishedAt(){return h().attribute("finishedAt",h().transformDate).call(this)}peakMemoryUsed(){return function(t,e){if(!Number.isFinite(t))throw new TypeError("Expected a finite number, got ".concat(typeof t,": ").concat(t));const a=(e={bits:!1,binary:!1,space:!0,...e}).bits?e.binary?y:b:e.binary?x:f,n=e.space?" ":"";if(e.signed&&0===t)return" 0".concat(n).concat(a[0]);const s=t<0,r=s?"-":e.signed?"+":"";let o;if(s&&(t=-t),void 0!==e.minimumFractionDigits&&(o={minimumFractionDigits:e.minimumFractionDigits}),void 0!==e.maximumFractionDigits&&(o={maximumFractionDigits:e.maximumFractionDigits,...o}),t<1)return r+v(t,e.locale,o)+n+a[0];const i=Math.min(Math.floor(e.binary?Math.log(t)/Math.log(1024):Math.log10(t)/3),a.length-1);return t/=(e.binary?1024:1e3)**i,o||(t=t.toPrecision(3)),r+v(Number(t),e.locale,o)+n+a[i]}(1024*h().attribute("peakMemoryUsed").call(this))}}function k(){s().modal.close(),m.route.set(s().route("extension",{id:"flarum-extension-manager"})),s().extensionManager.queue.load({},!0),setTimeout((()=>{var t;null==(t=document.getElementById("ExtensionManager-queueSection"))||t.scrollIntoView({block:"nearest"})}),200)}function N(t){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(t)}function M(t,e,a){return n=function(t,e){if("object"!=N(t)||!t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var n=a.call(t,"string");if("object"!=N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==N(n)?n:n+"")in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t;var n}flarum.reg.add("flarum-extension-manager","admin/models/Task",_),window.jumpToQueue=k,flarum.reg.add("flarum-extension-manager","admin/utils/jumpToQueue",k);class w{constructor(){M(this,"polling",null),M(this,"tasks",null),M(this,"limit",20),M(this,"offset",0),M(this,"total",0)}load(t,e){var a;return void 0===e&&(e=!1),this.tasks=null,t={page:{limit:this.limit,offset:this.offset,...null==(a=t)?void 0:a.page},...t},s().store.find("extension-manager-tasks",t||{}).then((t=>{var a;return this.tasks=t,this.total=(null==(a=t.payload.meta)?void 0:a.total)||0,m.redraw(),(null==t?void 0:t.find((t=>"pending"===t.status()||"running"===t.status())))?this.pollQueue(e):e?(s().extensionManager.control.setLoading(null),window.location.reload()):s().extensionManager.control.isLoading()&&s().extensionManager.control.setLoading(null),t}))}getItems(){return this.tasks}getTotalPages(){return Math.ceil(this.total/this.limit)}pageNumber(){return Math.ceil(this.offset/this.limit)}hasPrev(){return 0!==this.pageNumber()}hasNext(){return this.offset+this.limit{this.load({},t)}),6e3)}hasPending(){var t;return!(null==(t=this.tasks)||!t.find((t=>"pending"===t.status()||"running"===t.status())))}}function E(t){s().extensionManager.control.setLoading(null);const e=t.response.errors[0];if(!["composer_command_failure","extension_already_installed","extension_not_installed"].includes(e.code))throw t;switch(s().alerts.clear(),e.code){case"composer_command_failure":e.guessed_cause?(s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.guessed_cause.".concat(e.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",w);const U=flarum.reg.get("core","common/utils/extractText");var S=a.n(U);class B{get lastUpdateRun(){const t=JSON.parse(s().data.settings["flarum-extension-manager.last_update_run"]);return t.limitedPackages=()=>[...t.major.limitedPackages,...t.minor.limitedPackages,...t.global.limitedPackages],t}constructor(){M(this,"loading",null),M(this,"packageUpdates",{}),M(this,"lastUpdateCheck",void 0),M(this,"extensionUpdates",void 0),M(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(t){return void 0===t&&(t=null),t&&this.loading===t||!t&&null!==this.loading}hasOperationRunning(){return this.isLoading()||s().extensionManager.queue.hasPending()}setLoading(t){this.loading=t}requirePackage(t){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:t}}).then((t=>{if(t.processing)k();else{const e=t.id;s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.extensions.successful_install",{extension:e})),window.location.href="".concat(s().forum.attribute("adminUrl"),"#/extension/").concat(e),window.location.reload()}})).catch(E).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((t=>{t.processing?k():(this.lastUpdateCheck=t,this.extensionUpdates=this.formatExtensionUpdates(t),this.coreUpdate=this.formatCoreUpdate(t),this.setLoading(null),m.redraw())})).catch(E).finally((()=>{m.redraw()}))}updateCoreMinor(){confirm(S()(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((t=>{null!=t&&t.processing?k():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.update_successful")),window.location.reload())})).catch(E).finally((()=>{s().modal.close(),m.redraw()})))}updateExtension(t,e){s().modal.show(c()),this.setLoading("extension-update"),s().request({method:"PATCH",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/extensions/").concat(t.id),body:{data:{updateMode:e}}}).then((e=>{null!=e&&e.processing?k():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.extensions.successful_update",{extension:t.extra["flarum-extension"].title})),window.location.reload())})).catch(E).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((t=>{null!=t&&t.processing?k():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.updater.global_update_successful")),window.location.reload())})).catch(E).finally((()=>{s().modal.close(),m.redraw()}))}formatExtensionUpdates(t){var e;return this.packageUpdates={},null==t||null==(e=t.updates)||null==(e=e.installed)||e.filter((t=>{const e=t.name.replace("/","-").replace(/(flarum-ext-)|(flarum-)/,""),a=s().data.extensions[e],n=["semver-safe-update","update-possible"].includes(t["latest-status"]);return a&&n&&(this.packageUpdates[a.id]=t),a&&n})),Object.values(s().data.extensions).filter((t=>this.packageUpdates[t.id]))}formatCoreUpdate(t){var e;const a=null==t||null==(e=t.updates)||null==(e=e.installed)?void 0:e.filter((t=>"flarum/core"===t.name)).pop();return a?{package:a,extension:{id:"flarum-core",name:"flarum/core",version:s().data.settings.version,icon:{backgroundImage:"url(".concat(s().data.resources[0].attributes.baseUrl,"/assets/extensions/flarum-extension-manager/flarum.svg")},extra:{"flarum-extension":{title:S()(s().translator.trans("flarum-extension-manager.admin.updater.flarum"))}}}}:null}majorUpdate(t){let{dryRun:e}=t;s().extensionManager.control.setLoading(e?"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:e}}}).then((t=>{null!=t&&t.processing?k():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.update_successful")),window.location.reload())})).catch(E).catch((t=>{var e;s().modal.close(),a.status="failure",a.incompatibleExtensions=null==(e=t.response)||null==(e=e.errors)||null==(e=e.pop())?void 0:e.incompatible_extensions})).finally((()=>{m.redraw()}))}}flarum.reg.add("flarum-extension-manager","admin/states/ControlSectionState",B);class q{constructor(){M(this,"queue",new w),M(this,"control",new B)}}flarum.reg.add("flarum-extension-manager","admin/states/ExtensionManagerState",q);const j=flarum.reg.get("core","common/extenders");var T=a.n(j);const $=flarum.reg.get("core","common/Component");var C=a.n($);const P=flarum.reg.get("core","common/components/LoadingIndicator");var F=a.n(P);const O=flarum.reg.get("core","common/components/Tooltip");var L=a.n(O);const A=flarum.reg.get("core","common/components/Icon");var D=a.n(A);const I=flarum.reg.get("core","common/utils/ItemList");var Y=a.n(I);const R=flarum.reg.get("core","common/components/Link");var G=a.n(R);const W=flarum.reg.get("core","common/utils/classList");var H=a.n(W);class Q extends(C()){view(t){const{className:e,type:a,...n}=this.attrs;return m("span",Object.assign({className:H()(["Label","Label--".concat(this.attrs.type),e])},n),t.children)}}flarum.reg.add("flarum-extension-manager","admin/components/Label",Q);const J=flarum.reg.get("core","common/components/Modal");var V=a.n(J);class Z 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",Z);var z=a(151),K=a.n(z);function X(t,e){dayjs.extend(K());const a=dayjs(e).diff(t);return dayjs.duration(a).humanize()}flarum.reg.add("flarum-extension-manager","admin/utils/humanDuration",X);class tt extends(C()){view(){return m("nav",{className:"Pagination UserListPage-gridPagination"},m(l(),{disabled:!this.attrs.list.hasPrev()||s().extensionManager.control.isLoading(),title:s().translator.trans("core.admin.users.pagination.back_button"),onclick:()=>this.attrs.list.prev(),icon:"fas fa-chevron-left",className:"Button Button--icon UserListPage-backBtn"}),m("span",{className:"UserListPage-pageNumber"},s().translator.trans("core.admin.users.pagination.page_counter",{current:this.attrs.list.pageNumber()+1,total:this.attrs.list.getTotalPages()})),m(l(),{disabled:!this.attrs.list.hasNext()||s().extensionManager.control.isLoading(),title:s().translator.trans("core.admin.users.pagination.next_button"),onclick:()=>this.attrs.list.next(),icon:"fas fa-chevron-right",className:"Button Button--icon UserListPage-nextBtn"}))}}flarum.reg.add("flarum-extension-manager","admin/components/Pagination",tt);class et extends(C()){oninit(t){super.oninit(t),s().extensionManager.queue.load()}view(){return m("section",{id:"ExtensionManager-queueSection",className:"ExtensionPage-permissions 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 t=new(Y());return t.add("operation",{label:S()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.operation")),content:t=>m("div",{className:"ExtensionManager-queueTable-operation"},m("span",{className:"ExtensionManager-queueTable-operation-icon"},this.operationIcon(t.operation())),m("span",{className:"ExtensionManager-queueTable-operation-name"},s().translator.trans("flarum-extension-manager.admin.sections.queue.operations.".concat(t.operation()))))},80),t.add("package",{label:S()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.package")),content:t=>{var e;const a=s().data.extensions[null==(e=t.package())?void 0:e.replace(/(\/flarum-|\/flarum-ext-|\/)/g,"-")];return a?m(G(),{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(D(),{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"},t.package()))):t.package()}},75),t.add("status",{label:S()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.status")),content:t=>m("[",null,m(Q,{className:"ExtensionManager-queueTable-status",type:{running:"neutral",failure:"error",pending:"warning",success:"success"}[t.status()]},s().translator.trans("flarum-extension-manager.admin.sections.queue.statuses.".concat(t.status()))),["pending","running"].includes(t.status())&&m(F(),{size:"small",display:"inline"}))},70),t.add("elapsedTime",{label:S()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.elapsed_time")),content:t=>t.startedAt()&&t.finishedAt()?m(L(),{text:"".concat(dayjs(t.startedAt()).format("LL LTS")," ").concat(dayjs(t.finishedAt()).format("LL LTS"))},m("span",null,X(t.startedAt(),t.finishedAt()))):s().translator.trans("flarum-extension-manager.admin.sections.queue.task_just_started")},65),t.add("memoryUsed",{label:S()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.peak_memory_used")),content:t=>m("span",null,t.peakMemoryUsed())},60),t.add("details",{label:S()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.details")),content:t=>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(Z,{task:t}),disabled:["pending","running"].includes(t.status())}),className:"Table-controls"},55),t}queueTable(){const t=s().extensionManager.queue.getItems();if(!t)return m(F(),null);if(t&&!t.length)return m("h3",{className:"ExtensionPage-subHeader"},s().translator.trans("flarum-extension-manager.admin.sections.queue.none"));const e=this.columns();return m("[",null,m("table",{className:"Table ExtensionManager-queueTable"},m("thead",null,m("tr",null,e.toArray().map(((t,e)=>m("th",{key:e},t.label))))),m("tbody",null,t.map(((t,a)=>m("tr",{key:a},e.toArray().map(((e,a)=>{const{label:n,content:s,...r}=e;return m("td",Object.assign({key:a},r),s(t))}))))))),m(tt,{list:s().extensionManager.queue}))}operationIcon(t){return m(D(),{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"}[t]})}}flarum.reg.add("flarum-extension-manager","admin/components/QueueSection",et);const at=flarum.reg.get("core","common/components/Alert");var nt=a.n(at);const st=flarum.reg.get("core","common/utils/Stream");var rt=a.n(st);class ot extends(C()){constructor(){super(...arguments),M(this,"packageName",void 0)}oninit(t){super.oninit(t),this.packageName=rt()("")}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",{extiverse:m("a",{href:"https://extiverse.com"},"extiverse.com"),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",ot);const it=flarum.reg.get("core","common/helpers/humanTime");var lt=a.n(it);class mt extends(V()){constructor(){super(...arguments),M(this,"loading",!0),M(this,"whyNot",null)}className(){return"Modal--large WhyNotModal"}title(){return s().translator.trans("flarum-extension-manager.admin.why_not_modal.title")}oncreate(t){super.oncreate(t),this.requestWhyNot()}content(){return m("div",{className:"Modal-body"},this.loading?m(F(),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((t=>{this.loading=!1,this.whyNot=t.data.reason,m.redraw()})).catch(E)}}flarum.reg.add("flarum-extension-manager","admin/components/WhyNotModal",mt);const ut=flarum.reg.get("core","common/components/Dropdown");var ct=a.n(ut);class dt extends(C()){view(t){var e;const{extension:a,updates:n,onClickUpdate:r,whyNotWarning:o,isCore:i,isDanger:u}=this.attrs,c=null!=(e=n["latest-minor"])?e:n["latest-major"]&&!i?n["latest-major"]:null;return m("div",{className:H()({"ExtensionManager-extension":!0,"ExtensionManager-extension--core":i,"ExtensionManager-extension--danger":u})},m("div",{className:"ExtensionManager-extension-icon ExtensionIcon",style:a.icon},a.icon?m(D(),{name:a.icon.name}):""),m("div",{className:"ExtensionManager-extension-info"},m("div",{className:"ExtensionManager-extension-name"},a.extra["flarum-extension"].title),m("div",{className:"ExtensionManager-extension-version"},m("span",{className:"ExtensionManager-extension-version-current"},this.version(n.version)),c?m(Q,{className:"ExtensionManager-extension-version-latest",type:n["latest-minor"]?"success":"warning"},this.version(c)):null)),m("div",{className:"ExtensionManager-extension-controls"},r&&"function"==typeof r?m(L(),{text:s().translator.trans("flarum-extension-manager.admin.extensions.update")},m(l(),{icon:"fas fa-arrow-alt-circle-up",className:"Button Button--icon Button--flat",onclick:r,"aria-label":s().translator.trans("flarum-extension-manager.admin.extensions.update")})):r?m(ct(),{buttonClassName:"Button Button--icon Button--flat",icon:"fas fa-arrow-alt-circle-up",label:s().translator.trans("flarum-extension-manager.admin.extensions.update")},m(l(),{icon:"fas fa-arrow-alt-circle-up",className:"Button",onclick:r.soft},s().translator.trans("flarum-extension-manager.admin.extensions.update_soft_label")),m(l(),{icon:"fas fa-arrow-alt-circle-up",className:"Button",onclick:r.hard,disabled:!n["direct-dependency"]},s().translator.trans("flarum-extension-manager.admin.extensions.update_hard_label"))):null,o?m(L(),{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(mt,{package:a.name}),"aria-label":s().translator.trans("flarum-extension-manager.admin.extensions.check_why_it_failed_updating")})):null))}version(t){return"v"===t.charAt(0)?t.substring(1):t}}flarum.reg.add("flarum-extension-manager","admin/components/ExtensionItem",dt);class gt extends(C()){constructor(){super(...arguments),M(this,"updateState",void 0)}oninit(t){super.oninit(t),this.updateState=this.attrs.updateState}view(){return m("div",{className:H()("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(L(),{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((t=>m(dt,{extension:s().data.extensions[t.replace("flarum-","").replace("flarum-ext-","").replace("/","-")],updates:{},onClickUpdate:null,isDanger:!0})))):null,"failure"===this.updateState.status?m(nt(),{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(mt,{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(t){s().extensionManager.control.majorUpdate({dryRun:t})}}flarum.reg.add("flarum-extension-manager","admin/components/MajorUpdater",gt);class pt extends(C()){view(){const t=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()),t&&t.package["latest-major"]?m(gt,{coreUpdate:t.package,updateState:s().extensionManager.control.lastUpdateRun.major}):null]}lastUpdateCheckView(){var t;return(null==(t=s().extensionManager.control.lastUpdateCheck)?void 0:t.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"},lt()(s().extensionManager.control.lastUpdateCheck.checkedAt)))||null}availableUpdatesView(){const t=s().extensionManager.control;if(s().extensionManager.control.isLoading("check")||s().extensionManager.control.isLoading("global-update"))return m("div",{className:"ExtensionManager-extensions"},m(F(),null));const e=t.coreUpdate&&t.coreUpdate.package["latest-minor"];return t.extensionUpdates.length||e?m("div",{className:"ExtensionManager-extensions"},m("div",{className:"ExtensionManager-extensions-grid"},e?m(dt,{extension:t.coreUpdate.extension,updates:t.coreUpdate.package,isCore:!0,onClickUpdate:()=>t.updateCoreMinor(),whyNotWarning:t.lastUpdateRun.limitedPackages().includes("flarum/core")}):null,t.extensionUpdates.map((e=>m(dt,{extension:e,updates:t.packageUpdates[e.id],onClickUpdate:{soft:()=>t.updateExtension(e,"soft"),hard:()=>t.updateExtension(e,"hard")},whyNotWarning:t.lastUpdateRun.limitedPackages().includes(e.name)}))))):m("div",{className:"ExtensionManager-extensions"},m("span",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.updater.up_to_date")))}controlItems(){const t=new(Y());return t.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),t.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"))),t}}flarum.reg.add("flarum-extension-manager","admin/components/Updater",pt);const ht=flarum.reg.get("core","common/components/Form");var ft=a.n(ht);class xt extends(C()){oninit(t){super.oninit(t)}view(){return m("div",{className:"ExtensionPage-permissions ExtensionManager-controlSection"},m("div",{className:"ExtensionPage-permissions-header"},m("div",{className:"container"},m("h2",{className:"ExtensionTitle"},s().translator.trans("flarum-extension-manager.admin.sections.control.title")))),m("div",{className:"container"},s().data["flarum-extension-manager.writable_dirs"]?m(ft(),null,m(ot,null),m(pt,null)):m("div",{className:"Form-group"},m(nt(),{type:"warning",dismissible:!1},s().translator.trans("flarum-extension-manager.admin.file_permissions")))))}}flarum.reg.add("flarum-extension-manager","admin/components/ControlSection",xt);const bt=flarum.reg.get("core","common/components/FormGroup");var yt=a.n(bt);class vt extends(C()){constructor(){super(...arguments),M(this,"settings",{}),M(this,"initialSettings",null),M(this,"loading",!1),M(this,"type",void 0)}oninit(t){super.oninit(t),this.submit(!0)}className(){return""}view(){return m("div",{className:H()("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 yt().prototype.customFieldComponents()}setting(t){var e;return null!=(e=this.settings[t])?e:this.settings[t]=rt()()}submit(t){this.loading=!0;const e={};Object.keys(this.settings).forEach((t=>{e[t]=this.settings[t]()})),s().request({method:"POST",url:s().forum.attribute("apiUrl")+"/extension-manager/composer",body:{type:this.type,data:t?null:e}}).then((t=>{let{data:e}=t;Object.keys(e).forEach((t=>{this.settings[t]=rt()(e[t])})),this.initialSettings=Array.isArray(e)?{}:e})).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",vt);const _t=flarum.reg.get("core","common/components/Select");var kt=a.n(_t);class Nt extends(V()){constructor(){super(...arguments),M(this,"name",void 0),M(this,"repository",void 0)}oninit(t){super.oninit(t),this.name=rt()(this.attrs.name||""),this.repository=rt()(this.attrs.repository||{type:"composer",url:""})}className(){return"RepositoryModal Modal--small"}title(){const t=this.attrs.repository?"edit":"add";return s().translator.trans("flarum-extension-manager.admin.composer.".concat(t,"_repository_label"))}content(){const t={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(ft(),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(kt(),{options:t,value:this.repository().type,onchange:t=>this.repository({...this.repository(),type:t})})),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:t=>this.repository({...this.repository(),url:t.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",Nt);class Mt extends vt{constructor(){super(...arguments),M(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((t=>{const e=this.setting("repositories")()[t];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"}[e.type],onclick:()=>s().modal.show(Nt,{name:t,repository:e,onsubmit:(e,a)=>{const n=this.setting("repositories")();delete n[t],this.setting("repositories")(n),this.onchange(e,a)}})},t," (",e.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(S()(s().translator.trans("flarum-extension-manager.admin.composer.delete_repository_confirmation")))){const e={...this.setting("repositories")()};delete e[t],this.setting("repositories")(e)}}}))})))))}submitButton(){const t=super.submitButton();return t.push(m(l(),{className:"Button",onclick:()=>s().modal.show(Nt,{onsubmit:this.onchange.bind(this)})},s().translator.trans("flarum-extension-manager.admin.composer.add_repository_label"))),t}onchange(t,e){this.setting("repositories")({...this.setting("repositories")(),[e]:t})}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureComposer",Mt);const wt=flarum.reg.get("core","common/helpers/listItems");var Et=a.n(wt);class Ut extends(V()){constructor(){super(...arguments),M(this,"type",void 0),M(this,"host",void 0),M(this,"token",void 0)}oninit(t){super.oninit(t),this.type=rt()(this.attrs.type||"bearer"),this.host=rt()(this.attrs.host||""),this.token=rt()(this.attrs.token||"")}className(){return"AuthMethodModal Modal--small"}title(){const t=this.attrs.host?"edit":"add";return s().translator.trans("flarum-extension-manager.admin.auth_config.".concat(t,"_label"))}content(){const t={"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(ft(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.type_label")),m(kt(),{options:t,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:t=>this.token(t.target.value),rows:"6",placeholder:this.token().startsWith("unchanged:")?S()(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",Ut);class St extends vt{constructor(){super(...arguments),M(this,"type","auth")}title(){return s().translator.trans("flarum-extension-manager.admin.auth_config.title")}className(){return"ConfigureAuth"}content(){const t=Object.keys(this.settings),e=t.length&&t.every((t=>{const e=this.settings[t]();return Array.isArray(e)?e.length:Object.keys(e).length}));return m("div",{className:"ExtensionManager-SettingsGroups-content"},e?t.map((t=>{const e=this.settings[t]();return m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.types.".concat(t))),m("div",{className:"ConfigureAuth-hosts"},Object.keys(e).map((a=>{const n=e[a];return m("div",{className:"ButtonGroup ButtonGroup--full"},m(l(),{className:"Button",icon:"fas fa-key",onclick:()=>s().modal.show(Ut,{type:t,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(S()(s().translator.trans("flarum-extension-manager.admin.auth_config.delete_confirmation")))){const e={...this.setting(t)()};delete e[a],Object.keys(e).length?this.setting(t)(e):delete this.settings[t]}}}))}))))})):m("span",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.auth_config.no_auth_methods_configured")))}submitButton(){const t=super.submitButton();return t.push(m(l(),{className:"Button",loading:this.loading,onclick:()=>s().modal.show(Ut,{onsubmit:this.onchange.bind(this,null)})},s().translator.trans("flarum-extension-manager.admin.auth_config.add_label"))),t}onchange(t,e,a,n){const s={...this.setting(e)()};t&&delete s[t],s[a]=n,this.setting(e)(s)}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureAuth",St);class Bt extends(o()){content(){const t=s().registry.getSettings(this.extension.id),e=[s().translator.trans("flarum-extension-manager.admin.settings.access_warning")];return s().data.debugEnabled&&e.push(s().translator.trans("flarum-extension-manager.admin.settings.debug_mode_warning")),m("div",{className:"ExtensionPage-settings"},m("div",{className:"container"},m("div",{className:"ExtensionManager-warnings Form-group"},m(nt(),{className:"ExtensionManager-primaryWarning",type:"warning",dismissible:!1},m("ul",null,Et()(e)))),t?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"},t.map(this.buildSettingComponent.bind(this))),m("div",{className:"Form-group Form--controls"},this.submitButton())),m(Mt,{buildSettingComponent:this.buildSettingComponent}),m(St,{buildSettingComponent:this.buildSettingComponent})):m("h3",{className:"ExtensionPage-subHeader"},s().translator.trans("core.admin.extension.no_settings"))))}sections(t){const e=super.sections(t);return e.setPriority("content",10),e.add("control",m(xt,null),8),"0"!==s().data.settings["flarum-extension-manager.queue_jobs"]&&s().data.settings["flarum-extension-manager.queue_jobs"]&&e.add("queue",m(et,null),5),e.remove("permissions"),e}onsaved(){super.onsaved(),m.redraw()}}flarum.reg.add("flarum-extension-manager","admin/components/SettingsPage",Bt);const qt=[(new(T().Admin)).setting((()=>({setting:"flarum-extension-manager.queue_jobs",label:s().translator.trans("flarum-extension-manager.admin.settings.queue_jobs"),help:m.trust(S()(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(Bt).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",(e=>{e.store.models["extension-manager-tasks"]=_,e.extensionManager=new q,e.data["flarum-extension-manager.using_sync_queue"]&&(e.data.settings["flarum-extension-manager.queue_jobs"]="0"),(0,t.extend)(o().prototype,"topItems",(function(t){"flarum-extension-manager"===this.extension.id||g()(this.extension.id)||t.add("remove",m(l(),{className:"Button Button--danger",icon:"fas fa-times",onclick:()=>{e.modal.show(c()),e.request({url:"".concat(e.forum.attribute("apiUrl"),"/extension-manager/extensions/").concat(this.extension.id),method:"DELETE"}).then((t=>{null!=t&&t.processing?k():(e.alerts.show({type:"success"},e.translator.trans("flarum-extension-manager.admin.extensions.successful_remove")),window.location=e.forum.attribute("adminUrl"))})).finally((()=>{e.modal.close()}))}},e.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:()=>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:{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"))}}}}: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})(); //# 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 94eeaf5b3..4ec89a0a8 100755 --- a/extensions/package-manager/js/dist/admin.js.map +++ b/extensions/package-manager/js/dist/admin.js.map @@ -1 +1 @@ -{"version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,WACLuN,EAAIQ,WAAW9N,MAAM,gEACxB5C,OAAOqB,SAAW6O,EAAIM,MAAMvM,UAAU,YACxC,IACCQ,SAAQ,KACTyL,EAAII,MAAMzR,OAAO,GACjB,GAEHqR,EAAIQ,WAAW9N,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/external root \"flarum.reg.get('core', 'common/Model')\"","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/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/./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/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/Pagination.tsx","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/Dropdown')\"","webpack://@flarum/extension-manager/./src/admin/components/ExtensionItem.tsx","webpack://@flarum/extension-manager/./src/admin/components/MajorUpdater.tsx","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/external root \"flarum.reg.get('core', 'common/helpers/listItems')\"","webpack://@flarum/extension-manager/./src/admin/components/AuthMethodModal.tsx","webpack://@flarum/extension-manager/./src/admin/components/ConfigureAuth.tsx","webpack://@flarum/extension-manager/./src/admin/components/SettingsPage.tsx","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');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","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 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 }\n load(params, actionTaken) {\n var _params;\n if (actionTaken === void 0) {\n actionTaken = false;\n }\n this.tasks = null;\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 ? 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 return data;\n });\n }\n getItems() {\n return this.tasks;\n }\n getTotalPages() {\n return Math.ceil(this.total / this.limit);\n }\n pageNumber() {\n return Math.ceil(this.offset / 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 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 // @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 }\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);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport QueueState from './QueueState';\nimport ControlSectionState from './ControlSectionState';\nexport default class ExtensionManagerState {\n constructor() {\n _defineProperty(this, \"queue\", new QueueState());\n _defineProperty(this, \"control\", new ControlSectionState());\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/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 Button from 'flarum/common/components/Button';\n/**\n * @todo make it abstract in core for reusability.\n */\nexport default class Pagination extends Component {\n view() {\n return m(\"nav\", {\n className: \"Pagination UserListPage-gridPagination\"\n }, m(Button, {\n disabled: !this.attrs.list.hasPrev() || app.extensionManager.control.isLoading(),\n title: app.translator.trans('core.admin.users.pagination.back_button'),\n onclick: () => this.attrs.list.prev(),\n icon: \"fas fa-chevron-left\",\n className: \"Button Button--icon UserListPage-backBtn\"\n }), m(\"span\", {\n className: \"UserListPage-pageNumber\"\n }, app.translator.trans('core.admin.users.pagination.page_counter', {\n current: this.attrs.list.pageNumber() + 1,\n total: this.attrs.list.getTotalPages()\n })), m(Button, {\n disabled: !this.attrs.list.hasNext() || app.extensionManager.control.isLoading(),\n title: app.translator.trans('core.admin.users.pagination.next_button'),\n onclick: () => this.attrs.list.next(),\n icon: \"fas fa-chevron-right\",\n className: \"Button Button--icon UserListPage-nextBtn\"\n }));\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Pagination', Pagination);","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 Label from './Label';\nimport TaskOutputModal from './TaskOutputModal';\nimport humanDuration from '../utils/humanDuration';\nimport Pagination from './Pagination';\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-permissions 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(\"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 }))))), m(Pagination, {\n list: app.extensionManager.queue\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 extiverse: m(\"a\", {\n href: \"https://extiverse.com\"\n }, \"extiverse.com\"),\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/Dropdown');","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nimport Icon from 'flarum/common/components/Icon';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Button from 'flarum/common/components/Button';\nimport WhyNotModal from './WhyNotModal';\nimport Label from './Label';\nimport Dropdown from 'flarum/common/components/Dropdown';\nexport default class ExtensionItem extends Component {\n view(vnode) {\n var _updates$latestMinor;\n const {\n extension,\n updates,\n onClickUpdate,\n whyNotWarning,\n isCore,\n isDanger\n } = this.attrs;\n const latestVersion = (_updates$latestMinor = updates['latest-minor']) != null ? _updates$latestMinor : updates['latest-major'] && !isCore ? updates['latest-major'] : null;\n return m(\"div\", {\n className: classList({\n 'ExtensionManager-extension': true,\n 'ExtensionManager-extension--core': isCore,\n 'ExtensionManager-extension--danger': isDanger\n })\n }, m(\"div\", {\n className: \"ExtensionManager-extension-icon ExtensionIcon\",\n style: extension.icon\n }, extension.icon ? m(Icon, {\n name: extension.icon.name\n }) : ''), m(\"div\", {\n className: \"ExtensionManager-extension-info\"\n }, m(\"div\", {\n className: \"ExtensionManager-extension-name\"\n }, extension.extra['flarum-extension'].title), m(\"div\", {\n className: \"ExtensionManager-extension-version\"\n }, m(\"span\", {\n className: \"ExtensionManager-extension-version-current\"\n }, this.version(updates['version'])), latestVersion ? m(Label, {\n className: \"ExtensionManager-extension-version-latest\",\n type: updates['latest-minor'] ? 'success' : 'warning'\n }, this.version(latestVersion)) : null)), m(\"div\", {\n className: \"ExtensionManager-extension-controls\"\n }, onClickUpdate && typeof onClickUpdate === 'function' ? m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.extensions.update')\n }, m(Button, {\n icon: \"fas fa-arrow-alt-circle-up\",\n className: \"Button Button--icon Button--flat\",\n onclick: onClickUpdate,\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.extensions.update')\n })) : onClickUpdate ? m(Dropdown, {\n buttonClassName: \"Button Button--icon Button--flat\",\n icon: \"fas fa-arrow-alt-circle-up\",\n label: app.translator.trans('flarum-extension-manager.admin.extensions.update')\n }, m(Button, {\n icon: \"fas fa-arrow-alt-circle-up\",\n className: \"Button\",\n onclick: onClickUpdate.soft\n }, app.translator.trans('flarum-extension-manager.admin.extensions.update_soft_label')), m(Button, {\n icon: \"fas fa-arrow-alt-circle-up\",\n className: \"Button\",\n onclick: onClickUpdate.hard,\n disabled: !updates['direct-dependency']\n }, app.translator.trans('flarum-extension-manager.admin.extensions.update_hard_label'))) : null, whyNotWarning ? 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 })) : null));\n }\n version(v) {\n return v.charAt(0) === 'v' ? v.substring(1) : v;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ExtensionItem', ExtensionItem);","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 ExtensionItem from './ExtensionItem';\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 // @todo move Form-group--danger class to core for reuse\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(ExtensionItem, {\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);","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 ExtensionItem from './ExtensionItem';\nimport ItemList from 'flarum/common/utils/ItemList';\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\"\n }, m(\"span\", {\n className: \"helpText\"\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(ExtensionItem, {\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(ExtensionItem, {\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-permissions ExtensionManager-controlSection\"\n }, m(\"div\", {\n className: \"ExtensionPage-permissions-header\"\n }, m(\"div\", {\n className: \"container\"\n }, m(\"h2\", {\n className: \"ExtensionTitle\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.control.title')))), 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);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/listItems');","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);","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 Alert from 'flarum/common/components/Alert';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ConfigureAuth from './ConfigureAuth';\nexport default class SettingsPage extends ExtensionPage {\n content() {\n const settings = app.registry.getSettings(this.extension.id);\n const warnings = [app.translator.trans('flarum-extension-manager.admin.settings.access_warning')];\n if (app.data.debugEnabled) warnings.push(app.translator.trans('flarum-extension-manager.admin.settings.debug_mode_warning'));\n return m(\"div\", {\n className: \"ExtensionPage-settings\"\n }, m(\"div\", {\n className: \"container\"\n }, m(\"div\", {\n className: \"ExtensionManager-warnings Form-group\"\n }, m(Alert, {\n className: \"ExtensionManager-primaryWarning\",\n type: \"warning\",\n dismissible: false\n }, m(\"ul\", null, listItems(warnings)))), settings ? 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.setPriority('content', 10);\n items.add('control', m(ControlSection, null), 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);","import Extend from 'flarum/common/extenders';\nimport app from 'flarum/admin/app';\nimport extractText from 'flarum/common/utils/extractText';\nimport SettingsPage from './components/SettingsPage';\nexport default [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 Task from './models/Task';\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.store.models['extension-manager-tasks'] = Task;\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","BYTE_UNITS","BIBYTE_UNITS","BIT_UNITS","BIBIT_UNITS","toLocaleString","number","options","result","Array","isArray","Task","status","operation","command","package","output","guessedCause","createdAt","startedAt","finishedAt","peakMemoryUsed","isFinite","TypeError","concat","UNITS","bits","binary","space","separator","signed","isNegative","prefix","localeOptions","minimumFractionDigits","maximumFractionDigits","exponent","min","log","log10","length","toPrecision","prettyBytes","jumpToQueue","close","route","set","id","queue","load","setTimeout","_document$getElementB","document","getElementById","scrollIntoView","block","_typeof","iterator","constructor","_defineProperty","toPrimitive","configurable","writable","window","QueueState","params","actionTaken","_params","tasks","page","limit","offset","find","then","data","_data$payload$meta","total","payload","meta","redraw","task","pollQueue","control","setLoading","location","reload","isLoading","getItems","getTotalPages","pageNumber","hasPrev","hasNext","prev","next","polling","clearTimeout","hasPending","_this$tasks","error","response","errors","includes","code","clear","guessed_cause","show","type","trans","ControlSectionState","lastUpdateRun","JSON","parse","settings","limitedPackages","major","minor","global","lastUpdateCheck","extensionUpdates","formatExtensionUpdates","coreUpdate","formatCoreUpdate","name","loading","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","version","icon","backgroundImage","resources","majorUpdate","_ref","dryRun","updateState","_e$response","incompatibleExtensions","incompatible_extensions","ExtensionManagerState","Label","view","vnode","className","attrs","assign","children","TaskOutputModal","content","humanDuration","start","end","dayjs","extend","durationTime","diff","Pagination","disabled","list","onclick","current","QueueSection","oninit","super","queueTable","columns","items","label","operationIcon","_task$package","style","running","failure","pending","success","size","display","text","toArray","item","index","update_check","update_major","update_minor","update_global","extension_install","extension_remove","extension_update","why_not","Installer","arguments","packageName","htmlFor","extiverse","semantic_link","placeholder","bidi","onsubmit","WhyNotModal","oncreate","requestWhyNot","whyNot","reason","ExtensionItem","_updates$latestMinor","onClickUpdate","whyNotWarning","isCore","isDanger","latestVersion","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","stringify","RepositoryModal","repository","context","types","composer","vcs","path","onchange","target","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","SettingsPage","getSettings","warnings","debugEnabled","sections","setPriority","remove","onsaved","trust","basic_impl_link","adv_impl_link","php_version","phpVersion","folder_perms_link","generalIndexItems","app","store","models","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,SAAS9B,GAAG,OAAO2B,KAAKI,IAAI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MAAM,6DAA8D,CAAC,GAAG,GAC9F4N,KAAM,eAAe5N,MAAM,4DAA6D,CAAC,GAAG,IAC3F,CACDlE,GAAI,gBACJoI,MAAO,eAAelE,MAAM,mDAAoD,CAAC,GAAG,IACnF,CACDlE,GAAI,UACJoI,MAAO,eAAelE,MAAM,uDAAwD,CAAC,GAAG,GACxF4N,KAAM,eAAe5N,MAAM,sDAAuD,CAAC,GAAG,QC5BxF,iBAAiB9G,IAAI,4BAA4Byb,IAC/CA,EAAIC,iBAAmB,IAAIzQ,EACvBwQ,EAAIjX,KAAK,+CACXiX,EAAIjX,KAAK4C,SAAS,uCAAyC,MAE7D,IAAA+E,QAAO,cAAyB,YAAY,SAAUS,GAC1B,6BAAtB7O,KAAKwK,UAAU3F,IAAqC,IAAmB7E,KAAKwK,UAAU3F,KAG1FgK,EAAM5M,IAAI,SAAU7C,EAAE,IAAQ,CAC5BkO,UAAW,wBACXnB,KAAM,eACNsC,QAAS,KACPiP,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 // @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 }\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","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","links","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 diff --git a/framework/core/js/dist-typings/admin/AdminApplication.d.ts b/framework/core/js/dist-typings/admin/AdminApplication.d.ts index b93023966..3d72b6ef9 100644 --- a/framework/core/js/dist-typings/admin/AdminApplication.d.ts +++ b/framework/core/js/dist-typings/admin/AdminApplication.d.ts @@ -5,13 +5,14 @@ import IHistory from '../common/IHistory'; import SearchManager from '../common/SearchManager'; import SearchState from '../common/states/SearchState'; import GeneralSearchIndex from './states/GeneralSearchIndex'; -export type Extension = { +export interface Extension { id: string; name: string; version: string; description?: string; icon?: { name: string; + [key: string]: string; }; links: { authors?: { @@ -33,7 +34,7 @@ export type Extension = { }; }; require?: Record; -}; +} export declare enum DatabaseDriver { MySQL = "MySQL", PostgreSQL = "PostgreSQL", diff --git a/framework/core/js/dist-typings/admin/components/UserListPage.d.ts b/framework/core/js/dist-typings/admin/components/UserListPage.d.ts index a7801c036..3ee183ea5 100644 --- a/framework/core/js/dist-typings/admin/components/UserListPage.d.ts +++ b/framework/core/js/dist-typings/admin/components/UserListPage.d.ts @@ -50,10 +50,6 @@ export default class UserListPage extends AdminPage { * `undefined` when page loads as no data has been fetched. */ private pageData; - /** - * Are there more users available? - */ - private moreData; private isLoadingPage; oninit(vnode: Mithril.Vnode): void; /** @@ -89,8 +85,6 @@ export default class UserListPage extends AdminPage { * @param pageNumber The **zero-based** page number to load and display */ loadPage(pageNumber: number): Promise; - nextPage(): void; - previousPage(): void; /** * @param page The **1-based** page number */ diff --git a/framework/core/js/dist-typings/common/Store.d.ts b/framework/core/js/dist-typings/common/Store.d.ts index 7f2db1543..8f9bfa372 100644 --- a/framework/core/js/dist-typings/common/Store.d.ts +++ b/framework/core/js/dist-typings/common/Store.d.ts @@ -1,6 +1,11 @@ import { FlarumRequestOptions } from './Application'; import Model, { ModelData, SavedModelData } from './Model'; export interface MetaInformation { + page?: { + limit?: number; + offset?: number; + total?: number; + }; [key: string]: any; } export interface ApiQueryParamsSingle { diff --git a/framework/core/js/dist-typings/common/common.d.ts b/framework/core/js/dist-typings/common/common.d.ts index ca92e210f..7c42d48a5 100644 --- a/framework/core/js/dist-typings/common/common.d.ts +++ b/framework/core/js/dist-typings/common/common.d.ts @@ -29,6 +29,7 @@ import './utils/patchMithril'; import './utils/classList'; import './utils/extractText'; import './utils/formatNumber'; +import './utils/formatAmount'; import './utils/mapRoutes'; import './utils/withAttr'; import './utils/focusTrap'; diff --git a/framework/core/js/dist-typings/common/components/Input.d.ts b/framework/core/js/dist-typings/common/components/Input.d.ts index e855f686b..509a92922 100644 --- a/framework/core/js/dist-typings/common/components/Input.d.ts +++ b/framework/core/js/dist-typings/common/components/Input.d.ts @@ -8,7 +8,6 @@ export interface IInputAttrs extends ComponentAttrs { clearable?: boolean; clearLabel?: string; loading?: boolean; - inputClassName?: string; onchange?: (value: string) => void; value?: string; stream?: Stream; diff --git a/framework/core/js/dist-typings/common/components/Pagination.d.ts b/framework/core/js/dist-typings/common/components/Pagination.d.ts new file mode 100644 index 000000000..5a338e389 --- /dev/null +++ b/framework/core/js/dist-typings/common/components/Pagination.d.ts @@ -0,0 +1,12 @@ +/// +import Component, { ComponentAttrs } from '../Component'; +export interface IPaginationInterface extends ComponentAttrs { + total: number; + perPage: number; + currentPage: number; + loadingPageNumber?: number; + onChange: (page: number) => void; +} +export default class Pagination extends Component { + view(): JSX.Element; +} diff --git a/framework/core/js/dist-typings/common/states/PaginatedListState.d.ts b/framework/core/js/dist-typings/common/states/PaginatedListState.d.ts index 5475238f7..045ef107c 100644 --- a/framework/core/js/dist-typings/common/states/PaginatedListState.d.ts +++ b/framework/core/js/dist-typings/common/states/PaginatedListState.d.ts @@ -34,11 +34,13 @@ export default abstract class PaginatedListState[]; protected params: P; protected initialLoading: boolean; protected loadingPrev: boolean; protected loadingNext: boolean; + protected loadingPage: boolean; protected constructor(params?: P, page?: number, pageSize?: number | null); abstract get type(): string; clear(): void; @@ -67,6 +69,7 @@ export default abstract class PaginatedListState; refresh(page?: number): Promise; + goto(page: number): Promise; getPages(): Page[]; getLocation(): PaginationLocation; isLoading(): boolean; @@ -106,4 +109,5 @@ export default abstract class PaginatedListState{var t,e,n={5710:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(8805);class s{constructor(){(0,r.A)(this,"element",void 0),(0,r.A)(this,"attrs",void 0),(0,r.A)(this,"state",void 0)}oninit(t){this.setAttrs(t.attrs)}oncreate(t){this.element=t.dom}onbeforeupdate(t){this.setAttrs(t.attrs)}onupdate(t){}onbeforeremove(t){}onremove(t){}$(t){const e=$(this.element);return t?e.find(t):e}static component(t,e){void 0===t&&(t={}),void 0===e&&(e=null);const n={...t};return m(this,n,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("[".concat(this.constructor.name,'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute'));if("tag"in t)throw new Error("[".concat(this.constructor.name,'] You cannot use the "tag" attribute name with Mithril 2.'))}this.attrs=t}static initAttrs(t){}}flarum.reg.add("core","common/Component",s)},5420:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(8805),s=n(5114);class i{constructor(t,e){void 0===t&&(t={}),void 0===e&&(e=s.A.store),(0,r.A)(this,"data",{}),(0,r.A)(this,"freshness",new Date),(0,r.A)(this,"exists",!1),(0,r.A)(this,"store",void 0),this.data=t,this.store=e}id(){return"id"in this.data?this.data.id:void 0}attribute(t){var e;return null==(e=this.data)||null==(e=e.attributes)?void 0:e[t]}pushData(t){if("id"in t&&(this.data.id=t.id),"type"in t&&(this.data.type=t.type),"attributes"in t){var e;(e=this.data).attributes||(e.attributes={});for(const e in t.attributes){const n=t.attributes[e];n&&n instanceof i&&delete t.attributes[e]}Object.assign(this.data.attributes,t.attributes)}if("relationships"in t){var n;const e=null!=(n=this.data.relationships)?n:{};for(const n in t.relationships){const r=t.relationships[n];if(null===r){delete e[n],delete t.relationships[n];continue}let s;s=r instanceof i?{data:i.getIdentifier(r)}:r instanceof Array?{data:r.map(i.getIdentifier)}:r,t.relationships[n]=s,e[n]=s}this.data.relationships=e}return this.freshness=new Date,this}pushAttributes(t){this.pushData({attributes:t})}save(t,e){void 0===e&&(e={});const n={type:this.data.type,attributes:t};if("id"in this.data&&(n.id=this.data.id),t.relationships){n.relationships={};for(const e in t.relationships){const r=t.relationships[e];null!==r&&(n.relationships[e]={data:r instanceof Array?r.map(i.getIdentifier):i.getIdentifier(r)})}delete t.relationships}const r=this.copyData();this.pushData(n);const a={data:n,meta:e.meta||void 0};return s.A.request({method:this.exists?"PATCH":"POST",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:a,...e}).then((t=>this.store.pushPayload(t)),(t=>{throw this.pushData(r),m.redraw(),t}))}delete(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.exists?s.A.request({method:"DELETE",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:t,...e}).then((()=>{this.exists=!1,this.store.remove(this)})):Promise.resolve()}apiEndpoint(){return"/"+this.data.type+("id"in this.data?"/"+this.data.id:"")}copyData(){return JSON.parse(JSON.stringify(this.data))}rawRelationship(t){var e;return null==(e=this.data.relationships)||null==(e=e[t])?void 0:e.data}static attribute(t,e){return function(){return e?e(this.attribute(t)):this.attribute(t)}}static hasOne(t){return function(){var e;const n=null==(e=this.data.relationships)||null==(e=e[t])?void 0:e.data;if(n&&n instanceof Array)throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is plural, so the hasOne method cannot be used to access it."));return!!n&&this.store.getById(n.type,n.id)}}static hasMany(t){return function(){var e;const n=null==(e=this.data.relationships)||null==(e=e[t])?void 0:e.data;if(n&&!(n instanceof Array))throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is singular, so the hasMany method cannot be used to access it."));return!!n&&n.map((t=>this.store.getById(t.type,t.id)))}}static transformDate(t){return null!=t?new Date(t):t}static getIdentifier(t){return t&&t.data&&"id"in t.data?{type:t.data.type,id:t.data.id}:null}}flarum.reg.add("core","common/Model",i)},3920:(t,e,n)=>{"use strict";n.d(e,{A:()=>p});var r=n(8805),s=n(5114),i=n(8631);class a extends i.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.author.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.author.hint",{},!0)}filterKey(){return"author"}}flarum.reg.add("core","common/query/discussions/AuthorGambit",a);class o extends i.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.created.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.created.hint",{},!0)}valuePattern(){return"(\\d{4}\\-\\d\\d\\-\\d\\d(?:\\.\\.(\\d{4}\\-\\d\\d\\-\\d\\d))?)"}filterKey(){return"created"}}flarum.reg.add("core","common/query/discussions/CreatedGambit",o);class l extends i.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.hidden.key",{},!0)}filterKey(){return"hidden"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/HiddenGambit",l);class c extends i.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.unread.key",{},!0)}filterKey(){return"unread"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/UnreadGambit",c);class u extends i.px{key(){return s.A.translator.trans("core.lib.gambits.users.email.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.email.hint",{},!0)}filterKey(){return"email"}enabled(){return!(!s.A.session.user||!s.A.forum.attribute("canEditUserCredentials"))}}flarum.reg.add("core","common/query/users/EmailGambit",u);class d extends i.px{key(){return s.A.translator.trans("core.lib.gambits.users.group.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.group.hint",{},!0)}filterKey(){return"group"}}flarum.reg.add("core","common/query/users/GroupGambit",d);class h extends i.px{key(){return s.A.translator.trans("core.lib.gambits.posts.discussion.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.posts.discussion.hint",{},!0)}filterKey(){return"discussion"}}flarum.reg.add("core","common/query/discussions/DiscussionGambit",h);class m{constructor(){(0,r.A)(this,"gambits",{discussions:[a,o,l,c],posts:[a,h],users:[u,d]})}apply(t,e){return e.q=this.match(t,e.q,((t,n,r)=>{const s=t.toFilter(n,r);Object.keys(s).forEach((n=>{n in e&&t.predicates&&Array.isArray(s[n])?e[n]=e[n].concat(s[n]):e[n]=s[n]}))})),e}match(t,e,n){const r=this.for(t).filter((t=>t.enabled()));if(0===r.length)return e;const s=e.split(" ");for(const t of r)for(const r of s){const s=new RegExp("^(-?)".concat(t.pattern(),"$"),"i");let i=r.match(s);if(i){const s="-"===i[1];i.splice(1,1),n(t,i,s,r),e=e.replace(r,"")}}return e.trim().replace(/\s+/g," ")}from(t,e,n){const r=this.for(t);return 0===r.length||Object.keys(n).forEach((t=>{for(const s of r){const r="-"===t[0];r&&(t=t.substring(1)),s.filterKey()===t&&(e+=" ".concat(s.fromFilter(n[t],r)))}})),e}for(t){return(this.gambits[t]||[]).map((t=>new t))}}flarum.reg.add("core","common/GambitManager",m);class p{constructor(t){(0,r.A)(this,"state",void 0),(0,r.A)(this,"gambits",new m),this.state=t}}(0,r.A)(p,"MIN_SEARCH_LEN",3),flarum.reg.add("core","common/SearchManager",p)},5114:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});const r=window,s=new Proxy({},{get:(t,e)=>Reflect.get(r.app,e,r.app),set:(t,e,n)=>Reflect.set(r.app,e,n,r.app)}),i=s;flarum.reg.add("core","common/app",s)},9924:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(5710),s=n(7880),i=n(5673),a=n(4586),o=n(4268),l=n(5114),c=n(7479);class u extends r.A{view(t){const e=Object.assign({},this.attrs),n=(0,a.A)(e,"type");e.className=(0,o.A)("Alert","Alert--".concat(n),e.className);const r=(0,a.A)(e,"title"),u=(0,a.A)(e,"icon"),d=(0,a.A)(e,"content")||t.children,h=(0,a.A)(e,"controls")||[],p=(0,a.A)(e,"dismissible"),f=(0,a.A)(e,"ondismiss"),g=[];return(p||void 0===p)&&g.push(m(s.A,{"aria-label":l.A.translator.trans("core.lib.alert.dismiss_a11y_label"),icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:f})),m("div",e,m("div",{className:(0,o.A)("Alert-container",e.containerClassName)},!!r&&m("div",{className:"Alert-title"},!!u&&m("span",{className:"Alert-title-icon"},m(c.A,{name:u})),m("span",{className:"Alert-title-text"},r)),m("span",{className:"Alert-body"},d),m("ul",{className:"Alert-controls"},(0,i.A)(h.concat(g)))))}}flarum.reg.add("core","common/components/Alert",u)},367:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=n(4391),s=n(5710),i=n(4268),a=n(3288),o=n(7479);class l extends s.A{view(){const{type:t,icon:e,label:n,color:s,style:l={},...c}=this.attrs,u=(0,i.A)("Badge",[t&&"Badge--".concat(t)],c.className,(0,a.A)(s)),d=e?m(o.A,{name:e,className:"Badge-icon"}):m.trust(" "),h={...l};window.testing||(h["--badge-bg"]=s);const p={...c,className:u,style:h},f=m("div",p,d);return n?m(r.A,{text:n},f):f}}flarum.reg.add("core","common/components/Badge",l)},7880:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(5710),s=n(5114);function i(){s.A.forum.attribute("debug")&&console.warn(...arguments)}flarum.reg.add("core","common/helpers/fireDebugWarning",i);var a=n(4268),o=n(117),l=n(43),c=n(7479);class u extends r.A{view(t){let{type:e,"aria-label":n,icon:r,disabled:s,loading:i,className:l,class:c,...u}=this.attrs;e||(e="button"),"object"==typeof n&&(n=(0,o.A)(n)),(s||i)&&delete u.onclick,l=(0,a.A)(c,l,{hasIcon:r,disabled:s||i,loading:i});const d={disabled:s,className:l,type:e,"aria-label":n,...u};return m("button",d,this.getButtonContent(t.children))}oncreate(t){var e,n;super.oncreate(t);const{"aria-label":r}=this.attrs;this.view!==u.prototype.view||r||(0,o.A)(t.children)||null!=(e=this.element)&&null!=(n=e.getAttribute)&&n.call(e,"aria-label")||i('[Flarum Accessibility Warning] Button has no content and no accessible label. This means that screen-readers will not be able to interpret its meaning and just read "Button". Consider providing accessible text via the `aria-label` attribute. https://web.dev/button-name',this.element)}getButtonContent(t){const e=this.attrs.icon;return[e&&m(c.A,{name:e,className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(l.A,{size:"small",display:"inline"})]}}flarum.reg.add("core","common/components/Button",u)},374:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(5710),s=n(4268);class i extends r.A{view(t){const{label:e,description:n,className:r,...i}=t.attrs;return m("div",Object.assign({className:(0,s.A)("Form",r)},i),(e||n)&&m("div",{className:"Form-header"},e&&m("label",null,e),n&&m("p",{className:"helpText"},n)),m("div",{className:"Form-body"},t.children))}}flarum.reg.add("core","common/components/Form",i)},2855:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(2849);class s extends r.A{wrapper(t){return m("form",{onsubmit:this.onsubmit.bind(this)},t)}onsubmit(t){}onready(){this.$().find("input, select, textarea").first().trigger("focus").trigger("select")}onerror(t){var e;this.alertAttrs=t.alert,m.redraw(),422===t.status&&null!=(e=t.response)&&e.errors?this.$("form [name="+t.response.errors[0].source.pointer.replace("/data/attributes/","")+"]").trigger("select"):this.onready()}}flarum.reg.add("core","common/components/FormModal",s)},3550:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(367);class s extends r.A{static initAttrs(t){super.initAttrs(t),t.group&&(t.icon=t.group.icon()||"",t.color=t.group.color()||"",t.label=void 0===t.label?t.group.nameSingular():t.label,t.type="group--"+t.group.id(),delete t.group)}}flarum.reg.add("core","common/components/GroupBadge",s)},7479:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(4268),s=n(5710);class i extends s.A{view(t){const{name:e,...n}=t.attrs;return n.className=(0,r.A)("icon",e,n.className),m("i",Object.assign({"aria-hidden":"true"},n))}}flarum.reg.add("core","common/components/Icon",i)},4164:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(5710),s=n(7479),i=n(4268);class a extends r.A{view(t){const{icon:e,className:n,...r}=t.attrs;return m("div",Object.assign({className:(0,i.A)("InfoTile",n)},r),this.icon(),m("div",{className:"InfoTile-text"},t.children))}icon(){return this.attrs.iconElement?this.attrs.iconElement:this.attrs.icon?m(s.A,{name:(0,i.A)(this.attrs.icon,"InfoTile-icon")}):null}}flarum.reg.add("core","common/components/InfoTile",a)},7882:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(5114),s=n(5710),i=n(7479),a=n(43),o=n(4268),l=n(7880);class c extends s.A{oninit(t){super.oninit(t)}view(t){var e,n;const{className:s,...c}=this.attrs.inputAttrs||{},u=this.attrs.value||(null==(e=(n=this.attrs).stream)?void 0:e.call(n))||"";return m("div",{className:(0,o.A)("Input",this.attrs.className,{"Input--withPrefix":this.attrs.prefixIcon,"Input--withClear":this.attrs.clearable})},this.attrs.prefixIcon&&m(i.A,{name:(0,o.A)(this.attrs.prefixIcon,"Input-prefix-icon")}),this.input({inputClassName:s,value:u,inputAttrs:c}),this.attrs.loading&&m(a.A,{size:"small",display:"inline",containerClassName:"Button Button--icon Button--link"}),this.attrs.clearable&&u&&!this.attrs.loading&&m(l.A,{className:"Input-clear Button Button--icon Button--link",onclick:this.clear.bind(this),"aria-label":this.attrs.clearLabel||r.A.translator.trans("core.lib.input.clear_button"),type:"button",icon:"fas fa-times-circle"}))}input(t){let{inputClassName:e,value:n,inputAttrs:r}=t;const s={className:(0,o.A)("FormControl",e),type:this.attrs.type||"text",value:n,oninput:t=>{var e;return null==(e=this.onchange)?void 0:e.call(this,t.target.value)},"aria-label":this.attrs.ariaLabel,placeholder:this.attrs.placeholder,readonly:this.attrs.readonly||void 0,disabled:this.attrs.disabled||void 0,...r};return this.attrs.renderInput?this.attrs.renderInput(s):m("input",s)}onchange(t){var e,n;this.attrs.stream?this.attrs.stream(t):null==(e=(n=this.attrs).onchange)||e.call(n,t)}clear(){this.onchange("")}}flarum.reg.add("core","common/components/Input",c)},43:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(5114),s=n(5710),i=n(4268);class a extends s.A{view(){const{display:t="block",size:e="medium",containerClassName:n,className:s,...a}=this.attrs,o=(0,i.A)("LoadingIndicator",s),l=(0,i.A)("LoadingIndicator-container","unset"!==t&&"LoadingIndicator-container--".concat(t),e&&"LoadingIndicator-container--".concat(e),n);return m("div",Object.assign({"aria-label":r.A.translator.trans("core.lib.loading_indicator.accessible_label"),role:"status"},a.containerAttrs,{"data-size":e,className:l}),m("div",Object.assign({"aria-hidden":"true",className:o},a)))}}flarum.reg.add("core","common/components/LoadingIndicator",a)},2849:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(8805),s=n(5114),i=n(5710),a=n(9924),o=n(7880),l=n(4268);class c extends i.A{constructor(){super(...arguments),(0,r.A)(this,"loading",!1),(0,r.A)(this,"alertAttrs",null)}static get dismissibleOptions(){return{viaCloseButton:this.isDismissibleViaCloseButton,viaEscKey:this.isDismissibleViaEscKey,viaBackdropClick:this.isDismissibleViaBackdropClick}}oncreate(t){super.oncreate(t),this.attrs.animateShow((()=>this.onready()))}onbeforeremove(t){if(super.onbeforeremove(t),!this.attrs.state.modal)return new Promise((t=>setTimeout(t,300)))}view(){return this.alertAttrs&&(this.alertAttrs.dismissible=!1),m("div",{className:(0,l.A)("Modal modal-dialog fade",this.className())},m("div",{className:"Modal-content"},this.dismissibleOptions.viaCloseButton&&m("div",{className:"Modal-close App-backControl"},m(o.A,{icon:"fas fa-times",onclick:()=>this.hide(),className:"Button Button--icon Button--link","aria-label":s.A.translator.trans("core.lib.modal.close")})),this.wrapper(this.inner())))}wrapper(t){return m("[",null,t)}inner(){return m("[",null,m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},this.title())),!!this.alertAttrs&&m("div",{className:"Modal-alert"},m(a.A,this.alertAttrs)),this.content())}onready(){}hide(){this.attrs.animateHide()}loaded(){this.loading=!1,m.redraw()}get dismissibleOptions(){return this.constructor.dismissibleOptions}}(0,r.A)(c,"isDismissibleViaCloseButton",!0),(0,r.A)(c,"isDismissibleViaEscKey",!0),(0,r.A)(c,"isDismissibleViaBackdropClick",!0),flarum.reg.add("core","common/components/Modal",c)},4391:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(8805),s=n(5710),i=n(4268),a=n(117);class o extends s.A{constructor(){super(...arguments),(0,r.A)(this,"firstChild",null),(0,r.A)(this,"childDomNode",null),(0,r.A)(this,"oldText",""),(0,r.A)(this,"oldVisibility",void 0),(0,r.A)(this,"shouldRecreateTooltip",!1),(0,r.A)(this,"shouldChangeTooltipVisibility",!1)}view(t){const e=t.children,{text:n,tooltipVisible:r,showOnFocus:s=!0,position:i="top",ignoreTitleWarning:a=!1,html:o=!1,delay:l=0,...c}=this.attrs;this.attrs.title&&!a&&console.warn("`title` attribute was passed to Tooltip component. Was this intentional? Tooltip content should be passed to the `text` attr instead.");const u=this.getRealText();if(u!==this.oldText&&(this.oldText=u,this.shouldRecreateTooltip=!0),r!==this.oldVisibility&&(this.oldVisibility=this.attrs.tooltipVisible,this.shouldChangeTooltipVisibility=!0),void 0===e)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if(1!==e.length)throw new Error("Tooltip component was either passed more than one or no child node.\n\nPlease wrap multiple children in another element, such as a
or .");const d=e[0];if("object"!=typeof d||Array.isArray(d)||null===d)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if("string"==typeof d.tag&&["#","[","<"].includes(d.tag))throw new Error('Tooltip component with provided with a vnode with tag "'.concat(d.tag,'". This is not a DOM element, so is not a valid child element. Please wrap this vnode in another element, such as a
or .'));return this.firstChild=d,e}oncreate(t){super.oncreate(t),this.checkDomNodeChanged(),this.recreateTooltip()}onupdate(t){super.onupdate(t),this.checkDomNodeChanged(),this.recreateTooltip()}recreateTooltip(){this.shouldRecreateTooltip&&null!==this.childDomNode&&($(this.childDomNode).tooltip("destroy","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"),this.createTooltip(),this.shouldRecreateTooltip=!1),this.shouldChangeTooltipVisibility&&(this.shouldChangeTooltipVisibility=!1,this.updateVisibility())}updateVisibility(){null!==this.childDomNode&&(!0===this.attrs.tooltipVisible?$(this.childDomNode).tooltip("show","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"):!1===this.attrs.tooltipVisible&&$(this.childDomNode).tooltip("hide","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"))}createTooltip(){if(null===this.childDomNode)return;const{showOnFocus:t=!0,position:e="top",delay:n,html:r=!1,tooltipVisible:s,text:a}=this.attrs,o="boolean"==typeof s?"manual":(0,i.A)("hover",[t&&"focus"]),l=this.getRealText();this.childDomNode.setAttribute("title",l),this.childDomNode.setAttribute("aria-label",l),$(this.childDomNode).tooltip({html:r,delay:n,placement:e,trigger:o},"DANGEROUS_tooltip_jquery_fn_deprecation_exempt")}getRealText(){const{text:t}=this.attrs;return Array.isArray(t)?(0,a.A)(t):t}checkDomNodeChanged(){const t=this.firstChild.dom;t&&!t.isSameNode(this.childDomNode)&&(this.childDomNode=t,this.shouldRecreateTooltip=!0)}}flarum.reg.add("core","common/components/Tooltip",o)},5673:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(646),s=n(4268);function i(t){return"object"==typeof t&&null!==t&&"tag"in t}function a(t){return i(t)&&t.tag===r.A}function o(t,e,n){void 0===e&&(e="li"),void 0===n&&(n={});const r=e;return function(t){const e=[];let n;return t.filter(Boolean).forEach(((r,s)=>{(!a(r)||n&&!a(n)&&s!==t.length-1)&&(n=r,e.push(r))})),e}(t instanceof Array?t:[t]).map((t=>{var e;const a=[t.itemName&&"item-".concat(t.itemName)];if(i(t)&&t.tag.isListItem)return t.attrs=t.attrs||{},t.attrs.key=t.attrs.key||t.itemName,t.key=t.attrs.key,t;var o,l,c;i(t)&&(a.push((null==(o=t.attrs)?void 0:o.itemClassName)||t.itemClassName),null!=(l=(c=t.tag).isActive)&&l.call(c,t.attrs)&&a.push("active"));const u=i(t)&&(null==t||null==(e=t.attrs)?void 0:e.key)||t.itemName;return m(r,Object.assign({className:(0,s.A)(a),key:u},n),t)}))}flarum.reg.add("core","common/helpers/listItems",o)},3288:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(2967);function s(t){return t?(0,r.A)(t)?"text-contrast--light":"text-contrast--dark":"text-contrast--unchanged"}flarum.reg.add("core","common/helpers/textContrastClass",s)},4583:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(8805),s=n(5420);class i extends s.A{nameSingular(){return s.A.attribute("nameSingular").call(this)}namePlural(){return s.A.attribute("namePlural").call(this)}color(){return s.A.attribute("color").call(this)}icon(){return s.A.attribute("icon").call(this)}isHidden(){return s.A.attribute("isHidden").call(this)}}(0,r.A)(i,"ADMINISTRATOR_ID","1"),(0,r.A)(i,"GUEST_ID","2"),(0,r.A)(i,"MEMBER_ID","3"),flarum.reg.add("core","common/models/Group",i)},8631:(t,e,n)=>{"use strict";n.d(e,{$Q:()=>i,pm:()=>a,px:()=>o});var r=n(8805),s=n(5114);let i=function(t){return t.KeyValue="key:value",t.Grouped="grouped",t}({});class a{constructor(){(0,r.A)(this,"type",i.Grouped),(0,r.A)(this,"predicates",!1)}pattern(){const t=s.A.translator.trans("core.lib.gambits.boolean_key",{},!0);let e=this.key();return Array.isArray(e)&&(e=e.join("|")),"".concat(t,":(").concat(e,")")}toFilter(t,e){const n=(e?"-":"")+this.filterKey();return{[n]:!0}}fromFilter(t,e){const n=s.A.translator.trans("core.lib.gambits.boolean_key",{},!0),r=this.key();return"".concat(e?"-":"").concat(n,":").concat(r)}suggestion(){return{group:s.A.translator.trans("core.lib.gambits.boolean_key",{},!0),key:this.key()}}enabled(){return!0}}class o{constructor(){(0,r.A)(this,"type",i.KeyValue),(0,r.A)(this,"predicates",!1)}valuePattern(){return"(.+)"}gambitValueToFilterValue(t){return t}filterValueToGambitValue(t){return Array.isArray(t)?t.join(","):t.toString()}pattern(){const t=this.key();return"".concat(t,":")+this.valuePattern()}toFilter(t,e){const n=(e?"-":"")+this.filterKey();return{[n]:this.gambitValueToFilterValue(t[1])}}fromFilter(t,e){return"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}suggestion(){return{key:this.key(),hint:this.hint()}}enabled(){return!0}}flarum.reg.add("core","common/query/IGambit",{GambitType:i,BooleanGambit:a,KeyValueGambit:o})},5992:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(8805);class s{constructor(t){(0,r.A)(this,"symbol",void 0),(0,r.A)(this,"relativeStart",0),(0,r.A)(this,"absoluteStart",0),this.symbol=t}check(t,e,n){void 0===n&&(n=null),this.absoluteStart=0;for(let s=t.length-1;s>=0;s--){var r;const i=t.substr(s,1);if(n&&(null==(r=n)||!r.test(i)))return null;if(this.symbol){const t="string"==typeof this.symbol?t=>t===this.symbol:this.symbol;if(!t(i))continue}if(0===s||/\s/.test(t.substr(s-1,1)))return this.relativeStart=s+(this.symbol?1:0),this.absoluteStart=e-t.length+s+(this.symbol?1:0),{symbol:this.symbol&&i,relativeStart:this.relativeStart,absoluteStart:this.absoluteStart,typed:t.substring(this.relativeStart).toLowerCase()}}return null}}flarum.reg.add("core","common/utils/AutocompleteReader",s)},6500:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=n(8805),s=n(5114),i=n(8631),a=n(5992),o=n(7880);class l{constructor(t,e,n,s){this.resource=t,this.jqueryInput=e,this.onchange=n,this.afterSuggest=s,(0,r.A)(this,"query","")}suggestions(t){const e=s.A.search.gambits.for(this.resource).filter((t=>t.enabled()));this.query=t;const n=e.filter((t=>t.type===i.$Q.Grouped)),r=e.filter((t=>t.type!==i.$Q.Grouped)),o=[];for(const t of n)o.includes(t.suggestion().group)||o.push(t.suggestion().group);const l=[];for(const t of o)l.push({type:i.$Q.Grouped,suggestion:()=>({group:t,key:n.filter((e=>e.suggestion().group===t)).map((t=>{const e=t.suggestion().key;return e instanceof Array?e.join(", "):e})).join(", ")}),pattern:()=>"",filterKey:()=>"",toFilter:()=>[],fromFilter:()=>"",predicates:!1,enabled:()=>!0});const c=new a.A(null),u=this.jqueryInput().prop("selectionStart")||t.length,d=t.slice(0,u),h=c.check(d,u,/\S+$/);let m=(null==h?void 0:h.typed)||"";const p=m.startsWith("-");if(p&&(m=m.slice(1)),m.endsWith(":")){const t=m.replace(/:$/,"")||null,e=m.split(":").pop()||"";if(t){const r=this.specificGambitSuggestions(t,e,o,n,h);if(r)return r}}return[...l,...r].filter((t=>!h||new RegExp(m).test(t.type===i.$Q.Grouped?t.suggestion().group:t.suggestion().key))).map((t=>{const e=t.suggestion(),n=t.type===i.$Q.Grouped?e.group:e.key,r=t.type===i.$Q.Grouped?e.key:e.hint;return this.gambitSuggestion(n,r,(t=>{var e;return this.suggest((t?"-":"")+n+":",m||"",(null!=(e=null==h?void 0:h.relativeStart)?e:u)+Number(p))}))}))}specificGambitSuggestions(t,e,n,r,s){return n.includes(t)?r.filter((e=>e.suggestion().group===t)).flatMap((t=>t.suggestion().key instanceof Array?t.suggestion().key:[t.suggestion().key])).filter((t=>!e||t.toLowerCase().startsWith(e))).map((t=>this.gambitSuggestion(t,null,(()=>this.suggest(t,e,s.relativeStart+s.typed.length))))):null}gambitSuggestion(t,e,n){return m("li",null,m("span",{className:"Dropdown-item GambitsAutocomplete-gambit"},m("button",{type:"button",className:"Button--ua-reset",onclick:()=>n()},m("span",{className:"GambitsAutocomplete-gambit-key"},t,!!e&&":"),!!e&&m("span",{className:"GambitsAutocomplete-gambit-value"},e)),!!e&&m("span",{className:"GambitsAutocomplete-gambit-actions"},m(o.A,{class:"Button Button--icon",onclick:()=>n(),icon:"fas fa-plus","aria-label":s.A.translator.trans("core.forum.search.gambit_plus_button_a11y_label")}),m(o.A,{class:"Button Button--icon",onclick:()=>n(!0),icon:"fas fa-minus","aria-label":s.A.translator.trans("core.forum.search.gambit_minus_button_a11y_label")}))))}suggest(t,e,n){const r=this.jqueryInput(),s=this.query,i=s.slice(0,n)+t+s.slice(n+e.length);this.onchange(i),r[0].focus(),setTimeout((()=>{r[0].setSelectionRange(n+t.length,n+t.length),m.redraw()}),50),this.afterSuggest(i)}}flarum.reg.add("core","common/utils/GambitsAutocomplete",l)},6064:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(8805),s=n(9648);class i{constructor(t,e){(0,r.A)(this,"content",void 0),(0,r.A)(this,"priority",void 0),this.content=t,this.priority=e}}class a{constructor(){(0,r.A)(this,"_items",{})}isEmpty(){return 0===Object.keys(this._items).length}has(t){return Object.keys(this._items).includes(t)}get(t){return this._items[t].content}getPriority(t){return this._items[t].priority}add(t,e,n){return void 0===n&&(n=0),this._items[t]=new i(e,n),this}setContent(t,e){if(!this.has(t))throw new Error("[ItemList] Cannot set content of Item. Key `".concat(t,"` is not present."));return null!==e&&(this._items[t].content=e),this}setPriority(t,e){if(!this.has(t))throw new Error("[ItemList] Cannot set priority of Item. Key `".concat(t,"` is not present."));return this._items[t].priority=e,this}remove(t){return delete this._items[t],this}merge(t){return Object.keys(t._items).forEach((e=>{const n=t._items[e];n instanceof i&&(this._items[e]=n)})),this}toArray(t){return void 0===t&&(t=!1),Object.keys(this._items).map(((e,n)=>{const r=this._items[e];return!t||(0,s.A)(r.content)?{...r,content:this.createItemContentProxy((0,s.A)(r.content)?r.content:Object(r.content),e)}:{...r}})).sort(((t,e)=>e.priority-t.priority)).map((t=>t.content))}toObject(){return Object.keys(this._items).reduce(((t,e)=>{const n={content:this.get(e),itemName:e,priority:this.getPriority(e)};return t[e]=n,t}),{})}createItemContentProxy(t,e){return new Proxy(t,{get:(t,n,r)=>"itemName"===n?e:Reflect.get(t,n,r),set(t,n,r,s){if(null!==e&&"itemName"===n)throw new Error("`itemName` property is read-only");return Reflect.set(t,n,r,s)}})}}flarum.reg.add("core","common/utils/ItemList",a)},6732:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(8805),s=function(t){return t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowDown=40]="ArrowDown",t[t.ArrowLeft=37]="ArrowLeft",t[t.ArrowRight=39]="ArrowRight",t[t.Tab=9]="Tab",t[t.Backspace=8]="Backspace",t}(s||{});class i{constructor(){(0,r.A)(this,"callbacks",new Map),(0,r.A)(this,"whenCallback",(t=>!0))}onUp(t){return this.onDirection(t,s.ArrowUp)}onDown(t){return this.onDirection(t,s.ArrowDown)}onLeft(t){return this.onDirection(t,s.ArrowLeft)}onRight(t){return this.onDirection(t,s.ArrowRight)}onDirection(t,e){return this.callbacks.set(e,(e=>{e.preventDefault(),t(e)})),this}onSelect(t,e){void 0===e&&(e=!1);const n=e=>{e.preventDefault(),t(e)};return e||this.callbacks.set(s.Tab,n),this.callbacks.set(s.Enter,n),this}onTab(t){return this.callbacks.set(9,(e=>{e.preventDefault(),t(e)})),this}onCancel(t){return this.callbacks.set(s.Escape,(e=>{e.stopPropagation(),e.preventDefault(),t(e)})),this}onRemove(t){return this.callbacks.set(s.Backspace,(e=>{e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&0===e.target.selectionStart&&0===e.target.selectionEnd&&(t(e),e.preventDefault())})),this}when(t){return this.whenCallback=t,this}bindTo(t){t[0].addEventListener("keydown",this.navigate.bind(this))}navigate(t){if(!this.whenCallback(t))return;const e=this.callbacks.get(t.which);e&&e(t)}}flarum.reg.add("core","common/utils/KeyboardNavigatable",i)},4311:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(5263),s=n.n(r);const i=s();flarum.reg.add("core","common/utils/Stream",s())},2202:()=>{Array.prototype.flat||(Array.prototype.flat=function t(e){return(null!=e?e:1)>0?Array.prototype.reduce.call(this,((n,r)=>n.concat(Array.isArray(r)?t.call(r,e-1):r)),[]):[...this]})},4268:(t,e,n)=>{"use strict";function r(t){var e,n,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;ei});const s=function(){for(var t,e,n=0,s="";n{"use strict";function r(t,e){const n=t[e];return delete t[e],n}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/extract",r)},117:(t,e,n)=>{"use strict";function r(t){return t instanceof Array?t.map((t=>r(t))).join(""):"object"==typeof t&&null!==t?r(t.children):String(t)}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/extractText",r)},2967:(t,e,n)=>{"use strict";function r(t){if(!t||t.length<4)return!1;let e=t.replace("#","");return 3===e.length&&(e=e.split("").map((t=>t.repeat(2))).join("")),(299*parseInt(e.slice(0,2),16)+587*parseInt(e.slice(2,4),16)+114*parseInt(e.slice(4,6),16))/1e3<(parseInt(getComputedStyle(document.body).getPropertyValue("--yiq-threshold").trim())||128)}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/isDark",r)},9648:(t,e,n)=>{"use strict";function r(t){const e=typeof t;return"function"===e||"object"===e&&!!t}n.d(e,{A:()=>r}),flarum.reg.add("core","common/utils/isObject",r)},1592:()=>{!function(t){"use strict";var e=function(n,r){this.options=t.extend({},e.DEFAULTS,r);var s=this.options.target===e.DEFAULTS.target?t(this.options.target):t(document).find(this.options.target);this.$target=s.on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(n),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function n(n){return this.each((function(){var r=t(this),s=r.data("bs.affix"),i="object"==typeof n&&n;s||r.data("bs.affix",s=new e(this,i)),"string"==typeof n&&s[n]()}))}e.VERSION="3.4.1",e.RESET="affix affix-top affix-bottom",e.DEFAULTS={offset:0,target:window},e.prototype.getState=function(t,e,n,r){var s=this.$target.scrollTop(),i=this.$element.offset(),a=this.$target.height();if(null!=n&&"top"==this.affixed)return s=t-r&&"bottom"},e.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(e.RESET).addClass("affix");var t=this.$target.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-t},e.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},e.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=this.$element.height(),r=this.options.offset,s=r.top,i=r.bottom,a=Math.max(t(document).height(),t(document.body).height());"object"!=typeof r&&(i=s=r),"function"==typeof s&&(s=r.top(this.$element)),"function"==typeof i&&(i=r.bottom(this.$element));var o=this.getState(a,n,s,i);if(this.affixed!=o){null!=this.unpin&&this.$element.css("top","");var l="affix"+(o?"-"+o:""),c=t.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=o,this.unpin="bottom"==o?this.getPinnedOffset():null,this.$element.removeClass(e.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==o&&this.$element.offset({top:a-n-i})}};var r=t.fn.affix;t.fn.affix=n,t.fn.affix.Constructor=e,t.fn.affix.noConflict=function(){return t.fn.affix=r,this},t(window).on("load",(function(){t('[data-spy="affix"]').each((function(){var e=t(this),r=e.data();r.offset=r.offset||{},null!=r.offsetBottom&&(r.offset.bottom=r.offsetBottom),null!=r.offsetTop&&(r.offset.top=r.offsetTop),n.call(e,r)}))}))}(jQuery)},5941:()=>{!function(t){"use strict";var e='[data-toggle="dropdown"]',n=function(e){t(e).on("click.bs.dropdown",this.toggle)};function r(e){var n=e.attr("data-target");n||(n=(n=e.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r="#"!==n?t(document).find(n):null;return r&&r.length?r:e.parent()}function s(n){n&&3===n.which||(t(".dropdown-backdrop").remove(),t(e).each((function(){var e=t(this),s=r(e),i={relatedTarget:this};s.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&t.contains(s[0],n.target)||(s.trigger(n=t.Event("hide.bs.dropdown",i)),n.isDefaultPrevented()||(e.attr("aria-expanded","false"),s.removeClass("open").trigger(t.Event("hidden.bs.dropdown",i)))))})))}n.VERSION="3.4.1",n.prototype.toggle=function(e){var n=t(this);if(!n.is(".disabled, :disabled")){var i=r(n),a=i.hasClass("open");if(s(),!a){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",s);var o={relatedTarget:this};if(i.trigger(e=t.Event("show.bs.dropdown",o)),e.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),i.toggleClass("open").trigger(t.Event("shown.bs.dropdown",o))}return!1}},n.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var s=t(this);if(n.preventDefault(),n.stopPropagation(),!s.is(".disabled, :disabled")){var i=r(s),a=i.hasClass("open");if(!a&&27!=n.which||a&&27==n.which)return 27==n.which&&i.find(e).trigger("focus"),s.trigger("click");var o=i.find(".dropdown-menu li:not(.disabled):visible a");if(o.length){var l=o.index(n.target);38==n.which&&l>0&&l--,40==n.which&&l{!function(t){"use strict";var e=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,s=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function i(e,i){var a=e.nodeName.toLowerCase();if(-1!==t.inArray(a,i))return-1===t.inArray(a,n)||Boolean(e.nodeValue.match(r)||e.nodeValue.match(s));for(var o=t(i).filter((function(t,e){return e instanceof RegExp})),l=0,c=o.length;l
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}},o.prototype.init=function(e,n,r){if(this.enabled=!0,this.type=e,this.$element=t(n),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&t(document).find(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var s=this.options.trigger.split(" "),i=s.length;i--;){var a=s[i];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var o="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},o.prototype.getDefaults=function(){return o.DEFAULTS},o.prototype.getOptions=function(n){var r=this.$element.data();for(var s in r)r.hasOwnProperty(s)&&-1!==t.inArray(s,e)&&delete r[s];return(n=t.extend({},this.getDefaults(),r,n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.sanitize&&(n.template=a(n.template,n.whiteList,n.sanitizeFn)),n},o.prototype.getDelegateOptions=function(){var e={},n=this.getDefaults();return this._options&&t.each(this._options,(function(t,r){n[t]!=r&&(e[t]=r)})),e},o.prototype.enter=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusin"==e.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState)n.hoverState="in";else{if(clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout((function(){"in"==n.hoverState&&n.show()}),n.options.delay.show)}},o.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},o.prototype.leave=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusout"==e.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout((function(){"out"==n.hoverState&&n.hide()}),n.options.delay.hide)}},o.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var n=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!n)return;var r=this,s=this.tip(),i=this.getUID(this.type);this.setContent(),s.attr("id",i),this.$element.attr("aria-describedby",i),this.options.animation&&s.addClass("fade");var a="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,c=l.test(a);c&&(a=a.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(a).data("bs."+this.type,this),this.options.container?s.appendTo(t(document).find(this.options.container)):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var u=this.getPosition(),d=s[0].offsetWidth,h=s[0].offsetHeight;if(c){var m=a,p=this.getPosition(this.$viewport);a="bottom"==a&&u.bottom+h>p.bottom?"top":"top"==a&&u.top-hp.width?"left":"left"==a&&u.left-da.top+a.height&&(s.top=a.top+a.height-l)}else{var c=e.left-i,u=e.left+i+n;ca.right&&(s.left=a.left+a.width-u)}return s},o.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},o.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},o.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},o.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},o.prototype.enable=function(){this.enabled=!0},o.prototype.disable=function(){this.enabled=!1},o.prototype.toggleEnabled=function(){this.enabled=!this.enabled},o.prototype.toggle=function(e){var n=this;e&&((n=t(e.currentTarget).data("bs."+this.type))||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n))),e?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},o.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide((function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null}))},o.prototype.sanitizeHtml=function(t){return a(t,this.options.whiteList,this.options.sanitizeFn)};var l=t.fn.tooltip;t.fn.tooltip=function(e){return this.each((function(){var n=t(this),r=n.data("bs.tooltip"),s="object"==typeof e&&e;!r&&/destroy|hide/.test(e)||(r||n.data("bs.tooltip",r=new o(this,s)),"string"==typeof e&&r[e]())}))},t.fn.tooltip.Constructor=o,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=l,this}}(jQuery)},3387:()=>{!function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var n=!1,r=this;return t(this).one("bsTransitionEnd",(function(){n=!0})),setTimeout((function(){n||t(r).trigger(t.support.transition.end)}),e),this},t((function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e)if(void 0!==t.style[n])return{end:e[n]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})}))}(jQuery)},7514:t=>{var e=function(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas),this.width=this.canvas.width=t.width,this.height=this.canvas.height=t.height,this.context.drawImage(t,0,0,this.width,this.height)};e.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},e.prototype.update=function(t){this.context.putImageData(t,0,0)},e.prototype.getPixelCount=function(){return this.width*this.height},e.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)},e.prototype.removeCanvas=function(){this.canvas.parentNode.removeChild(this.canvas)};var n=function(){};if(n.prototype.getColor=function(t,e){return this.getPalette(t,5,e)[0]},n.prototype.getPalette=function(t,n,r){void 0===n&&(n=10),(void 0===r||1>r)&&(r=10);for(var i,a,o,l,c=new e(t),u=c.getImageData().data,d=c.getPixelCount(),h=[],m=0;d>m;m+=r)a=u[0+(i=4*m)],o=u[i+1],l=u[i+2],u[i+3]>=125&&(a>250&&o>250&&l>250||h.push([a,o,l]));var p=s.quantize(h,n),f=p?p.palette():null;return c.removeCanvas(),f},!r)var r={map:function(t,e){var n={};return e?t.map((function(t,r){return n.index=r,e.call(n,t)})):t.slice()},naturalOrder:function(t,e){return e>t?-1:t>e?1:0},sum:function(t,e){var n={};return t.reduce(e?function(t,r,s){return n.index=s,t+e.call(n,r)}:function(t,e){return t+e},0)},max:function(t,e){return Math.max.apply(null,e?r.map(t,e):t)}};var s=function(){function t(t,e,n){return(t<<2*l)+(e<>c,s=e[1]>>c,i=e[2]>>c,n=t(r,s,i),a[n]=(a[n]||0)+1})),a}function a(t,e){var r,s,i,a=1e6,o=0,l=1e6,u=0,d=1e6,h=0;return t.forEach((function(t){r=t[0]>>c,s=t[1]>>c,i=t[2]>>c,a>r?a=r:r>o&&(o=r),l>s?l=s:s>u&&(u=s),d>i?d=i:i>h&&(h=i)})),new n(a,o,l,u,d,h,e)}function o(e,n){if(n.count()){var s=n.r2-n.r1+1,i=n.g2-n.g1+1,a=n.b2-n.b1+1,o=r.max([s,i,a]);if(1==n.count())return[n.copy()];var l,c,u,d,h=0,m=[],p=[];if(o==s)for(l=n.r1;l<=n.r2;l++){for(d=0,c=n.g1;c<=n.g2;c++)for(u=n.b1;u<=n.b2;u++)d+=e[t(l,c,u)]||0;h+=d,m[l]=h}else if(o==i)for(l=n.g1;l<=n.g2;l++){for(d=0,c=n.r1;c<=n.r2;c++)for(u=n.b1;u<=n.b2;u++)d+=e[t(c,l,u)]||0;h+=d,m[l]=h}else for(l=n.b1;l<=n.b2;l++){for(d=0,c=n.r1;c<=n.r2;c++)for(u=n.g1;u<=n.g2;u++)d+=e[t(c,u,l)]||0;h+=d,m[l]=h}return m.forEach((function(t,e){p[e]=h-t})),function(t){var e,r,s,i,a,o=t+"1",c=t+"2",u=0;for(l=n[o];l<=n[c];l++)if(m[l]>h/2){for(s=n.copy(),i=n.copy(),e=l-n[o],a=(r=n[c]-l)>=e?Math.min(n[c]-1,~~(l+r/2)):Math.max(n[o],~~(l-1-e/2));!m[a];)a++;for(u=p[a];!u&&m[a-1];)u=p[--a];return s[c]=a,i[o]=s[c]+1,[s,i]}}(o==s?"r":o==i?"g":"b")}}var l=5,c=8-l;return n.prototype={volume:function(t){var e=this;return(!e._volume||t)&&(e._volume=(e.r2-e.r1+1)*(e.g2-e.g1+1)*(e.b2-e.b1+1)),e._volume},count:function(e){var n=this,r=n.histo;if(!n._count_set||e){var s,i,a,o=0;for(s=n.r1;s<=n.r2;s++)for(i=n.g1;i<=n.g2;i++)for(a=n.b1;a<=n.b2;a++)index=t(s,i,a),o+=r[index]||0;n._count=o,n._count_set=!0}return n._count},copy:function(){var t=this;return new n(t.r1,t.r2,t.g1,t.g2,t.b1,t.b2,t.histo)},avg:function(e){var n=this,r=n.histo;if(!n._avg||e){var s,i,a,o,c=0,u=1<<8-l,d=0,h=0,m=0;for(i=n.r1;i<=n.r2;i++)for(a=n.g1;a<=n.g2;a++)for(o=n.b1;o<=n.b2;o++)c+=s=r[t(i,a,o)]||0,d+=s*(i+.5)*u,h+=s*(a+.5)*u,m+=s*(o+.5)*u;n._avg=c?[~~(d/c),~~(h/c),~~(m/c)]:[~~(u*(n.r1+n.r2+1)/2),~~(u*(n.g1+n.g2+1)/2),~~(u*(n.b1+n.b2+1)/2)]}return n._avg},contains:function(t){var e=this,n=t[0]>>c;return gval=t[1]>>c,bval=t[2]>>c,n>=e.r1&&n<=e.r2&&gval>=e.g1&&gval<=e.g2&&bval>=e.b1&&bval<=e.b2}},s.prototype={push:function(t){this.vboxes.push({vbox:t,color:t.avg()})},palette:function(){return this.vboxes.map((function(t){return t.color}))},size:function(){return this.vboxes.size()},map:function(t){for(var e=this.vboxes,n=0;n(n=Math.sqrt(Math.pow(t[0]-s.peek(i).color[0],2)+Math.pow(t[1]-s.peek(i).color[1],2)+Math.pow(t[2]-s.peek(i).color[2],2)))||void 0===e)&&(e=n,r=s.peek(i).color);return r},forcebw:function(){var t=this.vboxes;t.sort((function(t,e){return r.naturalOrder(r.sum(t.color),r.sum(e.color))}));var e=t[0].color;e[0]<5&&e[1]<5&&e[2]<5&&(t[0].color=[0,0,0]);var n=t.length-1,s=t[n].color;s[0]>251&&s[1]>251&&s[2]>251&&(t[n].color=[255,255,255])}},{quantize:function(t,n){function l(t,e){for(var n,r=1,s=0;1e3>s;)if((n=t.pop()).count()){var i=o(c,n),a=i[0],l=i[1];if(!a)return;if(t.push(a),l&&(t.push(l),r++),r>=e)return;if(s++>1e3)return}else t.push(n),s++}if(!t.length||2>n||n>256)return!1;var c=i(t);c.forEach((function(){}));var u=a(t,c),d=new e((function(t,e){return r.naturalOrder(t.count(),e.count())}));d.push(u),l(d,.75*n);for(var h=new e((function(t,e){return r.naturalOrder(t.count()*t.volume(),e.count()*e.volume())}));d.size();)h.push(d.pop());l(h,n-h.size());for(var m=new s;h.size();)m.push(h.pop());return m}}}();t.exports=n},1720:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",r="second",s="minute",i="hour",a="day",o="week",l="month",c="quarter",u="year",d="date",h="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|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,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},g=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:g,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),s=n%60;return(e<=0?"+":"-")+g(r,2,"0")+":"+g(s,2,"0")},m:function t(e,n){if(e.date()1)return t(a[0])}else{var o=e.name;y[o]=e,s=o}return!r&&s&&(b=s),s||!r&&b},_=function(t,e){if(A(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},N=v;N.l=x,N.i=A,N.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function f(t){this.$L=x(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[w]=!0}var g=f.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(N.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(m);if(r){var s=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(e)}(t),this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return N},g.isValid=function(){return!(this.$d.toString()===h)},g.isSame=function(t,e){var n=_(t);return this.startOf(e)<=n&&n<=this.endOf(e)},g.isAfter=function(t,e){return _(t)0,g<=f.r||!f.r){g<=1&&p>0&&(f=h[p-1]);var v=d[f.l];o&&(g=o(""+g)),c="string"==typeof v?v.replace("%d",g):v(g,r,f.l,u);break}}if(r)return c;var b=u?d.future:d.past;return"function"==typeof b?b(c):b.replace("%s",c)},r.to=function(t,e){return i(t,e,this,!0)},r.from=function(t,e){return i(t,e,this)};var a=function(t){return t.$u?n.utc():n()};r.toNow=function(t){return this.to(a(this),t)},r.fromNow=function(t){return this.from(a(this),t)}}}()},5187:(t,e,n)=>{"use strict";t.exports=function(){if("object"==typeof globalThis)return globalThis;var t;try{t=this||new Function("return this")()}catch(t){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return t}()},2894:function(){!function(t){function e(e){if("string"==typeof e.data&&(e.data={keys:e.data}),e.data&&e.data.keys&&"string"==typeof e.data.keys){var n=e.handler,r=e.data.keys.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!(t.hotkeys.options.filterInputAcceptingElements&&t.hotkeys.textInputTypes.test(e.target.nodeName)||t.hotkeys.options.filterContentEditable&&t(e.target).attr("contenteditable")||t.hotkeys.options.filterTextInputs&&t.inArray(e.target.type,t.hotkeys.textAcceptingInputTypes)>-1)){var s="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],i=String.fromCharCode(e.which).toLowerCase(),a="",o={};t.each(["alt","ctrl","shift"],(function(t,n){e[n+"Key"]&&s!==n&&(a+=n+"+")})),e.metaKey&&!e.ctrlKey&&"meta"!==s&&(a+="meta+"),e.metaKey&&"meta"!==s&&a.indexOf("alt+ctrl+shift+")>-1&&(a=a.replace("alt+ctrl+shift+","hyper+")),s?o[a+s]=!0:(o[a+i]=!0,o[a+t.hotkeys.shiftNums[i]]=!0,"shift+"===a&&(o[t.hotkeys.shiftNums[i]]=!0));for(var l=0,c=r.length;l","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},t.each(["keydown","keyup","keypress"],(function(){t.event.special[this]={add:e}}))}(jQuery||this.jQuery||window.jQuery)},1963:function(t,e){var n;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(r,s){"use strict";var i=[],a=Object.getPrototypeOf,o=i.slice,l=i.flat?function(t){return i.flat.call(t)}:function(t){return i.concat.apply([],t)},c=i.push,u=i.indexOf,d={},h=d.toString,m=d.hasOwnProperty,p=m.toString,f=p.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},b=function(t){return null!=t&&t===t.window},y=r.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function A(t,e,n){var r,s,i=(n=n||y).createElement("script");if(i.text=t,e)for(r in w)(s=e[r]||e.getAttribute&&e.getAttribute(r))&&i.setAttribute(r,s);n.head.appendChild(i).parentNode.removeChild(i)}function x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?d[h.call(t)]||"object":typeof t}var _="3.7.1",N=/HTML$/i,S=function(t,e){return new S.fn.init(t,e)};function E(t){var e=!!t&&"length"in t&&t.length,n=x(t);return!v(t)&&!b(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function k(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}S.fn=S.prototype={jquery:_,constructor:S,length:0,toArray:function(){return o.call(this)},get:function(t){return null==t?o.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+D+")"+D+"*"),H=new RegExp(D+"|>"),q=new RegExp(B),U=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+D+"*(even|odd|(([+-]|)(\\d*)n|)"+D+"*(?:([+-]|)"+D+"*(\\d+)|))"+D+"*\\)|)","i"),bool:new RegExp("^(?:"+E+")$","i"),needsContext:new RegExp("^"+D+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+D+"*((?:-\\d)?\\d*)"+D+"*\\)|)(?=[^-]|$)","i")},z=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,V=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Y=new RegExp("\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\([^\\r\\n\\f])","g"),Q=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},J=function(){lt()},X=ht((function(t){return!0===t.disabled&&k(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{f.apply(i=o.call(j.childNodes),j.childNodes),i[j.childNodes.length].nodeType}catch(t){f={apply:function(t,e){L.apply(t,o.call(e))},call:function(t){L.apply(t,o.call(arguments,1))}}}function Z(t,e,n,r){var s,i,a,o,c,u,m,p=e&&e.ownerDocument,b=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==b&&9!==b&&11!==b)return n;if(!r&&(lt(e),e=e||l,d)){if(11!==b&&(c=V.exec(t)))if(s=c[1]){if(9===b){if(!(a=e.getElementById(s)))return n;if(a.id===s)return f.call(n,a),n}else if(p&&(a=p.getElementById(s))&&Z.contains(e,a)&&a.id===s)return f.call(n,a),n}else{if(c[2])return f.apply(n,e.getElementsByTagName(t)),n;if((s=c[3])&&e.getElementsByClassName)return f.apply(n,e.getElementsByClassName(s)),n}if(!(_[t+" "]||h&&h.test(t))){if(m=t,p=e,1===b&&(H.test(t)||F.test(t))){for((p=K.test(t)&&ot(e.parentNode)||e)==e&&g.scope||((o=e.getAttribute("id"))?o=S.escapeSelector(o):e.setAttribute("id",o=v)),i=(u=ut(t)).length;i--;)u[i]=(o?"#"+o:":scope")+" "+dt(u[i]);m=u.join(",")}try{return f.apply(n,p.querySelectorAll(m)),n}catch(e){_(t,!0)}finally{o===v&&e.removeAttribute("id")}}}return bt(t.replace(O,"$1"),e,n,r)}function tt(){var t=[];return function n(r,s){return t.push(r+" ")>e.cacheLength&&delete n[t.shift()],n[r+" "]=s}}function et(t){return t[v]=!0,t}function nt(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function rt(t){return function(e){return k(e,"input")&&e.type===t}}function st(t){return function(e){return(k(e,"input")||k(e,"button"))&&e.type===t}}function it(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&X(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function at(t){return et((function(e){return e=+e,et((function(n,r){for(var s,i=t([],n.length,e),a=i.length;a--;)n[s=i[a]]&&(n[s]=!(r[s]=n[s]))}))}))}function ot(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var n,r=t?t.ownerDocument||t:j;return r!=l&&9===r.nodeType&&r.documentElement?(c=(l=r).documentElement,d=!S.isXMLDoc(l),p=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&j!=l&&(n=l.defaultView)&&n.top!==n&&n.addEventListener("unload",J),g.getById=nt((function(t){return c.appendChild(t).id=S.expando,!l.getElementsByName||!l.getElementsByName(S.expando).length})),g.disconnectedMatch=nt((function(t){return p.call(t,"*")})),g.scope=nt((function(){return l.querySelectorAll(":scope")})),g.cssHas=nt((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),g.getById?(e.filter.ID=function(t){var e=t.replace(Y,Q);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&d){var n=e.getElementById(t);return n?[n]:[]}}):(e.filter.ID=function(t){var e=t.replace(Y,Q);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&d){var n,r,s,i=e.getElementById(t);if(i){if((n=i.getAttributeNode("id"))&&n.value===t)return[i];for(s=e.getElementsByName(t),r=0;i=s[r++];)if((n=i.getAttributeNode("id"))&&n.value===t)return[i]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&d)return e.getElementsByClassName(t)},h=[],nt((function(t){var e;c.appendChild(t).innerHTML="",t.querySelectorAll("[selected]").length||h.push("\\["+D+"*(?:value|"+E+")"),t.querySelectorAll("[id~="+v+"-]").length||h.push("~="),t.querySelectorAll("a#"+v+"+*").length||h.push(".#.+[+~]"),t.querySelectorAll(":checked").length||h.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||h.push("\\["+D+"*name"+D+"*="+D+"*(?:''|\"\")")})),g.cssHas||h.push(":has"),h=h.length&&new RegExp(h.join("|")),N=function(t,e){if(t===e)return a=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!g.sortDetached&&e.compareDocumentPosition(t)===n?t===l||t.ownerDocument==j&&Z.contains(j,t)?-1:e===l||e.ownerDocument==j&&Z.contains(j,e)?1:s?u.call(s,t)-u.call(s,e):0:4&n?-1:1)},l):l}for(t in Z.matches=function(t,e){return Z(t,null,null,e)},Z.matchesSelector=function(t,e){if(lt(t),d&&!_[e+" "]&&(!h||!h.test(e)))try{var n=p.call(t,e);if(n||g.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){_(e,!0)}return Z(e,l,null,[t]).length>0},Z.contains=function(t,e){return(t.ownerDocument||t)!=l&<(t),S.contains(t,e)},Z.attr=function(t,n){(t.ownerDocument||t)!=l&<(t);var r=e.attrHandle[n.toLowerCase()],s=r&&m.call(e.attrHandle,n.toLowerCase())?r(t,n,!d):void 0;return void 0!==s?s:t.getAttribute(n)},Z.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},S.uniqueSort=function(t){var e,n=[],r=0,i=0;if(a=!g.sortStable,s=!g.sortStable&&o.call(t,0),C.call(t,N),a){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)P.call(t,n[r],1)}return s=null,t},S.fn.uniqueSort=function(){return this.pushStack(S.uniqueSort(o.apply(this)))},e=S.expr={cacheLength:50,createPseudo:et,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Y,Q),t[3]=(t[3]||t[4]||t[5]||"").replace(Y,Q),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||Z.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&Z.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&q.test(n)&&(e=ut(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Y,Q).toLowerCase();return"*"===t?function(){return!0}:function(t){return k(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+D+")"+t+"("+D+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var s=Z.attr(r,t);return null==s?"!="===e:!e||(s+="","="===e?s===n:"!="===e?s!==n:"^="===e?n&&0===s.indexOf(n):"*="===e?n&&s.indexOf(n)>-1:"$="===e?n&&s.slice(-n.length)===n:"~="===e?(" "+s.replace(R," ")+" ").indexOf(n)>-1:"|="===e&&(s===n||s.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,s){var i="nth"!==t.slice(0,3),a="last"!==t.slice(-4),o="of-type"===e;return 1===r&&0===s?function(t){return!!t.parentNode}:function(e,n,l){var c,u,d,h,m,p=i!==a?"nextSibling":"previousSibling",f=e.parentNode,g=o&&e.nodeName.toLowerCase(),y=!l&&!o,w=!1;if(f){if(i){for(;p;){for(d=e;d=d[p];)if(o?k(d,g):1===d.nodeType)return!1;m=p="only"===t&&!m&&"nextSibling"}return!0}if(m=[a?f.firstChild:f.lastChild],a&&y){for(w=(h=(c=(u=f[v]||(f[v]={}))[t]||[])[0]===b&&c[1])&&c[2],d=h&&f.childNodes[h];d=++h&&d&&d[p]||(w=h=0)||m.pop();)if(1===d.nodeType&&++w&&d===e){u[t]=[b,h,w];break}}else if(y&&(w=h=(c=(u=e[v]||(e[v]={}))[t]||[])[0]===b&&c[1]),!1===w)for(;(d=++h&&d&&d[p]||(w=h=0)||m.pop())&&(!(o?k(d,g):1===d.nodeType)||!++w||(y&&((u=d[v]||(d[v]={}))[t]=[b,w]),d!==e)););return(w-=s)===r||w%r==0&&w/r>=0}}},PSEUDO:function(t,n){var r,s=e.pseudos[t]||e.setFilters[t.toLowerCase()]||Z.error("unsupported pseudo: "+t);return s[v]?s(n):s.length>1?(r=[t,t,"",n],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var r,i=s(t,n),a=i.length;a--;)t[r=u.call(t,i[a])]=!(e[r]=i[a])})):function(t){return s(t,0,r)}):s}},pseudos:{not:et((function(t){var e=[],n=[],r=vt(t.replace(O,"$1"));return r[v]?et((function(t,e,n,s){for(var i,a=r(t,null,s,[]),o=t.length;o--;)(i=a[o])&&(t[o]=!(e[o]=i))})):function(t,s,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:et((function(t){return function(e){return Z(t,e).length>0}})),contains:et((function(t){return t=t.replace(Y,Q),function(e){return(e.textContent||S.text(e)).indexOf(t)>-1}})),lang:et((function(t){return U.test(t||"")||Z.error("unsupported lang: "+t),t=t.replace(Y,Q).toLowerCase(),function(e){var n;do{if(n=d?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=r.location&&r.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:it(!1),disabled:it(!0),checked:function(t){return k(t,"input")&&!!t.checked||k(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return W.test(t.nodeName)},input:function(t){return z.test(t.nodeName)},button:function(t){return k(t,"input")&&"button"===t.type||k(t,"button")},text:function(t){var e;return k(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:at((function(){return[0]})),last:at((function(t,e){return[e-1]})),eq:at((function(t,e,n){return[n<0?n+e:n]})),even:at((function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t})),gt:at((function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var s=t.length;s--;)if(!t[s](e,n,r))return!1;return!0}:t[0]}function pt(t,e,n,r,s){for(var i,a=[],o=0,l=t.length,c=null!=e;o-1&&(i[c]=!(a[c]=h))}}else m=pt(m===a?m.splice(v,m.length):m),s?s(null,a,m,l):f.apply(a,m)}))}function gt(t){for(var r,s,i,a=t.length,o=e.relative[t[0].type],l=o||e.relative[" "],c=o?1:0,d=ht((function(t){return t===r}),l,!0),h=ht((function(t){return u.call(r,t)>-1}),l,!0),m=[function(t,e,s){var i=!o&&(s||e!=n)||((r=e).nodeType?d(t,e,s):h(t,e,s));return r=null,i}];c1&&mt(m),c>1&&dt(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(O,"$1"),s,c0,i=t.length>0,a=function(a,o,c,u,h){var m,p,g,v=0,y="0",w=a&&[],A=[],x=n,_=a||i&&e.find.TAG("*",h),N=b+=null==x?1:Math.random()||.1,E=_.length;for(h&&(n=o==l||o||h);y!==E&&null!=(m=_[y]);y++){if(i&&m){for(p=0,o||m.ownerDocument==l||(lt(m),c=!d);g=t[p++];)if(g(m,o||l,c)){f.call(u,m);break}h&&(b=N)}s&&((m=!g&&m)&&v--,a&&w.push(m))}if(v+=y,s&&y!==v){for(p=0;g=r[p++];)g(w,A,o,c);if(a){if(v>0)for(;y--;)w[y]||A[y]||(A[y]=T.call(u));A=pt(A)}f.apply(u,A),h&&!a&&A.length>0&&v+r.length>1&&S.uniqueSort(u)}return h&&(b=N,n=x),w};return s?et(a):a}(a,i)),o.selector=t}return o}function bt(t,n,r,s){var i,a,o,l,c,u="function"==typeof t&&t,h=!s&&ut(t=u.selector||t);if(r=r||[],1===h.length){if((a=h[0]=h[0].slice(0)).length>2&&"ID"===(o=a[0]).type&&9===n.nodeType&&d&&e.relative[a[1].type]){if(!(n=(e.find.ID(o.matches[0].replace(Y,Q),n)||[])[0]))return r;u&&(n=n.parentNode),t=t.slice(a.shift().value.length)}for(i=G.needsContext.test(t)?0:a.length;i--&&(o=a[i],!e.relative[l=o.type]);)if((c=e.find[l])&&(s=c(o.matches[0].replace(Y,Q),K.test(a[0].type)&&ot(n.parentNode)||n))){if(a.splice(i,1),!(t=s.length&&dt(a)))return f.apply(r,s),r;break}}return(u||vt(t,h))(s,n,!d,r,!n||K.test(t)&&ot(n.parentNode)||n),r}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,g.sortStable=v.split("").sort(N).join("")===v,lt(),g.sortDetached=nt((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),S.find=Z,S.expr[":"]=S.expr.pseudos,S.unique=S.uniqueSort,Z.compile=vt,Z.select=bt,Z.setDocument=lt,Z.tokenize=ut,Z.escape=S.escapeSelector,Z.getText=S.text,Z.isXML=S.isXMLDoc,Z.selectors=S.expr,Z.support=S.support,Z.uniqueSort=S.uniqueSort}();var B=function(t,e,n){for(var r=[],s=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(s&&S(t).is(n))break;r.push(t)}return r},R=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},$=S.expr.match.needsContext,F=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function H(t,e,n){return v(e)?S.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?S.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?S.grep(t,(function(t){return u.call(e,t)>-1!==n})):S.filter(e,t,n)}S.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?S.find.matchesSelector(r,t)?[r]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,n,r=this.length,s=this;if("string"!=typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e1?S.uniqueSort(n):n},filter:function(t){return this.pushStack(H(this,t||[],!1))},not:function(t){return this.pushStack(H(this,t||[],!0))},is:function(t){return!!H(this,"string"==typeof t&&$.test(t)?S(t):t||[],!1).length}});var q,U=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,n){var r,s;if(!t)return this;if(n=n||q,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:U.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:y,!0)),F.test(r[1])&&S.isPlainObject(e))for(r in e)v(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(s=y.getElementById(r[2]))&&(this[0]=s,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t(S):S.makeArray(t,this)}).prototype=S.fn,q=S(y);var G=/^(?:parents|prev(?:Until|All))/,z={children:!0,contents:!0,next:!0,prev:!0};function W(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&S.find.matchesSelector(n,t))){i.push(n);break}return this.pushStack(i.length>1?S.uniqueSort(i):i)},index:function(t){return t?"string"==typeof t?u.call(S(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return B(t,"parentNode")},parentsUntil:function(t,e,n){return B(t,"parentNode",n)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return B(t,"nextSibling")},prevAll:function(t){return B(t,"previousSibling")},nextUntil:function(t,e,n){return B(t,"nextSibling",n)},prevUntil:function(t,e,n){return B(t,"previousSibling",n)},siblings:function(t){return R((t.parentNode||{}).firstChild,t)},children:function(t){return R(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(k(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(n,r){var s=S.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(s=S.filter(r,s)),this.length>1&&(z[t]||S.uniqueSort(s),G.test(t)&&s.reverse()),this.pushStack(s)}}));var V=/[^\x20\t\r\n\f]+/g;function K(t){return t}function Y(t){throw t}function Q(t,e,n,r){var s;try{t&&v(s=t.promise)?s.call(t).done(e).fail(n):t&&v(s=t.then)?s.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}S.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return S.each(t.match(V)||[],(function(t,n){e[n]=!0})),e}(t):S.extend({},t);var e,n,r,s,i=[],a=[],o=-1,l=function(){for(s=s||t.once,r=e=!0;a.length;o=-1)for(n=a.shift();++o-1;)i.splice(n,1),n<=o&&o--})),this},has:function(t){return t?S.inArray(t,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return s=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return s=a=[],n||e||(i=n=""),this},locked:function(){return!!s},fireWith:function(t,n){return s||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],n="pending",s={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},catch:function(t){return s.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(n){S.each(e,(function(e,r){var s=v(t[r[4]])&&t[r[4]];i[r[1]]((function(){var t=s&&s.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,s?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,s){var i=0;function a(t,e,n,s){return function(){var o=this,l=arguments,c=function(){var r,c;if(!(t=i&&(n!==Y&&(o=void 0,l=[r]),e.rejectWith(o,l))}};t?u():(S.Deferred.getErrorHook?u.error=S.Deferred.getErrorHook():S.Deferred.getStackHook&&(u.error=S.Deferred.getStackHook()),r.setTimeout(u))}}return S.Deferred((function(r){e[0][3].add(a(0,r,v(s)?s:K,r.notifyWith)),e[1][3].add(a(0,r,v(t)?t:K)),e[2][3].add(a(0,r,v(n)?n:Y))})).promise()},promise:function(t){return null!=t?S.extend(t,s):s}},i={};return S.each(e,(function(t,r){var a=r[2],o=r[5];s[r[1]]=a.add,o&&a.add((function(){n=o}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(r[3].fire),i[r[0]]=function(){return i[r[0]+"With"](this===i?void 0:this,arguments),this},i[r[0]+"With"]=a.fireWith})),s.promise(i),t&&t.call(i,i),i},when:function(t){var e=arguments.length,n=e,r=Array(n),s=o.call(arguments),i=S.Deferred(),a=function(t){return function(n){r[t]=this,s[t]=arguments.length>1?o.call(arguments):n,--e||i.resolveWith(r,s)}};if(e<=1&&(Q(t,i.done(a(n)).resolve,i.reject,!e),"pending"===i.state()||v(s[n]&&s[n].then)))return i.then();for(;n--;)Q(s[n],a(n),i.reject);return i.promise()}});var J=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){r.console&&r.console.warn&&t&&J.test(t.name)&&r.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){r.setTimeout((function(){throw t}))};var X=S.Deferred();function Z(){y.removeEventListener("DOMContentLoaded",Z),r.removeEventListener("load",Z),S.ready()}S.fn.ready=function(t){return X.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||X.resolveWith(y,[S]))}}),S.ready.then=X.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?r.setTimeout(S.ready):(y.addEventListener("DOMContentLoaded",Z),r.addEventListener("load",Z));var tt=function(t,e,n,r,s,i,a){var o=0,l=t.length,c=null==n;if("object"===x(n))for(o in s=!0,n)tt(t,e,o,n[o],!0,i,a);else if(void 0!==r&&(s=!0,v(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(S(t),n)})),e))for(;o1,null,!0)},removeData:function(t){return this.each((function(){lt.remove(this,t)}))}}),S.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=ot.get(t,e),n&&(!r||Array.isArray(n)?r=ot.access(t,e,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=S.queue(t,e),r=n.length,s=n.shift(),i=S._queueHooks(t,e);"inprogress"===s&&(s=n.shift(),r--),s&&("fx"===e&&n.unshift("inprogress"),delete i.stop,s.call(t,(function(){S.dequeue(t,e)}),i)),!r&&i&&i.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return ot.get(t,n)||ot.access(t,n,{empty:S.Callbacks("once memory").add((function(){ot.remove(t,[e+"queue",n])}))})}}),S.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,kt=/^$|^module$|\/(?:java|ecma)script/i;_t=y.createDocumentFragment().appendChild(y.createElement("div")),(Nt=y.createElement("input")).setAttribute("type","radio"),Nt.setAttribute("checked","checked"),Nt.setAttribute("name","t"),_t.appendChild(Nt),g.checkClone=_t.cloneNode(!0).cloneNode(!0).lastChild.checked,_t.innerHTML="",g.noCloneChecked=!!_t.cloneNode(!0).lastChild.defaultValue,_t.innerHTML="",g.option=!!_t.lastChild;var Tt={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Ct(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&k(t,e)?S.merge([t],n):n}function Pt(t,e){for(var n=0,r=t.length;n",""]);var Dt=/<|&#?\w+;/;function Ot(t,e,n,r,s){for(var i,a,o,l,c,u,d=e.createDocumentFragment(),h=[],m=0,p=t.length;m-1)s&&s.push(i);else if(c=gt(i),a=Ct(d.appendChild(i),"script"),c&&Pt(a),n)for(u=0;i=a[u++];)kt.test(i.type||"")&&n.push(i);return d}var It=/^([^.]*)(?:\.(.+)|)/;function Mt(){return!0}function jt(){return!1}function Lt(t,e,n,r,s,i){var a,o;if("object"==typeof e){for(o in"string"!=typeof n&&(r=r||n,n=void 0),e)Lt(t,o,n,r,e[o],i);return t}if(null==r&&null==s?(s=n,r=n=void 0):null==s&&("string"==typeof n?(s=r,r=void 0):(s=r,r=n,n=void 0)),!1===s)s=jt;else if(!s)return t;return 1===i&&(a=s,s=function(t){return S().off(t),a.apply(this,arguments)},s.guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,s,r,n)}))}function Bt(t,e,n){n?(ot.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var n,r=ot.get(this,e);if(1&t.isTrigger&&this[e]){if(r)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(r=o.call(arguments),ot.set(this,e,r),this[e](),n=ot.get(this,e),ot.set(this,e,!1),r!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else r&&(ot.set(this,e,S.event.trigger(r[0],r.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Mt)}})):void 0===ot.get(t,e)&&S.event.add(t,e,Mt)}S.event={global:{},add:function(t,e,n,r,s){var i,a,o,l,c,u,d,h,m,p,f,g=ot.get(t);if(it(t))for(n.handler&&(n=(i=n).handler,s=i.selector),s&&S.find.matchesSelector(ft,s),n.guid||(n.guid=S.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(V)||[""]).length;c--;)m=f=(o=It.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),m&&(d=S.event.special[m]||{},m=(s?d.delegateType:d.bindType)||m,d=S.event.special[m]||{},u=S.extend({type:m,origType:f,data:r,handler:n,guid:n.guid,selector:s,needsContext:s&&S.expr.match.needsContext.test(s),namespace:p.join(".")},i),(h=l[m])||((h=l[m]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,r,p,a)||t.addEventListener&&t.addEventListener(m,a)),d.add&&(d.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),s?h.splice(h.delegateCount++,0,u):h.push(u),S.event.global[m]=!0)},remove:function(t,e,n,r,s){var i,a,o,l,c,u,d,h,m,p,f,g=ot.hasData(t)&&ot.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(V)||[""]).length;c--;)if(m=f=(o=It.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),m){for(d=S.event.special[m]||{},h=l[m=(r?d.delegateType:d.bindType)||m]||[],o=o[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=h.length;i--;)u=h[i],!s&&f!==u.origType||n&&n.guid!==u.guid||o&&!o.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(h.splice(i,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(t,u));a&&!h.length&&(d.teardown&&!1!==d.teardown.call(t,p,g.handle)||S.removeEvent(t,m,g.handle),delete l[m])}else for(m in l)S.event.remove(t,m+e[c],n,r,!0);S.isEmptyObject(l)&&ot.remove(t,"handle events")}},dispatch:function(t){var e,n,r,s,i,a,o=new Array(arguments.length),l=S.event.fix(t),c=(ot.get(this,"events")||Object.create(null))[l.type]||[],u=S.event.special[l.type]||{};for(o[0]=l,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(i=[],a={},n=0;n-1:S.find(s,this,null,[c]).length),a[s]&&i.push(r);i.length&&o.push({elem:c,handlers:i})}return c=this,l\s*$/g;function Ht(t,e){return k(t,"table")&&k(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function qt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ut(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Gt(t,e){var n,r,s,i,a,o;if(1===e.nodeType){if(ot.hasData(t)&&(o=ot.get(t).events))for(s in ot.remove(e,"handle events"),o)for(n=0,r=o[s].length;n1&&"string"==typeof p&&!g.checkClone&&$t.test(p))return t.each((function(s){var i=t.eq(s);f&&(e[0]=p.call(this,s,i.html())),Wt(i,e,n,r)}));if(h&&(i=(s=Ot(e,t[0].ownerDocument,!1,t,r)).firstChild,1===s.childNodes.length&&(s=i),i||r)){for(o=(a=S.map(Ct(s,"script"),qt)).length;d0&&Pt(a,!l&&Ct(t,"script")),o},cleanData:function(t){for(var e,n,r,s=S.event.special,i=0;void 0!==(n=t[i]);i++)if(it(n)){if(e=n[ot.expando]){if(e.events)for(r in e.events)s[r]?S.event.remove(n,r):S.removeEvent(n,r,e.handle);n[ot.expando]=void 0}n[lt.expando]&&(n[lt.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Vt(this,t,!0)},remove:function(t){return Vt(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Wt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ht(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ht(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(Ct(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Rt.test(t)&&!Tt[(Et.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;n=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-i-l-o-.5))||0),l+c}function ue(t,e,n){var r=Qt(t),s=(!g.boxSizingReliable()||n)&&"border-box"===S.css(t,"boxSizing",!1,r),i=s,a=Zt(t,e,r),o="offset"+e[0].toUpperCase()+e.slice(1);if(Kt.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&s||!g.reliableTrDimensions()&&k(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(t,"display",!1,r))&&t.getClientRects().length&&(s="border-box"===S.css(t,"boxSizing",!1,r),(i=o in t)&&(a=t[o])),(a=parseFloat(a)||0)+ce(t,e,n||(s?"border":"content"),i,r,a)+"px"}function de(t,e,n,r,s){return new de.prototype.init(t,e,n,r,s)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Zt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var s,i,a,o=st(e),l=Yt.test(e),c=t.style;if(l||(e=se(o)),a=S.cssHooks[e]||S.cssHooks[o],void 0===n)return a&&"get"in a&&void 0!==(s=a.get(t,!1,r))?s:c[e];"string"==(i=typeof n)&&(s=mt.exec(n))&&s[1]&&(n=yt(t,e,s),i="number"),null!=n&&n==n&&("number"!==i||l||(n+=s&&s[3]||(S.cssNumber[o]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var s,i,a,o=st(e);return Yt.test(e)||(e=se(o)),(a=S.cssHooks[e]||S.cssHooks[o])&&"get"in a&&(s=a.get(t,!0,n)),void 0===s&&(s=Zt(t,e,r)),"normal"===s&&e in oe&&(s=oe[e]),""===n||n?(i=parseFloat(s),!0===n||isFinite(i)?i||0:s):s}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,n,r){if(n)return!ie.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ue(t,e,r):Jt(t,ae,(function(){return ue(t,e,r)}))},set:function(t,n,r){var s,i=Qt(t),a=!g.scrollboxSize()&&"absolute"===i.position,o=(a||r)&&"border-box"===S.css(t,"boxSizing",!1,i),l=r?ce(t,e,r,o,i):0;return o&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(i[e])-ce(t,e,"border",!1,i)-.5)),l&&(s=mt.exec(n))&&"px"!==(s[3]||"px")&&(t.style[e]=n,n=S.css(t,e)),le(0,n,l)}}})),S.cssHooks.marginLeft=te(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Zt(t,"marginLeft"))||t.getBoundingClientRect().left-Jt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(n){for(var r=0,s={},i="string"==typeof n?n.split(" "):[n];r<4;r++)s[t+pt[r]+e]=i[r]||i[r-2]||i[0];return s}},"margin"!==t&&(S.cssHooks[t+e].set=le)})),S.fn.extend({css:function(t,e){return tt(this,(function(t,e,n){var r,s,i={},a=0;if(Array.isArray(e)){for(r=Qt(t),s=e.length;a1)}}),S.Tween=de,de.prototype={constructor:de,init:function(t,e,n,r,s,i){this.elem=t,this.prop=n,this.easing=s||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=i||(S.cssNumber[n]?"":"px")},cur:function(){var t=de.propHooks[this.prop];return t&&t.get?t.get(this):de.propHooks._default.get(this)},run:function(t){var e,n=de.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):de.propHooks._default.set(this),this}},de.prototype.init.prototype=de.prototype,de.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[se(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},de.propHooks.scrollTop=de.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=de.prototype.init,S.fx.step={};var he,me,pe=/^(?:toggle|show|hide)$/,fe=/queueHooks$/;function ge(){me&&(!1===y.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ge):r.setTimeout(ge,S.fx.interval),S.fx.tick())}function ve(){return r.setTimeout((function(){he=void 0})),he=Date.now()}function be(t,e){var n,r=0,s={height:t};for(e=e?1:0;r<4;r+=2-e)s["margin"+(n=pt[r])]=s["padding"+n]=t;return e&&(s.opacity=s.width=t),s}function ye(t,e,n){for(var r,s=(we.tweeners[e]||[]).concat(we.tweeners["*"]),i=0,a=s.length;i1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,n){var r,s,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===t.getAttribute?S.prop(t,e,n):(1===i&&S.isXMLDoc(t)||(s=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?Ae:void 0)),void 0!==n?null===n?void S.removeAttr(t,e):s&&"set"in s&&void 0!==(r=s.set(t,n,e))?r:(t.setAttribute(e,n+""),n):s&&"get"in s&&null!==(r=s.get(t,e))?r:null==(r=S.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&k(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,s=e&&e.match(V);if(s&&1===t.nodeType)for(;n=s[r++];)t.removeAttribute(n)}}),Ae={set:function(t,e,n){return!1===e?S.removeAttr(t,n):t.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=xe[e]||S.find.attr;xe[e]=function(t,e,r){var s,i,a=e.toLowerCase();return r||(i=xe[a],xe[a]=s,s=null!=n(t,e,r)?a:null,xe[a]=i),s}}));var _e=/^(?:input|select|textarea|button)$/i,Ne=/^(?:a|area)$/i;function Se(t){return(t.match(V)||[]).join(" ")}function Ee(t){return t.getAttribute&&t.getAttribute("class")||""}function ke(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(V)||[]}S.fn.extend({prop:function(t,e){return tt(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,n){var r,s,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&S.isXMLDoc(t)||(e=S.propFix[e]||e,s=S.propHooks[e]),void 0!==n?s&&"set"in s&&void 0!==(r=s.set(t,n,e))?r:t[e]=n:s&&"get"in s&&null!==(r=s.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):_e.test(t.nodeName)||Ne.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,n,r,s,i,a;return v(t)?this.each((function(e){S(this).addClass(t.call(this,e,Ee(this)))})):(e=ke(t)).length?this.each((function(){if(r=Ee(this),n=1===this.nodeType&&" "+Se(r)+" "){for(i=0;i-1;)n=n.replace(" "+s+" "," ");a=Se(n),r!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(t,e){var n,r,s,i,a=typeof t,o="string"===a||Array.isArray(t);return v(t)?this.each((function(n){S(this).toggleClass(t.call(this,n,Ee(this),e),e)})):"boolean"==typeof e&&o?e?this.addClass(t):this.removeClass(t):(n=ke(t),this.each((function(){if(o)for(i=S(this),s=0;s-1)return!0;return!1}});var Te=/\r/g;S.fn.extend({val:function(t){var e,n,r,s=this[0];return arguments.length?(r=v(t),this.each((function(n){var s;1===this.nodeType&&(null==(s=r?t.call(this,n,S(this).val()):t)?s="":"number"==typeof s?s+="":Array.isArray(s)&&(s=S.map(s,(function(t){return null==t?"":t+""}))),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,s,"value")||(this.value=s))}))):s?(e=S.valHooks[s.type]||S.valHooks[s.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(s,"value"))?n:"string"==typeof(n=s.value)?n.replace(Te,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:Se(S.text(t))}},select:{get:function(t){var e,n,r,s=t.options,i=t.selectedIndex,a="select-one"===t.type,o=a?null:[],l=a?i+1:s.length;for(r=i<0?l:a?i:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),i}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},g.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Ce=r.location,Pe={guid:Date.now()},De=/\?/;S.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new r.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Oe=/^(?:focusinfocus|focusoutblur)$/,Ie=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,n,s){var i,a,o,l,c,u,d,h,p=[n||y],f=m.call(t,"type")?t.type:t,g=m.call(t,"namespace")?t.namespace.split("."):[];if(a=h=o=n=n||y,3!==n.nodeType&&8!==n.nodeType&&!Oe.test(f+S.event.triggered)&&(f.indexOf(".")>-1&&(g=f.split("."),f=g.shift(),g.sort()),c=f.indexOf(":")<0&&"on"+f,(t=t[S.expando]?t:new S.Event(f,"object"==typeof t&&t)).isTrigger=s?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:S.makeArray(e,[t]),d=S.event.special[f]||{},s||!d.trigger||!1!==d.trigger.apply(n,e))){if(!s&&!d.noBubble&&!b(n)){for(l=d.delegateType||f,Oe.test(l+f)||(a=a.parentNode);a;a=a.parentNode)p.push(a),o=a;o===(n.ownerDocument||y)&&p.push(o.defaultView||o.parentWindow||r)}for(i=0;(a=p[i++])&&!t.isPropagationStopped();)h=a,t.type=i>1?l:d.bindType||f,(u=(ot.get(a,"events")||Object.create(null))[t.type]&&ot.get(a,"handle"))&&u.apply(a,e),(u=c&&a[c])&&u.apply&&it(a)&&(t.result=u.apply(a,e),!1===t.result&&t.preventDefault());return t.type=f,s||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),e)||!it(n)||c&&v(n[f])&&!b(n)&&((o=n[c])&&(n[c]=null),S.event.triggered=f,t.isPropagationStopped()&&h.addEventListener(f,Ie),n[f](),t.isPropagationStopped()&&h.removeEventListener(f,Ie),S.event.triggered=void 0,o&&(n[c]=o)),t.result}},simulate:function(t,e,n){var r=S.extend(new S.Event,n,{type:t,isSimulated:!0});S.event.trigger(r,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return S.event.trigger(t,e,n,!0)}});var Me=/\[\]$/,je=/\r?\n/g,Le=/^(?:submit|button|image|reset|file)$/i,Be=/^(?:input|select|textarea|keygen)/i;function Re(t,e,n,r){var s;if(Array.isArray(e))S.each(e,(function(e,s){n||Me.test(t)?r(t,s):Re(t+"["+("object"==typeof s&&null!=s?e:"")+"]",s,n,r)}));else if(n||"object"!==x(e))r(t,e);else for(s in e)Re(t+"["+s+"]",e[s],n,r)}S.param=function(t,e){var n,r=[],s=function(t,e){var n=v(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){s(this.name,this.value)}));else for(n in t)Re(n,t[n],e,s);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&Be.test(this.nodeName)&&!Le.test(t)&&(this.checked||!St.test(t))})).map((function(t,e){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(t){return{name:e.name,value:t.replace(je,"\r\n")}})):{name:e.name,value:n.replace(je,"\r\n")}})).get()}});var $e=/%20/g,Fe=/#.*$/,He=/([?&])_=[^&]*/,qe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ue=/^(?:GET|HEAD)$/,Ge=/^\/\//,ze={},We={},Ve="*/".concat("*"),Ke=y.createElement("a");function Ye(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,s=0,i=e.toLowerCase().match(V)||[];if(v(n))for(;r=i[s++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Qe(t,e,n,r){var s={},i=t===We;function a(o){var l;return s[o]=!0,S.each(t[o]||[],(function(t,o){var c=o(e,n,r);return"string"!=typeof c||i||s[c]?i?!(l=c):void 0:(e.dataTypes.unshift(c),a(c),!1)})),l}return a(e.dataTypes[0])||!s["*"]&&a("*")}function Je(t,e){var n,r,s=S.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((s[n]?t:r||(r={}))[n]=e[n]);return r&&S.extend(!0,t,r),t}Ke.href=Ce.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ce.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ce.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ve,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Je(Je(t,S.ajaxSettings),e):Je(S.ajaxSettings,t)},ajaxPrefilter:Ye(ze),ajaxTransport:Ye(We),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,s,i,a,o,l,c,u,d,h,m=S.ajaxSetup({},e),p=m.context||m,f=m.context&&(p.nodeType||p.jquery)?S(p):S.event,g=S.Deferred(),v=S.Callbacks("once memory"),b=m.statusCode||{},w={},A={},x="canceled",_={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=qe.exec(i);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?i:null},setRequestHeader:function(t,e){return null==c&&(t=A[t.toLowerCase()]=A[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(m.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)_.always(t[_.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||x;return n&&n.abort(e),N(0,e),this}};if(g.promise(_),m.url=((t||m.url||Ce.href)+"").replace(Ge,Ce.protocol+"//"),m.type=e.method||e.type||m.method||m.type,m.dataTypes=(m.dataType||"*").toLowerCase().match(V)||[""],null==m.crossDomain){l=y.createElement("a");try{l.href=m.url,l.href=l.href,m.crossDomain=Ke.protocol+"//"+Ke.host!=l.protocol+"//"+l.host}catch(t){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=S.param(m.data,m.traditional)),Qe(ze,m,e,_),c)return _;for(d in(u=S.event&&m.global)&&0==S.active++&&S.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!Ue.test(m.type),s=m.url.replace(Fe,""),m.hasContent?m.data&&m.processData&&0===(m.contentType||"").indexOf("application/x-www-form-urlencoded")&&(m.data=m.data.replace($e,"+")):(h=m.url.slice(s.length),m.data&&(m.processData||"string"==typeof m.data)&&(s+=(De.test(s)?"&":"?")+m.data,delete m.data),!1===m.cache&&(s=s.replace(He,"$1"),h=(De.test(s)?"&":"?")+"_="+Pe.guid+++h),m.url=s+h),m.ifModified&&(S.lastModified[s]&&_.setRequestHeader("If-Modified-Since",S.lastModified[s]),S.etag[s]&&_.setRequestHeader("If-None-Match",S.etag[s])),(m.data&&m.hasContent&&!1!==m.contentType||e.contentType)&&_.setRequestHeader("Content-Type",m.contentType),_.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+Ve+"; q=0.01":""):m.accepts["*"]),m.headers)_.setRequestHeader(d,m.headers[d]);if(m.beforeSend&&(!1===m.beforeSend.call(p,_,m)||c))return _.abort();if(x="abort",v.add(m.complete),_.done(m.success),_.fail(m.error),n=Qe(We,m,e,_)){if(_.readyState=1,u&&f.trigger("ajaxSend",[_,m]),c)return _;m.async&&m.timeout>0&&(o=r.setTimeout((function(){_.abort("timeout")}),m.timeout));try{c=!1,n.send(w,N)}catch(t){if(c)throw t;N(-1,t)}}else N(-1,"No Transport");function N(t,e,a,l){var d,h,y,w,A,x=e;c||(c=!0,o&&r.clearTimeout(o),n=void 0,i=l||"",_.readyState=t>0?4:0,d=t>=200&&t<300||304===t,a&&(w=function(t,e,n){for(var r,s,i,a,o=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(s in o)if(o[s]&&o[s].test(r)){l.unshift(s);break}if(l[0]in n)i=l[0];else{for(s in n){if(!l[0]||t.converters[s+" "+l[0]]){i=s;break}a||(a=s)}i=i||a}if(i)return i!==l[0]&&l.unshift(i),n[i]}(m,_,a)),!d&&S.inArray("script",m.dataTypes)>-1&&S.inArray("json",m.dataTypes)<0&&(m.converters["text script"]=function(){}),w=function(t,e,n,r){var s,i,a,o,l,c={},u=t.dataTypes.slice();if(u[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(i=u.shift();i;)if(t.responseFields[i]&&(n[t.responseFields[i]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=i,i=u.shift())if("*"===i)i=l;else if("*"!==l&&l!==i){if(!(a=c[l+" "+i]||c["* "+i]))for(s in c)if((o=s.split(" "))[1]===i&&(a=c[l+" "+o[0]]||c["* "+o[0]])){!0===a?a=c[s]:!0!==c[s]&&(i=o[0],u.unshift(o[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+i}}}return{state:"success",data:e}}(m,w,_,d),d?(m.ifModified&&((A=_.getResponseHeader("Last-Modified"))&&(S.lastModified[s]=A),(A=_.getResponseHeader("etag"))&&(S.etag[s]=A)),204===t||"HEAD"===m.type?x="nocontent":304===t?x="notmodified":(x=w.state,h=w.data,d=!(y=w.error))):(y=x,!t&&x||(x="error",t<0&&(t=0))),_.status=t,_.statusText=(e||x)+"",d?g.resolveWith(p,[h,x,_]):g.rejectWith(p,[_,x,y]),_.statusCode(b),b=void 0,u&&f.trigger(d?"ajaxSuccess":"ajaxError",[_,m,d?h:y]),v.fireWith(p,[_,x]),u&&(f.trigger("ajaxComplete",[_,m]),--S.active||S.event.trigger("ajaxStop")))}return _},getJSON:function(t,e,n){return S.get(t,e,n,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,n,r,s){return v(n)&&(s=s||r,r=n,n=void 0),S.ajax(S.extend({url:t,type:e,dataType:s,data:n,success:r},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,n){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,n)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(n){S(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(t){}};var Xe={0:200,1223:204},Ze=S.ajaxSettings.xhr();g.cors=!!Ze&&"withCredentials"in Ze,g.ajax=Ze=!!Ze,S.ajaxTransport((function(t){var e,n;if(g.cors||Ze&&!t.crossDomain)return{send:function(s,i){var a,o=t.xhr();if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)o[a]=t.xhrFields[a];for(a in t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest"),s)o.setRequestHeader(a,s[a]);e=function(t){return function(){e&&(e=n=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===t?o.abort():"error"===t?"number"!=typeof o.status?i(0,"error"):i(o.status,o.statusText):i(Xe[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=e(),n=o.onerror=o.ontimeout=e("error"),void 0!==o.onabort?o.onabort=n:o.onreadystatechange=function(){4===o.readyState&&r.setTimeout((function(){e&&n()}))},e=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,s){e=S("