@liveblocks/core 3.1.2-url1 → 3.1.2

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 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.2-url1";
9
+ var PKG_VERSION = "3.1.2";
10
10
  var PKG_FORMAT = "cjs";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -3844,8 +3844,8 @@ function createStore_forTools() {
3844
3844
  return DerivedSignal.from(() => {
3845
3845
  return (
3846
3846
  // A tool that's registered and scoped to a specific chat ID...
3847
- _nullishCoalesce(_optionalChain([(chatId !== void 0 ? _optionalChain([toolsByChatId\u03A3, 'access', _57 => _57.get, 'call', _58 => _58(chatId), 'optionalAccess', _59 => _59.get, 'call', _60 => _60(name)]) : void 0), 'optionalAccess', _61 => _61.get, 'call', _62 => _62()]), () => ( // ...or a globally registered tool
3848
- _optionalChain([toolsByChatId\u03A3, 'access', _63 => _63.getOrCreate, 'call', _64 => _64(kWILDCARD), 'access', _65 => _65.get, 'call', _66 => _66(name), 'optionalAccess', _67 => _67.get, 'call', _68 => _68()])))
3847
+ _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
3848
+ toolsByChatId\u03A3.getOrCreate(kWILDCARD).getOrCreate(name).get()))
3849
3849
  );
3850
3850
  });
3851
3851
  });
