mirror of
https://github.com/flarum/framework.git
synced 2024-12-05 00:43:39 +08:00
8b11fef3ee
Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci]
1 line
106 KiB
Plaintext
Executable File
Generated
1 line
106 KiB
Plaintext
Executable File
Generated
{"version":3,"file":"admin.js","mappings":"2BAAoEA,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,EAAEmB,EAAEpB,GAAG,GAAG,EAAEwB,EAAE,SAASxB,GAAG,OAAOA,EAAE,CAAC,EAAEyB,EAAE,SAASzB,GAAG,OAAOwB,EAAExB,GAAG0B,KAAKC,KAAK3B,GAAG0B,KAAKE,MAAM5B,EAAE,EAAE6B,EAAE,SAAS7B,GAAG,OAAO0B,KAAKI,IAAI9B,EAAE,EAAE+B,EAAE,SAAS/B,EAAEC,GAAG,OAAOD,EAAEwB,EAAExB,GAAG,CAACgC,UAAS,EAAGC,OAAO,GAAGJ,EAAE7B,GAAGC,GAAG,CAAC+B,UAAS,EAAGC,OAAO,GAAGjC,EAAEC,GAAG,CAAC+B,UAAS,EAAGC,OAAO,GAAG,EAAEb,EAAE,WAAW,SAASI,EAAExB,EAAEC,EAAEC,GAAG,IAAIC,EAAE+B,KAAK,GAAGA,KAAKC,GAAG,CAAC,EAAED,KAAKZ,GAAGpB,OAAE,IAASF,IAAIkC,KAA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AK,eACLF,QAAS,WACPZ,EAAIyQ,MAAMC,KAAKhL,KAEf1F,EACG2Q,QAAqC,CACpC/K,IAAQ5F,EAAI4Q,MAAMC,UAAU,UAAS,+BAA+B,EAAK9O,UAAUR,GACnFoE,OAAQ,WAETG,MAAK,SAAC9B,GACO,MAARA,GAAAA,EAAU+B,WACZ1B,KAEArE,EAAI8Q,OAAOJ,KAAK,CAAEhR,KAAM,WAAaM,EAAI4P,WAAWC,MAAM,8DAC1DhL,OAAOoB,SAAWjG,EAAI4Q,MAAMC,UAAU,YAE1C,IAAE,SACO,WACP7Q,EAAIyQ,MAAMM,OACZ,GACJ,GAAE,UAKR,GACF,G","sources":["webpack://@flarum/package-manager/../../../node_modules/dayjs/plugin/duration.js","webpack://@flarum/package-manager/webpack/bootstrap","webpack://@flarum/package-manager/webpack/runtime/compat get default export","webpack://@flarum/package-manager/webpack/runtime/define property getters","webpack://@flarum/package-manager/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/package-manager/webpack/runtime/make namespace object","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['admin/components/LoadingModal']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['admin/utils/isExtensionEnabled']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@flarum/package-manager/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/package-manager/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/package-manager/../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@flarum/package-manager/./src/admin/components/Label.tsx","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/package-manager/./src/admin/components/TaskOutputModal.tsx","webpack://@flarum/package-manager/./src/admin/components/Pagination.tsx","webpack://@flarum/package-manager/./src/admin/components/QueueSection.tsx","webpack://@flarum/package-manager/./src/admin/utils/humanDuration.ts","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@flarum/package-manager/./src/admin/utils/errorHandler.ts","webpack://@flarum/package-manager/./src/admin/utils/jumpToQueue.ts","webpack://@flarum/package-manager/./src/admin/components/Installer.tsx","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@flarum/package-manager/./src/admin/components/WhyNotModal.tsx","webpack://@flarum/package-manager/./src/admin/components/ExtensionItem.tsx","webpack://@flarum/package-manager/./src/admin/components/MajorUpdater.tsx","webpack://@flarum/package-manager/../../../node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/package-manager/../../../node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@flarum/package-manager/../../../framework/core/js/src/common/utils/isObject.ts","webpack://@flarum/package-manager/../../../framework/core/js/src/common/utils/ItemList.ts","webpack://@flarum/package-manager/./src/admin/components/Updater.tsx","webpack://@flarum/package-manager/./src/admin/components/ControlSection.tsx","webpack://@flarum/package-manager/./src/admin/components/SettingsPage.tsx","webpack://@flarum/package-manager/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/package-manager/../../../node_modules/pretty-bytes/index.js","webpack://@flarum/package-manager/./src/admin/models/Task.ts","webpack://@flarum/package-manager/./src/admin/states/QueueState.ts","webpack://@flarum/package-manager/./src/admin/states/ControlSectionState.ts","webpack://@flarum/package-manager/./src/admin/states/PackageManagerState.ts","webpack://@flarum/package-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,h=2592e6,a=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,d={years:u,months:h,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof p},f=function(t,s,n){return new p(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)},g=function(t,s){return t?l(t)?{negative:!0,format:\"\"+y(t)+s}:{negative:!1,format:\"\"+t+s}:{negative:!1,format:\"\"}},p=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*d[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)*d[n]}),0)},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/h),t%=h,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=g(this.$d.years,\"Y\"),s=g(this.$d.months,\"M\"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=g(n,\"D\"),e=g(this.$d.hours,\"H\"),r=g(this.$d.minutes,\"M\"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3);var u=g(o,\"S\"),h=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?\"T\":\"\",d=(h?\"-\":\"\")+\"P\"+t.format+s.format+i.format+a+e.format+r.format+u.format;return\"P\"===d||\"-P\"===d?\"P0D\":d},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/d[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return\"milliseconds\"===n?s%=1e3:s=\"weeks\"===n?$(s/d[n]):this.$d[n],0===s?0:s},y.add=function(t,s,n){var i;return i=s?t*d[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.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}();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)&&(t=t.asMilliseconds()),r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)&&(t=t.asMilliseconds()),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.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/LoadingModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/utils/isExtensionEnabled'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\n\ninterface LabelAttrs extends ComponentAttrs {\n type: 'success' | 'error' | 'neutral' | 'warning';\n}\n\nexport default class Label extends Component<LabelAttrs> {\n view(vnode: Mithril.Vnode<LabelAttrs, this>) {\n const { className, type, ...attrs } = this.attrs;\n\n return (\n <span className={classList(['Label', `Label--${this.attrs.type}`, className])} {...attrs}>\n {vnode.children}\n </span>\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","import app from 'flarum/admin/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport Task from '../models/Task';\n\ninterface TaskOutputModalAttrs extends IInternalModalAttrs {\n task: Task;\n}\n\nexport default class TaskOutputModal<CustomAttrs extends TaskOutputModalAttrs = TaskOutputModalAttrs> extends Modal<CustomAttrs> {\n className() {\n return 'Modal--large QuickModal';\n }\n\n title() {\n return app.translator.trans(`flarum-package-manager.admin.sections.queue.operations.${this.attrs.task.operation()}`);\n }\n\n content() {\n return (\n <div className=\"Modal-body\">\n <div className=\"TaskOutputModal-data\">\n <div className=\"Form-group\">\n <label>{app.translator.trans('flarum-package-manager.admin.sections.queue.output_modal.command')}</label>\n <div className=\"FormControl TaskOutputModal-data-command\">\n <code>$ composer {this.attrs.task.command()}</code>\n </div>\n </div>\n <div className=\"Form-group\">\n <label>{app.translator.trans('flarum-package-manager.admin.sections.queue.output_modal.output')}</label>\n <div className=\"FormControl TaskOutputModal-data-output\">\n <code>\n <pre>{this.attrs.task.output()}</pre>\n </code>\n </div>\n </div>\n </div>\n </div>\n );\n }\n}\n","import app from 'flarum/admin/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport QueueState from '../states/QueueState';\n\ninterface PaginationAttrs extends ComponentAttrs {\n list: QueueState;\n}\n\n/**\n * @todo make it abstract in core for reusability.\n */\nexport default class Pagination extends Component<PaginationAttrs> {\n view() {\n return (\n <nav class=\"Pagination UserListPage-gridPagination\">\n <Button\n disabled={!this.attrs.list.hasPrev()}\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 />\n <span class=\"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 })}\n </span>\n <Button\n disabled={!this.attrs.list.hasNext()}\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 </nav>\n );\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/admin/app';\nimport Component, { ComponentAttrs } 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 { Extension } from 'flarum/admin/AdminApplication';\nimport icon from 'flarum/common/helpers/icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport extractText from 'flarum/common/utils/extractText';\n\nimport Label from './Label';\nimport TaskOutputModal from './TaskOutputModal';\nimport humanDuration from '../utils/humanDuration';\nimport Task, { TaskOperations } from '../models/Task';\nimport Pagination from './Pagination';\n\ninterface QueueTableColumn extends ComponentAttrs {\n label: string;\n content: (task: Task) => Mithril.Children;\n}\n\nexport default class QueueSection extends Component<{}> {\n oninit(vnode: Mithril.Vnode<{}, this>) {\n super.oninit(vnode);\n\n app.packageManager.queue.load();\n }\n\n view() {\n return (\n <section id=\"PackageManager-queueSection\" className=\"ExtensionPage-permissions PackageManager-queueSection\">\n <div className=\"ExtensionPage-permissions-header PackageManager-queueSection-header\">\n <div className=\"container\">\n <h2 className=\"ExtensionTitle\">{app.translator.trans('flarum-package-manager.admin.sections.queue.title')}</h2>\n <Button\n className=\"Button Button--icon\"\n icon=\"fas fa-sync-alt\"\n onclick={() => app.packageManager.queue.load()}\n aria-label={app.translator.trans('flarum-package-manager.admin.sections.queue.refresh')}\n />\n </div>\n </div>\n <div className=\"container\">{this.queueTable()}</div>\n </section>\n );\n }\n\n columns() {\n const items = new ItemList<QueueTableColumn>();\n\n items.add(\n 'operation',\n {\n label: extractText(app.translator.trans('flarum-package-manager.admin.sections.queue.columns.operation')),\n content: (task) => (\n <div className=\"PackageManager-queueTable-operation\">\n <span className=\"PackageManager-queueTable-operation-icon\">{this.operationIcon(task.operation())}</span>\n <span className=\"PackageManager-queueTable-operation-name\">\n {app.translator.trans(`flarum-package-manager.admin.sections.queue.operations.${task.operation()}`)}\n </span>\n </div>\n ),\n },\n 80\n );\n\n items.add(\n 'package',\n {\n label: extractText(app.translator.trans('flarum-package-manager.admin.sections.queue.columns.package')),\n content: (task) => {\n const extension: Extension | null = app.data.extensions[task.package()?.replace(/(\\/flarum-|\\/flarum-ext-|\\/)/g, '-')];\n\n return extension ? (\n <div className=\"PackageManager-queueTable-package\">\n <div className=\"PackageManager-queueTable-package-icon ExtensionIcon\" style={extension.icon}>\n {extension.icon ? icon(extension.icon.name) : ''}\n </div>\n <div className=\"PackageManager-queueTable-package-details\">\n <span className=\"PackageManager-queueTable-package-title\">{extension.extra['flarum-extension'].title}</span>\n <span className=\"PackageManager-queueTable-package-name\">{task.package()}</span>\n </div>\n </div>\n ) : (\n task.package()\n );\n },\n },\n 75\n );\n\n items.add(\n 'status',\n {\n label: extractText(app.translator.trans('flarum-package-manager.admin.sections.queue.columns.status')),\n content: (task) => (\n <Label\n className=\"PackageManager-queueTable-status\"\n type={{ running: 'neutral', failure: 'error', pending: 'warning', success: 'success' }[task.status()]}\n >\n {app.translator.trans(`flarum-package-manager.admin.sections.queue.statuses.${task.status()}`)}\n </Label>\n ),\n },\n 70\n );\n\n items.add(\n 'elapsedTime',\n {\n label: extractText(app.translator.trans('flarum-package-manager.admin.sections.queue.columns.elapsed_time')),\n content: (task) =>\n !task.startedAt() ? (\n app.translator.trans('flarum-package-manager.admin.sections.queue.task_just_started')\n ) : (\n <Tooltip text={`${dayjs(task.startedAt()).format('LL LTS')} ${dayjs(task.finishedAt()).format('LL LTS')}`}>\n <span>{humanDuration(task.startedAt(), task.finishedAt())}</span>\n </Tooltip>\n ),\n },\n 65\n );\n\n items.add(\n 'memoryUsed',\n {\n label: extractText(app.translator.trans('flarum-package-manager.admin.sections.queue.columns.peak_memory_used')),\n content: (task) => <span>{task.peakMemoryUsed()}</span>,\n },\n 60\n );\n\n items.add(\n 'details',\n {\n label: extractText(app.translator.trans('flarum-package-manager.admin.sections.queue.columns.details')),\n content: (task) => (\n <Button\n className=\"Button Button--icon Table-controls-item\"\n icon=\"fas fa-file-alt\"\n aria-label={app.translator.trans('flarum-package-manager.admin.sections.queue.columns.details')}\n // @todo fix in core\n // @ts-ignore\n onclick={() => app.modal.show(TaskOutputModal, { task })}\n />\n ),\n className: 'Table-controls',\n },\n 55\n );\n\n return items;\n }\n\n queueTable() {\n const tasks = app.packageManager.queue.getItems();\n\n if (!tasks) {\n return <LoadingIndicator />;\n }\n\n if (tasks && !tasks.length) {\n return <h3 className=\"ExtensionPage-subHeader\">{app.translator.trans('flarum-package-manager.admin.sections.queue.none')}</h3>;\n }\n\n const columns = this.columns();\n\n return (\n <>\n <table className=\"Table PackageManager-queueTable\">\n <thead>\n <tr>\n {columns.toArray().map((item, index) => (\n <th key={index}>{item.label}</th>\n ))}\n </tr>\n </thead>\n <tbody>\n {tasks.map((task, index) => (\n <tr key={index}>\n {columns.toArray().map((item, index) => {\n const { label, content, ...attrs } = item;\n\n return (\n <td key={index} {...attrs}>\n {content(task)}\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n\n <Pagination list={app.packageManager.queue} />\n </>\n );\n }\n\n operationIcon(operation: TaskOperations): Mithril.Children {\n return icon(\n {\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}\n","import duration from 'dayjs/plugin/duration';\n\nexport default function humanDuration(start: Date, end: Date) {\n dayjs.extend(duration);\n\n const durationTime = dayjs(end).diff(start);\n\n return dayjs.duration(durationTime).humanize();\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","import app from 'flarum/admin/app';\n\nexport default function (e: any) {\n const error = e.response.errors[0];\n\n if (!['composer_command_failure', 'extension_already_installed', 'extension_not_installed'].includes(error.code)) {\n throw e;\n }\n\n switch (error.code) {\n case 'composer_command_failure':\n if (error.guessed_cause) {\n app.alerts.show({ type: 'error' }, app.translator.trans(`flarum-package-manager.admin.exceptions.guessed_cause.${error.guessed_cause}`));\n app.modal.close();\n } else {\n app.alerts.show({ type: 'error' }, app.translator.trans('flarum-package-manager.admin.exceptions.composer_command_failure'));\n }\n break;\n\n case 'extension_already_installed':\n app.alerts.show({ type: 'error' }, app.translator.trans('flarum-package-manager.admin.exceptions.extension_already_installed'));\n app.modal.close();\n break;\n\n case 'extension_not_installed':\n app.alerts.show({ type: 'error' }, app.translator.trans('flarum-package-manager.admin.exceptions.extension_not_installed'));\n app.modal.close();\n }\n}\n","import app from 'flarum/admin/app';\n\n// @ts-ignore\nwindow.jumpToQueue = jumpToQueue;\n\nexport default function jumpToQueue(): void {\n app.modal.close();\n m.route.set(app.route('extension', { id: 'flarum-package-manager' }));\n app.packageManager.queue.load();\n setTimeout(() => {\n document.getElementById('PackageManager-queueSection')?.scrollIntoView({ block: 'nearest' });\n }, 200);\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/admin/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\n\nimport errorHandler from '../utils/errorHandler';\nimport jumpToQueue from '../utils/jumpToQueue';\nimport { AsyncBackendResponse } from '../shims';\n\nexport interface InstallerAttrs extends ComponentAttrs {}\n\nexport type InstallerLoadingTypes = 'extension-install' | null;\n\nexport default class Installer extends Component<InstallerAttrs> {\n packageName!: Stream<string>;\n\n oninit(vnode: Mithril.Vnode<InstallerAttrs, this>): void {\n super.oninit(vnode);\n\n this.packageName = Stream('');\n }\n\n view(): Mithril.Children {\n return (\n <div className=\"Form-group PackageManager-installer\">\n <label htmlFor=\"install-extension\">{app.translator.trans('flarum-package-manager.admin.extensions.install')}</label>\n <p className=\"helpText\">\n {app.translator.trans('flarum-package-manager.admin.extensions.install_help', {\n extiverse: <a href=\"https://extiverse.com\">extiverse.com</a>,\n })}\n </p>\n <div className=\"FormControl-container\">\n <input className=\"FormControl\" id=\"install-extension\" placeholder=\"vendor/package-name\" bidi={this.packageName} />\n <Button\n className=\"Button\"\n icon=\"fas fa-download\"\n onclick={this.onsubmit.bind(this)}\n loading={app.packageManager.control.isLoading('extension-install')}\n disabled={app.packageManager.control.isLoadingOtherThan('extension-install')}\n >\n {app.translator.trans('flarum-package-manager.admin.extensions.proceed')}\n </Button>\n </div>\n </div>\n );\n }\n\n data(): any {\n return {\n package: this.packageName(),\n };\n }\n\n onsubmit(): void {\n app.packageManager.control.setLoading('extension-install');\n app.modal.show(LoadingModal);\n\n app\n .request<AsyncBackendResponse & { id: number }>({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions`,\n body: {\n data: this.data(),\n },\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-package-manager.admin.extensions.successful_install', { extension: extensionId })\n );\n window.location.href = `${app.forum.attribute('adminUrl')}#/extension/${extensionId}`;\n window.location.reload();\n }\n })\n .catch(errorHandler)\n .finally(() => {\n app.packageManager.control.setLoading(null);\n app.modal.close();\n m.redraw();\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","import type Mithril from 'mithril';\nimport app from 'flarum/admin/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nimport errorHandler from '../utils/errorHandler';\n\ntype WhyNotResponse = {\n data: {\n reason: string;\n };\n};\n\nexport interface WhyNotModalAttrs extends IInternalModalAttrs {\n package: string;\n}\n\nexport default class WhyNotModal<CustomAttrs extends WhyNotModalAttrs = WhyNotModalAttrs> extends Modal<CustomAttrs> {\n loading: boolean = true;\n whyNot: string | null = null;\n\n className() {\n return 'Modal--large WhyNotModal';\n }\n\n title() {\n return app.translator.trans('flarum-package-manager.admin.why_not_modal.title');\n }\n\n oncreate(vnode: Mithril.VnodeDOM<CustomAttrs, this>) {\n super.oncreate(vnode);\n\n this.requestWhyNot();\n }\n\n content() {\n return <div className=\"Modal-body\">{this.loading ? <LoadingIndicator /> : <pre className=\"WhyNotModal-contents\">{this.whyNot}</pre>}</div>;\n }\n\n requestWhyNot(): void {\n app\n .request<WhyNotResponse>({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/why-not`,\n body: {\n data: {\n package: this.attrs.package,\n },\n },\n })\n .then((response) => {\n this.loading = false;\n this.whyNot = response.data.reason;\n m.redraw();\n })\n .catch(errorHandler);\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/admin/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nimport icon from 'flarum/common/helpers/icon';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Button from 'flarum/common/components/Button';\nimport { Extension } from 'flarum/admin/AdminApplication';\n\nimport { UpdatedPackage } from '../states/ControlSectionState';\nimport WhyNotModal from './WhyNotModal';\nimport Label from './Label';\n\nexport interface ExtensionItemAttrs extends ComponentAttrs {\n extension: Extension;\n updates: UpdatedPackage;\n onClickUpdate: CallableFunction;\n whyNotWarning?: boolean;\n isCore?: boolean;\n updatable?: boolean;\n isDanger?: boolean;\n}\n\nexport default class ExtensionItem<Attrs extends ExtensionItemAttrs = ExtensionItemAttrs> extends Component<Attrs> {\n view(vnode: Mithril.Vnode<Attrs, this>): Mithril.Children {\n const { extension, updates, onClickUpdate, whyNotWarning, isCore, isDanger } = this.attrs;\n const latestVersion = updates['latest-minor'] ?? (updates['latest-major'] && !isCore ? updates['latest-major'] : null);\n\n return (\n <div\n className={classList({\n 'PackageManager-extension': true,\n 'PackageManager-extension--core': isCore,\n 'PackageManager-extension--danger': isDanger,\n })}\n >\n <div className=\"PackageManager-extension-icon ExtensionIcon\" style={extension.icon}>\n {extension.icon ? icon(extension.icon.name) : ''}\n </div>\n <div className=\"PackageManager-extension-info\">\n <div className=\"PackageManager-extension-name\">{extension.extra['flarum-extension'].title}</div>\n <div className=\"PackageManager-extension-version\">\n <span className=\"PackageManager-extension-version-current\">{this.version(updates['version'])}</span>\n {latestVersion ? (\n <Label className=\"PackageManager-extension-version-latest\" type={updates['latest-minor'] ? 'success' : 'warning'}>\n {this.version(latestVersion)}\n </Label>\n ) : null}\n </div>\n </div>\n <div className=\"PackageManager-extension-controls\">\n {onClickUpdate ? (\n <Tooltip text={app.translator.trans('flarum-package-manager.admin.extensions.update')}>\n <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-package-manager.admin.extensions.update')}\n />\n </Tooltip>\n ) : null}\n {whyNotWarning ? (\n <Tooltip text={app.translator.trans('flarum-package-manager.admin.extensions.check_why_it_failed_updating')}>\n <Button\n icon=\"fas fa-exclamation-circle\"\n className=\"Button Button--icon Button--flat Button--danger\"\n onclick={() => app.modal.show(WhyNotModal, { package: extension.name })}\n aria-label={app.translator.trans('flarum-package-manager.admin.extensions.check_why_it_failed_updating')}\n />\n </Tooltip>\n ) : null}\n </div>\n </div>\n );\n }\n\n version(v: string): string {\n return 'v' + v.replace('v', '');\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/admin/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport Alert from 'flarum/common/components/Alert';\nimport RequestError from 'flarum/common/utils/RequestError';\n\nimport { UpdatedPackage, UpdateState } from '../states/ControlSectionState';\nimport errorHandler from '../utils/errorHandler';\nimport WhyNotModal from './WhyNotModal';\nimport ExtensionItem from './ExtensionItem';\nimport { AsyncBackendResponse } from '../shims';\nimport jumpToQueue from '../utils/jumpToQueue';\n\nexport interface MajorUpdaterAttrs extends ComponentAttrs {\n coreUpdate: UpdatedPackage;\n updateState: UpdateState;\n}\n\nexport type MajorUpdaterLoadingTypes = 'major-update' | 'major-update-dry-run';\n\nexport default class MajorUpdater<T extends MajorUpdaterAttrs = MajorUpdaterAttrs> extends Component<T> {\n updateState!: UpdateState;\n\n oninit(vnode: Mithril.Vnode<T, this>) {\n super.oninit(vnode);\n\n this.updateState = this.attrs.updateState;\n }\n\n view(): Mithril.Children {\n // @todo move Form-group--danger class to core for reuse\n return (\n <div className=\"Form-group Form-group--danger PackageManager-majorUpdate\">\n <img alt=\"flarum logo\" src={app.forum.attribute('baseUrl') + '/assets/extensions/flarum-package-manager/flarum.svg'} />\n <label>{app.translator.trans('flarum-package-manager.admin.major_updater.title', { version: this.attrs.coreUpdate['latest-major'] })}</label>\n <p className=\"helpText\">{app.translator.trans('flarum-package-manager.admin.major_updater.description')}</p>\n <div className=\"PackageManager-updaterControls\">\n <Tooltip text={app.translator.trans('flarum-package-manager.admin.major_updater.dry_run_help')}>\n <Button\n className=\"Button\"\n icon=\"fas fa-vial\"\n onclick={this.update.bind(this, true)}\n disabled={app.packageManager.control.isLoadingOtherThan('major-update-dry-run')}\n >\n {app.translator.trans('flarum-package-manager.admin.major_updater.dry_run')}\n </Button>\n </Tooltip>\n <Button\n className=\"Button Button--danger\"\n icon=\"fas fa-play\"\n onclick={this.update.bind(this, false)}\n disabled={app.packageManager.control.isLoadingOtherThan('major-update')}\n >\n {app.translator.trans('flarum-package-manager.admin.major_updater.update')}\n </Button>\n </div>\n {this.updateState.incompatibleExtensions.length ? (\n <div className=\"PackageManager-majorUpdate-incompatibleExtensions PackageManager-extensions-grid\">\n {this.updateState.incompatibleExtensions.map((extension: string) => (\n <ExtensionItem\n extension={app.data.extensions[extension.replace('flarum-', '').replace('flarum-ext-', '').replace('/', '-')]}\n updates={{}}\n onClickUpdate={null}\n isDanger={true}\n />\n ))}\n </div>\n ) : null}\n {this.updateState.status === 'failure' ? (\n <Alert\n type=\"error\"\n className=\"PackageManager-majorUpdate-failure\"\n dismissible={false}\n controls={[\n <Button\n className=\"Button Button--text PackageManager-majorUpdate-failure-details\"\n icon=\"fas fa-question-circle\"\n onclick={() => app.modal.show(WhyNotModal, { package: 'flarum/core' })}\n >\n {app.translator.trans('flarum-package-manager.admin.major_updater.failure.why')}\n </Button>,\n ]}\n >\n <p className=\"PackageManager-majorUpdate-failure-desc\">\n {app.translator.trans('flarum-package-manager.admin.major_updater.failure.desc')}\n </p>\n </Alert>\n ) : null}\n </div>\n );\n }\n\n update(dryRun: boolean) {\n app.packageManager.control.setLoading(dryRun ? 'major-update-dry-run' : 'major-update');\n app.modal.show(LoadingModal);\n\n app\n .request<AsyncBackendResponse | null>({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/major-update`,\n body: {\n data: { dryRun },\n },\n })\n .then((response) => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.update_successful'));\n window.location.reload();\n }\n })\n .catch(errorHandler)\n .catch((e: RequestError) => {\n app.modal.close();\n this.updateState.status = 'failure';\n this.updateState.incompatibleExtensions = e.response?.errors?.pop()?.incompatible_extensions as string[];\n })\n .finally(() => {\n app.packageManager.control.setLoading(null);\n m.redraw();\n });\n }\n}\n","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","/**\n * Returns if the passed value is an object.\n *\n * In this context, \"object\" refers to **any non-primitive value**, including\n * arrays, function, maps, dates, and more.\n *\n * @example\n * isObject({}); // true\n * @example\n * isObject([]); // true\n * @example\n * isObject(function () {}); // true\n * @example\n * isObject(Object(1)); // true\n * @example\n * isObject(null); // false\n * @example\n * isObject(1); // false\n * @example\n * isObject(\"hello world\"); // false\n *\n * @see https://github.com/jashkenas/underscore/blob/943977e34e2279503528a71ddcc2dd5f96483945/underscore.js#L87-L91\n */\nexport default function isObject(obj: unknown): obj is object {\n const type = typeof obj;\n return type === 'function' || (type === 'object' && !!obj);\n}\n","import isObject from './isObject';\n\nexport interface IItemObject<T> {\n content: T;\n itemName: string;\n priority: number;\n}\n\nclass Item<T> {\n content: T;\n priority: number;\n\n constructor(content: T, priority: number) {\n this.content = content;\n this.priority = priority;\n }\n}\n\n/**\n * The `ItemList` class collects items and then arranges them into an array\n * by priority.\n */\nexport default class ItemList<T> {\n /**\n * The items in the list.\n */\n protected _items: Record<string, Item<T>> = {};\n\n // TODO: [Flarum 2.0] Remove `.items` getter.\n /**\n * A **read-only copy** of items in the list.\n *\n * We don't allow adding new items to the ItemList via setting new properties,\n * nor do we allow modifying existing items directly.\n *\n * @deprecated Use {@link ItemList.toObject} instead.\n */\n get items(): DeepReadonly<Record<string, Item<T>>> {\n return new Proxy(this._items, {\n set() {\n console.warn('Modifying `ItemList.items` is not allowed.');\n return false;\n },\n });\n }\n\n /**\n * Check whether the list is empty.\n */\n isEmpty(): boolean {\n return Object.keys(this._items).length === 0;\n }\n\n /**\n * Check whether an item is present in the list.\n */\n has(key: string): boolean {\n return Object.keys(this._items).includes(key);\n }\n\n /**\n * Get the content of an item.\n */\n get(key: string): T {\n return this._items[key].content;\n }\n\n /**\n * Get the priority of an item.\n */\n getPriority(key: string): number {\n return this._items[key].priority;\n }\n\n /**\n * Add an item to the list.\n *\n * @param key A unique key for the item.\n * @param content The item's content.\n * @param priority The priority of the item. Items with a higher priority\n * will be positioned before items with a lower priority.\n */\n add(key: string, content: T, priority: number = 0): this {\n this._items[key] = new Item(content, priority);\n\n return this;\n }\n\n // TODO: [Flarum 2.0] Remove deprecated `.replace()` method.\n /**\n * Replace an item and/or priority in the list, only if it is already present.\n *\n * If `content` or `priority` are `null`, these values will not be replaced.\n *\n * If the provided `key` is not present, nothing will happen.\n *\n * @deprecated Please use the {@link ItemList.setContent} and {@link ItemList.setPriority}\n * methods to replace items and their priorities. This method will be removed in Flarum 2.0.\n *\n * @param key The key of the item in the list\n * @param content The item's new content\n * @param priority The item's new priority\n *\n * @example <caption>Replace priority and not content.</caption>\n * items.replace('myItem', null, 10);\n *\n * @example <caption>Replace content and not priority.</caption>\n * items.replace('myItem', <p>My new value.</p>);\n *\n * @example <caption>Replace content and priority.</caption>\n * items.replace('myItem', <p>My new value.</p>, 10);\n */\n replace(key: string, content: T | null = null, priority: number | null = null): this {\n if (!this.has(key)) return this;\n\n if (content !== null) {\n this._items[key].content = content;\n }\n\n if (priority !== null) {\n this._items[key].priority = priority;\n }\n\n return this;\n }\n\n /**\n * Replaces an item's content, if the provided item key exists.\n *\n * If the provided `key` is not present, an error will be thrown.\n *\n * @param key The key of the item in the list\n * @param content The item's new content\n *\n * @example <caption>Replace item content.</caption>\n * items.setContent('myItem', <p>My new value.</p>);\n *\n * @example <caption>Replace item content and priority.</caption>\n * items\n * .setContent('myItem', <p>My new value.</p>)\n * .setPriority('myItem', 10);\n *\n * @throws If the provided `key` is not present in the ItemList.\n */\n setContent(key: string, content: T): this {\n if (!this.has(key)) {\n throw new Error(`[ItemList] Cannot set content of Item. Key \\`${key}\\` is not present.`);\n }\n\n // Saves on bundle size to call the deprecated method internally\n return this.replace(key, content);\n }\n\n /**\n * Replaces an item's priority, if the provided item key exists.\n *\n * If the provided `key` is not present, an error will be thrown.\n *\n * @param key The key of the item in the list\n * @param priority The item's new priority\n *\n * @example <caption>Replace item priority.</caption>\n * items.setPriority('myItem', 10);\n *\n * @example <caption>Replace item priority and content.</caption>\n * items\n * .setPriority('myItem', 10)\n * .setContent('myItem', <p>My new value.</p>);\n *\n * @throws If the provided `key` is not present in the ItemList.\n */\n setPriority(key: string, priority: number): this {\n if (!this.has(key)) {\n throw new Error(`[ItemList] Cannot set priority of Item. Key \\`${key}\\` is not present.`);\n }\n\n this._items[key].priority = priority;\n\n return this;\n }\n\n /**\n * Remove an item from the list.\n *\n * If the provided `key` is not present, nothing will happen.\n */\n remove(key: string): this {\n delete this._items[key];\n\n return this;\n }\n\n /**\n * Merge another list's items into this one.\n *\n * The list passed to this function will overwrite items which already exist\n * with the same key.\n */\n merge(otherList: ItemList<T>): ItemList<T> {\n Object.keys(otherList._items).forEach((key) => {\n const val = otherList._items[key];\n\n if (val instanceof Item) {\n this._items[key] = val;\n }\n });\n\n return this;\n }\n\n /**\n * Convert the list into an array of item content arranged by priority.\n *\n * This **does not** preserve the original types of primitives and proxies\n * all content values to make `itemName` accessible on them.\n *\n * **NOTE:** If your ItemList holds primitive types (such as numbers, booleans\n * or strings), these will be converted to their object counterparts if you do\n * not provide `true` to this function.\n *\n * **NOTE:** Modifying any objects in the final array may also update the\n * content of the original ItemList.\n *\n * @param keepPrimitives Converts item content to objects and sets the\n * `itemName` property on them.\n *\n * @see https://github.com/flarum/core/issues/3030\n */\n toArray(keepPrimitives?: false): (T & { itemName: string })[];\n /**\n * Convert the list into an array of item content arranged by priority.\n *\n * Content values that are already objects will be proxied and have\n * `itemName` accessible on them. Primitive values will not have the\n * `itemName` property accessible.\n *\n * **NOTE:** Modifying any objects in the final array may also update the\n * content of the original ItemList.\n *\n * @param keepPrimitives Converts item content to objects and sets the\n * `itemName` property on them.\n */\n toArray(keepPrimitives: true): (T extends object ? T & Readonly<{ itemName: string }> : T)[];\n\n toArray(keepPrimitives: boolean = false): T[] | (T & Readonly<{ itemName: string }>)[] {\n const items: Item<T>[] = Object.keys(this._items).map((key, i) => {\n const item = this._items[key];\n\n if (!keepPrimitives || isObject(item.content)) {\n // Convert content to object, then proxy it\n return {\n ...item,\n content: this.createItemContentProxy(isObject(item.content) ? item.content : Object(item.content), key),\n };\n } else {\n // ...otherwise just return a clone of the item.\n return { ...item };\n }\n });\n\n return items.sort((a, b) => b.priority - a.priority).map((item) => item.content);\n }\n\n /**\n * A read-only map of all keys to their respective items in no particular order.\n *\n * We don't allow adding new items to the ItemList via setting new properties,\n * nor do we allow modifying existing items directly. You should use the\n * {@link ItemList.add}, {@link ItemList.setContent} and\n * {@link ItemList.setPriority} methods instead.\n *\n * To match the old behaviour of the `ItemList.items` property, call\n * `Object.values(ItemList.toObject())`.\n *\n * @example\n * const items = new ItemList();\n * items.add('b', 'My cool value', 20);\n * items.add('a', 'My value', 10);\n * items.toObject();\n * // {\n * // a: { content: 'My value', priority: 10, itemName: 'a' },\n * // b: { content: 'My cool value', priority: 20, itemName: 'b' },\n * // }\n */\n toObject(): DeepReadonly<Record<string, IItemObject<T>>> {\n return Object.keys(this._items).reduce((map, key) => {\n const obj = {\n content: this.get(key),\n itemName: key,\n priority: this.getPriority(key),\n };\n\n map[key] = obj;\n\n return map;\n }, {} as Record<string, IItemObject<T>>);\n }\n\n /**\n * Proxies an item's content, adding the `itemName` readonly property to it.\n *\n * @example\n * createItemContentProxy({ foo: 'bar' }, 'myItem');\n * // { foo: 'bar', itemName: 'myItem' }\n *\n * @param content The item's content (objects only)\n * @param key The item's key\n * @return Proxied content\n *\n * @internal\n */\n private createItemContentProxy<C extends object>(content: C, key: string): Readonly<C & { itemName: string }> {\n return new Proxy(content, {\n get(target, property, receiver) {\n if (property === 'itemName') return key;\n\n return Reflect.get(target, property, receiver);\n },\n set(target, property, value, receiver) {\n if (key !== null && property === 'itemName') {\n throw new Error('`itemName` property is read-only');\n }\n\n return Reflect.set(target, property, value, receiver);\n },\n }) as C & { itemName: string };\n }\n}\n","import app from 'flarum/admin/app';\nimport Component, { ComponentAttrs } 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 { Extension } from 'flarum/admin/AdminApplication';\nimport Alert from 'flarum/common/components/Alert';\nimport ItemList from '@flarum/core/src/common/utils/ItemList';\n\nexport interface IUpdaterAttrs extends ComponentAttrs {}\n\nexport type UpdaterLoadingTypes = 'check' | 'minor-update' | 'global-update' | 'extension-update' | null;\n\nexport default class Updater extends Component<IUpdaterAttrs> {\n view() {\n const core = app.packageManager.control.coreUpdate;\n\n return [\n <div className=\"Form-group\">\n <label>{app.translator.trans('flarum-package-manager.admin.updater.updater_title')}</label>\n <p className=\"helpText\">{app.translator.trans('flarum-package-manager.admin.updater.updater_help')}</p>\n {this.lastUpdateCheckView()}\n <div className=\"PackageManager-updaterControls\">{this.controlItems().toArray()}</div>\n {this.availableUpdatesView()}\n </div>,\n core && core.package['latest-major'] ? (\n <MajorUpdater coreUpdate={core.package} updateState={app.packageManager.control.lastUpdateRun.major} />\n ) : null,\n ];\n }\n\n lastUpdateCheckView() {\n return (\n (app.packageManager.control.lastUpdateCheck?.checkedAt && (\n <p className=\"PackageManager-lastUpdatedAt\">\n <span className=\"PackageManager-lastUpdatedAt-label\">\n {app.translator.trans('flarum-package-manager.admin.updater.last_update_checked_at')}\n </span>\n <span className=\"PackageManager-lastUpdatedAt-value\">{humanTime(app.packageManager.control.lastUpdateCheck.checkedAt)}</span>\n </p>\n )) ||\n null\n );\n }\n\n availableUpdatesView() {\n const state = app.packageManager.control;\n\n if (app.packageManager.control.isLoading()) {\n return (\n <div className=\"PackageManager-extensions\">\n <LoadingIndicator />\n </div>\n );\n }\n\n if (!(state.extensionUpdates.length || state.coreUpdate)) {\n return (\n <div className=\"PackageManager-extensions\">\n <Alert type=\"success\" dismissible={false}>\n {app.translator.trans('flarum-package-manager.admin.updater.up_to_date')}\n </Alert>\n </div>\n );\n }\n\n return (\n <div className=\"PackageManager-extensions\">\n <div className=\"PackageManager-extensions-grid\">\n {state.coreUpdate ? (\n <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 />\n ) : null}\n {state.extensionUpdates.map((extension: Extension) => (\n <ExtensionItem\n extension={extension}\n updates={state.packageUpdates[extension.id]}\n onClickUpdate={() => state.updateExtension(extension)}\n whyNotWarning={state.lastUpdateRun.limitedPackages().includes(extension.name)}\n />\n ))}\n </div>\n </div>\n );\n }\n\n controlItems() {\n const items = new ItemList();\n\n items.add(\n 'updateCheck',\n <Button\n className=\"Button\"\n icon=\"fas fa-sync-alt\"\n onclick={() => app.packageManager.control.checkForUpdates()}\n loading={app.packageManager.control.isLoading('check')}\n disabled={app.packageManager.control.isLoadingOtherThan('check')}\n >\n {app.translator.trans('flarum-package-manager.admin.updater.check_for_updates')}\n </Button>,\n 100\n );\n\n items.add(\n 'globalUpdate',\n <Button\n className=\"Button\"\n icon=\"fas fa-play\"\n onclick={() => app.packageManager.control.updateGlobally()}\n loading={app.packageManager.control.isLoading('global-update')}\n disabled={app.packageManager.control.isLoadingOtherThan('global-update')}\n >\n {app.translator.trans('flarum-package-manager.admin.updater.run_global_update')}\n </Button>\n );\n\n return items;\n }\n}\n","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Alert from 'flarum/common/components/Alert';\nimport { ComponentAttrs } from 'flarum/common/Component';\n\nimport Installer from './Installer';\nimport Updater from './Updater';\nimport Mithril from 'mithril';\n\nexport default class ControlSection extends Component<ComponentAttrs> {\n oninit(vnode: Mithril.Vnode<ComponentAttrs, this>) {\n super.oninit(vnode);\n }\n\n view() {\n return (\n <div className=\"ExtensionPage-permissions PackageManager-controlSection\">\n <div className=\"ExtensionPage-permissions-header\">\n <div className=\"container\">\n <h2 className=\"ExtensionTitle\">{app.translator.trans('flarum-package-manager.admin.sections.control.title')}</h2>\n </div>\n </div>\n <div className=\"container\">\n {app.data['flarum-package-manager.writable_dirs'] ? (\n <>\n <Installer />\n <Updater />\n </>\n ) : (\n <div className=\"Form-group\">\n <Alert type=\"warning\" dismissible={false}>\n {app.translator.trans('flarum-package-manager.admin.file_permissions')}\n </Alert>\n </div>\n )}\n </div>\n </div>\n );\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/admin/app';\nimport ExtensionPage, { ExtensionPageAttrs } from 'flarum/admin/components/ExtensionPage';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nimport QueueSection from './QueueSection';\nimport ControlSection from './ControlSection';\n\nexport default class SettingsPage extends ExtensionPage {\n sections(vnode: Mithril.VnodeDOM<ExtensionPageAttrs, this>): ItemList<unknown> {\n const items = super.sections(vnode);\n\n items.setPriority('content', 10);\n\n items.add('control', <ControlSection />, 8);\n\n if (parseInt(app.data.settings['flarum-package-manager.queue_jobs'])) {\n items.add('queue', <QueueSection />, 5);\n }\n\n items.setPriority('permissions', 0);\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['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\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\tif (options.signed && number === 0) {\n\t\treturn ` 0 ${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 + ' ' + 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 + ' ' + unit;\n}\n","import Model from 'flarum/common/Model';\nimport prettyBytes from 'pretty-bytes';\n\nexport type TaskOperations =\n | 'extension_install'\n | 'extension_remove'\n | 'extension_update'\n | 'update_global'\n | 'update_minor'\n | 'update_major'\n | 'update_check'\n | 'why_not';\n\nexport default class Task extends Model {\n status() {\n return Model.attribute<'pending' | 'running' | 'failure' | 'success'>('status').call(this);\n }\n\n operation() {\n return Model.attribute<TaskOperations>('operation').call(this);\n }\n\n command() {\n return Model.attribute<string>('command').call(this);\n }\n\n package() {\n return Model.attribute<string>('package').call(this);\n }\n\n output() {\n return Model.attribute<string>('output').call(this);\n }\n\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n\n startedAt() {\n return Model.attribute<Date, string>('startedAt', Model.transformDate).call(this);\n }\n\n finishedAt() {\n return Model.attribute<Date, string>('finishedAt', Model.transformDate).call(this);\n }\n\n peakMemoryUsed() {\n return prettyBytes(Model.attribute<number>('peakMemoryUsed').call(this) * 1024);\n }\n}\n","import app from 'flarum/admin/app';\nimport Task from '../models/Task';\nimport { ApiQueryParamsPlural } from 'flarum/common/Store';\n\nexport default class QueueState {\n private tasks: Task[] | null = null;\n private limit = 20;\n private offset = 0;\n private total = 0;\n\n load(params?: ApiQueryParamsPlural) {\n this.tasks = null;\n params = {\n page: {\n limit: this.limit,\n offset: this.offset,\n ...params?.page,\n },\n ...params,\n };\n\n return app.store.find<Task[]>('package-manager-tasks', params || {}).then((data) => {\n this.tasks = data;\n this.total = data.payload.meta?.total;\n\n m.redraw();\n\n return data;\n });\n }\n\n getItems() {\n return this.tasks;\n }\n\n getTotalPages(): number {\n return Math.ceil(this.total / this.limit);\n }\n\n pageNumber(): number {\n return Math.ceil(this.offset / this.limit);\n }\n\n hasPrev(): boolean {\n return this.pageNumber() !== 0;\n }\n\n hasNext(): boolean {\n return this.offset + this.limit < this.total;\n }\n\n prev(): void {\n if (this.hasPrev()) {\n this.offset -= this.limit;\n this.load();\n }\n }\n\n next(): void {\n if (this.hasNext()) {\n this.offset += this.limit;\n this.load();\n }\n }\n}\n","import app from 'flarum/admin/app';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport { UpdaterLoadingTypes } from '../components/Updater';\nimport { InstallerLoadingTypes } from '../components/Installer';\nimport { MajorUpdaterLoadingTypes } from '../components/MajorUpdater';\nimport { AsyncBackendResponse } from '../shims';\nimport errorHandler from '../utils/errorHandler';\nimport jumpToQueue from '../utils/jumpToQueue';\nimport { Extension } from 'flarum/admin/AdminApplication';\nimport extractText from 'flarum/common/utils/extractText';\n\nexport type UpdatedPackage = {\n name: string;\n version: string;\n latest: string;\n 'latest-minor': string | null;\n 'latest-major': string | null;\n 'latest-status': string;\n description: string;\n};\n\nexport type ComposerUpdates = {\n installed: UpdatedPackage[];\n};\n\nexport type LastUpdateCheck = {\n checkedAt: Date | null;\n updates: ComposerUpdates;\n};\n\ntype UpdateType = 'major' | 'minor' | 'global';\ntype UpdateStatus = 'success' | 'failure' | null;\nexport type UpdateState = {\n ranAt: Date | null;\n status: UpdateStatus;\n limitedPackages: string[];\n incompatibleExtensions: string[];\n};\n\nexport type LastUpdateRun = {\n [key in UpdateType]: UpdateState;\n} & {\n limitedPackages: () => string[];\n};\n\nexport type LoadingTypes = UpdaterLoadingTypes | InstallerLoadingTypes | MajorUpdaterLoadingTypes;\n\nexport type CoreUpdate = {\n package: UpdatedPackage;\n extension: Extension;\n};\n\nexport default class ControlSectionState {\n loading: LoadingTypes = null;\n\n public packageUpdates: Record<string, UpdatedPackage> = {};\n public lastUpdateCheck!: LastUpdateCheck;\n public extensionUpdates!: Extension[];\n public coreUpdate: CoreUpdate | null = null;\n get lastUpdateRun(): LastUpdateRun {\n const lastUpdateRun = JSON.parse(app.data.settings['flarum-package-manager.last_update_run']) as LastUpdateRun;\n\n lastUpdateRun.limitedPackages = () => [\n ...lastUpdateRun.major.limitedPackages,\n ...lastUpdateRun.minor.limitedPackages,\n ...lastUpdateRun.global.limitedPackages,\n ];\n\n return lastUpdateRun;\n }\n\n constructor() {\n this.lastUpdateCheck = JSON.parse(app.data.settings['flarum-package-manager.last_update_check']) as LastUpdateCheck;\n this.extensionUpdates = this.formatExtensionUpdates(this.lastUpdateCheck);\n this.coreUpdate = this.formatCoreUpdate(this.lastUpdateCheck);\n }\n\n isLoading(name: LoadingTypes = null): boolean {\n return (name && this.loading === name) || (!name && this.loading !== null);\n }\n\n isLoadingOtherThan(name: LoadingTypes): boolean {\n return this.loading !== null && this.loading !== name;\n }\n\n setLoading(name: LoadingTypes): void {\n this.loading = name;\n }\n\n checkForUpdates() {\n this.setLoading('check');\n\n app\n .request<AsyncBackendResponse | LastUpdateCheck>({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/check-for-updates`,\n })\n .then((response) => {\n if ((response as AsyncBackendResponse).processing) {\n jumpToQueue();\n } else {\n this.lastUpdateCheck = response as LastUpdateCheck;\n this.extensionUpdates = this.formatExtensionUpdates(response as LastUpdateCheck);\n this.coreUpdate = this.formatCoreUpdate(response as LastUpdateCheck);\n m.redraw();\n }\n })\n .catch(errorHandler)\n .finally(() => {\n this.setLoading(null);\n m.redraw();\n });\n }\n\n updateCoreMinor() {\n if (confirm(extractText(app.translator.trans('flarum-package-manager.admin.minor_update_confirmation.content')))) {\n app.modal.show(LoadingModal);\n this.setLoading('minor-update');\n\n app\n .request<AsyncBackendResponse | null>({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/minor-update`,\n })\n .then((response) => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.update_successful'));\n window.location.reload();\n }\n })\n .catch(errorHandler)\n .finally(() => {\n this.setLoading(null);\n app.modal.close();\n m.redraw();\n });\n }\n }\n\n updateExtension(extension: Extension) {\n app.modal.show(LoadingModal);\n this.setLoading('extension-update');\n\n app\n .request<AsyncBackendResponse | null>({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions/${extension.id}`,\n })\n .then((response) => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show(\n { type: 'success' },\n app.translator.trans('flarum-package-manager.admin.extensions.successful_update', {\n extension: extension.extra['flarum-extension'].title,\n })\n );\n window.location.reload();\n }\n })\n .catch(errorHandler)\n .finally(() => {\n this.setLoading(null);\n app.modal.close();\n m.redraw();\n });\n }\n\n updateGlobally() {\n app.modal.show(LoadingModal);\n this.setLoading('global-update');\n\n app\n .request<AsyncBackendResponse | null>({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/global-update`,\n })\n .then((response) => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.updater.global_update_successful'));\n window.location.reload();\n }\n })\n .catch(errorHandler)\n .finally(() => {\n this.setLoading(null);\n app.modal.close();\n m.redraw();\n });\n }\n\n formatExtensionUpdates(lastUpdateCheck: LastUpdateCheck): Extension[] {\n this.packageUpdates = {};\n\n lastUpdateCheck?.updates?.installed?.filter((composerPackage: UpdatedPackage) => {\n const id = composerPackage.name.replace('/', '-').replace(/(flarum-ext-)|(flarum-)/, '');\n\n const extension = app.data.extensions[id];\n const safeToUpdate = ['semver-safe-update', 'update-possible'].includes(composerPackage['latest-status']);\n\n if (extension && safeToUpdate) {\n this.packageUpdates[extension.id] = composerPackage;\n }\n\n return extension && safeToUpdate;\n });\n\n return (Object.values(app.data.extensions) as Extension[]).filter((extension: Extension) => this.packageUpdates[extension.id]);\n }\n\n formatCoreUpdate(lastUpdateCheck: LastUpdateCheck): CoreUpdate | null {\n const core = lastUpdateCheck?.updates?.installed?.filter((composerPackage: UpdatedPackage) => composerPackage.name === 'flarum/core').pop();\n\n if (!core) return null;\n\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(${app.data.resources[0]['attributes']['baseUrl']}/assets/extensions/flarum-package-manager/flarum.svg`,\n },\n extra: {\n 'flarum-extension': {\n title: extractText(app.translator.trans('flarum-package-manager.admin.updater.flarum')),\n },\n },\n },\n };\n }\n}\n","import QueueState from './QueueState';\nimport ControlSectionState from './ControlSectionState';\n\nexport default class PackageManagerState {\n public queue: QueueState = new QueueState();\n public control: ControlSectionState = new ControlSectionState();\n}\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 Alert from 'flarum/common/components/Alert';\n\nimport SettingsPage from './components/SettingsPage';\nimport Task from './models/Task';\nimport jumpToQueue from './utils/jumpToQueue';\nimport extractText from 'flarum/common/utils/extractText';\nimport { AsyncBackendResponse } from './shims';\nimport PackageManagerState from './states/PackageManagerState';\n\napp.initializers.add('flarum-package-manager', (app) => {\n app.store.models['package-manager-tasks'] = Task;\n\n app.packageManager = new PackageManagerState();\n\n app.extensionData\n .for('flarum-package-manager')\n .registerSetting(() => (\n <div className=\"Form-group\">\n <Alert type=\"warning\" dismissible={false}>\n {app.translator.trans('flarum-package-manager.admin.settings.access_warning')}\n </Alert>\n </div>\n ))\n .registerSetting({\n setting: 'flarum-package-manager.queue_jobs',\n label: app.translator.trans('flarum-package-manager.admin.settings.queue_jobs'),\n help: m.trust(\n extractText(\n app.translator.trans('flarum-package-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: `<strong>${app.data.phpVersion}</strong>`,\n folder_perms_link: 'https://docs.flarum.org/install#folder-ownership',\n })\n )\n ),\n default: false,\n type: 'boolean',\n disabled: app.data['flarum-package-manager.using_sync_queue'],\n })\n .registerPage(SettingsPage);\n\n extend(ExtensionPage.prototype, 'topItems', function (items) {\n if (this.extension.id === 'flarum-package-manager' || isExtensionEnabled(this.extension.id)) {\n return;\n }\n\n items.add(\n 'remove',\n <Button\n className=\"Button Button--danger\"\n icon=\"fas fa-times\"\n onclick={() => {\n app.modal.show(LoadingModal);\n\n app\n .request<AsyncBackendResponse | null>({\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions/${this.extension.id}`,\n method: 'DELETE',\n })\n .then((response) => {\n if (response?.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.extensions.successful_remove'));\n window.location = app.forum.attribute('adminUrl');\n }\n })\n .finally(() => {\n app.modal.close();\n });\n }}\n >\n Remove\n </Button>\n );\n });\n});\n"],"names":["module","exports","t","s","n","i","e","r","o","u","h","a","d","years","months","days","hours","minutes","seconds","milliseconds","weeks","c","p","f","$l","m","l","$","Math","ceil","floor","y","abs","g","negative","format","this","$d","$ms","parseFromMilliseconds","Object","keys","forEach","calMilliseconds","match","slice","map","Number","prototype","reduce","toISOString","toJSON","Y","YY","YYYY","M","MM","D","DD","H","HH","mm","ss","SSS","replace","String","as","get","add","subtract","locale","clone","humanize","fromNow","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","core","compat","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","_objectWithoutPropertiesLoose","source","excluded","target","sourceKeys","length","indexOf","Label","view","vnode","attrs","className","type","classList","children","Component","TaskOutputModal","title","app","task","operation","content","command","output","Modal","Pagination","class","disabled","list","hasPrev","onclick","prev","icon","current","pageNumber","total","getTotalPages","hasNext","next","QueueSection","oninit","id","queueTable","columns","items","ItemList","label","extractText","operationIcon","extension","style","name","extra","running","failure","pending","success","status","startedAt","text","dayjs","finishedAt","start","end","extend","durationTime","diff","humanDuration","peakMemoryUsed","tasks","toArray","item","index","update_check","update_major","update_minor","update_global","extension_install","extension_remove","extension_update","why_not","error","response","errors","includes","code","guessed_cause","jumpToQueue","route","set","setTimeout","document","getElementById","scrollIntoView","block","window","Installer","packageName","Stream","htmlFor","extiverse","href","placeholder","bidi","onsubmit","loading","data","package","LoadingModal","method","url","body","then","processing","extensionId","location","reload","errorHandler","redraw","WhyNotModal","whyNot","oncreate","requestWhyNot","reason","ExtensionItem","updates","onClickUpdate","whyNotWarning","isCore","isDanger","latestVersion","version","v","MajorUpdater","updateState","alt","src","coreUpdate","update","incompatibleExtensions","dismissible","controls","dryRun","pop","incompatible_extensions","_extends","assign","arguments","apply","_defineProperties","props","descriptor","configurable","writable","_createClass","Constructor","protoProps","staticProps","isObject","Item","priority","_items","isEmpty","has","getPriority","setContent","Error","setPriority","remove","merge","otherList","val","keepPrimitives","createItemContentProxy","sort","b","toObject","itemName","Proxy","property","receiver","Reflect","console","warn","Updater","lastUpdateCheckView","controlItems","availableUpdatesView","checkedAt","humanTime","state","extensionUpdates","updateCoreMinor","lastUpdateRun","limitedPackages","packageUpdates","updateExtension","ControlSection","SettingsPage","sections","parseInt","ExtensionPage","BYTE_UNITS","BIBYTE_UNITS","BIT_UNITS","BIBIT_UNITS","toLocaleString","number","options","result","Array","isArray","Task","Model","createdAt","isFinite","TypeError","UNITS","bits","binary","signed","localeOptions","isNegative","prefix","minimumFractionDigits","maximumFractionDigits","exponent","min","log","log10","toPrecision","prettyBytes","QueueState","limit","offset","load","params","page","payload","meta","getItems","ControlSectionState","lastUpdateCheck","JSON","parse","formatExtensionUpdates","formatCoreUpdate","isLoading","isLoadingOtherThan","setLoading","checkForUpdates","confirm","updateGlobally","installed","filter","composerPackage","safeToUpdate","values","backgroundImage","major","minor","global","PackageManagerState","queue","control","store","models","packageManager","extensionData","registerSetting","translator","trans","setting","help","trust","basic_impl_link","adv_impl_link","php_version","phpVersion","folder_perms_link","default","registerPage","isExtensionEnabled","modal","show","request","forum","attribute","alerts","close"],"sourceRoot":""} |