@liveblocks/core 3.1.1-prismic1 → 3.1.1
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/dist/index.cjs +95 -95
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/version.ts
|
|
8
8
|
var PKG_NAME = "@liveblocks/core";
|
|
9
|
-
var PKG_VERSION = "3.1.1
|
|
9
|
+
var PKG_VERSION = "3.1.1";
|
|
10
10
|
var PKG_FORMAT = "cjs";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -3794,8 +3794,8 @@ function createStore_forTools() {
|
|
|
3794
3794
|
return DerivedSignal.from(() => {
|
|
3795
3795
|
return (
|
|
3796
3796
|
// A tool that's registered and scoped to a specific chat ID...
|
|
3797
|
-
_nullishCoalesce(_optionalChain([(chatId !== void 0 ?
|
|
3798
|
-
|
|
3797
|
+
_nullishCoalesce(_optionalChain([(chatId !== void 0 ? toolsByChatId\u03A3.getOrCreate(chatId).getOrCreate(name) : void 0), 'optionalAccess', _57 => _57.get, 'call', _58 => _58()]), () => ( // ...or a globally registered tool
|
|
3798
|
+
toolsByChatId\u03A3.getOrCreate(kWILDCARD).getOrCreate(name).get()))
|
|
3799
3799
|
);
|
|
3800
3800
|
});
|
|
3801
3801
|
});
|
|
@@ -3824,8 +3824,8 @@ function createStore_forTools() {
|
|
|
3824
3824
|
const globalTools\u03A3 = toolsByChatId\u03A3.get(kWILDCARD);
|
|
3825
3825
|
const scopedTools\u03A3 = toolsByChatId\u03A3.get(chatId);
|
|
3826
3826
|
return Array.from([
|
|
3827
|
-
..._nullishCoalesce(_optionalChain([globalTools\u03A3, 'optionalAccess',
|
|
3828
|
-
..._nullishCoalesce(_optionalChain([scopedTools\u03A3, 'optionalAccess',
|
|
3827
|
+
..._nullishCoalesce(_optionalChain([globalTools\u03A3, 'optionalAccess', _59 => _59.entries, 'call', _60 => _60()]), () => ( [])),
|
|
3828
|
+
..._nullishCoalesce(_optionalChain([scopedTools\u03A3, 'optionalAccess', _61 => _61.entries, 'call', _62 => _62()]), () => ( []))
|
|
3829
3829
|
]).flatMap(([name, tool\u03A3]) => {
|
|
3830
3830
|
const tool = tool\u03A3.get();
|
|
3831
3831
|
return tool && (_nullishCoalesce(tool.enabled, () => ( true))) ? [{ name, description: tool.description, parameters: tool.parameters }] : [];
|
|
@@ -3926,7 +3926,7 @@ function createStore_forChatMessages(toolsStore, setToolResultFn) {
|
|
|
3926
3926
|
} else {
|
|
3927
3927
|
continue;
|
|
3928
3928
|
}
|
|
3929
|
-
const executeFn = _optionalChain([toolsStore, 'access',
|
|
3929
|
+
const executeFn = _optionalChain([toolsStore, 'access', _63 => _63.getTool\u03A3, 'call', _64 => _64(toolInvocation.name, message.chatId), 'access', _65 => _65.get, 'call', _66 => _66(), 'optionalAccess', _67 => _67.execute]);
|
|
3930
3930
|
if (executeFn) {
|
|
3931
3931
|
(async () => {
|
|
3932
3932
|
const result = await executeFn(toolInvocation.args, {
|
|
@@ -4021,8 +4021,8 @@ function createStore_forChatMessages(toolsStore, setToolResultFn) {
|
|
|
4021
4021
|
const spine = [];
|
|
4022
4022
|
let lastVisitedMessage = null;
|
|
4023
4023
|
for (const message2 of pool.walkUp(leaf.id)) {
|
|
4024
|
-
const prev = _nullishCoalesce(_optionalChain([first, 'call',
|
|
4025
|
-
const next = _nullishCoalesce(_optionalChain([first, 'call',
|
|
4024
|
+
const prev = _nullishCoalesce(_optionalChain([first, 'call', _68 => _68(pool.walkLeft(message2.id, isAlive)), 'optionalAccess', _69 => _69.id]), () => ( null));
|
|
4025
|
+
const next = _nullishCoalesce(_optionalChain([first, 'call', _70 => _70(pool.walkRight(message2.id, isAlive)), 'optionalAccess', _71 => _71.id]), () => ( null));
|
|
4026
4026
|
if (!message2.deletedAt || prev || next) {
|
|
4027
4027
|
const node = {
|
|
4028
4028
|
...message2,
|
|
@@ -4215,7 +4215,7 @@ function createAi(config) {
|
|
|
4215
4215
|
if ("event" in msg) {
|
|
4216
4216
|
switch (msg.event) {
|
|
4217
4217
|
case "cmd-failed":
|
|
4218
|
-
_optionalChain([pendingCmd, 'optionalAccess',
|
|
4218
|
+
_optionalChain([pendingCmd, 'optionalAccess', _72 => _72.reject, 'call', _73 => _73(new Error(msg.error))]);
|
|
4219
4219
|
break;
|
|
4220
4220
|
case "delta": {
|
|
4221
4221
|
const { id, delta } = msg;
|
|
@@ -4297,7 +4297,7 @@ function createAi(config) {
|
|
|
4297
4297
|
return assertNever(msg, "Unhandled case");
|
|
4298
4298
|
}
|
|
4299
4299
|
}
|
|
4300
|
-
_optionalChain([pendingCmd, 'optionalAccess',
|
|
4300
|
+
_optionalChain([pendingCmd, 'optionalAccess', _74 => _74.resolve, 'call', _75 => _75(msg)]);
|
|
4301
4301
|
}
|
|
4302
4302
|
managedSocket.events.onMessage.subscribe(handleServerMessage);
|
|
4303
4303
|
managedSocket.events.statusDidChange.subscribe(onStatusDidChange);
|
|
@@ -4381,9 +4381,9 @@ function createAi(config) {
|
|
|
4381
4381
|
invocationId,
|
|
4382
4382
|
result,
|
|
4383
4383
|
generationOptions: {
|
|
4384
|
-
copilotId: _optionalChain([options, 'optionalAccess',
|
|
4385
|
-
stream: _optionalChain([options, 'optionalAccess',
|
|
4386
|
-
timeout: _optionalChain([options, 'optionalAccess',
|
|
4384
|
+
copilotId: _optionalChain([options, 'optionalAccess', _76 => _76.copilotId]),
|
|
4385
|
+
stream: _optionalChain([options, 'optionalAccess', _77 => _77.stream]),
|
|
4386
|
+
timeout: _optionalChain([options, 'optionalAccess', _78 => _78.timeout]),
|
|
4387
4387
|
// Knowledge and tools aren't coming from the options, but retrieved
|
|
4388
4388
|
// from the global context
|
|
4389
4389
|
knowledge: knowledge.length > 0 ? knowledge : void 0,
|
|
@@ -4419,9 +4419,9 @@ function createAi(config) {
|
|
|
4419
4419
|
sourceMessage: userMessage,
|
|
4420
4420
|
targetMessageId,
|
|
4421
4421
|
generationOptions: {
|
|
4422
|
-
copilotId: _optionalChain([options, 'optionalAccess',
|
|
4423
|
-
stream: _optionalChain([options, 'optionalAccess',
|
|
4424
|
-
timeout: _optionalChain([options, 'optionalAccess',
|
|
4422
|
+
copilotId: _optionalChain([options, 'optionalAccess', _79 => _79.copilotId]),
|
|
4423
|
+
stream: _optionalChain([options, 'optionalAccess', _80 => _80.stream]),
|
|
4424
|
+
timeout: _optionalChain([options, 'optionalAccess', _81 => _81.timeout]),
|
|
4425
4425
|
// Knowledge and tools aren't coming from the options, but retrieved
|
|
4426
4426
|
// from the global context
|
|
4427
4427
|
knowledge: knowledge.length > 0 ? knowledge : void 0,
|
|
@@ -4523,7 +4523,7 @@ function createAuthManager(authOptions, onAuthenticate) {
|
|
|
4523
4523
|
return void 0;
|
|
4524
4524
|
}
|
|
4525
4525
|
async function makeAuthRequest(options) {
|
|
4526
|
-
const fetcher = _nullishCoalesce(_optionalChain([authOptions, 'access',
|
|
4526
|
+
const fetcher = _nullishCoalesce(_optionalChain([authOptions, 'access', _82 => _82.polyfills, 'optionalAccess', _83 => _83.fetch]), () => ( (typeof window === "undefined" ? void 0 : window.fetch)));
|
|
4527
4527
|
if (authentication.type === "private") {
|
|
4528
4528
|
if (fetcher === void 0) {
|
|
4529
4529
|
throw new StopRetrying(
|
|
@@ -4539,7 +4539,7 @@ function createAuthManager(authOptions, onAuthenticate) {
|
|
|
4539
4539
|
"The same Liveblocks auth token was issued from the backend before. Caching Liveblocks tokens is not supported."
|
|
4540
4540
|
);
|
|
4541
4541
|
}
|
|
4542
|
-
_optionalChain([onAuthenticate, 'optionalCall',
|
|
4542
|
+
_optionalChain([onAuthenticate, 'optionalCall', _84 => _84(parsed.parsed)]);
|
|
4543
4543
|
return parsed;
|
|
4544
4544
|
}
|
|
4545
4545
|
if (authentication.type === "custom") {
|
|
@@ -4547,7 +4547,7 @@ function createAuthManager(authOptions, onAuthenticate) {
|
|
|
4547
4547
|
if (response && typeof response === "object") {
|
|
4548
4548
|
if (typeof response.token === "string") {
|
|
4549
4549
|
const parsed = parseAuthToken(response.token);
|
|
4550
|
-
_optionalChain([onAuthenticate, 'optionalCall',
|
|
4550
|
+
_optionalChain([onAuthenticate, 'optionalCall', _85 => _85(parsed.parsed)]);
|
|
4551
4551
|
return parsed;
|
|
4552
4552
|
} else if (typeof response.error === "string") {
|
|
4553
4553
|
const reason = `Authentication failed: ${"reason" in response && typeof response.reason === "string" ? response.reason : "Forbidden"}`;
|
|
@@ -4705,7 +4705,7 @@ function sendToPanel(message, options) {
|
|
|
4705
4705
|
...message,
|
|
4706
4706
|
source: "liveblocks-devtools-client"
|
|
4707
4707
|
};
|
|
4708
|
-
if (!(_optionalChain([options, 'optionalAccess',
|
|
4708
|
+
if (!(_optionalChain([options, 'optionalAccess', _86 => _86.force]) || _bridgeActive)) {
|
|
4709
4709
|
return;
|
|
4710
4710
|
}
|
|
4711
4711
|
window.postMessage(fullMsg, "*");
|
|
@@ -4713,7 +4713,7 @@ function sendToPanel(message, options) {
|
|
|
4713
4713
|
var eventSource = makeEventSource();
|
|
4714
4714
|
if (process.env.NODE_ENV !== "production" && typeof window !== "undefined") {
|
|
4715
4715
|
window.addEventListener("message", (event) => {
|
|
4716
|
-
if (event.source === window && _optionalChain([event, 'access',
|
|
4716
|
+
if (event.source === window && _optionalChain([event, 'access', _87 => _87.data, 'optionalAccess', _88 => _88.source]) === "liveblocks-devtools-panel") {
|
|
4717
4717
|
eventSource.notify(event.data);
|
|
4718
4718
|
} else {
|
|
4719
4719
|
}
|
|
@@ -4855,7 +4855,7 @@ function fullSync(room) {
|
|
|
4855
4855
|
msg: "room::sync::full",
|
|
4856
4856
|
roomId: room.id,
|
|
4857
4857
|
status: room.getStatus(),
|
|
4858
|
-
storage: _nullishCoalesce(_optionalChain([root, 'optionalAccess',
|
|
4858
|
+
storage: _nullishCoalesce(_optionalChain([root, 'optionalAccess', _89 => _89.toTreeNode, 'call', _90 => _90("root"), 'access', _91 => _91.payload]), () => ( null)),
|
|
4859
4859
|
me,
|
|
4860
4860
|
others
|
|
4861
4861
|
});
|
|
@@ -5146,7 +5146,7 @@ function createManagedPool(roomId, options) {
|
|
|
5146
5146
|
generateId: () => `${getCurrentConnectionId()}:${clock++}`,
|
|
5147
5147
|
generateOpId: () => `${getCurrentConnectionId()}:${opClock++}`,
|
|
5148
5148
|
dispatch(ops, reverse, storageUpdates) {
|
|
5149
|
-
_optionalChain([onDispatch, 'optionalCall',
|
|
5149
|
+
_optionalChain([onDispatch, 'optionalCall', _92 => _92(ops, reverse, storageUpdates)]);
|
|
5150
5150
|
},
|
|
5151
5151
|
assertStorageIsWritable: () => {
|
|
5152
5152
|
if (!isStorageWritable()) {
|
|
@@ -5373,7 +5373,7 @@ var LiveRegister = class _LiveRegister extends AbstractCrdt {
|
|
|
5373
5373
|
return [
|
|
5374
5374
|
{
|
|
5375
5375
|
type: 8 /* CREATE_REGISTER */,
|
|
5376
|
-
opId: _optionalChain([pool, 'optionalAccess',
|
|
5376
|
+
opId: _optionalChain([pool, 'optionalAccess', _93 => _93.generateOpId, 'call', _94 => _94()]),
|
|
5377
5377
|
id: this._id,
|
|
5378
5378
|
parentId,
|
|
5379
5379
|
parentKey,
|
|
@@ -5479,7 +5479,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5479
5479
|
const ops = [];
|
|
5480
5480
|
const op = {
|
|
5481
5481
|
id: this._id,
|
|
5482
|
-
opId: _optionalChain([pool, 'optionalAccess',
|
|
5482
|
+
opId: _optionalChain([pool, 'optionalAccess', _95 => _95.generateOpId, 'call', _96 => _96()]),
|
|
5483
5483
|
type: 2 /* CREATE_LIST */,
|
|
5484
5484
|
parentId,
|
|
5485
5485
|
parentKey
|
|
@@ -5750,7 +5750,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5750
5750
|
#applyInsertUndoRedo(op) {
|
|
5751
5751
|
const { id, parentKey: key } = op;
|
|
5752
5752
|
const child = creationOpToLiveNode(op);
|
|
5753
|
-
if (_optionalChain([this, 'access',
|
|
5753
|
+
if (_optionalChain([this, 'access', _97 => _97._pool, 'optionalAccess', _98 => _98.getNode, 'call', _99 => _99(id)]) !== void 0) {
|
|
5754
5754
|
return { modified: false };
|
|
5755
5755
|
}
|
|
5756
5756
|
child._attach(id, nn(this._pool));
|
|
@@ -5758,8 +5758,8 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5758
5758
|
const existingItemIndex = this._indexOfPosition(key);
|
|
5759
5759
|
let newKey = key;
|
|
5760
5760
|
if (existingItemIndex !== -1) {
|
|
5761
|
-
const before2 = _optionalChain([this, 'access',
|
|
5762
|
-
const after2 = _optionalChain([this, 'access',
|
|
5761
|
+
const before2 = _optionalChain([this, 'access', _100 => _100.#items, 'access', _101 => _101[existingItemIndex], 'optionalAccess', _102 => _102._parentPos]);
|
|
5762
|
+
const after2 = _optionalChain([this, 'access', _103 => _103.#items, 'access', _104 => _104[existingItemIndex + 1], 'optionalAccess', _105 => _105._parentPos]);
|
|
5763
5763
|
newKey = makePosition(before2, after2);
|
|
5764
5764
|
child._setParentLink(this, newKey);
|
|
5765
5765
|
}
|
|
@@ -5773,7 +5773,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5773
5773
|
#applySetUndoRedo(op) {
|
|
5774
5774
|
const { id, parentKey: key } = op;
|
|
5775
5775
|
const child = creationOpToLiveNode(op);
|
|
5776
|
-
if (_optionalChain([this, 'access',
|
|
5776
|
+
if (_optionalChain([this, 'access', _106 => _106._pool, 'optionalAccess', _107 => _107.getNode, 'call', _108 => _108(id)]) !== void 0) {
|
|
5777
5777
|
return { modified: false };
|
|
5778
5778
|
}
|
|
5779
5779
|
this.#unacknowledgedSets.set(key, nn(op.opId));
|
|
@@ -5894,7 +5894,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5894
5894
|
} else {
|
|
5895
5895
|
this.#items[existingItemIndex]._setParentLink(
|
|
5896
5896
|
this,
|
|
5897
|
-
makePosition(newKey, _optionalChain([this, 'access',
|
|
5897
|
+
makePosition(newKey, _optionalChain([this, 'access', _109 => _109.#items, 'access', _110 => _110[existingItemIndex + 1], 'optionalAccess', _111 => _111._parentPos]))
|
|
5898
5898
|
);
|
|
5899
5899
|
const previousIndex = this.#items.indexOf(child);
|
|
5900
5900
|
child._setParentLink(this, newKey);
|
|
@@ -5919,7 +5919,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5919
5919
|
if (existingItemIndex !== -1) {
|
|
5920
5920
|
this.#items[existingItemIndex]._setParentLink(
|
|
5921
5921
|
this,
|
|
5922
|
-
makePosition(newKey, _optionalChain([this, 'access',
|
|
5922
|
+
makePosition(newKey, _optionalChain([this, 'access', _112 => _112.#items, 'access', _113 => _113[existingItemIndex + 1], 'optionalAccess', _114 => _114._parentPos]))
|
|
5923
5923
|
);
|
|
5924
5924
|
}
|
|
5925
5925
|
child._setParentLink(this, newKey);
|
|
@@ -5938,7 +5938,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5938
5938
|
if (existingItemIndex !== -1) {
|
|
5939
5939
|
this.#items[existingItemIndex]._setParentLink(
|
|
5940
5940
|
this,
|
|
5941
|
-
makePosition(newKey, _optionalChain([this, 'access',
|
|
5941
|
+
makePosition(newKey, _optionalChain([this, 'access', _115 => _115.#items, 'access', _116 => _116[existingItemIndex + 1], 'optionalAccess', _117 => _117._parentPos]))
|
|
5942
5942
|
);
|
|
5943
5943
|
}
|
|
5944
5944
|
child._setParentLink(this, newKey);
|
|
@@ -5965,7 +5965,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
5965
5965
|
if (existingItemIndex !== -1) {
|
|
5966
5966
|
this.#items[existingItemIndex]._setParentLink(
|
|
5967
5967
|
this,
|
|
5968
|
-
makePosition(newKey, _optionalChain([this, 'access',
|
|
5968
|
+
makePosition(newKey, _optionalChain([this, 'access', _118 => _118.#items, 'access', _119 => _119[existingItemIndex + 1], 'optionalAccess', _120 => _120._parentPos]))
|
|
5969
5969
|
);
|
|
5970
5970
|
}
|
|
5971
5971
|
child._setParentLink(this, newKey);
|
|
@@ -6023,7 +6023,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
6023
6023
|
* @param element The element to add to the end of the LiveList.
|
|
6024
6024
|
*/
|
|
6025
6025
|
push(element) {
|
|
6026
|
-
_optionalChain([this, 'access',
|
|
6026
|
+
_optionalChain([this, 'access', _121 => _121._pool, 'optionalAccess', _122 => _122.assertStorageIsWritable, 'call', _123 => _123()]);
|
|
6027
6027
|
return this.insert(element, this.length);
|
|
6028
6028
|
}
|
|
6029
6029
|
/**
|
|
@@ -6032,7 +6032,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
6032
6032
|
* @param index The index at which you want to insert the element.
|
|
6033
6033
|
*/
|
|
6034
6034
|
insert(element, index) {
|
|
6035
|
-
_optionalChain([this, 'access',
|
|
6035
|
+
_optionalChain([this, 'access', _124 => _124._pool, 'optionalAccess', _125 => _125.assertStorageIsWritable, 'call', _126 => _126()]);
|
|
6036
6036
|
if (index < 0 || index > this.#items.length) {
|
|
6037
6037
|
throw new Error(
|
|
6038
6038
|
`Cannot insert list item at index "${index}". index should be between 0 and ${this.#items.length}`
|
|
@@ -6062,7 +6062,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
6062
6062
|
* @param targetIndex The index where the element should be after moving.
|
|
6063
6063
|
*/
|
|
6064
6064
|
move(index, targetIndex) {
|
|
6065
|
-
_optionalChain([this, 'access',
|
|
6065
|
+
_optionalChain([this, 'access', _127 => _127._pool, 'optionalAccess', _128 => _128.assertStorageIsWritable, 'call', _129 => _129()]);
|
|
6066
6066
|
if (targetIndex < 0) {
|
|
6067
6067
|
throw new Error("targetIndex cannot be less than 0");
|
|
6068
6068
|
}
|
|
@@ -6120,7 +6120,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
6120
6120
|
* @param index The index of the element to delete
|
|
6121
6121
|
*/
|
|
6122
6122
|
delete(index) {
|
|
6123
|
-
_optionalChain([this, 'access',
|
|
6123
|
+
_optionalChain([this, 'access', _130 => _130._pool, 'optionalAccess', _131 => _131.assertStorageIsWritable, 'call', _132 => _132()]);
|
|
6124
6124
|
if (index < 0 || index >= this.#items.length) {
|
|
6125
6125
|
throw new Error(
|
|
6126
6126
|
`Cannot delete list item at index "${index}". index should be between 0 and ${this.#items.length - 1}`
|
|
@@ -6153,7 +6153,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
6153
6153
|
}
|
|
6154
6154
|
}
|
|
6155
6155
|
clear() {
|
|
6156
|
-
_optionalChain([this, 'access',
|
|
6156
|
+
_optionalChain([this, 'access', _133 => _133._pool, 'optionalAccess', _134 => _134.assertStorageIsWritable, 'call', _135 => _135()]);
|
|
6157
6157
|
if (this._pool) {
|
|
6158
6158
|
const ops = [];
|
|
6159
6159
|
const reverseOps = [];
|
|
@@ -6187,7 +6187,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
6187
6187
|
}
|
|
6188
6188
|
}
|
|
6189
6189
|
set(index, item) {
|
|
6190
|
-
_optionalChain([this, 'access',
|
|
6190
|
+
_optionalChain([this, 'access', _136 => _136._pool, 'optionalAccess', _137 => _137.assertStorageIsWritable, 'call', _138 => _138()]);
|
|
6191
6191
|
if (index < 0 || index >= this.#items.length) {
|
|
6192
6192
|
throw new Error(
|
|
6193
6193
|
`Cannot set list item at index "${index}". index should be between 0 and ${this.#items.length - 1}`
|
|
@@ -6333,7 +6333,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
|
|
|
6333
6333
|
#shiftItemPosition(index, key) {
|
|
6334
6334
|
const shiftedPosition = makePosition(
|
|
6335
6335
|
key,
|
|
6336
|
-
this.#items.length > index + 1 ? _optionalChain([this, 'access',
|
|
6336
|
+
this.#items.length > index + 1 ? _optionalChain([this, 'access', _139 => _139.#items, 'access', _140 => _140[index + 1], 'optionalAccess', _141 => _141._parentPos]) : void 0
|
|
6337
6337
|
);
|
|
6338
6338
|
this.#items[index]._setParentLink(this, shiftedPosition);
|
|
6339
6339
|
}
|
|
@@ -6458,7 +6458,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
|
|
|
6458
6458
|
const ops = [];
|
|
6459
6459
|
const op = {
|
|
6460
6460
|
id: this._id,
|
|
6461
|
-
opId: _optionalChain([pool, 'optionalAccess',
|
|
6461
|
+
opId: _optionalChain([pool, 'optionalAccess', _142 => _142.generateOpId, 'call', _143 => _143()]),
|
|
6462
6462
|
type: 7 /* CREATE_MAP */,
|
|
6463
6463
|
parentId,
|
|
6464
6464
|
parentKey
|
|
@@ -6593,7 +6593,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
|
|
|
6593
6593
|
* @param value The value of the element to add. Should be serializable to JSON.
|
|
6594
6594
|
*/
|
|
6595
6595
|
set(key, value) {
|
|
6596
|
-
_optionalChain([this, 'access',
|
|
6596
|
+
_optionalChain([this, 'access', _144 => _144._pool, 'optionalAccess', _145 => _145.assertStorageIsWritable, 'call', _146 => _146()]);
|
|
6597
6597
|
const oldValue = this.#map.get(key);
|
|
6598
6598
|
if (oldValue) {
|
|
6599
6599
|
oldValue._detach();
|
|
@@ -6639,7 +6639,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
|
|
|
6639
6639
|
* @returns true if an element existed and has been removed, or false if the element does not exist.
|
|
6640
6640
|
*/
|
|
6641
6641
|
delete(key) {
|
|
6642
|
-
_optionalChain([this, 'access',
|
|
6642
|
+
_optionalChain([this, 'access', _147 => _147._pool, 'optionalAccess', _148 => _148.assertStorageIsWritable, 'call', _149 => _149()]);
|
|
6643
6643
|
const item = this.#map.get(key);
|
|
6644
6644
|
if (item === void 0) {
|
|
6645
6645
|
return false;
|
|
@@ -6829,7 +6829,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
|
|
|
6829
6829
|
if (this._id === void 0) {
|
|
6830
6830
|
throw new Error("Cannot serialize item is not attached");
|
|
6831
6831
|
}
|
|
6832
|
-
const opId = _optionalChain([pool, 'optionalAccess',
|
|
6832
|
+
const opId = _optionalChain([pool, 'optionalAccess', _150 => _150.generateOpId, 'call', _151 => _151()]);
|
|
6833
6833
|
const ops = [];
|
|
6834
6834
|
const op = {
|
|
6835
6835
|
type: 4 /* CREATE_OBJECT */,
|
|
@@ -7101,7 +7101,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
|
|
|
7101
7101
|
* @param value The value of the property to add
|
|
7102
7102
|
*/
|
|
7103
7103
|
set(key, value) {
|
|
7104
|
-
_optionalChain([this, 'access',
|
|
7104
|
+
_optionalChain([this, 'access', _152 => _152._pool, 'optionalAccess', _153 => _153.assertStorageIsWritable, 'call', _154 => _154()]);
|
|
7105
7105
|
this.update({ [key]: value });
|
|
7106
7106
|
}
|
|
7107
7107
|
/**
|
|
@@ -7116,7 +7116,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
|
|
|
7116
7116
|
* @param key The key of the property to delete
|
|
7117
7117
|
*/
|
|
7118
7118
|
delete(key) {
|
|
7119
|
-
_optionalChain([this, 'access',
|
|
7119
|
+
_optionalChain([this, 'access', _155 => _155._pool, 'optionalAccess', _156 => _156.assertStorageIsWritable, 'call', _157 => _157()]);
|
|
7120
7120
|
const keyAsString = key;
|
|
7121
7121
|
const oldValue = this.#map.get(keyAsString);
|
|
7122
7122
|
if (oldValue === void 0) {
|
|
@@ -7169,7 +7169,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
|
|
|
7169
7169
|
* @param patch The object used to overrides properties
|
|
7170
7170
|
*/
|
|
7171
7171
|
update(patch) {
|
|
7172
|
-
_optionalChain([this, 'access',
|
|
7172
|
+
_optionalChain([this, 'access', _158 => _158._pool, 'optionalAccess', _159 => _159.assertStorageIsWritable, 'call', _160 => _160()]);
|
|
7173
7173
|
if (_LiveObject.detectLargeObjects) {
|
|
7174
7174
|
const data = {};
|
|
7175
7175
|
for (const [key, value] of this.#map) {
|
|
@@ -7915,15 +7915,15 @@ function installBackgroundTabSpy() {
|
|
|
7915
7915
|
const doc = typeof document !== "undefined" ? document : void 0;
|
|
7916
7916
|
const inBackgroundSince = { current: null };
|
|
7917
7917
|
function onVisibilityChange() {
|
|
7918
|
-
if (_optionalChain([doc, 'optionalAccess',
|
|
7918
|
+
if (_optionalChain([doc, 'optionalAccess', _161 => _161.visibilityState]) === "hidden") {
|
|
7919
7919
|
inBackgroundSince.current = _nullishCoalesce(inBackgroundSince.current, () => ( Date.now()));
|
|
7920
7920
|
} else {
|
|
7921
7921
|
inBackgroundSince.current = null;
|
|
7922
7922
|
}
|
|
7923
7923
|
}
|
|
7924
|
-
_optionalChain([doc, 'optionalAccess',
|
|
7924
|
+
_optionalChain([doc, 'optionalAccess', _162 => _162.addEventListener, 'call', _163 => _163("visibilitychange", onVisibilityChange)]);
|
|
7925
7925
|
const unsub = () => {
|
|
7926
|
-
_optionalChain([doc, 'optionalAccess',
|
|
7926
|
+
_optionalChain([doc, 'optionalAccess', _164 => _164.removeEventListener, 'call', _165 => _165("visibilitychange", onVisibilityChange)]);
|
|
7927
7927
|
};
|
|
7928
7928
|
return [inBackgroundSince, unsub];
|
|
7929
7929
|
}
|
|
@@ -8103,7 +8103,7 @@ function createRoom(options, config) {
|
|
|
8103
8103
|
}
|
|
8104
8104
|
}
|
|
8105
8105
|
function isStorageWritable() {
|
|
8106
|
-
const scopes = _optionalChain([context, 'access',
|
|
8106
|
+
const scopes = _optionalChain([context, 'access', _166 => _166.dynamicSessionInfoSig, 'access', _167 => _167.get, 'call', _168 => _168(), 'optionalAccess', _169 => _169.scopes]);
|
|
8107
8107
|
return scopes !== void 0 ? canWriteStorage(scopes) : true;
|
|
8108
8108
|
}
|
|
8109
8109
|
const eventHub = {
|
|
@@ -8220,7 +8220,7 @@ function createRoom(options, config) {
|
|
|
8220
8220
|
}
|
|
8221
8221
|
case "experimental-fallback-to-http": {
|
|
8222
8222
|
warn("Message is too large for websockets, so sending over HTTP instead");
|
|
8223
|
-
const nonce = _nullishCoalesce(_optionalChain([context, 'access',
|
|
8223
|
+
const nonce = _nullishCoalesce(_optionalChain([context, 'access', _170 => _170.dynamicSessionInfoSig, 'access', _171 => _171.get, 'call', _172 => _172(), 'optionalAccess', _173 => _173.nonce]), () => ( raise("Session is not authorized to send message over HTTP")));
|
|
8224
8224
|
void httpClient.sendMessages({ roomId, nonce, messages }).then((resp) => {
|
|
8225
8225
|
if (!resp.ok && resp.status === 403) {
|
|
8226
8226
|
managedSocket.reconnect();
|
|
@@ -8271,7 +8271,7 @@ function createRoom(options, config) {
|
|
|
8271
8271
|
} else {
|
|
8272
8272
|
context.root = LiveObject._fromItems(message.items, context.pool);
|
|
8273
8273
|
}
|
|
8274
|
-
const canWrite = _nullishCoalesce(_optionalChain([self, 'access',
|
|
8274
|
+
const canWrite = _nullishCoalesce(_optionalChain([self, 'access', _174 => _174.get, 'call', _175 => _175(), 'optionalAccess', _176 => _176.canWrite]), () => ( true));
|
|
8275
8275
|
const stackSizeBefore = context.undoStack.length;
|
|
8276
8276
|
for (const key in context.initialStorage) {
|
|
8277
8277
|
if (context.root.get(key) === void 0) {
|
|
@@ -8474,7 +8474,7 @@ function createRoom(options, config) {
|
|
|
8474
8474
|
}
|
|
8475
8475
|
context.myPresence.patch(patch);
|
|
8476
8476
|
if (context.activeBatch) {
|
|
8477
|
-
if (_optionalChain([options2, 'optionalAccess',
|
|
8477
|
+
if (_optionalChain([options2, 'optionalAccess', _177 => _177.addToHistory])) {
|
|
8478
8478
|
context.activeBatch.reverseOps.pushLeft({
|
|
8479
8479
|
type: "presence",
|
|
8480
8480
|
data: oldValues
|
|
@@ -8483,7 +8483,7 @@ function createRoom(options, config) {
|
|
|
8483
8483
|
context.activeBatch.updates.presence = true;
|
|
8484
8484
|
} else {
|
|
8485
8485
|
flushNowOrSoon();
|
|
8486
|
-
if (_optionalChain([options2, 'optionalAccess',
|
|
8486
|
+
if (_optionalChain([options2, 'optionalAccess', _178 => _178.addToHistory])) {
|
|
8487
8487
|
addToUndoStack([{ type: "presence", data: oldValues }]);
|
|
8488
8488
|
}
|
|
8489
8489
|
notify({ presence: true });
|
|
@@ -8680,7 +8680,7 @@ function createRoom(options, config) {
|
|
|
8680
8680
|
if (process.env.NODE_ENV !== "production") {
|
|
8681
8681
|
const traces = /* @__PURE__ */ new Set();
|
|
8682
8682
|
for (const opId of message.opIds) {
|
|
8683
|
-
const trace = _optionalChain([context, 'access',
|
|
8683
|
+
const trace = _optionalChain([context, 'access', _179 => _179.opStackTraces, 'optionalAccess', _180 => _180.get, 'call', _181 => _181(opId)]);
|
|
8684
8684
|
if (trace) {
|
|
8685
8685
|
traces.add(trace);
|
|
8686
8686
|
}
|
|
@@ -8814,7 +8814,7 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
8814
8814
|
const unacknowledgedOps = new Map(context.unacknowledgedOps);
|
|
8815
8815
|
createOrUpdateRootFromMessage(message);
|
|
8816
8816
|
applyAndSendOps(unacknowledgedOps);
|
|
8817
|
-
_optionalChain([_resolveStoragePromise, 'optionalCall',
|
|
8817
|
+
_optionalChain([_resolveStoragePromise, 'optionalCall', _182 => _182()]);
|
|
8818
8818
|
notifyStorageStatus();
|
|
8819
8819
|
eventHub.storageDidLoad.notify();
|
|
8820
8820
|
}
|
|
@@ -9035,8 +9035,8 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
9035
9035
|
async function getThreads(options2) {
|
|
9036
9036
|
return httpClient.getThreads({
|
|
9037
9037
|
roomId,
|
|
9038
|
-
query: _optionalChain([options2, 'optionalAccess',
|
|
9039
|
-
cursor: _optionalChain([options2, 'optionalAccess',
|
|
9038
|
+
query: _optionalChain([options2, 'optionalAccess', _183 => _183.query]),
|
|
9039
|
+
cursor: _optionalChain([options2, 'optionalAccess', _184 => _184.cursor])
|
|
9040
9040
|
});
|
|
9041
9041
|
}
|
|
9042
9042
|
async function getThread(threadId) {
|
|
@@ -9143,7 +9143,7 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
9143
9143
|
function getSubscriptionSettings(options2) {
|
|
9144
9144
|
return httpClient.getSubscriptionSettings({
|
|
9145
9145
|
roomId,
|
|
9146
|
-
signal: _optionalChain([options2, 'optionalAccess',
|
|
9146
|
+
signal: _optionalChain([options2, 'optionalAccess', _185 => _185.signal])
|
|
9147
9147
|
});
|
|
9148
9148
|
}
|
|
9149
9149
|
function updateSubscriptionSettings(settings) {
|
|
@@ -9165,7 +9165,7 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
9165
9165
|
{
|
|
9166
9166
|
[kInternal]: {
|
|
9167
9167
|
get presenceBuffer() {
|
|
9168
|
-
return deepClone(_nullishCoalesce(_optionalChain([context, 'access',
|
|
9168
|
+
return deepClone(_nullishCoalesce(_optionalChain([context, 'access', _186 => _186.buffer, 'access', _187 => _187.presenceUpdates, 'optionalAccess', _188 => _188.data]), () => ( null)));
|
|
9169
9169
|
},
|
|
9170
9170
|
// prettier-ignore
|
|
9171
9171
|
get undoStack() {
|
|
@@ -9180,9 +9180,9 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
9180
9180
|
return context.yjsProvider;
|
|
9181
9181
|
},
|
|
9182
9182
|
setYjsProvider(newProvider) {
|
|
9183
|
-
_optionalChain([context, 'access',
|
|
9183
|
+
_optionalChain([context, 'access', _189 => _189.yjsProvider, 'optionalAccess', _190 => _190.off, 'call', _191 => _191("status", yjsStatusDidChange)]);
|
|
9184
9184
|
context.yjsProvider = newProvider;
|
|
9185
|
-
_optionalChain([newProvider, 'optionalAccess',
|
|
9185
|
+
_optionalChain([newProvider, 'optionalAccess', _192 => _192.on, 'call', _193 => _193("status", yjsStatusDidChange)]);
|
|
9186
9186
|
context.yjsProviderDidChange.notify();
|
|
9187
9187
|
},
|
|
9188
9188
|
yjsProviderDidChange: context.yjsProviderDidChange.observable,
|
|
@@ -9228,7 +9228,7 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
9228
9228
|
source.dispose();
|
|
9229
9229
|
}
|
|
9230
9230
|
eventHub.roomWillDestroy.notify();
|
|
9231
|
-
_optionalChain([context, 'access',
|
|
9231
|
+
_optionalChain([context, 'access', _194 => _194.yjsProvider, 'optionalAccess', _195 => _195.off, 'call', _196 => _196("status", yjsStatusDidChange)]);
|
|
9232
9232
|
syncSourceForStorage.destroy();
|
|
9233
9233
|
syncSourceForYjs.destroy();
|
|
9234
9234
|
uninstallBgTabSpy();
|
|
@@ -9378,7 +9378,7 @@ function makeClassicSubscribeFn(roomId, events, errorEvents) {
|
|
|
9378
9378
|
}
|
|
9379
9379
|
if (isLiveNode(first)) {
|
|
9380
9380
|
const node = first;
|
|
9381
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
9381
|
+
if (_optionalChain([options, 'optionalAccess', _197 => _197.isDeep])) {
|
|
9382
9382
|
const storageCallback = second;
|
|
9383
9383
|
return subscribeToLiveStructureDeeply(node, storageCallback);
|
|
9384
9384
|
} else {
|
|
@@ -9457,8 +9457,8 @@ function createClient(options) {
|
|
|
9457
9457
|
const userId = token.k === "sec-legacy" /* SECRET_LEGACY */ ? token.id : token.uid;
|
|
9458
9458
|
currentUserId.set(() => userId);
|
|
9459
9459
|
});
|
|
9460
|
-
const fetchPolyfill = _optionalChain([clientOptions, 'access',
|
|
9461
|
-
_optionalChain([globalThis, 'access',
|
|
9460
|
+
const fetchPolyfill = _optionalChain([clientOptions, 'access', _198 => _198.polyfills, 'optionalAccess', _199 => _199.fetch]) || /* istanbul ignore next */
|
|
9461
|
+
_optionalChain([globalThis, 'access', _200 => _200.fetch, 'optionalAccess', _201 => _201.bind, 'call', _202 => _202(globalThis)]);
|
|
9462
9462
|
const httpClient = createApiClient({
|
|
9463
9463
|
baseUrl,
|
|
9464
9464
|
fetchPolyfill,
|
|
@@ -9476,7 +9476,7 @@ function createClient(options) {
|
|
|
9476
9476
|
delegates: {
|
|
9477
9477
|
createSocket: makeCreateSocketDelegateForAi(
|
|
9478
9478
|
baseUrl,
|
|
9479
|
-
_optionalChain([clientOptions, 'access',
|
|
9479
|
+
_optionalChain([clientOptions, 'access', _203 => _203.polyfills, 'optionalAccess', _204 => _204.WebSocket])
|
|
9480
9480
|
),
|
|
9481
9481
|
authenticate: async () => {
|
|
9482
9482
|
const resp = await authManager.getAuthValue({
|
|
@@ -9544,7 +9544,7 @@ function createClient(options) {
|
|
|
9544
9544
|
createSocket: makeCreateSocketDelegateForRoom(
|
|
9545
9545
|
roomId,
|
|
9546
9546
|
baseUrl,
|
|
9547
|
-
_optionalChain([clientOptions, 'access',
|
|
9547
|
+
_optionalChain([clientOptions, 'access', _205 => _205.polyfills, 'optionalAccess', _206 => _206.WebSocket])
|
|
9548
9548
|
),
|
|
9549
9549
|
authenticate: makeAuthDelegateForRoom(roomId, authManager)
|
|
9550
9550
|
})),
|
|
@@ -9567,7 +9567,7 @@ function createClient(options) {
|
|
|
9567
9567
|
const shouldConnect = _nullishCoalesce(options2.autoConnect, () => ( true));
|
|
9568
9568
|
if (shouldConnect) {
|
|
9569
9569
|
if (typeof atob === "undefined") {
|
|
9570
|
-
if (_optionalChain([clientOptions, 'access',
|
|
9570
|
+
if (_optionalChain([clientOptions, 'access', _207 => _207.polyfills, 'optionalAccess', _208 => _208.atob]) === void 0) {
|
|
9571
9571
|
throw new Error(
|
|
9572
9572
|
"You need to polyfill atob to use the client in your environment. Please follow the instructions at https://liveblocks.io/docs/errors/liveblocks-client/atob-polyfill"
|
|
9573
9573
|
);
|
|
@@ -9579,7 +9579,7 @@ function createClient(options) {
|
|
|
9579
9579
|
return leaseRoom(newRoomDetails);
|
|
9580
9580
|
}
|
|
9581
9581
|
function getRoom(roomId) {
|
|
9582
|
-
const room = _optionalChain([roomsById, 'access',
|
|
9582
|
+
const room = _optionalChain([roomsById, 'access', _209 => _209.get, 'call', _210 => _210(roomId), 'optionalAccess', _211 => _211.room]);
|
|
9583
9583
|
return room ? room : null;
|
|
9584
9584
|
}
|
|
9585
9585
|
function logout() {
|
|
@@ -9599,7 +9599,7 @@ function createClient(options) {
|
|
|
9599
9599
|
const batchedResolveUsers = new Batch(
|
|
9600
9600
|
async (batchedUserIds) => {
|
|
9601
9601
|
const userIds = batchedUserIds.flat();
|
|
9602
|
-
const users = await _optionalChain([resolveUsers, 'optionalCall',
|
|
9602
|
+
const users = await _optionalChain([resolveUsers, 'optionalCall', _212 => _212({ userIds })]);
|
|
9603
9603
|
warnIfNoResolveUsers();
|
|
9604
9604
|
return _nullishCoalesce(users, () => ( userIds.map(() => void 0)));
|
|
9605
9605
|
},
|
|
@@ -9617,7 +9617,7 @@ function createClient(options) {
|
|
|
9617
9617
|
const batchedResolveRoomsInfo = new Batch(
|
|
9618
9618
|
async (batchedRoomIds) => {
|
|
9619
9619
|
const roomIds = batchedRoomIds.flat();
|
|
9620
|
-
const roomsInfo = await _optionalChain([resolveRoomsInfo, 'optionalCall',
|
|
9620
|
+
const roomsInfo = await _optionalChain([resolveRoomsInfo, 'optionalCall', _213 => _213({ roomIds })]);
|
|
9621
9621
|
warnIfNoResolveRoomsInfo();
|
|
9622
9622
|
return _nullishCoalesce(roomsInfo, () => ( roomIds.map(() => void 0)));
|
|
9623
9623
|
},
|
|
@@ -9670,7 +9670,7 @@ function createClient(options) {
|
|
|
9670
9670
|
}
|
|
9671
9671
|
};
|
|
9672
9672
|
const win = typeof window !== "undefined" ? window : void 0;
|
|
9673
|
-
_optionalChain([win, 'optionalAccess',
|
|
9673
|
+
_optionalChain([win, 'optionalAccess', _214 => _214.addEventListener, 'call', _215 => _215("beforeunload", maybePreventClose)]);
|
|
9674
9674
|
}
|
|
9675
9675
|
async function getNotificationSettings(options2) {
|
|
9676
9676
|
const plainSettings = await httpClient.getNotificationSettings(options2);
|
|
@@ -9809,7 +9809,7 @@ var commentBodyElementsTypes = {
|
|
|
9809
9809
|
mention: "inline"
|
|
9810
9810
|
};
|
|
9811
9811
|
function traverseCommentBody(body, elementOrVisitor, possiblyVisitor) {
|
|
9812
|
-
if (!body || !_optionalChain([body, 'optionalAccess',
|
|
9812
|
+
if (!body || !_optionalChain([body, 'optionalAccess', _216 => _216.content])) {
|
|
9813
9813
|
return;
|
|
9814
9814
|
}
|
|
9815
9815
|
const element = typeof elementOrVisitor === "string" ? elementOrVisitor : void 0;
|
|
@@ -9819,13 +9819,13 @@ function traverseCommentBody(body, elementOrVisitor, possiblyVisitor) {
|
|
|
9819
9819
|
for (const block of body.content) {
|
|
9820
9820
|
if (type === "all" || type === "block") {
|
|
9821
9821
|
if (guard(block)) {
|
|
9822
|
-
_optionalChain([visitor, 'optionalCall',
|
|
9822
|
+
_optionalChain([visitor, 'optionalCall', _217 => _217(block)]);
|
|
9823
9823
|
}
|
|
9824
9824
|
}
|
|
9825
9825
|
if (type === "all" || type === "inline") {
|
|
9826
9826
|
for (const inline of block.children) {
|
|
9827
9827
|
if (guard(inline)) {
|
|
9828
|
-
_optionalChain([visitor, 'optionalCall',
|
|
9828
|
+
_optionalChain([visitor, 'optionalCall', _218 => _218(inline)]);
|
|
9829
9829
|
}
|
|
9830
9830
|
}
|
|
9831
9831
|
}
|
|
@@ -9859,7 +9859,7 @@ async function resolveUsersInCommentBody(body, resolveUsers) {
|
|
|
9859
9859
|
userIds
|
|
9860
9860
|
});
|
|
9861
9861
|
for (const [index, userId] of userIds.entries()) {
|
|
9862
|
-
const user = _optionalChain([users, 'optionalAccess',
|
|
9862
|
+
const user = _optionalChain([users, 'optionalAccess', _219 => _219[index]]);
|
|
9863
9863
|
if (user) {
|
|
9864
9864
|
resolvedUsers.set(userId, user);
|
|
9865
9865
|
}
|
|
@@ -9986,7 +9986,7 @@ var stringifyCommentBodyPlainElements = {
|
|
|
9986
9986
|
text: ({ element }) => element.text,
|
|
9987
9987
|
link: ({ element }) => _nullishCoalesce(element.text, () => ( element.url)),
|
|
9988
9988
|
mention: ({ element, user }) => {
|
|
9989
|
-
return `@${_nullishCoalesce(_optionalChain([user, 'optionalAccess',
|
|
9989
|
+
return `@${_nullishCoalesce(_optionalChain([user, 'optionalAccess', _220 => _220.name]), () => ( element.id))}`;
|
|
9990
9990
|
}
|
|
9991
9991
|
};
|
|
9992
9992
|
var stringifyCommentBodyHtmlElements = {
|
|
@@ -10016,7 +10016,7 @@ var stringifyCommentBodyHtmlElements = {
|
|
|
10016
10016
|
return html`<a href="${href}" target="_blank" rel="noopener noreferrer">${element.text ? html`${element.text}` : element.url}</a>`;
|
|
10017
10017
|
},
|
|
10018
10018
|
mention: ({ element, user }) => {
|
|
10019
|
-
return html`<span data-mention>@${_optionalChain([user, 'optionalAccess',
|
|
10019
|
+
return html`<span data-mention>@${_optionalChain([user, 'optionalAccess', _221 => _221.name]) ? html`${_optionalChain([user, 'optionalAccess', _222 => _222.name])}` : element.id}</span>`;
|
|
10020
10020
|
}
|
|
10021
10021
|
};
|
|
10022
10022
|
var stringifyCommentBodyMarkdownElements = {
|
|
@@ -10046,19 +10046,19 @@ var stringifyCommentBodyMarkdownElements = {
|
|
|
10046
10046
|
return markdown`[${_nullishCoalesce(element.text, () => ( element.url))}](${href})`;
|
|
10047
10047
|
},
|
|
10048
10048
|
mention: ({ element, user }) => {
|
|
10049
|
-
return markdown`@${_nullishCoalesce(_optionalChain([user, 'optionalAccess',
|
|
10049
|
+
return markdown`@${_nullishCoalesce(_optionalChain([user, 'optionalAccess', _223 => _223.name]), () => ( element.id))}`;
|
|
10050
10050
|
}
|
|
10051
10051
|
};
|
|
10052
10052
|
async function stringifyCommentBody(body, options) {
|
|
10053
|
-
const format = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
10054
|
-
const separator = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
10053
|
+
const format = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _224 => _224.format]), () => ( "plain"));
|
|
10054
|
+
const separator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _225 => _225.separator]), () => ( (format === "markdown" ? "\n\n" : "\n")));
|
|
10055
10055
|
const elements = {
|
|
10056
10056
|
...format === "html" ? stringifyCommentBodyHtmlElements : format === "markdown" ? stringifyCommentBodyMarkdownElements : stringifyCommentBodyPlainElements,
|
|
10057
|
-
..._optionalChain([options, 'optionalAccess',
|
|
10057
|
+
..._optionalChain([options, 'optionalAccess', _226 => _226.elements])
|
|
10058
10058
|
};
|
|
10059
10059
|
const resolvedUsers = await resolveUsersInCommentBody(
|
|
10060
10060
|
body,
|
|
10061
|
-
_optionalChain([options, 'optionalAccess',
|
|
10061
|
+
_optionalChain([options, 'optionalAccess', _227 => _227.resolveUsers])
|
|
10062
10062
|
);
|
|
10063
10063
|
const blocks = body.content.flatMap((block, blockIndex) => {
|
|
10064
10064
|
switch (block.type) {
|
|
@@ -10349,12 +10349,12 @@ function legacy_patchImmutableNode(state, path, update) {
|
|
|
10349
10349
|
}
|
|
10350
10350
|
const newState = Object.assign({}, state);
|
|
10351
10351
|
for (const key in update.updates) {
|
|
10352
|
-
if (_optionalChain([update, 'access',
|
|
10352
|
+
if (_optionalChain([update, 'access', _228 => _228.updates, 'access', _229 => _229[key], 'optionalAccess', _230 => _230.type]) === "update") {
|
|
10353
10353
|
const val = update.node.get(key);
|
|
10354
10354
|
if (val !== void 0) {
|
|
10355
10355
|
newState[key] = lsonToJson(val);
|
|
10356
10356
|
}
|
|
10357
|
-
} else if (_optionalChain([update, 'access',
|
|
10357
|
+
} else if (_optionalChain([update, 'access', _231 => _231.updates, 'access', _232 => _232[key], 'optionalAccess', _233 => _233.type]) === "delete") {
|
|
10358
10358
|
delete newState[key];
|
|
10359
10359
|
}
|
|
10360
10360
|
}
|
|
@@ -10415,12 +10415,12 @@ function legacy_patchImmutableNode(state, path, update) {
|
|
|
10415
10415
|
}
|
|
10416
10416
|
const newState = Object.assign({}, state);
|
|
10417
10417
|
for (const key in update.updates) {
|
|
10418
|
-
if (_optionalChain([update, 'access',
|
|
10418
|
+
if (_optionalChain([update, 'access', _234 => _234.updates, 'access', _235 => _235[key], 'optionalAccess', _236 => _236.type]) === "update") {
|
|
10419
10419
|
const value = update.node.get(key);
|
|
10420
10420
|
if (value !== void 0) {
|
|
10421
10421
|
newState[key] = lsonToJson(value);
|
|
10422
10422
|
}
|
|
10423
|
-
} else if (_optionalChain([update, 'access',
|
|
10423
|
+
} else if (_optionalChain([update, 'access', _237 => _237.updates, 'access', _238 => _238[key], 'optionalAccess', _239 => _239.type]) === "delete") {
|
|
10424
10424
|
delete newState[key];
|
|
10425
10425
|
}
|
|
10426
10426
|
}
|
|
@@ -10500,9 +10500,9 @@ function makePoller(callback, intervalMs, options) {
|
|
|
10500
10500
|
const startTime = performance.now();
|
|
10501
10501
|
const doc = typeof document !== "undefined" ? document : void 0;
|
|
10502
10502
|
const win = typeof window !== "undefined" ? window : void 0;
|
|
10503
|
-
const maxStaleTimeMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
10503
|
+
const maxStaleTimeMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _240 => _240.maxStaleTimeMs]), () => ( Number.POSITIVE_INFINITY));
|
|
10504
10504
|
const context = {
|
|
10505
|
-
inForeground: _optionalChain([doc, 'optionalAccess',
|
|
10505
|
+
inForeground: _optionalChain([doc, 'optionalAccess', _241 => _241.visibilityState]) !== "hidden",
|
|
10506
10506
|
lastSuccessfulPollAt: startTime,
|
|
10507
10507
|
count: 0,
|
|
10508
10508
|
backoff: 0
|
|
@@ -10583,11 +10583,11 @@ function makePoller(callback, intervalMs, options) {
|
|
|
10583
10583
|
pollNowIfStale();
|
|
10584
10584
|
}
|
|
10585
10585
|
function onVisibilityChange() {
|
|
10586
|
-
setInForeground(_optionalChain([doc, 'optionalAccess',
|
|
10586
|
+
setInForeground(_optionalChain([doc, 'optionalAccess', _242 => _242.visibilityState]) !== "hidden");
|
|
10587
10587
|
}
|
|
10588
|
-
_optionalChain([doc, 'optionalAccess',
|
|
10589
|
-
_optionalChain([win, 'optionalAccess',
|
|
10590
|
-
_optionalChain([win, 'optionalAccess',
|
|
10588
|
+
_optionalChain([doc, 'optionalAccess', _243 => _243.addEventListener, 'call', _244 => _244("visibilitychange", onVisibilityChange)]);
|
|
10589
|
+
_optionalChain([win, 'optionalAccess', _245 => _245.addEventListener, 'call', _246 => _246("online", onVisibilityChange)]);
|
|
10590
|
+
_optionalChain([win, 'optionalAccess', _247 => _247.addEventListener, 'call', _248 => _248("focus", pollNowIfStale)]);
|
|
10591
10591
|
fsm.start();
|
|
10592
10592
|
return {
|
|
10593
10593
|
inc,
|