@@ -3874,8 +3874,8 @@ function createStore_forTools() {
3874
3874
  const globalTools\u03A3 = toolsByChatId\u03A3.get(kWILDCARD);
3875
3875
  const scopedTools\u03A3 = toolsByChatId\u03A3.get(chatId);
3876
3876
  return Array.from([
3877
- ..._nullishCoalesce(_optionalChain([globalTools\u03A3, 'optionalAccess', _69 => _69.entries, 'call', _70 => _70()]), () => ( [])),
3878
- ..._nullishCoalesce(_optionalChain([scopedTools\u03A3, 'optionalAccess', _71 => _71.entries, 'call', _72 => _72()]), () => ( []))
3877
+ ..._nullishCoalesce(_optionalChain([globalTools\u03A3, 'optionalAccess', _59 => _59.entries, 'call', _60 => _60()]), () => ( [])),
3878
+ ..._nullishCoalesce(_optionalChain([scopedTools\u03A3, 'optionalAccess', _61 => _61.entries, 'call', _62 => _62()]), () => ( []))
3879
3879
  ]).flatMap(([name, tool\u03A3]) => {
3880
3880
  const tool = tool\u03A3.get();
3881
3881
  return tool && (_nullishCoalesce(tool.enabled, () => ( true))) ? [{ name, description: tool.description, parameters: tool.parameters }] : [];
@@ -3976,7 +3976,7 @@ function createStore_forChatMessages(toolsStore, setToolResultFn) {
3976
3976
  } else {
3977
3977
  continue;
3978
3978
  }
3979
- const executeFn = _optionalChain([toolsStore, 'access', _73 => _73.getTool\u03A3, 'call', _74 => _74(toolInvocation.name, message.chatId), 'access', _75 => _75.get, 'call', _76 => _76(), 'optionalAccess', _77 => _77.execute]);
3979
+ 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]);
3980
3980
  if (executeFn) {
3981
3981
  (async () => {
3982
3982
  const result = await executeFn(toolInvocation.args, {
@@ -4071,8 +4071,8 @@ function createStore_forChatMessages(toolsStore, setToolResultFn) {
4071
4071
  const spine = [];
4072
4072
  let lastVisitedMessage = null;
4073
4073
  for (const message2 of pool.walkUp(leaf.id)) {
4074
- const prev = _nullishCoalesce(_optionalChain([first, 'call', _78 => _78(pool.walkLeft(message2.id, isAlive)), 'optionalAccess', _79 => _79.id]), () => ( null));
4075
- const next = _nullishCoalesce(_optionalChain([first, 'call', _80 => _80(pool.walkRight(message2.id, isAlive)), 'optionalAccess', _81 => _81.id]), () => ( null));
4074
+ const prev = _nullishCoalesce(_optionalChain([first, 'call', _68 => _68(pool.walkLeft(message2.id, isAlive)), 'optionalAccess', _69 => _69.id]), () => ( null));
4075
+ const next = _nullishCoalesce(_optionalChain([first, 'call', _70 => _70(pool.walkRight(message2.id, isAlive)), 'optionalAccess', _71 => _71.id]), () => ( null));
4076
4076
  if (!message2.deletedAt || prev || next) {
4077
4077
  const node = {
4078
4078
  ...message2,
@@ -4265,7 +4265,7 @@ function createAi(config) {
4265
4265
  if ("event" in msg) {
4266
4266
  switch (msg.event) {
4267
4267
  case "cmd-failed":
4268
- _optionalChain([pendingCmd, 'optionalAccess', _82 => _82.reject, 'call', _83 => _83(new Error(msg.error))]);
4268
+ _optionalChain([pendingCmd, 'optionalAccess', _72 => _72.reject, 'call', _73 => _73(new Error(msg.error))]);
4269
4269
  break;
4270
4270
  case "delta": {
4271
4271
  const { id, delta } = msg;
@@ -4347,7 +4347,7 @@ function createAi(config) {
4347
4347
  return assertNever(msg, "Unhandled case");
4348
4348
  }
4349
4349
  }
4350
- _optionalChain([pendingCmd, 'optionalAccess', _84 => _84.resolve, 'call', _85 => _85(msg)]);
4350
+ _optionalChain([pendingCmd, 'optionalAccess', _74 => _74.resolve, 'call', _75 => _75(msg)]);
4351
4351
  }
4352
4352
  managedSocket.events.onMessage.subscribe(handleServerMessage);
4353
4353
  managedSocket.events.statusDidChange.subscribe(onStatusDidChange);
@@ -4431,9 +4431,9 @@ function createAi(config) {
4431
4431
  invocationId,
4432
4432
  result,
4433
4433
  generationOptions: {
4434
- copilotId: _optionalChain([options, 'optionalAccess', _86 => _86.copilotId]),
4435
- stream: _optionalChain([options, 'optionalAccess', _87 => _87.stream]),
4436
- timeout: _optionalChain([options, 'optionalAccess', _88 => _88.timeout]),
4434
+ copilotId: _optionalChain([options, 'optionalAccess', _76 => _76.copilotId]),
4435
+ stream: _optionalChain([options, 'optionalAccess', _77 => _77.stream]),
4436
+ timeout: _optionalChain([options, 'optionalAccess', _78 => _78.timeout]),
4437
4437
  // Knowledge and tools aren't coming from the options, but retrieved
4438
4438
  // from the global context
4439
4439
  knowledge: knowledge.length > 0 ? knowledge : void 0,
@@ -4469,9 +4469,9 @@ function createAi(config) {
4469
4469
  sourceMessage: userMessage,
4470
4470
  targetMessageId,
4471
4471
  generationOptions: {
4472
- copilotId: _optionalChain([options, 'optionalAccess', _89 => _89.copilotId]),
4473
- stream: _optionalChain([options, 'optionalAccess', _90 => _90.stream]),
4474
- timeout: _optionalChain([options, 'optionalAccess', _91 => _91.timeout]),
4472
+ copilotId: _optionalChain([options, 'optionalAccess', _79 => _79.copilotId]),
4473
+ stream: _optionalChain([options, 'optionalAccess', _80 => _80.stream]),
4474
+ timeout: _optionalChain([options, 'optionalAccess', _81 => _81.timeout]),
4475
4475
  // Knowledge and tools aren't coming from the options, but retrieved
4476
4476
  // from the global context
4477
4477
  knowledge: knowledge.length > 0 ? knowledge : void 0,
@@ -4573,7 +4573,7 @@ function createAuthManager(authOptions, onAuthenticate) {
4573
4573
  return void 0;
4574
4574
  }
4575
4575
  async function makeAuthRequest(options) {
4576
- const fetcher = _nullishCoalesce(_optionalChain([authOptions, 'access', _92 => _92.polyfills, 'optionalAccess', _93 => _93.fetch]), () => ( (typeof window === "undefined" ? void 0 : window.fetch)));
4576
+ const fetcher = _nullishCoalesce(_optionalChain([authOptions, 'access', _82 => _82.polyfills, 'optionalAccess', _83 => _83.fetch]), () => ( (typeof window === "undefined" ? void 0 : window.fetch)));
4577
4577
  if (authentication.type === "private") {
4578
4578
  if (fetcher === void 0) {
4579
4579
  throw new StopRetrying(
@@ -4589,7 +4589,7 @@ function createAuthManager(authOptions, onAuthenticate) {
4589
4589
  "The same Liveblocks auth token was issued from the backend before. Caching Liveblocks tokens is not supported."
4590
4590
  );
4591
4591
  }
4592
- _optionalChain([onAuthenticate, 'optionalCall', _94 => _94(parsed.parsed)]);
4592
+ _optionalChain([onAuthenticate, 'optionalCall', _84 => _84(parsed.parsed)]);
4593
4593
  return parsed;
4594
4594
  }
4595
4595
  if (authentication.type === "custom") {
@@ -4597,7 +4597,7 @@ function createAuthManager(authOptions, onAuthenticate) {
4597
4597
  if (response && typeof response === "object") {
4598
4598
  if (typeof response.token === "string") {
4599
4599
  const parsed = parseAuthToken(response.token);
4600
- _optionalChain([onAuthenticate, 'optionalCall', _95 => _95(parsed.parsed)]);
4600
+ _optionalChain([onAuthenticate, 'optionalCall', _85 => _85(parsed.parsed)]);
4601
4601
  return parsed;
4602
4602
  } else if (typeof response.error === "string") {
4603
4603
  const reason = `Authentication failed: ${"reason" in response && typeof response.reason === "string" ? response.reason : "Forbidden"}`;
@@ -4755,7 +4755,7 @@ function sendToPanel(message, options) {
4755
4755
  ...message,
4756
4756
  source: "liveblocks-devtools-client"
4757
4757
  };
4758
- if (!(_optionalChain([options, 'optionalAccess', _96 => _96.force]) || _bridgeActive)) {
4758
+ if (!(_optionalChain([options, 'optionalAccess', _86 => _86.force]) || _bridgeActive)) {
4759
4759
  return;
4760
4760
  }
4761
4761
  window.postMessage(fullMsg, "*");
@@ -4763,7 +4763,7 @@ function sendToPanel(message, options) {
4763
4763
  var eventSource = makeEventSource();
4764
4764
  if (process.env.NODE_ENV !== "production" && typeof window !== "undefined") {
4765
4765
  window.addEventListener("message", (event) => {
4766
- if (event.source === window && _optionalChain([event, 'access', _97 => _97.data, 'optionalAccess', _98 => _98.source]) === "liveblocks-devtools-panel") {
4766
+ if (event.source === window && _optionalChain([event, 'access', _87 => _87.data, 'optionalAccess', _88 => _88.source]) === "liveblocks-devtools-panel") {
4767
4767
  eventSource.notify(event.data);
4768
4768
  } else {
4769
4769
  }
@@ -4905,7 +4905,7 @@ function fullSync(room) {
4905
4905
  msg: "room::sync::full",
4906
4906
  roomId: room.id,
4907
4907
  status: room.getStatus(),
4908
- storage: _nullishCoalesce(_optionalChain([root, 'optionalAccess', _99 => _99.toTreeNode, 'call', _100 => _100("root"), 'access', _101 => _101.payload]), () => ( null)),
4908
+ storage: _nullishCoalesce(_optionalChain([root, 'optionalAccess', _89 => _89.toTreeNode, 'call', _90 => _90("root"), 'access', _91 => _91.payload]), () => ( null)),
4909
4909
  me,
4910
4910
  others
4911
4911
  });
@@ -5196,7 +5196,7 @@ function createManagedPool(roomId, options) {
5196
5196
  generateId: () => `${getCurrentConnectionId()}:${clock++}`,
5197
5197
  generateOpId: () => `${getCurrentConnectionId()}:${opClock++}`,
5198
5198
  dispatch(ops, reverse, storageUpdates) {
5199
- _optionalChain([onDispatch, 'optionalCall', _102 => _102(ops, reverse, storageUpdates)]);
5199
+ _optionalChain([onDispatch, 'optionalCall', _92 => _92(ops, reverse, storageUpdates)]);
5200
5200
  },
5201
5201
  assertStorageIsWritable: () => {
5202
5202
  if (!isStorageWritable()) {
@@ -5423,7 +5423,7 @@ var LiveRegister = class _LiveRegister extends AbstractCrdt {
5423
5423
  return [
5424
5424
  {
5425
5425
  type: 8 /* CREATE_REGISTER */,
5426
- opId: _optionalChain([pool, 'optionalAccess', _103 => _103.generateOpId, 'call', _104 => _104()]),
5426
+ opId: _optionalChain([pool, 'optionalAccess', _93 => _93.generateOpId, 'call', _94 => _94()]),
5427
5427
  id: this._id,
5428
5428
  parentId,
5429
5429
  parentKey,
@@ -5529,7 +5529,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
5529
5529
  const ops = [];
5530
5530
  const op = {
5531
5531
  id: this._id,
5532
- opId: _optionalChain([pool, 'optionalAccess', _105 => _105.generateOpId, 'call', _106 => _106()]),
5532
+ opId: _optionalChain([pool, 'optionalAccess', _95 => _95.generateOpId, 'call', _96 => _96()]),
5533
5533
  type: 2 /* CREATE_LIST */,
5534
5534
  parentId,
5535
5535
  parentKey
@@ -5800,7 +5800,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
5800
5800
  #applyInsertUndoRedo(op) {
5801
5801
  const { id, parentKey: key } = op;
5802
5802
  const child = creationOpToLiveNode(op);
5803
- if (_optionalChain([this, 'access', _107 => _107._pool, 'optionalAccess', _108 => _108.getNode, 'call', _109 => _109(id)]) !== void 0) {
5803
+ if (_optionalChain([this, 'access', _97 => _97._pool, 'optionalAccess', _98 => _98.getNode, 'call', _99 => _99(id)]) !== void 0) {
5804
5804
  return { modified: false };
5805
5805
  }
5806
5806
  child._attach(id, nn(this._pool));
@@ -5808,8 +5808,8 @@ var LiveList = class _LiveList extends AbstractCrdt {
5808
5808
  const existingItemIndex = this._indexOfPosition(key);
5809
5809
  let newKey = key;
5810
5810
  if (existingItemIndex !== -1) {
5811
- const before2 = _optionalChain([this, 'access', _110 => _110.#items, 'access', _111 => _111[existingItemIndex], 'optionalAccess', _112 => _112._parentPos]);
5812
- const after2 = _optionalChain([this, 'access', _113 => _113.#items, 'access', _114 => _114[existingItemIndex + 1], 'optionalAccess', _115 => _115._parentPos]);
5811
+ const before2 = _optionalChain([this, 'access', _100 => _100.#items, 'access', _101 => _101[existingItemIndex], 'optionalAccess', _102 => _102._parentPos]);
5812
+ const after2 = _optionalChain([this, 'access', _103 => _103.#items, 'access', _104 => _104[existingItemIndex + 1], 'optionalAccess', _105 => _105._parentPos]);
5813
5813
  newKey = makePosition(before2, after2);
5814
5814
  child._setParentLink(this, newKey);
5815
5815
  }
@@ -5823,7 +5823,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
5823
5823
  #applySetUndoRedo(op) {
5824
5824
  const { id, parentKey: key } = op;
5825
5825
  const child = creationOpToLiveNode(op);
5826
- if (_optionalChain([this, 'access', _116 => _116._pool, 'optionalAccess', _117 => _117.getNode, 'call', _118 => _118(id)]) !== void 0) {
5826
+ if (_optionalChain([this, 'access', _106 => _106._pool, 'optionalAccess', _107 => _107.getNode, 'call', _108 => _108(id)]) !== void 0) {
5827
5827
  return { modified: false };
5828
5828
  }
5829
5829
  this.#unacknowledgedSets.set(key, nn(op.opId));
@@ -5944,7 +5944,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
5944
5944
  } else {
5945
5945
  this.#items[existingItemIndex]._setParentLink(
5946
5946
  this,
5947
- makePosition(newKey, _optionalChain([this, 'access', _119 => _119.#items, 'access', _120 => _120[existingItemIndex + 1], 'optionalAccess', _121 => _121._parentPos]))
5947
+ makePosition(newKey, _optionalChain([this, 'access', _109 => _109.#items, 'access', _110 => _110[existingItemIndex + 1], 'optionalAccess', _111 => _111._parentPos]))
5948
5948
  );
5949
5949
  const previousIndex = this.#items.indexOf(child);
5950
5950
  child._setParentLink(this, newKey);
@@ -5969,7 +5969,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
5969
5969
  if (existingItemIndex !== -1) {
5970
5970
  this.#items[existingItemIndex]._setParentLink(
5971
5971
  this,
5972
- makePosition(newKey, _optionalChain([this, 'access', _122 => _122.#items, 'access', _123 => _123[existingItemIndex + 1], 'optionalAccess', _124 => _124._parentPos]))
5972
+ makePosition(newKey, _optionalChain([this, 'access', _112 => _112.#items, 'access', _113 => _113[existingItemIndex + 1], 'optionalAccess', _114 => _114._parentPos]))
5973
5973
  );
5974
5974
  }
5975
5975
  child._setParentLink(this, newKey);
@@ -5988,7 +5988,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
5988
5988
  if (existingItemIndex !== -1) {
5989
5989
  this.#items[existingItemIndex]._setParentLink(
5990
5990
  this,
5991
- makePosition(newKey, _optionalChain([this, 'access', _125 => _125.#items, 'access', _126 => _126[existingItemIndex + 1], 'optionalAccess', _127 => _127._parentPos]))
5991
+ makePosition(newKey, _optionalChain([this, 'access', _115 => _115.#items, 'access', _116 => _116[existingItemIndex + 1], 'optionalAccess', _117 => _117._parentPos]))
5992
5992
  );
5993
5993
  }
5994
5994
  child._setParentLink(this, newKey);
@@ -6015,7 +6015,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6015
6015
  if (existingItemIndex !== -1) {
6016
6016
  this.#items[existingItemIndex]._setParentLink(
6017
6017
  this,
6018
- makePosition(newKey, _optionalChain([this, 'access', _128 => _128.#items, 'access', _129 => _129[existingItemIndex + 1], 'optionalAccess', _130 => _130._parentPos]))
6018
+ makePosition(newKey, _optionalChain([this, 'access', _118 => _118.#items, 'access', _119 => _119[existingItemIndex + 1], 'optionalAccess', _120 => _120._parentPos]))
6019
6019
  );
6020
6020
  }
6021
6021
  child._setParentLink(this, newKey);
@@ -6073,7 +6073,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6073
6073
  * @param element The element to add to the end of the LiveList.
6074
6074
  */
6075
6075
  push(element) {
6076
- _optionalChain([this, 'access', _131 => _131._pool, 'optionalAccess', _132 => _132.assertStorageIsWritable, 'call', _133 => _133()]);
6076
+ _optionalChain([this, 'access', _121 => _121._pool, 'optionalAccess', _122 => _122.assertStorageIsWritable, 'call', _123 => _123()]);
6077
6077
  return this.insert(element, this.length);
6078
6078
  }
6079
6079
  /**
@@ -6082,7 +6082,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6082
6082
  * @param index The index at which you want to insert the element.
6083
6083
  */
6084
6084
  insert(element, index) {
6085
- _optionalChain([this, 'access', _134 => _134._pool, 'optionalAccess', _135 => _135.assertStorageIsWritable, 'call', _136 => _136()]);
6085
+ _optionalChain([this, 'access', _124 => _124._pool, 'optionalAccess', _125 => _125.assertStorageIsWritable, 'call', _126 => _126()]);
6086
6086
  if (index < 0 || index > this.#items.length) {
6087
6087
  throw new Error(
6088
6088
  `Cannot insert list item at index "${index}". index should be between 0 and ${this.#items.length}`
@@ -6112,7 +6112,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6112
6112
  * @param targetIndex The index where the element should be after moving.
6113
6113
  */
6114
6114
  move(index, targetIndex) {
6115
- _optionalChain([this, 'access', _137 => _137._pool, 'optionalAccess', _138 => _138.assertStorageIsWritable, 'call', _139 => _139()]);
6115
+ _optionalChain([this, 'access', _127 => _127._pool, 'optionalAccess', _128 => _128.assertStorageIsWritable, 'call', _129 => _129()]);
6116
6116
  if (targetIndex < 0) {
6117
6117
  throw new Error("targetIndex cannot be less than 0");
6118
6118
  }
@@ -6170,7 +6170,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6170
6170
  * @param index The index of the element to delete
6171
6171
  */
6172
6172
  delete(index) {
6173
- _optionalChain([this, 'access', _140 => _140._pool, 'optionalAccess', _141 => _141.assertStorageIsWritable, 'call', _142 => _142()]);
6173
+ _optionalChain([this, 'access', _130 => _130._pool, 'optionalAccess', _131 => _131.assertStorageIsWritable, 'call', _132 => _132()]);
6174
6174
  if (index < 0 || index >= this.#items.length) {
6175
6175
  throw new Error(
6176
6176
  `Cannot delete list item at index "${index}". index should be between 0 and ${this.#items.length - 1}`
@@ -6203,7 +6203,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6203
6203
  }
6204
6204
  }
6205
6205
  clear() {
6206
- _optionalChain([this, 'access', _143 => _143._pool, 'optionalAccess', _144 => _144.assertStorageIsWritable, 'call', _145 => _145()]);
6206
+ _optionalChain([this, 'access', _133 => _133._pool, 'optionalAccess', _134 => _134.assertStorageIsWritable, 'call', _135 => _135()]);
6207
6207
  if (this._pool) {
6208
6208
  const ops = [];
6209
6209
  const reverseOps = [];
@@ -6237,7 +6237,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6237
6237
  }
6238
6238
  }
6239
6239
  set(index, item) {
6240
- _optionalChain([this, 'access', _146 => _146._pool, 'optionalAccess', _147 => _147.assertStorageIsWritable, 'call', _148 => _148()]);
6240
+ _optionalChain([this, 'access', _136 => _136._pool, 'optionalAccess', _137 => _137.assertStorageIsWritable, 'call', _138 => _138()]);
6241
6241
  if (index < 0 || index >= this.#items.length) {
6242
6242
  throw new Error(
6243
6243
  `Cannot set list item at index "${index}". index should be between 0 and ${this.#items.length - 1}`
@@ -6383,7 +6383,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
6383
6383
  #shiftItemPosition(index, key) {
6384
6384
  const shiftedPosition = makePosition(
6385
6385
  key,
6386
- this.#items.length > index + 1 ? _optionalChain([this, 'access', _149 => _149.#items, 'access', _150 => _150[index + 1], 'optionalAccess', _151 => _151._parentPos]) : void 0
6386
+ this.#items.length > index + 1 ? _optionalChain([this, 'access', _139 => _139.#items, 'access', _140 => _140[index + 1], 'optionalAccess', _141 => _141._parentPos]) : void 0
6387
6387
  );
6388
6388
  this.#items[index]._setParentLink(this, shiftedPosition);
6389
6389
  }
@@ -6508,7 +6508,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
6508
6508
  const ops = [];
6509
6509
  const op = {
6510
6510
  id: this._id,
6511
- opId: _optionalChain([pool, 'optionalAccess', _152 => _152.generateOpId, 'call', _153 => _153()]),
6511
+ opId: _optionalChain([pool, 'optionalAccess', _142 => _142.generateOpId, 'call', _143 => _143()]),
6512
6512
  type: 7 /* CREATE_MAP */,
6513
6513
  parentId,
6514
6514
  parentKey
@@ -6643,7 +6643,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
6643
6643
  * @param value The value of the element to add. Should be serializable to JSON.
6644
6644
  */
6645
6645
  set(key, value) {
6646
- _optionalChain([this, 'access', _154 => _154._pool, 'optionalAccess', _155 => _155.assertStorageIsWritable, 'call', _156 => _156()]);
6646
+ _optionalChain([this, 'access', _144 => _144._pool, 'optionalAccess', _145 => _145.assertStorageIsWritable, 'call', _146 => _146()]);
6647
6647
  const oldValue = this.#map.get(key);
6648
6648
  if (oldValue) {
6649
6649
  oldValue._detach();
@@ -6689,7 +6689,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
6689
6689
  * @returns true if an element existed and has been removed, or false if the element does not exist.
6690
6690
  */
6691
6691
  delete(key) {
6692
- _optionalChain([this, 'access', _157 => _157._pool, 'optionalAccess', _158 => _158.assertStorageIsWritable, 'call', _159 => _159()]);
6692
+ _optionalChain([this, 'access', _147 => _147._pool, 'optionalAccess', _148 => _148.assertStorageIsWritable, 'call', _149 => _149()]);
6693
6693
  const item = this.#map.get(key);
6694
6694
  if (item === void 0) {
6695
6695
  return false;
@@ -6879,7 +6879,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
6879
6879
  if (this._id === void 0) {
6880
6880
  throw new Error("Cannot serialize item is not attached");
6881
6881
  }
6882
- const opId = _optionalChain([pool, 'optionalAccess', _160 => _160.generateOpId, 'call', _161 => _161()]);
6882
+ const opId = _optionalChain([pool, 'optionalAccess', _150 => _150.generateOpId, 'call', _151 => _151()]);
6883
6883
  const ops = [];
6884
6884
  const op = {
6885
6885
  type: 4 /* CREATE_OBJECT */,
@@ -7151,7 +7151,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7151
7151
  * @param value The value of the property to add
7152
7152
  */
7153
7153
  set(key, value) {
7154
- _optionalChain([this, 'access', _162 => _162._pool, 'optionalAccess', _163 => _163.assertStorageIsWritable, 'call', _164 => _164()]);
7154
+ _optionalChain([this, 'access', _152 => _152._pool, 'optionalAccess', _153 => _153.assertStorageIsWritable, 'call', _154 => _154()]);
7155
7155
  this.update({ [key]: value });
7156
7156
  }
7157
7157
  /**
@@ -7166,7 +7166,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7166
7166
  * @param key The key of the property to delete
7167
7167
  */
7168
7168
  delete(key) {
7169
- _optionalChain([this, 'access', _165 => _165._pool, 'optionalAccess', _166 => _166.assertStorageIsWritable, 'call', _167 => _167()]);
7169
+ _optionalChain([this, 'access', _155 => _155._pool, 'optionalAccess', _156 => _156.assertStorageIsWritable, 'call', _157 => _157()]);
7170
7170
  const keyAsString = key;
7171
7171
  const oldValue = this.#map.get(keyAsString);
7172
7172
  if (oldValue === void 0) {
@@ -7219,7 +7219,7 @@ var LiveObject = (_class2 = class _LiveObject extends AbstractCrdt {
7219
7219
  * @param patch The object used to overrides properties
7220
7220
  */
7221
7221
  update(patch) {
7222
- _optionalChain([this, 'access', _168 => _168._pool, 'optionalAccess', _169 => _169.assertStorageIsWritable, 'call', _170 => _170()]);
7222
+ _optionalChain([this, 'access', _158 => _158._pool, 'optionalAccess', _159 => _159.assertStorageIsWritable, 'call', _160 => _160()]);
7223
7223
  if (_LiveObject.detectLargeObjects) {
7224
7224
  const data = {};
7225
7225
  for (const [key, value] of this.#map) {
@@ -7965,15 +7965,15 @@ function installBackgroundTabSpy() {
7965
7965
  const doc = typeof document !== "undefined" ? document : void 0;
7966
7966
  const inBackgroundSince = { current: null };
7967
7967
  function onVisibilityChange() {
7968
- if (_optionalChain([doc, 'optionalAccess', _171 => _171.visibilityState]) === "hidden") {
7968
+ if (_optionalChain([doc, 'optionalAccess', _161 => _161.visibilityState]) === "hidden") {
7969
7969
  inBackgroundSince.current = _nullishCoalesce(inBackgroundSince.current, () => ( Date.now()));
7970
7970
  } else {
7971
7971
  inBackgroundSince.current = null;
7972
7972
  }
7973
7973
  }
7974
- _optionalChain([doc, 'optionalAccess', _172 => _172.addEventListener, 'call', _173 => _173("visibilitychange", onVisibilityChange)]);
7974
+ _optionalChain([doc, 'optionalAccess', _162 => _162.addEventListener, 'call', _163 => _163("visibilitychange", onVisibilityChange)]);
7975
7975
  const unsub = () => {
7976
- _optionalChain([doc, 'optionalAccess', _174 => _174.removeEventListener, 'call', _175 => _175("visibilitychange", onVisibilityChange)]);
7976
+ _optionalChain([doc, 'optionalAccess', _164 => _164.removeEventListener, 'call', _165 => _165("visibilitychange", onVisibilityChange)]);
7977
7977
  };
7978
7978
  return [inBackgroundSince, unsub];
7979
7979
  }
@@ -8153,7 +8153,7 @@ function createRoom(options, config) {
8153
8153
  }
8154
8154
  }
8155
8155
  function isStorageWritable() {
8156
- const scopes = _optionalChain([context, 'access', _176 => _176.dynamicSessionInfoSig, 'access', _177 => _177.get, 'call', _178 => _178(), 'optionalAccess', _179 => _179.scopes]);
8156
+ const scopes = _optionalChain([context, 'access', _166 => _166.dynamicSessionInfoSig, 'access', _167 => _167.get, 'call', _168 => _168(), 'optionalAccess', _169 => _169.scopes]);
8157
8157
  return scopes !== void 0 ? canWriteStorage(scopes) : true;
8158
8158
  }
8159
8159
  const eventHub = {
@@ -8270,7 +8270,7 @@ function createRoom(options, config) {
8270
8270
  }
8271
8271
  case "experimental-fallback-to-http": {
8272
8272
  warn("Message is too large for websockets, so sending over HTTP instead");
8273
- const nonce = _nullishCoalesce(_optionalChain([context, 'access', _180 => _180.dynamicSessionInfoSig, 'access', _181 => _181.get, 'call', _182 => _182(), 'optionalAccess', _183 => _183.nonce]), () => ( raise("Session is not authorized to send message over HTTP")));
8273
+ 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")));
8274
8274
  void httpClient.sendMessages({ roomId, nonce, messages }).then((resp) => {
8275
8275
  if (!resp.ok && resp.status === 403) {
8276
8276
  managedSocket.reconnect();
@@ -8321,7 +8321,7 @@ function createRoom(options, config) {
8321
8321
  } else {
8322
8322
  context.root = LiveObject._fromItems(message.items, context.pool);
8323
8323
  }
8324
- const canWrite = _nullishCoalesce(_optionalChain([self, 'access', _184 => _184.get, 'call', _185 => _185(), 'optionalAccess', _186 => _186.canWrite]), () => ( true));
8324
+ const canWrite = _nullishCoalesce(_optionalChain([self, 'access', _174 => _174.get, 'call', _175 => _175(), 'optionalAccess', _176 => _176.canWrite]), () => ( true));
8325
8325
  const stackSizeBefore = context.undoStack.length;
8326
8326
  for (const key in context.initialStorage) {
8327
8327
  if (context.root.get(key) === void 0) {
@@ -8524,7 +8524,7 @@ function createRoom(options, config) {
8524
8524
  }
8525
8525
  context.myPresence.patch(patch);
8526
8526
  if (context.activeBatch) {
8527
- if (_optionalChain([options2, 'optionalAccess', _187 => _187.addToHistory])) {
8527
+ if (_optionalChain([options2, 'optionalAccess', _177 => _177.addToHistory])) {
8528
8528
  context.activeBatch.reverseOps.pushLeft({
8529
8529
  type: "presence",
8530
8530
  data: oldValues
@@ -8533,7 +8533,7 @@ function createRoom(options, config) {
8533
8533
  context.activeBatch.updates.presence = true;
8534
8534
  } else {
8535
8535
  flushNowOrSoon();
8536
- if (_optionalChain([options2, 'optionalAccess', _188 => _188.addToHistory])) {
8536
+ if (_optionalChain([options2, 'optionalAccess', _178 => _178.addToHistory])) {
8537
8537
  addToUndoStack([{ type: "presence", data: oldValues }]);
8538
8538
  }
8539
8539
  notify({ presence: true });
@@ -8730,7 +8730,7 @@ function createRoom(options, config) {
8730
8730
  if (process.env.NODE_ENV !== "production") {
8731
8731
  const traces = /* @__PURE__ */ new Set();
8732
8732
  for (const opId of message.opIds) {
8733
- const trace = _optionalChain([context, 'access', _189 => _189.opStackTraces, 'optionalAccess', _190 => _190.get, 'call', _191 => _191(opId)]);
8733
+ const trace = _optionalChain([context, 'access', _179 => _179.opStackTraces, 'optionalAccess', _180 => _180.get, 'call', _181 => _181(opId)]);
8734
8734
  if (trace) {
8735
8735
  traces.add(trace);
8736
8736
  }
@@ -8864,7 +8864,7 @@ ${Array.from(traces).join("\n\n")}`
8864
8864
  const unacknowledgedOps = new Map(context.unacknowledgedOps);
8865
8865
  createOrUpdateRootFromMessage(message);
8866
8866
  applyAndSendOps(unacknowledgedOps);
8867
- _optionalChain([_resolveStoragePromise, 'optionalCall', _192 => _192()]);
8867
+ _optionalChain([_resolveStoragePromise, 'optionalCall', _182 => _182()]);
8868
8868
  notifyStorageStatus();
8869
8869
  eventHub.storageDidLoad.notify();
8870
8870
  }
@@ -9085,8 +9085,8 @@ ${Array.from(traces).join("\n\n")}`
9085
9085
  async function getThreads(options2) {
9086
9086
  return httpClient.getThreads({
9087
9087
  roomId,
9088
- query: _optionalChain([options2, 'optionalAccess', _193 => _193.query]),
9089
- cursor: _optionalChain([options2, 'optionalAccess', _194 => _194.cursor])
9088
+ query: _optionalChain([options2, 'optionalAccess', _183 => _183.query]),
9089
+ cursor: _optionalChain([options2, 'optionalAccess', _184 => _184.cursor])
9090
9090
  });
9091
9091
  }
9092
9092
  async function getThread(threadId) {
@@ -9193,7 +9193,7 @@ ${Array.from(traces).join("\n\n")}`
9193
9193
  function getSubscriptionSettings(options2) {
9194
9194
  return httpClient.getSubscriptionSettings({
9195
9195
  roomId,
9196
- signal: _optionalChain([options2, 'optionalAccess', _195 => _195.signal])
9196
+ signal: _optionalChain([options2, 'optionalAccess', _185 => _185.signal])
9197
9197
  });
9198
9198
  }
9199
9199
  function updateSubscriptionSettings(settings) {
@@ -9215,7 +9215,7 @@ ${Array.from(traces).join("\n\n")}`
9215
9215
  {
9216
9216
  [kInternal]: {
9217
9217
  get presenceBuffer() {
9218
- return deepClone(_nullishCoalesce(_optionalChain([context, 'access', _196 => _196.buffer, 'access', _197 => _197.presenceUpdates, 'optionalAccess', _198 => _198.data]), () => ( null)));
9218
+ return deepClone(_nullishCoalesce(_optionalChain([context, 'access', _186 => _186.buffer, 'access', _187 => _187.presenceUpdates, 'optionalAccess', _188 => _188.data]), () => ( null)));
9219
9219
  },
9220
9220
  // prettier-ignore
9221
9221
  get undoStack() {
@@ -9230,9 +9230,9 @@ ${Array.from(traces).join("\n\n")}`
9230
9230
  return context.yjsProvider;
9231
9231
  },
9232
9232
  setYjsProvider(newProvider) {
9233
- _optionalChain([context, 'access', _199 => _199.yjsProvider, 'optionalAccess', _200 => _200.off, 'call', _201 => _201("status", yjsStatusDidChange)]);
9233
+ _optionalChain([context, 'access', _189 => _189.yjsProvider, 'optionalAccess', _190 => _190.off, 'call', _191 => _191("status", yjsStatusDidChange)]);
9234
9234
  context.yjsProvider = newProvider;
9235
- _optionalChain([newProvider, 'optionalAccess', _202 => _202.on, 'call', _203 => _203("status", yjsStatusDidChange)]);
9235
+ _optionalChain([newProvider, 'optionalAccess', _192 => _192.on, 'call', _193 => _193("status", yjsStatusDidChange)]);
9236
9236
  context.yjsProviderDidChange.notify();
9237
9237
  },
9238
9238
  yjsProviderDidChange: context.yjsProviderDidChange.observable,
@@ -9278,7 +9278,7 @@ ${Array.from(traces).join("\n\n")}`
9278
9278
  source.dispose();
9279
9279
  }
9280
9280
  eventHub.roomWillDestroy.notify();
9281
- _optionalChain([context, 'access', _204 => _204.yjsProvider, 'optionalAccess', _205 => _205.off, 'call', _206 => _206("status", yjsStatusDidChange)]);
9281
+ _optionalChain([context, 'access', _194 => _194.yjsProvider, 'optionalAccess', _195 => _195.off, 'call', _196 => _196("status", yjsStatusDidChange)]);
9282
9282
  syncSourceForStorage.destroy();
9283
9283
  syncSourceForYjs.destroy();
9284
9284
  uninstallBgTabSpy();
@@ -9428,7 +9428,7 @@ function makeClassicSubscribeFn(roomId, events, errorEvents) {
9428
9428
  }
9429
9429
  if (isLiveNode(first)) {
9430
9430
  const node = first;
9431
- if (_optionalChain([options, 'optionalAccess', _207 => _207.isDeep])) {
9431
+ if (_optionalChain([options, 'optionalAccess', _197 => _197.isDeep])) {
9432
9432
  const storageCallback = second;
9433
9433
  return subscribeToLiveStructureDeeply(node, storageCallback);
9434
9434
  } else {
@@ -9507,8 +9507,8 @@ function createClient(options) {
9507
9507
  const userId = token.k === "sec-legacy" /* SECRET_LEGACY */ ? token.id : token.uid;
9508
9508
  currentUserId.set(() => userId);
9509
9509
  });
9510
- const fetchPolyfill = _optionalChain([clientOptions, 'access', _208 => _208.polyfills, 'optionalAccess', _209 => _209.fetch]) || /* istanbul ignore next */
9511
- _optionalChain([globalThis, 'access', _210 => _210.fetch, 'optionalAccess', _211 => _211.bind, 'call', _212 => _212(globalThis)]);
9510
+ const fetchPolyfill = _optionalChain([clientOptions, 'access', _198 => _198.polyfills, 'optionalAccess', _199 => _199.fetch]) || /* istanbul ignore next */
9511
+ _optionalChain([globalThis, 'access', _200 => _200.fetch, 'optionalAccess', _201 => _201.bind, 'call', _202 => _202(globalThis)]);
9512
9512
  const httpClient = createApiClient({
9513
9513
  baseUrl,
9514
9514
  fetchPolyfill,
@@ -9526,7 +9526,7 @@ function createClient(options) {
9526
9526
  delegates: {
9527
9527
  createSocket: makeCreateSocketDelegateForAi(
9528
9528
  baseUrl,
9529
- _optionalChain([clientOptions, 'access', _213 => _213.polyfills, 'optionalAccess', _214 => _214.WebSocket])
9529
+ _optionalChain([clientOptions, 'access', _203 => _203.polyfills, 'optionalAccess', _204 => _204.WebSocket])
9530
9530
  ),
9531
9531
  authenticate: async () => {
9532
9532
  const resp = await authManager.getAuthValue({
@@ -9594,7 +9594,7 @@ function createClient(options) {
9594
9594
  createSocket: makeCreateSocketDelegateForRoom(
9595
9595
  roomId,
9596
9596
  baseUrl,
9597
- _optionalChain([clientOptions, 'access', _215 => _215.polyfills, 'optionalAccess', _216 => _216.WebSocket])
9597
+ _optionalChain([clientOptions, 'access', _205 => _205.polyfills, 'optionalAccess', _206 => _206.WebSocket])
9598
9598
  ),
9599
9599
  authenticate: makeAuthDelegateForRoom(roomId, authManager)
9600
9600
  })),
@@ -9617,7 +9617,7 @@ function createClient(options) {
9617
9617
  const shouldConnect = _nullishCoalesce(options2.autoConnect, () => ( true));
9618
9618
  if (shouldConnect) {
9619
9619
  if (typeof atob === "undefined") {
9620
- if (_optionalChain([clientOptions, 'access', _217 => _217.polyfills, 'optionalAccess', _218 => _218.atob]) === void 0) {
9620
+ if (_optionalChain([clientOptions, 'access', _207 => _207.polyfills, 'optionalAccess', _208 => _208.atob]) === void 0) {
9621
9621
  throw new Error(
9622
9622
  "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"
9623
9623
  );
@@ -9629,7 +9629,7 @@ function createClient(options) {
9629
9629
  return leaseRoom(newRoomDetails);
9630
9630
  }
9631
9631
  function getRoom(roomId) {
9632
- const room = _optionalChain([roomsById, 'access', _219 => _219.get, 'call', _220 => _220(roomId), 'optionalAccess', _221 => _221.room]);
9632
+ const room = _optionalChain([roomsById, 'access', _209 => _209.get, 'call', _210 => _210(roomId), 'optionalAccess', _211 => _211.room]);
9633
9633
  return room ? room : null;
9634
9634
  }
9635
9635
  function logout() {
@@ -9649,7 +9649,7 @@ function createClient(options) {
9649
9649
  const batchedResolveUsers = new Batch(
9650
9650
  async (batchedUserIds) => {
9651
9651
  const userIds = batchedUserIds.flat();
9652
- const users = await _optionalChain([resolveUsers, 'optionalCall', _222 => _222({ userIds })]);
9652
+ const users = await _optionalChain([resolveUsers, 'optionalCall', _212 => _212({ userIds })]);
9653
9653
  warnIfNoResolveUsers();
9654
9654
  return _nullishCoalesce(users, () => ( userIds.map(() => void 0)));
9655
9655
  },
@@ -9667,7 +9667,7 @@ function createClient(options) {
9667
9667
  const batchedResolveRoomsInfo = new Batch(
9668
9668
  async (batchedRoomIds) => {
9669
9669
  const roomIds = batchedRoomIds.flat();
9670
- const roomsInfo = await _optionalChain([resolveRoomsInfo, 'optionalCall', _223 => _223({ roomIds })]);
9670
+ const roomsInfo = await _optionalChain([resolveRoomsInfo, 'optionalCall', _213 => _213({ roomIds })]);
9671
9671
  warnIfNoResolveRoomsInfo();
9672
9672
  return _nullishCoalesce(roomsInfo, () => ( roomIds.map(() => void 0)));
9673
9673
  },
@@ -9720,7 +9720,7 @@ function createClient(options) {
9720
9720
  }
9721
9721
  };
9722
9722
  const win = typeof window !== "undefined" ? window : void 0;
9723
- _optionalChain([win, 'optionalAccess', _224 => _224.addEventListener, 'call', _225 => _225("beforeunload", maybePreventClose)]);
9723
+ _optionalChain([win, 'optionalAccess', _214 => _214.addEventListener, 'call', _215 => _215("beforeunload", maybePreventClose)]);
9724
9724
  }
9725
9725
  async function getNotificationSettings(options2) {
9726
9726
  const plainSettings = await httpClient.getNotificationSettings(options2);
@@ -9859,7 +9859,7 @@ var commentBodyElementsTypes = {
9859
9859
  mention: "inline"
9860
9860
  };
9861
9861
  function traverseCommentBody(body, elementOrVisitor, possiblyVisitor) {
9862
- if (!body || !_optionalChain([body, 'optionalAccess', _226 => _226.content])) {
9862
+ if (!body || !_optionalChain([body, 'optionalAccess', _216 => _216.content])) {
9863
9863
  return;
9864
9864
  }
9865
9865
  const element = typeof elementOrVisitor === "string" ? elementOrVisitor : void 0;
@@ -9869,13 +9869,13 @@ function traverseCommentBody(body, elementOrVisitor, possiblyVisitor) {
9869
9869
  for (const block of body.content) {
9870
9870
  if (type === "all" || type === "block") {
9871
9871
  if (guard(block)) {
9872
- _optionalChain([visitor, 'optionalCall', _227 => _227(block)]);
9872
+ _optionalChain([visitor, 'optionalCall', _217 => _217(block)]);
9873
9873
  }
9874
9874
  }
9875
9875
  if (type === "all" || type === "inline") {
9876
9876
  for (const inline of block.children) {
9877
9877
  if (guard(inline)) {
9878
- _optionalChain([visitor, 'optionalCall', _228 => _228(inline)]);
9878
+ _optionalChain([visitor, 'optionalCall', _218 => _218(inline)]);
9879
9879
  }
9880
9880
  }
9881
9881
  }
@@ -9909,7 +9909,7 @@ async function resolveUsersInCommentBody(body, resolveUsers) {
9909
9909
  userIds
9910
9910
  });
9911
9911
  for (const [index, userId] of userIds.entries()) {
9912
- const user = _optionalChain([users, 'optionalAccess', _229 => _229[index]]);
9912
+ const user = _optionalChain([users, 'optionalAccess', _219 => _219[index]]);
9913
9913
  if (user) {
9914
9914
  resolvedUsers.set(userId, user);
9915
9915
  }
@@ -10028,7 +10028,7 @@ var stringifyCommentBodyPlainElements = {
10028
10028
  text: ({ element }) => element.text,
10029
10029
  link: ({ element }) => _nullishCoalesce(element.text, () => ( element.url)),
10030
10030
  mention: ({ element, user }) => {
10031
- return `@${_nullishCoalesce(_optionalChain([user, 'optionalAccess', _230 => _230.name]), () => ( element.id))}`;
10031
+ return `@${_nullishCoalesce(_optionalChain([user, 'optionalAccess', _220 => _220.name]), () => ( element.id))}`;
10032
10032
  }
10033
10033
  };
10034
10034
  var stringifyCommentBodyHtmlElements = {
@@ -10058,7 +10058,7 @@ var stringifyCommentBodyHtmlElements = {
10058
10058
  return html`<a href="${href}" target="_blank" rel="noopener noreferrer">${element.text ? html`${element.text}` : element.url}</a>`;
10059
10059
  },
10060
10060
  mention: ({ element, user }) => {
10061
- return html`<span data-mention>@${_optionalChain([user, 'optionalAccess', _231 => _231.name]) ? html`${_optionalChain([user, 'optionalAccess', _232 => _232.name])}` : element.id}</span>`;
10061
+ return html`<span data-mention>@${_optionalChain([user, 'optionalAccess', _221 => _221.name]) ? html`${_optionalChain([user, 'optionalAccess', _222 => _222.name])}` : element.id}</span>`;
10062
10062
  }
10063
10063
  };
10064
10064
  var stringifyCommentBodyMarkdownElements = {
@@ -10088,19 +10088,19 @@ var stringifyCommentBodyMarkdownElements = {
10088
10088
  return markdown`[${_nullishCoalesce(element.text, () => ( element.url))}](${href})`;
10089
10089
  },
10090
10090
  mention: ({ element, user }) => {
10091
- return markdown`@${_nullishCoalesce(_optionalChain([user, 'optionalAccess', _233 => _233.name]), () => ( element.id))}`;
10091
+ return markdown`@${_nullishCoalesce(_optionalChain([user, 'optionalAccess', _223 => _223.name]), () => ( element.id))}`;
10092
10092
  }
10093
10093
  };
10094
10094
  async function stringifyCommentBody(body, options) {
10095
- const format = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _234 => _234.format]), () => ( "plain"));
10096
- const separator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _235 => _235.separator]), () => ( (format === "markdown" ? "\n\n" : "\n")));
10095
+ const format = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _224 => _224.format]), () => ( "plain"));
10096
+ const separator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _225 => _225.separator]), () => ( (format === "markdown" ? "\n\n" : "\n")));
10097
10097
  const elements = {
10098
10098
  ...format === "html" ? stringifyCommentBodyHtmlElements : format === "markdown" ? stringifyCommentBodyMarkdownElements : stringifyCommentBodyPlainElements,
10099
- ..._optionalChain([options, 'optionalAccess', _236 => _236.elements])
10099
+ ..._optionalChain([options, 'optionalAccess', _226 => _226.elements])
10100
10100
  };
10101
10101
  const resolvedUsers = await resolveUsersInCommentBody(
10102
10102
  body,
10103
- _optionalChain([options, 'optionalAccess', _237 => _237.resolveUsers])
10103
+ _optionalChain([options, 'optionalAccess', _227 => _227.resolveUsers])
10104
10104
  );
10105
10105
  const blocks = body.content.flatMap((block, blockIndex) => {
10106
10106
  switch (block.type) {
@@ -10386,12 +10386,12 @@ function legacy_patchImmutableNode(state, path, update) {
10386
10386
  }
10387
10387
  const newState = Object.assign({}, state);
10388
10388
  for (const key in update.updates) {
10389
- if (_optionalChain([update, 'access', _238 => _238.updates, 'access', _239 => _239[key], 'optionalAccess', _240 => _240.type]) === "update") {
10389
+ if (_optionalChain([update, 'access', _228 => _228.updates, 'access', _229 => _229[key], 'optionalAccess', _230 => _230.type]) === "update") {
10390
10390
  const val = update.node.get(key);
10391
10391
  if (val !== void 0) {
10392
10392
  newState[key] = lsonToJson(val);
10393
10393
  }
10394
- } else if (_optionalChain([update, 'access', _241 => _241.updates, 'access', _242 => _242[key], 'optionalAccess', _243 => _243.type]) === "delete") {
10394
+ } else if (_optionalChain([update, 'access', _231 => _231.updates, 'access', _232 => _232[key], 'optionalAccess', _233 => _233.type]) === "delete") {
10395
10395
  delete newState[key];
10396
10396
  }
10397
10397
  }
@@ -10452,12 +10452,12 @@ function legacy_patchImmutableNode(state, path, update) {
10452
10452
  }
10453
10453
  const newState = Object.assign({}, state);
10454
10454
  for (const key in update.updates) {
10455
- if (_optionalChain([update, 'access', _244 => _244.updates, 'access', _245 => _245[key], 'optionalAccess', _246 => _246.type]) === "update") {
10455
+ if (_optionalChain([update, 'access', _234 => _234.updates, 'access', _235 => _235[key], 'optionalAccess', _236 => _236.type]) === "update") {
10456
10456
  const value = update.node.get(key);
10457
10457
  if (value !== void 0) {
10458
10458
  newState[key] = lsonToJson(value);
10459
10459
  }
10460
- } else if (_optionalChain([update, 'access', _247 => _247.updates, 'access', _248 => _248[key], 'optionalAccess', _249 => _249.type]) === "delete") {
10460
+ } else if (_optionalChain([update, 'access', _237 => _237.updates, 'access', _238 => _238[key], 'optionalAccess', _239 => _239.type]) === "delete") {
10461
10461
  delete newState[key];
10462
10462
  }
10463
10463
  }
@@ -10537,9 +10537,9 @@ function makePoller(callback, intervalMs, options) {
10537
10537
  const startTime = performance.now();
10538
10538
  const doc = typeof document !== "undefined" ? document : void 0;
10539
10539
  const win = typeof window !== "undefined" ? window : void 0;
10540
- const maxStaleTimeMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _250 => _250.maxStaleTimeMs]), () => ( Number.POSITIVE_INFINITY));
10540
+ const maxStaleTimeMs = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _240 => _240.maxStaleTimeMs]), () => ( Number.POSITIVE_INFINITY));
10541
10541
  const context = {
10542
- inForeground: _optionalChain([doc, 'optionalAccess', _251 => _251.visibilityState]) !== "hidden",
10542
+ inForeground: _optionalChain([doc, 'optionalAccess', _241 => _241.visibilityState]) !== "hidden",
10543
10543
  lastSuccessfulPollAt: startTime,
10544
10544
  count: 0,
10545
10545
  backoff: 0
@@ -10620,11 +10620,11 @@ function makePoller(callback, intervalMs, options) {
10620
10620
  pollNowIfStale();
10621
10621
  }
10622
10622
  function onVisibilityChange() {
10623
- setInForeground(_optionalChain([doc, 'optionalAccess', _252 => _252.visibilityState]) !== "hidden");
10623
+ setInForeground(_optionalChain([doc, 'optionalAccess', _242 => _242.visibilityState]) !== "hidden");
10624
10624
  }
10625
- _optionalChain([doc, 'optionalAccess', _253 => _253.addEventListener, 'call', _254 => _254("visibilitychange", onVisibilityChange)]);
10626
- _optionalChain([win, 'optionalAccess', _255 => _255.addEventListener, 'call', _256 => _256("online", onVisibilityChange)]);
10627
- _optionalChain([win, 'optionalAccess', _257 => _257.addEventListener, 'call', _258 => _258("focus", pollNowIfStale)]);
10625
+ _optionalChain([doc, 'optionalAccess', _243 => _243.addEventListener, 'call', _244 => _244("visibilitychange", onVisibilityChange)]);
10626
+ _optionalChain([win, 'optionalAccess', _245 => _245.addEventListener, 'call', _246 => _246("online", onVisibilityChange)]);
10627
+ _optionalChain([win, 'optionalAccess', _247 => _247.addEventListener, 'call', _248 => _248("focus", pollNowIfStale)]);
10628
10628
  fsm.start();
10629
10629
  return {
10630
10630
  inc,