@voidhash/mimic 0.0.2 → 0.0.4
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/.turbo/turbo-build.log +257 -42
- package/dist/Document.cjs +152 -0
- package/dist/Document.d.cts +67 -0
- package/dist/Document.d.cts.map +1 -0
- package/dist/Document.d.mts +68 -0
- package/dist/Document.d.mts.map +1 -0
- package/dist/Document.mjs +147 -0
- package/dist/Document.mjs.map +1 -0
- package/dist/EffectSchema.cjs +180 -0
- package/dist/EffectSchema.d.cts +84 -0
- package/dist/EffectSchema.d.cts.map +1 -0
- package/dist/EffectSchema.d.mts +84 -0
- package/dist/EffectSchema.d.mts.map +1 -0
- package/dist/EffectSchema.mjs +176 -0
- package/dist/EffectSchema.mjs.map +1 -0
- package/dist/FractionalIndex.cjs +365 -0
- package/dist/FractionalIndex.mjs +364 -0
- package/dist/FractionalIndex.mjs.map +1 -0
- package/dist/Operation.cjs +53 -0
- package/dist/Operation.d.cts +39 -0
- package/dist/Operation.d.cts.map +1 -0
- package/dist/Operation.d.mts +39 -0
- package/dist/Operation.d.mts.map +1 -0
- package/dist/Operation.mjs +46 -0
- package/dist/Operation.mjs.map +1 -0
- package/dist/OperationDefinition.cjs +13 -0
- package/dist/OperationDefinition.d.cts +12 -0
- package/dist/OperationDefinition.d.cts.map +1 -0
- package/dist/OperationDefinition.d.mts +12 -0
- package/dist/OperationDefinition.d.mts.map +1 -0
- package/dist/OperationDefinition.mjs +13 -0
- package/dist/OperationDefinition.mjs.map +1 -0
- package/dist/OperationPath.cjs +148 -0
- package/dist/OperationPath.d.cts +60 -0
- package/dist/OperationPath.d.cts.map +1 -0
- package/dist/OperationPath.d.mts +60 -0
- package/dist/OperationPath.d.mts.map +1 -0
- package/dist/OperationPath.mjs +138 -0
- package/dist/OperationPath.mjs.map +1 -0
- package/dist/{Presence-gWrmGBeu.cjs → Presence.cjs} +4 -39
- package/dist/{Presence-N8u7Eppr.d.mts → Presence.d.cts} +2 -2
- package/dist/Presence.d.cts.map +1 -0
- package/dist/{Presence-DKKP4v5X.d.cts → Presence.d.mts} +2 -2
- package/dist/Presence.d.mts.map +1 -0
- package/dist/{Presence-DdMVKcOv.mjs → Presence.mjs} +3 -28
- package/dist/Presence.mjs.map +1 -0
- package/dist/Primitive.cjs +52 -0
- package/dist/Primitive.d.cts +20 -0
- package/dist/Primitive.d.cts.map +1 -0
- package/dist/Primitive.d.mts +20 -0
- package/dist/Primitive.d.mts.map +1 -0
- package/dist/Primitive.mjs +48 -0
- package/dist/Primitive.mjs.map +1 -0
- package/dist/ProxyEnvironment.cjs +34 -0
- package/dist/ProxyEnvironment.d.cts +31 -0
- package/dist/ProxyEnvironment.d.cts.map +1 -0
- package/dist/ProxyEnvironment.d.mts +31 -0
- package/dist/ProxyEnvironment.d.mts.map +1 -0
- package/dist/ProxyEnvironment.mjs +29 -0
- package/dist/ProxyEnvironment.mjs.map +1 -0
- package/dist/Transaction.cjs +66 -0
- package/dist/Transaction.d.cts +56 -0
- package/dist/Transaction.d.cts.map +1 -0
- package/dist/Transaction.d.mts +56 -0
- package/dist/Transaction.d.mts.map +1 -0
- package/dist/Transaction.mjs +58 -0
- package/dist/Transaction.mjs.map +1 -0
- package/dist/Transform.cjs +11 -0
- package/dist/Transform.d.cts +21 -0
- package/dist/Transform.d.cts.map +1 -0
- package/dist/Transform.d.mts +21 -0
- package/dist/Transform.d.mts.map +1 -0
- package/dist/Transform.mjs +6 -0
- package/dist/Transform.mjs.map +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/defineProperty.cjs +14 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/defineProperty.mjs +14 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/objectSpread2.cjs +27 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/objectSpread2.mjs +27 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/toPrimitive.cjs +16 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/toPrimitive.mjs +16 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/toPropertyKey.cjs +11 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/toPropertyKey.mjs +11 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/typeof.cjs +18 -0
- package/dist/_virtual/_@oxc-project_runtime@0.103.0/helpers/typeof.mjs +12 -0
- package/dist/_virtual/rolldown_runtime.cjs +43 -0
- package/dist/{chunk-CLMFDpHK.mjs → _virtual/rolldown_runtime.mjs} +1 -1
- package/dist/client/ClientDocument.cjs +590 -0
- package/dist/client/ClientDocument.d.cts +161 -0
- package/dist/client/ClientDocument.d.cts.map +1 -0
- package/dist/client/ClientDocument.d.mts +162 -0
- package/dist/client/ClientDocument.d.mts.map +1 -0
- package/dist/client/ClientDocument.mjs +586 -0
- package/dist/client/ClientDocument.mjs.map +1 -0
- package/dist/client/Rebase.cjs +204 -0
- package/dist/client/Rebase.d.cts +87 -0
- package/dist/client/Rebase.d.cts.map +1 -0
- package/dist/client/Rebase.d.mts +88 -0
- package/dist/client/Rebase.d.mts.map +1 -0
- package/dist/client/Rebase.mjs +198 -0
- package/dist/client/Rebase.mjs.map +1 -0
- package/dist/client/StateMonitor.cjs +133 -0
- package/dist/client/StateMonitor.d.cts +122 -0
- package/dist/client/StateMonitor.d.cts.map +1 -0
- package/dist/client/StateMonitor.d.mts +122 -0
- package/dist/client/StateMonitor.d.mts.map +1 -0
- package/dist/client/StateMonitor.mjs +129 -0
- package/dist/client/StateMonitor.mjs.map +1 -0
- package/dist/client/Transport.cjs +11 -0
- package/dist/client/Transport.d.cts +237 -0
- package/dist/client/Transport.d.cts.map +1 -0
- package/dist/client/Transport.d.mts +237 -0
- package/dist/client/Transport.d.mts.map +1 -0
- package/dist/client/Transport.mjs +6 -0
- package/dist/client/Transport.mjs.map +1 -0
- package/dist/client/WebSocketTransport.cjs +396 -0
- package/dist/client/WebSocketTransport.d.cts +29 -0
- package/dist/client/WebSocketTransport.d.cts.map +1 -0
- package/dist/client/WebSocketTransport.d.mts +29 -0
- package/dist/client/WebSocketTransport.d.mts.map +1 -0
- package/dist/client/WebSocketTransport.mjs +392 -0
- package/dist/client/WebSocketTransport.mjs.map +1 -0
- package/dist/client/errors.cjs +135 -0
- package/dist/client/errors.d.cts +87 -0
- package/dist/client/errors.d.cts.map +1 -0
- package/dist/client/errors.d.mts +87 -0
- package/dist/client/errors.d.mts.map +1 -0
- package/dist/client/errors.mjs +127 -0
- package/dist/client/errors.mjs.map +1 -0
- package/dist/client/index.cjs +22 -1424
- package/dist/client/index.d.cts +8 -692
- package/dist/client/index.d.mts +8 -692
- package/dist/client/index.mjs +9 -1413
- package/dist/index.cjs +20 -2973
- package/dist/index.d.cts +12 -419
- package/dist/index.d.mts +12 -419
- package/dist/index.mjs +13 -2968
- package/dist/primitives/Array.cjs +302 -0
- package/dist/primitives/Array.d.cts +95 -0
- package/dist/primitives/Array.d.cts.map +1 -0
- package/dist/primitives/Array.d.mts +95 -0
- package/dist/primitives/Array.d.mts.map +1 -0
- package/dist/primitives/Array.mjs +301 -0
- package/dist/primitives/Array.mjs.map +1 -0
- package/dist/primitives/Boolean.cjs +95 -0
- package/dist/primitives/Boolean.d.cts +44 -0
- package/dist/primitives/Boolean.d.cts.map +1 -0
- package/dist/primitives/Boolean.d.mts +44 -0
- package/dist/primitives/Boolean.d.mts.map +1 -0
- package/dist/primitives/Boolean.mjs +94 -0
- package/dist/primitives/Boolean.mjs.map +1 -0
- package/dist/primitives/Either.cjs +200 -0
- package/dist/primitives/Either.d.cts +113 -0
- package/dist/primitives/Either.d.cts.map +1 -0
- package/dist/primitives/Either.d.mts +113 -0
- package/dist/primitives/Either.d.mts.map +1 -0
- package/dist/primitives/Either.mjs +199 -0
- package/dist/primitives/Either.mjs.map +1 -0
- package/dist/primitives/Lazy.cjs +46 -0
- package/dist/primitives/Lazy.d.cts +46 -0
- package/dist/primitives/Lazy.d.cts.map +1 -0
- package/dist/primitives/Lazy.d.mts +46 -0
- package/dist/primitives/Lazy.d.mts.map +1 -0
- package/dist/primitives/Lazy.mjs +46 -0
- package/dist/primitives/Lazy.mjs.map +1 -0
- package/dist/primitives/Literal.cjs +91 -0
- package/dist/primitives/Literal.d.cts +46 -0
- package/dist/primitives/Literal.d.cts.map +1 -0
- package/dist/primitives/Literal.d.mts +46 -0
- package/dist/primitives/Literal.d.mts.map +1 -0
- package/dist/primitives/Literal.mjs +90 -0
- package/dist/primitives/Literal.mjs.map +1 -0
- package/dist/primitives/Number.cjs +115 -0
- package/dist/primitives/Number.d.cts +54 -0
- package/dist/primitives/Number.d.cts.map +1 -0
- package/dist/primitives/Number.d.mts +54 -0
- package/dist/primitives/Number.d.mts.map +1 -0
- package/dist/primitives/Number.mjs +114 -0
- package/dist/primitives/Number.mjs.map +1 -0
- package/dist/primitives/String.cjs +127 -0
- package/dist/primitives/String.d.cts +56 -0
- package/dist/primitives/String.d.cts.map +1 -0
- package/dist/primitives/String.d.mts +56 -0
- package/dist/primitives/String.d.mts.map +1 -0
- package/dist/primitives/String.mjs +126 -0
- package/dist/primitives/String.mjs.map +1 -0
- package/dist/primitives/Struct.cjs +207 -0
- package/dist/primitives/Struct.d.cts +96 -0
- package/dist/primitives/Struct.d.cts.map +1 -0
- package/dist/primitives/Struct.d.mts +97 -0
- package/dist/primitives/Struct.d.mts.map +1 -0
- package/dist/primitives/Struct.mjs +206 -0
- package/dist/primitives/Struct.mjs.map +1 -0
- package/dist/primitives/Tree.cjs +575 -0
- package/dist/primitives/Tree.d.cts +185 -0
- package/dist/primitives/Tree.d.cts.map +1 -0
- package/dist/primitives/Tree.d.mts +185 -0
- package/dist/primitives/Tree.d.mts.map +1 -0
- package/dist/primitives/Tree.mjs +574 -0
- package/dist/primitives/Tree.mjs.map +1 -0
- package/dist/primitives/TreeNode.cjs +73 -0
- package/dist/primitives/TreeNode.d.cts +92 -0
- package/dist/primitives/TreeNode.d.cts.map +1 -0
- package/dist/primitives/TreeNode.d.mts +93 -0
- package/dist/primitives/TreeNode.d.mts.map +1 -0
- package/dist/primitives/TreeNode.mjs +72 -0
- package/dist/primitives/TreeNode.mjs.map +1 -0
- package/dist/primitives/Union.cjs +170 -0
- package/dist/primitives/Union.d.cts +81 -0
- package/dist/primitives/Union.d.cts.map +1 -0
- package/dist/primitives/Union.d.mts +81 -0
- package/dist/primitives/Union.d.mts.map +1 -0
- package/dist/primitives/Union.mjs +169 -0
- package/dist/primitives/Union.mjs.map +1 -0
- package/dist/primitives/shared.cjs +60 -0
- package/dist/primitives/shared.d.cts +147 -0
- package/dist/primitives/shared.d.cts.map +1 -0
- package/dist/primitives/shared.d.mts +147 -0
- package/dist/primitives/shared.d.mts.map +1 -0
- package/dist/primitives/shared.mjs +58 -0
- package/dist/primitives/shared.mjs.map +1 -0
- package/dist/server/ServerDocument.cjs +110 -0
- package/dist/server/ServerDocument.d.cts +98 -0
- package/dist/server/ServerDocument.d.cts.map +1 -0
- package/dist/server/ServerDocument.d.mts +99 -0
- package/dist/server/ServerDocument.d.mts.map +1 -0
- package/dist/server/ServerDocument.mjs +106 -0
- package/dist/server/ServerDocument.mjs.map +1 -0
- package/dist/server/errors.cjs +85 -0
- package/dist/server/errors.d.cts +53 -0
- package/dist/server/errors.d.cts.map +1 -0
- package/dist/server/errors.d.mts +53 -0
- package/dist/server/errors.d.mts.map +1 -0
- package/dist/server/errors.mjs +81 -0
- package/dist/server/errors.mjs.map +1 -0
- package/dist/server/index.cjs +9 -185
- package/dist/server/index.d.cts +3 -148
- package/dist/server/index.d.mts +3 -148
- package/dist/server/index.mjs +3 -181
- package/dist/types/index.cjs +16 -0
- package/dist/types/index.d.cts +16 -0
- package/dist/types/index.d.cts.map +1 -0
- package/dist/types/index.d.mts +16 -0
- package/dist/types/index.d.mts.map +1 -0
- package/dist/types/index.mjs +12 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/utils/tree-helpers.cjs +443 -0
- package/dist/utils/tree-helpers.d.cts +280 -0
- package/dist/utils/tree-helpers.d.cts.map +1 -0
- package/dist/utils/tree-helpers.d.mts +280 -0
- package/dist/utils/tree-helpers.d.mts.map +1 -0
- package/dist/utils/tree-helpers.mjs +439 -0
- package/dist/utils/tree-helpers.mjs.map +1 -0
- package/package.json +2 -2
- package/tsdown.config.ts +1 -1
- package/dist/Document-ChuFrTk1.cjs +0 -571
- package/dist/Document-CwiAFTIq.mjs +0 -438
- package/dist/Document-CwiAFTIq.mjs.map +0 -1
- package/dist/Presence-DKKP4v5X.d.cts.map +0 -1
- package/dist/Presence-DdMVKcOv.mjs.map +0 -1
- package/dist/Presence-N8u7Eppr.d.mts.map +0 -1
- package/dist/Primitive-DqQFc3Gu.d.mts +0 -1180
- package/dist/Primitive-DqQFc3Gu.d.mts.map +0 -1
- package/dist/Primitive-awpEjnKL.d.cts +0 -1180
- package/dist/Primitive-awpEjnKL.d.cts.map +0 -1
- package/dist/client/index.d.cts.map +0 -1
- package/dist/client/index.d.mts.map +0 -1
- package/dist/client/index.mjs.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/server/index.d.cts.map +0 -1
- package/dist/server/index.d.mts.map +0 -1
- package/dist/server/index.mjs.map +0 -1
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
import { __export } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.103.0/helpers/objectSpread2.mjs";
|
|
3
|
+
import { isEmpty } from "../Transaction.mjs";
|
|
4
|
+
import { make as make$1 } from "../Document.mjs";
|
|
5
|
+
import { validate } from "../Presence.mjs";
|
|
6
|
+
import { rebaseAfterRejectionWithPrimitive, transformTransactionWithPrimitive } from "./Rebase.mjs";
|
|
7
|
+
import { InvalidStateError, NotConnectedError } from "./errors.mjs";
|
|
8
|
+
|
|
9
|
+
//#region src/client/ClientDocument.ts
|
|
10
|
+
var ClientDocument_exports = /* @__PURE__ */ __export({ make: () => make });
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new ClientDocument for the given schema.
|
|
13
|
+
*/
|
|
14
|
+
const make = (options) => {
|
|
15
|
+
const { schema, transport, initialState, initialVersion = 0, onRejection, onStateChange, onConnectionChange, onReady, transactionTimeout = 3e4, initTimeout = 1e4, debug = false, presence: presenceSchema, initialPresence } = options;
|
|
16
|
+
let _serverState = initialState;
|
|
17
|
+
let _serverVersion = initialVersion;
|
|
18
|
+
let _pending = [];
|
|
19
|
+
let _serverTransactionHistory = [];
|
|
20
|
+
const MAX_HISTORY_SIZE = 100;
|
|
21
|
+
let _optimisticDoc = make$1(schema, { initial: _serverState });
|
|
22
|
+
let _unsubscribe = null;
|
|
23
|
+
const _timeoutHandles = /* @__PURE__ */ new Map();
|
|
24
|
+
let _initState = initialState !== void 0 ? { type: "ready" } : { type: "uninitialized" };
|
|
25
|
+
let _initTimeoutHandle = null;
|
|
26
|
+
let _initResolver = null;
|
|
27
|
+
let _initRejecter = null;
|
|
28
|
+
const _subscribers = /* @__PURE__ */ new Set();
|
|
29
|
+
let _presenceSelfId = void 0;
|
|
30
|
+
let _presenceSelfData = void 0;
|
|
31
|
+
const _presenceOthers = /* @__PURE__ */ new Map();
|
|
32
|
+
const _presenceSubscribers = /* @__PURE__ */ new Set();
|
|
33
|
+
/**
|
|
34
|
+
* Debug logging helper that only logs when debug is enabled.
|
|
35
|
+
*/
|
|
36
|
+
const debugLog = (...args) => {
|
|
37
|
+
if (debug) console.log("[ClientDocument]", ...args);
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Notifies all listeners of a state change.
|
|
41
|
+
*/
|
|
42
|
+
const notifyStateChange = (state) => {
|
|
43
|
+
debugLog("notifyStateChange", {
|
|
44
|
+
state,
|
|
45
|
+
subscriberCount: _subscribers.size,
|
|
46
|
+
hasOnStateChange: !!onStateChange
|
|
47
|
+
});
|
|
48
|
+
onStateChange === null || onStateChange === void 0 || onStateChange(state);
|
|
49
|
+
for (const listener of _subscribers) {
|
|
50
|
+
var _listener$onStateChan;
|
|
51
|
+
(_listener$onStateChan = listener.onStateChange) === null || _listener$onStateChan === void 0 || _listener$onStateChan.call(listener, state);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Notifies all listeners of a connection change.
|
|
56
|
+
*/
|
|
57
|
+
const notifyConnectionChange = (connected) => {
|
|
58
|
+
debugLog("notifyConnectionChange", {
|
|
59
|
+
connected,
|
|
60
|
+
subscriberCount: _subscribers.size,
|
|
61
|
+
hasOnConnectionChange: !!onConnectionChange
|
|
62
|
+
});
|
|
63
|
+
onConnectionChange === null || onConnectionChange === void 0 || onConnectionChange(connected);
|
|
64
|
+
for (const listener of _subscribers) {
|
|
65
|
+
var _listener$onConnectio;
|
|
66
|
+
(_listener$onConnectio = listener.onConnectionChange) === null || _listener$onConnectio === void 0 || _listener$onConnectio.call(listener, connected);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Notifies all listeners when ready.
|
|
71
|
+
*/
|
|
72
|
+
const notifyReady = () => {
|
|
73
|
+
debugLog("notifyReady", {
|
|
74
|
+
subscriberCount: _subscribers.size,
|
|
75
|
+
hasOnReady: !!onReady
|
|
76
|
+
});
|
|
77
|
+
onReady === null || onReady === void 0 || onReady();
|
|
78
|
+
for (const listener of _subscribers) {
|
|
79
|
+
var _listener$onReady;
|
|
80
|
+
(_listener$onReady = listener.onReady) === null || _listener$onReady === void 0 || _listener$onReady.call(listener);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Notifies all presence listeners of a change.
|
|
85
|
+
*/
|
|
86
|
+
const notifyPresenceChange = () => {
|
|
87
|
+
debugLog("notifyPresenceChange", { subscriberCount: _presenceSubscribers.size });
|
|
88
|
+
for (const listener of _presenceSubscribers) try {
|
|
89
|
+
var _listener$onPresenceC;
|
|
90
|
+
(_listener$onPresenceC = listener.onPresenceChange) === null || _listener$onPresenceC === void 0 || _listener$onPresenceC.call(listener);
|
|
91
|
+
} catch (_unused) {}
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Handles incoming presence snapshot from server.
|
|
95
|
+
*/
|
|
96
|
+
const handlePresenceSnapshot = (message) => {
|
|
97
|
+
if (!presenceSchema) return;
|
|
98
|
+
debugLog("handlePresenceSnapshot", {
|
|
99
|
+
selfId: message.selfId,
|
|
100
|
+
presenceCount: Object.keys(message.presences).length
|
|
101
|
+
});
|
|
102
|
+
_presenceSelfId = message.selfId;
|
|
103
|
+
_presenceOthers.clear();
|
|
104
|
+
for (const [id, entry] of Object.entries(message.presences)) if (id !== message.selfId) _presenceOthers.set(id, entry);
|
|
105
|
+
notifyPresenceChange();
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Handles incoming presence update from server (another user).
|
|
109
|
+
*/
|
|
110
|
+
const handlePresenceUpdate = (message) => {
|
|
111
|
+
if (!presenceSchema) return;
|
|
112
|
+
debugLog("handlePresenceUpdate", {
|
|
113
|
+
id: message.id,
|
|
114
|
+
userId: message.userId
|
|
115
|
+
});
|
|
116
|
+
_presenceOthers.set(message.id, {
|
|
117
|
+
data: message.data,
|
|
118
|
+
userId: message.userId
|
|
119
|
+
});
|
|
120
|
+
notifyPresenceChange();
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Handles incoming presence remove from server (user disconnected).
|
|
124
|
+
*/
|
|
125
|
+
const handlePresenceRemove = (message) => {
|
|
126
|
+
if (!presenceSchema) return;
|
|
127
|
+
debugLog("handlePresenceRemove", { id: message.id });
|
|
128
|
+
_presenceOthers.delete(message.id);
|
|
129
|
+
notifyPresenceChange();
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Clears all presence state (on disconnect).
|
|
133
|
+
*/
|
|
134
|
+
const clearPresenceState = () => {
|
|
135
|
+
_presenceSelfId = void 0;
|
|
136
|
+
_presenceSelfData = void 0;
|
|
137
|
+
_presenceOthers.clear();
|
|
138
|
+
notifyPresenceChange();
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Recomputes the optimistic document from server state + pending transactions.
|
|
142
|
+
*/
|
|
143
|
+
const recomputeOptimisticState = () => {
|
|
144
|
+
debugLog("recomputeOptimisticState", {
|
|
145
|
+
serverVersion: _serverVersion,
|
|
146
|
+
pendingCount: _pending.length,
|
|
147
|
+
serverState: _serverState
|
|
148
|
+
});
|
|
149
|
+
_optimisticDoc = make$1(schema, { initial: _serverState });
|
|
150
|
+
for (const pending of _pending) _optimisticDoc.apply(pending.transaction.ops);
|
|
151
|
+
const newState = _optimisticDoc.get();
|
|
152
|
+
debugLog("recomputeOptimisticState: new optimistic state", newState);
|
|
153
|
+
notifyStateChange(newState);
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Adds a transaction to pending queue and sends to server.
|
|
157
|
+
*/
|
|
158
|
+
const submitTransaction = (tx) => {
|
|
159
|
+
if (!transport.isConnected()) throw new NotConnectedError();
|
|
160
|
+
debugLog("submitTransaction", {
|
|
161
|
+
txId: tx.id,
|
|
162
|
+
ops: tx.ops,
|
|
163
|
+
pendingCount: _pending.length + 1
|
|
164
|
+
});
|
|
165
|
+
const pending = {
|
|
166
|
+
transaction: tx,
|
|
167
|
+
original: tx,
|
|
168
|
+
sentAt: Date.now()
|
|
169
|
+
};
|
|
170
|
+
_pending.push(pending);
|
|
171
|
+
const timeoutHandle = setTimeout(() => {
|
|
172
|
+
handleTransactionTimeout(tx.id);
|
|
173
|
+
}, transactionTimeout);
|
|
174
|
+
_timeoutHandles.set(tx.id, timeoutHandle);
|
|
175
|
+
transport.send(tx);
|
|
176
|
+
debugLog("submitTransaction: sent to server", { txId: tx.id });
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Handles a transaction timeout.
|
|
180
|
+
*/
|
|
181
|
+
const handleTransactionTimeout = (txId) => {
|
|
182
|
+
debugLog("handleTransactionTimeout", { txId });
|
|
183
|
+
const index = _pending.findIndex((p) => p.transaction.id === txId);
|
|
184
|
+
if (index === -1) {
|
|
185
|
+
debugLog("handleTransactionTimeout: transaction not found (already confirmed/rejected)", { txId });
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const [removed] = _pending.splice(index, 1);
|
|
189
|
+
_timeoutHandles.delete(txId);
|
|
190
|
+
debugLog("handleTransactionTimeout: removed from pending", {
|
|
191
|
+
txId,
|
|
192
|
+
remainingPending: _pending.length
|
|
193
|
+
});
|
|
194
|
+
recomputeOptimisticState();
|
|
195
|
+
onRejection === null || onRejection === void 0 || onRejection(removed.transaction, "Transaction timed out");
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Handles an incoming server transaction.
|
|
199
|
+
*/
|
|
200
|
+
const handleServerTransaction = (serverTx, version) => {
|
|
201
|
+
debugLog("handleServerTransaction", {
|
|
202
|
+
txId: serverTx.id,
|
|
203
|
+
version,
|
|
204
|
+
ops: serverTx.ops,
|
|
205
|
+
currentServerVersion: _serverVersion,
|
|
206
|
+
pendingCount: _pending.length
|
|
207
|
+
});
|
|
208
|
+
_serverVersion = version;
|
|
209
|
+
const pendingIndex = _pending.findIndex((p) => p.transaction.id === serverTx.id);
|
|
210
|
+
if (pendingIndex !== -1) {
|
|
211
|
+
debugLog("handleServerTransaction: transaction confirmed (ACK)", {
|
|
212
|
+
txId: serverTx.id,
|
|
213
|
+
pendingIndex
|
|
214
|
+
});
|
|
215
|
+
_pending[pendingIndex];
|
|
216
|
+
const timeoutHandle = _timeoutHandles.get(serverTx.id);
|
|
217
|
+
if (timeoutHandle) {
|
|
218
|
+
clearTimeout(timeoutHandle);
|
|
219
|
+
_timeoutHandles.delete(serverTx.id);
|
|
220
|
+
}
|
|
221
|
+
_pending.splice(pendingIndex, 1);
|
|
222
|
+
const tempDoc = make$1(schema, { initial: _serverState });
|
|
223
|
+
tempDoc.apply(serverTx.ops);
|
|
224
|
+
_serverState = tempDoc.get();
|
|
225
|
+
debugLog("handleServerTransaction: updated server state", {
|
|
226
|
+
txId: serverTx.id,
|
|
227
|
+
newServerState: _serverState,
|
|
228
|
+
remainingPending: _pending.length
|
|
229
|
+
});
|
|
230
|
+
recomputeOptimisticState();
|
|
231
|
+
} else {
|
|
232
|
+
debugLog("handleServerTransaction: remote transaction, rebasing pending", {
|
|
233
|
+
txId: serverTx.id,
|
|
234
|
+
pendingCount: _pending.length
|
|
235
|
+
});
|
|
236
|
+
const tempDoc = make$1(schema, { initial: _serverState });
|
|
237
|
+
tempDoc.apply(serverTx.ops);
|
|
238
|
+
_serverState = tempDoc.get();
|
|
239
|
+
_serverTransactionHistory.push(serverTx);
|
|
240
|
+
if (_serverTransactionHistory.length > MAX_HISTORY_SIZE) _serverTransactionHistory.shift();
|
|
241
|
+
const rebasedPending = _pending.map((p) => _objectSpread2(_objectSpread2({}, p), {}, { transaction: transformTransactionWithPrimitive(p.transaction, serverTx, schema) }));
|
|
242
|
+
debugLog("handleServerTransaction: rebased pending transactions", {
|
|
243
|
+
txId: serverTx.id,
|
|
244
|
+
rebasedCount: rebasedPending.length,
|
|
245
|
+
originalPendingIds: _pending.map((p) => p.transaction.id),
|
|
246
|
+
rebasedPendingIds: rebasedPending.map((p) => p.transaction.id)
|
|
247
|
+
});
|
|
248
|
+
_pending = rebasedPending;
|
|
249
|
+
recomputeOptimisticState();
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Handles a transaction rejection from the server.
|
|
254
|
+
*/
|
|
255
|
+
const handleRejection = (txId, reason) => {
|
|
256
|
+
debugLog("handleRejection", {
|
|
257
|
+
txId,
|
|
258
|
+
reason,
|
|
259
|
+
pendingCount: _pending.length
|
|
260
|
+
});
|
|
261
|
+
const index = _pending.findIndex((p) => p.transaction.id === txId);
|
|
262
|
+
if (index === -1) {
|
|
263
|
+
debugLog("handleRejection: transaction not found (already removed)", { txId });
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const rejected = _pending[index];
|
|
267
|
+
const timeoutHandle = _timeoutHandles.get(txId);
|
|
268
|
+
if (timeoutHandle) {
|
|
269
|
+
clearTimeout(timeoutHandle);
|
|
270
|
+
_timeoutHandles.delete(txId);
|
|
271
|
+
}
|
|
272
|
+
_pending.splice(index, 1);
|
|
273
|
+
debugLog("handleRejection: removed rejected transaction, rebasing remaining", {
|
|
274
|
+
txId,
|
|
275
|
+
remainingPending: _pending.length,
|
|
276
|
+
serverHistorySize: _serverTransactionHistory.length
|
|
277
|
+
});
|
|
278
|
+
const remainingOriginals = _pending.map((p) => p.original);
|
|
279
|
+
const retransformed = rebaseAfterRejectionWithPrimitive([...remainingOriginals, rejected.original], txId, _serverTransactionHistory, schema);
|
|
280
|
+
_pending = _pending.map((p, i) => {
|
|
281
|
+
var _retransformed$i;
|
|
282
|
+
return _objectSpread2(_objectSpread2({}, p), {}, { transaction: (_retransformed$i = retransformed[i]) !== null && _retransformed$i !== void 0 ? _retransformed$i : p.transaction });
|
|
283
|
+
});
|
|
284
|
+
debugLog("handleRejection: rebased remaining transactions", {
|
|
285
|
+
txId,
|
|
286
|
+
rebasedCount: _pending.length
|
|
287
|
+
});
|
|
288
|
+
recomputeOptimisticState();
|
|
289
|
+
onRejection === null || onRejection === void 0 || onRejection(rejected.original, reason);
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Handles a snapshot from the server.
|
|
293
|
+
* @param isInitialSnapshot - If true, this is the initial sync snapshot
|
|
294
|
+
*/
|
|
295
|
+
const handleSnapshot = (state, version, isInitialSnapshot = false) => {
|
|
296
|
+
debugLog("handleSnapshot", {
|
|
297
|
+
isInitialSnapshot,
|
|
298
|
+
version,
|
|
299
|
+
currentServerVersion: _serverVersion,
|
|
300
|
+
pendingCount: _pending.length,
|
|
301
|
+
state
|
|
302
|
+
});
|
|
303
|
+
if (!isInitialSnapshot) {
|
|
304
|
+
debugLog("handleSnapshot: non-initial snapshot, clearing pending transactions", { clearedPendingCount: _pending.length });
|
|
305
|
+
for (const handle of _timeoutHandles.values()) clearTimeout(handle);
|
|
306
|
+
_timeoutHandles.clear();
|
|
307
|
+
for (const pending of _pending) onRejection === null || onRejection === void 0 || onRejection(pending.original, "State reset due to resync");
|
|
308
|
+
_pending = [];
|
|
309
|
+
}
|
|
310
|
+
_serverTransactionHistory = [];
|
|
311
|
+
_serverState = state;
|
|
312
|
+
_serverVersion = version;
|
|
313
|
+
debugLog("handleSnapshot: updated server state", {
|
|
314
|
+
newVersion: _serverVersion,
|
|
315
|
+
newState: _serverState
|
|
316
|
+
});
|
|
317
|
+
recomputeOptimisticState();
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Processes buffered messages after receiving the initial snapshot.
|
|
321
|
+
* Filters out transactions already included in the snapshot (version <= snapshotVersion)
|
|
322
|
+
* and applies newer transactions in order.
|
|
323
|
+
*/
|
|
324
|
+
const processBufferedMessages = (bufferedMessages, snapshotVersion) => {
|
|
325
|
+
debugLog("processBufferedMessages", {
|
|
326
|
+
bufferedCount: bufferedMessages.length,
|
|
327
|
+
snapshotVersion
|
|
328
|
+
});
|
|
329
|
+
const sortedMessages = [...bufferedMessages].sort((a, b) => {
|
|
330
|
+
if (a.type === "transaction" && b.type === "transaction") return a.version - b.version;
|
|
331
|
+
return 0;
|
|
332
|
+
});
|
|
333
|
+
for (const message of sortedMessages) switch (message.type) {
|
|
334
|
+
case "transaction":
|
|
335
|
+
if (message.version > snapshotVersion) {
|
|
336
|
+
debugLog("processBufferedMessages: applying buffered transaction", {
|
|
337
|
+
txId: message.transaction.id,
|
|
338
|
+
version: message.version,
|
|
339
|
+
snapshotVersion
|
|
340
|
+
});
|
|
341
|
+
handleServerTransaction(message.transaction, message.version);
|
|
342
|
+
} else debugLog("processBufferedMessages: skipping buffered transaction (already in snapshot)", {
|
|
343
|
+
txId: message.transaction.id,
|
|
344
|
+
version: message.version,
|
|
345
|
+
snapshotVersion
|
|
346
|
+
});
|
|
347
|
+
break;
|
|
348
|
+
case "error":
|
|
349
|
+
debugLog("processBufferedMessages: processing buffered error", {
|
|
350
|
+
txId: message.transactionId,
|
|
351
|
+
reason: message.reason
|
|
352
|
+
});
|
|
353
|
+
handleRejection(message.transactionId, message.reason);
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Completes initialization and transitions to ready state.
|
|
359
|
+
*/
|
|
360
|
+
const completeInitialization = () => {
|
|
361
|
+
debugLog("completeInitialization");
|
|
362
|
+
if (_initTimeoutHandle !== null) {
|
|
363
|
+
clearTimeout(_initTimeoutHandle);
|
|
364
|
+
_initTimeoutHandle = null;
|
|
365
|
+
}
|
|
366
|
+
_initState = { type: "ready" };
|
|
367
|
+
if (_initResolver) {
|
|
368
|
+
_initResolver();
|
|
369
|
+
_initResolver = null;
|
|
370
|
+
_initRejecter = null;
|
|
371
|
+
}
|
|
372
|
+
debugLog("completeInitialization: ready", {
|
|
373
|
+
serverVersion: _serverVersion,
|
|
374
|
+
serverState: _serverState
|
|
375
|
+
});
|
|
376
|
+
notifyReady();
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* Handles initialization timeout.
|
|
380
|
+
*/
|
|
381
|
+
const handleInitTimeout = () => {
|
|
382
|
+
debugLog("handleInitTimeout: initialization timed out");
|
|
383
|
+
_initTimeoutHandle = null;
|
|
384
|
+
if (_initRejecter) {
|
|
385
|
+
_initRejecter(/* @__PURE__ */ new Error("Initialization timed out waiting for snapshot"));
|
|
386
|
+
_initResolver = null;
|
|
387
|
+
_initRejecter = null;
|
|
388
|
+
}
|
|
389
|
+
_initState = { type: "uninitialized" };
|
|
390
|
+
};
|
|
391
|
+
/**
|
|
392
|
+
* Handles incoming server messages.
|
|
393
|
+
* During initialization, messages are buffered until the snapshot arrives.
|
|
394
|
+
* Presence messages are always processed immediately (not buffered).
|
|
395
|
+
*/
|
|
396
|
+
const handleServerMessage = (message) => {
|
|
397
|
+
debugLog("handleServerMessage", {
|
|
398
|
+
messageType: message.type,
|
|
399
|
+
initState: _initState.type
|
|
400
|
+
});
|
|
401
|
+
if (message.type === "presence_snapshot") {
|
|
402
|
+
handlePresenceSnapshot(message);
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
if (message.type === "presence_update") {
|
|
406
|
+
handlePresenceUpdate(message);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
if (message.type === "presence_remove") {
|
|
410
|
+
handlePresenceRemove(message);
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
if (_initState.type === "initializing") {
|
|
414
|
+
if (message.type === "snapshot") {
|
|
415
|
+
debugLog("handleServerMessage: received snapshot during initialization", {
|
|
416
|
+
version: message.version,
|
|
417
|
+
bufferedCount: _initState.bufferedMessages.length
|
|
418
|
+
});
|
|
419
|
+
const buffered = _initState.bufferedMessages;
|
|
420
|
+
handleSnapshot(message.state, message.version, true);
|
|
421
|
+
processBufferedMessages(buffered, message.version);
|
|
422
|
+
completeInitialization();
|
|
423
|
+
} else {
|
|
424
|
+
debugLog("handleServerMessage: buffering message during initialization", {
|
|
425
|
+
messageType: message.type,
|
|
426
|
+
bufferedCount: _initState.bufferedMessages.length + 1
|
|
427
|
+
});
|
|
428
|
+
_initState.bufferedMessages.push(message);
|
|
429
|
+
}
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
switch (message.type) {
|
|
433
|
+
case "transaction":
|
|
434
|
+
handleServerTransaction(message.transaction, message.version);
|
|
435
|
+
break;
|
|
436
|
+
case "snapshot":
|
|
437
|
+
handleSnapshot(message.state, message.version, false);
|
|
438
|
+
break;
|
|
439
|
+
case "error":
|
|
440
|
+
handleRejection(message.transactionId, message.reason);
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
return {
|
|
445
|
+
schema,
|
|
446
|
+
get root() {
|
|
447
|
+
return _optimisticDoc.root;
|
|
448
|
+
},
|
|
449
|
+
get: () => _optimisticDoc.get(),
|
|
450
|
+
getServerState: () => _serverState,
|
|
451
|
+
getServerVersion: () => _serverVersion,
|
|
452
|
+
getPendingCount: () => _pending.length,
|
|
453
|
+
hasPendingChanges: () => _pending.length > 0,
|
|
454
|
+
transaction: (fn) => {
|
|
455
|
+
debugLog("transaction: starting", {
|
|
456
|
+
isConnected: transport.isConnected(),
|
|
457
|
+
isReady: _initState.type === "ready",
|
|
458
|
+
pendingCount: _pending.length
|
|
459
|
+
});
|
|
460
|
+
if (!transport.isConnected()) throw new NotConnectedError();
|
|
461
|
+
if (_initState.type !== "ready") throw new InvalidStateError("Client is not ready. Wait for initialization to complete.");
|
|
462
|
+
const result = _optimisticDoc.transaction(fn);
|
|
463
|
+
const tx = _optimisticDoc.flush();
|
|
464
|
+
if (!isEmpty(tx)) {
|
|
465
|
+
debugLog("transaction: flushed, submitting", {
|
|
466
|
+
txId: tx.id,
|
|
467
|
+
opsCount: tx.ops.length
|
|
468
|
+
});
|
|
469
|
+
submitTransaction(tx);
|
|
470
|
+
} else debugLog("transaction: flushed, empty transaction (no ops)");
|
|
471
|
+
notifyStateChange(_optimisticDoc.get());
|
|
472
|
+
return result;
|
|
473
|
+
},
|
|
474
|
+
connect: async () => {
|
|
475
|
+
debugLog("connect: starting");
|
|
476
|
+
_unsubscribe = transport.subscribe(handleServerMessage);
|
|
477
|
+
await transport.connect();
|
|
478
|
+
debugLog("connect: transport connected");
|
|
479
|
+
notifyConnectionChange(true);
|
|
480
|
+
if (presenceSchema && initialPresence !== void 0) {
|
|
481
|
+
debugLog("connect: setting initial presence", { initialPresence });
|
|
482
|
+
const validated = validate(presenceSchema, initialPresence);
|
|
483
|
+
_presenceSelfData = validated;
|
|
484
|
+
transport.sendPresenceSet(validated);
|
|
485
|
+
notifyPresenceChange();
|
|
486
|
+
}
|
|
487
|
+
if (_initState.type === "ready") {
|
|
488
|
+
debugLog("connect: already ready (has initial state)");
|
|
489
|
+
notifyReady();
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
_initState = {
|
|
493
|
+
type: "initializing",
|
|
494
|
+
bufferedMessages: []
|
|
495
|
+
};
|
|
496
|
+
debugLog("connect: entering initializing state", { initTimeout });
|
|
497
|
+
_initTimeoutHandle = setTimeout(handleInitTimeout, initTimeout);
|
|
498
|
+
const readyPromise = new Promise((resolve, reject) => {
|
|
499
|
+
_initResolver = resolve;
|
|
500
|
+
_initRejecter = reject;
|
|
501
|
+
});
|
|
502
|
+
debugLog("connect: requesting initial snapshot");
|
|
503
|
+
transport.requestSnapshot();
|
|
504
|
+
await readyPromise;
|
|
505
|
+
debugLog("connect: completed");
|
|
506
|
+
},
|
|
507
|
+
disconnect: () => {
|
|
508
|
+
debugLog("disconnect: starting", {
|
|
509
|
+
pendingCount: _pending.length,
|
|
510
|
+
initState: _initState.type
|
|
511
|
+
});
|
|
512
|
+
for (const handle of _timeoutHandles.values()) clearTimeout(handle);
|
|
513
|
+
_timeoutHandles.clear();
|
|
514
|
+
if (_initTimeoutHandle !== null) {
|
|
515
|
+
clearTimeout(_initTimeoutHandle);
|
|
516
|
+
_initTimeoutHandle = null;
|
|
517
|
+
}
|
|
518
|
+
if (_initRejecter) {
|
|
519
|
+
_initRejecter(/* @__PURE__ */ new Error("Disconnected during initialization"));
|
|
520
|
+
_initResolver = null;
|
|
521
|
+
_initRejecter = null;
|
|
522
|
+
}
|
|
523
|
+
if (_initState.type === "initializing") _initState = { type: "uninitialized" };
|
|
524
|
+
clearPresenceState();
|
|
525
|
+
if (_unsubscribe) {
|
|
526
|
+
_unsubscribe();
|
|
527
|
+
_unsubscribe = null;
|
|
528
|
+
}
|
|
529
|
+
transport.disconnect();
|
|
530
|
+
notifyConnectionChange(false);
|
|
531
|
+
debugLog("disconnect: completed");
|
|
532
|
+
},
|
|
533
|
+
isConnected: () => transport.isConnected(),
|
|
534
|
+
isReady: () => _initState.type === "ready",
|
|
535
|
+
resync: () => {
|
|
536
|
+
debugLog("resync: requesting snapshot", {
|
|
537
|
+
currentVersion: _serverVersion,
|
|
538
|
+
pendingCount: _pending.length
|
|
539
|
+
});
|
|
540
|
+
if (!transport.isConnected()) throw new NotConnectedError();
|
|
541
|
+
transport.requestSnapshot();
|
|
542
|
+
},
|
|
543
|
+
subscribe: (listener) => {
|
|
544
|
+
_subscribers.add(listener);
|
|
545
|
+
return () => {
|
|
546
|
+
_subscribers.delete(listener);
|
|
547
|
+
};
|
|
548
|
+
},
|
|
549
|
+
presence: presenceSchema ? {
|
|
550
|
+
selfId: () => _presenceSelfId,
|
|
551
|
+
self: () => _presenceSelfData,
|
|
552
|
+
others: () => _presenceOthers,
|
|
553
|
+
all: () => {
|
|
554
|
+
const all = /* @__PURE__ */ new Map();
|
|
555
|
+
for (const [id, entry] of _presenceOthers) all.set(id, entry);
|
|
556
|
+
if (_presenceSelfId !== void 0 && _presenceSelfData !== void 0) all.set(_presenceSelfId, { data: _presenceSelfData });
|
|
557
|
+
return all;
|
|
558
|
+
},
|
|
559
|
+
set: (data) => {
|
|
560
|
+
if (!presenceSchema) return;
|
|
561
|
+
const validated = validate(presenceSchema, data);
|
|
562
|
+
debugLog("presence.set", { data: validated });
|
|
563
|
+
_presenceSelfData = validated;
|
|
564
|
+
transport.sendPresenceSet(validated);
|
|
565
|
+
notifyPresenceChange();
|
|
566
|
+
},
|
|
567
|
+
clear: () => {
|
|
568
|
+
if (!presenceSchema) return;
|
|
569
|
+
debugLog("presence.clear");
|
|
570
|
+
_presenceSelfData = void 0;
|
|
571
|
+
transport.sendPresenceClear();
|
|
572
|
+
notifyPresenceChange();
|
|
573
|
+
},
|
|
574
|
+
subscribe: (listener) => {
|
|
575
|
+
_presenceSubscribers.add(listener);
|
|
576
|
+
return () => {
|
|
577
|
+
_presenceSubscribers.delete(listener);
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
} : void 0
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
//#endregion
|
|
585
|
+
export { ClientDocument_exports };
|
|
586
|
+
//# sourceMappingURL=ClientDocument.mjs.map
|