@xwiki/cristal-electron-renderer 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -17
- package/dist/AttachmentPreview-DNQ6Ebkw.css +0 -1
- package/dist/AttachmentPreview-DmcUO34d.js +0 -2
- package/dist/AttachmentPreview-DmcUO34d.js.map +0 -1
- package/dist/AuthServiceBanner-BArubXdu.css +0 -1
- package/dist/AuthServiceBanner-ChdElfqx.js +0 -2
- package/dist/AuthServiceBanner-ChdElfqx.js.map +0 -1
- package/dist/DeletePage-ttlY0HjN.js +0 -2
- package/dist/DeletePage-ttlY0HjN.js.map +0 -1
- package/dist/GitHubLoginMenu-Csiodp6I.js +0 -2
- package/dist/GitHubLoginMenu-Csiodp6I.js.map +0 -1
- package/dist/LoggedInMenu-DWOuONhZ.js +0 -2
- package/dist/LoggedInMenu-DWOuONhZ.js.map +0 -1
- package/dist/LoginMenu-Bwz_qtz_.js +0 -2
- package/dist/LoginMenu-Bwz_qtz_.js.map +0 -1
- package/dist/MovePage-B-6I8pRk.js +0 -2
- package/dist/MovePage-B-6I8pRk.js.map +0 -1
- package/dist/MovePage-BHS998Jm.css +0 -1
- package/dist/NextcloudLoginMenu-DGCgMCya.css +0 -1
- package/dist/NextcloudLoginMenu-DxWXKyFo.js +0 -2
- package/dist/NextcloudLoginMenu-DxWXKyFo.js.map +0 -1
- package/dist/RenamePage-Db1fLUHy.js +0 -2
- package/dist/RenamePage-Db1fLUHy.js.map +0 -1
- package/dist/SettingsConfigurations-B9GWI5mw.css +0 -1
- package/dist/SettingsConfigurations-DKf33rjI.js +0 -2
- package/dist/SettingsConfigurations-DKf33rjI.js.map +0 -1
- package/dist/c-config-menu-BGV5XXU8.css +0 -1
- package/dist/c-config-menu-CmcdRZXV.js +0 -2
- package/dist/c-config-menu-CmcdRZXV.js.map +0 -1
- package/dist/c-edit-blocknote-DwSRLR1x.js +0 -259
- package/dist/c-edit-blocknote-DwSRLR1x.js.map +0 -1
- package/dist/c-edit-blocknote-xpE8qhtQ.css +0 -1
- package/dist/chunk.24ZZSBUF-BmQPh48m.js +0 -89
- package/dist/chunk.24ZZSBUF-BmQPh48m.js.map +0 -1
- package/dist/chunk.36O46B5H-Cv2poSyf.js +0 -64
- package/dist/chunk.36O46B5H-Cv2poSyf.js.map +0 -1
- package/dist/chunk.3LWOA5DF-D8Va5Pmw.js +0 -77
- package/dist/chunk.3LWOA5DF-D8Va5Pmw.js.map +0 -1
- package/dist/chunk.3RPBFEDE-DI7eSlIl.js +0 -2
- package/dist/chunk.3RPBFEDE-DI7eSlIl.js.map +0 -1
- package/dist/chunk.4TUIT776-BvlNwMXD.js +0 -18
- package/dist/chunk.4TUIT776-BvlNwMXD.js.map +0 -1
- package/dist/chunk.6CTB5ZDJ-9Su7bEUQ.js +0 -2
- package/dist/chunk.6CTB5ZDJ-9Su7bEUQ.js.map +0 -1
- package/dist/chunk.7E4JTYWU-Ci99jpyG.js +0 -75
- package/dist/chunk.7E4JTYWU-Ci99jpyG.js.map +0 -1
- package/dist/chunk.AJ3ENQ5C-zot94vv9.js +0 -2
- package/dist/chunk.AJ3ENQ5C-zot94vv9.js.map +0 -1
- package/dist/chunk.B4BZKR24-B0iVuGLD.js +0 -2
- package/dist/chunk.B4BZKR24-B0iVuGLD.js.map +0 -1
- package/dist/chunk.D5YQDJ7X-_UyNui_V.js +0 -2
- package/dist/chunk.D5YQDJ7X-_UyNui_V.js.map +0 -1
- package/dist/chunk.DFHYNK3F-bS0lNIuO.js +0 -86
- package/dist/chunk.DFHYNK3F-bS0lNIuO.js.map +0 -1
- package/dist/chunk.GMYPQTFK-BT1AAYXJ.js +0 -2
- package/dist/chunk.GMYPQTFK-BT1AAYXJ.js.map +0 -1
- package/dist/chunk.J5ZM7LIC-n6gjp3-L.js +0 -244
- package/dist/chunk.J5ZM7LIC-n6gjp3-L.js.map +0 -1
- package/dist/chunk.JCXLDPQF-BOaK9AtU.js +0 -622
- package/dist/chunk.JCXLDPQF-BOaK9AtU.js.map +0 -1
- package/dist/chunk.JHOXTQXA-CWkZ1weQ.js +0 -24
- package/dist/chunk.JHOXTQXA-CWkZ1weQ.js.map +0 -1
- package/dist/chunk.JQBT7BOV-BKSO0Hfn.js +0 -3378
- package/dist/chunk.JQBT7BOV-BKSO0Hfn.js.map +0 -1
- package/dist/chunk.JXOKFADN-DpK3Q_uU.js +0 -785
- package/dist/chunk.JXOKFADN-DpK3Q_uU.js.map +0 -1
- package/dist/chunk.KPLQLAWP-DUYDfZ7-.js +0 -163
- package/dist/chunk.KPLQLAWP-DUYDfZ7-.js.map +0 -1
- package/dist/chunk.LD4M4QGE-cX1_6HT7.js +0 -2
- package/dist/chunk.LD4M4QGE-cX1_6HT7.js.map +0 -1
- package/dist/chunk.NYIIDP5N-AHr3eTN0.js +0 -2
- package/dist/chunk.NYIIDP5N-AHr3eTN0.js.map +0 -1
- package/dist/chunk.R45OWEVP-WMyXo-Fn.js +0 -181
- package/dist/chunk.R45OWEVP-WMyXo-Fn.js.map +0 -1
- package/dist/chunk.RWUUFNUL-BJhNq5wM.js +0 -2
- package/dist/chunk.RWUUFNUL-BJhNq5wM.js.map +0 -1
- package/dist/chunk.RY756JLP-BUknFjxa.js +0 -22
- package/dist/chunk.RY756JLP-BUknFjxa.js.map +0 -1
- package/dist/chunk.SI4ACBFK-BB831ml8.js +0 -58
- package/dist/chunk.SI4ACBFK-BB831ml8.js.map +0 -1
- package/dist/chunk.TRHSUYII-DFnBKJNh.js +0 -140
- package/dist/chunk.TRHSUYII-DFnBKJNh.js.map +0 -1
- package/dist/chunk.XA43ZQPC-maNlqVLX.js +0 -395
- package/dist/chunk.XA43ZQPC-maNlqVLX.js.map +0 -1
- package/dist/chunk.XSFJLY2D-ldEKWtxN.js +0 -178
- package/dist/chunk.XSFJLY2D-ldEKWtxN.js.map +0 -1
- package/dist/chunk.YHLNUJ7P-BGNuPG1R.js +0 -109
- package/dist/chunk.YHLNUJ7P-BGNuPG1R.js.map +0 -1
- package/dist/chunk.ZGGPD2XJ-DD1S3h7C.js +0 -2
- package/dist/chunk.ZGGPD2XJ-DD1S3h7C.js.map +0 -1
- package/dist/chunk.ZH2AND3P-CzagA8cz.js +0 -288
- package/dist/chunk.ZH2AND3P-CzagA8cz.js.map +0 -1
- package/dist/class-map-DmaCJs8c.js +0 -2
- package/dist/class-map-DmaCJs8c.js.map +0 -1
- package/dist/filesystem-internal-link-serializer-BOne-ZvI.js +0 -2
- package/dist/filesystem-internal-link-serializer-BOne-ZvI.js.map +0 -1
- package/dist/floating-ui.dom-1S43Ew4Q.js +0 -2
- package/dist/floating-ui.dom-1S43Ew4Q.js.map +0 -1
- package/dist/github-CGNzogjY.js +0 -3
- package/dist/github-CGNzogjY.js.map +0 -1
- package/dist/github-internal-link-serializer-BGkdMYJI.js +0 -2
- package/dist/github-internal-link-serializer-BGkdMYJI.js.map +0 -1
- package/dist/hocuspocus-provider.esm-DpwNtHpL.js +0 -2
- package/dist/hocuspocus-provider.esm-DpwNtHpL.js.map +0 -1
- package/dist/if-defined-O-hFrvt0.js +0 -2
- package/dist/if-defined-O-hFrvt0.js.map +0 -1
- package/dist/index-B7HOg_tC.js +0 -254
- package/dist/index-B7HOg_tC.js.map +0 -1
- package/dist/index-BgL5UHSB.css +0 -1
- package/dist/index-DTmXfR9q.js +0 -3
- package/dist/index-DTmXfR9q.js.map +0 -1
- package/dist/index-DWPjg9z3.js +0 -2
- package/dist/index-DWPjg9z3.js.map +0 -1
- package/dist/index.html +0 -13
- package/dist/live-z5w0O4st.js +0 -2
- package/dist/live-z5w0O4st.js.map +0 -1
- package/dist/module-RjUF93sV.js +0 -717
- package/dist/module-RjUF93sV.js.map +0 -1
- package/dist/native-48B9X9Wg.js +0 -2
- package/dist/native-48B9X9Wg.js.map +0 -1
- package/dist/nextcloud-CQ2JbCvQ.js +0 -31
- package/dist/nextcloud-CQ2JbCvQ.js.map +0 -1
- package/dist/nextcloud-internal-link-serializer-qLagTAdg.js +0 -7
- package/dist/nextcloud-internal-link-serializer-qLagTAdg.js.map +0 -1
- package/dist/offline-lGzDTw-r.js +0 -4
- package/dist/offline-lGzDTw-r.js.map +0 -1
- package/dist/query-x48B6FB_.js +0 -2
- package/dist/query-x48B6FB_.js.map +0 -1
- package/dist/shoelace-fOJMLOCp.js +0 -3
- package/dist/shoelace-fOJMLOCp.js.map +0 -1
- package/dist/static-Dm20cmTz.js +0 -3
- package/dist/static-Dm20cmTz.js.map +0 -1
- package/dist/staticBuild-BOgweg16.js +0 -2
- package/dist/staticBuild-BOgweg16.js.map +0 -1
- package/dist/translations-D5nOIu3x.js +0 -2
- package/dist/translations-D5nOIu3x.js.map +0 -1
- package/dist/translations-Ds9OkLNv.js +0 -2
- package/dist/translations-Ds9OkLNv.js.map +0 -1
- package/dist/vuetify-CJV1Jf0o.js +0 -21
- package/dist/vuetify-CJV1Jf0o.js.map +0 -1
- package/dist/vuetify-yTaAqVoQ.css +0 -1
- package/dist/worker-C267fLfn.js +0 -202
- package/dist/worker-C267fLfn.js.map +0 -1
- package/dist/x-alert-BhErtBtU.css +0 -1
- package/dist/x-alert-Bo-c4sd8.js +0 -2
- package/dist/x-alert-Bo-c4sd8.js.map +0 -1
- package/dist/x-alert-DfYpLdml.css +0 -1
- package/dist/x-alert-iPDEBtQL.js +0 -2
- package/dist/x-alert-iPDEBtQL.js.map +0 -1
- package/dist/x-avatar-2efH4gNX.css +0 -1
- package/dist/x-avatar-CBx0PT77.js +0 -2
- package/dist/x-avatar-CBx0PT77.js.map +0 -1
- package/dist/x-avatar-Do0uzcGf.js +0 -2
- package/dist/x-avatar-Do0uzcGf.js.map +0 -1
- package/dist/x-breadcrumb-BMSNlvvi.css +0 -1
- package/dist/x-breadcrumb-HTdiGdCL.js +0 -2
- package/dist/x-breadcrumb-HTdiGdCL.js.map +0 -1
- package/dist/x-breadcrumb-zrKcaFfC.js +0 -2
- package/dist/x-breadcrumb-zrKcaFfC.js.map +0 -1
- package/dist/x-btn-C6CLTqa7.js +0 -2
- package/dist/x-btn-C6CLTqa7.js.map +0 -1
- package/dist/x-btn-DPGq6Sd-.css +0 -1
- package/dist/x-btn-TXMfg-5G.js +0 -2
- package/dist/x-btn-TXMfg-5G.js.map +0 -1
- package/dist/x-btn.vue_vue_type_script_setup_true_lang-CARXp5Xp.js +0 -2
- package/dist/x-btn.vue_vue_type_script_setup_true_lang-CARXp5Xp.js.map +0 -1
- package/dist/x-card-CJQtO6wd.js +0 -2
- package/dist/x-card-CJQtO6wd.js.map +0 -1
- package/dist/x-card-DZkGTPkV.js +0 -2
- package/dist/x-card-DZkGTPkV.js.map +0 -1
- package/dist/x-checkbox-BoqoQxdA.css +0 -1
- package/dist/x-checkbox-COxu3htb.js +0 -2
- package/dist/x-checkbox-COxu3htb.js.map +0 -1
- package/dist/x-checkbox-DykPAWbI.js +0 -2
- package/dist/x-checkbox-DykPAWbI.js.map +0 -1
- package/dist/x-col-Cr4ppY2u.js +0 -2
- package/dist/x-col-Cr4ppY2u.js.map +0 -1
- package/dist/x-container-D1TcVPe4.js +0 -2
- package/dist/x-container-D1TcVPe4.js.map +0 -1
- package/dist/x-dialog-Bk9LE0HR.css +0 -1
- package/dist/x-dialog-DpDwSqtj.js +0 -2
- package/dist/x-dialog-DpDwSqtj.js.map +0 -1
- package/dist/x-dialog-VzzVz38L.css +0 -1
- package/dist/x-dialog-o95lWpug.js +0 -2
- package/dist/x-dialog-o95lWpug.js.map +0 -1
- package/dist/x-divider-BfvWE9xx.js +0 -2
- package/dist/x-divider-BfvWE9xx.js.map +0 -1
- package/dist/x-divider-CyQQBVg0.js +0 -2
- package/dist/x-divider-CyQQBVg0.js.map +0 -1
- package/dist/x-dropdown-BPYmh0ED.js +0 -2
- package/dist/x-dropdown-BPYmh0ED.js.map +0 -1
- package/dist/x-dropdown-C0eWLs8m.js +0 -2
- package/dist/x-dropdown-C0eWLs8m.js.map +0 -1
- package/dist/x-dropdown-CxWpPIwn.css +0 -1
- package/dist/x-dropdown-GNs7ILlc.css +0 -1
- package/dist/x-file-input-BSstA5LD.css +0 -1
- package/dist/x-file-input-C3zWnjnM.js +0 -2
- package/dist/x-file-input-C3zWnjnM.js.map +0 -1
- package/dist/x-file-input-I5f_Xur8.js +0 -2
- package/dist/x-file-input-I5f_Xur8.js.map +0 -1
- package/dist/x-form-CK24VrXN.css +0 -1
- package/dist/x-form-CUJhQDpC.js +0 -2
- package/dist/x-form-CUJhQDpC.js.map +0 -1
- package/dist/x-form-DGUS5Veh.css +0 -1
- package/dist/x-form-DvYxiGYI.js +0 -2
- package/dist/x-form-DvYxiGYI.js.map +0 -1
- package/dist/x-img-B3bwcipR.js +0 -2
- package/dist/x-img-B3bwcipR.js.map +0 -1
- package/dist/x-img-Bmlsvg1a.js +0 -2
- package/dist/x-img-Bmlsvg1a.js.map +0 -1
- package/dist/x-load-BlPeW_ej.css +0 -1
- package/dist/x-load-BsACA7Yh.css +0 -1
- package/dist/x-load-CBeg_T3j.js +0 -2
- package/dist/x-load-CBeg_T3j.js.map +0 -1
- package/dist/x-load-DP6QIpju.js +0 -2
- package/dist/x-load-DP6QIpju.js.map +0 -1
- package/dist/x-menu-BmuGyRjl.css +0 -1
- package/dist/x-menu-fzYlqJyV.js +0 -2
- package/dist/x-menu-fzYlqJyV.js.map +0 -1
- package/dist/x-menu-item-CTnQPDyU.js +0 -2
- package/dist/x-menu-item-CTnQPDyU.js.map +0 -1
- package/dist/x-menu-item-DLbqVWzS.js +0 -2
- package/dist/x-menu-item-DLbqVWzS.js.map +0 -1
- package/dist/x-menu-j6yX563A.js +0 -2
- package/dist/x-menu-j6yX563A.js.map +0 -1
- package/dist/x-menu-label-BLmtnk8J.js +0 -2
- package/dist/x-menu-label-BLmtnk8J.js.map +0 -1
- package/dist/x-menu-label-DXnUzNu1.js +0 -2
- package/dist/x-menu-label-DXnUzNu1.js.map +0 -1
- package/dist/x-menu-label-DhRAj-fk.css +0 -1
- package/dist/x-row-Cr4ppY2u.js +0 -2
- package/dist/x-row-Cr4ppY2u.js.map +0 -1
- package/dist/x-search-B99zXUrg.js +0 -2
- package/dist/x-search-B99zXUrg.js.map +0 -1
- package/dist/x-search-CVyiz17E.js +0 -2
- package/dist/x-search-CVyiz17E.js.map +0 -1
- package/dist/x-select-DpGG8AuD.js +0 -2
- package/dist/x-select-DpGG8AuD.js.map +0 -1
- package/dist/x-select-DrHr7Shp.js +0 -2
- package/dist/x-select-DrHr7Shp.js.map +0 -1
- package/dist/x-tab-c-e3rymA.js +0 -2
- package/dist/x-tab-c-e3rymA.js.map +0 -1
- package/dist/x-tab-grZhQqAi.js +0 -2
- package/dist/x-tab-grZhQqAi.js.map +0 -1
- package/dist/x-tab-group-BwvoSXDb.js +0 -2
- package/dist/x-tab-group-BwvoSXDb.js.map +0 -1
- package/dist/x-tab-group-DKKRxIP0.js +0 -2
- package/dist/x-tab-group-DKKRxIP0.js.map +0 -1
- package/dist/x-tab-panel-BkaSuvQL.js +0 -2
- package/dist/x-tab-panel-BkaSuvQL.js.map +0 -1
- package/dist/x-tab-panel-DIMNu54Y.js +0 -2
- package/dist/x-tab-panel-DIMNu54Y.js.map +0 -1
- package/dist/x-text-field-BdKCeID0.js +0 -2
- package/dist/x-text-field-BdKCeID0.js.map +0 -1
- package/dist/x-text-field-C8txfmgG.js +0 -2
- package/dist/x-text-field-C8txfmgG.js.map +0 -1
- package/dist/x-tree-Ct89gjKs.js +0 -2
- package/dist/x-tree-Ct89gjKs.js.map +0 -1
- package/dist/x-tree-D0WG-8EM.css +0 -1
- package/dist/x-tree-DZgepjwE.js +0 -2
- package/dist/x-tree-DZgepjwE.js.map +0 -1
- package/dist/x-tree-OLo4IKf9.css +0 -1
- package/dist/xwiki-OgNiU9fx.js +0 -4
- package/dist/xwiki-OgNiU9fx.js.map +0 -1
- package/dist/xwiki-internal-link-serializer-Cd8xorru-BvcqTQNz.js +0 -2
- package/dist/xwiki-internal-link-serializer-Cd8xorru-BvcqTQNz.js.map +0 -1
- package/dist/xwiki-logo-color-DZ9bdNW4.svg +0 -18
- package/dist/yjs-VtUl3AlT.js +0 -6
- package/dist/yjs-VtUl3AlT.js.map +0 -1
package/dist/worker-C267fLfn.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
var lr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Md(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ol={};var al;function Rd(){if(al)return ol;al=1;var t;return(function(e){(function(n){var i=typeof globalThis=="object"?globalThis:typeof lr=="object"?lr:typeof self=="object"?self:typeof this=="object"?this:d(),r=s(e);typeof i.Reflect<"u"&&(r=s(i.Reflect,r)),n(r,i),typeof i.Reflect>"u"&&(i.Reflect=e);function s(g,v){return function(b,w){Object.defineProperty(g,b,{configurable:!0,writable:!0,value:w}),v&&v(b,w)}}function a(){try{return Function("return this;")()}catch{}}function u(){try{return(0,eval)("(function() { return this; })()")}catch{}}function d(){return a()||u()}})(function(n,i){var r=Object.prototype.hasOwnProperty,s=typeof Symbol=="function",a=s&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",u=s&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",d=typeof Object.create=="function",g={__proto__:[]}instanceof Array,v=!d&&!g,b={create:d?function(){return nt(Object.create(null))}:g?function(){return nt({__proto__:null})}:function(){return nt({})},has:v?function(S,A){return r.call(S,A)}:function(S,A){return A in S},get:v?function(S,A){return r.call(S,A)?S[A]:void 0}:function(S,A){return S[A]}},w=Object.getPrototypeOf(Function),j=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:st(),z=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:qe(),M=typeof WeakMap=="function"?WeakMap:vt(),K=s?Symbol.for("@reflect-metadata:registry"):void 0,te=q(),Y=V(te);function se(S,A,T,D){if(ve(T)){if(!Ae(S))throw new TypeError;if(!$n(A))throw new TypeError;return rt(S,A)}else{if(!Ae(S))throw new TypeError;if(!Pe(A))throw new TypeError;if(!Pe(D)&&!ve(D)&&!dt(D))throw new TypeError;return dt(D)&&(D=void 0),T=pt(T),gn(S,A,T,D)}}n("decorate",se);function J(S,A){function T(D,F){if(!Pe(D))throw new TypeError;if(!ve(F)&&!Tt(F))throw new TypeError;ft(S,A,D,F)}return T}n("metadata",J);function ie(S,A,T,D){if(!Pe(T))throw new TypeError;return ve(D)||(D=pt(D)),ft(S,A,T,D)}n("defineMetadata",ie);function ue(S,A,T){if(!Pe(A))throw new TypeError;return ve(T)||(T=pt(T)),qt(S,A,T)}n("hasMetadata",ue);function pe(S,A,T){if(!Pe(A))throw new TypeError;return ve(T)||(T=pt(T)),ut(S,A,T)}n("hasOwnMetadata",pe);function G(S,A,T){if(!Pe(A))throw new TypeError;return ve(T)||(T=pt(T)),tt(S,A,T)}n("getMetadata",G);function ge(S,A,T){if(!Pe(A))throw new TypeError;return ve(T)||(T=pt(T)),he(S,A,T)}n("getOwnMetadata",ge);function je(S,A){if(!Pe(S))throw new TypeError;return ve(A)||(A=pt(A)),St(S,A)}n("getMetadataKeys",je);function We(S,A){if(!Pe(S))throw new TypeError;return ve(A)||(A=pt(A)),Ue(S,A)}n("getOwnMetadataKeys",We);function _e(S,A,T){if(!Pe(A))throw new TypeError;if(ve(T)||(T=pt(T)),!Pe(A))throw new TypeError;ve(T)||(T=pt(T));var D=de(A,T,!1);return ve(D)?!1:D.OrdinaryDeleteMetadata(S,A,T)}n("deleteMetadata",_e);function rt(S,A){for(var T=S.length-1;T>=0;--T){var D=S[T],F=D(A);if(!ve(F)&&!dt(F)){if(!$n(F))throw new TypeError;A=F}}return A}function gn(S,A,T,D){for(var F=S.length-1;F>=0;--F){var ye=S[F],xe=ye(A,T,D);if(!ve(xe)&&!dt(xe)){if(!Pe(xe))throw new TypeError;D=xe}}return D}function qt(S,A,T){var D=ut(S,A,T);if(D)return!0;var F=Nt(A);return dt(F)?!1:qt(S,F,T)}function ut(S,A,T){var D=de(A,T,!1);return ve(D)?!1:Ln(D.OrdinaryHasOwnMetadata(S,A,T))}function tt(S,A,T){var D=ut(S,A,T);if(D)return he(S,A,T);var F=Nt(A);if(!dt(F))return tt(S,F,T)}function he(S,A,T){var D=de(A,T,!1);if(!ve(D))return D.OrdinaryGetOwnMetadata(S,A,T)}function ft(S,A,T,D){var F=de(T,D,!0);F.OrdinaryDefineOwnMetadata(S,A,T,D)}function St(S,A){var T=Ue(S,A),D=Nt(S);if(D===null)return T;var F=St(D,A);if(F.length<=0)return T;if(T.length<=0)return F;for(var ye=new z,xe=[],be=0,L=T;be<L.length;be++){var re=L[be],ae=ye.has(re);ae||(ye.add(re),xe.push(re))}for(var le=0,Se=F;le<Se.length;le++){var re=Se[le],ae=ye.has(re);ae||(ye.add(re),xe.push(re))}return xe}function Ue(S,A){var T=de(S,A,!1);return T?T.OrdinaryOwnMetadataKeys(S,A):[]}function kt(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}function ve(S){return S===void 0}function dt(S){return S===null}function oi(S){return typeof S=="symbol"}function Pe(S){return typeof S=="object"?S!==null:typeof S=="function"}function Vt(S,A){switch(kt(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var T="string",D=Qt(S,a);if(D!==void 0){var F=D.call(S,T);if(Pe(F))throw new TypeError;return F}return Jt(S)}function Jt(S,A){var T,D;{var F=S.toString;if(Et(F)){var D=F.call(S);if(!Pe(D))return D}var T=S.valueOf;if(Et(T)){var D=T.call(S);if(!Pe(D))return D}}throw new TypeError}function Ln(S){return!!S}function fe(S){return""+S}function pt(S){var A=Vt(S);return oi(A)?A:fe(A)}function Ae(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}function Et(S){return typeof S=="function"}function $n(S){return typeof S=="function"}function Tt(S){switch(kt(S)){case 3:return!0;case 4:return!0;default:return!1}}function rn(S,A){return S===A||S!==S&&A!==A}function Qt(S,A){var T=S[A];if(T!=null){if(!Et(T))throw new TypeError;return T}}function ai(S){var A=Qt(S,u);if(!Et(A))throw new TypeError;var T=A.call(S);if(!Pe(T))throw new TypeError;return T}function ci(S){return S.value}function mn(S){var A=S.next();return A.done?!1:A}function mt(S){var A=S.return;A&&A.call(S)}function Nt(S){var A=Object.getPrototypeOf(S);if(typeof S!="function"||S===w||A!==w)return A;var T=S.prototype,D=T&&Object.getPrototypeOf(T);if(D==null||D===Object.prototype)return A;var F=D.constructor;return typeof F!="function"||F===S?A:F}function $(){var S;!ve(K)&&typeof i.Reflect<"u"&&!(K in i.Reflect)&&typeof i.Reflect.defineMetadata=="function"&&(S=Q(i.Reflect));var A,T,D,F=new M,ye={registerProvider:xe,getProvider:L,setProvider:ae};return ye;function xe(le){if(!Object.isExtensible(ye))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case S===le:break;case ve(A):A=le;break;case A===le:break;case ve(T):T=le;break;case T===le:break;default:D===void 0&&(D=new z),D.add(le);break}}function be(le,Se){if(!ve(A)){if(A.isProviderFor(le,Se))return A;if(!ve(T)){if(T.isProviderFor(le,Se))return A;if(!ve(D))for(var Be=ai(D);;){var Ve=mn(Be);if(!Ve)return;var It=ci(Ve);if(It.isProviderFor(le,Se))return mt(Be),It}}}if(!ve(S)&&S.isProviderFor(le,Se))return S}function L(le,Se){var Be=F.get(le),Ve;return ve(Be)||(Ve=Be.get(Se)),ve(Ve)&&(Ve=be(le,Se),ve(Ve)||(ve(Be)&&(Be=new j,F.set(le,Be)),Be.set(Se,Ve))),Ve}function re(le){if(ve(le))throw new TypeError;return A===le||T===le||!ve(D)&&D.has(le)}function ae(le,Se,Be){if(!re(Be))throw new Error("Metadata provider not registered.");var Ve=L(le,Se);if(Ve!==Be){if(!ve(Ve))return!1;var It=F.get(le);ve(It)&&(It=new j,F.set(le,It)),It.set(Se,Be)}return!0}}function q(){var S;return!ve(K)&&Pe(i.Reflect)&&Object.isExtensible(i.Reflect)&&(S=i.Reflect[K]),ve(S)&&(S=$()),!ve(K)&&Pe(i.Reflect)&&Object.isExtensible(i.Reflect)&&Object.defineProperty(i.Reflect,K,{enumerable:!1,configurable:!1,writable:!1,value:S}),S}function V(S){var A=new M,T={isProviderFor:function(re,ae){var le=A.get(re);return ve(le)?!1:le.has(ae)},OrdinaryDefineOwnMetadata:xe,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:ye,OrdinaryOwnMetadataKeys:be,OrdinaryDeleteMetadata:L};return te.registerProvider(T),T;function D(re,ae,le){var Se=A.get(re),Be=!1;if(ve(Se)){if(!le)return;Se=new j,A.set(re,Se),Be=!0}var Ve=Se.get(ae);if(ve(Ve)){if(!le)return;if(Ve=new j,Se.set(ae,Ve),!S.setProvider(re,ae,T))throw Se.delete(ae),Be&&A.delete(re),new Error("Wrong provider for target.")}return Ve}function F(re,ae,le){var Se=D(ae,le,!1);return ve(Se)?!1:Ln(Se.has(re))}function ye(re,ae,le){var Se=D(ae,le,!1);if(!ve(Se))return Se.get(re)}function xe(re,ae,le,Se){var Be=D(le,Se,!0);Be.set(re,ae)}function be(re,ae){var le=[],Se=D(re,ae,!1);if(ve(Se))return le;for(var Be=Se.keys(),Ve=ai(Be),It=0;;){var sn=mn(Ve);if(!sn)return le.length=It,le;var vn=ci(sn);try{le[It]=vn}catch($i){try{mt(Ve)}finally{throw $i}}It++}}function L(re,ae,le){var Se=D(ae,le,!1);if(ve(Se)||!Se.delete(re))return!1;if(Se.size===0){var Be=A.get(ae);ve(Be)||(Be.delete(le),Be.size===0&&A.delete(Be))}return!0}}function Q(S){var A=S.defineMetadata,T=S.hasOwnMetadata,D=S.getOwnMetadata,F=S.getOwnMetadataKeys,ye=S.deleteMetadata,xe=new M,be={isProviderFor:function(L,re){var ae=xe.get(L);return!ve(ae)&&ae.has(re)?!0:F(L,re).length?(ve(ae)&&(ae=new z,xe.set(L,ae)),ae.add(re),!0):!1},OrdinaryDefineOwnMetadata:A,OrdinaryHasOwnMetadata:T,OrdinaryGetOwnMetadata:D,OrdinaryOwnMetadataKeys:F,OrdinaryDeleteMetadata:ye};return be}function de(S,A,T){var D=te.getProvider(S,A);if(!ve(D))return D;if(T){if(te.setProvider(S,A,Y))return Y;throw new Error("Illegal state.")}}function st(){var S={},A=[],T=(function(){function be(L,re,ae){this._index=0,this._keys=L,this._values=re,this._selector=ae}return be.prototype["@@iterator"]=function(){return this},be.prototype[u]=function(){return this},be.prototype.next=function(){var L=this._index;if(L>=0&&L<this._keys.length){var re=this._selector(this._keys[L],this._values[L]);return L+1>=this._keys.length?(this._index=-1,this._keys=A,this._values=A):this._index++,{value:re,done:!1}}return{value:void 0,done:!0}},be.prototype.throw=function(L){throw this._index>=0&&(this._index=-1,this._keys=A,this._values=A),L},be.prototype.return=function(L){return this._index>=0&&(this._index=-1,this._keys=A,this._values=A),{value:L,done:!0}},be})(),D=(function(){function be(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return Object.defineProperty(be.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),be.prototype.has=function(L){return this._find(L,!1)>=0},be.prototype.get=function(L){var re=this._find(L,!1);return re>=0?this._values[re]:void 0},be.prototype.set=function(L,re){var ae=this._find(L,!0);return this._values[ae]=re,this},be.prototype.delete=function(L){var re=this._find(L,!1);if(re>=0){for(var ae=this._keys.length,le=re+1;le<ae;le++)this._keys[le-1]=this._keys[le],this._values[le-1]=this._values[le];return this._keys.length--,this._values.length--,rn(L,this._cacheKey)&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},be.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},be.prototype.keys=function(){return new T(this._keys,this._values,F)},be.prototype.values=function(){return new T(this._keys,this._values,ye)},be.prototype.entries=function(){return new T(this._keys,this._values,xe)},be.prototype["@@iterator"]=function(){return this.entries()},be.prototype[u]=function(){return this.entries()},be.prototype._find=function(L,re){if(!rn(this._cacheKey,L)){this._cacheIndex=-1;for(var ae=0;ae<this._keys.length;ae++)if(rn(this._keys[ae],L)){this._cacheIndex=ae;break}}return this._cacheIndex<0&&re&&(this._cacheIndex=this._keys.length,this._keys.push(L),this._values.push(void 0)),this._cacheIndex},be})();return D;function F(be,L){return be}function ye(be,L){return L}function xe(be,L){return[be,L]}}function qe(){var S=(function(){function A(){this._map=new j}return Object.defineProperty(A.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),A.prototype.has=function(T){return this._map.has(T)},A.prototype.add=function(T){return this._map.set(T,T),this},A.prototype.delete=function(T){return this._map.delete(T)},A.prototype.clear=function(){this._map.clear()},A.prototype.keys=function(){return this._map.keys()},A.prototype.values=function(){return this._map.keys()},A.prototype.entries=function(){return this._map.entries()},A.prototype["@@iterator"]=function(){return this.keys()},A.prototype[u]=function(){return this.keys()},A})();return S}function vt(){var S=16,A=b.create(),T=D();return(function(){function L(){this._key=D()}return L.prototype.has=function(re){var ae=F(re,!1);return ae!==void 0?b.has(ae,this._key):!1},L.prototype.get=function(re){var ae=F(re,!1);return ae!==void 0?b.get(ae,this._key):void 0},L.prototype.set=function(re,ae){var le=F(re,!0);return le[this._key]=ae,this},L.prototype.delete=function(re){var ae=F(re,!1);return ae!==void 0?delete ae[this._key]:!1},L.prototype.clear=function(){this._key=D()},L})();function D(){var L;do L="@@WeakMap@@"+be();while(b.has(A,L));return A[L]=!0,L}function F(L,re){if(!r.call(L,T)){if(!re)return;Object.defineProperty(L,T,{value:b.create()})}return L[T]}function ye(L,re){for(var ae=0;ae<re;++ae)L[ae]=Math.random()*255|0;return L}function xe(L){if(typeof Uint8Array=="function"){var re=new Uint8Array(L);return typeof crypto<"u"?crypto.getRandomValues(re):typeof msCrypto<"u"?msCrypto.getRandomValues(re):ye(re,L),re}return ye(new Array(L),L)}function be(){var L=xe(S);L[6]=L[6]&79|64,L[8]=L[8]&191|128;for(var re="",ae=0;ae<S;++ae){var le=L[ae];(ae===4||ae===6||ae===8)&&(re+="-"),le<16&&(re+="0"),re+=le.toString(16).toLowerCase()}return re}}function nt(S){return S.__=void 0,delete S.__,S}})})(t||(t={})),ol}Rd();function jd(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Fa={},vs=()=>{},Da=Object.assign,Bd=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Ld=Object.prototype.hasOwnProperty,_s=(t,e)=>Ld.call(t,e),Ft=Array.isArray,tr=t=>Ls(t)==="[object Map]",$d=t=>Ls(t)==="[object Set]",fn=t=>typeof t=="function",Fd=t=>typeof t=="string",Sr=t=>typeof t=="symbol",Rn=t=>t!==null&&typeof t=="object",Dd=t=>(Rn(t)||fn(t))&&fn(t.then)&&fn(t.catch),Ud=Object.prototype.toString,Ls=t=>Ud.call(t),Kd=t=>Ls(t).slice(8,-1),qd=t=>Ls(t)==="[object Object]",$s=t=>Fd(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,tn=(t,e)=>!Object.is(t,e),Vd=(t,e,n,i=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:n})};let cl;const Ua=()=>cl||(cl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});let gt;class zd{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=gt,!e&>&&(this.index=(gt.scopes||(gt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=gt;try{return gt=this,e()}finally{gt=n}}}on(){++this._on===1&&(this.prevScope=gt,gt=this)}off(){this._on>0&&--this._on===0&&(gt=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n<i;n++)this.effects[n].stop();for(this.effects.length=0,n=0,i=this.cleanups.length;n<i;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,i=this.scopes.length;n<i;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Wd(t){return new zd(t)}function Zl(){return gt}function Hd(t,e=!1){gt&>.cleanups.push(t)}let Fe;const No=new WeakSet;class Gd{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,gt&>.active&>.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,No.has(this)&&(No.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||tu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ll(this),nu(this);const e=Fe,n=Ht;Fe=this,Ht=!0;try{return this.fn()}finally{iu(this),Fe=e,Ht=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Va(e);this.deps=this.depsTail=void 0,ll(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?No.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ia(this)&&this.run()}get dirty(){return ia(this)}}let eu=0,nr,ir;function tu(t,e=!1){if(t.flags|=8,e){t.next=ir,ir=t;return}t.next=nr,nr=t}function Ka(){eu++}function qa(){if(--eu>0)return;if(ir){let e=ir;for(ir=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;nr;){let e=nr;for(nr=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){t||(t=i)}e=n}}if(t)throw t}function nu(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function iu(t){let e,n=t.depsTail,i=n;for(;i;){const r=i.prevDep;i.version===-1?(i===n&&(n=r),Va(i),Yd(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}t.deps=e,t.depsTail=n}function ia(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(ru(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function ru(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===ur)||(t.globalVersion=ur,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!ia(t))))return;t.flags|=2;const e=t.dep,n=Fe,i=Ht;Fe=t,Ht=!0;try{nu(t);const r=t.fn(t._value);(e.version===0||tn(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{Fe=n,Ht=i,iu(t),t.flags&=-3}}function Va(t,e=!1){const{dep:n,prevSub:i,nextSub:r}=t;if(i&&(i.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=i,t.nextSub=void 0),n.subs===t&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Va(s,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function Yd(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let Ht=!0;const su=[];function za(){su.push(Ht),Ht=!1}function Wa(){const t=su.pop();Ht=t===void 0?!0:t}function ll(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=Fe;Fe=void 0;try{e()}finally{Fe=n}}}let ur=0;class Jd{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ha{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Fe||!Ht||Fe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Fe)n=this.activeLink=new Jd(Fe,this),Fe.deps?(n.prevDep=Fe.depsTail,Fe.depsTail.nextDep=n,Fe.depsTail=n):Fe.deps=Fe.depsTail=n,ou(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=Fe.depsTail,n.nextDep=void 0,Fe.depsTail.nextDep=n,Fe.depsTail=n,Fe.deps===n&&(Fe.deps=i)}return n}trigger(e){this.version++,ur++,this.notify(e)}notify(e){Ka();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{qa()}}}function ou(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)ou(i)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Cs=new WeakMap,ei=Symbol(""),ra=Symbol(""),fr=Symbol("");function Ct(t,e,n){if(Ht&&Fe){let i=Cs.get(t);i||Cs.set(t,i=new Map);let r=i.get(n);r||(i.set(n,r=new Ha),r.map=i,r.key=n),r.track()}}function Pn(t,e,n,i,r,s){const a=Cs.get(t);if(!a){ur++;return}const u=d=>{d&&d.trigger()};if(Ka(),e==="clear")a.forEach(u);else{const d=Ft(t),g=d&&$s(n);if(d&&n==="length"){const v=Number(i);a.forEach((b,w)=>{(w==="length"||w===fr||!Sr(w)&&w>=v)&&u(b)})}else switch((n!==void 0||a.has(void 0))&&u(a.get(n)),g&&u(a.get(fr)),e){case"add":d?g&&u(a.get("length")):(u(a.get(ei)),tr(t)&&u(a.get(ra)));break;case"delete":d||(u(a.get(ei)),tr(t)&&u(a.get(ra)));break;case"set":tr(t)&&u(a.get(ei));break}}qa()}function Qd(t,e){const n=Cs.get(t);return n&&n.get(e)}function mi(t){const e=Me(t);return e===t?e:(Ct(e,"iterate",fr),Lt(t)?e:e.map(hn))}function Ga(t){return Ct(t=Me(t),"iterate",fr),t}function en(t,e){return jn(t)?dr(On(t)?hn(e):e):hn(e)}const Xd={__proto__:null,[Symbol.iterator](){return Mo(this,Symbol.iterator,t=>en(this,t))},concat(...t){return mi(this).concat(...t.map(e=>Ft(e)?mi(e):e))},entries(){return Mo(this,"entries",t=>(t[1]=en(this,t[1]),t))},every(t,e){return cn(this,"every",t,e,void 0,arguments)},filter(t,e){return cn(this,"filter",t,e,n=>n.map(i=>en(this,i)),arguments)},find(t,e){return cn(this,"find",t,e,n=>en(this,n),arguments)},findIndex(t,e){return cn(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return cn(this,"findLast",t,e,n=>en(this,n),arguments)},findLastIndex(t,e){return cn(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return cn(this,"forEach",t,e,void 0,arguments)},includes(...t){return Ro(this,"includes",t)},indexOf(...t){return Ro(this,"indexOf",t)},join(t){return mi(this).join(t)},lastIndexOf(...t){return Ro(this,"lastIndexOf",t)},map(t,e){return cn(this,"map",t,e,void 0,arguments)},pop(){return Gi(this,"pop")},push(...t){return Gi(this,"push",t)},reduce(t,...e){return ul(this,"reduce",t,e)},reduceRight(t,...e){return ul(this,"reduceRight",t,e)},shift(){return Gi(this,"shift")},some(t,e){return cn(this,"some",t,e,void 0,arguments)},splice(...t){return Gi(this,"splice",t)},toReversed(){return mi(this).toReversed()},toSorted(t){return mi(this).toSorted(t)},toSpliced(...t){return mi(this).toSpliced(...t)},unshift(...t){return Gi(this,"unshift",t)},values(){return Mo(this,"values",t=>en(this,t))}};function Mo(t,e,n){const i=Ga(t),r=i[e]();return i!==t&&!Lt(t)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=n(s.value)),s}),r}const Zd=Array.prototype;function cn(t,e,n,i,r,s){const a=Ga(t),u=a!==t&&!Lt(t),d=a[e];if(d!==Zd[e]){const b=d.apply(t,s);return u?hn(b):b}let g=n;a!==t&&(u?g=function(b,w){return n.call(this,en(t,b),w,t)}:n.length>2&&(g=function(b,w){return n.call(this,b,w,t)}));const v=d.call(a,g,i);return u&&r?r(v):v}function ul(t,e,n,i){const r=Ga(t),s=r!==t&&!Lt(t);let a=n,u=!1;r!==t&&(s?(u=i.length===0,a=function(g,v,b){return u&&(u=!1,g=en(t,g)),n.call(this,g,en(t,v),b,t)}):n.length>3&&(a=function(g,v,b){return n.call(this,g,v,b,t)}));const d=r[e](a,...i);return u?en(t,d):d}function Ro(t,e,n){const i=Me(t);Ct(i,"iterate",fr);const r=i[e](...n);return(r===-1||r===!1)&&pu(n[0])?(n[0]=Me(n[0]),i[e](...n)):r}function Gi(t,e,n=[]){za(),Ka();const i=Me(t)[e].apply(t,n);return qa(),Wa(),i}const ep=jd("__proto__,__v_isRef,__isVue"),au=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Sr));function tp(t){Sr(t)||(t=String(t));const e=Me(this);return Ct(e,"has",t),e.hasOwnProperty(t)}class cu{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,i){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return s;if(n==="__v_raw")return i===(r?s?fp:fu:s?up:uu).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const a=Ft(e);if(!r){let d;if(a&&(d=Xd[n]))return d;if(n==="hasOwnProperty")return tp}const u=Reflect.get(e,n,ct(e)?e:i);if((Sr(n)?au.has(n):ep(n))||(r||Ct(e,"get",n),s))return u;if(ct(u)){const d=a&&$s(n)?u:u.value;return r&&Rn(d)?oa(d):d}return Rn(u)?r?oa(u):Ya(u):u}}class np extends cu{constructor(e=!1){super(!1,e)}set(e,n,i,r){let s=e[n];const a=Ft(e)&&$s(n);if(!this._isShallow){const g=jn(s);if(!Lt(i)&&!jn(i)&&(s=Me(s),i=Me(i)),!a&&ct(s)&&!ct(i))return g||(s.value=i),!0}const u=a?Number(n)<e.length:_s(e,n),d=Reflect.set(e,n,i,ct(e)?e:r);return e===Me(r)&&(u?tn(i,s)&&Pn(e,"set",n,i):Pn(e,"add",n,i)),d}deleteProperty(e,n){const i=_s(e,n);e[n];const r=Reflect.deleteProperty(e,n);return r&&i&&Pn(e,"delete",n,void 0),r}has(e,n){const i=Reflect.has(e,n);return(!Sr(n)||!au.has(n))&&Ct(e,"has",n),i}ownKeys(e){return Ct(e,"iterate",Ft(e)?"length":ei),Reflect.ownKeys(e)}}class ip extends cu{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const rp=new np,sp=new ip,sa=t=>t,rs=t=>Reflect.getPrototypeOf(t);function op(t,e,n){return function(...i){const r=this.__v_raw,s=Me(r),a=tr(s),u=t==="entries"||t===Symbol.iterator&&a,d=t==="keys"&&a,g=r[t](...i),v=n?sa:e?dr:hn;return!e&&Ct(s,"iterate",d?ra:ei),Da(Object.create(g),{next(){const{value:b,done:w}=g.next();return w?{value:b,done:w}:{value:u?[v(b[0]),v(b[1])]:v(b),done:w}}})}}function ss(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function ap(t,e){const n={get(r){const s=this.__v_raw,a=Me(s),u=Me(r);t||(tn(r,u)&&Ct(a,"get",r),Ct(a,"get",u));const{has:d}=rs(a),g=e?sa:t?dr:hn;if(d.call(a,r))return g(s.get(r));if(d.call(a,u))return g(s.get(u));s!==a&&s.get(r)},get size(){const r=this.__v_raw;return!t&&Ct(Me(r),"iterate",ei),r.size},has(r){const s=this.__v_raw,a=Me(s),u=Me(r);return t||(tn(r,u)&&Ct(a,"has",r),Ct(a,"has",u)),r===u?s.has(r):s.has(r)||s.has(u)},forEach(r,s){const a=this,u=a.__v_raw,d=Me(u),g=e?sa:t?dr:hn;return!t&&Ct(d,"iterate",ei),u.forEach((v,b)=>r.call(s,g(v),g(b),a))}};return Da(n,t?{add:ss("add"),set:ss("set"),delete:ss("delete"),clear:ss("clear")}:{add(r){const s=Me(this),a=rs(s),u=Me(r),d=!e&&!Lt(r)&&!jn(r)?u:r;return a.has.call(s,d)||tn(r,d)&&a.has.call(s,r)||tn(u,d)&&a.has.call(s,u)||(s.add(d),Pn(s,"add",d,d)),this},set(r,s){!e&&!Lt(s)&&!jn(s)&&(s=Me(s));const a=Me(this),{has:u,get:d}=rs(a);let g=u.call(a,r);g||(r=Me(r),g=u.call(a,r));const v=d.call(a,r);return a.set(r,s),g?tn(s,v)&&Pn(a,"set",r,s):Pn(a,"add",r,s),this},delete(r){const s=Me(this),{has:a,get:u}=rs(s);let d=a.call(s,r);d||(r=Me(r),d=a.call(s,r)),u&&u.call(s,r);const g=s.delete(r);return d&&Pn(s,"delete",r,void 0),g},clear(){const r=Me(this),s=r.size!==0,a=r.clear();return s&&Pn(r,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=op(r,t,e)}),n}function lu(t,e){const n=ap(t,e);return(i,r,s)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?i:Reflect.get(_s(n,r)&&r in i?n:i,r,s)}const cp={get:lu(!1,!1)},lp={get:lu(!0,!1)},uu=new WeakMap,up=new WeakMap,fu=new WeakMap,fp=new WeakMap;function dp(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function pp(t){return t.__v_skip||!Object.isExtensible(t)?0:dp(Kd(t))}function Ya(t){return jn(t)?t:du(t,!1,rp,cp,uu)}function oa(t){return du(t,!0,sp,lp,fu)}function du(t,e,n,i,r){if(!Rn(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=pp(t);if(s===0)return t;const a=r.get(t);if(a)return a;const u=new Proxy(t,s===2?i:n);return r.set(t,u),u}function On(t){return jn(t)?On(t.__v_raw):!!(t&&t.__v_isReactive)}function jn(t){return!!(t&&t.__v_isReadonly)}function Lt(t){return!!(t&&t.__v_isShallow)}function pu(t){return t?!!t.__v_raw:!1}function Me(t){const e=t&&t.__v_raw;return e?Me(e):t}function hp(t){return!_s(t,"__v_skip")&&Object.isExtensible(t)&&Vd(t,"__v_skip",!0),t}const hn=t=>Rn(t)?Ya(t):t,dr=t=>Rn(t)?oa(t):t;function ct(t){return t?t.__v_isRef===!0:!1}function gp(t){return mp(t,!1)}function mp(t,e){return ct(t)?t:new vp(t,e)}class vp{constructor(e,n){this.dep=new Ha,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Me(e),this._value=n?e:hn(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,i=this.__v_isShallow||Lt(e)||jn(e);e=i?e:Me(e),tn(e,n)&&(this._rawValue=e,this._value=i?e:hn(e),this.dep.trigger())}}function yp(t){return ct(t)?t.value:t}function bp(t){const e=Ft(t)?new Array(t.length):{};for(const n in t)e[n]=hu(t,n);return e}class wp{constructor(e,n,i){this._object=e,this._key=n,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._raw=Me(e);let r=!0,s=e;if(!Ft(e)||!$s(String(n)))do r=!pu(s)||Lt(s);while(r&&(s=s.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=yp(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&ct(this._raw[this._key])){const n=this._object[this._key];if(ct(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return Qd(this._raw,this._key)}}class xp{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Sp(t,e,n){return ct(t)?t:fn(t)?new xp(t):Rn(t)&&arguments.length>1?hu(t,e,n):gp(t)}function hu(t,e,n){return new wp(t,e,n)}class kp{constructor(e,n,i){this.fn=e,this.setter=n,this._value=void 0,this.dep=new Ha(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ur-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Fe!==this)return tu(this,!0),!0}get value(){const e=this.dep.track();return ru(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function _p(t,e,n=!1){let i,r;return fn(t)?i=t:(i=t.get,r=t.set),new kp(i,r,n)}const os={},Es=new WeakMap;let Wn;function Cp(t,e=!1,n=Wn){if(n){let i=Es.get(n);i||Es.set(n,i=[]),i.push(t)}}function Ep(t,e,n=Fa){const{immediate:i,deep:r,once:s,scheduler:a,augmentJob:u,call:d}=n,g=J=>r?J:Lt(J)||r===!1||r===0?An(J,1):An(J);let v,b,w,j,z=!1,M=!1;if(ct(t)?(b=()=>t.value,z=Lt(t)):On(t)?(b=()=>g(t),z=!0):Ft(t)?(M=!0,z=t.some(J=>On(J)||Lt(J)),b=()=>t.map(J=>{if(ct(J))return J.value;if(On(J))return g(J);if(fn(J))return d?d(J,2):J()})):fn(t)?e?b=d?()=>d(t,2):t:b=()=>{if(w){za();try{w()}finally{Wa()}}const J=Wn;Wn=v;try{return d?d(t,3,[j]):t(j)}finally{Wn=J}}:b=vs,e&&r){const J=b,ie=r===!0?1/0:r;b=()=>An(J(),ie)}const K=Zl(),te=()=>{v.stop(),K&&K.active&&Bd(K.effects,v)};if(s&&e){const J=e;e=(...ie)=>{J(...ie),te()}}let Y=M?new Array(t.length).fill(os):os;const se=J=>{if(!(!(v.flags&1)||!v.dirty&&!J))if(e){const ie=v.run();if(r||z||(M?ie.some((ue,pe)=>tn(ue,Y[pe])):tn(ie,Y))){w&&w();const ue=Wn;Wn=v;try{const pe=[ie,Y===os?void 0:M&&Y[0]===os?[]:Y,j];Y=ie,d?d(e,3,pe):e(...pe)}finally{Wn=ue}}}else v.run()};return u&&u(se),v=new Gd(b),v.scheduler=a?()=>a(se,!1):se,j=J=>Cp(J,!1,v),w=v.onStop=()=>{const J=Es.get(v);if(J){if(d)d(J,4);else for(const ie of J)ie();Es.delete(v)}},e?i?se(!0):Y=v.run():a?a(se.bind(null,!0),!0):v.run(),te.pause=v.pause.bind(v),te.resume=v.resume.bind(v),te.stop=te,te}function An(t,e=1/0,n){if(e<=0||!Rn(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,ct(t))An(t.value,e,n);else if(Ft(t))for(let i=0;i<t.length;i++)An(t[i],e,n);else if($d(t)||tr(t))t.forEach(i=>{An(i,e,n)});else if(qd(t)){for(const i in t)An(t[i],e,n);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&An(t[i],e,n)}return t}function Ja(t,e,n,i){try{return i?t(...i):t()}catch(r){mu(r,e,n)}}function gu(t,e,n,i){if(fn(t)){const r=Ja(t,e,n,i);return r&&Dd(r)&&r.catch(s=>{mu(s,e,n)}),r}if(Ft(t)){const r=[];for(let s=0;s<t.length;s++)r.push(gu(t[s],e,n,i));return r}}function mu(t,e,n,i=!0){const r=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||Fa;if(e){let u=e.parent;const d=e.proxy,g=`https://vuejs.org/error-reference/#runtime-${n}`;for(;u;){const v=u.ec;if(v){for(let b=0;b<v.length;b++)if(v[b](t,d,g)===!1)return}u=u.parent}if(s){za(),Ja(s,null,10,[t,d,g]),Wa();return}}Ip(t,n,r,i,a)}function Ip(t,e,n,i=!0,r=!1){if(r)throw t;console.error(t)}const jt=[];let ln=-1;const Ii=[];let Cn=null,xi=0;const vu=Promise.resolve();let Is=null;function Pp(t){const e=Is||vu;return t?e.then(this?t.bind(this):t):e}function Ap(t){let e=ln+1,n=jt.length;for(;e<n;){const i=e+n>>>1,r=jt[i],s=pr(r);s<t||s===t&&r.flags&2?e=i+1:n=i}return e}function Op(t){if(!(t.flags&1)){const e=pr(t),n=jt[jt.length-1];!n||!(t.flags&2)&&e>=pr(n)?jt.push(t):jt.splice(Ap(e),0,t),t.flags|=1,yu()}}function yu(){Is||(Is=vu.then(bu))}function Tp(t){Ft(t)?Ii.push(...t):Cn&&t.id===-1?Cn.splice(xi+1,0,t):t.flags&1||(Ii.push(t),t.flags|=1),yu()}function Np(t){if(Ii.length){const e=[...new Set(Ii)].sort((n,i)=>pr(n)-pr(i));if(Ii.length=0,Cn){Cn.push(...e);return}for(Cn=e,xi=0;xi<Cn.length;xi++){const n=Cn[xi];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Cn=null,xi=0}}const pr=t=>t.id==null?t.flags&2?-1:1/0:t.id;function bu(t){try{for(ln=0;ln<jt.length;ln++){const e=jt[ln];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Ja(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;ln<jt.length;ln++){const e=jt[ln];e&&(e.flags&=-2)}ln=-1,jt.length=0,Np(),Is=null,(jt.length||Ii.length)&&bu()}}let Mp=null;function wu(t,e,n=!1){const i=Su();if(i||xu){let r=i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&t in r)return r[t];if(arguments.length>1)return n&&fn(e)?e.call(i&&i.proxy):e}}function Rp(){return!!(Su()||xu)}const jp=Symbol.for("v-scx"),Bp=()=>wu(jp);function Lp(t,e,n){return $p(t,e,n)}function $p(t,e,n=Fa){const{immediate:i,deep:r,flush:s,once:a}=n,u=Da({},n),d=e&&i||!e&&s!=="post";let g;if(Ps){if(s==="sync"){const j=Bp();g=j.__watcherHandles||(j.__watcherHandles=[])}else if(!d){const j=()=>{};return j.stop=vs,j.resume=vs,j.pause=vs,j}}const v=Qa;u.call=(j,z,M)=>gu(j,v,z,M);let b=!1;s==="post"?u.scheduler=j=>{Fp(j,v&&v.suspense)}:s!=="sync"&&(b=!0,u.scheduler=(j,z)=>{z?j():Op(j)}),u.augmentJob=j=>{e&&(j.flags|=4),b&&(j.flags|=2,v&&(j.id=v.uid,j.i=v))};const w=Ep(t,e,u);return Ps&&(g?g.push(w):d&&w()),w}Ua().requestIdleCallback;Ua().cancelIdleCallback;let xu=null;const Fp=Dp;function Dp(t,e){e&&e.pendingBranch?Ft(t)?e.effects.push(...t):e.effects.push(t):Tp(t)}let Qa=null;const Su=()=>Qa||Mp;{const t=Ua(),e=(n,i)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(i),s=>{r.length>1?r.forEach(a=>a(s)):r[0](s)}};e("__VUE_INSTANCE_SETTERS__",n=>Qa=n),e("__VUE_SSR_SETTERS__",n=>Ps=n)}let Ps=!1;const ku=(t,e)=>_p(t,e,Ps);function Ze(t){return(typeof t=="object"&&t!==null||typeof t=="function")&&typeof t.then=="function"}function lt(t){switch(typeof t){case"string":case"symbol":return t.toString();case"function":return t.name;default:throw new Error(`Unexpected ${typeof t} service id type`)}}const jo=Symbol.for("@inversifyjs/common/islazyServiceIdentifier");class Fs{[jo];#e;constructor(e){this.#e=e,this[jo]=!0}static is(e){return typeof e=="object"&&e!==null&&e[jo]===!0}unwrap(){return this.#e()}}var fl={};var dl;function Up(){if(dl)return fl;dl=1;var t;return(function(e){(function(n){var i=typeof globalThis=="object"?globalThis:typeof lr=="object"?lr:typeof self=="object"?self:typeof this=="object"?this:a(),r=s(e);typeof i.Reflect<"u"&&(r=s(i.Reflect,r)),n(r,i),typeof i.Reflect>"u"&&(i.Reflect=e);function s(u,d){return function(g,v){Object.defineProperty(u,g,{configurable:!0,writable:!0,value:v}),d&&d(g,v)}}function a(){throw new ReferenceError("globalThis could not be found. Please polyfill globalThis before loading this module.")}})(function(n,i){var r=typeof Symbol=="function",s=r&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:Qt("Symbol.toPrimitive not found."),a=r&&typeof Symbol.iterator<"u"?Symbol.iterator:Qt("Symbol.iterator not found."),u=Object.getPrototypeOf(Function),d=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Qt("A valid Map constructor could not be found."),g=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Qt("A valid Set constructor could not be found."),v=typeof WeakMap=="function"?WeakMap:Qt("A valid WeakMap constructor could not be found."),b=r?Symbol.for("@reflect-metadata:registry"):void 0,w=ci(),j=mn(w);function z($,q,V,Q){if(he(V)){if(!Vt($))throw new TypeError;if(!Ln(q))throw new TypeError;return G($,q)}else{if(!Vt($))throw new TypeError;if(!Ue(q))throw new TypeError;if(!Ue(Q)&&!he(Q)&&!ft(Q))throw new TypeError;return ft(Q)&&(Q=void 0),V=Pe(V),ge($,q,V,Q)}}n("decorate",z);function M($,q){function V(Q,de){if(!Ue(Q))throw new TypeError;if(!he(de)&&!fe(de))throw new TypeError;gn($,q,Q,de)}return V}n("metadata",M);function K($,q,V,Q){if(!Ue(V))throw new TypeError;return he(Q)||(Q=Pe(Q)),gn($,q,V,Q)}n("defineMetadata",K);function te($,q,V){if(!Ue(q))throw new TypeError;return he(V)||(V=Pe(V)),je($,q,V)}n("hasMetadata",te);function Y($,q,V){if(!Ue(q))throw new TypeError;return he(V)||(V=Pe(V)),We($,q,V)}n("hasOwnMetadata",Y);function se($,q,V){if(!Ue(q))throw new TypeError;return he(V)||(V=Pe(V)),_e($,q,V)}n("getMetadata",se);function J($,q,V){if(!Ue(q))throw new TypeError;return he(V)||(V=Pe(V)),rt($,q,V)}n("getOwnMetadata",J);function ie($,q){if(!Ue($))throw new TypeError;return he(q)||(q=Pe(q)),qt($,q)}n("getMetadataKeys",ie);function ue($,q){if(!Ue($))throw new TypeError;return he(q)||(q=Pe(q)),ut($,q)}n("getOwnMetadataKeys",ue);function pe($,q,V){if(!Ue(q))throw new TypeError;he(V)||(V=Pe(V));var Q=Nt(q,V,!1);return he(Q)?!1:Q.OrdinaryDeleteMetadata($,q,V)}n("deleteMetadata",pe);function G($,q){for(var V=$.length-1;V>=0;--V){var Q=$[V],de=Q(q);if(!he(de)&&!ft(de)){if(!Ln(de))throw new TypeError;q=de}}return q}function ge($,q,V,Q){for(var de=$.length-1;de>=0;--de){var st=$[de],qe=st(q,V,Q);if(!he(qe)&&!ft(qe)){if(!Ue(qe))throw new TypeError;Q=qe}}return Q}function je($,q,V){var Q=We($,q,V);if(Q)return!0;var de=rn(q);return ft(de)?!1:je($,de,V)}function We($,q,V){var Q=Nt(q,V,!1);return he(Q)?!1:dt(Q.OrdinaryHasOwnMetadata($,q,V))}function _e($,q,V){var Q=We($,q,V);if(Q)return rt($,q,V);var de=rn(q);if(!ft(de))return _e($,de,V)}function rt($,q,V){var Q=Nt(q,V,!1);if(!he(Q))return Q.OrdinaryGetOwnMetadata($,q,V)}function gn($,q,V,Q){var de=Nt(V,Q,!0);de.OrdinaryDefineOwnMetadata($,q,V,Q)}function qt($,q){var V=ut($,q),Q=rn($);if(Q===null)return V;var de=qt(Q,q);if(de.length<=0)return V;if(V.length<=0)return de;for(var st=new g,qe=[],vt=0,nt=V;vt<nt.length;vt++){var S=nt[vt],A=st.has(S);A||(st.add(S),qe.push(S))}for(var T=0,D=de;T<D.length;T++){var S=D[T],A=st.has(S);A||(st.add(S),qe.push(S))}return qe}function ut($,q){var V=Nt($,q,!1);return V?V.OrdinaryOwnMetadataKeys($,q):[]}function tt($){if($===null)return 1;switch(typeof $){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return $===null?1:6;default:return 6}}function he($){return $===void 0}function ft($){return $===null}function St($){return typeof $=="symbol"}function Ue($){return typeof $=="object"?$!==null:typeof $=="function"}function kt($,q){switch(tt($)){case 0:return $;case 1:return $;case 2:return $;case 3:return $;case 4:return $;case 5:return $}var V="string",Q=pt($,s);if(Q!==void 0){var de=Q.call($,V);if(Ue(de))throw new TypeError;return de}return ve($)}function ve($,q){var V,Q;{var de=$.toString;if(Jt(de)){var Q=de.call($);if(!Ue(Q))return Q}var V=$.valueOf;if(Jt(V)){var Q=V.call($);if(!Ue(Q))return Q}}throw new TypeError}function dt($){return!!$}function oi($){return""+$}function Pe($){var q=kt($);return St(q)?q:oi(q)}function Vt($){return Array.isArray?Array.isArray($):$ instanceof Object?$ instanceof Array:Object.prototype.toString.call($)==="[object Array]"}function Jt($){return typeof $=="function"}function Ln($){return typeof $=="function"}function fe($){switch(tt($)){case 3:return!0;case 4:return!0;default:return!1}}function pt($,q){var V=$[q];if(V!=null){if(!Jt(V))throw new TypeError;return V}}function Ae($){var q=pt($,a);if(!Jt(q))throw new TypeError;var V=q.call($);if(!Ue(V))throw new TypeError;return V}function Et($){return $.value}function $n($){var q=$.next();return q.done?!1:q}function Tt($){var q=$.return;q&&q.call($)}function rn($){var q=Object.getPrototypeOf($);if(typeof $!="function"||$===u||q!==u)return q;var V=$.prototype,Q=V&&Object.getPrototypeOf(V);if(Q==null||Q===Object.prototype)return q;var de=Q.constructor;return typeof de!="function"||de===$?q:de}function Qt($){throw $}function ai(){var $;!he(b)&&typeof i.Reflect<"u"&&!(b in i.Reflect)&&typeof i.Reflect.defineMetadata=="function"&&($=mt(i.Reflect));var q,V,Q,de=new v,st={registerProvider:qe,getProvider:nt,setProvider:A};return st;function qe(T){if(!Object.isExtensible(st))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case $===T:break;case he(q):q=T;break;case q===T:break;case he(V):V=T;break;case V===T:break;default:Q===void 0&&(Q=new g),Q.add(T);break}}function vt(T,D){if(!he(q)){if(q.isProviderFor(T,D))return q;if(!he(V)){if(V.isProviderFor(T,D))return q;if(!he(Q))for(var F=Ae(Q);;){var ye=$n(F);if(!ye)return;var xe=Et(ye);if(xe.isProviderFor(T,D))return Tt(F),xe}}}if(!he($)&&$.isProviderFor(T,D))return $}function nt(T,D){var F=de.get(T),ye;return he(F)||(ye=F.get(D)),he(ye)&&(ye=vt(T,D),he(ye)||(he(F)&&(F=new d,de.set(T,F)),F.set(D,ye))),ye}function S(T){if(he(T))throw new TypeError;return q===T||V===T||!he(Q)&&Q.has(T)}function A(T,D,F){if(!S(F))throw new Error("Metadata provider not registered.");var ye=nt(T,D);if(ye!==F){if(!he(ye))return!1;var xe=de.get(T);he(xe)&&(xe=new d,de.set(T,xe)),xe.set(D,F)}return!0}}function ci(){var $;return!he(b)&&Ue(i.Reflect)&&Object.isExtensible(i.Reflect)&&($=i.Reflect[b]),he($)&&($=ai()),!he(b)&&Ue(i.Reflect)&&Object.isExtensible(i.Reflect)&&Object.defineProperty(i.Reflect,b,{enumerable:!1,configurable:!1,writable:!1,value:$}),$}function mn($){var q=new v,V={isProviderFor:function(S,A){var T=q.get(S);return he(T)?!1:T.has(A)},OrdinaryDefineOwnMetadata:qe,OrdinaryHasOwnMetadata:de,OrdinaryGetOwnMetadata:st,OrdinaryOwnMetadataKeys:vt,OrdinaryDeleteMetadata:nt};return w.registerProvider(V),V;function Q(S,A,T){var D=q.get(S),F=!1;if(he(D)){if(!T)return;D=new d,q.set(S,D),F=!0}var ye=D.get(A);if(he(ye)){if(!T)return;if(ye=new d,D.set(A,ye),!$.setProvider(S,A,V))throw D.delete(A),F&&q.delete(S),new Error("Wrong provider for target.")}return ye}function de(S,A,T){var D=Q(A,T,!1);return he(D)?!1:dt(D.has(S))}function st(S,A,T){var D=Q(A,T,!1);if(!he(D))return D.get(S)}function qe(S,A,T,D){var F=Q(T,D,!0);F.set(S,A)}function vt(S,A){var T=[],D=Q(S,A,!1);if(he(D))return T;for(var F=D.keys(),ye=Ae(F),xe=0;;){var be=$n(ye);if(!be)return T.length=xe,T;var L=Et(be);try{T[xe]=L}catch(re){try{Tt(ye)}finally{throw re}}xe++}}function nt(S,A,T){var D=Q(A,T,!1);if(he(D)||!D.delete(S))return!1;if(D.size===0){var F=q.get(A);he(F)||(F.delete(T),F.size===0&&q.delete(F))}return!0}}function mt($){var q=$.defineMetadata,V=$.hasOwnMetadata,Q=$.getOwnMetadata,de=$.getOwnMetadataKeys,st=$.deleteMetadata,qe=new v,vt={isProviderFor:function(nt,S){var A=qe.get(nt);return!he(A)&&A.has(S)?!0:de(nt,S).length?(he(A)&&(A=new g,qe.set(nt,A)),A.add(S),!0):!1},OrdinaryDefineOwnMetadata:q,OrdinaryHasOwnMetadata:V,OrdinaryGetOwnMetadata:Q,OrdinaryOwnMetadataKeys:de,OrdinaryDeleteMetadata:st};return vt}function Nt($,q,V){var Q=w.getProvider($,q);if(!he(Q))return Q;if(V){if(w.setProvider($,q,j))return j;throw new Error("Illegal state.")}}})})(t||(t={})),fl}Up();function Mi(t,e,n){return Reflect.getOwnMetadata(e,t,n)}function _u(t,e,n,i){Reflect.defineMetadata(e,n,t,i)}function ii(t,e,n,i,r){const s=Mi(t,e,r)??n(),a=i(s);Reflect.defineMetadata(e,a,t,r)}const Bo="@inversifyjs/container/bindingId";function Hn(){const t=Mi(Object,Bo)??0;return t===Number.MAX_SAFE_INTEGER?_u(Object,Bo,Number.MIN_SAFE_INTEGER):ii(Object,Bo,()=>t,e=>e+1),t}const Gt={Request:"Request",Singleton:"Singleton",Transient:"Transient"},Re={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Instance:"Instance",ResolvedValue:"ResolvedValue",ServiceRedirection:"ServiceRedirection"};function*Cu(...t){for(const e of t)yield*e}const Kp=-1;class kr{#e;#t;#i;constructor(e){this.#e=new Map,this.#t={};for(const n of Reflect.ownKeys(e))this.#t[n]=new Map;this.#i=e}add(e,n){this.#o(e).push(n);for(const i of Reflect.ownKeys(n))this.#s(i,n[i]).push(e)}clone(){const e=this.#n(),n=this.#r(),i=Reflect.ownKeys(this.#i),r=this._buildNewInstance(this.#i);this.#p(this.#e,r.#e,e,n);for(const s of i)this.#a(this.#t[s],r.#t[s],e);return r}get(e,n){return this.#t[e].get(n)}getAllKeys(e){return this.#t[e].keys()}removeByRelation(e,n){const i=this.get(e,n);if(i===void 0)return;const r=new Set(i);for(const s of r){const a=this.#e.get(s);if(a===void 0)throw new Error("Expecting model relation, none found");for(const u of a)u[e]===n&&this.#u(s,u);this.#e.delete(s)}}_buildNewInstance(e){return new kr(e)}_cloneModel(e){return e}_cloneRelation(e){return e}#n(){const e=new Map;for(const n of this.#e.keys()){const i=this._cloneModel(n);e.set(n,i)}return e}#r(){const e=new Map;for(const n of this.#e.values())for(const i of n){const r=this._cloneRelation(i);e.set(i,r)}return e}#o(e){let n=this.#e.get(e);return n===void 0&&(n=[],this.#e.set(e,n)),n}#s(e,n){let i=this.#t[e].get(n);return i===void 0&&(i=[],this.#t[e].set(n,i)),i}#l(e,n){const i=n.get(e);if(i===void 0)throw new Error("Expecting model to be cloned, none found");return i}#c(e,n){const i=n.get(e);if(i===void 0)throw new Error("Expecting relation to be cloned, none found");return i}#a(e,n,i){for(const[r,s]of e){const a=new Array;for(const u of s)a.push(this.#l(u,i));n.set(r,a)}}#p(e,n,i,r){for(const[s,a]of e){const u=new Array;for(const d of a)u.push(this.#c(d,r));n.set(this.#l(s,i),u)}}#u(e,n){for(const i of Reflect.ownKeys(n))this.#f(e,i,n[i])}#f(e,n,i){const r=this.#t[n].get(i);if(r!==void 0){const s=r.indexOf(e);s!==Kp&&r.splice(s,1),r.length===0&&this.#t[n].delete(i)}}}var rr;(function(t){t.moduleId="moduleId",t.serviceId="serviceId"})(rr||(rr={}));class hr{#e;#t;constructor(e,n){this.#e=n??new kr({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#t=e}static build(e){return new hr(e)}add(e,n){this.#e.add(e,n)}clone(){return new hr(this.#t,this.#e.clone())}get(e){const n=[],i=this.#e.get(rr.serviceId,e);i!==void 0&&n.push(i);const r=this.#t()?.get(e);if(r!==void 0&&n.push(r),n.length!==0)return Cu(...n)}removeAllByModuleId(e){this.#e.removeByRelation(rr.moduleId,e)}removeAllByServiceId(e){this.#e.removeByRelation(rr.serviceId,e)}}const _r="@inversifyjs/core/classMetadataReflectKey";function Cr(){return{constructorArguments:[],lifecycle:{postConstructMethodNames:new Set,preDestroyMethodNames:new Set},properties:new Map,scope:void 0}}const Xa="@inversifyjs/core/pendingClassMetadataCountReflectKey";function qp(t){const e=Mi(t,Xa);return e!==void 0&&e!==0}const Lo=Symbol.for("@inversifyjs/core/InversifyCoreError");class Ce extends Error{[Lo];kind;constructor(e,n,i){super(n,i),this[Lo]=!0,this.kind=e}static is(e){return typeof e=="object"&&e!==null&&e[Lo]===!0}static isErrorOfKind(e,n){return Ce.is(e)&&e.kind===n}}var Ee;(function(t){t[t.injectionDecoratorConflict=0]="injectionDecoratorConflict",t[t.missingInjectionDecorator=1]="missingInjectionDecorator",t[t.planning=2]="planning",t[t.planningMaxDepthExceeded=3]="planningMaxDepthExceeded",t[t.resolution=4]="resolution",t[t.unknown=5]="unknown"})(Ee||(Ee={}));var ti;(function(t){t[t.unknown=32]="unknown"})(ti||(ti={}));function Vp(t,e){const n=[];for(let i=0;i<e.constructorArguments.length;++i){const r=e.constructorArguments[i];(r===void 0||r.kind===ti.unknown)&&n.push(` - Missing or incomplete metadata for type "${t.name}" at constructor argument with index ${i.toString()}.
|
|
2
|
-
Every constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`)}for(const[i,r]of e.properties)r.kind===ti.unknown&&n.push(` - Missing or incomplete metadata for type "${t.name}" at property "${i.toString()}".
|
|
3
|
-
This property must be decorated either with @inject or @multiInject decorator.`);throw n.length===0?new Ce(Ee.unknown,`Unexpected class metadata for type "${t.name}" with uncompletion traces.
|
|
4
|
-
This might be caused by one of the following reasons:
|
|
5
|
-
|
|
6
|
-
1. A third party library is targeting inversify reflection metadata.
|
|
7
|
-
2. A bug is causing the issue. Consider submiting an issue to fix it.`):new Ce(Ee.missingInjectionDecorator,`Invalid class metadata at type ${t.name}:
|
|
8
|
-
|
|
9
|
-
${n.join(`
|
|
10
|
-
|
|
11
|
-
`)}`)}function zp(t,e){const n=[];if(e.length<t.length)throw new Ce(Ee.missingInjectionDecorator,`Found unexpected missing metadata on type "${t.name}". "${t.name}" constructor requires at least ${t.length.toString()} arguments, found ${e.length.toString()} instead.
|
|
12
|
-
Are you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument?
|
|
13
|
-
|
|
14
|
-
If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`);for(let i=0;i<e.length;++i)e[i]===void 0&&n.push(i);if(n.length>0)throw new Ce(Ee.missingInjectionDecorator,`Found unexpected missing metadata on type "${t.name}" at constructor indexes "${n.join('", "')}".
|
|
15
|
-
|
|
16
|
-
Are you using @inject, @multiInject or @unmanaged decorators at those indexes?
|
|
17
|
-
|
|
18
|
-
If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}function Ds(t){const e=Mi(t,_r)??Cr();if(qp(t))Vp(t,e);else return zp(t,e.constructorArguments),e}function Eu(t,e){const i=Ds(e).scope??t.scope;return{cache:{isRight:!1,value:void 0},id:Hn(),implementationType:e,isSatisfiedBy:()=>!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:i,serviceIdentifier:e,type:Re.Instance}}function Er(t){return t.isRight?{isRight:!0,value:t.value}:t}function Wp(t){return{cache:Er(t.cache),id:t.id,isSatisfiedBy:t.isSatisfiedBy,moduleId:t.moduleId,onActivation:t.onActivation,onDeactivation:t.onDeactivation,scope:t.scope,serviceIdentifier:t.serviceIdentifier,type:t.type,value:t.value}}function Hp(t){return{cache:Er(t.cache),id:t.id,isSatisfiedBy:t.isSatisfiedBy,moduleId:t.moduleId,onActivation:t.onActivation,onDeactivation:t.onDeactivation,scope:t.scope,serviceIdentifier:t.serviceIdentifier,type:t.type,value:t.value}}function Gp(t){return{cache:Er(t.cache),factory:t.factory,id:t.id,isSatisfiedBy:t.isSatisfiedBy,moduleId:t.moduleId,onActivation:t.onActivation,onDeactivation:t.onDeactivation,scope:t.scope,serviceIdentifier:t.serviceIdentifier,type:t.type}}function Yp(t){return{cache:Er(t.cache),id:t.id,implementationType:t.implementationType,isSatisfiedBy:t.isSatisfiedBy,moduleId:t.moduleId,onActivation:t.onActivation,onDeactivation:t.onDeactivation,scope:t.scope,serviceIdentifier:t.serviceIdentifier,type:t.type}}function Jp(t){return{cache:Er(t.cache),factory:t.factory,id:t.id,isSatisfiedBy:t.isSatisfiedBy,metadata:t.metadata,moduleId:t.moduleId,onActivation:t.onActivation,onDeactivation:t.onDeactivation,scope:t.scope,serviceIdentifier:t.serviceIdentifier,type:t.type}}function Qp(t){return{id:t.id,isSatisfiedBy:t.isSatisfiedBy,moduleId:t.moduleId,serviceIdentifier:t.serviceIdentifier,targetServiceIdentifier:t.targetServiceIdentifier,type:t.type}}function Xp(t){switch(t.type){case Re.ConstantValue:return Wp(t);case Re.DynamicValue:return Hp(t);case Re.Factory:return Gp(t);case Re.Instance:return Yp(t);case Re.ResolvedValue:return Jp(t);case Re.ServiceRedirection:return Qp(t)}}var At;(function(t){t.id="id",t.moduleId="moduleId",t.serviceId="serviceId"})(At||(At={}));class Za extends kr{_buildNewInstance(e){return new Za(e)}_cloneModel(e){return Xp(e)}}class gr{#e;#t;#i;constructor(e,n,i){this.#t=i??new Za({id:{isOptional:!1},moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#i=e,this.#e=n}static build(e,n){return new gr(e,n)}clone(){return new gr(this.#i,this.#e,this.#t.clone())}get(e){const n=this.getNonParentBindings(e)??this.#i()?.get(e);if(n!==void 0)return n;const i=this.#n(e);return i===void 0?i:[i]}*getChained(e){const n=this.getNonParentBindings(e);n!==void 0&&(yield*n);const i=this.#i();if(i===void 0){if(n===void 0){const r=this.#n(e);r!==void 0&&(yield r)}}else yield*i.getChained(e)}getBoundServices(){const e=new Set(this.#t.getAllKeys(At.serviceId)),n=this.#i();if(n!==void 0)for(const i of n.getBoundServices())e.add(i);return e}getById(e){return this.#t.get(At.id,e)??this.#i()?.getById(e)}getByModuleId(e){return this.#t.get(At.moduleId,e)??this.#i()?.getByModuleId(e)}getNonParentBindings(e){return this.#t.get(At.serviceId,e)}getNonParentBoundServices(){return this.#t.getAllKeys(At.serviceId)}removeById(e){this.#t.removeByRelation(At.id,e)}removeAllByModuleId(e){this.#t.removeByRelation(At.moduleId,e)}removeAllByServiceId(e){this.#t.removeByRelation(At.serviceId,e)}set(e){const n={[At.id]:e.id,[At.serviceId]:e.serviceIdentifier};e.moduleId!==void 0&&(n[At.moduleId]=e.moduleId),this.#t.add(e,n)}#n(e){if(this.#e===void 0||typeof e!="function")return;const n=Eu(this.#e,e);return this.set(n),n}}var sr;(function(t){t.moduleId="moduleId",t.serviceId="serviceId"})(sr||(sr={}));class mr{#e;#t;constructor(e,n){this.#e=n??new kr({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#t=e}static build(e){return new mr(e)}add(e,n){this.#e.add(e,n)}clone(){return new mr(this.#t,this.#e.clone())}get(e){const n=[],i=this.#e.get(sr.serviceId,e);i!==void 0&&n.push(i);const r=this.#t()?.get(e);if(r!==void 0&&n.push(r),n.length!==0)return Cu(...n)}removeAllByModuleId(e){this.#e.removeByRelation(sr.moduleId,e)}removeAllByServiceId(e){this.#e.removeByRelation(sr.serviceId,e)}}function Iu(){return 0}function Pu(t){return e=>{e!==void 0&&e.kind===ti.unknown&&ii(t,Xa,Iu,n=>n-1)}}var xt;(function(t){t[t.multipleInjection=0]="multipleInjection",t[t.singleInjection=1]="singleInjection",t[t.unmanaged=2]="unmanaged"})(xt||(xt={}));function Au(t,e){return(...n)=>i=>{if(i===void 0)return t(...n);if(i.kind===xt.unmanaged)throw new Ce(Ee.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return e(i,...n)}}function Zp(t,e,n){return t===xt.multipleInjection?{chained:n?.chained??!1,kind:t,name:void 0,optional:!1,tags:new Map,value:e}:{kind:t,name:void 0,optional:!1,tags:new Map,value:e}}function Ou(t){if(t.kind!==ti.unknown&&t.isFromTypescriptParamType!==!0)throw new Ce(Ee.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}function eh(t,e,n,i){return Ou(t),e===xt.multipleInjection?{...t,chained:i?.chained??!1,kind:e,value:n}:{...t,kind:e,value:n}}const th=Au(Zp,eh);function nh(t,e){return n=>{const i=n.constructorArguments[e];return n.constructorArguments[e]=t(i),n}}function Tu(t,e){return n=>{const i=n.properties.get(e);return n.properties.set(e,t(i)),n}}var Tn;(function(t){t[t.method=0]="method",t[t.parameter=1]="parameter",t[t.property=2]="property"})(Tn||(Tn={}));function ih(t,e,n){if(n===void 0){if(e===void 0)throw new Ce(Ee.unknown,"Unexpected undefined property and index values");return{kind:Tn.property,property:e,targetClass:t.constructor}}return typeof n=="number"?{index:n,kind:Tn.parameter,targetClass:t}:{kind:Tn.method,method:e,targetClass:t}}function rh(t){switch(t.kind){case Tn.method:return`[class: "${t.targetClass.name}", method: "${t.method.toString()}"]`;case Tn.parameter:return`[class: "${t.targetClass.name}", index: "${t.index.toString()}"]`;case Tn.property:return`[class: "${t.targetClass.name}", property: "${t.property.toString()}"]`}}function sh(t,e,n,i){if(Ce.isErrorOfKind(i,Ee.injectionDecoratorConflict)){const r=ih(t,e,n);throw new Ce(Ee.injectionDecoratorConflict,`Unexpected injection error.
|
|
19
|
-
|
|
20
|
-
Cause:
|
|
21
|
-
|
|
22
|
-
${i.message}
|
|
23
|
-
|
|
24
|
-
Details
|
|
25
|
-
|
|
26
|
-
${rh(r)}`,{cause:i})}throw i}function Us(t,e){return(i,r,s)=>{try{s===void 0?ch(t,e)(i,r):typeof s=="number"?ah(t,e)(i,r,s):oh(t,e)(i,r,s)}catch(a){sh(i,r,s,a)}}}function ec(t,e){return n=>{const i=e(n);return r=>(i(r),t(r))}}function oh(t,e){const n=ec(t,e);return(i,r,s)=>{if(uh(s))ii(i.constructor,_r,Cr,Tu(n(i),r));else throw new Ce(Ee.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.
|
|
27
|
-
Found @inject decorator at method "${r.toString()}" at class "${i.constructor.name}"`)}}function ah(t,e){const n=ec(t,e);return(i,r,s)=>{if(lh(i,r))ii(i,_r,Cr,nh(n(i),s));else throw new Ce(Ee.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.
|
|
28
|
-
Found @inject decorator at method "${r?.toString()??""}" at class "${i.constructor.name}"`)}}function ch(t,e){const n=ec(t,e);return(i,r)=>{ii(i.constructor,_r,Cr,Tu(n(i),r))}}function lh(t,e){return typeof t=="function"&&e===void 0}function uh(t){return t.set!==void 0}function Le(t){const e=th(xt.singleInjection,t);return Us(e,Pu)}const pl="@inversifyjs/core/classIsInjectableFlagReflectKey";function fh(t){if(Mi(t,pl)!==void 0)throw new Ce(Ee.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${t.name}"`);_u(t,pl,!0)}const dh="design:paramtypes";function ph(t){return{isFromTypescriptParamType:!0,kind:xt.singleInjection,name:void 0,optional:!1,tags:new Map,value:t}}const hh=[Array,BigInt,Boolean,Function,Number,Object,String];function gh(t){return!hh.includes(t)}function mh(t){const e=Mi(t,dh);e!==void 0&&ii(t,_r,Cr,vh(e))}function vh(t){return e=>(t.forEach((n,i)=>{e.constructorArguments[i]===void 0&&gh(n)&&(e.constructorArguments[i]=ph(n))}),e)}function it(t){return e=>{fh(e),mh(e)}}function Nu(t){return e=>{e===void 0&&ii(t,Xa,Iu,n=>n+1)}}function yh(t){return e=>{if(e.name!==void 0)throw new Ce(Ee.injectionDecoratorConflict,"Unexpected duplicated named decorator");return e.name=t,e}}function bh(){return{kind:ti.unknown,name:void 0,optional:!1,tags:new Map}}function Mu(t){return e=>{const n=e??bh();if(n.kind===xt.unmanaged)throw new Ce(Ee.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return t(n)}}function tc(t){const e=Mu(yh(t));return Us(e,Nu)}function wh(t){if(t.optional)throw new Ce(Ee.injectionDecoratorConflict,"Unexpected duplicated optional decorator");return t.optional=!0,t}function xh(){const t=Mu(wh);return Us(t,Nu)}function Ru(){return{kind:xt.unmanaged}}function Sh(t){if(Ou(t),kh(t))throw new Ce(Ee.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return Ru()}function kh(t){return t.name!==void 0||t.optional||t.tags.size>0}const _h=Au(Ru,Sh);function Ch(){const t=_h();return Us(t,Pu)}var dn;(function(t){t[t.multipleInjection=0]="multipleInjection",t[t.singleInjection=1]="singleInjection"})(dn||(dn={}));function Eh(t){return t.rootConstraints.isMultiple?{chained:t.rootConstraints.chained,isMultiple:!0,name:t.rootConstraints.name,optional:t.rootConstraints.isOptional??!1,serviceIdentifier:t.rootConstraints.serviceIdentifier,tag:t.rootConstraints.tag}:{isMultiple:!1,name:t.rootConstraints.name,optional:t.rootConstraints.isOptional??!1,serviceIdentifier:t.rootConstraints.serviceIdentifier,tag:t.rootConstraints.tag}}const Ih=/stack space|call stack|too much recursion/i,Ph=/too much recursion/;function nc(t){try{return t instanceof Error?t instanceof RangeError&&Ih.test(t.message)||t.name==="InternalError"&&Ph.test(t.message):!1}catch(e){return e instanceof SyntaxError&&e.message.includes("Stack overflow")}}function Ah(t){const e=new Set;for(const n of t.servicesBranch){if(e.has(n))return[...e,n];e.add(n)}return[...e]}function Oh(t,e){if(nc(e)||Ce.isErrorOfKind(e,Ee.planningMaxDepthExceeded)){const n=Th(Ah(t));throw new Ce(Ee.planning,`Circular dependency found: ${n}`,{cause:e})}throw e}function Th(t){const e=[...t];return e.length===0?"(No dependency trace)":e.map(lt).join(" -> ")}const $o=Symbol.for("@inversifyjs/core/LazyPlanServiceNode");class Ot{[$o];_serviceIdentifier;_serviceNode;constructor(e,n){this[$o]=!0,this._serviceNode=e,this._serviceIdentifier=n}get bindings(){return this._getNode().bindings}get isContextFree(){return this._getNode().isContextFree}get serviceIdentifier(){return this._serviceIdentifier}set bindings(e){this._getNode().bindings=e}set isContextFree(e){this._getNode().isContextFree=e}static is(e){return typeof e=="object"&&e!==null&&e[$o]===!0}invalidate(){this._serviceNode=void 0}isExpanded(){return this._serviceNode!==void 0}_getNode(){return this._serviceNode===void 0&&(this._serviceNode=this._buildPlanServiceNode()),this._serviceNode}}class Bn{#e;constructor(e){this.#e=e}get name(){return this.#e.elem.name}get serviceIdentifier(){return this.#e.elem.serviceIdentifier}get tags(){return this.#e.elem.tags}getAncestor(){if(this.#e.elem.getAncestorsCalled=!0,this.#e.previous!==void 0)return new Bn(this.#e.previous)}}function Ks(t,e,n){const i=n?.customServiceIdentifier??e.serviceIdentifier,s=(n?.chained===!0?[...t.operations.getBindingsChained(i)]:[...t.operations.getBindings(i)??[]]).filter(a=>a.isSatisfiedBy(e));if(s.length===0&&t.autobindOptions!==void 0&&typeof i=="function"){const a=Eu(t.autobindOptions,i);t.operations.setBinding(a),a.isSatisfiedBy(e)&&s.push(a)}return s}class ic{last;length;constructor(e,n){this.last=e,this.length=n}concat(e){return new ic({elem:e,previous:this.last},this.length+1)}[Symbol.iterator](){let e=this.last;return{next:()=>{if(e===void 0)return{done:!0,value:void 0};const n=e.elem;return e=e.previous,{done:!1,value:n}}}}}function rc(t){const e=new Map;return t.rootConstraints.tag!==void 0&&e.set(t.rootConstraints.tag.key,t.rootConstraints.tag.value),new ic({elem:{getAncestorsCalled:!1,name:t.rootConstraints.name,serviceIdentifier:t.rootConstraints.serviceIdentifier,tags:e},previous:void 0},1)}function ri(t){return t.redirections!==void 0}function Nh(t){switch(t.type){case Re.Instance:return`[ type: "${t.type}", serviceIdentifier: "${lt(t.serviceIdentifier)}", scope: "${t.scope}", implementationType: "${t.implementationType.name}" ]`;case Re.ServiceRedirection:return`[ type: "${t.type}", serviceIdentifier: "${lt(t.serviceIdentifier)}", redirection: "${lt(t.targetServiceIdentifier)}" ]`;default:return`[ type: "${t.type}", serviceIdentifier: "${lt(t.serviceIdentifier)}", scope: "${t.scope}" ]`}}function ju(t,e,n,i){const r=n.elem.serviceIdentifier,s=n.previous?.elem.serviceIdentifier;Array.isArray(t)?Mh(t,e,r,s,n.elem,i):Rh(t,e,r,s,n.elem,i)}function Bu(t,e,n,i){const r=i[i.length-1]??t,s=`No bindings found for service: "${lt(r)}".
|
|
29
|
-
|
|
30
|
-
Trying to resolve bindings for "${Lu(t,e)}".${Fu(i)}${$u(n)}`;throw new Ce(Ee.planning,s)}function Mh(t,e,n,i,r,s){if(t.length===0)e||Bu(n,i,r,s);else{const a=s[s.length-1]??n,u=`Ambiguous bindings found for service: "${lt(a)}".${Fu(s)}
|
|
31
|
-
|
|
32
|
-
Registered bindings:
|
|
33
|
-
|
|
34
|
-
${t.map(d=>Nh(d.binding)).join(`
|
|
35
|
-
`)}
|
|
36
|
-
|
|
37
|
-
Trying to resolve bindings for "${Lu(n,i)}".${$u(r)}`;throw new Ce(Ee.planning,u)}}function Rh(t,e,n,i,r,s){t===void 0&&!e&&Bu(n,i,r,s)}function Lu(t,e){return e===void 0?`${lt(t)} (Root service)`:lt(e)}function $u(t){const e=t.tags.size===0?"":`
|
|
38
|
-
- tags:
|
|
39
|
-
- ${[...t.tags.keys()].map(n=>n.toString()).join(`
|
|
40
|
-
- `)}`;return`
|
|
41
|
-
|
|
42
|
-
Binding constraints:
|
|
43
|
-
- service identifier: ${lt(t.serviceIdentifier)}
|
|
44
|
-
- name: ${t.name?.toString()??"-"}${e}`}function Fu(t){return t.length===0?"":`
|
|
45
|
-
|
|
46
|
-
- service redirections:
|
|
47
|
-
- ${t.map(e=>lt(e)).join(`
|
|
48
|
-
- `)}`}const jh=1;function Du(t,e,n,i){if(t.redirections.length===jh){const[r]=t.redirections;ri(r)&&Du(r,e,n,[...i,r.binding.targetServiceIdentifier]);return}ju(t.redirections,e,n,i)}const Bh=1;function sc(t,e,n){if(Array.isArray(t.bindings)&&t.bindings.length===Bh){const[i]=t.bindings;ri(i)&&Du(i,e,n,[i.binding.targetServiceIdentifier]);return}ju(t.bindings,e,n,[])}function Lh(t){return e=>{const n=rc(e),i=new Bn(n.last),r=e.rootConstraints.isMultiple&&e.rootConstraints.chained,s=Ks(e,i,{chained:r}),a=[],u={bindings:a,isContextFree:!0,serviceIdentifier:e.rootConstraints.serviceIdentifier};if(a.push(...t(e,n,s,u,r)),u.isContextFree=!n.last.elem.getAncestorsCalled,!e.rootConstraints.isMultiple){sc(u,e.rootConstraints.isOptional??!1,n.last);const[d]=a;u.bindings=d}return u}}function qs(t){return Fs.is(t)?t.unwrap():t}function Uu(t){return(e,n,i)=>{const r=qs(i.value),s=n.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:r,tags:i.tags}),a=new Bn(s.last),u=i.kind===xt.multipleInjection&&i.chained,d=Ks(e,a,{chained:u}),g=[],v={bindings:g,isContextFree:!0,serviceIdentifier:r};if(g.push(...t(e,s,d,v,u)),v.isContextFree=!s.last.elem.getAncestorsCalled,i.kind===xt.singleInjection){sc(v,i.optional,s.last);const[b]=g;v.bindings=b}return v}}function Ku(t){return(e,n,i)=>{const r=qs(i.value),s=n.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:r,tags:i.tags}),a=new Bn(s.last),u=i.kind===dn.multipleInjection&&i.chained,d=Ks(e,a,{chained:u}),g=[],v={bindings:g,isContextFree:!0,serviceIdentifier:r};if(g.push(...t(e,s,d,v,u)),v.isContextFree=!s.last.elem.getAncestorsCalled,i.kind===dn.singleInjection){sc(v,i.optional,s.last);const[b]=g;v.bindings=b}return v}}function qu(t){const e=$h(t),n=Fh(t),i=(s,a,u,d,g)=>{const v=ri(d)?d.binding.targetServiceIdentifier:d.serviceIdentifier;s.servicesBranch.push(v);const b=[];for(const w of u)switch(w.type){case Re.Instance:{b.push(e(s,w,a));break}case Re.ResolvedValue:{b.push(n(s,w,a));break}case Re.ServiceRedirection:{const j=r(s,a,w,g);b.push(j);break}default:b.push({binding:w})}return s.servicesBranch.pop(),b},r=Dh(i);return i}function $h(t){return(e,n,i)=>{const r=e.operations.getClassMetadata(n.implementationType),s={binding:n,classMetadata:r,constructorParams:[],propertyParams:new Map},a={autobindOptions:e.autobindOptions,node:s,operations:e.operations,servicesBranch:e.servicesBranch};return t(a,i)}}function Fh(t){return(e,n,i)=>{const r={binding:n,params:[]},s={autobindOptions:e.autobindOptions,node:r,operations:e.operations,servicesBranch:e.servicesBranch};return t(s,i)}}function Dh(t){return(e,n,i,r)=>{const s={binding:i,redirections:[]},a=new Bn(n.last),u=Ks(e,a,{chained:r,customServiceIdentifier:i.targetServiceIdentifier});return s.redirections.push(...t(e,n,u,s,r)),s}}function Uh(t){return t.binding.type===Re.Instance}function Kh(t){let e;if(t.tags.size===0)e=void 0;else if(t.tags.size===1){const[i,r]=t.tags.entries().next().value;e={key:i,value:r}}else return;const n=Fs.is(t.value)?t.value.unwrap():t.value;return t.kind===xt.multipleInjection?{chained:t.chained,isMultiple:!0,name:t.name,optional:t.optional,serviceIdentifier:n,tag:e}:{isMultiple:!1,name:t.name,optional:t.optional,serviceIdentifier:n,tag:e}}function qh(t){let e;if(t.tags.size===0)e=void 0;else if(t.tags.size===1){const[i,r]=t.tags.entries().next().value;e={key:i,value:r}}else return;const n=Fs.is(t.value)?t.value.unwrap():t.value;return t.kind===dn.multipleInjection?{chained:t.chained,isMultiple:!0,name:t.name,optional:t.optional,serviceIdentifier:n,tag:e}:{isMultiple:!1,name:t.name,optional:t.optional,serviceIdentifier:n,tag:e}}function Vu(t,e,n,i){if(t!==void 0&&(Ot.is(n)&&!n.isExpanded()||n.isContextFree)){const r={tree:{root:n}};e.setPlan(t,r)}else e.setNonCachedServiceNode(n,i)}const Vh=500;class zh extends Ot{#e;#t;#i;#n;constructor(e,n,i,r,s){super(s,qs(r.value)),this.#t=n,this.#e=e,this.#i=i,this.#n=r}_buildPlanServiceNode(){return this.#t(this.#e,this.#i,this.#n)}}class Wh extends Ot{#e;#t;#i;#n;constructor(e,n,i,r,s){super(s,qs(r.value)),this.#e=e,this.#t=n,this.#i=i,this.#n=r}_buildPlanServiceNode(){return this.#t(this.#e,this.#i,this.#n)}}function zu(t,e,n,i){const r=Hh(t,n),s=Gh(e,i);return(a,u)=>Uh(a.node)?r(a,a.node,u):s(a,a.node,u)}function Hh(t,e){const n=Yh(t,e);return(i,r,s)=>{const a=r.classMetadata;for(const[u,d]of a.constructorArguments.entries())r.constructorParams[u]=n(i,s,d);for(const[u,d]of a.properties){const g=n(i,s,d);g!==void 0&&r.propertyParams.set(u,g)}return i.node}}function Gh(t,e){const n=Jh(t,e);return(i,r,s)=>{const a=r.binding.metadata;for(const[u,d]of a.arguments.entries())r.params[u]=n(i,s,d);return i.node}}function Yh(t,e){return(n,i,r)=>{if(r.kind===xt.unmanaged)return;if(i.length>Vh)throw new Ce(Ee.planningMaxDepthExceeded,"Maximum plan depth exceeded. This is likely caused by a circular dependency.");const s=Kh(r);if(s!==void 0){const d=n.operations.getPlan(s);if(d!==void 0&&d.tree.root.isContextFree)return d.tree.root}const a=e(n,i,r),u=new zh(n,t,i,r,a);return Vu(s,n.operations,u,{bindingConstraintsList:i,chainedBindings:r.kind===xt.multipleInjection&&r.chained,optionalBindings:r.optional}),u}}function Jh(t,e){return(n,i,r)=>{const s=qh(r);if(s!==void 0){const d=n.operations.getPlan(s);if(d!==void 0&&d.tree.root.isContextFree)return d.tree.root}const a=e(n,i,r),u=new Wh(n,t,i,r,a);return Vu(s,n.operations,u,{bindingConstraintsList:i,chainedBindings:r.kind===dn.multipleInjection&&r.chained,optionalBindings:r.optional}),u}}class Qh extends Ot{#e;constructor(e,n){super(n,n.serviceIdentifier),this.#e=e}_buildPlanServiceNode(){return Gu(this.#e)}}const aa=Uu(Hu),ca=Ku(Hu),Xh=zu(aa,ca,aa,ca),Wu=qu(Xh);function Hu(t,e,n,i,r){return Wu(t,e,n,i,r)}const Gu=Lh(Wu);function Zh(t){try{const e=Eh(t),n=t.operations.getPlan(e);if(n!==void 0)return n;const i=Gu(t),r={tree:{root:new Qh(t,i)}};return t.operations.setPlan(e,r),r}catch(e){Oh(t,e)}}var Wt;(function(t){t.bindingAdded="bindingAdded",t.bindingRemoved="bindingRemoved"})(Wt||(Wt={}));const eg=8,tg=1024,ng=.5;class ig{#e;#t;#i;constructor(){this.#e=[],this.#t=eg,this.#i=tg}*[Symbol.iterator](){let e=0;for(const n of this.#e){const i=n.deref();i===void 0?++e:yield i}this.#e.length>=this.#t&&this.#r(e)&&this.#n(e)}push(e){const n=new WeakRef(e);if(this.#e.push(n),this.#e.length>=this.#t&&this.#e.length%this.#i===0){let i=0;for(const r of this.#e)r.deref()===void 0&&++i;this.#r(i)&&this.#n(i)}}#n(e){const n=new Array(this.#e.length-e);let i=0;for(const r of this.#e)r.deref()&&(n[i++]=r);this.#e=n}#r(e){return e>=this.#e.length*ng}}function rg(t){const e=Uu(t);return(n,i,r)=>{try{return e(n,i,r)}catch(s){if(Ce.isErrorOfKind(s,Ee.planning))return;throw s}}}function sg(t){const e=Ku(t);return(n,i,r)=>{try{return e(n,i,r)}catch(s){if(Ce.isErrorOfKind(s,Ee.planning))return;throw s}}}const og=zu(aa,ca,lg,ug),oc=qu(og),ag=rg(oc),cg=sg(oc);function lg(t,e,n){return ag(t,e,n)}function ug(t,e,n){return cg(t,e,n)}function Yu(t,e,n,i,r){if(Ot.is(e)&&!e.isExpanded())return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1};const s=new Bn(i.last);return!n.isSatisfiedBy(s)||i.last.elem.getAncestorsCalled?{isContextFreeBinding:!i.last.elem.getAncestorsCalled,shouldInvalidateServiceNode:!1}:fg(t,e,n,i,r)}function fg(t,e,n,i,r){let s;try{[s]=oc(t,i,[n],e,r)}catch(a){if(nc(a)||Ce.isErrorOfKind(a,Ee.planningMaxDepthExceeded))return{isContextFreeBinding:!1,shouldInvalidateServiceNode:!0};throw a}return dg(e,s)}function dg(t,e){if(Array.isArray(t.bindings))t.bindings.push(e);else if(t.bindings===void 0)t.bindings=e;else{if(!Ot.is(t))throw new Ce(Ee.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!0}}return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}}function pg(t,e,n){if(Ot.is(e)&&!e.isExpanded())return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1};const i=rc(t),r=t.rootConstraints.isMultiple&&t.rootConstraints.chained;return Yu(t,e,n,i,r)}function Ju(t,e,n,i){if(Ot.is(t)&&!t.isExpanded())return{bindingNodeRemoved:void 0,isContextFreeBinding:!0};const r=new Bn(n.last);if(!e.isSatisfiedBy(r)||n.last.elem.getAncestorsCalled)return{bindingNodeRemoved:void 0,isContextFreeBinding:!n.last.elem.getAncestorsCalled};let s;if(Array.isArray(t.bindings))t.bindings=t.bindings.filter(a=>a.binding===e?(s=a,!1):!0);else if(t.bindings?.binding===e)if(s=t.bindings,i)t.bindings=void 0;else{if(!Ot.is(t))throw new Ce(Ee.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");t.invalidate()}return{bindingNodeRemoved:s,isContextFreeBinding:!0}}function hg(t,e,n){if(Ot.is(e)&&!e.isExpanded())return{bindingNodeRemoved:void 0,isContextFreeBinding:!0};const i=rc(t);return Ju(e,n,i,t.rootConstraints.isOptional??!1)}const hl=4,Fo=2,Do=1,gg=8;class gl{#e;#t;#i;#n;#r;#o;constructor(){this.#e=new Map,this.#t=this.#s(),this.#i=this.#s(),this.#n=this.#s(),this.#r=this.#s(),this.#o=new ig}clearCache(){for(const e of this.#p())e.clear();for(const e of this.#o)e.clearCache()}get(e){return e.name===void 0?e.tag===void 0?this.#a(this.#t,e).get(e.serviceIdentifier):this.#a(this.#r,e).get(e.serviceIdentifier)?.get(e.tag.key)?.get(e.tag.value):e.tag===void 0?this.#a(this.#i,e).get(e.serviceIdentifier)?.get(e.name):this.#a(this.#n,e).get(e.serviceIdentifier)?.get(e.name)?.get(e.tag.key)?.get(e.tag.value)}invalidateServiceBinding(e){this.#b(e),this.#f(e),this.#d(e),this.#w(e),this.#y(e);for(const n of this.#o)n.invalidateServiceBinding(e)}set(e,n){e.name===void 0?e.tag===void 0?this.#a(this.#t,e).set(e.serviceIdentifier,n):this.#c(this.#c(this.#a(this.#r,e),e.serviceIdentifier),e.tag.key).set(e.tag.value,n):e.tag===void 0?this.#c(this.#a(this.#i,e),e.serviceIdentifier).set(e.name,n):this.#c(this.#c(this.#c(this.#a(this.#n,e),e.serviceIdentifier),e.name),e.tag.key).set(e.tag.value,n)}setNonCachedServiceNode(e,n){let i=this.#e.get(e.serviceIdentifier);i===void 0&&(i=new Map,this.#e.set(e.serviceIdentifier,i)),i.set(e,n)}subscribe(e){this.#o.push(e)}#s(){const e=new Array(gg);for(let n=0;n<e.length;++n)e[n]=new Map;return e}#l(e,n,i,r){const s=(n&Fo)!==0;let a;return s?a={chained:(n&Fo&hl)!==0,isMultiple:s,serviceIdentifier:e.binding.serviceIdentifier}:a={isMultiple:s,serviceIdentifier:e.binding.serviceIdentifier},(n&Do)!==0&&(a.isOptional=!0),i!==void 0&&(a.name=i),r!==void 0&&(a.tag=r),{autobindOptions:void 0,operations:e.operations,rootConstraints:a,servicesBranch:[]}}#c(e,n){let i=e.get(n);return i===void 0&&(i=new Map,e.set(n,i)),i}#a(e,n){return e[this.#u(n)]}#p(){return[this.#e,...this.#t,...this.#i,...this.#n,...this.#r]}#u(e){return e.isMultiple?(e.chained?hl:0)|(e.optional?Do:0)|Fo:e.optional?Do:0}#f(e){for(const[n,i]of this.#i.entries()){const r=i.get(e.binding.serviceIdentifier);if(r!==void 0)for(const[s,a]of r.entries())this.#g(e,a,n,s,void 0)}}#d(e){for(const[n,i]of this.#n.entries()){const r=i.get(e.binding.serviceIdentifier);if(r!==void 0)for(const[s,a]of r.entries())for(const[u,d]of a.entries())for(const[g,v]of d.entries())this.#g(e,v,n,s,{key:u,value:g})}}#h(e){switch(e.binding.type){case Re.ServiceRedirection:for(const n of e.redirections)this.#h(n);break;case Re.Instance:for(const n of e.constructorParams)n!==void 0&&this.#m(n);for(const n of e.propertyParams.values())this.#m(n);break;case Re.ResolvedValue:for(const n of e.params)this.#m(n);break}}#m(e){const n=this.#e.get(e.serviceIdentifier);n===void 0||!n.has(e)||(n.delete(e),this.#v(e))}#v(e){if(!(Ot.is(e)&&!e.isExpanded())&&e.bindings!==void 0)if(Array.isArray(e.bindings))for(const n of e.bindings)this.#h(n);else this.#h(e.bindings)}#y(e){const n=this.#e.get(e.binding.serviceIdentifier);if(n!==void 0)switch(e.kind){case Wt.bindingAdded:for(const[i,r]of n){const s=Yu({autobindOptions:void 0,operations:e.operations,servicesBranch:[]},i,e.binding,r.bindingConstraintsList,r.chainedBindings);s.isContextFreeBinding?s.shouldInvalidateServiceNode&&Ot.is(i)&&(this.#v(i),i.invalidate()):this.clearCache()}break;case Wt.bindingRemoved:for(const[i,r]of n){const s=Ju(i,e.binding,r.bindingConstraintsList,r.optionalBindings);s.isContextFreeBinding?s.bindingNodeRemoved!==void 0&&this.#h(s.bindingNodeRemoved):this.clearCache()}break}}#b(e){for(const[n,i]of this.#t.entries()){const r=i.get(e.binding.serviceIdentifier);this.#g(e,r,n,void 0,void 0)}}#w(e){for(const[n,i]of this.#r.entries()){const r=i.get(e.binding.serviceIdentifier);if(r!==void 0)for(const[s,a]of r.entries())for(const[u,d]of a.entries())this.#g(e,d,n,void 0,{key:s,value:u})}}#g(e,n,i,r,s){if(n!==void 0&&Ot.is(n.tree.root)){const a=this.#l(e,i,r,s);switch(e.kind){case Wt.bindingAdded:{const u=pg(a,n.tree.root,e.binding);u.isContextFreeBinding?u.shouldInvalidateServiceNode&&(this.#v(n.tree.root),n.tree.root.invalidate()):this.clearCache()}break;case Wt.bindingRemoved:{const u=hg(a,n.tree.root,e.binding);u.isContextFreeBinding?u.bindingNodeRemoved!==void 0&&this.#h(u.bindingNodeRemoved):this.clearCache()}break}}}}const mg=-1;function vg(t,e){if(nc(e)||Ce.isErrorOfKind(e,Ee.planningMaxDepthExceeded)){const n=wg(yg(t));throw new Ce(Ee.planning,`Circular dependency found: ${n}`,{cause:e})}throw e}function yg(t){const e=t.planResult.tree.root,n=[];function i(s){const a=n.indexOf(s);if(a!==mg)return[...n.slice(a),s].map(d=>d.serviceIdentifier);n.push(s);try{for(const u of bg(s)){const d=i(u);if(d!==void 0)return d}}finally{n.pop()}}return i(e)??[]}function bg(t){const e=[],n=t.bindings;if(n===void 0)return e;const i=r=>{if(ri(r)){for(const s of r.redirections)i(s);return}switch(r.binding.type){case Re.Instance:{const s=r;for(const a of s.constructorParams)a!==void 0&&e.push(a);for(const a of s.propertyParams.values())e.push(a);break}case Re.ResolvedValue:{const s=r;for(const a of s.params)e.push(a);break}}};if(Array.isArray(n))for(const r of n)i(r);else i(n);return e}function wg(t){const e=[...t];return e.length===0?"(No dependency trace)":e.map(lt).join(" -> ")}function xg(t,e){return e.value}function Qu(t,e){return Ze(e)?(t.cache={isRight:!0,value:e},e.then(n=>ml(t,n))):ml(t,e)}function ml(t,e){return t.cache={isRight:!0,value:e},e}function Sg(t,e,n){const i=t.getActivations(e);return i===void 0?n:Ze(n)?Xu(t,n,i[Symbol.iterator]()):kg(t,n,i[Symbol.iterator]())}function kg(t,e,n){let i=e,r=n.next();for(;r.done!==!0;){const s=r.value(t.context,i);if(Ze(s))return Xu(t,s,n);i=s,r=n.next()}return i}async function Xu(t,e,n){let i=await e,r=n.next();for(;r.done!==!0;)i=await r.value(t.context,i),r=n.next();return i}function ys(t,e,n){let i=n;if(e.onActivation!==void 0){const r=e.onActivation;Ze(i)?i=i.then(s=>r(t.context,s)):i=r(t.context,i)}return Sg(t,e.serviceIdentifier,i)}function Zu(t){return(e,n)=>{if(n.cache.isRight)return n.cache.value;const i=ys(e,n,t(e,n));return Qu(n,i)}}const _g=Zu(xg);function Cg(t,e){return e.value(t.context)}function Eg(t){return t}function ac(t,e){return(n,i)=>{const r=t(i);switch(r.scope){case Gt.Singleton:{if(r.cache.isRight)return r.cache.value;const s=ys(n,r,e(n,i));return Qu(r,s)}case Gt.Request:{if(n.requestScopeCache.has(r.id))return n.requestScopeCache.get(r.id);const s=ys(n,r,e(n,i));return n.requestScopeCache.set(r.id,s),s}case Gt.Transient:return ys(n,r,e(n,i))}}}const Ig=t=>ac(Eg,t),Pg=Ig(Cg);function Ag(t,e){return e.factory(t.context)}const Og=Zu(Ag);function Tg(t){return(e,n)=>{const i=[];for(const r of n.constructorParams)r===void 0?i.push(void 0):i.push(t(e,r));return i.some(Ze)?Promise.all(i):i}}function Ng(t,e,n){return(i,r)=>{const s=t(i,r);return Ze(s)?e(s,i,r):n(s,i,r)}}function Mg(t){return async(e,n,i)=>{const r=await e;return t(r,n,i)}}function vl(t,e,n){const i=Rg(t,e,n);return Ze(i)?i.then(()=>t):t}function Rg(t,e,n){if(n in t)if(typeof t[n]=="function"){let i;try{i=t[n]()}catch(r){throw new Ce(Ee.resolution,`Unexpected error found when calling "${n.toString()}" @postConstruct decorated method on class "${e.implementationType.name}"`,{cause:r})}if(Ze(i))return jg(e,n,i)}else throw new Ce(Ee.resolution,`Expecting a "${n.toString()}" method when resolving "${e.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);else throw new Ce(Ee.resolution,`Expecting a "${n.toString()}" property when resolving "${e.implementationType.name}" class @postConstruct decorated method, none found.`)}async function jg(t,e,n){try{await n}catch(i){throw new Ce(Ee.resolution,`Unexpected error found when calling "${e.toString()}" @postConstruct decorated method on class "${t.implementationType.name}"`,{cause:i})}}function yl(t,e,n){if(n.size===0)return t;let i=t;for(const r of n)Ze(i)?i=i.then(s=>vl(s,e,r)):i=vl(i,e,r);return i}function bl(t){return(e,n,i)=>{const r=new i.binding.implementationType(...e),s=t(n,r,i);return Ze(s)?s.then(()=>yl(r,i.binding,i.classMetadata.lifecycle.postConstructMethodNames)):yl(r,i.binding,i.classMetadata.lifecycle.postConstructMethodNames)}}function Bg(t){return(e,n)=>{const i=t(e,n);return Ze(i)?i.then(r=>n.binding.factory(...r)):n.binding.factory(...i)}}function Lg(t){return(e,n)=>{const i=[];for(const r of n.params)i.push(t(e,r));return i.some(Ze)?Promise.all(i):i}}function $g(t){return t.binding}const Fg=t=>ac($g,t);function Dg(t){return t.binding}const Ug=t=>ac(Dg,t);function Kg(t){function e(n,i){const r=[];for(const s of i.redirections)ri(s)?r.push(...e(n,s)):r.push(t(n,s));return r}return e}function qg(t){return(e,n,i)=>{const r=[];for(const[s,a]of i.propertyParams){const u=i.classMetadata.properties.get(s);if(u===void 0)throw new Ce(Ee.resolution,`Expecting metadata at property "${s.toString()}", none found`);u.kind!==xt.unmanaged&&a.bindings!==void 0&&(n[s]=t(e,a),Ze(n[s])&&r.push((async()=>{n[s]=await n[s]})()))}if(r.length>0)return Promise.all(r).then(()=>{})}}const wl=qg(Vs),ef=Kg(cc),Vg=Ng(Tg(Vs),Mg(bl(wl)),bl(wl)),zg=Bg(Lg(Vs)),Wg=Fg(Vg),Hg=Ug(zg);function Gg(t){try{const e=t.planResult.tree.root;return Vs(t,e)}catch(e){vg(t,e)}}function cc(t,e){switch(e.binding.type){case Re.ConstantValue:return _g(t,e.binding);case Re.DynamicValue:return Pg(t,e.binding);case Re.Factory:return Og(t,e.binding);case Re.Instance:return Wg(t,e);case Re.ResolvedValue:return Hg(t,e)}}function Vs(t,e){if(e.bindings!==void 0)return Array.isArray(e.bindings)?Yg(t,e.bindings):Jg(t,e.bindings)}function Yg(t,e){const n=[];for(const i of e)ri(i)?n.push(...ef(t,i)):n.push(cc(t,i));return n.some(Ze)?Promise.all(n):n}function Jg(t,e){if(ri(e)){const n=ef(t,e);if(n.length===1)return n[0];throw new Ce(Ee.resolution,"Unexpected multiple resolved values on single injection")}else return cc(t,e)}function Qg(t){return t.scope!==void 0}function Xg(t,e){if(e.type===Re.Instance){const n=t.getClassMetadata(e.implementationType),i=e.cache.value;return Ze(i)?i.then(r=>Sl(n,r)):Sl(n,i)}}function xl(t,e){if(typeof t[e]=="function")return t[e]()}function Sl(t,e){const n=t.lifecycle.preDestroyMethodNames;if(n.size===0)return;let i;for(const r of n)i===void 0?i=xl(e,r):i=i.then(()=>xl(e,r));return i}function kl(t,e,n){const i=t.getDeactivations(e);if(i!==void 0)return Ze(n)?tf(n,i[Symbol.iterator]()):Zg(n,i[Symbol.iterator]())}function Zg(t,e){let n=e.next();for(;n.done!==!0;){const i=n.value(t);if(Ze(i))return tf(t,e);n=e.next()}}async function tf(t,e){const n=await t;let i=e.next();for(;i.done!==!0;)await i.value(n),i=e.next()}function em(t,e){const n=Xg(t,e);return n===void 0?_l(t,e):n.then(()=>_l(t,e))}function _l(t,e){const n=e.cache;return Ze(n.value)?n.value.then(i=>Cl(t,e,i)):Cl(t,e,n.value)}function Cl(t,e,n){let i;if(e.onDeactivation!==void 0){const r=e.onDeactivation;i=r(n)}return i===void 0?kl(t,e.serviceIdentifier,n):i.then(()=>kl(t,e.serviceIdentifier,n))}function As(t,e){if(e===void 0)return;const n=tm(e),i=[];for(const r of n){const s=em(t,r);s!==void 0&&i.push(s)}if(i.length>0)return Promise.all(i).then(()=>{})}function tm(t){const e=[];for(const n of t)Qg(n)&&n.scope===Gt.Singleton&&n.cache.isRight&&e.push(n);return e}function nm(t,e){const n=t.getBindingsFromModule(e);return As(t,n)}function im(t,e){const n=t.getBindings(e);return As(t,n)}const nf=Symbol.for("@inversifyjs/container/bindingIdentifier");function El(t){return typeof t=="object"&&t!==null&&t[nf]===!0}class vi{static always=e=>!0}const Uo=Symbol.for("@inversifyjs/container/InversifyContainerError");class Dt extends Error{[Uo];kind;constructor(e,n,i){super(n,i),this[Uo]=!0,this.kind=e}static is(e){return typeof e=="object"&&e!==null&&e[Uo]===!0}static isErrorOfKind(e,n){return Dt.is(e)&&e.kind===n}}var Ut;(function(t){t[t.invalidOperation=0]="invalidOperation"})(Ut||(Ut={}));function lc(t){return{[nf]:!0,id:t.id}}function Ir(t){return e=>{for(let n=e.getAncestor();n!==void 0;n=n.getAncestor())if(t(n))return!0;return!1}}function Pr(t){return e=>e.name===t}function rm(t){return Ir(Pr(t))}function zs(t){return e=>e.serviceIdentifier===t}function sm(t){return Ir(zs(t))}function Ar(t,e){return n=>n.tags.has(t)&&n.tags.get(t)===e}function om(t,e){return Ir(Ar(t,e))}function am(t){return t.name===void 0&&t.tags.size===0}function cm(t){return t.isMultiple===!0}function Ws(t){const e=Ir(t);return n=>!e(n)}function lm(t){return Ws(Pr(t))}function um(t){return Ws(zs(t))}function fm(t,e){return Ws(Ar(t,e))}function Hs(t){return e=>{const n=e.getAncestor();return n===void 0||!t(n)}}function dm(t){return Hs(Pr(t))}function pm(t){return Hs(zs(t))}function hm(t,e){return Hs(Ar(t,e))}function Gs(t){return e=>{const n=e.getAncestor();return n!==void 0&&t(n)}}function gm(t){return Gs(Pr(t))}function mm(t){return Gs(zs(t))}function vm(t,e){return Gs(Ar(t,e))}function ym(t){return typeof t=="object"&&!Fs.is(t)}class bm{#e;constructor(e){this.#e=e}getIdentifier(){return lc(this.#e)}inRequestScope(){return this.#e.scope=Gt.Request,new Pi(this.#e)}inSingletonScope(){return this.#e.scope=Gt.Singleton,new Pi(this.#e)}inTransientScope(){return this.#e.scope=Gt.Transient,new Pi(this.#e)}}class rf{#e;#t;#i;#n;constructor(e,n,i,r){this.#e=e,this.#t=n,this.#i=i,this.#n=r}to(e){const n=Ds(e),i={cache:{isRight:!1,value:void 0},id:Hn(),implementationType:e,isSatisfiedBy:vi.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:n.scope??this.#i,serviceIdentifier:this.#n,type:Re.Instance};return this.#e(i),new Ko(i)}toSelf(){if(typeof this.#n!="function")throw new Error('"toSelf" function can only be applied when a newable function is used as service identifier');return this.to(this.#n)}toConstantValue(e){const n={cache:{isRight:!1,value:void 0},id:Hn(),isSatisfiedBy:vi.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:Gt.Singleton,serviceIdentifier:this.#n,type:Re.ConstantValue,value:e};return this.#e(n),new Pi(n)}toDynamicValue(e){const n={cache:{isRight:!1,value:void 0},id:Hn(),isSatisfiedBy:vi.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:this.#i,serviceIdentifier:this.#n,type:Re.DynamicValue,value:e};return this.#e(n),new Ko(n)}toResolvedValue(e,n){const i={cache:{isRight:!1,value:void 0},factory:e,id:Hn(),isSatisfiedBy:vi.always,metadata:this.#r(n),moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:this.#i,serviceIdentifier:this.#n,type:Re.ResolvedValue};return this.#e(i),new Ko(i)}toFactory(e){const n={cache:{isRight:!1,value:void 0},factory:e,id:Hn(),isSatisfiedBy:vi.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:Gt.Singleton,serviceIdentifier:this.#n,type:Re.Factory};return this.#e(n),new Pi(n)}toService(e){const n={id:Hn(),isSatisfiedBy:vi.always,moduleId:this.#t,serviceIdentifier:this.#n,targetServiceIdentifier:e,type:Re.ServiceRedirection};this.#e(n)}#r(e){return{arguments:(e??[]).map(i=>ym(i)?cm(i)?{chained:i.chained??!1,kind:dn.multipleInjection,name:i.name,optional:i.optional??!1,tags:new Map((i.tags??[]).map(r=>[r.key,r.value])),value:i.serviceIdentifier}:{kind:dn.singleInjection,name:i.name,optional:i.optional??!1,tags:new Map((i.tags??[]).map(r=>[r.key,r.value])),value:i.serviceIdentifier}:{kind:dn.singleInjection,name:void 0,optional:!1,tags:new Map,value:i})}}}class sf{#e;constructor(e){this.#e=e}getIdentifier(){return lc(this.#e)}onActivation(e){return this.#e.onActivation=e,new la(this.#e)}onDeactivation(e){if(this.#e.onDeactivation=e,this.#e.scope!==Gt.Singleton)throw new Dt(Ut.invalidOperation,`Binding for service "${lt(this.#e.serviceIdentifier)}" has a deactivation function, but its scope is not singleton. Deactivation functions can only be used with singleton bindings.`);return new la(this.#e)}}class la{#e;constructor(e){this.#e=e}getIdentifier(){return lc(this.#e)}when(e){return this.#e.isSatisfiedBy=e,new sf(this.#e)}whenAnyAncestor(e){return this.when(Ir(e))}whenAnyAncestorIs(e){return this.when(sm(e))}whenAnyAncestorNamed(e){return this.when(rm(e))}whenAnyAncestorTagged(e,n){return this.when(om(e,n))}whenDefault(){return this.when(am)}whenNamed(e){return this.when(Pr(e))}whenNoParent(e){return this.when(Hs(e))}whenNoParentIs(e){return this.when(pm(e))}whenNoParentNamed(e){return this.when(dm(e))}whenNoParentTagged(e,n){return this.when(hm(e,n))}whenParent(e){return this.when(Gs(e))}whenParentIs(e){return this.when(mm(e))}whenParentNamed(e){return this.when(gm(e))}whenParentTagged(e,n){return this.when(vm(e,n))}whenTagged(e,n){return this.when(Ar(e,n))}whenNoAncestor(e){return this.when(Ws(e))}whenNoAncestorIs(e){return this.when(um(e))}whenNoAncestorNamed(e){return this.when(lm(e))}whenNoAncestorTagged(e,n){return this.when(fm(e,n))}}class Pi extends la{#e;constructor(e){super(e),this.#e=new sf(e)}onActivation(e){return this.#e.onActivation(e)}onDeactivation(e){return this.#e.onDeactivation(e)}}class Ko extends Pi{#e;constructor(e){super(e),this.#e=new bm(e)}inRequestScope(){return this.#e.inRequestScope()}inSingletonScope(){return this.#e.inSingletonScope()}inTransientScope(){return this.#e.inTransientScope()}}function wm(t){if(t===void 0)return;const e=t.next();if(e.done!==!0)return e.value}function xm(t){return wm(t?.[Symbol.iterator]())}class Sm{#e;#t;#i;#n;constructor(e,n,i,r){this.#e=e,this.#t=n,this.#i=i,this.#n=r}bind(e){return new rf(n=>{this.#r(n)},void 0,this.#t,e)}isBound(e,n){const i=this.#n.bindingService.get(e);return this.#d(e,i,n)}isCurrentBound(e,n){const i=this.#n.bindingService.getNonParentBindings(e);return this.#d(e,i,n)}async rebindAsync(e){return await this.unbindAsync(e),this.bind(e)}rebind(e){return this.unbind(e),this.bind(e)}async unbindAsync(e){await this.#s(e)}async unbindAllAsync(){await this.#a()}unbindAll(){if(this.#a()!==void 0)throw new Dt(Ut.invalidOperation,"Unexpected asynchronous deactivation when unbinding all services. Consider using Container.unbindAllAsync() instead.")}unbind(e){this.#s(e)!==void 0&&this.#o(e)}#r(e){this.#n.bindingService.set(e),this.#i.invalidateService({binding:e,kind:Wt.bindingAdded})}#o(e){let n;if(El(e)){const i=this.#n.bindingService.getById(e.id),r=xm(i)?.serviceIdentifier;r===void 0?n="Unexpected asynchronous deactivation when unbinding binding identifier. Consider using Container.unbindAsync() instead.":n=`Unexpected asynchronous deactivation when unbinding "${lt(r)}" binding. Consider using Container.unbindAsync() instead.`}else n=`Unexpected asynchronous deactivation when unbinding "${lt(e)}" service. Consider using Container.unbindAsync() instead.`;throw new Dt(Ut.invalidOperation,n)}#s(e){return El(e)?this.#l(e):this.#u(e)}#l(e){const n=this.#n.bindingService.getById(e.id),i=n===void 0?void 0:[...n],r=As(this.#e,n);if(r===void 0)this.#c(i,e);else return r.then(()=>{this.#c(i,e)})}#c(e,n){if(this.#n.bindingService.removeById(n.id),e!==void 0)for(const i of e)this.#i.invalidateService({binding:i,kind:Wt.bindingRemoved})}#a(){const e=[...this.#n.bindingService.getNonParentBoundServices()],n=e.map(r=>im(this.#e,r));if(n.some(r=>Ze(r)))return Promise.all(n).then(()=>{this.#p(e)});this.#p(e)}#p(e){for(const n of e)this.#n.activationService.removeAllByServiceId(n),this.#n.bindingService.removeAllByServiceId(n),this.#n.deactivationService.removeAllByServiceId(n);this.#n.planResultCacheService.clearCache()}#u(e){const n=this.#n.bindingService.get(e),i=n===void 0?void 0:[...n],r=As(this.#e,n);if(r===void 0)this.#f(e,i);else return r.then(()=>{this.#f(e,i)})}#f(e,n){if(this.#n.activationService.removeAllByServiceId(e),this.#n.bindingService.removeAllByServiceId(e),this.#n.deactivationService.removeAllByServiceId(e),n!==void 0)for(const i of n)this.#i.invalidateService({binding:i,kind:Wt.bindingRemoved})}#d(e,n,i){if(n===void 0)return!1;const r={getAncestor:()=>{},name:i?.name,serviceIdentifier:e,tags:new Map};i?.tag!==void 0&&r.tags.set(i.tag.key,i.tag.value);for(const s of n)if(s.isSatisfiedBy(r))return!0;return!1}}class km{#e;#t;#i;#n;#r;constructor(e,n,i,r,s){this.#e=e,this.#t=n,this.#i=i,this.#n=r,this.#r=s}async loadAsync(...e){await Promise.all(this.#l(...e))}load(...e){const n=this.#l(...e);for(const i of n)if(i!==void 0)throw new Dt(Ut.invalidOperation,"Unexpected asynchronous module load. Consider using container.loadAsync() instead.")}async unloadAsync(...e){await Promise.all(this.#a(...e)),this.#s(e)}unload(...e){const n=this.#a(...e);for(const i of n)if(i!==void 0)throw new Dt(Ut.invalidOperation,"Unexpected asynchronous module unload. Consider using container.unloadAsync() instead.");this.#s(e)}#o(e){return{bind:n=>new rf(i=>{this.#c(i)},e,this.#i,n),isBound:this.#e.isBound.bind(this.#e),onActivation:(n,i)=>{this.#r.activationService.add(i,{moduleId:e,serviceId:n})},onDeactivation:(n,i)=>{this.#r.deactivationService.add(i,{moduleId:e,serviceId:n})},rebind:this.#e.rebind.bind(this.#e),rebindAsync:this.#e.rebindAsync.bind(this.#e),unbind:this.#e.unbind.bind(this.#e),unbindAsync:this.#e.unbindAsync.bind(this.#e)}}#s(e){for(const n of e)this.#r.activationService.removeAllByModuleId(n.id),this.#r.bindingService.removeAllByModuleId(n.id),this.#r.deactivationService.removeAllByModuleId(n.id);this.#r.planResultCacheService.clearCache()}#l(...e){return e.map(n=>n.load(this.#o(n.id)))}#c(e){this.#r.bindingService.set(e),this.#n.invalidateService({binding:e,kind:Wt.bindingAdded})}#a(...e){return e.map(n=>nm(this.#t,n.id))}}function _m(t,e){e.getBindings=t.bindingService.get.bind(t.bindingService),e.getBindingsFromModule=t.bindingService.getByModuleId.bind(t.bindingService),e.getDeactivations=t.deactivationService.get.bind(t.deactivationService)}function Cm(t){return{getBindings:t.bindingService.get.bind(t.bindingService),getBindingsFromModule:t.bindingService.getByModuleId.bind(t.bindingService),getClassMetadata:Ds,getDeactivations:t.deactivationService.get.bind(t.deactivationService)}}class Em{deactivationParams;constructor(e){this.deactivationParams=Cm(e),e.onReset(()=>{_m(e,this.deactivationParams)})}}class Im{planParamsOperations;#e;constructor(e){this.#e=e,this.planParamsOperations={getBindings:this.#e.bindingService.get.bind(this.#e.bindingService),getBindingsChained:this.#e.bindingService.getChained.bind(this.#e.bindingService),getClassMetadata:Ds,getPlan:this.#e.planResultCacheService.get.bind(this.#e.planResultCacheService),setBinding:this.#i.bind(this),setNonCachedServiceNode:this.#e.planResultCacheService.setNonCachedServiceNode.bind(this.#e.planResultCacheService),setPlan:this.#e.planResultCacheService.set.bind(this.#e.planResultCacheService)},this.#e.onReset(()=>{this.#t()})}#t(){this.planParamsOperations.getBindings=this.#e.bindingService.get.bind(this.#e.bindingService),this.planParamsOperations.getBindingsChained=this.#e.bindingService.getChained.bind(this.#e.bindingService),this.planParamsOperations.setBinding=this.#i.bind(this)}#i(e){this.#e.bindingService.set(e),this.#e.planResultCacheService.invalidateServiceBinding({binding:e,kind:Wt.bindingAdded,operations:this.planParamsOperations})}}class Pm{#e;#t;constructor(e,n){this.#e=e,this.#t=n}invalidateService(e){this.#t.planResultCacheService.invalidateServiceBinding({...e,operations:this.#e.planParamsOperations})}}const Am=Symbol.for("@inversifyjs/plugin/isPlugin");class Om{#e;#t;#i;#n;constructor(e,n,i){this.#n=n,this.#i=i,this.#e=this.#o(e),this.#t=this.#s()}register(e,n){const i=new n(e,this.#t);this.#r(i),i.load(this.#e)}#r(e){if(e[Am]!==!0)throw new Dt(Ut.invalidOperation,"Invalid plugin. The plugin must extend the Plugin class")}#o(e){return{define:(n,i)=>{if(Object.prototype.hasOwnProperty.call(e,n))throw new Dt(Ut.invalidOperation,`Container already has a method named "${String(n)}"`);e[n]=i},onPlan:this.#i.onPlan.bind(this.#i)}}#s(){const e=this.#n;return{get activationService(){return e.activationService},get bindingService(){return e.bindingService},get deactivationService(){return e.deactivationService},get planResultCacheService(){return e.planResultCacheService}}}}class Il{activationService;bindingService;deactivationService;planResultCacheService;#e;constructor(e,n,i,r){this.activationService=e,this.bindingService=n,this.deactivationService=i,this.planResultCacheService=r,this.#e=[]}reset(e,n,i){this.activationService=e,this.bindingService=n,this.deactivationService=i,this.planResultCacheService.clearCache();for(const r of this.#e)r()}onReset(e){this.#e.push(e)}}class Tm{#e;#t;#i;#n;#r;#o;#s;constructor(e,n,i,r){this.#o=e,this.#s=n,this.#n=this.#f(),this.#e=i,this.#t=r,this.#i=s=>this.#s.activationService.get(s),this.#r=[],this.#s.onReset(()=>{this.#l()})}get(e,n){const i=this.#u(!1,e,n),r=this.#d(i);if(Ze(r))throw new Dt(Ut.invalidOperation,`Unexpected asynchronous service when resolving service "${lt(e)}"`);return r}getAll(e,n){const i=this.#u(!0,e,n),r=this.#d(i);if(Ze(r))throw new Dt(Ut.invalidOperation,`Unexpected asynchronous service when resolving service "${lt(e)}"`);return r}async getAllAsync(e,n){const i=this.#u(!0,e,n);return this.#d(i)}async getAsync(e,n){const i=this.#u(!1,e,n);return this.#d(i)}onPlan(e){this.#r.push(e)}#l(){this.#n=this.#f()}#c(e,n,i){const r=i?.name,s=i?.optional??!1,a=i?.tag;return e?{chained:i?.chained??!1,isMultiple:e,name:r,optional:s,serviceIdentifier:n,tag:a}:{isMultiple:e,name:r,optional:s,serviceIdentifier:n,tag:a}}#a(e,n,i){const r={autobindOptions:i?.autobind??this.#e?{scope:this.#t}:void 0,operations:this.#o.planParamsOperations,rootConstraints:this.#p(e,n,i),servicesBranch:[]};return this.#h(r,i),r}#p(e,n,i){return n?{chained:i?.chained??!1,isMultiple:n,serviceIdentifier:e}:{isMultiple:n,serviceIdentifier:e}}#u(e,n,i){const r=this.#c(e,n,i),s=this.#s.planResultCacheService.get(r);if(s!==void 0)return s;const a=Zh(this.#a(n,e,i));for(const u of this.#r)u(r,a);return a}#f(){return{get:this.get.bind(this),getAll:this.getAll.bind(this),getAllAsync:this.getAllAsync.bind(this),getAsync:this.getAsync.bind(this)}}#d(e){return Gg({context:this.#n,getActivations:this.#i,planResult:e,requestScopeCache:new Map})}#h(e,n){n!==void 0&&(n.name!==void 0&&(e.rootConstraints.name=n.name),n.optional===!0&&(e.rootConstraints.isOptional=!0),n.tag!==void 0&&(e.rootConstraints.tag={key:n.tag.key,value:n.tag.value}),e.rootConstraints.isMultiple&&(e.rootConstraints.chained=n?.chained??!1))}}class Nm{#e;#t;constructor(e){this.#e=e,this.#t=[]}restore(){const e=this.#t.pop();if(e===void 0)throw new Dt(Ut.invalidOperation,"No snapshot available to restore");this.#e.reset(e.activationService,e.bindingService,e.deactivationService)}snapshot(){this.#t.push({activationService:this.#e.activationService.clone(),bindingService:this.#e.bindingService.clone(),deactivationService:this.#e.deactivationService.clone()})}}const Mm=Gt.Transient;class Rm{#e;#t;#i;#n;#r;#o;constructor(e){const n=e?.autobind??!1,i=e?.defaultScope??Mm;this.#n=this.#l(e,n,i);const r=new Im(this.#n),s=new Pm(r,this.#n),a=new Em(this.#n);this.#e=new Sm(a.deactivationParams,i,s,this.#n),this.#t=new km(this.#e,a.deactivationParams,i,s,this.#n),this.#r=new Tm(r,this.#n,n,i),this.#i=new Om(this,this.#n,this.#r),this.#o=new Nm(this.#n)}bind(e){return this.#e.bind(e)}get(e,n){return this.#r.get(e,n)}getAll(e,n){return this.#r.getAll(e,n)}async getAllAsync(e,n){return this.#r.getAllAsync(e,n)}async getAsync(e,n){return this.#r.getAsync(e,n)}isBound(e,n){return this.#e.isBound(e,n)}isCurrentBound(e,n){return this.#e.isCurrentBound(e,n)}async loadAsync(...e){return this.#t.loadAsync(...e)}load(...e){this.#t.load(...e)}onActivation(e,n){this.#n.activationService.add(n,{serviceId:e})}onDeactivation(e,n){this.#n.deactivationService.add(n,{serviceId:e})}register(e){this.#i.register(this,e)}restore(){this.#o.restore()}async rebindAsync(e){return this.#e.rebindAsync(e)}rebind(e){return this.#e.rebind(e)}snapshot(){this.#o.snapshot()}async unbindAsync(e){await this.#e.unbindAsync(e)}async unbindAllAsync(){await this.#e.unbindAllAsync()}unbindAll(){this.#e.unbindAll()}unbind(e){this.#e.unbind(e)}async unloadAsync(...e){return this.#t.unloadAsync(...e)}unload(...e){this.#t.unload(...e)}#s(e,n){if(e)return{scope:n}}#l(e,n,i){const r=this.#s(n,i);if(e?.parent===void 0)return new Il(hr.build(()=>{}),gr.build(()=>{},r),mr.build(()=>{}),new gl);const s=new gl,a=e.parent;return a.#n.planResultCacheService.subscribe(s),new Il(hr.build(()=>a.#n.activationService),gr.build(()=>a.#n.bindingService,r),mr.build(()=>a.#n.deactivationService),s)}}class ua{jsonld;constructor(e){this.jsonld=e}getIdentifier(){return this.jsonld.identifier}setIdentifier(e){this.jsonld.identifier=e}getName(){return this.jsonld.name}setName(e){this.jsonld.name=e}getText(){return this.jsonld.text}setText(e){this.jsonld.text=e}get(e){return this.jsonld[e]}set(e,n){this.jsonld[e]=n}getSource(){return this.jsonld}}class Nn{id;name;mode="";source;syntax;html;document;css;js;version;headline="";headlineRaw="";lastModificationDate;lastAuthor;canEdit=!0;constructor(e="",n="",i="",r=""){this.document=new ua({}),this.source=i,this.syntax=r,this.html="",this.name=n,this.id=e,this.css=[],this.js=[],this.version=""}toObject(){return{id:this.id,name:this.name,source:this.source,syntax:this.syntax,html:this.html,document:this.document.getSource(),css:this.css,js:this.js,version:this.version}}fromObject(e){this.id=e.id,this.name=e.name,this.source=e.source,this.syntax=e.syntax,this.html=e.html,this.document=new ua(e.document),this.css=e.css,this.js=e.js,this.version=e.version}}var jm=(t,e,n,i)=>{for(var r=e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},Pl=(t,e)=>(n,i)=>e(n,i,t);let vr=class{constructor(e){this.loggerConfig=e}module;setModule(e){this.module=e}debug(...e){(!this.loggerConfig||this.loggerConfig.hasLevelId(this.module,4))&&e.unshift(this.module+":"),console.debug.apply(null,e)}info(...e){e.unshift(this.module+":"),console.info.apply(null,e)}warn(...e){e.unshift(this.module+":"),console.warn.apply(null,e)}error(...e){e.unshift(this.module+":"),console.error.apply(null,e)}};vr=jm([it(),Pl(0,Le("LoggerConfig")),Pl(0,xh())],vr);var Bm=(t,e,n,i)=>{for(var r=e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r};let fa=class{config;computedConfig;defaultLevel;defaultLevelId;levels=new Map;constructor(e="error"){this.config=new Map,this.defaultLevel=e,this.computedConfig=new Map,this.levels.set("error",1),this.levels.set("warn",2),this.levels.set("info",3),this.levels.set("debug",4)}addLevel(e,n){const i=this.levels.get(n);i!=null&&this.config.forEach(r=>{if(r.startsWith(e)){const s=this.computedConfig.get(r);(s==null||i&&i>s)&&i&&this.computedConfig.set(r,i)}})}getLevels(){return this.config}getLevel(e){let n=this.config.get(e);return n||(n=this.defaultLevel),n}getLevelId(e){return this.levels.get(e)||10}setDefaultLevel(e){this.defaultLevel=e,this.defaultLevelId=this.getLevelId(this.defaultLevel)}getDefaultLevel(){return this.defaultLevel}getDefaultLevelId(){return this.defaultLevelId?this.defaultLevelId:(this.defaultLevelId=this.getLevelId(this.defaultLevel),this.defaultLevelId)}hasLevel(e,n){let i=this.computedConfig.get(e);i||(i=this.getDefaultLevelId());const r=this.getLevelId(n);return!!(r&&i>=r)}hasLevelId(e,n){let i=this.computedConfig.get(e);i||(i=this.getDefaultLevelId());const r=n;return!!(r&&i>=r)}};fa=Bm([it()],fa);var Lm=(t,e,n,i)=>{for(var r=e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},$m=(t,e)=>(n,i)=>e(n,i,t);let yr=class{name;baseURL;baseRestURL;realtimeURL;authenticationBaseURL;authenticationManager;homePage;storage;serverRendering;designSystem;editor;offline;offlineSetup;storageRoot;cristal;logger;constructor(e){this.logger=e,this.logger.setModule("storage.components.defaultWikiStorage"),this.offlineSetup=!1}setConfig(e,n,i,r,s,a,u,d,g){Object.assign(this,{name:e,baseURL:n,baseRestURL:i,homePage:r,serverRendering:s,designSystem:a,offline:u,editor:d,...g})}setConfigFromObject(e){Object.assign(this,e)}setupOfflineStorage(){if(this.logger.debug("Checking offline storage"),this.offline&&this.cristal){this.logger.debug("Looking for wrapping offline storage");const e=this.cristal.getContainer().get("WrappingStorage");e?(this.logger.debug("Offline local storage is ready"),e.setStorage(this.storage),e.setWikiConfig(this.storage.getWikiConfig()),this.storage=e):this.logger.debug("Failed Looking for wrapping offline storage")}else this.cristal||this.logger.debug("Cristal not initialized"),this.offline||this.logger.debug("Offline mode not activated")}isSupported(e){return e=="html"}initialize(){this.offline&&!this.offlineSetup&&(this.setupOfflineStorage(),this.offlineSetup=!0,this.storage.isStorageReady())}defaultPageName(){return"index"}getType(){return"Default"}getNewPageDefaultName(){return"newpage"}};yr=Lm([it(),$m(0,Le("Logger"))],yr);var Fm=Object.getOwnPropertyDescriptor,Dm=(t,e,n,i)=>{for(var r=i>1?void 0:i?Fm(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r};let da=class{wikiConfig;container;availableConfigurations;constructor(){this.availableConfigurations=new Map}getApp(){throw new Error("Method not implemented.")}getRouter(){throw new Error("Method not implemented.")}getContainer(){return this.container}setContainer(t){this.container=t}getWikiConfig(){return this.wikiConfig}setWikiConfig(t){this.wikiConfig=t}getSkinManager(){throw new Error("Method not implemented.")}switchConfig(){}setAvailableConfigurations(t){for(const e in t){const n=t[e],i=n?.configType;if(n){const r=this.container.get("WikiConfig",{name:i});r.setConfigFromObject(n),this.availableConfigurations.set(e,r)}}}getAvailableConfigurations(){return this.availableConfigurations}deleteAvailableConfiguration(t){this.availableConfigurations.delete(t)}run(){throw new Error("Method not implemented.")}getUIXTemplates(){throw new Error("Method not implemented.")}getMenuEntries(){throw new Error("Method not implemented.")}getCurrentPage(){throw new Error("Method not implemented.")}getCurrentContent(){throw new Error("Method not implemented.")}getCurrentSource(){throw new Error("Method not implemented.")}getCurrentSyntax(){throw new Error("Method not implemented.")}setCurrentPage(){throw new Error("Method not implemented.")}setContentRef(){throw new Error("Method not implemented.")}loadPageFromURL(){throw new Error("Method not implemented.")}loadPage(){throw new Error("Method not implemented.")}getPage(){throw new Error("Method not implemented.")}getLogger(){return new vr}getLoggerConfig(){throw new Error("Method not implemented.")}};da=Dm([it()],da);var Um=Object.getOwnPropertyDescriptor,Km=(t,e,n,i)=>{for(var r=i>1?void 0:i?Um(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r};let pa=class{constructor(){this.initialize()}initialize(){}getStatus(){return!0}async increment(){return 0}async addToQueue(){}async getQueueSize(){return 0}};pa=Km([it()],pa);let of;const uc=t=>of=t,qm=Symbol();function ha(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var or;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(or||(or={}));const af=()=>{};function Al(t,e,n,i=af){t.add(e);const r=()=>{t.delete(e)&&i()};return!n&&Zl()&&Hd(r),r}function yi(t,...e){t.forEach(n=>{n(...e)})}const Vm=t=>t(),Ol=Symbol(),qo=Symbol();function ga(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,i)=>t.set(i,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const i=e[n],r=t[n];ha(r)&&ha(i)&&t.hasOwnProperty(n)&&!ct(i)&&!On(i)?t[n]=ga(r,i):t[n]=i}return t}const zm=Symbol();function Wm(t){return!ha(t)||!Object.prototype.hasOwnProperty.call(t,zm)}const{assign:_n}=Object;function Hm(t){return!!(ct(t)&&t.effect)}function Gm(t,e,n,i){const{state:r,actions:s,getters:a}=e,u=n.state.value[t];let d;function g(){u||(n.state.value[t]=r?r():{});const v=bp(n.state.value[t]);return _n(v,s,Object.keys(a||{}).reduce((b,w)=>(b[w]=hp(ku(()=>{uc(n);const j=n._s.get(t);return a[w].call(j,j)})),b),{}))}return d=cf(t,g,e,n,i,!0),d}function cf(t,e,n={},i,r,s){let a;const u=_n({actions:{}},n),d={deep:!0};let g,v,b=new Set,w=new Set,j;const z=i.state.value[t];!s&&!z&&(i.state.value[t]={});let M;function K(G){let ge;g=v=!1,typeof G=="function"?(G(i.state.value[t]),ge={type:or.patchFunction,storeId:t,events:j}):(ga(i.state.value[t],G),ge={type:or.patchObject,payload:G,storeId:t,events:j});const je=M=Symbol();Pp().then(()=>{M===je&&(g=!0)}),v=!0,yi(b,ge,i.state.value[t])}const te=s?function(){const{state:ge}=n,je=ge?ge():{};this.$patch(We=>{_n(We,je)})}:af;function Y(){a.stop(),b.clear(),w.clear(),i._s.delete(t)}const se=(G,ge="")=>{if(Ol in G)return G[qo]=ge,G;const je=function(){uc(i);const We=Array.from(arguments),_e=new Set,rt=new Set;function gn(tt){_e.add(tt)}function qt(tt){rt.add(tt)}yi(w,{args:We,name:je[qo],store:ie,after:gn,onError:qt});let ut;try{ut=G.apply(this&&this.$id===t?this:ie,We)}catch(tt){throw yi(rt,tt),tt}return ut instanceof Promise?ut.then(tt=>(yi(_e,tt),tt)).catch(tt=>(yi(rt,tt),Promise.reject(tt))):(yi(_e,ut),ut)};return je[Ol]=!0,je[qo]=ge,je},J={_p:i,$id:t,$onAction:Al.bind(null,w),$patch:K,$reset:te,$subscribe(G,ge={}){const je=Al(b,G,ge.detached,()=>We()),We=a.run(()=>Lp(()=>i.state.value[t],_e=>{(ge.flush==="sync"?v:g)&&G({storeId:t,type:or.direct,events:j},_e)},_n({},d,ge)));return je},$dispose:Y},ie=Ya(J);i._s.set(t,ie);const pe=(i._a&&i._a.runWithContext||Vm)(()=>i._e.run(()=>(a=Wd()).run(()=>e({action:se}))));for(const G in pe){const ge=pe[G];if(ct(ge)&&!Hm(ge)||On(ge))s||(z&&Wm(ge)&&(ct(ge)?ge.value=z[G]:ga(ge,z[G])),i.state.value[t][G]=ge);else if(typeof ge=="function"){const je=se(ge,G);pe[G]=je,u.actions[G]=ge}}return _n(ie,pe),_n(Me(ie),pe),Object.defineProperty(ie,"$state",{get:()=>i.state.value[t],set:G=>{K(ge=>{_n(ge,G)})}}),i._p.forEach(G=>{_n(ie,a.run(()=>G({store:ie,app:i._a,pinia:i,options:u})))}),z&&s&&n.hydrate&&n.hydrate(ie.$state,z),g=!0,v=!0,ie}function Ym(t,e,n){let i;const r=typeof e=="function";i=r?n:e;function s(a,u){const d=Rp();return a=a||(d?wu(qm,null):null),a&&uc(a),a=of,a._s.has(t)||(r?cf(t,e,i,a):Gm(t,i,a)),a._s.get(t)}return s.$id=t,s}function Jm(t){const e=Me(t),n={};for(const i in e){const r=e[i];r.effect?n[i]=ku({get:()=>t[i],set(s){t[i]=s}}):(ct(r)||On(r))&&(n[i]=Sp(t,i))}return n}var Qm=Object.getOwnPropertyDescriptor,Xm=(t,e,n,i)=>{for(var r=i>1?void 0:i?Qm(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r};const Zm=Ym("alerts",{state(){return{alerts:[],id:0}},actions:{createAlert(t,e,n){const i=this.alerts.find(r=>r.type==t&&r.message==e&&r.actions==n);i?i.duplicatesCount++:this.alerts.push({id:this.id++,type:t,message:e,actions:n,duplicatesCount:0})},deleteAlert(t){for(const e of this.alerts.keys())if(this.alerts[e].id==t){this.alerts.splice(e,1);break}}}});let ma=class{refs;store;constructor(){this.store=Zm(),this.refs=Jm(this.store)}list(){return this.refs.alerts}info(t,e){this.store.createAlert("info",t,e)}success(t,e){this.store.createAlert("success",t,e)}warning(t,e){this.store.createAlert("warning",t,e)}error(t,e){this.store.createAlert("error",t,e)}dismiss(t){this.store.deleteAlert(t)}};ma=Xm([it()],ma);var ev=Object.getOwnPropertyDescriptor,tv=(t,e,n,i)=>{for(var r=i>1?void 0:i?ev(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},nv=(t,e)=>(n,i)=>e(n,i,t);let va=class{constructor(t){this.cristal=t}get(){return this.cristal.getContainer().get("AlertsService")}};va=tv([it(),nv(0,Le("CristalApp"))],va);let iv=class{constructor(e){e.bind("AlertsService").to(ma).inSingletonScope(),e.bind("AlertsServiceProvider").to(va).inSingletonScope()}};var rv=Object.getOwnPropertyDescriptor,sv=(t,e,n,i)=>{for(var r=i>1?void 0:i?rv(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},ov=(t,e)=>(n,i)=>e(n,i,t);let ya=class{constructor(t){this.cristalApp=t}get(t){const e=t??this.cristalApp.getWikiConfig().authenticationManager??this.cristalApp.getWikiConfig().getType();try{return this.cristalApp.getContainer().get("AuthenticationManager",{name:e})}catch(n){this.cristalApp.getLogger("authentication.api").warn(`Couldn't resolve AuthenticationManager for type=[${e}]`,n);return}}};ya=sv([it(),ov(0,Le("CristalApp"))],ya);let av=class{constructor(e){e.bind("AuthenticationManagerProvider").to(ya).inSingletonScope()}};var bs={exports:{}},cv=bs.exports,Tl;function lv(){return Tl||(Tl=1,(function(t,e){((n,i)=>{t.exports=i()})(cv,function(){var n=function(o,c){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(l,f){l.__proto__=f}:function(l,f){for(var p in f)Object.prototype.hasOwnProperty.call(f,p)&&(l[p]=f[p])}))(o,c)},i=function(){return(i=Object.assign||function(o){for(var c,l=1,f=arguments.length;l<f;l++)for(var p in c=arguments[l])Object.prototype.hasOwnProperty.call(c,p)&&(o[p]=c[p]);return o}).apply(this,arguments)};function r(o,c,l){for(var f,p=0,h=c.length;p<h;p++)!f&&p in c||((f=f||Array.prototype.slice.call(c,0,p))[p]=c[p]);return o.concat(f||Array.prototype.slice.call(c))}var s=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:lr,a=Object.keys,u=Array.isArray;function d(o,c){return typeof c=="object"&&a(c).forEach(function(l){o[l]=c[l]}),o}typeof Promise>"u"||s.Promise||(s.Promise=Promise);var g=Object.getPrototypeOf,v={}.hasOwnProperty;function b(o,c){return v.call(o,c)}function w(o,c){typeof c=="function"&&(c=c(g(o))),(typeof Reflect>"u"?a:Reflect.ownKeys)(c).forEach(function(l){z(o,l,c[l])})}var j=Object.defineProperty;function z(o,c,l,f){j(o,c,d(l&&b(l,"get")&&typeof l.get=="function"?{get:l.get,set:l.set,configurable:!0}:{value:l,configurable:!0,writable:!0},f))}function M(o){return{from:function(c){return o.prototype=Object.create(c.prototype),z(o.prototype,"constructor",o),{extend:w.bind(null,o.prototype)}}}}var K=Object.getOwnPropertyDescriptor,te=[].slice;function Y(o,c,l){return te.call(o,c,l)}function se(o,c){return c(o)}function J(o){if(!o)throw new Error("Assertion Failed")}function ie(o){s.setImmediate?setImmediate(o):setTimeout(o,0)}function ue(o,c){if(typeof c=="string"&&b(o,c))return o[c];if(!c)return o;if(typeof c!="string"){for(var l=[],f=0,p=c.length;f<p;++f){var h=ue(o,c[f]);l.push(h)}return l}var m,y=c.indexOf(".");return y===-1||(m=o[c.substr(0,y)])==null?void 0:ue(m,c.substr(y+1))}function pe(o,c,l){if(o&&c!==void 0&&!("isFrozen"in Object&&Object.isFrozen(o)))if(typeof c!="string"&&"length"in c){J(typeof l!="string"&&"length"in l);for(var f=0,p=c.length;f<p;++f)pe(o,c[f],l[f])}else{var h,m,y=c.indexOf(".");y!==-1?(h=c.substr(0,y),(y=c.substr(y+1))===""?l===void 0?u(o)&&!isNaN(parseInt(h))?o.splice(h,1):delete o[h]:o[h]=l:pe(m=(m=o[h])&&b(o,h)?m:o[h]={},y,l)):l===void 0?u(o)&&!isNaN(parseInt(c))?o.splice(c,1):delete o[c]:o[c]=l}}function G(o){var c,l={};for(c in o)b(o,c)&&(l[c]=o[c]);return l}var ge=[].concat;function je(o){return ge.apply([],o)}var kt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(je([8,16,32,64].map(function(o){return["Int","Uint","Float"].map(function(c){return c+o+"Array"})}))).filter(function(o){return s[o]}),We=new Set(kt.map(function(o){return s[o]})),_e=null;function rt(o){return _e=new WeakMap,o=(function c(l){if(!l||typeof l!="object")return l;var f=_e.get(l);if(f)return f;if(u(l)){f=[],_e.set(l,f);for(var p=0,h=l.length;p<h;++p)f.push(c(l[p]))}else if(We.has(l.constructor))f=l;else{var m,y=g(l);for(m in f=y===Object.prototype?{}:Object.create(y),_e.set(l,f),l)b(l,m)&&(f[m]=c(l[m]))}return f})(o),_e=null,o}var gn={}.toString;function qt(o){return gn.call(o).slice(8,-1)}var ut=typeof Symbol<"u"?Symbol.iterator:"@@iterator",tt=typeof ut=="symbol"?function(o){var c;return o!=null&&(c=o[ut])&&c.apply(o)}:function(){return null};function he(o,c){c=o.indexOf(c),0<=c&&o.splice(c,1)}var ft={};function St(o){var c,l,f,p;if(arguments.length===1){if(u(o))return o.slice();if(this===ft&&typeof o=="string")return[o];if(p=tt(o))for(l=[];!(f=p.next()).done;)l.push(f.value);else{if(o==null)return[o];if(typeof(c=o.length)!="number")return[o];for(l=new Array(c);c--;)l[c]=o[c]}}else for(c=arguments.length,l=new Array(c);c--;)l[c]=arguments[c];return l}var Ue=typeof Symbol<"u"?function(o){return o[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},kt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Q=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(kt),ve={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function dt(o,c){this.name=o,this.message=c}function oi(o,c){return o+". Errors: "+Object.keys(c).map(function(l){return c[l].toString()}).filter(function(l,f,p){return p.indexOf(l)===f}).join(`
|
|
49
|
-
`)}function Pe(o,c,l,f){this.failures=c,this.failedKeys=f,this.successCount=l,this.message=oi(o,c)}function Vt(o,c){this.name="BulkError",this.failures=Object.keys(c).map(function(l){return c[l]}),this.failuresByPos=c,this.message=oi(o,this.failures)}M(dt).from(Error).extend({toString:function(){return this.name+": "+this.message}}),M(Pe).from(dt),M(Vt).from(dt);var Jt=Q.reduce(function(o,c){return o[c]=c+"Error",o},{}),Ln=dt,fe=Q.reduce(function(o,c){var l=c+"Error";function f(p,h){this.name=l,p?typeof p=="string"?(this.message="".concat(p).concat(h?`
|
|
50
|
-
`+h:""),this.inner=h||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=ve[c]||l,this.inner=null)}return M(f).from(Ln),o[c]=f,o},{}),pt=(fe.Syntax=SyntaxError,fe.Type=TypeError,fe.Range=RangeError,kt.reduce(function(o,c){return o[c+"Error"]=fe[c],o},{}));kt=Q.reduce(function(o,c){return["Syntax","Type","Range"].indexOf(c)===-1&&(o[c+"Error"]=fe[c]),o},{});function Ae(){}function Et(o){return o}function $n(o,c){return o==null||o===Et?c:function(l){return c(o(l))}}function Tt(o,c){return function(){o.apply(this,arguments),c.apply(this,arguments)}}function rn(o,c){return o===Ae?c:function(){var l=o.apply(this,arguments),f=(l!==void 0&&(arguments[0]=l),this.onsuccess),p=this.onerror,h=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return f&&(this.onsuccess=this.onsuccess?Tt(f,this.onsuccess):f),p&&(this.onerror=this.onerror?Tt(p,this.onerror):p),h!==void 0?h:l}}function Qt(o,c){return o===Ae?c:function(){o.apply(this,arguments);var l=this.onsuccess,f=this.onerror;this.onsuccess=this.onerror=null,c.apply(this,arguments),l&&(this.onsuccess=this.onsuccess?Tt(l,this.onsuccess):l),f&&(this.onerror=this.onerror?Tt(f,this.onerror):f)}}function ai(o,c){return o===Ae?c:function(p){var f=o.apply(this,arguments),p=(d(p,f),this.onsuccess),h=this.onerror,m=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return p&&(this.onsuccess=this.onsuccess?Tt(p,this.onsuccess):p),h&&(this.onerror=this.onerror?Tt(h,this.onerror):h),f===void 0?m===void 0?void 0:m:d(f,m)}}function ci(o,c){return o===Ae?c:function(){return c.apply(this,arguments)!==!1&&o.apply(this,arguments)}}function mn(o,c){return o===Ae?c:function(){var l=o.apply(this,arguments);if(l&&typeof l.then=="function"){for(var f=this,p=arguments.length,h=new Array(p);p--;)h[p]=arguments[p];return l.then(function(){return c.apply(f,h)})}return c.apply(this,arguments)}}kt.ModifyError=Pe,kt.DexieError=dt,kt.BulkError=Vt;var mt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Nt(o){mt=o}var $={},q=100,V=typeof Promise>"u"?[]:(Q=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[V=crypto.subtle.digest("SHA-512",new Uint8Array([0])),g(V),Q]:[Q,g(Q),Q]),Q=V[0],hi=V[1],hi=hi&&hi.then,de=Q&&Q.constructor,st=!!V[2],qe=function(o,c){ye.push([o,c]),nt&&(queueMicrotask(It),nt=!1)},vt=!0,nt=!0,S=[],A=[],T=Et,D={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ae,pgp:!1,env:{},finalize:Ae},F=D,ye=[],xe=0,be=[];function L(o){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var c=this._PSD=F;if(typeof o!="function"){if(o!==$)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&le(this,this._value)}else this._state=null,this._value=null,++c.ref,(function l(f,p){try{p(function(h){if(f._state===null){if(h===f)throw new TypeError("A promise cannot be resolved with itself.");var m=f._lib&&sn();h&&typeof h.then=="function"?l(f,function(y,_){h instanceof L?h._then(y,_):h.then(y,_)}):(f._state=!0,f._value=h,Se(f)),m&&vn()}},le.bind(null,f))}catch(h){le(f,h)}})(this,o)}var re={get:function(){var o=F,c=Fr;function l(f,p){var h=this,m=!o.global&&(o!==F||c!==Fr),y=m&&!bn(),_=new L(function(N,C){Be(h,new ae(Oc(f,o,m,y),Oc(p,o,m,y),N,C,o))});return this._consoleTask&&(_._consoleTask=this._consoleTask),_}return l.prototype=$,l},set:function(o){z(this,"then",o&&o.prototype===$?re:{get:function(){return o},set:re.set})}};function ae(o,c,l,f,p){this.onFulfilled=typeof o=="function"?o:null,this.onRejected=typeof c=="function"?c:null,this.resolve=l,this.reject=f,this.psd=p}function le(o,c){var l,f;A.push(c),o._state===null&&(l=o._lib&&sn(),c=T(c),o._state=!1,o._value=c,f=o,S.some(function(p){return p._value===f._value})||S.push(f),Se(o),l)&&vn()}function Se(o){var c=o._listeners;o._listeners=[];for(var l=0,f=c.length;l<f;++l)Be(o,c[l]);var p=o._PSD;--p.ref||p.finalize(),xe===0&&(++xe,qe(function(){--xe==0&&$i()},[]))}function Be(o,c){if(o._state===null)o._listeners.push(c);else{var l=o._state?c.onFulfilled:c.onRejected;if(l===null)return(o._state?c.resolve:c.reject)(o._value);++c.psd.ref,++xe,qe(Ve,[l,o,c])}}function Ve(o,c,l){try{var f,p=c._value;!c._state&&A.length&&(A=[]),f=mt&&c._consoleTask?c._consoleTask.run(function(){return o(p)}):o(p),c._state||A.indexOf(p)!==-1||(h=>{for(var m=S.length;m;)if(S[--m]._value===h._value)return S.splice(m,1)})(c),l.resolve(f)}catch(h){l.reject(h)}finally{--xe==0&&$i(),--l.psd.ref||l.psd.finalize()}}function It(){Fn(D,function(){sn()&&vn()})}function sn(){var o=vt;return nt=vt=!1,o}function vn(){var o,c,l;do for(;0<ye.length;)for(o=ye,ye=[],l=o.length,c=0;c<l;++c){var f=o[c];f[0].apply(null,f[1])}while(0<ye.length);nt=vt=!0}function $i(){for(var o=S,c=(S=[],o.forEach(function(f){f._PSD.onunhandled.call(null,f._value,f)}),be.slice(0)),l=c.length;l;)c[--l]()}function Br(o){return new L($,!1,o)}function Ke(o,c){var l=F;return function(){var f=sn(),p=F;try{return wn(l,!0),o.apply(this,arguments)}catch(h){c&&c(h)}finally{wn(p,!1),f&&vn()}}}w(L.prototype,{then:re,_then:function(o,c){Be(this,new ae(null,null,o,c,F))},catch:function(o){var c,l;return arguments.length===1?this.then(null,o):(c=o,l=arguments[1],typeof c=="function"?this.then(null,function(f){return(f instanceof c?l:Br)(f)}):this.then(null,function(f){return(f&&f.name===c?l:Br)(f)}))},finally:function(o){return this.then(function(c){return L.resolve(o()).then(function(){return c})},function(c){return L.resolve(o()).then(function(){return Br(c)})})},timeout:function(o,c){var l=this;return o<1/0?new L(function(f,p){var h=setTimeout(function(){return p(new fe.Timeout(c))},o);l.then(f,p).finally(clearTimeout.bind(null,h))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&z(L.prototype,Symbol.toStringTag,"Dexie.Promise"),D.env=Ac(),w(L,{all:function(){var o=St.apply(null,arguments).map(Dr);return new L(function(c,l){o.length===0&&c([]);var f=o.length;o.forEach(function(p,h){return L.resolve(p).then(function(m){o[h]=m,--f||c(o)},l)})})},resolve:function(o){return o instanceof L?o:o&&typeof o.then=="function"?new L(function(c,l){o.then(c,l)}):new L($,!0,o)},reject:Br,race:function(){var o=St.apply(null,arguments).map(Dr);return new L(function(c,l){o.map(function(f){return L.resolve(f).then(c,l)})})},PSD:{get:function(){return F},set:function(o){return F=o}},totalEchoes:{get:function(){return Fr}},newPSD:yn,usePSD:Fn,scheduler:{get:function(){return qe},set:function(o){qe=o}},rejectionMapper:{get:function(){return T},set:function(o){T=o}},follow:function(o,c){return new L(function(l,f){return yn(function(p,h){var m=F;m.unhandleds=[],m.onunhandled=h,m.finalize=Tt(function(){var y,_=this;y=function(){_.unhandleds.length===0?p():h(_.unhandleds[0])},be.push(function N(){y(),be.splice(be.indexOf(N),1)}),++xe,qe(function(){--xe==0&&$i()},[])},m.finalize),o()},c,l,f)})}}),de&&(de.allSettled&&z(L,"allSettled",function(){var o=St.apply(null,arguments).map(Dr);return new L(function(c){o.length===0&&c([]);var l=o.length,f=new Array(l);o.forEach(function(p,h){return L.resolve(p).then(function(m){return f[h]={status:"fulfilled",value:m}},function(m){return f[h]={status:"rejected",reason:m}}).then(function(){return--l||c(f)})})})}),de.any&&typeof AggregateError<"u"&&z(L,"any",function(){var o=St.apply(null,arguments).map(Dr);return new L(function(c,l){o.length===0&&l(new AggregateError([]));var f=o.length,p=new Array(f);o.forEach(function(h,m){return L.resolve(h).then(function(y){return c(y)},function(y){p[m]=y,--f||l(new AggregateError(p))})})})}),de.withResolvers)&&(L.withResolvers=de.withResolvers);var ot={awaits:0,echoes:0,id:0},ud=0,Lr=[],$r=0,Fr=0,fd=0;function yn(o,m,l,f){var p=F,h=Object.create(p),m=(h.parent=p,h.ref=0,h.global=!1,h.id=++fd,D.env,h.env=st?{Promise:L,PromiseProp:{value:L,configurable:!0,writable:!0},all:L.all,race:L.race,allSettled:L.allSettled,any:L.any,resolve:L.resolve,reject:L.reject}:{},m&&d(h,m),++p.ref,h.finalize=function(){--this.parent.ref||this.parent.finalize()},Fn(h,o,l,f));return h.ref===0&&h.finalize(),m}function li(){return ot.id||(ot.id=++ud),++ot.awaits,ot.echoes+=q,ot.id}function bn(){return!!ot.awaits&&(--ot.awaits==0&&(ot.id=0),ot.echoes=ot.awaits*q,!0)}function Dr(o){return ot.echoes&&o&&o.constructor===de?(li(),o.then(function(c){return bn(),c},function(c){return bn(),Ge(c)})):o}function dd(){var o=Lr[Lr.length-1];Lr.pop(),wn(o,!1)}function wn(o,c){var l,f,p=F;(c?!ot.echoes||$r++&&o===F:!$r||--$r&&o===F)||queueMicrotask(c?function(h){++Fr,ot.echoes&&--ot.echoes!=0||(ot.echoes=ot.awaits=ot.id=0),Lr.push(F),wn(h,!0)}.bind(null,o):dd),o!==F&&(F=o,p===D&&(D.env=Ac()),st)&&(l=D.env.Promise,f=o.env,p.global||o.global)&&(Object.defineProperty(s,"Promise",f.PromiseProp),l.all=f.all,l.race=f.race,l.resolve=f.resolve,l.reject=f.reject,f.allSettled&&(l.allSettled=f.allSettled),f.any)&&(l.any=f.any)}function Ac(){var o=s.Promise;return st?{Promise:o,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:o.all,race:o.race,allSettled:o.allSettled,any:o.any,resolve:o.resolve,reject:o.reject}:{}}function Fn(o,c,l,f,p){var h=F;try{return wn(o,!0),c(l,f,p)}finally{wn(h,!1)}}function Oc(o,c,l,f){return typeof o!="function"?o:function(){var p=F;l&&li(),wn(c,!0);try{return o.apply(this,arguments)}finally{wn(p,!1),f&&queueMicrotask(bn)}}}function ro(o){Promise===de&&ot.echoes===0?$r===0?o():enqueueNativeMicroTask(o):setTimeout(o,0)}(""+hi).indexOf("[native code]")===-1&&(li=bn=Ae);var Ge=L.reject,Dn="",on="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Tc="String expected.",ui=[],Ur="__dbnames",so="readonly",oo="readwrite";function Un(o,c){return o?c?function(){return o.apply(this,arguments)&&c.apply(this,arguments)}:o:c}var Nc={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Kr(o){return typeof o!="string"||/\./.test(o)?function(c){return c}:function(c){return c[o]===void 0&&o in c&&delete(c=rt(c))[o],c}}function Mc(){throw fe.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function Ie(o,c){try{var l=Rc(o),f=Rc(c);if(l!==f)return l==="Array"?1:f==="Array"?-1:l==="binary"?1:f==="binary"?-1:l==="string"?1:f==="string"?-1:l==="Date"?1:f!=="Date"?NaN:-1;switch(l){case"number":case"Date":case"string":return c<o?1:o<c?-1:0;case"binary":for(var p=jc(o),h=jc(c),m=p.length,y=h.length,_=m<y?m:y,N=0;N<_;++N)if(p[N]!==h[N])return p[N]<h[N]?-1:1;return m===y?0:m<y?-1:1;case"Array":for(var C=o,x=c,I=C.length,P=x.length,E=I<P?I:P,k=0;k<E;++k){var R=Ie(C[k],x[k]);if(R!==0)return R}return I===P?0:I<P?-1:1}}catch{}return NaN}function Rc(o){var c=typeof o;return c=="object"&&(ArrayBuffer.isView(o)||(c=qt(o))==="ArrayBuffer")?"binary":c}function jc(o){return o instanceof Uint8Array?o:ArrayBuffer.isView(o)?new Uint8Array(o.buffer,o.byteOffset,o.byteLength):new Uint8Array(o)}function qr(o,c,l){var f=o.schema.yProps;return f?(c&&0<l.numFailures&&(c=c.filter(function(p,h){return!l.failures[h]})),Promise.all(f.map(function(p){return p=p.updatesTable,c?o.db.table(p).where("k").anyOf(c).delete():o.db.table(p).clear()})).then(function(){return l})):l}Bc.prototype.execute=function(o){var c=this["@@propmod"];if(c.add!==void 0){var l=c.add;if(u(l))return r(r([],u(o)?o:[],!0),l).sort();if(typeof l=="number")return(Number(o)||0)+l;if(typeof l=="bigint")try{return BigInt(o)+l}catch{return BigInt(0)+l}throw new TypeError("Invalid term ".concat(l))}if(c.remove!==void 0){var f=c.remove;if(u(f))return u(o)?o.filter(function(p){return!f.includes(p)}).sort():[];if(typeof f=="number")return Number(o)-f;if(typeof f=="bigint")try{return BigInt(o)-f}catch{return BigInt(0)-f}throw new TypeError("Invalid subtrahend ".concat(f))}return l=(l=c.replacePrefix)==null?void 0:l[0],l&&typeof o=="string"&&o.startsWith(l)?c.replacePrefix[1]+o.substring(l.length):o};var Fi=Bc;function Bc(o){this["@@propmod"]=o}function Lc(o,c){for(var l=a(c),f=l.length,p=!1,h=0;h<f;++h){var m=l[h],y=c[m],_=ue(o,m);y instanceof Fi?(pe(o,m,y.execute(_)),p=!0):_!==y&&(pe(o,m,y),p=!0)}return p}$e.prototype._trans=function(o,c,l){var f=this._tx||F.trans,p=this.name,h=mt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(o==="readonly"?"read":"write"," ").concat(this.name));function m(N,C,x){if(x.schema[p])return c(x.idbtrans,x);throw new fe.NotFound("Table "+p+" not part of transaction")}var y=sn();try{var _=f&&f.db._novip===this.db._novip?f===F.trans?f._promise(o,m,l):yn(function(){return f._promise(o,m,l)},{trans:f,transless:F.transless||F}):(function N(C,x,I,P){if(C.idbdb&&(C._state.openComplete||F.letThrough||C._vip)){var E=C._createTransaction(x,I,C._dbSchema);try{E.create(),C._state.PR1398_maxLoop=3}catch(k){return k.name===Jt.InvalidState&&C.isOpen()&&0<--C._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),C.close({disableAutoOpen:!1}),C.open().then(function(){return N(C,x,I,P)})):Ge(k)}return E._promise(x,function(k,R){return yn(function(){return F.trans=E,P(k,R,E)})}).then(function(k){if(x==="readwrite")try{E.idbtrans.commit()}catch{}return x==="readonly"?k:E._completion.then(function(){return k})})}if(C._state.openComplete)return Ge(new fe.DatabaseClosed(C._state.dbOpenError));if(!C._state.isBeingOpened){if(!C._state.autoOpen)return Ge(new fe.DatabaseClosed);C.open().catch(Ae)}return C._state.dbReadyPromise.then(function(){return N(C,x,I,P)})})(this.db,o,[this.name],m);return h&&(_._consoleTask=h,_=_.catch(function(N){return console.trace(N),Ge(N)})),_}finally{y&&vn()}},$e.prototype.get=function(o,c){var l=this;return o&&o.constructor===Object?this.where(o).first(c):o==null?Ge(new fe.Type("Invalid argument to Table.get()")):this._trans("readonly",function(f){return l.core.get({trans:f,key:o}).then(function(p){return l.hook.reading.fire(p)})}).then(c)},$e.prototype.where=function(o){if(typeof o=="string")return new this.db.WhereClause(this,o);if(u(o))return new this.db.WhereClause(this,"[".concat(o.join("+"),"]"));var c=a(o);if(c.length===1)return this.where(c[0]).equals(o[c[0]]);var l=this.schema.indexes.concat(this.schema.primKey).filter(function(y){if(y.compound&&c.every(function(N){return 0<=y.keyPath.indexOf(N)})){for(var _=0;_<c.length;++_)if(c.indexOf(y.keyPath[_])===-1)return!1;return!0}return!1}).sort(function(y,_){return y.keyPath.length-_.keyPath.length})[0];if(l&&this.db._maxKey!==Dn)return m=l.keyPath.slice(0,c.length),this.where(m).equals(m.map(function(y){return o[y]}));!l&&mt&&console.warn("The query ".concat(JSON.stringify(o)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(c.join("+"),"]"));var f=this.schema.idxByName;function p(y,_){return Ie(y,_)===0}var m=c.reduce(function(C,_){var N=C[0],C=C[1],x=f[_],I=o[_];return[N||x,N||!x?Un(C,x&&x.multi?function(P){return P=ue(P,_),u(P)&&P.some(function(E){return p(I,E)})}:function(P){return p(I,ue(P,_))}):C]},[null,null]),h=m[0],m=m[1];return h?this.where(h.name).equals(o[h.keyPath]).filter(m):l?this.filter(m):this.where(c).equals("")},$e.prototype.filter=function(o){return this.toCollection().and(o)},$e.prototype.count=function(o){return this.toCollection().count(o)},$e.prototype.offset=function(o){return this.toCollection().offset(o)},$e.prototype.limit=function(o){return this.toCollection().limit(o)},$e.prototype.each=function(o){return this.toCollection().each(o)},$e.prototype.toArray=function(o){return this.toCollection().toArray(o)},$e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},$e.prototype.orderBy=function(o){return new this.db.Collection(new this.db.WhereClause(this,u(o)?"[".concat(o.join("+"),"]"):o))},$e.prototype.reverse=function(){return this.toCollection().reverse()},$e.prototype.mapToClass=function(o){for(var c=this.db,l=this.name,f=((this.schema.mappedClass=o).prototype instanceof Mc&&(o=(m=>{var y=C,_=m;if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function N(){this.constructor=y}function C(){return m!==null&&m.apply(this,arguments)||this}return n(y,_),y.prototype=_===null?Object.create(_):(N.prototype=_.prototype,new N),Object.defineProperty(C.prototype,"db",{get:function(){return c},enumerable:!1,configurable:!0}),C.prototype.table=function(){return l},C})(o)),new Set),p=o.prototype;p;p=g(p))Object.getOwnPropertyNames(p).forEach(function(m){return f.add(m)});function h(m){if(!m)return m;var y,_=Object.create(o.prototype);for(y in m)if(!f.has(y))try{_[y]=m[y]}catch{}return _}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=h,this.hook("reading",h),o},$e.prototype.defineClass=function(){return this.mapToClass(function(o){d(this,o)})},$e.prototype.add=function(o,c){var l=this,f=this.schema.primKey,p=f.auto,h=f.keyPath,m=o;return h&&p&&(m=Kr(h)(o)),this._trans("readwrite",function(y){return l.core.mutate({trans:y,type:"add",keys:c!=null?[c]:null,values:[m]})}).then(function(y){return y.numFailures?L.reject(y.failures[0]):y.lastResult}).then(function(y){if(h)try{pe(o,h,y)}catch{}return y})},$e.prototype.upsert=function(o,c){var l=this,f=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return l.core.get({trans:p,key:o}).then(function(h){var m=h??{};return Lc(m,c),f&&pe(m,f,o),l.core.mutate({trans:p,type:"put",values:[m],keys:[o],upsert:!0,updates:{keys:[o],changeSpecs:[c]}}).then(function(y){return y.numFailures?L.reject(y.failures[0]):!!h})})})},$e.prototype.update=function(o,c){return typeof o!="object"||u(o)?this.where(":id").equals(o).modify(c):(o=ue(o,this.schema.primKey.keyPath))===void 0?Ge(new fe.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(o).modify(c)},$e.prototype.put=function(o,c){var l=this,f=this.schema.primKey,p=f.auto,h=f.keyPath,m=o;return h&&p&&(m=Kr(h)(o)),this._trans("readwrite",function(y){return l.core.mutate({trans:y,type:"put",values:[m],keys:c!=null?[c]:null})}).then(function(y){return y.numFailures?L.reject(y.failures[0]):y.lastResult}).then(function(y){if(h)try{pe(o,h,y)}catch{}return y})},$e.prototype.delete=function(o){var c=this;return this._trans("readwrite",function(l){return c.core.mutate({trans:l,type:"delete",keys:[o]}).then(function(f){return qr(c,[o],f)}).then(function(f){return f.numFailures?L.reject(f.failures[0]):void 0})})},$e.prototype.clear=function(){var o=this;return this._trans("readwrite",function(c){return o.core.mutate({trans:c,type:"deleteRange",range:Nc}).then(function(l){return qr(o,null,l)})}).then(function(c){return c.numFailures?L.reject(c.failures[0]):void 0})},$e.prototype.bulkGet=function(o){var c=this;return this._trans("readonly",function(l){return c.core.getMany({keys:o,trans:l}).then(function(f){return f.map(function(p){return c.hook.reading.fire(p)})})})},$e.prototype.bulkAdd=function(o,c,l){var f=this,p=Array.isArray(c)?c:void 0,h=(l=l||(p?void 0:c))?l.allKeys:void 0;return this._trans("readwrite",function(m){var y=f.schema.primKey,N=y.auto,y=y.keyPath;if(y&&p)throw new fe.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==o.length)throw new fe.InvalidArgument("Arguments objects and keys must have the same length");var _=o.length,N=y&&N?o.map(Kr(y)):o;return f.core.mutate({trans:m,type:"add",keys:p,values:N,wantResults:h}).then(function(C){var x=C.numFailures,I=C.failures;if(x===0)return h?C.results:C.lastResult;throw new Vt("".concat(f.name,".bulkAdd(): ").concat(x," of ").concat(_," operations failed"),I)})})},$e.prototype.bulkPut=function(o,c,l){var f=this,p=Array.isArray(c)?c:void 0,h=(l=l||(p?void 0:c))?l.allKeys:void 0;return this._trans("readwrite",function(m){var y=f.schema.primKey,N=y.auto,y=y.keyPath;if(y&&p)throw new fe.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==o.length)throw new fe.InvalidArgument("Arguments objects and keys must have the same length");var _=o.length,N=y&&N?o.map(Kr(y)):o;return f.core.mutate({trans:m,type:"put",keys:p,values:N,wantResults:h}).then(function(C){var x=C.numFailures,I=C.failures;if(x===0)return h?C.results:C.lastResult;throw new Vt("".concat(f.name,".bulkPut(): ").concat(x," of ").concat(_," operations failed"),I)})})},$e.prototype.bulkUpdate=function(o){var c=this,l=this.core,f=o.map(function(m){return m.key}),p=o.map(function(m){return m.changes}),h=[];return this._trans("readwrite",function(m){return l.getMany({trans:m,keys:f,cache:"clone"}).then(function(y){var _=[],N=[],C=(o.forEach(function(x,I){var P=x.key,E=x.changes,k=y[I];if(k){for(var R=0,B=Object.keys(E);R<B.length;R++){var O=B[R],U=E[O];if(O===c.schema.primKey.keyPath){if(Ie(U,P)!==0)throw new fe.Constraint("Cannot update primary key in bulkUpdate()")}else pe(k,O,U)}h.push(I),_.push(P),N.push(k)}}),_.length);return l.mutate({trans:m,type:"put",keys:_,values:N,updates:{keys:f,changeSpecs:p}}).then(function(x){var I=x.numFailures,P=x.failures;if(I===0)return C;for(var E=0,k=Object.keys(P);E<k.length;E++){var R,B=k[E],O=h[Number(B)];O!=null&&(R=P[B],delete P[B],P[O]=R)}throw new Vt("".concat(c.name,".bulkUpdate(): ").concat(I," of ").concat(C," operations failed"),P)})})})},$e.prototype.bulkDelete=function(o){var c=this,l=o.length;return this._trans("readwrite",function(f){return c.core.mutate({trans:f,type:"delete",keys:o}).then(function(p){return qr(c,o,p)})}).then(function(f){var p=f.numFailures,h=f.failures;if(p===0)return f.lastResult;throw new Vt("".concat(c.name,".bulkDelete(): ").concat(p," of ").concat(l," operations failed"),h)})};var $c=$e;function $e(){}function Di(o){function c(m,y){if(y){for(var _=arguments.length,N=new Array(_-1);--_;)N[_-1]=arguments[_];return l[m].subscribe.apply(null,N),o}if(typeof m=="string")return l[m]}var l={};c.addEventType=h;for(var f=1,p=arguments.length;f<p;++f)h(arguments[f]);return c;function h(m,y,_){var N,C;if(typeof m!="object")return y=y||ci,C={subscribers:[],fire:_=_||Ae,subscribe:function(x){C.subscribers.indexOf(x)===-1&&(C.subscribers.push(x),C.fire=y(C.fire,x))},unsubscribe:function(x){C.subscribers=C.subscribers.filter(function(I){return I!==x}),C.fire=C.subscribers.reduce(y,_)}},l[m]=c[m]=C;a(N=m).forEach(function(x){var I=N[x];if(u(I))h(x,N[x][0],N[x][1]);else{if(I!=="asap")throw new fe.InvalidArgument("Invalid event config");var P=h(x,Et,function(){for(var E=arguments.length,k=new Array(E);E--;)k[E]=arguments[E];P.subscribers.forEach(function(R){ie(function(){R.apply(null,k)})})})}})}}function Ui(o,c){return M(c).from({prototype:o}),c}function fi(o,c){return!(o.filter||o.algorithm||o.or)&&(c?o.justLimit:!o.replayFilter)}function ao(o,c){o.filter=Un(o.filter,c)}function co(o,c,l){var f=o.replayFilter;o.replayFilter=f?function(){return Un(f(),c())}:c,o.justLimit=l&&!f}function Vr(o,c){if(o.isPrimKey)return c.primaryKey;var l=c.getIndexByKeyPath(o.index);if(l)return l;throw new fe.Schema("KeyPath "+o.index+" on object store "+c.name+" is not indexed")}function Fc(o,c,l){var f=Vr(o,c.schema);return c.openCursor({trans:l,values:!o.keysOnly,reverse:o.dir==="prev",unique:!!o.unique,query:{index:f,range:o.range}})}function zr(o,c,l,f){var p,h,m=o.replayFilter?Un(o.filter,o.replayFilter()):o.filter;return o.or?(p={},h=function(y,_,N){var C,x;m&&!m(_,N,function(I){return _.stop(I)},function(I){return _.fail(I)})||((x=""+(C=_.primaryKey))=="[object ArrayBuffer]"&&(x=""+new Uint8Array(C)),b(p,x))||(p[x]=!0,c(y,_,N))},Promise.all([o.or._iterate(h,l),Dc(Fc(o,f,l),o.algorithm,h,!o.keysOnly&&o.valueMapper)])):Dc(Fc(o,f,l),Un(o.algorithm,m),c,!o.keysOnly&&o.valueMapper)}function Dc(o,c,l,f){var p=Ke(f?function(h,m,y){return l(f(h),m,y)}:l);return o.then(function(h){if(h)return h.start(function(){var m=function(){return h.continue()};c&&!c(h,function(y){return m=y},function(y){h.stop(y),m=Ae},function(y){h.fail(y),m=Ae})||p(h.value,h,function(y){return m=y}),m()})})}Te.prototype._read=function(o,c){var l=this._ctx;return l.error?l.table._trans(null,Ge.bind(null,l.error)):l.table._trans("readonly",o).then(c)},Te.prototype._write=function(o){var c=this._ctx;return c.error?c.table._trans(null,Ge.bind(null,c.error)):c.table._trans("readwrite",o,"locked")},Te.prototype._addAlgorithm=function(o){var c=this._ctx;c.algorithm=Un(c.algorithm,o)},Te.prototype._iterate=function(o,c){return zr(this._ctx,o,c,this._ctx.table.core)},Te.prototype.clone=function(o){var c=Object.create(this.constructor.prototype),l=Object.create(this._ctx);return o&&d(l,o),c._ctx=l,c},Te.prototype.raw=function(){return this._ctx.valueMapper=null,this},Te.prototype.each=function(o){var c=this._ctx;return this._read(function(l){return zr(c,o,l,c.table.core)})},Te.prototype.count=function(o){var c=this;return this._read(function(l){var f,p=c._ctx,h=p.table.core;return fi(p,!0)?h.count({trans:l,query:{index:Vr(p,h.schema),range:p.range}}).then(function(m){return Math.min(m,p.limit)}):(f=0,zr(p,function(){return++f,!1},l,h).then(function(){return f}))}).then(o)},Te.prototype.sortBy=function(o,c){var l=o.split(".").reverse(),f=l[0],p=l.length-1;function h(_,N){return N?h(_[l[N]],N-1):_[f]}var m=this._ctx.dir==="next"?1:-1;function y(_,N){return Ie(h(_,p),h(N,p))*m}return this.toArray(function(_){return _.sort(y)}).then(c)},Te.prototype.toArray=function(o){var c=this;return this._read(function(l){var f,p,h,m=c._ctx;return m.dir==="next"&&fi(m,!0)&&0<m.limit?(f=m.valueMapper,p=Vr(m,m.table.core.schema),m.table.core.query({trans:l,limit:m.limit,values:!0,query:{index:p,range:m.range}}).then(function(y){return y=y.result,f?y.map(f):y})):(h=[],zr(m,function(y){return h.push(y)},l,m.table.core).then(function(){return h}))},o)},Te.prototype.offset=function(o){var c=this._ctx;return o<=0||(c.offset+=o,fi(c)?co(c,function(){var l=o;return function(f,p){return l===0||(l===1?--l:p(function(){f.advance(l),l=0}),!1)}}):co(c,function(){var l=o;return function(){return--l<0}})),this},Te.prototype.limit=function(o){return this._ctx.limit=Math.min(this._ctx.limit,o),co(this._ctx,function(){var c=o;return function(l,f,p){return--c<=0&&f(p),0<=c}},!0),this},Te.prototype.until=function(o,c){return ao(this._ctx,function(l,f,p){return!o(l.value)||(f(p),c)}),this},Te.prototype.first=function(o){return this.limit(1).toArray(function(c){return c[0]}).then(o)},Te.prototype.last=function(o){return this.reverse().first(o)},Te.prototype.filter=function(o){var c;return ao(this._ctx,function(l){return o(l.value)}),(c=this._ctx).isMatch=Un(c.isMatch,o),this},Te.prototype.and=function(o){return this.filter(o)},Te.prototype.or=function(o){return new this.db.WhereClause(this._ctx.table,o,this)},Te.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Te.prototype.desc=function(){return this.reverse()},Te.prototype.eachKey=function(o){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(l,f){o(f.key,f)})},Te.prototype.eachUniqueKey=function(o){return this._ctx.unique="unique",this.eachKey(o)},Te.prototype.eachPrimaryKey=function(o){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(l,f){o(f.primaryKey,f)})},Te.prototype.keys=function(o){var c=this._ctx,l=(c.keysOnly=!c.isMatch,[]);return this.each(function(f,p){l.push(p.key)}).then(function(){return l}).then(o)},Te.prototype.primaryKeys=function(o){var c=this._ctx;if(c.dir==="next"&&fi(c,!0)&&0<c.limit)return this._read(function(f){var p=Vr(c,c.table.core.schema);return c.table.core.query({trans:f,values:!1,limit:c.limit,query:{index:p,range:c.range}})}).then(function(f){return f.result}).then(o);c.keysOnly=!c.isMatch;var l=[];return this.each(function(f,p){l.push(p.primaryKey)}).then(function(){return l}).then(o)},Te.prototype.uniqueKeys=function(o){return this._ctx.unique="unique",this.keys(o)},Te.prototype.firstKey=function(o){return this.limit(1).keys(function(c){return c[0]}).then(o)},Te.prototype.lastKey=function(o){return this.reverse().firstKey(o)},Te.prototype.distinct=function(){var o,c=this._ctx,c=c.index&&c.table.schema.idxByName[c.index];return c&&c.multi&&(o={},ao(this._ctx,function(f){var f=f.primaryKey.toString(),p=b(o,f);return o[f]=!0,!p})),this},Te.prototype.modify=function(o){var c=this,l=this._ctx;return this._write(function(f){function p(k,R){var B=R.failures;I+=k-R.numFailures;for(var O=0,U=a(B);O<U.length;O++){var W=U[O];x.push(B[W])}}var h=typeof o=="function"?o:function(k){return Lc(k,o)},m=l.table.core,C=m.schema.primaryKey,y=C.outbound,_=C.extractKey,N=200,C=c.db._options.modifyChunkSize,x=(C&&(N=typeof C=="object"?C[m.name]||C["*"]||200:C),[]),I=0,P=[],E=o===Uc;return c.clone().primaryKeys().then(function(k){function R(O){var U=Math.min(N,k.length-O),W=k.slice(O,O+U);return(E?Promise.resolve([]):m.getMany({trans:f,keys:W,cache:"immutable"})).then(function(Z){var ee=[],H=[],oe=y?[]:null,ne=E?W:[];if(!E)for(var X=0;X<U;++X){var ce=Z[X],Oe={value:rt(ce),primKey:k[O+X]};h.call(Oe,Oe.value,Oe)!==!1&&(Oe.value==null?ne.push(k[O+X]):y||Ie(_(ce),_(Oe.value))===0?(H.push(Oe.value),y&&oe.push(k[O+X])):(ne.push(k[O+X]),ee.push(Oe.value)))}return Promise.resolve(0<ee.length&&m.mutate({trans:f,type:"add",values:ee}).then(function(Ne){for(var me in Ne.failures)ne.splice(parseInt(me),1);p(ee.length,Ne)})).then(function(){return(0<H.length||B&&typeof o=="object")&&m.mutate({trans:f,type:"put",keys:oe,values:H,criteria:B,changeSpec:typeof o!="function"&&o,isAdditionalChunk:0<O}).then(function(Ne){return p(H.length,Ne)})}).then(function(){return(0<ne.length||B&&E)&&m.mutate({trans:f,type:"delete",keys:ne,criteria:B,isAdditionalChunk:0<O}).then(function(Ne){return qr(l.table,ne,Ne)}).then(function(Ne){return p(ne.length,Ne)})}).then(function(){return k.length>O+U&&R(O+N)})})}var B=fi(l)&&l.limit===1/0&&(typeof o!="function"||E)&&{index:l.index,range:l.range};return R(0).then(function(){if(0<x.length)throw new Pe("Error modifying one or more objects",x,I,P);return k.length})})})},Te.prototype.delete=function(){var o=this._ctx,c=o.range;return!fi(o)||o.table.schema.yProps||!o.isPrimKey&&c.type!==3?this.modify(Uc):this._write(function(l){var f=o.table.core.schema.primaryKey,p=c;return o.table.core.count({trans:l,query:{index:f,range:p}}).then(function(h){return o.table.core.mutate({trans:l,type:"deleteRange",range:p}).then(function(_){var y=_.failures,_=_.numFailures;if(_)throw new Pe("Could not delete some values",Object.keys(y).map(function(N){return y[N]}),h-_);return h-_})})})};var pd=Te;function Te(){}var Uc=function(o,c){return c.value=null};function hd(o,c){return o<c?-1:o===c?0:1}function gd(o,c){return c<o?-1:o===c?0:1}function Pt(o,c,l){return o=o instanceof qc?new o.Collection(o):o,o._ctx.error=new(l||TypeError)(c),o}function di(o){return new o.Collection(o,function(){return Kc("")}).limit(0)}function Wr(P,c,l,f){var p,h,m,y,_,N,C,x=l.length;if(!l.every(function(k){return typeof k=="string"}))return Pt(P,Tc);function I(k){p=k==="next"?function(B){return B.toUpperCase()}:function(B){return B.toLowerCase()},h=k==="next"?function(B){return B.toLowerCase()}:function(B){return B.toUpperCase()},m=k==="next"?hd:gd;var R=l.map(function(B){return{lower:h(B),upper:p(B)}}).sort(function(B,O){return m(B.lower,O.lower)});y=R.map(function(B){return B.upper}),_=R.map(function(B){return B.lower}),C=(N=k)==="next"?"":f}I("next");var P=new P.Collection(P,function(){return xn(y[0],_[x-1]+f)}),E=(P._ondirectionchange=function(k){I(k)},0);return P._addAlgorithm(function(k,R,B){var O=k.key;if(typeof O=="string"){var U=h(O);if(c(U,_,E))return!0;for(var W=null,Z=E;Z<x;++Z){var ee=((H,oe,ne,X,ce,Oe)=>{for(var Ne=Math.min(H.length,X.length),me=-1,ke=0;ke<Ne;++ke){var ze=oe[ke];if(ze!==X[ke])return ce(H[ke],ne[ke])<0?H.substr(0,ke)+ne[ke]+ne.substr(ke+1):ce(H[ke],X[ke])<0?H.substr(0,ke)+X[ke]+ne.substr(ke+1):0<=me?H.substr(0,me)+oe[me]+ne.substr(me+1):null;ce(H[ke],ze)<0&&(me=ke)}return Ne<X.length&&Oe==="next"?H+ne.substr(H.length):Ne<H.length&&Oe==="prev"?H.substr(0,ne.length):me<0?null:H.substr(0,me)+X[me]+ne.substr(me+1)})(O,U,y[Z],_[Z],m,N);ee===null&&W===null?E=Z+1:(W===null||0<m(W,ee))&&(W=ee)}R(W!==null?function(){k.continue(W+C)}:B)}return!1}),P}function xn(o,c,l,f){return{type:2,lower:o,upper:c,lowerOpen:l,upperOpen:f}}function Kc(o){return{type:1,lower:o,upper:o}}Object.defineProperty(at.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),at.prototype.between=function(o,c,l,f){l=l!==!1,f=f===!0;try{return 0<this._cmp(o,c)||this._cmp(o,c)===0&&(l||f)&&(!l||!f)?di(this):new this.Collection(this,function(){return xn(o,c,!l,!f)})}catch{return Pt(this,on)}},at.prototype.equals=function(o){return o==null?Pt(this,on):new this.Collection(this,function(){return Kc(o)})},at.prototype.above=function(o){return o==null?Pt(this,on):new this.Collection(this,function(){return xn(o,void 0,!0)})},at.prototype.aboveOrEqual=function(o){return o==null?Pt(this,on):new this.Collection(this,function(){return xn(o,void 0,!1)})},at.prototype.below=function(o){return o==null?Pt(this,on):new this.Collection(this,function(){return xn(void 0,o,!1,!0)})},at.prototype.belowOrEqual=function(o){return o==null?Pt(this,on):new this.Collection(this,function(){return xn(void 0,o)})},at.prototype.startsWith=function(o){return typeof o!="string"?Pt(this,Tc):this.between(o,o+Dn,!0,!0)},at.prototype.startsWithIgnoreCase=function(o){return o===""?this.startsWith(o):Wr(this,function(c,l){return c.indexOf(l[0])===0},[o],Dn)},at.prototype.equalsIgnoreCase=function(o){return Wr(this,function(c,l){return c===l[0]},[o],"")},at.prototype.anyOfIgnoreCase=function(){var o=St.apply(ft,arguments);return o.length===0?di(this):Wr(this,function(c,l){return l.indexOf(c)!==-1},o,"")},at.prototype.startsWithAnyOfIgnoreCase=function(){var o=St.apply(ft,arguments);return o.length===0?di(this):Wr(this,function(c,l){return l.some(function(f){return c.indexOf(f)===0})},o,Dn)},at.prototype.anyOf=function(){var o,c,l=this,f=St.apply(ft,arguments),p=this._cmp;try{f.sort(p)}catch{return Pt(this,on)}return f.length===0?di(this):((o=new this.Collection(this,function(){return xn(f[0],f[f.length-1])}))._ondirectionchange=function(h){p=h==="next"?l._ascending:l._descending,f.sort(p)},c=0,o._addAlgorithm(function(h,m,y){for(var _=h.key;0<p(_,f[c]);)if(++c===f.length)return m(y),!1;return p(_,f[c])===0||(m(function(){h.continue(f[c])}),!1)}),o)},at.prototype.notEqual=function(o){return this.inAnyRange([[-1/0,o],[o,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},at.prototype.noneOf=function(){var o=St.apply(ft,arguments);if(o.length===0)return new this.Collection(this);try{o.sort(this._ascending)}catch{return Pt(this,on)}var c=o.reduce(function(l,f){return l?l.concat([[l[l.length-1][1],f]]):[[-1/0,f]]},null);return c.push([o[o.length-1],this.db._maxKey]),this.inAnyRange(c,{includeLowers:!1,includeUppers:!1})},at.prototype.inAnyRange=function(o,B){var l=this,f=this._cmp,p=this._ascending,h=this._descending,m=this._min,y=this._max;if(o.length===0)return di(this);if(!o.every(function(O){return O[0]!==void 0&&O[1]!==void 0&&p(O[0],O[1])<=0}))return Pt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",fe.InvalidArgument);var _=!B||B.includeLowers!==!1,N=B&&B.includeUppers===!0,C,x=p;function I(O,U){return x(O[0],U[0])}try{(C=o.reduce(function(O,U){for(var W=0,Z=O.length;W<Z;++W){var ee=O[W];if(f(U[0],ee[1])<0&&0<f(U[1],ee[0])){ee[0]=m(ee[0],U[0]),ee[1]=y(ee[1],U[1]);break}}return W===Z&&O.push(U),O},[])).sort(I)}catch{return Pt(this,on)}var P=0,E=N?function(O){return 0<p(O,C[P][1])}:function(O){return 0<=p(O,C[P][1])},k=_?function(O){return 0<h(O,C[P][0])}:function(O){return 0<=h(O,C[P][0])},R=E,B=new this.Collection(this,function(){return xn(C[0][0],C[C.length-1][1],!_,!N)});return B._ondirectionchange=function(O){x=O==="next"?(R=E,p):(R=k,h),C.sort(I)},B._addAlgorithm(function(O,U,W){for(var Z,ee=O.key;R(ee);)if(++P===C.length)return U(W),!1;return!E(Z=ee)&&!k(Z)||(l._cmp(ee,C[P][1])===0||l._cmp(ee,C[P][0])===0||U(function(){x===p?O.continue(C[P][0]):O.continue(C[P][1])}),!1)}),B},at.prototype.startsWithAnyOf=function(){var o=St.apply(ft,arguments);return o.every(function(c){return typeof c=="string"})?o.length===0?di(this):this.inAnyRange(o.map(function(c){return[c,c+Dn]})):Pt(this,"startsWithAnyOf() only works with strings")};var qc=at;function at(){}function Xt(o){return Ke(function(c){return Ki(c),o(c.target.error),!1})}function Ki(o){o.stopPropagation&&o.stopPropagation(),o.preventDefault&&o.preventDefault()}var qi="storagemutated",lo="x-storagemutated-1",Sn=Di(null,qi),md=(Zt.prototype._lock=function(){return J(!F.global),++this._reculock,this._reculock!==1||F.global||(F.lockOwnerFor=this),this},Zt.prototype._unlock=function(){if(J(!F.global),--this._reculock==0)for(F.global||(F.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var o=this._blockedFuncs.shift();try{Fn(o[1],o[0])}catch{}}return this},Zt.prototype._locked=function(){return this._reculock&&F.lockOwnerFor!==this},Zt.prototype.create=function(o){var c=this;if(this.mode){var l=this.db.idbdb,f=this.db._state.dbOpenError;if(J(!this.idbtrans),!o&&!l)switch(f&&f.name){case"DatabaseClosedError":throw new fe.DatabaseClosed(f);case"MissingAPIError":throw new fe.MissingAPI(f.message,f);default:throw new fe.OpenFailed(f)}if(!this.active)throw new fe.TransactionInactive;J(this._completion._state===null),(o=this.idbtrans=o||(this.db.core||l).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Ke(function(p){Ki(p),c._reject(o.error)}),o.onabort=Ke(function(p){Ki(p),c.active&&c._reject(new fe.Abort(o.error)),c.active=!1,c.on("abort").fire(p)}),o.oncomplete=Ke(function(){c.active=!1,c._resolve(),"mutatedParts"in o&&Sn.storagemutated.fire(o.mutatedParts)})}return this},Zt.prototype._promise=function(o,c,l){var f,p=this;return o==="readwrite"&&this.mode!=="readwrite"?Ge(new fe.ReadOnly("Transaction is readonly")):this.active?this._locked()?new L(function(h,m){p._blockedFuncs.push([function(){p._promise(o,c,l).then(h,m)},F])}):l?yn(function(){var h=new L(function(m,y){p._lock();var _=c(m,y,p);_&&_.then&&_.then(m,y)});return h.finally(function(){return p._unlock()}),h._lib=!0,h}):((f=new L(function(h,m){var y=c(h,m,p);y&&y.then&&y.then(h,m)}))._lib=!0,f):Ge(new fe.TransactionInactive)},Zt.prototype._root=function(){return this.parent?this.parent._root():this},Zt.prototype.waitFor=function(o){var c,l=this._root(),f=L.resolve(o),p=(l._waitingFor?l._waitingFor=l._waitingFor.then(function(){return f}):(l._waitingFor=f,l._waitingQueue=[],c=l.idbtrans.objectStore(l.storeNames[0]),(function h(){for(++l._spinCount;l._waitingQueue.length;)l._waitingQueue.shift()();l._waitingFor&&(c.get(-1/0).onsuccess=h)})()),l._waitingFor);return new L(function(h,m){f.then(function(y){return l._waitingQueue.push(Ke(h.bind(null,y)))},function(y){return l._waitingQueue.push(Ke(m.bind(null,y)))}).finally(function(){l._waitingFor===p&&(l._waitingFor=null)})})},Zt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new fe.Abort))},Zt.prototype.table=function(o){var c=this._memoizedTables||(this._memoizedTables={});if(b(c,o))return c[o];var l=this.schema[o];if(l)return(l=new this.db.Table(o,l,this)).core=this.db.core.table(o),c[o]=l;throw new fe.NotFound("Table "+o+" not part of transaction")},Zt);function Zt(){}function uo(o,c,l,f,p,h,m,y){return{name:o,keyPath:c,unique:l,multi:f,auto:p,compound:h,src:(l&&!m?"&":"")+(f?"*":"")+(p?"++":"")+Vc(c),type:y}}function Vc(o){return typeof o=="string"?o:o?"["+[].join.call(o,"+")+"]":""}function fo(o,c,l){return{name:o,primKey:c,indexes:l,mappedClass:null,idxByName:(f=function(p){return[p.name,p]},l.reduce(function(p,h,m){return h=f(h,m),h&&(p[h[0]]=h[1]),p},{}))};var f}var Vi=function(o){try{return o.only([[]]),Vi=function(){return[[]]},[[]]}catch{return Vi=function(){return Dn},Dn}};function po(o){return o==null?function(){}:typeof o=="string"?(c=o).split(".").length===1?function(l){return l[c]}:function(l){return ue(l,c)}:function(l){return ue(l,o)};var c}function zc(o){return[].slice.call(o)}var vd=0;function zi(o){return o==null?":id":typeof o=="string"?o:"[".concat(o.join("+"),"]")}function yd(o,c,_){function f(E){if(E.type===3)return null;if(E.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var x=E.lower,I=E.upper,P=E.lowerOpen,E=E.upperOpen;return x===void 0?I===void 0?null:c.upperBound(I,!!E):I===void 0?c.lowerBound(x,!!P):c.bound(x,I,!!P,!!E)}function p(C){var x,I=C.name;return{name:I,schema:C,mutate:function(P){var E=P.trans,k=P.type,R=P.keys,B=P.values,O=P.range;return new Promise(function(U,W){U=Ke(U);var Z=E.objectStore(I),ee=Z.keyPath==null,H=k==="put"||k==="add";if(!H&&k!=="delete"&&k!=="deleteRange")throw new Error("Invalid operation type: "+k);var oe,ne=(R||B||{length:1}).length;if(R&&B&&R.length!==B.length)throw new Error("Given keys array must have same length as given values array.");if(ne===0)return U({numFailures:0,failures:{},results:[],lastResult:void 0});function X(He){++Ne,Ki(He)}var ce=[],Oe=[],Ne=0;if(k==="deleteRange"){if(O.type===4)return U({numFailures:Ne,failures:Oe,results:[],lastResult:void 0});O.type===3?ce.push(oe=Z.clear()):ce.push(oe=Z.delete(f(O)))}else{var ee=H?ee?[B,R]:[B,null]:[R,null],me=ee[0],ke=ee[1];if(H)for(var ze=0;ze<ne;++ze)ce.push(oe=ke&&ke[ze]!==void 0?Z[k](me[ze],ke[ze]):Z[k](me[ze])),oe.onerror=X;else for(ze=0;ze<ne;++ze)ce.push(oe=Z[k](me[ze])),oe.onerror=X}function Mt(He){He=He.target.result,ce.forEach(function(Vn,To){return Vn.error!=null&&(Oe[To]=Vn.error)}),U({numFailures:Ne,failures:Oe,results:k==="delete"?R:ce.map(function(Vn){return Vn.result}),lastResult:He})}oe.onerror=function(He){X(He),Mt(He)},oe.onsuccess=Mt})},getMany:function(P){var E=P.trans,k=P.keys;return new Promise(function(R,B){R=Ke(R);for(var O,U=E.objectStore(I),W=k.length,Z=new Array(W),ee=0,H=0,oe=function(ce){ce=ce.target,Z[ce._pos]=ce.result,++H===ee&&R(Z)},ne=Xt(B),X=0;X<W;++X)k[X]!=null&&((O=U.get(k[X]))._pos=X,O.onsuccess=oe,O.onerror=ne,++ee);ee===0&&R(Z)})},get:function(P){var E=P.trans,k=P.key;return new Promise(function(R,B){R=Ke(R);var O=E.objectStore(I).get(k);O.onsuccess=function(U){return R(U.target.result)},O.onerror=Xt(B)})},query:(x=y,function(P){return new Promise(function(E,k){E=Ke(E);var R,B,O,H=P.trans,U=P.values,W=P.limit,ee=P.query,Z=W===1/0?void 0:W,oe=ee.index,ee=ee.range,H=H.objectStore(I),H=oe.isPrimaryKey?H:H.index(oe.name),oe=f(ee);if(W===0)return E({result:[]});x?((ee=U?H.getAll(oe,Z):H.getAllKeys(oe,Z)).onsuccess=function(ne){return E({result:ne.target.result})},ee.onerror=Xt(k)):(R=0,B=!U&&"openKeyCursor"in H?H.openKeyCursor(oe):H.openCursor(oe),O=[],B.onsuccess=function(ne){var X=B.result;return!X||(O.push(U?X.value:X.primaryKey),++R===W)?E({result:O}):void X.continue()},B.onerror=Xt(k))})}),openCursor:function(P){var E=P.trans,k=P.values,R=P.query,B=P.reverse,O=P.unique;return new Promise(function(U,W){U=Ke(U);var H=R.index,Z=R.range,ee=E.objectStore(I),ee=H.isPrimaryKey?ee:ee.index(H.name),H=B?O?"prevunique":"prev":O?"nextunique":"next",oe=!k&&"openKeyCursor"in ee?ee.openKeyCursor(f(Z),H):ee.openCursor(f(Z),H);oe.onerror=Xt(W),oe.onsuccess=Ke(function(ne){var X,ce,Oe,Ne,me=oe.result;me?(me.___id=++vd,me.done=!1,X=me.continue.bind(me),ce=(ce=me.continuePrimaryKey)&&ce.bind(me),Oe=me.advance.bind(me),Ne=function(){throw new Error("Cursor not stopped")},me.trans=E,me.stop=me.continue=me.continuePrimaryKey=me.advance=function(){throw new Error("Cursor not started")},me.fail=Ke(W),me.next=function(){var ke=this,ze=1;return this.start(function(){return ze--?ke.continue():ke.stop()}).then(function(){return ke})},me.start=function(ke){function ze(){if(oe.result)try{ke()}catch(He){me.fail(He)}else me.done=!0,me.start=function(){throw new Error("Cursor behind last entry")},me.stop()}var Mt=new Promise(function(He,Vn){He=Ke(He),oe.onerror=Xt(Vn),me.fail=Vn,me.stop=function(To){me.stop=me.continue=me.continuePrimaryKey=me.advance=Ne,He(To)}});return oe.onsuccess=Ke(function(He){oe.onsuccess=ze,ze()}),me.continue=X,me.continuePrimaryKey=ce,me.advance=Oe,ze(),Mt},U(me)):U(null)},W)})},count:function(P){var E=P.query,k=P.trans,R=E.index,B=E.range;return new Promise(function(O,U){var W=k.objectStore(I),W=R.isPrimaryKey?W:W.index(R.name),Z=f(B),Z=Z?W.count(Z):W.count();Z.onsuccess=Ke(function(ee){return O(ee.target.result)}),Z.onerror=Xt(U)})}}}h=_,m=zc((_=o).objectStoreNames);var h,_={schema:{name:_.name,tables:m.map(function(C){return h.objectStore(C)}).map(function(C){var x=C.keyPath,I=C.autoIncrement,E=u(x),P={},E={name:C.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:x==null,compound:E,keyPath:x,autoIncrement:I,unique:!0,extractKey:po(x)},indexes:zc(C.indexNames).map(function(k){return C.index(k)}).map(function(O){var U=O.name,R=O.unique,B=O.multiEntry,O=O.keyPath,U={name:U,compound:u(O),keyPath:O,unique:R,multiEntry:B,extractKey:po(O)};return P[zi(O)]=U}),getIndexByKeyPath:function(k){return P[zi(k)]}};return P[":id"]=E.primaryKey,x!=null&&(P[zi(x)]=E.primaryKey),E})},hasGetAll:0<m.length&&"getAll"in h.objectStore(m[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)},m=_.schema,y=_.hasGetAll,_=m.tables.map(p),N={};return _.forEach(function(C){return N[C.name]=C}),{stack:"dbcore",transaction:o.transaction.bind(o),table:function(C){if(N[C])return N[C];throw new Error("Table '".concat(C,"' not found"))},MIN_KEY:-1/0,MAX_KEY:Vi(c),schema:m}}function bd(o,c,l,f){return l=l.IDBKeyRange,c=yd(c,l,f),{dbcore:o.dbcore.reduce(function(p,h){return h=h.create,i(i({},p),h(p))},c)}}function Hr(o,c){var l=c.db,l=bd(o._middlewares,l,o._deps,c);o.core=l.dbcore,o.tables.forEach(function(f){var p=f.name;o.core.schema.tables.some(function(h){return h.name===p})&&(f.core=o.core.table(p),o[p]instanceof o.Table)&&(o[p].core=f.core)})}function Gr(o,c,l,f){l.forEach(function(p){var h=f[p];c.forEach(function(m){var y=(function _(N,C){return K(N,C)||(N=g(N))&&_(N,C)})(m,p);(!y||"value"in y&&y.value===void 0)&&(m===o.Transaction.prototype||m instanceof o.Transaction?z(m,p,{get:function(){return this.table(p)},set:function(_){j(this,p,{value:_,writable:!0,configurable:!0,enumerable:!0})}}):m[p]=new o.Table(p,h))})})}function ho(o,c){c.forEach(function(l){for(var f in l)l[f]instanceof o.Table&&delete l[f]})}function wd(o,c){return o._cfg.version-c._cfg.version}function xd(o,c,l,f){var p=o._dbSchema,h=(l.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=fo("$meta",Hc("")[0],[]),o._storeNames.push("$meta")),o._createTransaction("readwrite",o._storeNames,p)),m=(h.create(l),h._completion.catch(f),h._reject.bind(h)),y=F.transless||F;yn(function(){if(F.trans=h,F.transless=y,c!==0)return Hr(o,l),N=c,((_=h).storeNames.includes("$meta")?_.table("$meta").get("version").then(function(C){return C??N}):L.resolve(N)).then(function(R){var x=o,I=R,P=h,E=l,k=[],R=x._versions,B=x._dbSchema=Jr(0,x.idbdb,E);return(R=R.filter(function(O){return O._cfg.version>=I})).length===0?L.resolve():(R.forEach(function(O){k.push(function(){var U,W,Z,ee=B,H=O._cfg.dbschema,oe=(Qr(x,ee,E),Qr(x,H,E),B=x._dbSchema=H,go(ee,H)),ne=(oe.add.forEach(function(X){mo(E,X[0],X[1].primKey,X[1].indexes)}),oe.change.forEach(function(X){if(X.recreate)throw new fe.Upgrade("Not yet support for changing primary key");var ce=E.objectStore(X.name);X.add.forEach(function(Oe){return Yr(ce,Oe)}),X.change.forEach(function(Oe){ce.deleteIndex(Oe.name),Yr(ce,Oe)}),X.del.forEach(function(Oe){return ce.deleteIndex(Oe)})}),O._cfg.contentUpgrade);if(ne&&O._cfg.version>I)return Hr(x,E),P._memoizedTables={},U=G(H),oe.del.forEach(function(X){U[X]=ee[X]}),ho(x,[x.Transaction.prototype]),Gr(x,[x.Transaction.prototype],a(U),U),P.schema=U,(W=Ue(ne))&&li(),H=L.follow(function(){var X;(Z=ne(P))&&W&&(X=bn.bind(null,null),Z.then(X,X))}),Z&&typeof Z.then=="function"?L.resolve(Z):H.then(function(){return Z})}),k.push(function(U){var W,Z,ee=O._cfg.dbschema;W=ee,Z=U,[].slice.call(Z.db.objectStoreNames).forEach(function(H){return W[H]==null&&Z.db.deleteObjectStore(H)}),ho(x,[x.Transaction.prototype]),Gr(x,[x.Transaction.prototype],x._storeNames,x._dbSchema),P.schema=x._dbSchema}),k.push(function(U){x.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(x.idbdb.version/10)===O._cfg.version?(x.idbdb.deleteObjectStore("$meta"),delete x._dbSchema.$meta,x._storeNames=x._storeNames.filter(function(W){return W!=="$meta"})):U.objectStore("$meta").put(O._cfg.version,"version"))})}),(function O(){return k.length?L.resolve(k.shift()(P.idbtrans)).then(O):L.resolve()})().then(function(){Wc(B,E)}))}).catch(m);var _,N;a(p).forEach(function(C){mo(l,C,p[C].primKey,p[C].indexes)}),Hr(o,l),L.follow(function(){return o.on.populate.fire(h)}).catch(m)})}function Sd(o,c){Wc(o._dbSchema,c),c.db.version%10!=0||c.objectStoreNames.contains("$meta")||c.db.createObjectStore("$meta").add(Math.ceil(c.db.version/10-1),"version");var l=Jr(0,o.idbdb,c);Qr(o,o._dbSchema,c);for(var f=0,p=go(l,o._dbSchema).change;f<p.length;f++){var h=(m=>{if(m.change.length||m.recreate)return console.warn("Unable to patch indexes of table ".concat(m.name," because it has changes on the type of index or primary key.")),{value:void 0};var y=c.objectStore(m.name);m.add.forEach(function(_){mt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(m.name,".").concat(_.src)),Yr(y,_)})})(p[f]);if(typeof h=="object")return h.value}}function go(o,c){var l,f={del:[],add:[],change:[]};for(l in o)c[l]||f.del.push(l);for(l in c){var p=o[l],h=c[l];if(p){var m={name:l,def:h,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(h.primKey.keyPath||"")||p.primKey.auto!==h.primKey.auto)m.recreate=!0,f.change.push(m);else{var y=p.idxByName,_=h.idxByName,N=void 0;for(N in y)_[N]||m.del.push(N);for(N in _){var C=y[N],x=_[N];C?C.src!==x.src&&m.change.push(x):m.add.push(x)}(0<m.del.length||0<m.add.length||0<m.change.length)&&f.change.push(m)}}else f.add.push([l,h])}return f}function mo(o,c,l,f){var p=o.db.createObjectStore(c,l.keyPath?{keyPath:l.keyPath,autoIncrement:l.auto}:{autoIncrement:l.auto});f.forEach(function(h){return Yr(p,h)})}function Wc(o,c){a(o).forEach(function(l){c.db.objectStoreNames.contains(l)||(mt&&console.debug("Dexie: Creating missing table",l),mo(c,l,o[l].primKey,o[l].indexes))})}function Yr(o,c){o.createIndex(c.name,c.keyPath,{unique:c.unique,multiEntry:c.multi})}function Jr(o,c,l){var f={};return Y(c.objectStoreNames,0).forEach(function(p){for(var h=l.objectStore(p),m=uo(Vc(N=h.keyPath),N||"",!0,!1,!!h.autoIncrement,N&&typeof N!="string",!0),y=[],_=0;_<h.indexNames.length;++_){var C=h.index(h.indexNames[_]),N=C.keyPath,C=uo(C.name,N,!!C.unique,!!C.multiEntry,!1,N&&typeof N!="string",!1);y.push(C)}f[p]=fo(p,m,y)}),f}function Qr(o,c,l){for(var f=l.db.objectStoreNames,p=0;p<f.length;++p){var h=f[p],m=l.objectStore(h);o._hasGetAll="getAll"in m;for(var y=0;y<m.indexNames.length;++y){var _,N=m.indexNames[y],C=m.index(N).keyPath,C=typeof C=="string"?C:"["+Y(C).join("+")+"]";c[h]&&(_=c[h].idxByName[C])&&(_.name=N,delete c[h].idxByName[C],c[h].idxByName[N]=_)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&s.WorkerGlobalScope&&s instanceof s.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(o._hasGetAll=!1)}function Hc(o){return o.split(",").map(function(c,l){var p=c.split(":"),f=(f=p[1])==null?void 0:f.trim(),p=(c=p[0].trim()).replace(/([&*]|\+\+)/g,""),h=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return uo(p,h||null,/\&/.test(c),/\*/.test(c),/\+\+/.test(c),u(h),l===0,f)})}pi.prototype._createTableSchema=fo,pi.prototype._parseIndexSyntax=Hc,pi.prototype._parseStoresSpec=function(o,c){var l=this;a(o).forEach(function(f){if(o[f]!==null){var p=l._parseIndexSyntax(o[f]),h=p.shift();if(!h)throw new fe.Schema("Invalid schema for table "+f+": "+o[f]);if(h.unique=!0,h.multi)throw new fe.Schema("Primary key cannot be multiEntry*");p.forEach(function(m){if(m.auto)throw new fe.Schema("Only primary key can be marked as autoIncrement (++)");if(!m.keyPath)throw new fe.Schema("Index must have a name and cannot be an empty string")}),h=l._createTableSchema(f,h,p),c[f]=h}})},pi.prototype.stores=function(l){var c=this.db,l=(this._cfg.storesSource=this._cfg.storesSource?d(this._cfg.storesSource,l):l,c._versions),f={},p={};return l.forEach(function(h){d(f,h._cfg.storesSource),p=h._cfg.dbschema={},h._parseStoresSpec(f,p)}),c._dbSchema=p,ho(c,[c._allTables,c,c.Transaction.prototype]),Gr(c,[c._allTables,c,c.Transaction.prototype,this._cfg.tables],a(p),p),c._storeNames=a(p),this},pi.prototype.upgrade=function(o){return this._cfg.contentUpgrade=mn(this._cfg.contentUpgrade||Ae,o),this};var kd=pi;function pi(){}function vo(o,c){var l=o._dbNamesDB;return l||(l=o._dbNamesDB=new an(Ur,{addons:[],indexedDB:o,IDBKeyRange:c})).version(1).stores({dbnames:"name"}),l.table("dbnames")}function yo(o){return o&&typeof o.databases=="function"}function bo(o){return yn(function(){return F.letThrough=!0,o()})}function wo(o){return!("from"in o)}var ht=function(o,c){var l;if(!this)return l=new ht,o&&"d"in o&&d(l,o),l;d(this,arguments.length?{d:1,from:o,to:1<arguments.length?c:o}:{d:0})};function Wi(o,c,l){var f=Ie(c,l);if(!isNaN(f)){if(0<f)throw RangeError();if(wo(o))return d(o,{from:c,to:l,d:1});var f=o.l,p=o.r;if(Ie(l,o.from)<0)return f?Wi(f,c,l):o.l={from:c,to:l,d:1,l:null,r:null},Yc(o);if(0<Ie(c,o.to))return p?Wi(p,c,l):o.r={from:c,to:l,d:1,l:null,r:null},Yc(o);Ie(c,o.from)<0&&(o.from=c,o.l=null,o.d=p?p.d+1:1),0<Ie(l,o.to)&&(o.to=l,o.r=null,o.d=o.l?o.l.d+1:1),c=!o.r,f&&!o.l&&Hi(o,f),p&&c&&Hi(o,p)}}function Hi(o,c){wo(c)||(function l(f,p){var h=p.from,m=p.l,y=p.r;Wi(f,h,p.to),m&&l(f,m),y&&l(f,y)})(o,c)}function Gc(o,c){var l=Xr(c),f=l.next();if(!f.done)for(var p=f.value,h=Xr(o),m=h.next(p.from),y=m.value;!f.done&&!m.done;){if(Ie(y.from,p.to)<=0&&0<=Ie(y.to,p.from))return!0;Ie(p.from,y.from)<0?p=(f=l.next(y.from)).value:y=(m=h.next(p.from)).value}return!1}function Xr(o){var c=wo(o)?null:{s:0,n:o};return{next:function(l){for(var f=0<arguments.length;c;)switch(c.s){case 0:if(c.s=1,f)for(;c.n.l&&Ie(l,c.n.from)<0;)c={up:c,n:c.n.l,s:1};else for(;c.n.l;)c={up:c,n:c.n.l,s:1};case 1:if(c.s=2,!f||Ie(l,c.n.to)<=0)return{value:c.n,done:!1};case 2:if(c.n.r){c.s=3,c={up:c,n:c.n.r,s:0};continue}case 3:c=c.up}return{done:!0}}}}function Yc(o){var c,l,f,p=(((p=o.r)==null?void 0:p.d)||0)-(((p=o.l)==null?void 0:p.d)||0),p=1<p?"r":p<-1?"l":"";p&&(c=p=="r"?"l":"r",l=i({},o),f=o[p],o.from=f.from,o.to=f.to,o[p]=f[p],l[p]=f[c],(o[c]=l).d=Jc(l)),o.d=Jc(o)}function Jc(l){var c=l.r,l=l.l;return(c?l?Math.max(c.d,l.d):c.d:l?l.d:0)+1}function Zr(o,c){return a(c).forEach(function(l){o[l]?Hi(o[l],c[l]):o[l]=(function f(p){var h,m,y={};for(h in p)b(p,h)&&(m=p[h],y[h]=!m||typeof m!="object"||We.has(m.constructor)?m:f(m));return y})(c[l])}),o}function xo(o,c){return o.all||c.all||Object.keys(o).some(function(l){return c[l]&&Gc(c[l],o[l])})}w(ht.prototype,((Q={add:function(o){return Hi(this,o),this},addKey:function(o){return Wi(this,o,o),this},addKeys:function(o){var c=this;return o.forEach(function(l){return Wi(c,l,l)}),this},hasKey:function(o){var c=Xr(this).next(o).value;return c&&Ie(c.from,o)<=0&&0<=Ie(c.to,o)}})[ut]=function(){return Xr(this)},Q));var Kn={},So={},ko=!1;function es(o){Zr(So,o),ko||(ko=!0,setTimeout(function(){ko=!1,_o(So,!(So={}))},0))}function _o(o,c){c===void 0&&(c=!1);var l=new Set;if(o.all)for(var f=0,p=Object.values(Kn);f<p.length;f++)Qc(y=p[f],o,l,c);else for(var h in o){var m,y,h=/^idb\:\/\/(.*)\/(.*)\//.exec(h);h&&(m=h[1],h=h[2],y=Kn["idb://".concat(m,"/").concat(h)])&&Qc(y,o,l,c)}l.forEach(function(_){return _()})}function Qc(o,c,l,f){for(var p=[],h=0,m=Object.entries(o.queries.query);h<m.length;h++){for(var y=m[h],_=y[0],N=[],C=0,x=y[1];C<x.length;C++){var I=x[C];xo(c,I.obsSet)?I.subscribers.forEach(function(R){return l.add(R)}):f&&N.push(I)}f&&p.push([_,N])}if(f)for(var P=0,E=p;P<E.length;P++){var k=E[P],_=k[0],N=k[1];o.queries.query[_]=N}}function _d(o){var c=o._state,l=o._deps.indexedDB;if(c.isBeingOpened||o.idbdb)return c.dbReadyPromise.then(function(){return c.dbOpenError?Ge(c.dbOpenError):o});c.isBeingOpened=!0,c.dbOpenError=null,c.openComplete=!1;var f=c.openCanceller,p=Math.round(10*o.verno),h=!1;function m(){if(c.openCanceller!==f)throw new fe.DatabaseClosed("db.open() was cancelled")}function y(){return new L(function(I,P){if(m(),!l)throw new fe.MissingAPI;var E=o.name,k=c.autoSchema||!p?l.open(E):l.open(E,p);if(!k)throw new fe.MissingAPI;k.onerror=Xt(P),k.onblocked=Ke(o._fireOnBlocked),k.onupgradeneeded=Ke(function(R){var B;C=k.transaction,c.autoSchema&&!o._options.allowEmptyDB?(k.onerror=Ki,C.abort(),k.result.close(),(B=l.deleteDatabase(E)).onsuccess=B.onerror=Ke(function(){P(new fe.NoSuchDatabase("Database ".concat(E," doesnt exist")))})):(C.onerror=Xt(P),B=R.oldVersion>Math.pow(2,62)?0:R.oldVersion,x=B<1,o.idbdb=k.result,h&&Sd(o,C),xd(o,B/10,C,P))},P),k.onsuccess=Ke(function(){C=null;var R,B,O,U,W,Z,ee=o.idbdb=k.result,H=Y(ee.objectStoreNames);if(0<H.length)try{var oe=ee.transaction((W=H).length===1?W[0]:W,"readonly");if(c.autoSchema)Z=ee,U=oe,(O=o).verno=Z.version/10,U=O._dbSchema=Jr(0,Z,U),O._storeNames=Y(Z.objectStoreNames,0),Gr(O,[O._allTables],a(U),U);else if(Qr(o,o._dbSchema,oe),B=oe,((B=go(Jr(0,(R=o).idbdb,B),R._dbSchema)).add.length||B.change.some(function(ne){return ne.add.length||ne.change.length}))&&!h)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),ee.close(),p=ee.version+1,h=!0,I(y());Hr(o,oe)}catch{}ui.push(o),ee.onversionchange=Ke(function(ne){c.vcFired=!0,o.on("versionchange").fire(ne)}),ee.onclose=Ke(function(){o.close({disableAutoOpen:!1})}),x&&(H=o._deps,W=E,yo(Z=H.indexedDB)||W===Ur||vo(Z,H.IDBKeyRange).put({name:W}).catch(Ae)),I()},P)}).catch(function(I){switch(I?.name){case"UnknownError":if(0<c.PR1398_maxLoop)return c.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),y();break;case"VersionError":if(0<p)return p=0,y()}return L.reject(I)})}var _,N=c.dbReadyResolve,C=null,x=!1;return L.race([f,(typeof navigator>"u"?L.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(I){function P(){return indexedDB.databases().finally(I)}_=setInterval(P,100),P()}).finally(function(){return clearInterval(_)}):Promise.resolve()).then(y)]).then(function(){return m(),c.onReadyBeingFired=[],L.resolve(bo(function(){return o.on.ready.fire(o.vip)})).then(function I(){var P;if(0<c.onReadyBeingFired.length)return P=c.onReadyBeingFired.reduce(mn,Ae),c.onReadyBeingFired=[],L.resolve(bo(function(){return P(o.vip)})).then(I)})}).finally(function(){c.openCanceller===f&&(c.onReadyBeingFired=null,c.isBeingOpened=!1)}).catch(function(I){c.dbOpenError=I;try{C&&C.abort()}catch{}return f===c.openCanceller&&o._close(),Ge(I)}).finally(function(){c.openComplete=!0,N()}).then(function(){var I;return x&&(I={},o.tables.forEach(function(P){P.schema.indexes.forEach(function(E){E.name&&(I["idb://".concat(o.name,"/").concat(P.name,"/").concat(E.name)]=new ht(-1/0,[[[]]]))}),I["idb://".concat(o.name,"/").concat(P.name,"/")]=I["idb://".concat(o.name,"/").concat(P.name,"/:dels")]=new ht(-1/0,[[[]]])}),Sn(qi).fire(I),_o(I,!0)),o})}function Co(o){function c(h){return o.next(h)}var l=p(c),f=p(function(h){return o.throw(h)});function p(h){return function(y){var y=h(y),_=y.value;return y.done?_:_&&typeof _.then=="function"?_.then(l,f):u(_)?Promise.all(_).then(l,f):l(_)}}return p(c)()}function ts(o,c,l){for(var f=u(o)?o.slice():[o],p=0;p<l;++p)f.push(c);return f}var Cd={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(o){return i(i({},o),{table:function(f){var l=o.table(f),f=l.schema,p={},h=[];function m(I,P,E){var O=zi(I),k=p[O]=p[O]||[],R=I==null?0:typeof I=="string"?1:I.length,B=0<P,O=i(i({},E),{name:B?"".concat(O,"(virtual-from:").concat(E.name,")"):E.name,lowLevelIndex:E,isVirtual:B,keyTail:P,keyLength:R,extractKey:po(I),unique:!B&&E.unique});return k.push(O),O.isPrimaryKey||h.push(O),1<R&&m(R===2?I[0]:I.slice(0,R-1),P+1,E),k.sort(function(U,W){return U.keyTail-W.keyTail}),O}var y=m(f.primaryKey.keyPath,0,f.primaryKey);p[":id"]=[y];for(var _=0,N=f.indexes;_<N.length;_++){var C=N[_];m(C.keyPath,0,C)}function x(I){var P,E=I.query.index;return E.isVirtual?i(i({},I),{query:{index:E.lowLevelIndex,range:(P=I.query.range,E=E.keyTail,{type:P.type===1?2:P.type,lower:ts(P.lower,P.lowerOpen?o.MAX_KEY:o.MIN_KEY,E),lowerOpen:!0,upper:ts(P.upper,P.upperOpen?o.MIN_KEY:o.MAX_KEY,E),upperOpen:!0})}}):I}return i(i({},l),{schema:i(i({},f),{primaryKey:y,indexes:h,getIndexByKeyPath:function(I){return(I=p[zi(I)])&&I[0]}}),count:function(I){return l.count(x(I))},query:function(I){return l.query(x(I))},openCursor:function(I){var P=I.query.index,E=P.keyTail,k=P.keyLength;return P.isVirtual?l.openCursor(x(I)).then(function(B){return B&&R(B)}):l.openCursor(I);function R(B){return Object.create(B,{continue:{value:function(O){O!=null?B.continue(ts(O,I.reverse?o.MAX_KEY:o.MIN_KEY,E)):I.unique?B.continue(B.key.slice(0,k).concat(I.reverse?o.MIN_KEY:o.MAX_KEY,E)):B.continue()}},continuePrimaryKey:{value:function(O,U){B.continuePrimaryKey(ts(O,o.MAX_KEY,E),U)}},primaryKey:{get:function(){return B.primaryKey}},key:{get:function(){var O=B.key;return k===1?O[0]:O.slice(0,k)}},value:{get:function(){return B.value}}})}}})}})}};function Eo(o,c,l,f){return l=l||{},f=f||"",a(o).forEach(function(p){var h,m,y;b(c,p)?(h=o[p],m=c[p],typeof h=="object"&&typeof m=="object"&&h&&m?(y=qt(h))!==qt(m)?l[f+p]=c[p]:y==="Object"?Eo(h,m,l,f+p+"."):h!==m&&(l[f+p]=c[p]):h!==m&&(l[f+p]=c[p])):l[f+p]=void 0}),a(c).forEach(function(p){b(o,p)||(l[f+p]=c[p])}),l}function Io(o,c){return c.type==="delete"?c.keys:c.keys||c.values.map(o.extractKey)}var Ed={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(o){return i(i({},o),{table:function(c){var l=o.table(c),f=l.schema.primaryKey;return i(i({},l),{mutate:function(p){var h=F.trans,m=h.table(c).hook,y=m.deleting,_=m.creating,N=m.updating;switch(p.type){case"add":if(_.fire===Ae)break;return h._promise("readwrite",function(){return C(p)},!0);case"put":if(_.fire===Ae&&N.fire===Ae)break;return h._promise("readwrite",function(){return C(p)},!0);case"delete":if(y.fire===Ae)break;return h._promise("readwrite",function(){return C(p)},!0);case"deleteRange":if(y.fire===Ae)break;return h._promise("readwrite",function(){return(function x(I,P,E){return l.query({trans:I,values:!1,query:{index:f,range:P},limit:E}).then(function(k){var R=k.result;return C({type:"delete",keys:R,trans:I}).then(function(B){return 0<B.numFailures?Promise.reject(B.failures[0]):R.length<E?{failures:[],numFailures:0,lastResult:void 0}:x(I,i(i({},P),{lower:R[R.length-1],lowerOpen:!0}),E)})})})(p.trans,p.range,1e4)},!0)}return l.mutate(p);function C(x){var I,P,E,k=F.trans,R=x.keys||Io(f,x);if(R)return(x=x.type==="add"||x.type==="put"?i(i({},x),{keys:R}):i({},x)).type!=="delete"&&(x.values=r([],x.values)),x.keys&&(x.keys=r([],x.keys)),I=l,E=R,((P=x).type==="add"?Promise.resolve([]):I.getMany({trans:P.trans,keys:E,cache:"immutable"})).then(function(B){var O=R.map(function(U,W){var Z,ee,H,oe=B[W],ne={onerror:null,onsuccess:null};return x.type==="delete"?y.fire.call(ne,U,oe,k):x.type==="add"||oe===void 0?(Z=_.fire.call(ne,U,x.values[W],k),U==null&&Z!=null&&(x.keys[W]=U=Z,f.outbound||pe(x.values[W],f.keyPath,U))):(Z=Eo(oe,x.values[W]),(ee=N.fire.call(ne,Z,U,oe,k))&&(H=x.values[W],Object.keys(ee).forEach(function(X){b(H,X)?H[X]=ee[X]:pe(H,X,ee[X])}))),ne});return l.mutate(x).then(function(U){for(var W=U.failures,Z=U.results,ee=U.numFailures,U=U.lastResult,H=0;H<R.length;++H){var oe=(Z||R)[H],ne=O[H];oe==null?ne.onerror&&ne.onerror(W[H]):ne.onsuccess&&ne.onsuccess(x.type==="put"&&B[H]?x.values[H]:oe)}return{failures:W,results:Z,numFailures:ee,lastResult:U}}).catch(function(U){return O.forEach(function(W){return W.onerror&&W.onerror(U)}),Promise.reject(U)})});throw new Error("Keys missing")}}})}})}};function Xc(o,c,l){try{if(!c||c.keys.length<o.length)return null;for(var f=[],p=0,h=0;p<c.keys.length&&h<o.length;++p)Ie(c.keys[p],o[h])===0&&(f.push(l?rt(c.values[p]):c.values[p]),++h);return f.length===o.length?f:null}catch{return null}}var Id={stack:"dbcore",level:-1,create:function(o){return{table:function(c){var l=o.table(c);return i(i({},l),{getMany:function(f){var p;return f.cache?(p=Xc(f.keys,f.trans._cache,f.cache==="clone"))?L.resolve(p):l.getMany(f).then(function(h){return f.trans._cache={keys:f.keys,values:f.cache==="clone"?rt(h):h},h}):l.getMany(f)},mutate:function(f){return f.type!=="add"&&(f.trans._cache=null),l.mutate(f)}})}}}};function Zc(o,c){return o.trans.mode==="readonly"&&!!o.subscr&&!o.trans.explicit&&o.trans.db._options.cache!=="disabled"&&!c.schema.primaryKey.outbound}function el(o,c){switch(o){case"query":return c.values&&!c.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Pd={stack:"dbcore",level:0,name:"Observability",create:function(o){var c=o.schema.name,l=new ht(o.MIN_KEY,o.MAX_KEY);return i(i({},o),{transaction:function(f,p,h){if(F.subscr&&p!=="readonly")throw new fe.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(F.querier));return o.transaction(f,p,h)},table:function(f){function p(R){var k,R=R.query;return[k=R.index,new ht((k=(R=R.range).lower)!=null?k:o.MIN_KEY,(k=R.upper)!=null?k:o.MAX_KEY)]}var h=o.table(f),m=h.schema,y=m.primaryKey,_=m.indexes,N=y.extractKey,C=y.outbound,x=y.autoIncrement&&_.filter(function(E){return E.compound&&E.keyPath.includes(y.keyPath)}),I=i(i({},h),{mutate:function(E){function k(ce){return ce="idb://".concat(c,"/").concat(f,"/").concat(ce),W[ce]||(W[ce]=new ht)}var R,B,O,U=E.trans,W=E.mutatedParts||(E.mutatedParts={}),Z=k(""),ee=k(":dels"),H=E.type,ne=E.type==="deleteRange"?[E.range]:E.type==="delete"?[E.keys]:E.values.length<50?[Io(y,E).filter(function(ce){return ce}),E.values]:[],oe=ne[0],ne=ne[1],X=E.trans._cache;return u(oe)?(Z.addKeys(oe),(H=H==="delete"||oe.length===ne.length?Xc(oe,X):null)||ee.addKeys(oe),(H||ne)&&(R=k,B=H,O=ne,m.indexes.forEach(function(ce){var Oe=R(ce.name||"");function Ne(ke){return ke!=null?ce.extractKey(ke):null}function me(ke){ce.multiEntry&&u(ke)?ke.forEach(function(ze){return Oe.addKey(ze)}):Oe.addKey(ke)}(B||O).forEach(function(ke,He){var Mt=B&&Ne(B[He]),He=O&&Ne(O[He]);Ie(Mt,He)!==0&&(Mt!=null&&me(Mt),He!=null)&&me(He)})}))):oe?(ne={from:(X=oe.lower)!=null?X:o.MIN_KEY,to:(H=oe.upper)!=null?H:o.MAX_KEY},ee.add(ne),Z.add(ne)):(Z.add(l),ee.add(l),m.indexes.forEach(function(ce){return k(ce.name).add(l)})),h.mutate(E).then(function(ce){return!oe||E.type!=="add"&&E.type!=="put"||(Z.addKeys(ce.results),x&&x.forEach(function(Oe){for(var Ne=E.values.map(function(Mt){return Oe.extractKey(Mt)}),me=Oe.keyPath.findIndex(function(Mt){return Mt===y.keyPath}),ke=0,ze=ce.results.length;ke<ze;++ke)Ne[ke][me]=ce.results[ke];k(Oe.name).addKeys(Ne)})),U.mutatedParts=Zr(U.mutatedParts||{},W),ce})}}),P={get:function(E){return[y,new ht(E.key)]},getMany:function(E){return[y,new ht().addKeys(E.keys)]},count:p,query:p,openCursor:p};return a(P).forEach(function(E){I[E]=function(k){var R=F.subscr,B=!!R,O=Zc(F,h)&&el(E,k)?k.obsSet={}:R;if(B){var U,R=function(ne){return ne="idb://".concat(c,"/").concat(f,"/").concat(ne),O[ne]||(O[ne]=new ht)},W=R(""),Z=R(":dels"),B=P[E](k),ee=B[0],B=B[1];if((E==="query"&&ee.isPrimaryKey&&!k.values?Z:R(ee.name||"")).add(B),!ee.isPrimaryKey){if(E!=="count")return U=E==="query"&&C&&k.values&&h.query(i(i({},k),{values:!1})),h[E].apply(this,arguments).then(function(ne){if(E==="query"){if(C&&k.values)return U.then(function(Ne){return Ne=Ne.result,W.addKeys(Ne),ne});var X=k.values?ne.result.map(N):ne.result;(k.values?W:Z).addKeys(X)}else{var ce,Oe;if(E==="openCursor")return Oe=k.values,(ce=ne)&&Object.create(ce,{key:{get:function(){return Z.addKey(ce.primaryKey),ce.key}},primaryKey:{get:function(){var Ne=ce.primaryKey;return Z.addKey(Ne),Ne}},value:{get:function(){return Oe&&W.addKey(ce.primaryKey),ce.value}}})}return ne});Z.add(l)}}return h[E].apply(this,arguments)}}),I}})}};function tl(o,c,l){var f;return l.numFailures===0?c:c.type==="deleteRange"||(f=c.keys?c.keys.length:"values"in c&&c.values?c.values.length:1,l.numFailures===f)?null:(f=i({},c),u(f.keys)&&(f.keys=f.keys.filter(function(p,h){return!(h in l.failures)})),"values"in f&&u(f.values)&&(f.values=f.values.filter(function(p,h){return!(h in l.failures)})),f)}function Po(o,c){return l=o,((f=c).lower===void 0||(f.lowerOpen?0<Ie(l,f.lower):0<=Ie(l,f.lower)))&&(l=o,(f=c).upper===void 0||(f.upperOpen?Ie(l,f.upper)<0:Ie(l,f.upper)<=0));var l,f}function nl(o,c,l,f,p,h){var m,y,_,N,C,x;return!l||l.length===0||(m=c.query.index,y=m.multiEntry,_=c.query.range,N=f.schema.primaryKey.extractKey,C=m.extractKey,x=(m.lowLevelIndex||m).extractKey,(f=l.reduce(function(I,P){var E=I,k=[];if(P.type==="add"||P.type==="put")for(var R=new ht,B=P.values.length-1;0<=B;--B){var O,U=P.values[B],W=N(U);!R.hasKey(W)&&(O=C(U),y&&u(O)?O.some(function(ne){return Po(ne,_)}):Po(O,_))&&(R.addKey(W),k.push(U))}switch(P.type){case"add":var Z=new ht().addKeys(c.values?I.map(function(X){return N(X)}):I),E=I.concat(c.values?k.filter(function(X){return X=N(X),!Z.hasKey(X)&&(Z.addKey(X),!0)}):k.map(function(X){return N(X)}).filter(function(X){return!Z.hasKey(X)&&(Z.addKey(X),!0)}));break;case"put":var ee=new ht().addKeys(P.values.map(function(X){return N(X)}));E=I.filter(function(X){return!ee.hasKey(c.values?N(X):X)}).concat(c.values?k:k.map(function(X){return N(X)}));break;case"delete":var H=new ht().addKeys(P.keys);E=I.filter(function(X){return!H.hasKey(c.values?N(X):X)});break;case"deleteRange":var oe=P.range;E=I.filter(function(X){return!Po(N(X),oe)})}return E},o))===o)?o:(f.sort(function(I,P){return Ie(x(I),x(P))||Ie(N(I),N(P))}),c.limit&&c.limit<1/0&&(f.length>c.limit?f.length=c.limit:o.length===c.limit&&f.length<c.limit&&(p.dirty=!0)),h?Object.freeze(f):f)}function il(o,c){return Ie(o.lower,c.lower)===0&&Ie(o.upper,c.upper)===0&&!!o.lowerOpen==!!c.lowerOpen&&!!o.upperOpen==!!c.upperOpen}function Ad(o,c){return((l,f,p,h)=>{if(l===void 0)return f!==void 0?-1:0;if(f===void 0)return 1;if((l=Ie(l,f))===0){if(p&&h)return 0;if(p)return 1;if(h)return-1}return l})(o.lower,c.lower,o.lowerOpen,c.lowerOpen)<=0&&0<=((l,f,p,h)=>{if(l===void 0)return f!==void 0?1:0;if(f===void 0)return-1;if((l=Ie(l,f))===0){if(p&&h)return 0;if(p)return-1;if(h)return 1}return l})(o.upper,c.upper,o.upperOpen,c.upperOpen)}function Od(o,c,l,f){o.subscribers.add(l),f.addEventListener("abort",function(){var p,h;o.subscribers.delete(l),o.subscribers.size===0&&(p=o,h=c,setTimeout(function(){p.subscribers.size===0&&he(h,p)},3e3))})}var Td={stack:"dbcore",level:0,name:"Cache",create:function(o){var c=o.schema.name;return i(i({},o),{transaction:function(l,f,p){var h,m,y=o.transaction(l,f,p);return f==="readwrite"&&(p=(h=new AbortController).signal,y.addEventListener("abort",(m=function(_){return function(){if(h.abort(),f==="readwrite"){for(var N=new Set,C=0,x=l;C<x.length;C++){var I=x[C],P=Kn["idb://".concat(c,"/").concat(I)];if(P){var E=o.table(I),k=P.optimisticOps.filter(function(ce){return ce.trans===y});if(y._explicit&&_&&y.mutatedParts)for(var R=0,B=Object.values(P.queries.query);R<B.length;R++)for(var O=0,U=(ee=B[R]).slice();O<U.length;O++)xo((H=U[O]).obsSet,y.mutatedParts)&&(he(ee,H),H.subscribers.forEach(function(ce){return N.add(ce)}));else if(0<k.length){P.optimisticOps=P.optimisticOps.filter(function(ce){return ce.trans!==y});for(var W=0,Z=Object.values(P.queries.query);W<Z.length;W++)for(var ee,H,oe,ne=0,X=(ee=Z[W]).slice();ne<X.length;ne++)(H=X[ne]).res!=null&&y.mutatedParts&&(_&&!H.dirty?(oe=Object.isFrozen(H.res),oe=nl(H.res,H.req,k,E,H,oe),H.dirty?(he(ee,H),H.subscribers.forEach(function(ce){return N.add(ce)})):oe!==H.res&&(H.res=oe,H.promise=L.resolve({result:oe}))):(H.dirty&&he(ee,H),H.subscribers.forEach(function(ce){return N.add(ce)})))}}}N.forEach(function(ce){return ce()})}}})(!1),{signal:p}),y.addEventListener("error",m(!1),{signal:p}),y.addEventListener("complete",m(!0),{signal:p})),y},table:function(l){var f=o.table(l),p=f.schema.primaryKey;return i(i({},f),{mutate:function(h){var m,y=F.trans;return!p.outbound&&y.db._options.cache!=="disabled"&&!y.explicit&&y.idbtrans.mode==="readwrite"&&(m=Kn["idb://".concat(c,"/").concat(l)])?(y=f.mutate(h),h.type!=="add"&&h.type!=="put"||!(50<=h.values.length||Io(p,h).some(function(_){return _==null}))?(m.optimisticOps.push(h),h.mutatedParts&&es(h.mutatedParts),y.then(function(_){0<_.numFailures&&(he(m.optimisticOps,h),(_=tl(0,h,_))&&m.optimisticOps.push(_),h.mutatedParts)&&es(h.mutatedParts)}),y.catch(function(){he(m.optimisticOps,h),h.mutatedParts&&es(h.mutatedParts)})):y.then(function(_){var N=tl(0,i(i({},h),{values:h.values.map(function(C,x){var I;return _.failures[x]?C:(pe(I=(I=p.keyPath)!=null&&I.includes(".")?rt(C):i({},C),p.keyPath,_.results[x]),I)})}),_);m.optimisticOps.push(N),queueMicrotask(function(){return h.mutatedParts&&es(h.mutatedParts)})}),y):f.mutate(h)},query:function(h){var m,y,_,N,C,x,I;return Zc(F,f)&&el("query",h)?(m=((_=F.trans)==null?void 0:_.db._options.cache)==="immutable",y=(_=F).requery,_=_.signal,x=((P,E,k,R)=>{var B=Kn["idb://".concat(P,"/").concat(E)];if(!B)return[];if(!(P=B.queries[k]))return[null,!1,B,null];var O=P[(R.query?R.query.index.name:null)||""];if(!O)return[null,!1,B,null];switch(k){case"query":var U=O.find(function(W){return W.req.limit===R.limit&&W.req.values===R.values&&il(W.req.query.range,R.query.range)});return U?[U,!0,B,O]:[O.find(function(W){return("limit"in W.req?W.req.limit:1/0)>=R.limit&&(!R.values||W.req.values)&&Ad(W.req.query.range,R.query.range)}),!1,B,O];case"count":return U=O.find(function(W){return il(W.req.query.range,R.query.range)}),[U,!!U,B,O]}})(c,l,"query",h),I=x[0],N=x[2],C=x[3],I&&x[1]?I.obsSet=h.obsSet:(x=f.query(h).then(function(P){var E=P.result;if(I&&(I.res=E),m){for(var k=0,R=E.length;k<R;++k)Object.freeze(E[k]);Object.freeze(E)}else P.result=rt(E);return P}).catch(function(P){return C&&I&&he(C,I),Promise.reject(P)}),I={obsSet:h.obsSet,promise:x,subscribers:new Set,type:"query",req:h,dirty:!1},C?C.push(I):(C=[I],(N=N||(Kn["idb://".concat(c,"/").concat(l)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[h.query.index.name||""]=C)),Od(I,C,y,_),I.promise.then(function(P){return{result:nl(P.result,h,N?.optimisticOps,f,I,m)}})):f.query(h)}})}})}};function ns(o,c){return new Proxy(o,{get:function(l,f,p){return f==="db"?c:Reflect.get(l,f,p)}})}Ye.prototype.version=function(o){if(isNaN(o)||o<.1)throw new fe.Type("Given version is not a positive number");if(o=Math.round(10*o)/10,this.idbdb||this._state.isBeingOpened)throw new fe.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,o);var c=this._versions,l=c.filter(function(f){return f._cfg.version===o})[0];return l||(l=new this.Version(o),c.push(l),c.sort(wd),l.stores({}),this._state.autoSchema=!1),l},Ye.prototype._whenReady=function(o){var c=this;return this.idbdb&&(this._state.openComplete||F.letThrough||this._vip)?o():new L(function(l,f){if(c._state.openComplete)return f(new fe.DatabaseClosed(c._state.dbOpenError));if(!c._state.isBeingOpened){if(!c._state.autoOpen)return void f(new fe.DatabaseClosed);c.open().catch(Ae)}c._state.dbReadyPromise.then(l,f)}).then(o)},Ye.prototype.use=function(p){var c=p.stack,l=p.create,f=p.level,p=p.name,h=(p&&this.unuse({stack:c,name:p}),this._middlewares[c]||(this._middlewares[c]=[]));return h.push({stack:c,create:l,level:f??10,name:p}),h.sort(function(m,y){return m.level-y.level}),this},Ye.prototype.unuse=function(o){var c=o.stack,l=o.name,f=o.create;return c&&this._middlewares[c]&&(this._middlewares[c]=this._middlewares[c].filter(function(p){return f?p.create!==f:!!l&&p.name!==l})),this},Ye.prototype.open=function(){var o=this;return Fn(D,function(){return _d(o)})},Ye.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var o=this._state,c=ui.indexOf(this);if(0<=c&&ui.splice(c,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}o.isBeingOpened||(o.dbReadyPromise=new L(function(l){o.dbReadyResolve=l}),o.openCanceller=new L(function(l,f){o.cancelOpen=f}))},Ye.prototype.close=function(c){var c=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,l=this._state;c?(l.isBeingOpened&&l.cancelOpen(new fe.DatabaseClosed),this._close(),l.autoOpen=!1,l.dbOpenError=new fe.DatabaseClosed):(this._close(),l.autoOpen=this._options.autoOpen||l.isBeingOpened,l.openComplete=!1,l.dbOpenError=null)},Ye.prototype.delete=function(o){var c=this,l=(o===void 0&&(o={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),f=this._state;return new L(function(p,h){function m(){c.close(o);var y=c._deps.indexedDB.deleteDatabase(c.name);y.onsuccess=Ke(function(){var _,N,C;_=c._deps,N=c.name,yo(C=_.indexedDB)||N===Ur||vo(C,_.IDBKeyRange).delete(N).catch(Ae),p()}),y.onerror=Xt(h),y.onblocked=c._fireOnBlocked}if(l)throw new fe.InvalidArgument("Invalid closeOptions argument to db.delete()");f.isBeingOpened?f.dbReadyPromise.then(m):m()})},Ye.prototype.backendDB=function(){return this.idbdb},Ye.prototype.isOpen=function(){return this.idbdb!==null},Ye.prototype.hasBeenClosed=function(){var o=this._state.dbOpenError;return o&&o.name==="DatabaseClosed"},Ye.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Ye.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Ye.prototype,"tables",{get:function(){var o=this;return a(this._allTables).map(function(c){return o._allTables[c]})},enumerable:!1,configurable:!0}),Ye.prototype.transaction=function(){var o=function(c,l,f){var p=arguments.length;if(p<2)throw new fe.InvalidArgument("Too few arguments");for(var h=new Array(p-1);--p;)h[p-1]=arguments[p];return f=h.pop(),[c,je(h),f]}.apply(this,arguments);return this._transaction.apply(this,o)},Ye.prototype._transaction=function(o,c,l){var f,p,h=this,m=F.trans,y=(m&&m.db===this&&o.indexOf("!")===-1||(m=null),o.indexOf("?")!==-1);o=o.replace("!","").replace("?","");try{if(p=c.map(function(N){if(N=N instanceof h.Table?N.name:N,typeof N!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return N}),o=="r"||o===so)f=so;else{if(o!="rw"&&o!=oo)throw new fe.InvalidArgument("Invalid transaction mode: "+o);f=oo}if(m){if(m.mode===so&&f===oo){if(!y)throw new fe.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");m=null}m&&p.forEach(function(N){if(m&&m.storeNames.indexOf(N)===-1){if(!y)throw new fe.SubTransaction("Table "+N+" not included in parent transaction.");m=null}}),y&&m&&!m.active&&(m=null)}}catch(N){return m?m._promise(null,function(C,x){x(N)}):Ge(N)}var _=function N(C,x,I,P,E){return L.resolve().then(function(){var O=F.transless||F,k=C._createTransaction(x,I,C._dbSchema,P),O=(k.explicit=!0,{trans:k,transless:O});if(P)k.idbtrans=P.idbtrans;else try{k.create(),k.idbtrans._explicit=!0,C._state.PR1398_maxLoop=3}catch(U){return U.name===Jt.InvalidState&&C.isOpen()&&0<--C._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),C.close({disableAutoOpen:!1}),C.open().then(function(){return N(C,x,I,null,E)})):Ge(U)}var R,B=Ue(E),O=(B&&li(),L.follow(function(){var U;(R=E.call(k,k))&&(B?(U=bn.bind(null,null),R.then(U,U)):typeof R.next=="function"&&typeof R.throw=="function"&&(R=Co(R)))},O));return(R&&typeof R.then=="function"?L.resolve(R).then(function(U){return k.active?U:Ge(new fe.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):O.then(function(){return R})).then(function(U){return P&&k._resolve(),k._completion.then(function(){return U})}).catch(function(U){return k._reject(U),Ge(U)})})}.bind(null,this,f,p,m,l);return m?m._promise(f,_,"lock"):F.trans?Fn(F.transless,function(){return h._whenReady(_)}):this._whenReady(_)},Ye.prototype.table=function(o){if(b(this._allTables,o))return this._allTables[o];throw new fe.InvalidTable("Table ".concat(o," does not exist"))};var an=Ye;function Ye(o,c){var l,f,p,h,m,y=this,_=(this._middlewares={},this.verno=0,Ye.dependencies),_=(this._options=c=i({addons:Ye.addons,autoOpen:!0,indexedDB:_.indexedDB,IDBKeyRange:_.IDBKeyRange,cache:"cloned"},c),this._deps={indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange},c.addons),N=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Ae,dbReadyPromise:null,cancelOpen:Ae,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:c.autoOpen}),C=(N.dbReadyPromise=new L(function(x){N.dbReadyResolve=x}),N.openCanceller=new L(function(x,I){N.cancelOpen=I}),this._state=N,this.name=o,this.on=Di(this,"populate","blocked","versionchange","close",{ready:[mn,Ae]}),this.once=function(x,I){var P=function(){for(var E=[],k=0;k<arguments.length;k++)E[k]=arguments[k];y.on(x).unsubscribe(P),I.apply(y,E)};return y.on(x,P)},this.on.ready.subscribe=se(this.on.ready.subscribe,function(x){return function(I,P){Ye.vip(function(){var E,k=y._state;k.openComplete?(k.dbOpenError||L.resolve().then(I),P&&x(I)):k.onReadyBeingFired?(k.onReadyBeingFired.push(I),P&&x(I)):(x(I),E=y,P||x(function R(){E.on.ready.unsubscribe(I),E.on.ready.unsubscribe(R)}))})}}),this.Collection=(l=this,Ui(pd.prototype,function(R,k){this.db=l;var P=Nc,E=null;if(k)try{P=k()}catch(O){E=O}var k=R._ctx,R=k.table,B=R.hook.reading.fire;this._ctx={table:R,index:k.index,isPrimKey:!k.index||R.schema.primKey.keyPath&&k.index===R.schema.primKey.name,range:P,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:E,or:k.or,valueMapper:B!==Et?B:null}})),this.Table=(f=this,Ui($c.prototype,function(x,I,P){this.db=f,this._tx=P,this.name=x,this.schema=I,this.hook=f._allTables[x]?f._allTables[x].hook:Di(null,{creating:[rn,Ae],reading:[$n,Et],updating:[ai,Ae],deleting:[Qt,Ae]})})),this.Transaction=(p=this,Ui(md.prototype,function(x,I,P,E,k){var R=this;x!=="readonly"&&I.forEach(function(B){B=(B=P[B])==null?void 0:B.yProps,B&&(I=I.concat(B.map(function(O){return O.updatesTable})))}),this.db=p,this.mode=x,this.storeNames=I,this.schema=P,this.chromeTransactionDurability=E,this.idbtrans=null,this.on=Di(this,"complete","error","abort"),this.parent=k||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new L(function(B,O){R._resolve=B,R._reject=O}),this._completion.then(function(){R.active=!1,R.on.complete.fire()},function(B){var O=R.active;return R.active=!1,R.on.error.fire(B),R.parent?R.parent._reject(B):O&&R.idbtrans&&R.idbtrans.abort(),Ge(B)})})),this.Version=(h=this,Ui(kd.prototype,function(x){this.db=h,this._cfg={version:x,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(m=this,Ui(qc.prototype,function(x,I,P){if(this.db=m,this._ctx={table:x,index:I===":id"?null:I,or:P},this._cmp=this._ascending=Ie,this._descending=function(E,k){return Ie(k,E)},this._max=function(E,k){return 0<Ie(E,k)?E:k},this._min=function(E,k){return Ie(E,k)<0?E:k},this._IDBKeyRange=m._deps.IDBKeyRange,!this._IDBKeyRange)throw new fe.MissingAPI})),this.on("versionchange",function(x){0<x.newVersion?console.warn("Another connection wants to upgrade database '".concat(y.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(y.name,"'. Closing db now to resume the delete request.")),y.close({disableAutoOpen:!1})}),this.on("blocked",function(x){!x.newVersion||x.newVersion<x.oldVersion?console.warn("Dexie.delete('".concat(y.name,"') was blocked")):console.warn("Upgrade '".concat(y.name,"' blocked by other connection holding version ").concat(x.oldVersion/10))}),this._maxKey=Vi(c.IDBKeyRange),this._createTransaction=function(x,I,P,E){return new y.Transaction(x,I,P,y._options.chromeTransactionDurability,E)},this._fireOnBlocked=function(x){y.on("blocked").fire(x),ui.filter(function(I){return I.name===y.name&&I!==y&&!I._state.vcFired}).map(function(I){return I.on("versionchange").fire(x)})},this.use(Id),this.use(Td),this.use(Pd),this.use(Cd),this.use(Ed),new Proxy(this,{get:function(x,I,P){var E;return I==="_vip"||(I==="table"?function(k){return ns(y.table(k),C)}:(E=Reflect.get(x,I,P))instanceof $c?ns(E,C):I==="tables"?E.map(function(k){return ns(k,C)}):I==="_createTransaction"?function(){return ns(E.apply(this,arguments),C)}:E)}}));this.vip=C,_.forEach(function(x){return x(y)})}var is,hi=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Nd=(Ao.prototype.subscribe=function(o,c,l){return this._subscribe(o&&typeof o!="function"?o:{next:o,error:c,complete:l})},Ao.prototype[hi]=function(){return this},Ao);function Ao(o){this._subscribe=o}try{is={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch{is={indexedDB:null,IDBKeyRange:null}}function rl(o){var c,l=!1,f=new Nd(function(p){var h=Ue(o),m,y=!1,_={},N={},C={get closed(){return y},unsubscribe:function(){y||(y=!0,m&&m.abort(),x&&Sn.storagemutated.unsubscribe(P))}},x=(p.start&&p.start(C),!1),I=function(){return ro(E)},P=function(k){Zr(_,k),xo(N,_)&&I()},E=function(){var k,R,B;!y&&is.indexedDB&&(_={},k={},m&&m.abort(),m=new AbortController,B=(O=>{var U=sn();try{h&&li();var W=yn(o,O);return W=h?W.finally(bn):W}finally{U&&vn()}})(R={subscr:k,signal:m.signal,requery:I,querier:o,trans:null}),Promise.resolve(B).then(function(O){l=!0,c=O,y||R.signal.aborted||(_={},(U=>{for(var W in U)if(b(U,W))return;return 1})(N=k)||x||(Sn(qi,P),x=!0),ro(function(){return!y&&p.next&&p.next(O)}))},function(O){l=!1,["DatabaseClosedError","AbortError"].includes(O?.name)||y||ro(function(){y||p.error&&p.error(O)})}))};return setTimeout(I,0),C});return f.hasValue=function(){return l},f.getValue=function(){return c},f}var qn=an;function Oo(o){var c=kn;try{kn=!0,Sn.storagemutated.fire(o),_o(o,!0)}finally{kn=c}}w(qn,i(i({},kt),{delete:function(o){return new qn(o,{addons:[]}).delete()},exists:function(o){return new qn(o,{addons:[]}).open().then(function(c){return c.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(o){try{return c=qn.dependencies,l=c.indexedDB,c=c.IDBKeyRange,(yo(l)?Promise.resolve(l.databases()).then(function(f){return f.map(function(p){return p.name}).filter(function(p){return p!==Ur})}):vo(l,c).toCollection().primaryKeys()).then(o)}catch{return Ge(new fe.MissingAPI)}var c,l},defineClass:function(){return function(o){d(this,o)}},ignoreTransaction:function(o){return F.trans?Fn(F.transless,o):o()},vip:bo,async:function(o){return function(){try{var c=Co(o.apply(this,arguments));return c&&typeof c.then=="function"?c:L.resolve(c)}catch(l){return Ge(l)}}},spawn:function(o,c,l){try{var f=Co(o.apply(l,c||[]));return f&&typeof f.then=="function"?f:L.resolve(f)}catch(p){return Ge(p)}},currentTransaction:{get:function(){return F.trans||null}},waitFor:function(o,c){return o=L.resolve(typeof o=="function"?qn.ignoreTransaction(o):o).timeout(c||6e4),F.trans?F.trans.waitFor(o):o},Promise:L,debug:{get:function(){return mt},set:function(o){Nt(o)}},derive:M,extend:d,props:w,override:se,Events:Di,on:Sn,liveQuery:rl,extendObservabilitySet:Zr,getByKeyPath:ue,setByKeyPath:pe,delByKeyPath:function(o,c){typeof c=="string"?pe(o,c,void 0):"length"in c&&[].map.call(c,function(l){pe(o,l,void 0)})},shallowClone:G,deepClone:rt,getObjectDiff:Eo,cmp:Ie,asap:ie,minKey:-1/0,addons:[],connections:ui,errnames:Jt,dependencies:is,cache:Kn,semVer:"4.3.0",version:"4.3.0".split(".").map(function(o){return parseInt(o)}).reduce(function(o,c,l){return o+c/Math.pow(10,2*l)})})),qn.maxKey=Vi(qn.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Sn(qi,function(o){kn||(o=new CustomEvent(lo,{detail:o}),kn=!0,dispatchEvent(o),kn=!1)}),addEventListener(lo,function(o){o=o.detail,kn||Oo(o)}));var gi,kn=!1,sl=function(){};return typeof BroadcastChannel<"u"&&((sl=function(){(gi=new BroadcastChannel(lo)).onmessage=function(o){return o.data&&Oo(o.data)}})(),typeof gi.unref=="function"&&gi.unref(),Sn(qi,function(o){kn||gi.postMessage(o)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(o){if(!an.disableBfCache&&o.persisted){mt&&console.debug("Dexie: handling persisted pagehide"),gi?.close();for(var c=0,l=ui;c<l.length;c++)l[c].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(o){!an.disableBfCache&&o.persisted&&(mt&&console.debug("Dexie: handling persisted pageshow"),sl(),Oo({all:new ht(-1/0,[[]])}))})),L.rejectionMapper=function(o,c){return!o||o instanceof dt||o instanceof TypeError||o instanceof SyntaxError||!o.name||!pt[o.name]?o:(c=new pt[o.name](c||o.message,o),"stack"in o&&z(c,"stack",{get:function(){return this.inner.stack}}),c)},Nt(mt),i(an,Object.freeze({__proto__:null,Dexie:an,Entity:Mc,PropModification:Fi,RangeSet:ht,add:function(o){return new Fi({add:o})},cmp:Ie,default:an,liveQuery:rl,mergeRanges:Hi,rangesOverlap:Gc,remove:function(o){return new Fi({remove:o})},replacePrefix:function(o,c){return new Fi({replacePrefix:[o,c]})}}),{default:an}),an})})(bs)),bs.exports}var uv=lv(),ba=Md(uv);const Nl=Symbol.for("Dexie"),Os=globalThis[Nl]||(globalThis[Nl]=ba);if(ba.semVer!==Os.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${ba.semVer} and ${Os.semVer}`);const{liveQuery:Sw,mergeRanges:kw,rangesOverlap:_w,RangeSet:Cw,cmp:Ew,Entity:Iw,PropModification:Pw,replacePrefix:Aw,add:Ow,remove:Tw,DexieYProvider:Nw}=Os;class fv extends Os{pages;constructor(e){super("pages_"+e),this.version(2).stores({pages:"id, name, content, document, css, js, document.name, document.headline, document.creator"})}}var dv=Object.getOwnPropertyDescriptor,pv=(t,e,n,i)=>{for(var r=i>1?void 0:i?dv(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},hv=(t,e)=>(n,i)=>e(n,i,t);let wa=class{pageStorageMap=new Map;logger;constructor(t){this.logger=t,this.logger.setModule("storage.components.dexieOfflineStorage")}getPageStorage(t){let e=this.pageStorageMap.get(t);return e==null&&(e=new fv(t),this.pageStorageMap.set(t,e)),e}async getPage(t,e){try{this.logger.debug("Ready to load page from local storage",e);const n=this.getPageStorage(t);this.logger.debug("pageStorage is ready, asking for page");const i=await n.pages.get(e),r=new Nn;return r.fromObject(i),r}catch(n){this.logger.debug("Exception while trying to read from local storage",n);return}}async savePage(t,e,n){try{await this.getPageStorage(t).pages.put(n.toObject(),e)}catch(i){this.logger.debug("Exception while trying to store in local storage",t,e,n,i)}}async updatePage(t,e,n){try{const i=this.getPageStorage(t);this.logger.debug("Ready to store",n),await i.pages.update(e,n.toObject())}catch(i){this.logger.debug("Exception while trying to store in local storage",t,e,n,i)}}};wa=pv([it(),hv(0,Le("Logger"))],wa);var gv=Object.getOwnPropertyDescriptor,mv=(t,e,n,i)=>{for(var r=i>1?void 0:i?gv(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},Vo=(t,e)=>(n,i)=>e(n,i,t);let xa=class{logger;storage;offlineStorage;queueWorker;constructor(t,e,n){this.logger=t,this.logger.setModule("storage.components.wrappingOfflineStorage"),this.offlineStorage=e,this.queueWorker=n}setStorage(t){this.storage=t}getStorage(){return this.storage}setWikiConfig(t){return this.storage.setWikiConfig(t)}getWikiConfig(){return this.storage.getWikiConfig()}async isStorageReady(){return this.storage.isStorageReady()}getPageRestURL(t,e){return this.storage.getPageRestURL(t,e)}getPageFromViewURL(t){return this.storage.getPageFromViewURL(t)}getImageURL(t,e){return this.storage.getImageURL(t,e)}async getPageContent(t,e,n,i){if(this.logger.debug("Trying to get data for page ",t),this.offlineStorage){this.logger.debug("Asking offline storage for ",t);const r=await this.offlineStorage.getPage(this.getWikiConfig().name,t+"_"+e);return r!=null&&r!=null?(this.logger.debug("Loading data from local storage for page",t),(i==null||i)&&this.queueWorker.addToQueue(this.getWikiConfig().name+":"+t+"_"+e),r):(this.logger.debug("Could not find data in local storage for page",t),this.savePageContent(t,e))}else return this.logger.debug("No offline local storage available"),this.storage.getPageContent(t,e)}getAttachments(t){return this.storage.getAttachments(t)}getAttachment(t,e){return this.storage.getAttachment(t,e)}async savePageContent(t,e){const n=await this.storage.getPageContent(t,e);if(n)return n.id=t+"_"+e,this.logger.debug("Saving page to offline storage",t),this.offlineStorage.savePage(this.getWikiConfig().name,t+"_"+e,n),n;throw new Error("Can't save missing page.")}async updatePageContent(t,e){const n=await this.offlineStorage.getPage(this.getWikiConfig().name,t+"_"+e),i=await this.storage.getPageContent(t,e);return n&&i?(i.id=t+"_"+e,this.logger.debug("Saving page to offline storage",t),this.offlineStorage.savePage(this.getWikiConfig().name,t+"_"+e,i),!0):n?.version!=i?.version&&i?(i.id=t+"_"+e,this.logger.debug("Updating page to offline storage",t),this.offlineStorage.updatePage(this.getWikiConfig().name,t+"_"+e,i),!0):(this.logger.debug("Local storage not updated, because version are identical"),!1)}async getPanelContent(t,e,n){return this.storage.getPanelContent(t,e,n)}async getEditField(t,e){return await this.storage.getEditField(t,e)}save(t,e,n,i){return this.storage.save(t,e,n,i)}async saveAttachments(t,e){return this.storage.saveAttachments(t,e)}async delete(t){return this.storage.delete(t)}async move(t,e,n){return this.storage.move(t,e,n)}};xa=mv([it(),Vo(0,Le("Logger")),Vo(1,Le("OfflineStorage")),Vo(2,Le("QueueWorker"))],xa);let vv=class{constructor(e){e.bind("WrappingStorage").to(xa).inSingletonScope(),e.bind("OfflineStorage").to(wa).inSingletonScope()}};var yv=Object.getOwnPropertyDescriptor,bv=(t,e,n,i)=>{for(var r=i>1?void 0:i?yv(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},as=(t,e)=>(n,i)=>e(n,i,t);let Sa=class extends yr{storage;cristal;constructor(t,e,n){super(t),this.storage=e,this.cristal=n,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="README.md")}defaultPageName(){return"README"}getType(){return"GitHub"}};Sa=bv([it(),as(0,Le("Logger")),as(1,Le("Storage")),as(1,tc("GitHub")),as(2,Le("CristalApp"))],Sa);const fc=Symbol.for("yaml.alias"),ka=Symbol.for("yaml.document"),Mn=Symbol.for("yaml.map"),lf=Symbol.for("yaml.pair"),nn=Symbol.for("yaml.scalar"),Ri=Symbol.for("yaml.seq"),Kt=Symbol.for("yaml.node.type"),si=t=>!!t&&typeof t=="object"&&t[Kt]===fc,Or=t=>!!t&&typeof t=="object"&&t[Kt]===ka,Tr=t=>!!t&&typeof t=="object"&&t[Kt]===Mn,et=t=>!!t&&typeof t=="object"&&t[Kt]===lf,De=t=>!!t&&typeof t=="object"&&t[Kt]===nn,Nr=t=>!!t&&typeof t=="object"&&t[Kt]===Ri;function Qe(t){if(t&&typeof t=="object")switch(t[Kt]){case Mn:case Ri:return!0}return!1}function Xe(t){if(t&&typeof t=="object")switch(t[Kt]){case fc:case Mn:case nn:case Ri:return!0}return!1}const uf=t=>(De(t)||Qe(t))&&!!t.anchor,Gn=Symbol("break visit"),wv=Symbol("skip children"),ar=Symbol("remove node");function ji(t,e){const n=xv(e);Or(t)?_i(null,t.contents,n,Object.freeze([t]))===ar&&(t.contents=null):_i(null,t,n,Object.freeze([]))}ji.BREAK=Gn;ji.SKIP=wv;ji.REMOVE=ar;function _i(t,e,n,i){const r=Sv(t,e,n,i);if(Xe(r)||et(r))return kv(t,i,r),_i(t,r,n,i);if(typeof r!="symbol"){if(Qe(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){const a=_i(s,e.items[s],n,i);if(typeof a=="number")s=a-1;else{if(a===Gn)return Gn;a===ar&&(e.items.splice(s,1),s-=1)}}}else if(et(e)){i=Object.freeze(i.concat(e));const s=_i("key",e.key,n,i);if(s===Gn)return Gn;s===ar&&(e.key=null);const a=_i("value",e.value,n,i);if(a===Gn)return Gn;a===ar&&(e.value=null)}}return r}function xv(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Sv(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(Tr(e))return n.Map?.(t,e,i);if(Nr(e))return n.Seq?.(t,e,i);if(et(e))return n.Pair?.(t,e,i);if(De(e))return n.Scalar?.(t,e,i);if(si(e))return n.Alias?.(t,e,i)}function kv(t,e,n){const i=e[e.length-1];if(Qe(i))i.items[t]=n;else if(et(i))t==="key"?i.key=n:i.value=n;else if(Or(i))i.contents=n;else{const r=si(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const _v={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Cv=t=>t.replace(/[!,[\]{}]/g,e=>_v[e]);class bt{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},bt.defaultYaml,e),this.tags=Object.assign({},bt.defaultTags,n)}clone(){const e=new bt(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new bt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:bt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},bt.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:bt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},bt.defaultTags),this.atNextDocument=!1);const i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,a]=i;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const a=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,a),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const a=e.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(a){return n(String(a)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+Cv(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(e&&i.length>0&&Xe(e.contents)){const s={};ji(e.contents,(a,u)=>{Xe(u)&&u.tag&&(s[u.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,a]of i)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||r.some(u=>u.startsWith(a)))&&n.push(`%TAG ${s} ${a}`);return n.join(`
|
|
51
|
-
`)}}bt.defaultYaml={explicit:!1,version:"1.2"};bt.defaultTags={"!!":"tag:yaml.org,2002:"};function ff(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function df(t){const e=new Set;return ji(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function pf(t,e){for(let n=1;;++n){const i=`${t}${n}`;if(!e.has(i))return i}}function Ev(t,e){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=df(t));const a=pf(e,r);return r.add(a),a},setAnchors:()=>{for(const s of n){const a=i.get(s);if(typeof a=="object"&&a.anchor&&(De(a.node)||Qe(a.node)))a.node.anchor=a.anchor;else{const u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=s,u}}},sourceObjects:i}}function Ci(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){const a=i[r],u=Ci(t,i,String(r),a);u===void 0?delete i[r]:u!==a&&(i[r]=u)}else if(i instanceof Map)for(const r of Array.from(i.keys())){const s=i.get(r),a=Ci(t,i,r,s);a===void 0?i.delete(r):a!==s&&i.set(r,a)}else if(i instanceof Set)for(const r of Array.from(i)){const s=Ci(t,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(const[r,s]of Object.entries(i)){const a=Ci(t,i,r,s);a===void 0?delete i[r]:a!==s&&(i[r]=a)}return t.call(e,n,i)}function $t(t,e,n){if(Array.isArray(t))return t.map((i,r)=>$t(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!uf(t))return t.toJSON(e,n);const i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=s=>{i.res=s,delete n.onCreate};const r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}class dc{constructor(e){Object.defineProperty(this,Kt,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!Or(e))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},u=$t(this,"",a);if(typeof r=="function")for(const{count:d,res:g}of a.anchors.values())r(g,d);return typeof s=="function"?Ci(s,{"":u},"",u):u}}class pc extends dc{constructor(e){super(fc),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],ji(e,{Node:(s,a)=>{(si(a)||uf(a))&&i.push(a)}}),n&&(n.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(e,n){if(!n)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=n,a=this.resolve(r,n);if(!a){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let u=i.get(a);if(u||($t(a,null,n),u=i.get(a)),u?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(s>=0&&(u.count+=1,u.aliasCount===0&&(u.aliasCount=ws(r,a,i)),u.count*u.aliasCount>s)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return u.res}toString(e,n,i){const r=`*${this.source}`;if(e){if(ff(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}}function ws(t,e,n){if(si(e)){const i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Qe(e)){let i=0;for(const r of e.items){const s=ws(t,r,n);s>i&&(i=s)}return i}else if(et(e)){const i=ws(t,e.key,n),r=ws(t,e.value,n);return Math.max(i,r)}return 1}const hf=t=>!t||typeof t!="function"&&typeof t!="object";class we extends dc{constructor(e){super(nn),this.value=e}toJSON(e,n){return n?.keep?this.value:$t(this.value,e,n)}toString(){return String(this.value)}}we.BLOCK_FOLDED="BLOCK_FOLDED";we.BLOCK_LITERAL="BLOCK_LITERAL";we.PLAIN="PLAIN";we.QUOTE_DOUBLE="QUOTE_DOUBLE";we.QUOTE_SINGLE="QUOTE_SINGLE";const Iv="tag:yaml.org,2002:";function Pv(t,e,n){if(e){const i=n.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}function br(t,e,n){if(Or(t)&&(t=t.contents),Xe(t))return t;if(et(t)){const b=n.schema[Mn].createNode?.(n.schema,null,n);return b.items.push(t),b}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:a,sourceObjects:u}=n;let d;if(i&&t&&typeof t=="object"){if(d=u.get(t),d)return d.anchor??(d.anchor=r(t)),new pc(d.anchor);d={anchor:null,node:null},u.set(t,d)}e?.startsWith("!!")&&(e=Iv+e.slice(2));let g=Pv(t,e,a.tags);if(!g){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const b=new we(t);return d&&(d.node=b),b}g=t instanceof Map?a[Mn]:Symbol.iterator in Object(t)?a[Ri]:a[Mn]}s&&(s(g),delete n.onTagObj);const v=g?.createNode?g.createNode(n.schema,t,n):typeof g?.nodeClass?.from=="function"?g.nodeClass.from(n.schema,t,n):new we(t);return e?v.tag=e:g.default||(v.tag=g.tag),d&&(d.node=v),v}function Ts(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){const s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const a=[];a[s]=i,i=a}else i=new Map([[s,i]])}return br(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Xi=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class gf extends dc{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(i=>Xe(i)||et(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Xi(e))this.add(n);else{const[i,...r]=e,s=this.get(i,!0);if(Qe(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,Ts(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){const[n,...i]=e;if(i.length===0)return this.delete(n);const r=this.get(n,!0);if(Qe(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){const[i,...r]=e,s=this.get(i,!0);return r.length===0?!n&&De(s)?s.value:s:Qe(s)?s.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!et(n))return!1;const i=n.value;return i==null||e&&De(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){const[n,...i]=e;if(i.length===0)return this.has(n);const r=this.get(n,!0);return Qe(r)?r.hasIn(i):!1}setIn(e,n){const[i,...r]=e;if(r.length===0)this.set(i,n);else{const s=this.get(i,!0);if(Qe(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,Ts(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const Av=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function un(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const Qn=(t,e,n)=>t.endsWith(`
|
|
52
|
-
`)?un(n,e):n.includes(`
|
|
53
|
-
`)?`
|
|
54
|
-
`+un(n,e):(t.endsWith(" ")?"":" ")+n,mf="flow",_a="block",xs="quoted";function Ys(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:a,onOverflow:u}={}){if(!r||r<0)return t;r<s&&(s=0);const d=Math.max(1+s,1+r-e.length);if(t.length<=d)return t;const g=[],v={};let b=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?g.push(0):b=r-i);let w,j,z=!1,M=-1,K=-1,te=-1;n===_a&&(M=Ml(t,M,e.length),M!==-1&&(b=M+d));for(let se;se=t[M+=1];){if(n===xs&&se==="\\"){switch(K=M,t[M+1]){case"x":M+=3;break;case"u":M+=5;break;case"U":M+=9;break;default:M+=1}te=M}if(se===`
|
|
55
|
-
`)n===_a&&(M=Ml(t,M,e.length)),b=M+e.length+d,w=void 0;else{if(se===" "&&j&&j!==" "&&j!==`
|
|
56
|
-
`&&j!==" "){const J=t[M+1];J&&J!==" "&&J!==`
|
|
57
|
-
`&&J!==" "&&(w=M)}if(M>=b)if(w)g.push(w),b=w+d,w=void 0;else if(n===xs){for(;j===" "||j===" ";)j=se,se=t[M+=1],z=!0;const J=M>te+1?M-2:K-1;if(v[J])return t;g.push(J),v[J]=!0,b=J+d,w=void 0}else z=!0}j=se}if(z&&u&&u(),g.length===0)return t;a&&a();let Y=t.slice(0,g[0]);for(let se=0;se<g.length;++se){const J=g[se],ie=g[se+1]||t.length;J===0?Y=`
|
|
58
|
-
${e}${t.slice(0,ie)}`:(n===xs&&v[J]&&(Y+=`${t[J]}\\`),Y+=`
|
|
59
|
-
${e}${t.slice(J+1,ie)}`)}return Y}function Ml(t,e,n){let i=e,r=e+1,s=t[r];for(;s===" "||s===" ";)if(e<r+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
60
|
-
`);i=e,r=e+1,s=t[r]}return i}const Js=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Qs=t=>/^(%|---|\.\.\.)/m.test(t);function Ov(t,e,n){if(!e||e<0)return!1;const i=e-n,r=t.length;if(r<=i)return!1;for(let s=0,a=0;s<r;++s)if(t[s]===`
|
|
61
|
-
`){if(s-a>i)return!0;if(a=s+1,r-a<=i)return!1}return!0}function cr(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Qs(t)?" ":"");let a="",u=0;for(let d=0,g=n[d];g;g=n[++d])if(g===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(a+=n.slice(u,d)+"\\ ",d+=1,u=d,g="\\"),g==="\\")switch(n[d+1]){case"u":{a+=n.slice(u,d);const v=n.substr(d+2,4);switch(v){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:v.substr(0,2)==="00"?a+="\\x"+v.substr(2):a+=n.substr(d,6)}d+=5,u=d+1}break;case"n":if(i||n[d+2]==='"'||n.length<r)d+=1;else{for(a+=n.slice(u,d)+`
|
|
62
|
-
|
|
63
|
-
`;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)a+=`
|
|
64
|
-
`,d+=2;a+=s,n[d+2]===" "&&(a+="\\"),d+=1,u=d+1}break;default:d+=1}return a=u?a+n.slice(u):n,i?a:Ys(a,s,xs,Js(e,!1))}function Ca(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
65
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return cr(t,e);const n=e.indent||(Qs(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
66
|
-
${n}`)+"'";return e.implicitKey?i:Ys(i,n,mf,Js(e,!1))}function Ei(t,e){const{singleQuote:n}=e.options;let i;if(n===!1)i=cr;else{const r=t.includes('"'),s=t.includes("'");r&&!s?i=Ca:s&&!r?i=cr:i=n?Ca:cr}return i(t,e)}let Ea;try{Ea=new RegExp(`(^|(?<!
|
|
67
|
-
))
|
|
68
|
-
+(?!
|
|
69
|
-
|$)`,"g")}catch{Ea=/\n+(?!\n|$)/g}function Ss({comment:t,type:e,value:n},i,r,s){const{blockQuote:a,commentString:u,lineWidth:d}=i.options;if(!a||/\n[\t ]+$/.test(n))return Ei(n,i);const g=i.indent||(i.forceBlockIndent||Qs(n)?" ":""),v=a==="literal"?!0:a==="folded"||e===we.BLOCK_FOLDED?!1:e===we.BLOCK_LITERAL?!0:!Ov(n,d,g.length);if(!n)return v?`|
|
|
70
|
-
`:`>
|
|
71
|
-
`;let b,w;for(w=n.length;w>0;--w){const ie=n[w-1];if(ie!==`
|
|
72
|
-
`&&ie!==" "&&ie!==" ")break}let j=n.substring(w);const z=j.indexOf(`
|
|
73
|
-
`);z===-1?b="-":n===j||z!==j.length-1?(b="+",s&&s()):b="",j&&(n=n.slice(0,-j.length),j[j.length-1]===`
|
|
74
|
-
`&&(j=j.slice(0,-1)),j=j.replace(Ea,`$&${g}`));let M=!1,K,te=-1;for(K=0;K<n.length;++K){const ie=n[K];if(ie===" ")M=!0;else if(ie===`
|
|
75
|
-
`)te=K;else break}let Y=n.substring(0,te<K?te+1:K);Y&&(n=n.substring(Y.length),Y=Y.replace(/\n+/g,`$&${g}`));let J=(M?g?"2":"1":"")+b;if(t&&(J+=" "+u(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!v){const ie=n.replace(/\n+/g,`
|
|
76
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let ue=!1;const pe=Js(i,!0);a!=="folded"&&e!==we.BLOCK_FOLDED&&(pe.onOverflow=()=>{ue=!0});const G=Ys(`${Y}${ie}${j}`,g,_a,pe);if(!ue)return`>${J}
|
|
77
|
-
${g}${G}`}return n=n.replace(/\n+/g,`$&${g}`),`|${J}
|
|
78
|
-
${g}${Y}${n}${j}`}function Tv(t,e,n,i){const{type:r,value:s}=t,{actualString:a,implicitKey:u,indent:d,indentStep:g,inFlow:v}=e;if(u&&s.includes(`
|
|
79
|
-
`)||v&&/[[\]{},]/.test(s))return Ei(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return u||v||!s.includes(`
|
|
80
|
-
`)?Ei(s,e):Ss(t,e,n,i);if(!u&&!v&&r!==we.PLAIN&&s.includes(`
|
|
81
|
-
`))return Ss(t,e,n,i);if(Qs(s)){if(d==="")return e.forceBlockIndent=!0,Ss(t,e,n,i);if(u&&d===g)return Ei(s,e)}const b=s.replace(/\n+/g,`$&
|
|
82
|
-
${d}`);if(a){const w=M=>M.default&&M.tag!=="tag:yaml.org,2002:str"&&M.test?.test(b),{compat:j,tags:z}=e.doc.schema;if(z.some(w)||j?.some(w))return Ei(s,e)}return u?b:Ys(b,d,mf,Js(e,!1))}function hc(t,e,n,i){const{implicitKey:r,inFlow:s}=e,a=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:u}=t;u!==we.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(u=we.QUOTE_DOUBLE);const d=v=>{switch(v){case we.BLOCK_FOLDED:case we.BLOCK_LITERAL:return r||s?Ei(a.value,e):Ss(a,e,n,i);case we.QUOTE_DOUBLE:return cr(a.value,e);case we.QUOTE_SINGLE:return Ca(a.value,e);case we.PLAIN:return Tv(a,e,n,i);default:return null}};let g=d(u);if(g===null){const{defaultKeyType:v,defaultStringType:b}=e.options,w=r&&v||b;if(g=d(w),g===null)throw new Error(`Unsupported default string type ${w}`)}return g}function vf(t,e){const n=Object.assign({blockQuote:!0,commentString:Av,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function Nv(t,e){if(e.tag){const r=t.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let n,i;if(De(e)){i=e.value;let r=t.filter(s=>s.identify?.(i));if(r.length>1){const s=r.filter(a=>a.test);s.length>0&&(r=s)}n=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){const r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Mv(t,e,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(De(t)||Qe(t))&&t.anchor;s&&ff(s)&&(n.add(s),r.push(`&${s}`));const a=t.tag??(e.default?null:e.tag);return a&&r.push(i.directives.tagString(a)),r.join(" ")}function Ti(t,e,n,i){if(et(t))return t.toString(e,n,i);if(si(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r;const s=Xe(t)?t:e.doc.createNode(t,{onTagObj:d=>r=d});r??(r=Nv(e.doc.schema.tags,s));const a=Mv(s,r,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);const u=typeof r.stringify=="function"?r.stringify(s,e,n,i):De(s)?hc(s,e,n,i):s.toString(e,n,i);return a?De(s)||u[0]==="{"||u[0]==="["?`${a} ${u}`:`${a}
|
|
83
|
-
${e.indent}${u}`:u}function Rv({key:t,value:e},n,i,r){const{allNullValues:s,doc:a,indent:u,indentStep:d,options:{commentString:g,indentSeq:v,simpleKeys:b}}=n;let w=Xe(t)&&t.comment||null;if(b){if(w)throw new Error("With simple keys, key nodes cannot have comments");if(Qe(t)||!Xe(t)&&typeof t=="object"){const pe="With simple keys, collection cannot be used as a key value";throw new Error(pe)}}let j=!b&&(!t||w&&e==null&&!n.inFlow||Qe(t)||(De(t)?t.type===we.BLOCK_FOLDED||t.type===we.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!j&&(b||!s),indent:u+d});let z=!1,M=!1,K=Ti(t,n,()=>z=!0,()=>M=!0);if(!j&&!n.inFlow&&K.length>1024){if(b)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");j=!0}if(n.inFlow){if(s||e==null)return z&&i&&i(),K===""?"?":j?`? ${K}`:K}else if(s&&!b||e==null&&j)return K=`? ${K}`,w&&!z?K+=Qn(K,n.indent,g(w)):M&&r&&r(),K;z&&(w=null),j?(w&&(K+=Qn(K,n.indent,g(w))),K=`? ${K}
|
|
84
|
-
${u}:`):(K=`${K}:`,w&&(K+=Qn(K,n.indent,g(w))));let te,Y,se;Xe(e)?(te=!!e.spaceBefore,Y=e.commentBefore,se=e.comment):(te=!1,Y=null,se=null,e&&typeof e=="object"&&(e=a.createNode(e))),n.implicitKey=!1,!j&&!w&&De(e)&&(n.indentAtStart=K.length+1),M=!1,!v&&d.length>=2&&!n.inFlow&&!j&&Nr(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let J=!1;const ie=Ti(e,n,()=>J=!0,()=>M=!0);let ue=" ";if(w||te||Y){if(ue=te?`
|
|
85
|
-
`:"",Y){const pe=g(Y);ue+=`
|
|
86
|
-
${un(pe,n.indent)}`}ie===""&&!n.inFlow?ue===`
|
|
87
|
-
`&&se&&(ue=`
|
|
88
|
-
|
|
89
|
-
`):ue+=`
|
|
90
|
-
${n.indent}`}else if(!j&&Qe(e)){const pe=ie[0],G=ie.indexOf(`
|
|
91
|
-
`),ge=G!==-1,je=n.inFlow??e.flow??e.items.length===0;if(ge||!je){let We=!1;if(ge&&(pe==="&"||pe==="!")){let _e=ie.indexOf(" ");pe==="&"&&_e!==-1&&_e<G&&ie[_e+1]==="!"&&(_e=ie.indexOf(" ",_e+1)),(_e===-1||G<_e)&&(We=!0)}We||(ue=`
|
|
92
|
-
${n.indent}`)}}else(ie===""||ie[0]===`
|
|
93
|
-
`)&&(ue="");return K+=ue+ie,n.inFlow?J&&i&&i():se&&!J?K+=Qn(K,n.indent,g(se)):M&&r&&r(),K}function yf(t,e){(t==="debug"||t==="warn")&&console.warn(e)}const cs="<<",pn={identify:t=>t===cs||typeof t=="symbol"&&t.description===cs,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new we(Symbol(cs)),{addToJSMap:bf}),stringify:()=>cs},jv=(t,e)=>(pn.identify(e)||De(e)&&(!e.type||e.type===we.PLAIN)&&pn.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===pn.tag&&n.default);function bf(t,e,n){if(n=t&&si(n)?n.resolve(t.doc):n,Nr(n))for(const i of n.items)zo(t,e,i);else if(Array.isArray(n))for(const i of n)zo(t,e,i);else zo(t,e,n)}function zo(t,e,n){const i=t&&si(n)?n.resolve(t.doc):n;if(!Tr(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,t,Map);for(const[s,a]of r)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function wf(t,e,{key:n,value:i}){if(Xe(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if(jv(t,n))bf(t,e,i);else{const r=$t(n,"",t);if(e instanceof Map)e.set(r,$t(i,r,t));else if(e instanceof Set)e.add(r);else{const s=Bv(n,r,t),a=$t(i,s,t);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function Bv(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Xe(t)&&n?.doc){const i=vf(n.doc,{});i.anchors=new Set;for(const s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=t.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),yf(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}function gc(t,e,n){const i=br(t,void 0,n),r=br(e,void 0,n);return new wt(i,r)}class wt{constructor(e,n=null){Object.defineProperty(this,Kt,{value:lf}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return Xe(n)&&(n=n.clone(e)),Xe(i)&&(i=i.clone(e)),new wt(n,i)}toJSON(e,n){const i=n?.mapAsMap?new Map:{};return wf(n,i,this)}toString(e,n,i){return e?.doc?Rv(this,e,n,i):JSON.stringify(this)}}function xf(t,e,n){return(e.inFlow??t.flow?$v:Lv)(t,e,n)}function Lv({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:a,onComment:u}){const{indent:d,options:{commentString:g}}=n,v=Object.assign({},n,{indent:s,type:null});let b=!1;const w=[];for(let z=0;z<e.length;++z){const M=e[z];let K=null;if(Xe(M))!b&&M.spaceBefore&&w.push(""),Ns(n,w,M.commentBefore,b),M.comment&&(K=M.comment);else if(et(M)){const Y=Xe(M.key)?M.key:null;Y&&(!b&&Y.spaceBefore&&w.push(""),Ns(n,w,Y.commentBefore,b))}b=!1;let te=Ti(M,v,()=>K=null,()=>b=!0);K&&(te+=Qn(te,s,g(K))),b&&K&&(b=!1),w.push(i+te)}let j;if(w.length===0)j=r.start+r.end;else{j=w[0];for(let z=1;z<w.length;++z){const M=w[z];j+=M?`
|
|
94
|
-
${d}${M}`:`
|
|
95
|
-
`}}return t?(j+=`
|
|
96
|
-
`+un(g(t),d),u&&u()):b&&a&&a(),j}function $v({items:t},e,{flowChars:n,itemIndent:i}){const{indent:r,indentStep:s,flowCollectionPadding:a,options:{commentString:u}}=e;i+=s;const d=Object.assign({},e,{indent:i,inFlow:!0,type:null});let g=!1,v=0;const b=[];for(let z=0;z<t.length;++z){const M=t[z];let K=null;if(Xe(M))M.spaceBefore&&b.push(""),Ns(e,b,M.commentBefore,!1),M.comment&&(K=M.comment);else if(et(M)){const Y=Xe(M.key)?M.key:null;Y&&(Y.spaceBefore&&b.push(""),Ns(e,b,Y.commentBefore,!1),Y.comment&&(g=!0));const se=Xe(M.value)?M.value:null;se?(se.comment&&(K=se.comment),se.commentBefore&&(g=!0)):M.value==null&&Y?.comment&&(K=Y.comment)}K&&(g=!0);let te=Ti(M,d,()=>K=null);g||(g=b.length>v||te.includes(`
|
|
97
|
-
`)),z<t.length-1?te+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(g||(g=b.reduce((Y,se)=>Y+se.length+2,2)+(te.length+2)>e.options.lineWidth)),g&&(te+=",")),K&&(te+=Qn(te,i,u(K))),b.push(te),v=b.length}const{start:w,end:j}=n;if(b.length===0)return w+j;if(!g){const z=b.reduce((M,K)=>M+K.length+2,2);g=e.options.lineWidth>0&&z>e.options.lineWidth}if(g){let z=w;for(const M of b)z+=M?`
|
|
98
|
-
${s}${r}${M}`:`
|
|
99
|
-
`;return`${z}
|
|
100
|
-
${r}${j}`}else return`${w}${a}${b.join(" ")}${a}${j}`}function Ns({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=un(e(i),t);n.push(s.trimStart())}}function Xn(t,e){const n=De(e)?e.value:e;for(const i of t)if(et(i)&&(i.key===e||i.key===n||De(i.key)&&i.key.value===n))return i}class Bt extends gf{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Mn,e),this.items=[]}static from(e,n,i){const{keepUndefined:r,replacer:s}=i,a=new this(e),u=(d,g)=>{if(typeof s=="function")g=s.call(n,d,g);else if(Array.isArray(s)&&!s.includes(d))return;(g!==void 0||r)&&a.items.push(gc(d,g,i))};if(n instanceof Map)for(const[d,g]of n)u(d,g);else if(n&&typeof n=="object")for(const d of Object.keys(n))u(d,n[d]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,n){let i;et(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new wt(e,e?.value):i=new wt(e.key,e.value);const r=Xn(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);De(r.value)&&hf(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const a=this.items.findIndex(u=>s(i,u)<0);a===-1?this.items.push(i):this.items.splice(a,0,i)}else this.items.push(i)}delete(e){const n=Xn(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const r=Xn(this.items,e)?.value;return(!n&&De(r)?r.value:r)??void 0}has(e){return!!Xn(this.items,e)}set(e,n){this.add(new wt(e,n),!0)}toJSON(e,n,i){const r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(const s of this.items)wf(n,r,s);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(const r of this.items)if(!et(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),xf(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}}const Bi={collection:"map",default:!0,nodeClass:Bt,tag:"tag:yaml.org,2002:map",resolve(t,e){return Tr(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Bt.from(t,e,n)};class ni extends gf{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ri,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=ls(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const i=ls(e);if(typeof i!="number")return;const r=this.items[i];return!n&&De(r)?r.value:r}has(e){const n=ls(e);return typeof n=="number"&&n<this.items.length}set(e,n){const i=ls(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);const r=this.items[i];De(r)&&hf(n)?r.value=n:this.items[i]=n}toJSON(e,n){const i=[];n?.onCreate&&n.onCreate(i);let r=0;for(const s of this.items)i.push($t(s,String(r++),n));return i}toString(e,n,i){return e?xf(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){const{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n)){let a=0;for(let u of n){if(typeof r=="function"){const d=n instanceof Set?u:String(a++);u=r.call(n,d,u)}s.items.push(br(u,void 0,i))}}return s}}function ls(t){let e=De(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const Li={collection:"seq",default:!0,nodeClass:ni,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Nr(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>ni.from(t,e,n)},Xs={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),hc(t,e,n,i)}},Zs={identify:t=>t==null,createNode:()=>new we(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new we(null),stringify:({source:t},e)=>typeof t=="string"&&Zs.test.test(t)?t:e.options.nullStr},mc={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new we(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&mc.test.test(t)){const i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};function Yt({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let u=e-(s.length-a-1);for(;u-- >0;)s+="0"}return s}const Sf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Yt},kf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():Yt(t)}},_f={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new we(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Yt},eo=t=>typeof t=="bigint"||Number.isInteger(t),vc=(t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n);function Cf(t,e,n){const{value:i}=t;return eo(i)&&i>=0?n+i.toString(e):Yt(t)}const Ef={identify:t=>eo(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>vc(t,2,8,n),stringify:t=>Cf(t,8,"0o")},If={identify:eo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>vc(t,0,10,n),stringify:Yt},Pf={identify:t=>eo(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>vc(t,2,16,n),stringify:t=>Cf(t,16,"0x")},Fv=[Bi,Li,Xs,Zs,mc,Ef,If,Pf,Sf,kf,_f];function Rl(t){return typeof t=="bigint"||Number.isInteger(t)}const us=({value:t})=>JSON.stringify(t),Dv=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:us},{identify:t=>t==null,createNode:()=>new we(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:us},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:us},{identify:Rl,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Rl(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:us}],Uv={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Kv=[Bi,Li].concat(Dv,Uv),yc={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){const n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,s){if(!n)return"";const a=n;let u;if(typeof btoa=="function"){let d="";for(let g=0;g<a.length;++g)d+=String.fromCharCode(a[g]);u=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=we.BLOCK_LITERAL),e!==we.QUOTE_DOUBLE){const d=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),g=Math.ceil(u.length/d),v=new Array(g);for(let b=0,w=0;b<g;++b,w+=d)v[b]=u.substr(w,d);u=v.join(e===we.BLOCK_LITERAL?`
|
|
101
|
-
`:" ")}return hc({comment:t,type:e,value:u},i,r,s)}};function Af(t,e){if(Nr(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!et(i)){if(Tr(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");const r=i.items[0]||new wt(new we(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
102
|
-
${r.key.commentBefore}`:i.commentBefore),i.comment){const s=r.value??r.key;s.comment=s.comment?`${i.comment}
|
|
103
|
-
${s.comment}`:i.comment}i=r}t.items[n]=et(i)?i:new wt(i)}}else e("Expected a sequence for this tag");return t}function Of(t,e,n){const{replacer:i}=n,r=new ni(t);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof i=="function"&&(a=i.call(e,String(s++),a));let u,d;if(Array.isArray(a))if(a.length===2)u=a[0],d=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const g=Object.keys(a);if(g.length===1)u=g[0],d=a[u];else throw new TypeError(`Expected tuple with one key, not ${g.length} keys`)}else u=a;r.items.push(gc(u,d,n))}return r}const bc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Af,createNode:Of};class Ai extends ni{constructor(){super(),this.add=Bt.prototype.add.bind(this),this.delete=Bt.prototype.delete.bind(this),this.get=Bt.prototype.get.bind(this),this.has=Bt.prototype.has.bind(this),this.set=Bt.prototype.set.bind(this),this.tag=Ai.tag}toJSON(e,n){if(!n)return super.toJSON(e);const i=new Map;n?.onCreate&&n.onCreate(i);for(const r of this.items){let s,a;if(et(r)?(s=$t(r.key,"",n),a=$t(r.value,s,n)):s=$t(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,a)}return i}static from(e,n,i){const r=Of(e,n,i),s=new this;return s.items=r.items,s}}Ai.tag="tag:yaml.org,2002:omap";const wc={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ai,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=Af(t,e),i=[];for(const{key:r}of n.items)De(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Ai,n)},createNode:(t,e,n)=>Ai.from(t,e,n)};function Tf({value:t,source:e},n){return e&&(t?Nf:Mf).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Nf={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new we(!0),stringify:Tf},Mf={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new we(!1),stringify:Tf},qv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Yt},Vv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():Yt(t)}},zv={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new we(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){const i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Yt},Mr=t=>typeof t=="bigint"||Number.isInteger(t);function to(t,e,n,{intAsBigInt:i}){const r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const a=BigInt(t);return r==="-"?BigInt(-1)*a:a}const s=parseInt(t,n);return r==="-"?-1*s:s}function xc(t,e,n){const{value:i}=t;if(Mr(i)){const r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return Yt(t)}const Wv={identify:Mr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>to(t,2,2,n),stringify:t=>xc(t,2,"0b")},Hv={identify:Mr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>to(t,1,8,n),stringify:t=>xc(t,8,"0")},Gv={identify:Mr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>to(t,0,10,n),stringify:Yt},Yv={identify:Mr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>to(t,2,16,n),stringify:t=>xc(t,16,"0x")};class Oi extends Bt{constructor(e){super(e),this.tag=Oi.tag}add(e){let n;et(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new wt(e.key,null):n=new wt(e,null),Xn(this.items,n.key)||this.items.push(n)}get(e,n){const i=Xn(this.items,e);return!n&&et(i)?De(i.key)?i.key.value:i.key:i}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=Xn(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new wt(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){const{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof r=="function"&&(a=r.call(n,a,a)),s.items.push(gc(a,null,i));return s}}Oi.tag="tag:yaml.org,2002:set";const Sc={collection:"map",identify:t=>t instanceof Set,nodeClass:Oi,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Oi.from(t,e,n),resolve(t,e){if(Tr(t)){if(t.hasAllNullValues(!0))return Object.assign(new Oi,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function kc(t,e){const n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=a=>e?BigInt(a):Number(a),s=i.replace(/_/g,"").split(":").reduce((a,u)=>a*r(60)+r(u),r(0));return n==="-"?r(-1)*s:s}function Rf(t){let{value:e}=t,n=a=>a;if(typeof e=="bigint")n=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return Yt(t);let i="";e<0&&(i="-",e*=n(-1));const r=n(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const jf={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>kc(t,n),stringify:Rf},Bf={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>kc(t,!1),stringify:Rf},no={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const e=t.match(no.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,a,u]=e.map(Number),d=e[7]?Number((e[7]+"00").substr(1,3)):0;let g=Date.UTC(n,i-1,r,s||0,a||0,u||0,d);const v=e[8];if(v&&v!=="Z"){let b=kc(v,!1);Math.abs(b)<30&&(b*=60),g-=6e4*b}return new Date(g)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},jl=[Bi,Li,Xs,Zs,Nf,Mf,Wv,Hv,Gv,Yv,qv,Vv,zv,yc,pn,wc,bc,Sc,jf,Bf,no],Bl=new Map([["core",Fv],["failsafe",[Bi,Li,Xs]],["json",Kv],["yaml11",jl],["yaml-1.1",jl]]),Ll={binary:yc,bool:mc,float:_f,floatExp:kf,floatNaN:Sf,floatTime:Bf,int:If,intHex:Pf,intOct:Ef,intTime:jf,map:Bi,merge:pn,null:Zs,omap:wc,pairs:bc,seq:Li,set:Sc,timestamp:no},Jv={"tag:yaml.org,2002:binary":yc,"tag:yaml.org,2002:merge":pn,"tag:yaml.org,2002:omap":wc,"tag:yaml.org,2002:pairs":bc,"tag:yaml.org,2002:set":Sc,"tag:yaml.org,2002:timestamp":no};function Wo(t,e,n){const i=Bl.get(e);if(i&&!t)return n&&!i.includes(pn)?i.concat(pn):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{const s=Array.from(Bl.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(const s of t)r=r.concat(s);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(pn)),r.reduce((s,a)=>{const u=typeof a=="string"?Ll[a]:a;if(!u){const d=JSON.stringify(a),g=Object.keys(Ll).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${g}`)}return s.includes(u)||s.push(u),s},[])}const Qv=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0;class _c{constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:a,toStringDefaults:u}){this.compat=Array.isArray(e)?Wo(e,"compat"):e?Wo(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?Jv:{},this.tags=Wo(n,this.name,i),this.toStringOptions=u??null,Object.defineProperty(this,Mn,{value:Bi}),Object.defineProperty(this,nn,{value:Xs}),Object.defineProperty(this,Ri,{value:Li}),this.sortMapEntries=typeof a=="function"?a:a===!0?Qv:null}clone(){const e=Object.create(_c.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Xv(t,e){const n=[];let i=e.directives===!0;if(e.directives!==!1&&t.directives){const d=t.directives.toString(t);d?(n.push(d),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");const r=vf(t,e),{commentString:s}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");const d=s(t.commentBefore);n.unshift(un(d,""))}let a=!1,u=null;if(t.contents){if(Xe(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){const v=s(t.contents.commentBefore);n.push(un(v,""))}r.forceBlockIndent=!!t.comment,u=t.contents.comment}const d=u?void 0:()=>a=!0;let g=Ti(t.contents,r,()=>u=null,d);u&&(g+=Qn(g,"",s(u))),(g[0]==="|"||g[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${g}`:n.push(g)}else n.push(Ti(t.contents,r));if(t.directives?.docEnd)if(t.comment){const d=s(t.comment);d.includes(`
|
|
104
|
-
`)?(n.push("..."),n.push(un(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=t.comment;d&&a&&(d=d.replace(/^\n+/,"")),d&&((!a||u)&&n[n.length-1]!==""&&n.push(""),n.push(un(s(d),"")))}return n.join(`
|
|
105
|
-
`)+`
|
|
106
|
-
`}class Rr{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Kt,{value:ka});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:a}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new bt({version:a}),this.setSchema(a,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){const e=Object.create(Rr.prototype,{[Kt]:{value:ka}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Xe(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){bi(this.contents)&&this.contents.add(e)}addIn(e,n){bi(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){const i=df(this);e.anchor=!n||i.has(n)?pf(n||"a",i):n}return new pc(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){const K=Y=>typeof Y=="number"||Y instanceof String||Y instanceof Number,te=n.filter(K).map(String);te.length>0&&(n=n.concat(te)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:a,flow:u,keepUndefined:d,onTagObj:g,tag:v}=i??{},{onAnchor:b,setAnchors:w,sourceObjects:j}=Ev(this,a||"a"),z={aliasDuplicateObjects:s??!0,keepUndefined:d??!1,onAnchor:b,onTagObj:g,replacer:r,schema:this.schema,sourceObjects:j},M=br(e,v,z);return u&&Qe(M)&&(M.flow=!0),w(),M}createPair(e,n,i={}){const r=this.createNode(e,null,i),s=this.createNode(n,null,i);return new wt(r,s)}delete(e){return bi(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Xi(e)?this.contents==null?!1:(this.contents=null,!0):bi(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Qe(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Xi(e)?!n&&De(this.contents)?this.contents.value:this.contents:Qe(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Qe(this.contents)?this.contents.has(e):!1}hasIn(e){return Xi(e)?this.contents!==void 0:Qe(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Ts(this.schema,[e],n):bi(this.contents)&&this.contents.set(e,n)}setIn(e,n){Xi(e)?this.contents=n:this.contents==null?this.contents=Ts(this.schema,Array.from(e),n):bi(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new bt({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new bt({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new _c(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:a}={}){const u={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},d=$t(this.contents,n??"",u);if(typeof s=="function")for(const{count:g,res:v}of u.anchors.values())s(v,g);return typeof a=="function"?Ci(a,{"":d},"",d):d}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Xv(this,e)}}function bi(t){if(Qe(t))return!0;throw new Error("Expected a YAML collection as document contents")}class Lf extends Error{constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}}class Zi extends Lf{constructor(e,n,i){super("YAMLParseError",e,n,i)}}class Zv extends Lf{constructor(e,n,i){super("YAMLWarning",e,n,i)}}const $l=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(u=>e.linePos(u));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,a=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){const u=Math.min(s-39,a.length-79);a="…"+a.substring(u),s-=u-1}if(a.length>80&&(a=a.substring(0,79)+"…"),i>1&&/^ *$/.test(a.substring(0,s))){let u=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);u.length>80&&(u=u.substring(0,79)+`…
|
|
107
|
-
`),a=u+a}if(/[^ ]/.test(a)){let u=1;const d=n.linePos[1];d?.line===i&&d.col>r&&(u=Math.max(1,Math.min(d.col-r,80-s)));const g=" ".repeat(s)+"^".repeat(u);n.message+=`:
|
|
108
|
-
|
|
109
|
-
${a}
|
|
110
|
-
${g}
|
|
111
|
-
`}};function Ni(t,{flow:e,indicator:n,next:i,offset:r,onError:s,parentIndent:a,startOnNewline:u}){let d=!1,g=u,v=u,b="",w="",j=!1,z=!1,M=null,K=null,te=null,Y=null,se=null,J=null,ie=null;for(const G of t)switch(z&&(G.type!=="space"&&G.type!=="newline"&&G.type!=="comma"&&s(G.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),z=!1),M&&(g&&G.type!=="comment"&&G.type!=="newline"&&s(M,"TAB_AS_INDENT","Tabs are not allowed as indentation"),M=null),G.type){case"space":!e&&(n!=="doc-start"||i?.type!=="flow-collection")&&G.source.includes(" ")&&(M=G),v=!0;break;case"comment":{v||s(G,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const ge=G.source.substring(1)||" ";b?b+=w+ge:b=ge,w="",g=!1;break}case"newline":g?b?b+=G.source:(!J||n!=="seq-item-ind")&&(d=!0):w+=G.source,g=!0,j=!0,(K||te)&&(Y=G),v=!0;break;case"anchor":K&&s(G,"MULTIPLE_ANCHORS","A node can have at most one anchor"),G.source.endsWith(":")&&s(G.offset+G.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),K=G,ie??(ie=G.offset),g=!1,v=!1,z=!0;break;case"tag":{te&&s(G,"MULTIPLE_TAGS","A node can have at most one tag"),te=G,ie??(ie=G.offset),g=!1,v=!1,z=!0;break}case n:(K||te)&&s(G,"BAD_PROP_ORDER",`Anchors and tags must be after the ${G.source} indicator`),J&&s(G,"UNEXPECTED_TOKEN",`Unexpected ${G.source} in ${e??"collection"}`),J=G,g=n==="seq-item-ind"||n==="explicit-key-ind",v=!1;break;case"comma":if(e){se&&s(G,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),se=G,g=!1,v=!1;break}default:s(G,"UNEXPECTED_TOKEN",`Unexpected ${G.type} token`),g=!1,v=!1}const ue=t[t.length-1],pe=ue?ue.offset+ue.source.length:r;return z&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),M&&(g&&M.indent<=a||i?.type==="block-map"||i?.type==="block-seq")&&s(M,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:se,found:J,spaceBefore:d,comment:b,hasNewline:j,anchor:K,tag:te,newlineAfterProp:Y,end:pe,start:ie??pe}}function wr(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
112
|
-
`))return!0;if(t.end){for(const e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of t.items){for(const n of e.start)if(n.type==="newline")return!0;if(e.sep){for(const n of e.sep)if(n.type==="newline")return!0}if(wr(e.key)||wr(e.value))return!0}return!1;default:return!0}}function Ia(t,e,n){if(e?.type==="flow-collection"){const i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&wr(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function $f(t,e,n){const{uniqueKeys:i}=t.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,a)=>s===a||De(s)&&De(a)&&s.value===a.value;return e.some(s=>r(s.key,n))}const Fl="All mapping items must start at the same column";function ey({composeNode:t,composeEmptyNode:e},n,i,r,s){const a=s?.nodeClass??Bt,u=new a(n.schema);n.atRoot&&(n.atRoot=!1);let d=i.offset,g=null;for(const v of i.items){const{start:b,key:w,sep:j,value:z}=v,M=Ni(b,{indicator:"explicit-key-ind",next:w??j?.[0],offset:d,onError:r,parentIndent:i.indent,startOnNewline:!0}),K=!M.found;if(K){if(w&&(w.type==="block-seq"?r(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in w&&w.indent!==i.indent&&r(d,"BAD_INDENT",Fl)),!M.anchor&&!M.tag&&!j){g=M.end,M.comment&&(u.comment?u.comment+=`
|
|
113
|
-
`+M.comment:u.comment=M.comment);continue}(M.newlineAfterProp||wr(w))&&r(w??b[b.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else M.found?.indent!==i.indent&&r(d,"BAD_INDENT",Fl);n.atKey=!0;const te=M.end,Y=w?t(n,w,M,r):e(n,te,b,null,M,r);n.schema.compat&&Ia(i.indent,w,r),n.atKey=!1,$f(n,u.items,Y)&&r(te,"DUPLICATE_KEY","Map keys must be unique");const se=Ni(j??[],{indicator:"map-value-ind",next:z,offset:Y.range[2],onError:r,parentIndent:i.indent,startOnNewline:!w||w.type==="block-scalar"});if(d=se.end,se.found){K&&(z?.type==="block-map"&&!se.hasNewline&&r(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&M.start<se.found.offset-1024&&r(Y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const J=z?t(n,z,se,r):e(n,d,j,null,se,r);n.schema.compat&&Ia(i.indent,z,r),d=J.range[2];const ie=new wt(Y,J);n.options.keepSourceTokens&&(ie.srcToken=v),u.items.push(ie)}else{K&&r(Y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),se.comment&&(Y.comment?Y.comment+=`
|
|
114
|
-
`+se.comment:Y.comment=se.comment);const J=new wt(Y);n.options.keepSourceTokens&&(J.srcToken=v),u.items.push(J)}}return g&&g<d&&r(g,"IMPOSSIBLE","Map comment with trailing content"),u.range=[i.offset,d,g??d],u}function ty({composeNode:t,composeEmptyNode:e},n,i,r,s){const a=s?.nodeClass??ni,u=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=i.offset,g=null;for(const{start:v,value:b}of i.items){const w=Ni(v,{indicator:"seq-item-ind",next:b,offset:d,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!w.found)if(w.anchor||w.tag||b)b?.type==="block-seq"?r(w.end,"BAD_INDENT","All sequence items must start at the same column"):r(d,"MISSING_CHAR","Sequence item without - indicator");else{g=w.end,w.comment&&(u.comment=w.comment);continue}const j=b?t(n,b,w,r):e(n,w.end,v,null,w,r);n.schema.compat&&Ia(i.indent,b,r),d=j.range[2],u.items.push(j)}return u.range=[i.offset,d,g??d],u}function jr(t,e,n,i){let r="";if(t){let s=!1,a="";for(const u of t){const{source:d,type:g}=u;switch(g){case"space":s=!0;break;case"comment":{n&&!s&&i(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=d.substring(1)||" ";r?r+=a+v:r=v,a="";break}case"newline":r&&(a+=d),s=!0;break;default:i(u,"UNEXPECTED_TOKEN",`Unexpected ${g} at node end`)}e+=d.length}}return{comment:r,offset:e}}const Ho="Block collections are not allowed within flow collections",Go=t=>t&&(t.type==="block-map"||t.type==="block-seq");function ny({composeNode:t,composeEmptyNode:e},n,i,r,s){const a=i.start.source==="{",u=a?"flow map":"flow sequence",d=s?.nodeClass??(a?Bt:ni),g=new d(n.schema);g.flow=!0;const v=n.atRoot;v&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let b=i.offset+i.start.source.length;for(let K=0;K<i.items.length;++K){const te=i.items[K],{start:Y,key:se,sep:J,value:ie}=te,ue=Ni(Y,{flow:u,indicator:"explicit-key-ind",next:se??J?.[0],offset:b,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!ue.found){if(!ue.anchor&&!ue.tag&&!J&&!ie){K===0&&ue.comma?r(ue.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):K<i.items.length-1&&r(ue.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),ue.comment&&(g.comment?g.comment+=`
|
|
115
|
-
`+ue.comment:g.comment=ue.comment),b=ue.end;continue}!a&&n.options.strict&&wr(se)&&r(se,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(K===0)ue.comma&&r(ue.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(ue.comma||r(ue.start,"MISSING_CHAR",`Missing , between ${u} items`),ue.comment){let pe="";e:for(const G of Y)switch(G.type){case"comma":case"space":break;case"comment":pe=G.source.substring(1);break e;default:break e}if(pe){let G=g.items[g.items.length-1];et(G)&&(G=G.value??G.key),G.comment?G.comment+=`
|
|
116
|
-
`+pe:G.comment=pe,ue.comment=ue.comment.substring(pe.length+1)}}if(!a&&!J&&!ue.found){const pe=ie?t(n,ie,ue,r):e(n,ue.end,J,null,ue,r);g.items.push(pe),b=pe.range[2],Go(ie)&&r(pe.range,"BLOCK_IN_FLOW",Ho)}else{n.atKey=!0;const pe=ue.end,G=se?t(n,se,ue,r):e(n,pe,Y,null,ue,r);Go(se)&&r(G.range,"BLOCK_IN_FLOW",Ho),n.atKey=!1;const ge=Ni(J??[],{flow:u,indicator:"map-value-ind",next:ie,offset:G.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(ge.found){if(!a&&!ue.found&&n.options.strict){if(J)for(const _e of J){if(_e===ge.found)break;if(_e.type==="newline"){r(_e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}ue.start<ge.found.offset-1024&&r(ge.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else ie&&("source"in ie&&ie.source?.[0]===":"?r(ie,"MISSING_CHAR",`Missing space after : in ${u}`):r(ge.start,"MISSING_CHAR",`Missing , or : between ${u} items`));const je=ie?t(n,ie,ge,r):ge.found?e(n,ge.end,J,null,ge,r):null;je?Go(ie)&&r(je.range,"BLOCK_IN_FLOW",Ho):ge.comment&&(G.comment?G.comment+=`
|
|
117
|
-
`+ge.comment:G.comment=ge.comment);const We=new wt(G,je);if(n.options.keepSourceTokens&&(We.srcToken=te),a){const _e=g;$f(n,_e.items,G)&&r(pe,"DUPLICATE_KEY","Map keys must be unique"),_e.items.push(We)}else{const _e=new Bt(n.schema);_e.flow=!0,_e.items.push(We);const rt=(je??G).range;_e.range=[G.range[0],rt[1],rt[2]],g.items.push(_e)}b=je?je.range[2]:ge.end}}const w=a?"}":"]",[j,...z]=i.end;let M=b;if(j?.source===w)M=j.offset+j.source.length;else{const K=u[0].toUpperCase()+u.substring(1),te=v?`${K} must end with a ${w}`:`${K} in block collection must be sufficiently indented and end with a ${w}`;r(b,v?"MISSING_CHAR":"BAD_INDENT",te),j&&j.source.length!==1&&z.unshift(j)}if(z.length>0){const K=jr(z,M,n.options.strict,r);K.comment&&(g.comment?g.comment+=`
|
|
118
|
-
`+K.comment:g.comment=K.comment),g.range=[i.offset,M,K.offset]}else g.range=[i.offset,M,M];return g}function Yo(t,e,n,i,r,s){const a=n.type==="block-map"?ey(t,e,n,i,s):n.type==="block-seq"?ty(t,e,n,i,s):ny(t,e,n,i,s),u=a.constructor;return r==="!"||r===u.tagName?(a.tag=u.tagName,a):(r&&(a.tag=r),a)}function iy(t,e,n,i,r){const s=i.tag,a=s?e.directives.tagName(s.source,w=>r(s,"TAG_RESOLVE_FAILED",w)):null;if(n.type==="block-seq"){const{anchor:w,newlineAfterProp:j}=i,z=w&&s?w.offset>s.offset?w:s:w??s;z&&(!j||j.offset<z.offset)&&r(z,"MISSING_CHAR","Missing newline after block sequence props")}const u=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===Bt.tagName&&u==="map"||a===ni.tagName&&u==="seq")return Yo(t,e,n,r,a);let d=e.schema.tags.find(w=>w.tag===a&&w.collection===u);if(!d){const w=e.schema.knownTags[a];if(w?.collection===u)e.schema.tags.push(Object.assign({},w,{default:!1})),d=w;else return w?r(s,"BAD_COLLECTION_TYPE",`${w.tag} used for ${u} collection, but expects ${w.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Yo(t,e,n,r,a)}const g=Yo(t,e,n,r,a,d),v=d.resolve?.(g,w=>r(s,"TAG_RESOLVE_FAILED",w),e.options)??g,b=Xe(v)?v:new we(v);return b.range=g.range,b.tag=a,d?.format&&(b.format=d.format),b}function ry(t,e,n){const i=e.offset,r=sy(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?we.BLOCK_FOLDED:we.BLOCK_LITERAL,a=e.source?oy(e.source):[];let u=a.length;for(let M=a.length-1;M>=0;--M){const K=a[M][1];if(K===""||K==="\r")u=M;else break}if(u===0){const M=r.chomp==="+"&&a.length>0?`
|
|
119
|
-
`.repeat(Math.max(1,a.length-1)):"";let K=i+r.length;return e.source&&(K+=e.source.length),{value:M,type:s,comment:r.comment,range:[i,K,K]}}let d=e.indent+r.indent,g=e.offset+r.length,v=0;for(let M=0;M<u;++M){const[K,te]=a[M];if(te===""||te==="\r")r.indent===0&&K.length>d&&(d=K.length);else{K.length<d&&n(g+K.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(d=K.length),v=M,d===0&&!t.atRoot&&n(g,"BAD_INDENT","Block scalar values in collections must be indented");break}g+=K.length+te.length+1}for(let M=a.length-1;M>=u;--M)a[M][0].length>d&&(u=M+1);let b="",w="",j=!1;for(let M=0;M<v;++M)b+=a[M][0].slice(d)+`
|
|
120
|
-
`;for(let M=v;M<u;++M){let[K,te]=a[M];g+=K.length+te.length+1;const Y=te[te.length-1]==="\r";if(Y&&(te=te.slice(0,-1)),te&&K.length<d){const J=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(g-te.length-(Y?2:1),"BAD_INDENT",J),K=""}s===we.BLOCK_LITERAL?(b+=w+K.slice(d)+te,w=`
|
|
121
|
-
`):K.length>d||te[0]===" "?(w===" "?w=`
|
|
122
|
-
`:!j&&w===`
|
|
123
|
-
`&&(w=`
|
|
124
|
-
|
|
125
|
-
`),b+=w+K.slice(d)+te,w=`
|
|
126
|
-
`,j=!0):te===""?w===`
|
|
127
|
-
`?b+=`
|
|
128
|
-
`:w=`
|
|
129
|
-
`:(b+=w+te,w=" ",j=!1)}switch(r.chomp){case"-":break;case"+":for(let M=u;M<a.length;++M)b+=`
|
|
130
|
-
`+a[M][0].slice(d);b[b.length-1]!==`
|
|
131
|
-
`&&(b+=`
|
|
132
|
-
`);break;default:b+=`
|
|
133
|
-
`}const z=i+r.length+e.source.length;return{value:b,type:s,comment:r.comment,range:[i,z,z]}}function sy({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=e[0],s=r[0];let a=0,u="",d=-1;for(let w=1;w<r.length;++w){const j=r[w];if(!u&&(j==="-"||j==="+"))u=j;else{const z=Number(j);!a&&z?a=z:d===-1&&(d=t+w)}}d!==-1&&i(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let g=!1,v="",b=r.length;for(let w=1;w<e.length;++w){const j=e[w];switch(j.type){case"space":g=!0;case"newline":b+=j.source.length;break;case"comment":n&&!g&&i(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),b+=j.source.length,v=j.source.substring(1);break;case"error":i(j,"UNEXPECTED_TOKEN",j.message),b+=j.source.length;break;default:{const z=`Unexpected token in block scalar header: ${j.type}`;i(j,"UNEXPECTED_TOKEN",z);const M=j.source;M&&typeof M=="string"&&(b+=M.length)}}}return{mode:s,indent:a,chomp:u,comment:v,length:b}}function oy(t){const e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),s=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let a=1;a<e.length;a+=2)s.push([e[a],e[a+1]]);return s}function ay(t,e,n){const{offset:i,type:r,source:s,end:a}=t;let u,d;const g=(w,j,z)=>n(i+w,j,z);switch(r){case"scalar":u=we.PLAIN,d=cy(s,g);break;case"single-quoted-scalar":u=we.QUOTE_SINGLE,d=ly(s,g);break;case"double-quoted-scalar":u=we.QUOTE_DOUBLE,d=uy(s,g);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const v=i+s.length,b=jr(a,v,e,n);return{value:d,type:u,comment:b.comment,range:[i,v,b.offset]}}function cy(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Ff(t)}function ly(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Ff(t.slice(1,-1)).replace(/''/g,"'")}function Ff(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
134
|
-
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
135
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let r=i[1],s=" ",a=e.lastIndex;for(n.lastIndex=a;i=n.exec(t);)i[1]===""?s===`
|
|
136
|
-
`?r+=s:s=`
|
|
137
|
-
`:(r+=s+i[1],s=" "),a=n.lastIndex;const u=/[ \t]*(.*)/sy;return u.lastIndex=a,i=u.exec(t),r+s+(i?.[1]??"")}function uy(t,e){let n="";for(let i=1;i<t.length-1;++i){const r=t[i];if(!(r==="\r"&&t[i+1]===`
|
|
138
|
-
`))if(r===`
|
|
139
|
-
`){const{fold:s,offset:a}=fy(t,i);n+=s,i=a}else if(r==="\\"){let s=t[++i];const a=dy[s];if(a)n+=a;else if(s===`
|
|
140
|
-
`)for(s=t[i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="\r"&&t[i+1]===`
|
|
141
|
-
`)for(s=t[++i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="x"||s==="u"||s==="U"){const u={x:2,u:4,U:8}[s];n+=py(t,i+1,u,e),i+=u}else{const u=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),n+=u}}else if(r===" "||r===" "){const s=i;let a=t[i+1];for(;a===" "||a===" ";)a=t[++i+1];a!==`
|
|
142
|
-
`&&!(a==="\r"&&t[i+2]===`
|
|
143
|
-
`)&&(n+=i>s?t.slice(s,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function fy(t,e){let n="",i=t[e+1];for(;(i===" "||i===" "||i===`
|
|
144
|
-
`||i==="\r")&&!(i==="\r"&&t[e+2]!==`
|
|
145
|
-
`);)i===`
|
|
146
|
-
`&&(n+=`
|
|
147
|
-
`),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}const dy={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
148
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function py(t,e,n,i){const r=t.substr(e,n),a=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(a)){const u=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}return String.fromCodePoint(a)}function Df(t,e,n,i){const{value:r,type:s,comment:a,range:u}=e.type==="block-scalar"?ry(t,e,i):ay(e,t.options.strict,i),d=n?t.directives.tagName(n.source,b=>i(n,"TAG_RESOLVE_FAILED",b)):null;let g;t.options.stringKeys&&t.atKey?g=t.schema[nn]:d?g=hy(t.schema,r,d,n,i):e.type==="scalar"?g=gy(t,r,e,i):g=t.schema[nn];let v;try{const b=g.resolve(r,w=>i(n??e,"TAG_RESOLVE_FAILED",w),t.options);v=De(b)?b:new we(b)}catch(b){const w=b instanceof Error?b.message:String(b);i(n??e,"TAG_RESOLVE_FAILED",w),v=new we(r)}return v.range=u,v.source=r,s&&(v.type=s),d&&(v.tag=d),g.format&&(v.format=g.format),a&&(v.comment=a),v}function hy(t,e,n,i,r){if(n==="!")return t[nn];const s=[];for(const u of t.tags)if(!u.collection&&u.tag===n)if(u.default&&u.test)s.push(u);else return u;for(const u of s)if(u.test?.test(e))return u;const a=t.knownTags[n];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[nn])}function gy({atKey:t,directives:e,schema:n},i,r,s){const a=n.tags.find(u=>(u.default===!0||t&&u.default==="key")&&u.test?.test(i))||n[nn];if(n.compat){const u=n.compat.find(d=>d.default&&d.test?.test(i))??n[nn];if(a.tag!==u.tag){const d=e.tagString(a.tag),g=e.tagString(u.tag),v=`Value may be parsed as either ${d} or ${g}`;s(r,"TAG_RESOLVE_FAILED",v,!0)}}return a}function my(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}const vy={composeNode:Uf,composeEmptyNode:Cc};function Uf(t,e,n,i){const r=t.atKey,{spaceBefore:s,comment:a,anchor:u,tag:d}=n;let g,v=!0;switch(e.type){case"alias":g=yy(t,e,i),(u||d)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":g=Df(t,e,d,i),u&&(g.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{g=iy(vy,t,e,n,i),u&&(g.anchor=u.source.substring(1))}catch(b){const w=b instanceof Error?b.message:String(b);i(e,"RESOURCE_EXHAUSTION",w)}break;default:{const b=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",b),v=!1}}return g??(g=Cc(t,e.offset,void 0,null,n,i)),u&&g.anchor===""&&i(u,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!De(g)||typeof g.value!="string"||g.tag&&g.tag!=="tag:yaml.org,2002:str")&&i(d??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(g.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?g.comment=a:g.commentBefore=a),t.options.keepSourceTokens&&v&&(g.srcToken=e),g}function Cc(t,e,n,i,{spaceBefore:r,comment:s,anchor:a,tag:u,end:d},g){const v={type:"scalar",offset:my(e,n,i),indent:-1,source:""},b=Df(t,v,u,g);return a&&(b.anchor=a.source.substring(1),b.anchor===""&&g(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(b.spaceBefore=!0),s&&(b.comment=s,b.range[2]=d),b}function yy({options:t},{offset:e,source:n,end:i},r){const s=new pc(n.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=e+n.length,u=jr(i,a,t.strict,r);return s.range=[e,a,u.offset],u.comment&&(s.comment=u.comment),s}function by(t,e,{offset:n,start:i,value:r,end:s},a){const u=Object.assign({_directives:e},t),d=new Rr(void 0,u),g={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},v=Ni(i,{indicator:"doc-start",next:r??s?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:!0});v.found&&(d.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!v.hasNewline&&a(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=r?Uf(g,r,v,a):Cc(g,v.end,i,null,v,a);const b=d.contents.range[2],w=jr(s,b,!1,a);return w.comment&&(d.comment=w.comment),d.range=[n,b,w.offset],d}function Yi(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Dl(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){const s=t[r];switch(s[0]){case"#":e+=(e===""?"":i?`
|
|
149
|
-
|
|
150
|
-
`:`
|
|
151
|
-
`)+(s.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}class wy{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{const a=Yi(n);s?this.warnings.push(new Zv(a,i,r)):this.errors.push(new Zi(a,i,r))},this.directives=new bt({version:e.version||"1.2"}),this.options=e}decorate(e,n){const{comment:i,afterEmptyLine:r}=Dl(this.prelude);if(i){const s=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
152
|
-
${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(Qe(s)&&!s.flow&&s.items.length>0){let a=s.items[0];et(a)&&(a=a.key);const u=a.commentBefore;a.commentBefore=u?`${i}
|
|
153
|
-
${u}`:i}else{const a=s.commentBefore;s.commentBefore=a?`${i}
|
|
154
|
-
${a}`:i}}n?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Dl(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,i=-1){for(const r of e)yield*this.next(r);yield*this.end(n,i)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,i,r)=>{const s=Yi(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const n=by(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new Zi(Yi(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new Zi(Yi(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=jr(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i}
|
|
155
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Zi(Yi(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const i=Object.assign({_directives:this.directives},this.options),r=new Rr(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}}const Kf="\uFEFF",qf="",Vf="",Pa="";function xy(t){switch(t){case Kf:return"byte-order-mark";case qf:return"doc-mode";case Vf:return"flow-error-end";case Pa:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
156
|
-
`:case`\r
|
|
157
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function zt(t){switch(t){case void 0:case" ":case`
|
|
158
|
-
`:case"\r":case" ":return!0;default:return!1}}const Ul=new Set("0123456789ABCDEFabcdef"),Sy=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),fs=new Set(",[]{}"),ky=new Set(` ,[]{}
|
|
159
|
-
\r `),Jo=t=>!t||ky.has(t);class _y{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
|
|
160
|
-
`?!0:n==="\r"?this.buffer[e+1]===`
|
|
161
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+e];if(n==="\r"){const r=this.buffer[i+e+1];if(r===`
|
|
162
|
-
`||!r&&!this.atEnd)return e+i+1}return n===`
|
|
163
|
-
`||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&zt(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
164
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Kf&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,i=e.indexOf("#");for(;i!==-1;){const s=e[i-1];if(s===" "||s===" "){n=i-1;break}else i=e.indexOf("#",i+1)}for(;;){const s=e[n-1];if(s===" "||s===" ")n-=1;else break}const r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield qf,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&zt(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!zt(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&zt(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Jo),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,i=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&zt(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Vf,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Jo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||zt(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}const i=this.buffer.substring(0,n);let r=i.indexOf(`
|
|
165
|
-
`,this.pos);if(r!==-1){for(;r!==-1;){const s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
|
|
166
|
-
`,s)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>zt(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case`
|
|
167
|
-
`:e=s,n=0;break;case"\r":{const a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
168
|
-
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
169
|
-
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
170
|
-
`;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);const u=s;for(;a===" ";)a=this.buffer[--s];if(a===`
|
|
171
|
-
`&&s>=this.pos&&s+1+n>u)e=s;else break}while(!0);return yield Pa,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const s=this.buffer[i+1];if(zt(s)||e&&fs.has(s))break;n=i}else if(zt(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
|
|
172
|
-
`?(i+=1,r=`
|
|
173
|
-
`,s=this.buffer[i+1]):n=i),s==="#"||e&&fs.has(s))break;if(r===`
|
|
174
|
-
`){const a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(e&&fs.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Pa,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){const i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Jo))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,n=this.charAt(1);if(zt(n)||e&&fs.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!zt(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Sy.has(n))n=this.buffer[++e];else if(n==="%"&&Ul.has(this.buffer[e+1])&&Ul.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
175
|
-
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
176
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||e&&i===" ");const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class Cy{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,i=this.lineStarts.length;for(;n<i;){const s=n+i>>1;this.lineStarts[s]<e?n=s+1:i=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};const r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}}function En(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Kl(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function zf(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ds(t){switch(t.type){case"document":return t.start;case"block-map":{const e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function wi(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function ql(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!En(e.start,"explicit-key-ind")&&!En(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,zf(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Ey{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new _y,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const i of this.lexer.lex(e,n))yield*this.next(i);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const n=xy(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&ql(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Kl(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Kl(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const n=ds(this.peek(2)),i=wi(n);let r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
177
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
178
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){const r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(r&&n.sep&&!n.value){const a=[];for(let u=0;u<n.sep.length;++u){const d=n.sep[u];switch(d.type){case"newline":a.push(u);break;case"space":break;case"comment":d.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(En(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(zf(n.key)&&!En(n.sep,"newline")){const a=wi(n.start),u=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:u,sep:d}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(En(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const a=wi(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):En(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);r||n.value?(e.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!En(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||En(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=ds(i),s=wi(r);ql(e);const a=e.end.splice(1,e.end.length);a.push(this.sourceToken);const u={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
|
|
179
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
180
|
-
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=ds(e),i=wi(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=ds(e),i=wi(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Iy(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Cy||null,prettyErrors:e}}function Py(t,e={}){const{lineCounter:n,prettyErrors:i}=Iy(e),r=new Ey(n?.addNewLine),s=new wy(e);let a=null;for(const u of s.compose(r.parse(t),!0,t.length))if(!a)a=u;else if(a.options.logLevel!=="silent"){a.errors.push(new Zi(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(a.errors.forEach($l(t,n)),a.warnings.forEach($l(t,n))),a}function Ay(t,e,n){let i;const r=Py(t,n);if(!r)return null;if(r.warnings.forEach(s=>yf(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function Oy(t,e,n){let i=null;if(Array.isArray(e)&&(i=e),t===void 0){const{keepUndefined:r}={};if(!r)return}return Or(t)&&!i?t.toString(n):new Rr(t,i,n).toString(n)}class Wf{readPage(e){const n=e.split(`
|
|
181
|
-
`);if(n[0]=="---"){n.shift();const i=n.findIndex(r=>r=="---");if(i>=0){const r=n.slice(0,i).join(`
|
|
182
|
-
`);return{...Ay(r),content:n.slice(i+1).join(`
|
|
183
|
-
`)}}else return{content:e}}else return{content:e}}}class Hf{writePage(e){const{content:n,...i}=e;return i&&Object.keys(i).length>0?`---
|
|
184
|
-
${Oy(i)}---
|
|
185
|
-
${n??""}`:n??""}}var Ty=(t,e,n,i)=>{for(var r=e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},Ny=(t,e)=>(n,i)=>e(n,i,t);let xr=class{logger;wikiConfig;constructor(e,n){this.logger=e,this.logger.setModule(n)}setWikiConfig(e){this.logger.debug("Setting wiki Config: ",e),this.wikiConfig=e}getWikiConfig(){return this.wikiConfig}};xr=Ty([it(),Ny(0,Ch())],xr);var My=(t,e,n,i)=>{for(var r=e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},Ry=(t,e)=>(n,i)=>e(n,i,t);let Vl=class{constructor(t){this.cristalApp=t}get(){return this.cristalApp.getWikiConfig().storage}};Vl=My([it(),Ry(0,Le("CristalApp"))],Vl);const Gf={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.autodesk.fbx":["fbx"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dcmp+xml":["dcmp"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.slides":["ggs"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.drawing":["gdraw"],"application/vnd.google-apps.form":["gform"],"application/vnd.google-apps.jam":["gjam"],"application/vnd.google-apps.map":["gmap"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.script":["gscript"],"application/vnd.google-apps.site":["gsite"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.gov.sk.xmldatacontainer+xml":["xdcf"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-visio.viewer":["vdx"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.nato.bindingdataobject+xml":["bdo"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.procrate.brushset":["brushset"],"application/vnd.procreate.brush":["brush"],"application/vnd.procreate.dream":["drm"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw","vsdx","vtx"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blender":["blend"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-compressed":["*rar"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-ipynb+json":["ipynb"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zip-compressed":["*zip"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.blockfact.facti":["facti"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-adobe-dng":["dng"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.bary":["bary"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["*mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(Gf);const Yf={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/dicom":["dcm"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg","one","onea"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"application/zip+dotlottie":["lottie"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a","m4b"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/ief":["ief"],"image/jaii":["jaii"],"image/jais":["jais"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpg","jpeg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/pjpeg":["jfif"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime","mht","mhtml"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step":["step","stp","stpnc","p21","210"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(Yf);var Rt=function(t,e,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(t):i?i.value:e.get(t)},Si,er,Yn;class jy{constructor(...e){Si.set(this,new Map),er.set(this,new Map),Yn.set(this,new Map);for(const n of e)this.define(n)}define(e,n=!1){for(let[i,r]of Object.entries(e)){i=i.toLowerCase(),r=r.map(u=>u.toLowerCase()),Rt(this,Yn,"f").has(i)||Rt(this,Yn,"f").set(i,new Set);const s=Rt(this,Yn,"f").get(i);let a=!0;for(let u of r){const d=u.startsWith("*");if(u=d?u.slice(1):u,s?.add(u),a&&Rt(this,er,"f").set(i,u),a=!1,d)continue;const g=Rt(this,Si,"f").get(u);if(g&&g!=i&&!n)throw new Error(`"${i} -> ${u}" conflicts with "${g} -> ${u}". Pass \`force=true\` to override this definition.`);Rt(this,Si,"f").set(u,i)}}return this}getType(e){if(typeof e!="string")return null;const n=e.replace(/^.*[/\\]/s,"").toLowerCase(),i=n.replace(/^.*\./s,"").toLowerCase(),r=n.length<e.length;return!(i.length<n.length-1)&&r?null:Rt(this,Si,"f").get(i)??null}getExtension(e){return typeof e!="string"?null:(e=e?.split?.(";")[0],(e&&Rt(this,er,"f").get(e.trim().toLowerCase()))??null)}getAllExtensions(e){return typeof e!="string"?null:Rt(this,Yn,"f").get(e.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const e of Rt(this,Yn,"f").values())Object.freeze(e);return this}_getTestState(){return{types:Rt(this,Si,"f"),extensions:Rt(this,er,"f")}}}Si=new WeakMap,er=new WeakMap,Yn=new WeakMap;var By=new jy(Yf,Gf)._freeze(),Ly=Object.getOwnPropertyDescriptor,$y=(t,e,n,i)=>{for(var r=i>1?void 0:i?Ly(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},Qo=(t,e)=>(n,i)=>e(n,i,t);let Aa=class extends xr{constructor(t,e,n){super(t,"storage.components.githubStorage"),this.authenticationManagerProvider=e,this.alertsServiceProvider=n}ATTACHMENTS="attachments";async isStorageReady(){return!0}getPageRestURL(t,e,n){this.logger?.debug("GitHub Loading page",t);let i=`${this.wikiConfig.baseRestURL}/contents/${t}`;return n&&(i=`${i}?ref=${n}`),i}getPageRestMetaURL(t,e,n){const i=t.split("/");i[i.length-1]=`.${i[i.length-1]}`;let r=`${this.wikiConfig.baseRestURL}/contents/${i.join("/")}`;return n&&(r=`${r}?ref=${n}`),r}getPageFromViewURL(t){let e=null;return t.startsWith(this.wikiConfig.baseURL)&&(e=t.replace(this.wikiConfig.baseURL,"")),e}getImageURL(t,e){const n=t.replace(/[^/]*$/,"");return`${this.wikiConfig.baseURL}/${n}${e}`}hashCode=function(t){let e=0,n,i;if(t.length===0)return""+e;for(n=0;n<t.length;n++)i=t.charCodeAt(n),e=(e<<5)-e+i,e|=0;return""+e};async getPageContent(t,e,n){this.logger?.debug("GitHub Loading page",t);const i=this.getPageRestURL(`${t}.md`,e,n),r=await fetch(i,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.raw+json"}});if(r.status>=200&&r.status<300){const{content:s,...a}=new Wf().readPage(await r.text()),{date:u,name:d,username:g}=await this.getLastEditDetails(t,n);return Object.assign(new Nn,{source:s,syntax:"markdown/1.2",...a,id:t,headline:a.name,headlineRaw:a.name,canEdit:await this.authenticationManagerProvider.get()?.isAuthenticated()??!1,lastModificationDate:u,lastAuthor:{name:d,username:g}})}else return}async getAttachments(t){const e=`${this.getPageRestMetaURL(t,"")}/${this.ATTACHMENTS}`,n=await fetch(e,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.raw+json"}});if(n.status>=200&&n.status<300){const i=await n.json();return{attachments:await Promise.all(i.map(async r=>await this.getAttachment(t,r.name))),count:i.length}}else return{attachments:[],count:0}}async getAttachment(t,e){const n=`${this.getPageRestMetaURL(t,"")}/${this.ATTACHMENTS}/${e}`,i=await fetch(n,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.object+json"}});if(i.status>=200&&i.status<300){const r=await i.json(),s=new URL(`${this.wikiConfig.baseRestURL}/commits`);s.search=new URLSearchParams([["path",r.path],["per_page","1"]]).toString();const u=await(await fetch(s,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github+json"}})).json();return{reference:r.name,id:r.path,size:r.size,href:r.download_url,mimetype:By.getType(r.name)??"",date:new Date(u[0].commit.author.date),author:u[0].commit.author.name}}else return}async getPanelContent(){return new Nn}async getEditField(){return""}async save(t,e,n){const i=this.getPageRestURL(`${t}.md`,""),r=await fetch(i,{method:"HEAD",cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.object+json"}}),s=r.status>=200&&r.status<300?r.headers.get("ETag").slice(3,-1):void 0,a=new Hf().writePage({content:n,name:e,syntax:"markdown/1.2"}),u=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({content:btoa(a),message:`Update ${t}`,sha:s})});if(!u.ok){const d=await u.text();throw this.alertsServiceProvider.get().error(`Could not save page ${t}. Reason: ${d}`),new Error(d)}}async saveAttachments(t,e){const n=[];for(const i of e){const r=`${this.getPageRestMetaURL(t,"")}/${this.ATTACHMENTS}/${i.name}`,s=await this.computeAttachmentSHA(r);n.push(this.uploadAttachment(r,i,s,t))}return Promise.all(n)}async computeAttachmentSHA(t){const e=await fetch(t,{method:"HEAD",cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.object+json"}});return e.status>=200&&e.status<300?e.headers.get("ETag").slice(3,-1):void 0}uploadAttachment(t,e,n,i){return new Promise(r=>{const s=new FileReader;s.onload=async()=>{const a=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({content:s.result.split(",")[1],message:`Upload ${e.name}`,sha:n})});if(a.ok)r((await a.json()).content.download_url);else{const u=await a.text();this.alertsServiceProvider.get().error(`Could not upload attachment ${e.name} for page ${i}. Reason: ${u}`),r(void 0)}},s.readAsDataURL(e)})}async delete(t){const e=this.wikiConfig.baseURL.split("/").pop(),n=(await(await fetch(`${this.wikiConfig.baseRestURL}/git/ref/heads/${e}`,{method:"GET",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()}})).json()).object.sha,i=await fetch(`${this.wikiConfig.baseRestURL}/git/trees`,{method:"POST",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({base_tree:e,tree:[{path:`${t}.md`,mode:"040000",type:"tree",sha:null}]})});if(!i.ok)return{success:!1,error:await i.text()};const r=await fetch(`${this.wikiConfig.baseRestURL}/git/commits`,{method:"POST",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({tree:(await i.json()).sha,message:`Delete ${t}`,parents:[n]})});return r.ok?await fetch(`${this.wikiConfig.baseRestURL}/git/refs/heads/${e}`,{method:"PATCH",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({sha:(await r.json()).sha})}).then(async s=>s.ok?{success:!0}:{success:!1,error:await s.text()}):{success:!1,error:await r.text()}}async move(){throw new Error("Move not supported")}async getCredentials(){const t=await this.authenticationManagerProvider.get()?.getAuthorizationHeader(),e={};return t&&(e.Authorization=t),e}async getLastEditDetails(t,e){if(e){const n=new URL(`${this.wikiConfig.baseRestURL}/commits/${e}`),r=await(await fetch(n,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github+json"}})).json();return{date:new Date(r.commit.author.date),username:r.commit.author.login,name:r.commit.author.name}}else{const n=new URL(`${this.wikiConfig.baseRestURL}/commits`);n.search=new URLSearchParams([["path",`${t}.md`],["per_page","1"]]).toString();const r=await(await fetch(n,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github+json"}})).json();return{date:new Date(r[0].commit.author.date),username:r[0].commit.author.login,name:r[0].commit.author.name}}}};Aa=$y([it(),Qo(0,Le("Logger")),Qo(1,Le("AuthenticationManagerProvider")),Qo(2,Le("AlertsServiceProvider"))],Aa);function Ec(t){return e=>e.name==t||e.name==null}let Fy=class{constructor(e){e.bind("WikiConfig").to(Sa).when(Ec("GitHub")),e.bind("Storage").to(Aa).whenNamed("GitHub")}};var Dy=Object.getOwnPropertyDescriptor,Uy=(t,e,n,i)=>{for(var r=i>1?void 0:i?Dy(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},ps=(t,e)=>(n,i)=>e(n,i,t);let Oa=class extends yr{storage;cristal;constructor(t,e,n){super(t),this.cristal=n,this.storage=e,this.storage.setWikiConfig(this)}isSupported(t){return t=="html"}defaultPageName(){return"home"}getType(){return"Nextcloud"}};Oa=Uy([it(),ps(0,Le("Logger")),ps(1,Le("Storage")),ps(1,tc("Nextcloud")),ps(2,Le("CristalApp"))],Oa);class Ky{type=1;wiki;names;constructor(e,...n){this.wiki=e,this.names=n}}class qy{type=2;space;name;terminal;constructor(e,n,i){this.space=n,this.name=e,this.terminal=i??!1}}const Jf=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Vy=Jf+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",zy="["+Jf+"]["+Vy+"]*",Wy=new RegExp("^"+zy+"$");function Qf(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let a=0;a<s;a++)r.push(i[a]);n.push(r),i=e.exec(t)}return n}const io=function(t){const e=Wy.exec(t);return!(e===null||typeof e>"u")};function Hy(t){return typeof t<"u"}const Ic=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],Xf=["__proto__","constructor","prototype"],Gy={allowBooleanAttributes:!1,unpairedTags:[]};function Yy(t,e){e=Object.assign({},Gy,e);const n=[];let i=!1,r=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(let s=0;s<t.length;s++)if(t[s]==="<"&&t[s+1]==="?"){if(s+=2,s=Wl(t,s),s.err)return s}else if(t[s]==="<"){let a=s;if(s++,t[s]==="!"){s=Hl(t,s);continue}else{let u=!1;t[s]==="/"&&(u=!0,s++);let d="";for(;s<t.length&&t[s]!==">"&&t[s]!==" "&&t[s]!==" "&&t[s]!==`
|
|
186
|
-
`&&t[s]!=="\r";s++)d+=t[s];if(d=d.trim(),d[d.length-1]==="/"&&(d=d.substring(0,d.length-1),s--),!ib(d)){let b;return d.trim().length===0?b="Invalid space after '<'.":b="Tag '"+d+"' is an invalid name.",Je("InvalidTag",b,yt(t,s))}const g=Xy(t,s);if(g===!1)return Je("InvalidAttr","Attributes for '"+d+"' have open quote.",yt(t,s));let v=g.value;if(s=g.index,v[v.length-1]==="/"){const b=s-v.length;v=v.substring(0,v.length-1);const w=Gl(v,e);if(w===!0)i=!0;else return Je(w.err.code,w.err.msg,yt(t,b+w.err.line))}else if(u)if(g.tagClosed){if(v.trim().length>0)return Je("InvalidTag","Closing tag '"+d+"' can't have attributes or invalid starting.",yt(t,a));if(n.length===0)return Je("InvalidTag","Closing tag '"+d+"' has not been opened.",yt(t,a));{const b=n.pop();if(d!==b.tagName){let w=yt(t,b.tagStartPos);return Je("InvalidTag","Expected closing tag '"+b.tagName+"' (opened in line "+w.line+", col "+w.col+") instead of closing tag '"+d+"'.",yt(t,a))}n.length==0&&(r=!0)}}else return Je("InvalidTag","Closing tag '"+d+"' doesn't have proper closing.",yt(t,s));else{const b=Gl(v,e);if(b!==!0)return Je(b.err.code,b.err.msg,yt(t,s-v.length+b.err.line));if(r===!0)return Je("InvalidXml","Multiple possible root nodes found.",yt(t,s));e.unpairedTags.indexOf(d)!==-1||n.push({tagName:d,tagStartPos:a}),i=!0}for(s++;s<t.length;s++)if(t[s]==="<")if(t[s+1]==="!"){s++,s=Hl(t,s);continue}else if(t[s+1]==="?"){if(s=Wl(t,++s),s.err)return s}else break;else if(t[s]==="&"){const b=tb(t,s);if(b==-1)return Je("InvalidChar","char '&' is not expected.",yt(t,s));s=b}else if(r===!0&&!zl(t[s]))return Je("InvalidXml","Extra text at the end",yt(t,s));t[s]==="<"&&s--}}else{if(zl(t[s]))continue;return Je("InvalidChar","char '"+t[s]+"' is not expected.",yt(t,s))}if(i){if(n.length==1)return Je("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",yt(t,n[0].tagStartPos));if(n.length>0)return Je("InvalidXml","Invalid '"+JSON.stringify(n.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Je("InvalidXml","Start tag expected.",1);return!0}function zl(t){return t===" "||t===" "||t===`
|
|
187
|
-
`||t==="\r"}function Wl(t,e){const n=e;for(;e<t.length;e++)if(t[e]=="?"||t[e]==" "){const i=t.substr(n,e-n);if(e>5&&i==="xml")return Je("InvalidXml","XML declaration allowed only at the start of the document.",yt(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function Hl(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let n=1;for(e+=8;e<t.length;e++)if(t[e]==="<")n++;else if(t[e]===">"&&(n--,n===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}const Jy='"',Qy="'";function Xy(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if(t[e]===Jy||t[e]===Qy)i===""?i=t[e]:i!==t[e]||(i="");else if(t[e]===">"&&i===""){r=!0;break}n+=t[e]}return i!==""?!1:{value:n,index:e,tagClosed:r}}const Zy=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Gl(t,e){const n=Qf(t,Zy),i={};for(let r=0;r<n.length;r++){if(n[r][1].length===0)return Je("InvalidAttr","Attribute '"+n[r][2]+"' has no space in starting.",Ji(n[r]));if(n[r][3]!==void 0&&n[r][4]===void 0)return Je("InvalidAttr","Attribute '"+n[r][2]+"' is without value.",Ji(n[r]));if(n[r][3]===void 0&&!e.allowBooleanAttributes)return Je("InvalidAttr","boolean attribute '"+n[r][2]+"' is not allowed.",Ji(n[r]));const s=n[r][2];if(!nb(s))return Je("InvalidAttr","Attribute '"+s+"' is an invalid name.",Ji(n[r]));if(!Object.prototype.hasOwnProperty.call(i,s))i[s]=1;else return Je("InvalidAttr","Attribute '"+s+"' is repeated.",Ji(n[r]))}return!0}function eb(t,e){let n=/\d/;for(t[e]==="x"&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(n))break}return-1}function tb(t,e){if(e++,t[e]===";")return-1;if(t[e]==="#")return e++,eb(t,e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(t[e]===";")break;return-1}return e}function Je(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function nb(t){return io(t)}function ib(t){return io(t)}function yt(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Ji(t){return t.startIndex+t[1].length}const Zf=t=>Ic.includes(t)?"__"+t:t,rb={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Zf};function sb(t,e){if(typeof t!="string")return;const n=t.toLowerCase();if(Ic.some(i=>n===i.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);if(Xf.some(i=>n===i.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`)}function ed(t){return typeof t=="boolean"?{enabled:t,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof t=="object"&&t!==null?{enabled:t.enabled!==!1,maxEntitySize:Math.max(1,t.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,t.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,t.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,t.maxExpandedLength??1e5),maxEntityCount:Math.max(1,t.maxEntityCount??100),allowedTags:t.allowedTags??null,tagFilter:t.tagFilter??null}:ed(!0)}const ob=function(t){const e=Object.assign({},rb,t),n=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(const{value:i,name:r}of n)i&&sb(i,r);return e.onDangerousProperty===null&&(e.onDangerousProperty=Zf),e.processEntities=ed(e.processEntities),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(i=>typeof i=="string"&&i.startsWith("*.")?".."+i.substring(2):i)),e};let Ms;typeof Symbol!="function"?Ms="@@xmlMetadata":Ms=Symbol("XML Node Metadata");class In{constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null)}add(e,n){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:n})}addChild(e,n){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),n!==void 0&&(this.child[this.child.length-1][Ms]={startIndex:n})}static getMetaDataSymbol(){return Ms}}class ab{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,n){const i=Object.create(null);let r=0;if(e[n+3]==="O"&&e[n+4]==="C"&&e[n+5]==="T"&&e[n+6]==="Y"&&e[n+7]==="P"&&e[n+8]==="E"){n=n+9;let s=1,a=!1,u=!1,d="";for(;n<e.length;n++)if(e[n]==="<"&&!u){if(a&&zn(e,"!ENTITY",n)){n+=7;let g,v;if([g,v,n]=this.readEntityExp(e,n+1,this.suppressValidationErr),v.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&r>=this.options.maxEntityCount)throw new Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);const b=g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i[g]={regx:RegExp(`&${b};`,"g"),val:v},r++}}else if(a&&zn(e,"!ELEMENT",n)){n+=8;const{index:g}=this.readElementExp(e,n+1);n=g}else if(a&&zn(e,"!ATTLIST",n))n+=8;else if(a&&zn(e,"!NOTATION",n)){n+=9;const{index:g}=this.readNotationExp(e,n+1,this.suppressValidationErr);n=g}else if(zn(e,"!--",n))u=!0;else throw new Error("Invalid DOCTYPE");s++,d=""}else if(e[n]===">"){if(u?e[n-1]==="-"&&e[n-2]==="-"&&(u=!1,s--):s--,s===0)break}else e[n]==="["?a=!0:d+=e[n];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:i,i:n}}readEntityExp(e,n){n=_t(e,n);const i=n;for(;n<e.length&&!/\s/.test(e[n])&&e[n]!=='"'&&e[n]!=="'";)n++;let r=e.substring(i,n);if(Qi(r),n=_t(e,n),!this.suppressValidationErr){if(e.substring(n,n+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[n]==="%")throw new Error("Parameter entities are not supported")}let s="";if([n,s]=this.readIdentifierVal(e,n,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&s.length>this.options.maxEntitySize)throw new Error(`Entity "${r}" size (${s.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return n--,[r,s,n]}readNotationExp(e,n){n=_t(e,n);const i=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let r=e.substring(i,n);!this.suppressValidationErr&&Qi(r),n=_t(e,n);const s=e.substring(n,n+6).toUpperCase();if(!this.suppressValidationErr&&s!=="SYSTEM"&&s!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${s}"`);n+=s.length,n=_t(e,n);let a=null,u=null;if(s==="PUBLIC")[n,a]=this.readIdentifierVal(e,n,"publicIdentifier"),n=_t(e,n),(e[n]==='"'||e[n]==="'")&&([n,u]=this.readIdentifierVal(e,n,"systemIdentifier"));else if(s==="SYSTEM"&&([n,u]=this.readIdentifierVal(e,n,"systemIdentifier"),!this.suppressValidationErr&&!u))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:r,publicIdentifier:a,systemIdentifier:u,index:--n}}readIdentifierVal(e,n,i){let r="";const s=e[n];if(s!=='"'&&s!=="'")throw new Error(`Expected quoted string, found "${s}"`);n++;const a=n;for(;n<e.length&&e[n]!==s;)n++;if(r=e.substring(a,n),e[n]!==s)throw new Error(`Unterminated ${i} value`);return n++,[n,r]}readElementExp(e,n){n=_t(e,n);const i=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let r=e.substring(i,n);if(!this.suppressValidationErr&&!io(r))throw new Error(`Invalid element name: "${r}"`);n=_t(e,n);let s="";if(e[n]==="E"&&zn(e,"MPTY",n))n+=4;else if(e[n]==="A"&&zn(e,"NY",n))n+=2;else if(e[n]==="("){n++;const a=n;for(;n<e.length&&e[n]!==")";)n++;if(s=e.substring(a,n),e[n]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[n]}"`);return{elementName:r,contentModel:s.trim(),index:n}}readAttlistExp(e,n){n=_t(e,n);let i=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;let r=e.substring(i,n);for(Qi(r),n=_t(e,n),i=n;n<e.length&&!/\s/.test(e[n]);)n++;let s=e.substring(i,n);if(!Qi(s))throw new Error(`Invalid attribute name: "${s}"`);n=_t(e,n);let a="";if(e.substring(n,n+8).toUpperCase()==="NOTATION"){if(a="NOTATION",n+=8,n=_t(e,n),e[n]!=="(")throw new Error(`Expected '(', found "${e[n]}"`);n++;let d=[];for(;n<e.length&&e[n]!==")";){const g=n;for(;n<e.length&&e[n]!=="|"&&e[n]!==")";)n++;let v=e.substring(g,n);if(v=v.trim(),!Qi(v))throw new Error(`Invalid notation name: "${v}"`);d.push(v),e[n]==="|"&&(n++,n=_t(e,n))}if(e[n]!==")")throw new Error("Unterminated list of notations");n++,a+=" ("+d.join("|")+")"}else{const d=n;for(;n<e.length&&!/\s/.test(e[n]);)n++;a+=e.substring(d,n);const g=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!g.includes(a.toUpperCase()))throw new Error(`Invalid attribute type: "${a}"`)}n=_t(e,n);let u="";return e.substring(n,n+8).toUpperCase()==="#REQUIRED"?(u="#REQUIRED",n+=8):e.substring(n,n+7).toUpperCase()==="#IMPLIED"?(u="#IMPLIED",n+=7):[n,u]=this.readIdentifierVal(e,n,"ATTLIST"),{elementName:r,attributeName:s,attributeType:a,defaultValue:u,index:n}}}const _t=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function zn(t,e,n){for(let i=0;i<e.length;i++)if(e[i]!==t[n+i+1])return!1;return!0}function Qi(t){if(io(t))return t;throw new Error(`Invalid entity name ${t}`)}const cb=/^[-+]?0x[a-fA-F0-9]+$/,lb=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,ub={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function fb(t,e={}){if(e=Object.assign({},ub,e),!t||typeof t!="string")return t;let n=t.trim();if(e.skipLike!==void 0&&e.skipLike.test(n))return t;if(t==="0")return 0;if(e.hex&&cb.test(n))return gb(n,16);if(isFinite(n)){if(n.includes("e")||n.includes("E"))return pb(t,n,e);{const i=lb.exec(n);if(i){const r=i[1]||"",s=i[2];let a=hb(i[3]);const u=r?t[s.length+1]===".":t[s.length]===".";if(!e.leadingZeros&&(s.length>1||s.length===1&&!u))return t;{const d=Number(n),g=String(d);if(d===0)return d;if(g.search(/[eE]/)!==-1)return e.eNotation?d:t;if(n.indexOf(".")!==-1)return g==="0"||g===a||g===`${r}${a}`?d:t;let v=s?a:n;return s?v===g||r+v===g?d:t:v===g||v===r+g?d:t}}else return t}}else return mb(t,Number(n),e)}const db=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function pb(t,e,n){if(!n.eNotation)return t;const i=e.match(db);if(i){let r=i[1]||"";const s=i[3].indexOf("e")===-1?"E":"e",a=i[2],u=r?t[a.length+1]===s:t[a.length]===s;return a.length>1&&u?t:a.length===1&&(i[3].startsWith(`.${s}`)||i[3][0]===s)?Number(e):a.length>0?n.leadingZeros&&!u?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}else return t}function hb(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substring(0,t.length-1))),t}function gb(t,e){if(parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function mb(t,e,n){const i=e===1/0;switch(n.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return i?"Infinity":"-Infinity";default:return t}}function vb(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(const n of t)if(typeof n=="string"&&e===n||n instanceof RegExp&&n.test(e))return!0}:()=>!1}class Yl{constructor(e,n={}){this.pattern=e,this.separator=n.separator||".",this.segments=this._parse(e),this._hasDeepWildcard=this.segments.some(i=>i.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(i=>i.attrName!==void 0),this._hasPositionSelector=this.segments.some(i=>i.position!==void 0)}_parse(e){const n=[];let i=0,r="";for(;i<e.length;)e[i]===this.separator?i+1<e.length&&e[i+1]===this.separator?(r.trim()&&(n.push(this._parseSegment(r.trim())),r=""),n.push({type:"deep-wildcard"}),i+=2):(r.trim()&&n.push(this._parseSegment(r.trim())),r="",i++):(r+=e[i],i++);return r.trim()&&n.push(this._parseSegment(r.trim())),n}_parseSegment(e){const n={type:"tag"};let i=null,r=e;const s=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(s&&(r=s[1]+s[3],s[2])){const v=s[2].slice(1,-1);v&&(i=v)}let a,u=r;if(r.includes("::")){const v=r.indexOf("::");if(a=r.substring(0,v).trim(),u=r.substring(v+2).trim(),!a)throw new Error(`Invalid namespace in pattern: ${e}`)}let d,g=null;if(u.includes(":")){const v=u.lastIndexOf(":"),b=u.substring(0,v).trim(),w=u.substring(v+1).trim();["first","last","odd","even"].includes(w)||/^nth\(\d+\)$/.test(w)?(d=b,g=w):d=u}else d=u;if(!d)throw new Error(`Invalid segment pattern: ${e}`);if(n.tag=d,a&&(n.namespace=a),i)if(i.includes("=")){const v=i.indexOf("=");n.attrName=i.substring(0,v).trim(),n.attrValue=i.substring(v+1).trim()}else n.attrName=i.trim();if(g){const v=g.match(/^nth\((\d+)\)$/);v?(n.position="nth",n.positionValue=parseInt(v[1],10)):n.position=g}return n}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class yb{constructor(e={}){this.separator=e.separator||".",this.path=[],this.siblingStacks=[]}push(e,n=null,i=null){if(this.path.length>0){const v=this.path[this.path.length-1];v.values=void 0}const r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);const s=this.siblingStacks[r],a=i?`${i}:${e}`:e,u=s.get(a)||0;let d=0;for(const v of s.values())d+=v;s.set(a,u+1);const g={tag:e,position:d,counter:u};i!=null&&(g.namespace=i),n!=null&&(g.values=n),this.path.push(g)}pop(){if(this.path.length===0)return;const e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){const n=this.path[this.path.length-1];e!=null&&(n.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){return this.path.length===0?void 0:this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;const n=this.path[this.path.length-1];return n.values!==void 0&&e in n.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,n=!0){const i=e||this.separator;return this.path.map(r=>n&&r.namespace?`${r.namespace}:${r.tag}`:r.tag).join(i)}toArray(){return this.path.map(e=>e.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(e){const n=e.segments;return n.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(n):this._matchSimple(n)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let n=0;n<e.length;n++){const i=e[n],r=this.path[n],s=n===this.path.length-1;if(!this._matchSegment(i,r,s))return!1}return!0}_matchWithDeepWildcard(e){let n=this.path.length-1,i=e.length-1;for(;i>=0&&n>=0;){const r=e[i];if(r.type==="deep-wildcard"){if(i--,i<0)return!0;const s=e[i];let a=!1;for(let u=n;u>=0;u--){const d=u===this.path.length-1;if(this._matchSegment(s,this.path[u],d)){n=u-1,i--,a=!0;break}}if(!a)return!1}else{const s=n===this.path.length-1;if(!this._matchSegment(r,this.path[n],s))return!1;n--,i--}}return i<0}_matchSegment(e,n,i){if(e.tag!=="*"&&e.tag!==n.tag||e.namespace!==void 0&&e.namespace!=="*"&&e.namespace!==n.namespace)return!1;if(e.attrName!==void 0){if(!i||!n.values||!(e.attrName in n.values))return!1;if(e.attrValue!==void 0){const r=n.values[e.attrName];if(String(r)!==String(e.attrValue))return!1}}if(e.position!==void 0){if(!i)return!1;const r=n.counter??0;if(e.position==="first"&&r!==0)return!1;if(e.position==="odd"&&r%2!==1)return!1;if(e.position==="even"&&r%2!==0)return!1;if(e.position==="nth"&&r!==e.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this.path=e.path.map(n=>({...n})),this.siblingStacks=e.siblingStacks.map(n=>new Map(n))}}function bb(t,e){if(!t)return{};const n=e.attributesGroupName?t[e.attributesGroupName]:t;if(!n)return{};const i={};for(const r in n)if(r.startsWith(e.attributeNamePrefix)){const s=r.substring(e.attributeNamePrefix.length);i[s]=n[r]}else i[r]=n[r];return i}function wb(t){if(!t||typeof t!="string")return;const e=t.indexOf(":");if(e!==-1&&e>0){const n=t.substring(0,e);if(n!=="xmlns")return n}}class xb{constructor(e){if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(n,i)=>Jl(i,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(n,i)=>Jl(i,16,"&#x")}},this.addExternalEntities=Sb,this.parseXml=Ib,this.parseTextData=kb,this.resolveNameSpace=_b,this.buildAttributesMap=Eb,this.isItStopNode=Tb,this.replaceEntitiesValue=Ab,this.readStopNodeData=Mb,this.saveTextToParentTag=Ob,this.addChild=Pb,this.ignoreAttributesFn=vb(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new yb,this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let n=0;n<this.options.stopNodes.length;n++){const i=this.options.stopNodes[n];typeof i=="string"?this.stopNodeExpressions.push(new Yl(i)):i instanceof Yl&&this.stopNodeExpressions.push(i)}}}}function Sb(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n],r=i.replace(/[.\-+*:]/g,"\\.");this.lastEntities[i]={regex:new RegExp("&"+r+";","g"),val:t[i]}}}function kb(t,e,n,i,r,s,a){if(t!==void 0&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){a||(t=this.replaceEntitiesValue(t,e,n));const u=this.options.jPath?n.toString():n,d=this.options.tagValueProcessor(e,t,u,r,s);return d==null?t:typeof d!=typeof t||d!==t?d:this.options.trimValues?Na(t,this.options.parseTagValue,this.options.numberParseOptions):t.trim()===t?Na(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function _b(t){if(this.options.removeNSPrefix){const e=t.split(":"),n=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(t=n+e[1])}return t}const Cb=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Eb(t,e,n){if(this.options.ignoreAttributes!==!0&&typeof t=="string"){const i=Qf(t,Cb),r=i.length,s={},a={};for(let u=0;u<r;u++){const d=this.resolveNameSpace(i[u][1]),g=i[u][4];if(d.length&&g!==void 0){let v=g;this.options.trimValues&&(v=v.trim()),v=this.replaceEntitiesValue(v,n,e),a[d]=v}}Object.keys(a).length>0&&typeof e=="object"&&e.updateCurrent&&e.updateCurrent(a);for(let u=0;u<r;u++){const d=this.resolveNameSpace(i[u][1]),g=this.options.jPath?e.toString():e;if(this.ignoreAttributesFn(d,g))continue;let v=i[u][4],b=this.options.attributeNamePrefix+d;if(d.length)if(this.options.transformAttributeName&&(b=this.options.transformAttributeName(b)),b=td(b,this.options),v!==void 0){this.options.trimValues&&(v=v.trim()),v=this.replaceEntitiesValue(v,n,e);const w=this.options.jPath?e.toString():e,j=this.options.attributeValueProcessor(d,v,w);j==null?s[b]=v:typeof j!=typeof v||j!==v?s[b]=j:s[b]=Na(v,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[b]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const u={};return u[this.options.attributesGroupName]=s,u}return s}}const Ib=function(t){t=t.replace(/\r\n?/g,`
|
|
188
|
-
`);const e=new In("!xml");let n=e,i="";this.matcher.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;const r=new ab(this.options.processEntities);for(let s=0;s<t.length;s++)if(t[s]==="<")if(t[s+1]==="/"){const u=Zn(t,">",s,"Closing Tag is not closed.");let d=t.substring(s+2,u).trim();if(this.options.removeNSPrefix){const v=d.indexOf(":");v!==-1&&(d=d.substr(v+1))}d=Xo(this.options.transformTagName,d,"",this.options).tagName,n&&(i=this.saveTextToParentTag(i,n,this.matcher));const g=this.matcher.getCurrentTag();if(d&&this.options.unpairedTags.indexOf(d)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${d}>`);g&&this.options.unpairedTags.indexOf(g)!==-1&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),i="",s=u}else if(t[s+1]==="?"){let u=Ta(t,s,!1,"?>");if(!u)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,this.matcher),!(this.options.ignoreDeclaration&&u.tagName==="?xml"||this.options.ignorePiTags)){const d=new In(u.tagName);d.add(this.options.textNodeName,""),u.tagName!==u.tagExp&&u.attrExpPresent&&(d[":@"]=this.buildAttributesMap(u.tagExp,this.matcher,u.tagName)),this.addChild(n,d,this.matcher,s)}s=u.closeIndex+1}else if(t.substr(s+1,3)==="!--"){const u=Zn(t,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){const d=t.substring(s+4,u-2);i=this.saveTextToParentTag(i,n,this.matcher),n.add(this.options.commentPropName,[{[this.options.textNodeName]:d}])}s=u}else if(t.substr(s+1,2)==="!D"){const u=r.readDocType(t,s);this.docTypeEntities=u.entities,s=u.i}else if(t.substr(s+1,2)==="!["){const u=Zn(t,"]]>",s,"CDATA is not closed.")-2,d=t.substring(s+9,u);i=this.saveTextToParentTag(i,n,this.matcher);let g=this.parseTextData(d,n.tagname,this.matcher,!0,!1,!0,!0);g==null&&(g=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:d}]):n.add(this.options.textNodeName,g),s=u+2}else{let u=Ta(t,s,this.options.removeNSPrefix);if(!u){const Y=t.substring(Math.max(0,s-50),Math.min(t.length,s+50));throw new Error(`readTagExp returned undefined at position ${s}. Context: "${Y}"`)}let d=u.tagName;const g=u.rawTagName;let v=u.tagExp,b=u.attrExpPresent,w=u.closeIndex;if({tagName:d,tagExp:v}=Xo(this.options.transformTagName,d,v,this.options),this.options.strictReservedNames&&(d===this.options.commentPropName||d===this.options.cdataPropName||d===this.options.textNodeName||d===this.options.attributesGroupName))throw new Error(`Invalid tag name: ${d}`);n&&i&&n.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,n,this.matcher,!1));const j=n;j&&this.options.unpairedTags.indexOf(j.tagname)!==-1&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let z=!1;v.length>0&&v.lastIndexOf("/")===v.length-1&&(z=!0,d[d.length-1]==="/"?(d=d.substr(0,d.length-1),v=d):v=v.substr(0,v.length-1),b=d!==v);let M=null,K;K=wb(g),d!==e.tagname&&this.matcher.push(d,{},K),d!==v&&b&&(M=this.buildAttributesMap(v,this.matcher,d),M&&bb(M,this.options)),d!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));const te=s;if(this.isCurrentNodeStopNode){let Y="";if(z)s=u.closeIndex;else if(this.options.unpairedTags.indexOf(d)!==-1)s=u.closeIndex;else{const J=this.readStopNodeData(t,g,w+1);if(!J)throw new Error(`Unexpected end of ${g}`);s=J.i,Y=J.tagContent}const se=new In(d);M&&(se[":@"]=M),se.add(this.options.textNodeName,Y),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,se,this.matcher,te)}else{if(z){({tagName:d,tagExp:v}=Xo(this.options.transformTagName,d,v,this.options));const Y=new In(d);M&&(Y[":@"]=M),this.addChild(n,Y,this.matcher,te),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(this.options.unpairedTags.indexOf(d)!==-1){const Y=new In(d);M&&(Y[":@"]=M),this.addChild(n,Y,this.matcher,te),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=u.closeIndex;continue}else{const Y=new In(d);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),M&&(Y[":@"]=M),this.addChild(n,Y,this.matcher,te),n=Y}i="",s=w}}else i+=t[s];return e.child};function Pb(t,e,n,i){this.options.captureMetaData||(i=void 0);const r=this.options.jPath?n.toString():n,s=this.options.updateTag(e.tagname,r,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),t.addChild(e,i))}function Ab(t,e,n){const i=this.options.processEntities;if(!i||!i.enabled)return t;if(i.allowedTags){const r=this.options.jPath?n.toString():n;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(e):i.allowedTags(e,r)))return t}if(i.tagFilter){const r=this.options.jPath?n.toString():n;if(!i.tagFilter(e,r))return t}for(const r of Object.keys(this.docTypeEntities)){const s=this.docTypeEntities[r],a=t.match(s.regx);if(a){if(this.entityExpansionCount+=a.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);const u=t.length;if(t=t.replace(s.regx,s.val),i.maxExpandedLength&&(this.currentExpandedLength+=t.length-u,this.currentExpandedLength>i.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${i.maxExpandedLength}`)}}for(const r of Object.keys(this.lastEntities)){const s=this.lastEntities[r],a=t.match(s.regex);if(a&&(this.entityExpansionCount+=a.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);t=t.replace(s.regex,s.val)}if(t.indexOf("&")===-1)return t;if(this.options.htmlEntities)for(const r of Object.keys(this.htmlEntities)){const s=this.htmlEntities[r],a=t.match(s.regex);if(a&&(this.entityExpansionCount+=a.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);t=t.replace(s.regex,s.val)}return t=t.replace(this.ampEntity.regex,this.ampEntity.val),t}function Ob(t,e,n,i){return t&&(i===void 0&&(i=e.child.length===0),t=this.parseTextData(t,e.tagname,n,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,i),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function Tb(t,e){if(!t||t.length===0)return!1;for(let n=0;n<t.length;n++)if(e.matches(t[n]))return!0;return!1}function Nb(t,e,n=">"){let i,r="";for(let s=e;s<t.length;s++){let a=t[s];if(i)a===i&&(i="");else if(a==='"'||a==="'")i=a;else if(a===n[0])if(n[1]){if(t[s+1]===n[1])return{data:r,index:s}}else return{data:r,index:s};else a===" "&&(a=" ");r+=a}}function Zn(t,e,n,i){const r=t.indexOf(e,n);if(r===-1)throw new Error(i);return r+e.length-1}function Ta(t,e,n,i=">"){const r=Nb(t,e+1,i);if(!r)return;let s=r.data;const a=r.index,u=s.search(/\s/);let d=s,g=!0;u!==-1&&(d=s.substring(0,u),s=s.substring(u+1).trimStart());const v=d;if(n){const b=d.indexOf(":");b!==-1&&(d=d.substr(b+1),g=d!==r.data.substr(b+1))}return{tagName:d,tagExp:s,closeIndex:a,attrExpPresent:g,rawTagName:v}}function Mb(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if(t[n]==="<")if(t[n+1]==="/"){const s=Zn(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e&&(r--,r===0))return{tagContent:t.substring(i,n),i:s};n=s}else if(t[n+1]==="?")n=Zn(t,"?>",n+1,"StopNode is not closed.");else if(t.substr(n+1,3)==="!--")n=Zn(t,"-->",n+3,"StopNode is not closed.");else if(t.substr(n+1,2)==="![")n=Zn(t,"]]>",n,"StopNode is not closed.")-2;else{const s=Ta(t,n,">");s&&((s&&s.tagName)===e&&s.tagExp[s.tagExp.length-1]!=="/"&&r++,n=s.closeIndex)}}function Na(t,e,n){if(e&&typeof t=="string"){const i=t.trim();return i==="true"?!0:i==="false"?!1:fb(t,n)}else return Hy(t)?t:""}function Jl(t,e,n){const i=Number.parseInt(t,e);return i>=0&&i<=1114111?String.fromCodePoint(i):n+t+";"}function Xo(t,e,n,i){if(t){const r=t(e);n===e&&(n=r),e=r}return e=td(e,i),{tagName:e,tagExp:n}}function td(t,e){if(Xf.includes(t))throw new Error(`[SECURITY] Invalid name: "${t}" is a reserved JavaScript keyword that could cause prototype pollution`);return Ic.includes(t)?e.onDangerousProperty(t):t}const Zo=In.getMetaDataSymbol();function Rb(t,e){if(!t||typeof t!="object")return{};if(!e)return t;const n={};for(const i in t)if(i.startsWith(e)){const r=i.substring(e.length);n[r]=t[i]}else n[i]=t[i];return n}function jb(t,e,n){return nd(t,e,n)}function nd(t,e,n){let i;const r={};for(let s=0;s<t.length;s++){const a=t[s],u=Bb(a);if(u!==void 0&&u!==e.textNodeName){const d=Rb(a[":@"]||{},e.attributeNamePrefix);n.push(u,d)}if(u===e.textNodeName)i===void 0?i=a[u]:i+=""+a[u];else{if(u===void 0)continue;if(a[u]){let d=nd(a[u],e,n);const g=$b(d,e);if(a[":@"]?Lb(d,a[":@"],n,e):Object.keys(d).length===1&&d[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?d=d[e.textNodeName]:Object.keys(d).length===0&&(e.alwaysCreateTextNode?d[e.textNodeName]="":d=""),a[Zo]!==void 0&&typeof d=="object"&&d!==null&&(d[Zo]=a[Zo]),r[u]!==void 0&&Object.prototype.hasOwnProperty.call(r,u))Array.isArray(r[u])||(r[u]=[r[u]]),r[u].push(d);else{const v=e.jPath?n.toString():n;e.isArray(u,v,g)?r[u]=[d]:r[u]=d}u!==void 0&&u!==e.textNodeName&&n.pop()}}}return typeof i=="string"?i.length>0&&(r[e.textNodeName]=i):i!==void 0&&(r[e.textNodeName]=i),r}function Bb(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];if(i!==":@")return i}}function Lb(t,e,n,i){if(e){const r=Object.keys(e),s=r.length;for(let a=0;a<s;a++){const u=r[a],d=u.startsWith(i.attributeNamePrefix)?u.substring(i.attributeNamePrefix.length):u,g=i.jPath?n.toString()+"."+d:n;i.isArray(u,g,!0,!0)?t[u]=[e[u]]:t[u]=e[u]}}}function $b(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return!!(i===0||i===1&&(t[n]||typeof t[n]=="boolean"||t[n]===0))}class Fb{constructor(e){this.externalEntities={},this.options=ob(e)}parse(e,n){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});const s=Yy(e,n);if(s!==!0)throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}const i=new xb(this.options);i.addExternalEntities(this.externalEntities);const r=i.parseXml(e);return this.options.preserveOrder||r===void 0?r:jb(r,this.options,i.matcher)}addEntity(e,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=n}static getMetaDataSymbol(){return In.getMetaDataSymbol()}}var Db=Object.getOwnPropertyDescriptor,Ub=(t,e,n,i)=>{for(var r=i>1?void 0:i?Db(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},hs=(t,e)=>(n,i)=>e(n,i,t);let Ma=class extends xr{constructor(t,e,n,i){super(t,"storage.components.nextcloudStorage"),this.authenticationManagerProvider=e,this.alertsServiceProvider=n,this.cristalApp=i}ATTACHMENTS="attachments";initBaseContentCalled=!1;authenticatedHTTPHeadersProvider;documentService;async getEditField(){return""}getImageURL(){return""}async getAuthenticatedHTTPHeaders(){return this.authenticatedHTTPHeadersProvider||(this.authenticatedHTTPHeadersProvider=this.cristalApp.getContainer().get("HTTPHeadersProvider",{name:"Nextcloud/Authenticated"})),await this.authenticatedHTTPHeadersProvider.getHeaders()}getDocumentService(){return this.documentService||(this.documentService=this.cristalApp.getContainer().get("DocumentService")),this.documentService}getRootUrl(t){const e=this.getWikiConfig();return`${e.baseRestURL}${e.storageRoot??`/files/${t}/.cristal`}`.replace("${username}",t)}async getPageContent(t){const e=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!e){const n=new Nn;return n.html="Not logged-in.",n.canEdit=!1,n}await this.initBaseContent(e);try{const n=await fetch(`${this.getRootUrl(e)}/${t}.md`,{method:"GET",headers:await this.getAuthenticatedHTTPHeaders()});if(n.status>=200&&n.status<300){const{lastModificationDate:i,lastAuthor:r}=await this.getLastEditDetails(t,e),s=new Wf().readPage(await n.text()),a=new Nn;return a.source=s.content,a.name=s.name,a.headline=s.name,a.headlineRaw=s.name,a.syntax=s.syntax,a.lastAuthor=r,a.lastModificationDate=i,a.canEdit=!0,a}else return}catch(n){console.error("Unable to get page content",n);return}}async getLastEditDetails(t,e){let n,i;const r=await fetch(`${this.getRootUrl(e)}/${t}.md`,{body:`<?xml version="1.0" encoding="UTF-8"?>
|
|
189
|
-
<d:propfind xmlns:d="DAV:">
|
|
190
|
-
<d:prop xmlns:oc="http://owncloud.org/ns">
|
|
191
|
-
<d:getlastmodified />
|
|
192
|
-
<oc:owner-id />
|
|
193
|
-
<oc:owner-display-name />
|
|
194
|
-
</d:prop>
|
|
195
|
-
</d:propfind>`,method:"PROPFIND",headers:await this.getAuthenticatedHTTPHeaders()});if(r.status>=200&&r.status<300){const s=new Fb().parse(await r.text())["d:multistatus"]["d:response"]["d:propstat"]["d:prop"],a=s["d:getlastmodified"];a&&(n=new Date(Date.parse(a))),i={username:s["oc:owner-id"],name:s["oc:owner-display-name"]}}return{lastModificationDate:n,lastAuthor:i}}async getAttachments(t){const e=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!e)return;const n=await fetch(this.getAttachmentsBasePath(t,e),{method:"PROPFIND",headers:await this.getAuthenticatedHTTPHeaders()});if(n.status>=200&&n.status<300){const i=await n.text(),s=new window.DOMParser().parseFromString(i,"text/xml").getElementsByTagName("d:response"),a=[];for(let u=0;u<s.length;u++){const d=s[u];d.getElementsByTagName("d:getcontenttype").length>0&&a.push(this.parseAttachment(d))}return{attachments:a}}else return}async getAttachment(t,e){const n=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!n)return;const i=await fetch(this.getAttachmentBasePath(e,t,n),{method:"PROPFIND",headers:await this.getAuthenticatedHTTPHeaders()});if(i.status>=200&&i.status<300){const r=await i.text(),a=new window.DOMParser().parseFromString(r,"text/xml").getElementsByTagName("d:response")[0];return this.parseAttachment(a)}else return}getAttachmentsBasePath(t,e){const n=this.convertToMetaSegments(t).join("/");return`${this.getRootUrl(e)}/${n}/${this.ATTACHMENTS}`}getAttachmentBasePath(t,e,n){return`${this.getAttachmentsBasePath(e,n)}/${t}`}async save(t,e,n){const i=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!i)return;const r=t.split("/"),s=this.getRootUrl(i);await this.createIntermediateDirectories(s,r.slice(0,r.length-1));const a=new Hf().writePage({content:n,name:e,syntax:"markdown/1.2"});await fetch(`${s}/${r.join("/")}.md`,{method:"PUT",headers:await this.getAuthenticatedHTTPHeaders(),body:a})}convertToMetaSegments(t){const e=t.split("/");return[...e.slice(0,e.length-1),`.${e[e.length-1]}`]}async createIntermediateDirectories(t,e){await this.createDirectory(t);for(let n=0;n<e.length;n++)await this.createDirectory(`${t}/${e.slice(0,n+1).join("/")}`)}async saveAttachments(t,e){const n=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!n){this.alertsServiceProvider.get().error(`Could not save attachments for page ${t}, the user is not properly logged-in.`);return}return Promise.all(e.map(i=>this.saveAttachment(t,i,n)))}async saveAttachment(t,e,n){const i=this.convertToMetaSegments(t),r=this.getRootUrl(n);await this.createIntermediateDirectories(r,[...i,this.ATTACHMENTS]);const s=this.getAttachmentsBasePath(t,n)+"/"+e.name;await fetch(s,{method:"PUT",headers:await this.getAuthenticatedHTTPHeaders(),body:e})}getPageFromViewURL(){return null}getPageRestURL(){return""}async getPanelContent(){return new Nn}async delete(t){const e=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!e)return{success:!1,error:"Not logged-in."};const n=this.getRootUrl(e),r=(await Promise.all([await this.deletePageFile(n,t),await this.deletePageFolder(n,t)])).filter(s=>!s.success).map(s=>s.error).filter(s=>s!==void 0);return r.length>0?{success:!1,error:r.join(", ")}:{success:!0}}async deletePageFile(t,e){return await fetch(`${t}/${e}.md`,{method:"DELETE",headers:await this.getAuthenticatedHTTPHeaders()}).then(async n=>n.ok?{success:!0}:{success:!1,error:await n.text()})}async deletePageFolder(t,e){return await fetch(`${t}/${this.convertToMetaSegments(e).join("/")}`,{method:"DELETE",headers:await this.getAuthenticatedHTTPHeaders()}).then(async n=>n.ok||n.status==404?{success:!0}:{success:!1,error:await n.text()})}async move(){throw new Error("Move not supported")}async isStorageReady(){return!0}async createDirectory(t){await fetch(t,{method:"MKCOL",headers:await this.getAuthenticatedHTTPHeaders()})}parseAttachment(t){const e=t.getElementsByTagName("d:href")[0].textContent,n=t.getElementsByTagName("d:getcontenttype")[0].textContent,i=parseInt(t.getElementsByTagName("d:getcontentlength")[0].textContent),r=Date.parse(t.getElementsByTagName("d:getlastmodified")[0].textContent),s=e.split("/"),a=`${this.getWikiConfig().baseURL}${e}`,u=s[s.length-1];return{mimetype:n,reference:u,id:e,href:a,size:i,date:new Date(r),author:void 0}}async initBaseContent(t){if(!this.initBaseContentCalled){this.initBaseContentCalled=!0;try{(await fetch(this.getRootUrl(t),{method:"GET",headers:await this.getAuthenticatedHTTPHeaders()})).status===404&&(await this.save("home","",`# Welcome
|
|
196
|
-
|
|
197
|
-
This is a new **Cristal** wiki.
|
|
198
|
-
|
|
199
|
-
You can use it to take your *own* notes.
|
|
200
|
-
|
|
201
|
-
Enjoy!`),await this.getDocumentService().notifyDocumentChange("update",new qy("home",new Ky)))}catch(e){console.error("Failed to initialize Cristal default content",e)}}}};Ma=Ub([it(),hs(0,Le("Logger")),hs(1,Le("AuthenticationManagerProvider")),hs(2,Le("AlertsServiceProvider")),hs(3,Le("CristalApp"))],Ma);let Kb=class{constructor(e){e.bind("WikiConfig").to(Oa).when(Ec("Nextcloud")),e.bind("Storage").to(Ma).whenNamed("Nextcloud")}};var qb=Object.getOwnPropertyDescriptor,Vb=(t,e,n,i)=>{for(var r=i>1?void 0:i?qb(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},gs=(t,e)=>(n,i)=>e(n,i,t);let Ra=class extends yr{storage;cristal;constructor(t,e,n){super(t),this.cristal=n,this.storage=e,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="Main.WebHome")}isSupported(t){return t=="html"||t=="jsonld"}defaultPageName(){return"Main.WebHome"}getType(){return"XWiki"}getNewPageDefaultName(){return"NewPage"}};Ra=Vb([it(),gs(0,Le("Logger")),gs(1,Le("Storage")),gs(1,tc("XWiki")),gs(2,Le("CristalApp"))],Ra);function ea(t,e){const n=e.split(":"),i=n.length>1?n[0]:"xwiki",r=n.length>1?n[1]:n[0];return`${t.baseURL}/rest/wikis/${i}/spaces/${encodeURIComponent(r).replace(/((?:%5C%5C)*)%5C\./g,"$1%2E").replace(/%5C%5C/g,"%5C").replace(/\.(?=.*\.)/g,"/spaces/").replace(/\./,"/pages/")}`}var zb=Object.getOwnPropertyDescriptor,Wb=(t,e,n,i)=>{for(var r=i>1?void 0:i?zb(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},ta=(t,e)=>(n,i)=>e(n,i,t);let ja=class extends xr{constructor(t,e,n){super(t,"storage.components.xwikiStorage"),this.authenticationManagerProvider=e,this.alertsServiceProvider=n}async isStorageReady(){return!0}getPageRestURL(t,e,n){this.logger?.debug("XWiki Loading page",t);const i=new URL(this.buildPageRestBaseURL(t,["rest","cristal","wikis","xwiki"])),r=new URLSearchParams([["format",e]]);return n&&r.append("revision",n),i.search=r.toString(),i.toString()}getPageFromViewURL(t){let e;return t.startsWith(this.wikiConfig.baseURL)?(e=t.replace(this.wikiConfig.baseURL,"").replace("/bin","").replace("/view/","").replaceAll("%5C","%5C%5C").replaceAll(".","%5C.").replaceAll("/","."),e.endsWith(".")&&(e+="WebHome"),e=decodeURIComponent(e)):e=null,e}getImageURL(t,e){t==""&&(t="Main.WebHome");const n=this.wikiConfig.baseURL+"/bin/download/"+t.replace(".","/")+"/"+e;return this.logger?.debug("final image url ",n),n}async getPageContent(t,e,n){this.logger?.debug("XWiki Loading page",t),t==""&&(t="Main.WebHome");let i;n?i=new URL(`${ea(this.wikiConfig,t)}/history/${n}`):(i=new URL(ea(this.wikiConfig,t)),i.search=new URLSearchParams([["checkRight","edit"],["supportedSyntax","markdown/1.2"]]).toString()),this.logger?.debug("XWiki Loading url",i);const r=await fetch(i,{cache:"no-store",headers:{Accept:"application/json",...await this.getCredentials()}}),s=await r.json();if(r.status==404)return;if(!r.ok){this.alertsServiceProvider.get().error(`Could not load page ${t}. Reason: ${s.message}`);return}const a=new Nn;a.syntax=s.syntax,a.source=s.content,a.html=s.renderedContent,a.version=`${s.majorVersion}.${s.minorVersion}`,a.headlineRaw=s.rawTitle,a.headline=s.title;const u=s.hierarchy.items.pop().name;return a.name=u!="WebHome"?u:s.hierarchy.items.pop().name,a.lastModificationDate=new Date(s.modified),a.lastAuthor={name:s.author},a.canEdit=s.rights?.find(d=>d.name=="edit")?.value??!1,a.document=new ua({encodingFormat:a.syntax,name:a.name,identifier:s.fullName,headline:a.headline,headlineRaw:a.headlineRaw,text:a.source,html:a.html}),a}async getAttachments(t){return{attachments:(await(await fetch(this.buildAttachmentsURL(t),{headers:{Accept:"application/json",...await this.getCredentials()}})).json()).attachments.map(({id:r,name:s,mimeType:a,xwikiAbsoluteUrl:u,size:d,date:g,author:v})=>({id:r,reference:s,mimetype:a,href:u,size:d,date:new Date(g),author:v}))}}async getAttachment(t,e){const n=await this.getAttachments(t);if(n)return n.attachments.filter(i=>i.reference==e)[0]}async getPanelContent(t,e){const n=this.wikiConfig.baseURL+"/rest/cristal/panel?media=json&page="+e+"&panel="+t;this.logger?.debug("XWiki Loading url",n);const r=await(await fetch(n,{cache:"no-store"})).json(),s=new Nn;return s.source=r.source,s.syntax="xwiki",s.html=r.content,s.css=r.css,s.js=r.js,s}async getEditField(t,e){try{const n=t.get("xwikiMapping")[e];let i=n.type,r=n.fieldName;i==null&&(i="document"),r==null&&(r=e);const s=this.wikiConfig.baseURL+"/bin/get/"+t.getIdentifier().replaceAll(".","/")+"?xpage=display&mode=edit&type="+i+"&property="+t.get("className")+"."+r;return this.logger?.debug("XWiki Loading Field url",s),await(await fetch(s,{cache:"no-store"})).text()}catch(n){return this.logger?.error("Exception looking for edit field for field",e,n),""}}async save(t,e,n){const i=this.buildPageRestBaseURL(t,["rest","wikis","xwiki"]),r=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json",...await this.getCredentials()},body:JSON.stringify({content:n,title:e,syntax:"markdown/1.2"})});if(!r.ok){const s=await r.text();throw this.alertsServiceProvider.get().error(`Could not save page ${t}. Reason: ${s}`),new Error(s)}}async saveAttachments(t,e){await Promise.all(e.map(n=>this.saveAttachment(t,n)))}async saveAttachment(t,e){const n=await fetch(`${this.buildAttachmentsURL(t)}/${e.name}`,{method:"PUT",body:e,headers:{...await this.getCredentials(),"Content-Type":e.type}});if(!n.ok)throw new Error(`Failed to upload the attachment. Reason: [${n.statusText}]`)}async delete(t){const e=this.buildPageRestBaseURL(t,["rest","wikis","xwiki"]);return await fetch(e,{method:"DELETE",headers:{"Content-Type":"application/json",...await this.getCredentials()}}).then(async i=>i.ok?{success:!0}:{success:!1,error:await i.text()})}async move(){throw new Error("Move not supported")}async getCredentials(){const t=await this.authenticationManagerProvider.get()?.getAuthorizationHeader(),e={};return t&&(e.Authorization=t),e}buildPageRestBaseURL(t,e){const n=this.wikiConfig.baseURL,i=t.split(/(?<=(?<!\\)(?:\\\\)*)\./);for(let r=0;r<i.length;r++){const s=r<i.length-1?"spaces":"pages";e.push(s),e.push(i[r].replace(/\\\./g,"."))}return`${n}/${e.join("/")}`}buildAttachmentsURL(t){return`${ea(this.wikiConfig,t)}/attachments`}};ja=Wb([it(),ta(0,Le("Logger")),ta(1,Le("AuthenticationManagerProvider")),ta(2,Le("AlertsServiceProvider"))],ja);let Hb=class{constructor(e){e.bind("WikiConfig").to(Ra).when(Ec("XWiki")),e.bind("Storage").to(ja).whenNamed("XWiki")}};var Gb=Object.getOwnPropertyDescriptor,Yb=(t,e,n,i)=>{for(var r=i>1?void 0:i?Gb(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r};let Ba=class{name;hint;priority;singleton;constructor(){this.name="component.name",this.hint="default",this.priority=1e3,this.singleton=!1}getName(){return this.name}getHint(){return this.hint}getPriority(){return this.priority}isSingleton(){return this.singleton}};Ba=Yb([it()],Ba);class Jb{name;entryFile;staticModule;constructor(e,n,i){this.name=e,this.entryFile=n,this.staticModule=i}}var Qb=Object.getOwnPropertyDescriptor,Xb=(t,e,n,i)=>{for(var r=i>1?void 0:i?Qb(e,n):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(r=a(r)||r);return r},Zb=(t,e)=>(n,i)=>e(n,i,t);let La=class extends Ba{remoteExtensions=new Map;remoteExtensionDefaultURL="/apps/";remoteExtensionDefaultEntryFile="main.bundle.js";logger;constructor(t){super(),this.logger=t,this.logger.setModule("extensionmanager.components.defaultExtensionManager")}addRemoteExtension(t,e,n){this.remoteExtensions.set(t,new Jb(t,e,n))}setRemoteExtensionsConfig(t,e){this.remoteExtensionDefaultURL=t,this.remoteExtensionDefaultEntryFile=e}async loadExtension(t,e){try{const n=this.remoteExtensions.get(t),i=n&&n.entryFile?n.entryFile:this.remoteExtensionDefaultEntryFile,r=this.remoteExtensionDefaultURL+t+"/"+i,s=this.remoteExtensionDefaultURL+t+"/style.css";this.logger?.debug("Ready to import ",r);try{const u=await import(s,{assert:{type:"text/css"}});document.adoptedStyleSheets=[u.default]}catch{}const a=await import(r);if(a!=null){this.logger?.debug("Found components Init for ",t,a);const u=a.ComponentInit;new u(e),this.logger?.debug("Succesfull components Init for ",t)}else this.logger?.debug("No components to load for ",t);return}catch(n){this.logger?.error("Exception while loading components from ",t,n)}}async loadExtensions(t){for(const e of this.remoteExtensions.keys())await this.loadExtension(e,t)}};La=Xb([it(),Zb(0,Le("Logger"))],La);class ew{logger;constructor(e){this.logger=e.get("Logger"),this.logger.setModule("extensionmanager.components.componentsInit"),this.logger?.debug("Init Extension Manager components begin"),e.bind("ExtensionManager").to(La),this.logger?.debug("Init Extension Manager components end")}}class tw{logger;container;extensionList;constructor(e){this.extensionList=e}getLogger(e){let n=this.container.get("Logger");return n||(n=new vr),n.setModule(e),n}async loadExtensionManager(e){const n="extension-manager",i="/apps/"+n+"/main.bundle.dev.js";try{if(e)this.logger?.debug("Loading static extension Manager"),new ew(this.container);else{this.logger?.debug("Dynamic extension Manager. Ready to import ",i);const r=await import(i);if(r!=null){this.logger?.debug("Found components Init for ",n,r);const s=r.ComponentInit;new s(this.container),this.logger?.debug("Succesfull components Init for ",n)}else this.logger?.debug("No components to load for ",n)}}catch(r){this.logger?.error("Exception while loading extension Manager from ",i,r)}}async loadExtensions(e,n){this.logger?.debug("Start app"),await this.loadExtensionManager(e);const i=this.container.get("ExtensionManager");if(this.logger?.debug("Extension Manager is ",i),i!=null){if(!n){i.setRemoteExtensionsConfig("/apps/","main.bundle.dev.js");for(const r in this.extensionList)i.addRemoteExtension(r,"",!0);await i.loadExtensions(this.container)}this.logger?.debug("After extensions loading")}else this.logger?.debug("Could not start extension Manager");return i}initializeContainer(){this.container=new Rm,this.container.bind("LoggerConfig").to(fa).inSingletonScope(),this.container.bind("Logger").to(vr);const e=this.container.get("LoggerConfig");e&&e.setDefaultLevel("debug"),this.logger=this.getLogger("index.ts"),this.logger?.debug("Logging initialized")}getConfigFromPathName(e){let n="";if(e.startsWith("/")){const i=e.indexOf("/",1);i!=-1&&(n=e.substring(1,i))}return(n==null||n=="")&&(n="XWiki"),n}}const id=Symbol("Comlink.proxy"),nw=Symbol("Comlink.endpoint"),iw=Symbol("Comlink.releaseProxy"),na=Symbol("Comlink.finalizer"),ks=Symbol("Comlink.thrown"),rd=t=>typeof t=="object"&&t!==null||typeof t=="function",rw={canHandle:t=>rd(t)&&t[id],serialize(t){const{port1:e,port2:n}=new MessageChannel;return Pc(t,e),[n,[n]]},deserialize(t){return t.start(),cw(t)}},sw={canHandle:t=>rd(t)&&ks in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},sd=new Map([["proxy",rw],["throw",sw]]);function ow(t,e){for(const n of t)if(e===n||n==="*"||n instanceof RegExp&&n.test(e))return!0;return!1}function Pc(t,e=globalThis,n=["*"]){e.addEventListener("message",function i(r){if(!r||!r.data)return;if(!ow(n,r.origin)){console.warn(`Invalid origin '${r.origin}' for comlink proxy`);return}const{id:s,type:a,path:u}=Object.assign({path:[]},r.data),d=(r.data.argumentList||[]).map(Jn);let g;try{const v=u.slice(0,-1).reduce((w,j)=>w[j],t),b=u.reduce((w,j)=>w[j],t);switch(a){case"GET":g=b;break;case"SET":v[u.slice(-1)[0]]=Jn(r.data.value),g=!0;break;case"APPLY":g=b.apply(v,d);break;case"CONSTRUCT":{const w=new b(...d);g=pw(w)}break;case"ENDPOINT":{const{port1:w,port2:j}=new MessageChannel;Pc(t,j),g=dw(w,[w])}break;case"RELEASE":g=void 0;break;default:return}}catch(v){g={value:v,[ks]:0}}Promise.resolve(g).catch(v=>({value:v,[ks]:0})).then(v=>{const[b,w]=Bs(v);e.postMessage(Object.assign(Object.assign({},b),{id:s}),w),a==="RELEASE"&&(e.removeEventListener("message",i),od(e),na in t&&typeof t[na]=="function"&&t[na]())}).catch(v=>{const[b,w]=Bs({value:new TypeError("Unserializable return value"),[ks]:0});e.postMessage(Object.assign(Object.assign({},b),{id:s}),w)})}),e.start&&e.start()}function aw(t){return t.constructor.name==="MessagePort"}function od(t){aw(t)&&t.close()}function cw(t,e){const n=new Map;return t.addEventListener("message",function(r){const{data:s}=r;if(!s||!s.id)return;const a=n.get(s.id);if(a)try{a(s)}finally{n.delete(s.id)}}),$a(t,n,[],e)}function ms(t){if(t)throw new Error("Proxy has been released and is not useable")}function ad(t){return ki(t,new Map,{type:"RELEASE"}).then(()=>{od(t)})}const Rs=new WeakMap,js="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(Rs.get(t)||0)-1;Rs.set(t,e),e===0&&ad(t)});function lw(t,e){const n=(Rs.get(e)||0)+1;Rs.set(e,n),js&&js.register(t,e,t)}function uw(t){js&&js.unregister(t)}function $a(t,e,n=[],i=function(){}){let r=!1;const s=new Proxy(i,{get(a,u){if(ms(r),u===iw)return()=>{uw(s),ad(t),e.clear(),r=!0};if(u==="then"){if(n.length===0)return{then:()=>s};const d=ki(t,e,{type:"GET",path:n.map(g=>g.toString())}).then(Jn);return d.then.bind(d)}return $a(t,e,[...n,u])},set(a,u,d){ms(r);const[g,v]=Bs(d);return ki(t,e,{type:"SET",path:[...n,u].map(b=>b.toString()),value:g},v).then(Jn)},apply(a,u,d){ms(r);const g=n[n.length-1];if(g===nw)return ki(t,e,{type:"ENDPOINT"}).then(Jn);if(g==="bind")return $a(t,e,n.slice(0,-1));const[v,b]=Ql(d);return ki(t,e,{type:"APPLY",path:n.map(w=>w.toString()),argumentList:v},b).then(Jn)},construct(a,u){ms(r);const[d,g]=Ql(u);return ki(t,e,{type:"CONSTRUCT",path:n.map(v=>v.toString()),argumentList:d},g).then(Jn)}});return lw(s,t),s}function fw(t){return Array.prototype.concat.apply([],t)}function Ql(t){const e=t.map(Bs);return[e.map(n=>n[0]),fw(e.map(n=>n[1]))]}const cd=new WeakMap;function dw(t,e){return cd.set(t,e),t}function pw(t){return Object.assign(t,{[id]:!0})}function Bs(t){for(const[e,n]of sd)if(n.canHandle(t)){const[i,r]=n.serialize(t);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:t},cd.get(t)||[]]}function Jn(t){switch(t.type){case"HANDLER":return sd.get(t.name).deserialize(t.value);case"RAW":return t.value}}function ki(t,e,n,i){return new Promise(r=>{const s=hw();e.set(s,r),t.start&&t.start(),t.postMessage(Object.assign({id:s},n),i)})}function hw(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}async function Xl(){return await(await import("./index-DWPjg9z3.js")).loadConfig("/config.json")()}async function gw(){try{return!process||!process.versions||!process.versions.electron?{}:await Xl()}catch{return await Xl()}}class mw{currentNumber=0;queue=[];container;cristal;configMap;initialized=!1;fct;async start(){for(console.log("Starting worker thread"),await this.initialize();;)await this.sleep(1e3),await this.checkQueue()}setPageLoadedCallback(e){this.fct=e}sleep(e){return new Promise(n=>setTimeout(n,e))}async checkQueue(){if(this.getQueueSize()>0)if(this.initialized){const n=this.queue.pop();n&&await this.handleQueueItem(n),await this.checkQueue()}else console.log("Worker cristal code not initialized yet. Cannot process queue items.")}async handleQueueItem(e){console.log("Handling queue item code ready to process",e);try{let n=null,i=null,r=null;const s=e.indexOf(":"),a=e.lastIndexOf("_");if(s!=-1&&a!=-1){n=e.substring(0,s),i=e.substring(s+1,a),r=e.substring(a+1);const u=this.getWikiConfig(n);u==null?console.log("Could not find config for page",e):(console.log("Updating page ",i,r),await u.storage.updatePageContent(i,r)&&(console.log("Page updated. Calling back to main thread"),this.fct(e)))}else console.log("Could not process page",e)}catch(n){console.log("Exception while trying to load",e,n)}}add(e){return console.log("Worker in add"),this.currentNumber+=e,this.currentNumber}addToQueue(e){console.log("Worker in addToQueue",e),this.queue.includes(e)||this.queue.push(e)}getQueueSize(){return console.log("Worker in getQueueSize"),this.queue.length}getWikiConfig(e){const n=this.configMap.get(e);if(n==null){console.error("Failed to find wikiConfig for configName",e);return}const r=new Map(Object.entries(n)).get("configType");console.log("Looking for wikiConfig for name",e,"and type",r);let s;try{return s=this.container.get("WikiConfig",{name:r}),this.cristal.setWikiConfig(s),s.setConfigFromObject(n),s.initialize(),console.debug("Found wikiConfig for",e,"and type",r,":",s),s}catch(a){console.error("Failed to find wikiConfig for name",e,"and type",r,a);return}}async initialize(){console.log("Starting initialize");const e=["storage"],n=await gw();this.configMap=new Map(Object.entries(n)),console.log("Loaded json config",this.configMap);const i=new tw(e);i.initializeContainer(),this.container=i.container,console.log("Container status",this.container),this.container.bind("CristalApp").to(da).inSingletonScope(),this.container.bind("QueueWorker").to(pa).inSingletonScope(),this.cristal=this.container.get("CristalApp"),this.cristal.setContainer(this.container),console.log("Container status",this.container),new vv(i.container),new Fy(i.container),new Kb(i.container),new Hb(i.container),new av(i.container),new iv(i.container),console.log("Loading storage components"),this.initialized=!0,console.log("Finished initialize")}}const ld=new mw;ld.start();onconnect=t=>{Pc(ld,t.ports[0])};console.log("Worker code loaded");
|
|
202
|
-
//# sourceMappingURL=worker-C267fLfn.js.map
|