@markupai/sidebar-adapter 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,11 +1,11 @@
1
- var fe = /* @__PURE__ */ (function(e) {
1
+ var Pe = /* @__PURE__ */ (function(e) {
2
2
  return e.TEXT_PLAIN = "text/plain", e.TEXT_MARKDOWN = "text/markdown", e.TEXT_HTML = "text/html", e.APPLICATION_DITA_XML = "application/dita+xml", e;
3
- })({}), me = [
3
+ })({}), Ee = [
4
4
  "text/plain",
5
5
  "text/markdown",
6
6
  "text/html",
7
7
  "application/dita+xml"
8
- ], ye = {
8
+ ], Re = {
9
9
  integrationName: "unknown",
10
10
  integrationVersion: "unknown",
11
11
  integrationId: "markupai-sidebar-app",
@@ -14,80 +14,88 @@ var fe = /* @__PURE__ */ (function(e) {
14
14
  supportComments: !1,
15
15
  multiAgent: !1,
16
16
  multiDocument: !1
17
- }, Ie = (e) => typeof e != "object" || e === null ? !1 : Array.isArray(e.fields), ve = (e) => {
17
+ }, Oe = (e) => typeof e != "object" || e === null ? !1 : Array.isArray(e.fields), Te = (e) => {
18
18
  if (typeof e != "object" || e === null) return !1;
19
19
  const t = e;
20
- return typeof t.id != "string" || t.id.length === 0 || typeof t.label != "string" ? !1 : t.type === "boolean" ? typeof t.default == "boolean" : t.type === "enum" ? typeof t.default != "string" || !Array.isArray(t.options) || t.options.length === 0 ? !1 : t.options.every((n) => {
21
- if (typeof n != "object" || n === null) return !1;
22
- const r = n;
23
- return typeof r.value == "string" && typeof r.label == "string";
20
+ return typeof t.id != "string" || t.id.length === 0 || typeof t.label != "string" ? !1 : t.type === "boolean" ? typeof t.default == "boolean" : t.type === "enum" ? typeof t.default != "string" || !Array.isArray(t.options) || t.options.length === 0 ? !1 : t.options.every((r) => {
21
+ if (typeof r != "object" || r === null) return !1;
22
+ const n = r;
23
+ return typeof n.value == "string" && typeof n.label == "string";
24
24
  }) : !1;
25
- }, V = "2.4.0", v = class x extends Error {
25
+ }, Y = "2.5.0", A = class _ extends Error {
26
26
  name = "TextLookupError";
27
27
  constructor(t) {
28
- super(t), Object.setPrototypeOf(this, x.prototype);
28
+ super(t), Object.setPrototypeOf(this, _.prototype);
29
29
  }
30
- }, M = class _ extends v {
30
+ }, L = class k extends A {
31
31
  name = "ReplaceBatchError";
32
32
  applied;
33
33
  failed;
34
- constructor(t, n) {
35
- super(t), this.applied = n.applied.map((r) => ({
36
- start: r.start,
37
- end: r.end
38
- })), this.failed = n.failed.map((r) => L(r, r.message)), Object.setPrototypeOf(this, _.prototype);
34
+ constructor(t, r) {
35
+ super(t), this.applied = r.applied.map((n) => ({
36
+ start: n.start,
37
+ end: n.end
38
+ })), this.failed = r.failed.map((n) => U(n, n.message)), Object.setPrototypeOf(this, k.prototype);
39
+ }
40
+ }, N = class B extends Error {
41
+ name = "IpcTimeoutError";
42
+ constructor(t, r, n) {
43
+ super(`IPC call timeout: "${t}" did not respond within ${String(r)}ms` + (n === void 0 ? "" : ` (timeout ${String(n)} could not be used)`)), Object.setPrototypeOf(this, B.prototype);
39
44
  }
40
45
  };
41
- function Ae(e) {
42
- return e instanceof M;
46
+ function De(e) {
47
+ return e instanceof N;
48
+ }
49
+ function Me(e) {
50
+ return e instanceof L;
43
51
  }
44
- function L(e, t) {
45
- const n = {
52
+ function U(e, t) {
53
+ const r = {
46
54
  start: e.start,
47
55
  end: e.end
48
56
  };
49
- return typeof t == "string" && t.trim() !== "" && (n.message = t), n;
57
+ return typeof t == "string" && t.trim() !== "" && (r.message = t), r;
50
58
  }
51
- function R(e) {
59
+ function O(e) {
52
60
  return Array.isArray(e) ? e.flatMap((t) => {
53
61
  if (t === null || typeof t != "object") return [];
54
- const { start: n, end: r, message: i } = t;
55
- return typeof n != "number" || typeof r != "number" ? [] : [{
62
+ const { start: r, end: n, message: i } = t;
63
+ return typeof r != "number" || typeof n != "number" ? [] : [{
56
64
  range: {
57
- start: n,
58
- end: r
65
+ start: r,
66
+ end: n
59
67
  },
60
68
  message: i
61
69
  }];
62
70
  }) : [];
63
71
  }
64
- function Ce(e) {
65
- return e instanceof v;
72
+ function xe(e) {
73
+ return e instanceof A;
66
74
  }
67
- var O = {
68
- TextLookupError: (e) => new v(e),
69
- ReplaceBatchError: (e, t) => new M(e, {
70
- applied: R(t.applied).map((n) => n.range),
71
- failed: R(t.failed).map((n) => L(n.range, n.message))
75
+ var T = {
76
+ TextLookupError: (e) => new A(e),
77
+ ReplaceBatchError: (e, t) => new L(e, {
78
+ applied: O(t.applied).map((r) => r.range),
79
+ failed: O(t.failed).map((r) => U(r.range, r.message))
72
80
  })
73
81
  };
74
- function z(e) {
75
- const t = e.message ?? "", n = e.name, r = typeof n == "string" && n in O ? O[n] : void 0;
76
- return r ? r(t, e) : Object.assign(new Error(t), n ? { name: n } : {});
77
- }
78
- var k = ":", B = /^[a-z][a-z0-9-]*$/;
79
- function be(e) {
80
- const t = e.indexOf(k);
81
- return t <= 0 || t === e.length - 1 ? !1 : B.test(e.slice(0, t));
82
- }
83
- function Se(e, t) {
84
- const n = e.trim().toLowerCase(), r = t.trim();
85
- if (!B.test(n)) throw new Error(`Invalid document reference prefix ${JSON.stringify(e)}: expected a lowercase name like "word".`);
86
- if (r.length === 0) throw new Error("Invalid document reference: the document id is empty.");
87
- const i = `${n}${k}`;
88
- return r.startsWith(i) ? r : `${i}${r}`;
89
- }
90
- var W = class extends Promise {
82
+ function X(e) {
83
+ const t = e.message ?? "", r = e.name, n = typeof r == "string" && r in T ? T[r] : void 0;
84
+ return n ? n(t, e) : Object.assign(new Error(t), r ? { name: r } : {});
85
+ }
86
+ var H = ":", $ = /^[a-z][a-z0-9-]*$/;
87
+ function _e(e) {
88
+ const t = e.indexOf(H);
89
+ return t <= 0 || t === e.length - 1 ? !1 : $.test(e.slice(0, t));
90
+ }
91
+ function Le(e, t) {
92
+ const r = e.trim().toLowerCase(), n = t.trim();
93
+ if (!$.test(r)) throw new Error(`Invalid document reference prefix ${JSON.stringify(e)}: expected a lowercase name like "word".`);
94
+ if (n.length === 0) throw new Error("Invalid document reference: the document id is empty.");
95
+ const i = `${r}${H}`;
96
+ return n.startsWith(i) ? n : `${i}${n}`;
97
+ }
98
+ var K = class extends Promise {
91
99
  static get [Symbol.species]() {
92
100
  return Promise;
93
101
  }
@@ -95,29 +103,49 @@ var W = class extends Promise {
95
103
  reject;
96
104
  constructor(e = () => {
97
105
  }) {
98
- let t, n;
99
- super((r, i) => {
100
- t = r, n = i, e(r, i);
101
- }), this.resolve = t, this.reject = n;
102
- }
103
- }, G = { timeout: 1e4 };
104
- function J(e) {
105
- const t = typeof e == "object" && e !== null ? Object.fromEntries(Object.getOwnPropertyNames(e).map((o) => [o, e[o]])) : {}, n = e instanceof Error ? e.message : String(e), r = typeof t.message == "string" && t.message !== "" ? t.message : n, i = e instanceof Error ? e.name : void 0, a = typeof t.name == "string" ? t.name : i;
106
+ let t, r;
107
+ super((n, i) => {
108
+ t = n, r = i, e(n, i);
109
+ }), this.resolve = t, this.reject = r;
110
+ }
111
+ }, j = { timeout: 1e4 };
112
+ function I(e, t) {
113
+ try {
114
+ e?.(t);
115
+ } catch {
116
+ }
117
+ }
118
+ function q(e) {
119
+ const t = typeof e == "object" && e !== null ? Object.fromEntries(Object.getOwnPropertyNames(e).map((s) => [s, e[s]])) : {}, r = e instanceof Error ? e.message : String(e), n = typeof t.message == "string" && t.message !== "" ? t.message : r, i = e instanceof Error ? e.name : void 0, a = typeof t.name == "string" ? t.name : i;
106
120
  return JSON.stringify({
107
121
  ...t,
108
- message: r,
122
+ message: n,
109
123
  ...a !== void 0 && { name: a }
110
124
  });
111
125
  }
112
- var N = class {
126
+ function Z(e) {
127
+ try {
128
+ return X(JSON.parse(e));
129
+ } catch {
130
+ return /* @__PURE__ */ new Error("Failed to parse error from IPC");
131
+ }
132
+ }
133
+ var Q = 3e5, ee = 2147483647;
134
+ function te(e, t) {
135
+ const r = (i) => !Number.isNaN(i) && i > 0;
136
+ let n = j.timeout;
137
+ return r(e) ? n = e : r(t) && (n = t), Math.min(Math.max(1, Math.ceil(n)), ee);
138
+ }
139
+ var F = class {
113
140
  promisesByID = {};
114
141
  receiversByName = {};
142
+ progressReceiverNames = /* @__PURE__ */ new Set();
115
143
  currentID = 0;
116
144
  config;
117
145
  postMessage;
118
146
  constructor(e, t) {
119
147
  this.postMessage = e, this.config = {
120
- ...G,
148
+ ...j,
121
149
  ...t
122
150
  };
123
151
  }
@@ -130,30 +158,39 @@ var N = class {
130
158
  call(e, ...t) {
131
159
  return this.callWithOptions(e, {}, ...t);
132
160
  }
133
- callWithOptions(e, t, ...n) {
134
- const r = this.currentID++, i = new W(), a = t.timeout ?? this.config.timeout, o = setTimeout(() => {
135
- if (r in this.promisesByID) {
136
- const l = /* @__PURE__ */ new Error(`IPC call timeout: "${e}" did not respond within ${String(a)}ms`);
137
- i.reject(l), Reflect.deleteProperty(this.promisesByID, r);
138
- }
139
- }, a);
140
- this.promisesByID[r] = {
141
- promise: i,
142
- timeoutId: o
161
+ callWithOptions(e, t, ...r) {
162
+ const n = t.timeout ?? this.config.timeout, i = te(n, this.config.timeout), a = this.currentID++, s = new K(), o = setTimeout(() => {
163
+ if (a in this.promisesByID)
164
+ if (s.reject(new N(e, i, i === n ? void 0 : n)), t.onProgress || t.onLateResult) {
165
+ const c = this.promisesByID[a];
166
+ c.timedOut = !0, c.timeoutId = setTimeout(() => {
167
+ this.promisesByID[a] === c && Reflect.deleteProperty(this.promisesByID, a);
168
+ }, Q);
169
+ } else Reflect.deleteProperty(this.promisesByID, a);
170
+ }, i);
171
+ this.promisesByID[a] = {
172
+ promise: s,
173
+ timeoutId: o,
174
+ onProgress: t.onProgress,
175
+ onLateResult: t.onLateResult,
176
+ timedOut: !1
143
177
  };
144
- const s = {
178
+ const l = {
145
179
  type: "call",
146
- id: r,
180
+ id: a,
147
181
  name: e,
148
- data: n
182
+ data: r
149
183
  };
150
- return this.postMessage(s), i;
184
+ return this.postMessage(l), s;
151
185
  }
152
186
  receive(e, t) {
153
- this.receiversByName[e] = t;
187
+ this.receiversByName[e] = t, this.progressReceiverNames.delete(e);
188
+ }
189
+ receiveWithProgress(e, t) {
190
+ this.receiversByName[e] = t, this.progressReceiverNames.add(e);
154
191
  }
155
192
  ignore(e) {
156
- delete this.receiversByName[e];
193
+ delete this.receiversByName[e], this.progressReceiverNames.delete(e);
157
194
  }
158
195
  async handleMessage(e) {
159
196
  switch (e.type) {
@@ -166,116 +203,164 @@ var N = class {
166
203
  case "error":
167
204
  this.handleError(e);
168
205
  break;
206
+ case "progress":
207
+ this.handleProgress(e);
208
+ break;
169
209
  default:
170
210
  }
171
211
  }
172
212
  async handleCall(e) {
173
- const { id: t, name: n, data: r } = e;
174
- if (!(n in this.receiversByName)) {
175
- const a = /* @__PURE__ */ new Error(`No receiver registered for: ${n}`), o = JSON.stringify({
176
- message: a.message,
177
- name: a.name
213
+ const { id: t, name: r, data: n } = e;
214
+ if (!(r in this.receiversByName)) {
215
+ const o = /* @__PURE__ */ new Error(`No receiver registered for: ${r}`), l = JSON.stringify({
216
+ message: o.message,
217
+ name: o.name
178
218
  });
179
219
  this.postMessage({
180
220
  type: "error",
181
221
  id: t,
182
- name: n,
183
- errorJSON: o
222
+ name: r,
223
+ errorJSON: l
184
224
  });
185
225
  return;
186
226
  }
187
- const i = this.receiversByName[n];
227
+ const i = this.receiversByName[r];
228
+ let a = !1;
229
+ const s = (o) => {
230
+ if (!a)
231
+ try {
232
+ this.postMessage({
233
+ type: "progress",
234
+ id: t,
235
+ name: r,
236
+ data: o
237
+ });
238
+ } catch {
239
+ }
240
+ };
188
241
  try {
189
- if (!Array.isArray(r)) throw new TypeError(`IPC: Expected array of arguments but got ${typeof r}`);
190
- const a = await i(...r), o = {
242
+ if (!Array.isArray(n)) throw new TypeError(`IPC: Expected array of arguments but got ${typeof n}`);
243
+ const o = n, l = await (this.progressReceiverNames.has(r) ? i(s, ...o) : i(...o));
244
+ a = !0;
245
+ const c = {
191
246
  type: "response",
192
247
  id: t,
193
- name: n,
194
- data: a
248
+ name: r,
249
+ data: l
195
250
  };
196
- this.postMessage(o);
197
- } catch (a) {
198
- const o = {
251
+ this.postMessage(c);
252
+ } catch (o) {
253
+ a = !0;
254
+ const l = {
199
255
  type: "error",
200
256
  id: t,
201
- name: n,
202
- errorJSON: J(a)
257
+ name: r,
258
+ errorJSON: q(o)
203
259
  };
204
- this.postMessage(o);
260
+ this.postMessage(l);
205
261
  }
206
262
  }
207
263
  handleResponse(e) {
208
264
  const { id: t } = e;
209
265
  if (t in this.promisesByID) {
210
- const { promise: n, timeoutId: r } = this.promisesByID[t];
211
- clearTimeout(r), n.resolve(e.data), Reflect.deleteProperty(this.promisesByID, t);
266
+ const { promise: r, timeoutId: n, timedOut: i, onLateResult: a } = this.promisesByID[t];
267
+ if (clearTimeout(n), Reflect.deleteProperty(this.promisesByID, t), i) {
268
+ I(a, { status: "success" });
269
+ return;
270
+ }
271
+ r.resolve(e.data);
212
272
  }
213
273
  }
214
274
  handleError(e) {
215
- const { id: t, errorJSON: n } = e;
275
+ const { id: t, errorJSON: r } = e;
216
276
  if (t in this.promisesByID) {
217
- const { promise: r, timeoutId: i } = this.promisesByID[t];
218
- clearTimeout(i);
219
- try {
220
- const a = JSON.parse(n), o = z(a);
221
- r.reject(o);
222
- } catch {
223
- r.reject(/* @__PURE__ */ new Error("Failed to parse error from IPC"));
277
+ const { promise: n, timeoutId: i, timedOut: a, onLateResult: s } = this.promisesByID[t];
278
+ clearTimeout(i), Reflect.deleteProperty(this.promisesByID, t);
279
+ const o = Z(r);
280
+ if (a) {
281
+ I(s, {
282
+ status: "error",
283
+ error: o
284
+ });
285
+ return;
224
286
  }
225
- Reflect.deleteProperty(this.promisesByID, t);
287
+ n.reject(o);
226
288
  }
227
289
  }
290
+ handleProgress(e) {
291
+ const { id: t } = e;
292
+ t in this.promisesByID && I(this.promisesByID[t].onProgress, e.data);
293
+ }
228
294
  destroy() {
229
295
  for (const { promise: e, timeoutId: t } of Object.values(this.promisesByID))
230
296
  clearTimeout(t), e.reject(/* @__PURE__ */ new Error("IPC destroyed"));
231
- this.promisesByID = {}, this.receiversByName = {};
297
+ this.promisesByID = {}, this.receiversByName = {}, this.progressReceiverNames.clear();
232
298
  }
233
299
  };
234
- var Y = /* @__PURE__ */ new Set(["auto", "prompt"]), I = (e, t) => {
235
- const n = e[t];
236
- if (!(typeof n != "string" || n.length === 0))
237
- return n.slice(0, 64);
300
+ function re(e) {
301
+ if (typeof e != "object" || e === null) return !1;
302
+ const { start: t, end: r } = e;
303
+ return typeof t == "number" && typeof r == "number";
304
+ }
305
+ var D = (e) => `${String(e.start)}:${String(e.end)}`;
306
+ function ne(e, t) {
307
+ if (typeof e != "object" || e === null) return null;
308
+ const { total: r, applied: n } = e;
309
+ if (typeof r != "number" || !Array.isArray(n) || !n.every(re)) return null;
310
+ const i = new Set(t.map(({ range: a }) => D(a)));
311
+ return {
312
+ total: r,
313
+ applied: n.filter((a) => i.has(D(a))).map(({ start: a, end: s }) => ({
314
+ start: a,
315
+ end: s
316
+ }))
317
+ };
318
+ }
319
+ var ie = /* @__PURE__ */ new Set(["auto", "prompt"]), v = (e, t) => {
320
+ const r = e[t];
321
+ if (!(typeof r != "string" || r.length === 0))
322
+ return r.slice(0, 64);
238
323
  };
239
- function X(e) {
324
+ function ae(e) {
240
325
  if (typeof e != "object" || e === null || Array.isArray(e)) return null;
241
- const t = e, n = I(t, "version"), r = I(t, "commitHash");
242
- if (n === void 0 || r === void 0) return null;
326
+ const t = e, r = v(t, "version"), n = v(t, "commitHash");
327
+ if (r === void 0 || n === void 0) return null;
243
328
  const i = {
244
- version: n,
245
- commitHash: r
329
+ version: r,
330
+ commitHash: n
246
331
  };
247
- typeof t.swControlled == "boolean" && (i.swControlled = t.swControlled), Y.has(t.pwaUpdateMode) && (i.pwaUpdateMode = t.pwaUpdateMode);
248
- const a = I(t, "adapterVersion");
332
+ typeof t.swControlled == "boolean" && (i.swControlled = t.swControlled), ie.has(t.pwaUpdateMode) && (i.pwaUpdateMode = t.pwaUpdateMode);
333
+ const a = v(t, "adapterVersion");
249
334
  return a !== void 0 && (i.adapterVersion = a), i;
250
335
  }
251
- function K(e) {
336
+ function se(e) {
252
337
  return typeof e != "string" || e.length === 0 ? null : e.slice(0, 64);
253
338
  }
254
- var q = class {
339
+ var oe = class {
255
340
  ipc;
256
341
  sidebar;
257
342
  targetOrigin;
258
343
  latestHostAdapterVersion = null;
259
- constructor(e, t, n = "*") {
260
- this.sidebar = e || {}, this.targetOrigin = n, this.ipc = new N((r) => {
261
- window.parent.postMessage(r, this.targetOrigin);
344
+ constructor(e, t, r = "*") {
345
+ this.sidebar = e || {}, this.targetOrigin = r, this.ipc = new F((n) => {
346
+ window.parent.postMessage(n, this.targetOrigin);
262
347
  }, t), window.addEventListener("message", this.handleMessage), this.registerReceivers();
263
348
  }
264
349
  handleMessage = (e) => {
265
- const t = globalThis.window.location.origin, n = this.targetOrigin;
266
- e.origin !== t && (n !== "*" && e.origin !== n || e.data && typeof e.data == "object" && this.ipc.handleMessage(e.data));
350
+ const t = globalThis.window.location.origin, r = this.targetOrigin;
351
+ e.origin !== t && (r !== "*" && e.origin !== r || e.data && typeof e.data == "object" && this.ipc.handleMessage(e.data));
267
352
  };
268
353
  registerReceivers() {
269
354
  if (this.sidebar.onPluginStatusChange) {
270
355
  const e = this.sidebar.onPluginStatusChange;
271
- this.ipc.receive("onPluginStatusChange", async (t, n) => {
272
- await e(t, n);
356
+ this.ipc.receive("onPluginStatusChange", async (t, r) => {
357
+ await e(t, r);
273
358
  });
274
359
  }
275
360
  if (this.sidebar.activateAgenticIssue) {
276
361
  const e = this.sidebar.activateAgenticIssue;
277
- this.ipc.receive("activateAgenticIssue", async (t, n) => {
278
- await e(t, typeof n == "string" ? n : null);
362
+ this.ipc.receive("activateAgenticIssue", async (t, r) => {
363
+ await e(t, typeof r == "string" ? r : null);
279
364
  });
280
365
  }
281
366
  if (this.sidebar.invalidateAgenticIssue) {
@@ -314,11 +399,11 @@ var q = class {
314
399
  }
315
400
  }
316
401
  async getInitConfig(e) {
317
- const { hostAdapterVersion: t, ...n } = e ? await this.ipc.call("getInitConfig", {
402
+ const { hostAdapterVersion: t, ...r } = e ? await this.ipc.call("getInitConfig", {
318
403
  ...e,
319
- adapterVersion: e.adapterVersion ?? "2.4.0"
404
+ adapterVersion: e.adapterVersion ?? "2.5.0"
320
405
  }) : await this.ipc.call("getInitConfig");
321
- return this.latestHostAdapterVersion = K(t), n;
406
+ return this.latestHostAdapterVersion = se(t), r;
322
407
  }
323
408
  getHostAdapterVersion() {
324
409
  return this.latestHostAdapterVersion;
@@ -329,23 +414,30 @@ var q = class {
329
414
  async getSelectedContent(e) {
330
415
  return this.ipc.callWithOptions("getSelectedContent", e ?? {});
331
416
  }
332
- async replaceContent(e, t, n = null) {
333
- await this.ipc.call("replaceContent", e, t, n);
417
+ async replaceContent(e, t, r = null) {
418
+ await this.ipc.call("replaceContent", e, t, r);
334
419
  }
335
420
  async selectContent(e, t = null) {
336
421
  await this.ipc.call("selectContent", e, t);
337
422
  }
338
- async replaceMultipleContents(e) {
339
- await this.ipc.call("replaceMultipleContents", e);
423
+ async replaceMultipleContents(e, t) {
424
+ const { onProgress: r, ...n } = t ?? {};
425
+ await this.ipc.callWithOptions("replaceMultipleContents", {
426
+ ...n,
427
+ ...r && { onProgress: (i) => {
428
+ const a = ne(i, e);
429
+ a && r(a);
430
+ } }
431
+ }, e);
340
432
  }
341
- async onAgenticAgentResults(e, t, n = null) {
342
- await this.ipc.call("onAgenticAgentResults", e, t, n);
433
+ async onAgenticAgentResults(e, t, r = null) {
434
+ await this.ipc.call("onAgenticAgentResults", e, t, r);
343
435
  }
344
436
  async onAgenticStreamComplete(e = null) {
345
437
  await this.ipc.call("onAgenticStreamComplete", e);
346
438
  }
347
- async onAgenticIssueStatusChanged(e, t, n) {
348
- await this.ipc.call("onAgenticIssueStatusChanged", e, t, n);
439
+ async onAgenticIssueStatusChanged(e, t, r) {
440
+ await this.ipc.call("onAgenticIssueStatusChanged", e, t, r);
349
441
  }
350
442
  async onAgenticIssuesCleared(e = null) {
351
443
  await this.ipc.call("onAgenticIssuesCleared", e);
@@ -381,10 +473,10 @@ var q = class {
381
473
  destroy() {
382
474
  window.removeEventListener("message", this.handleMessage), this.ipc.destroy();
383
475
  }
384
- }, we = class {
476
+ }, ke = class {
385
477
  ipcAdapter;
386
- constructor(e, t, n) {
387
- this.ipcAdapter = new q(e, t, n);
478
+ constructor(e, t, r) {
479
+ this.ipcAdapter = new oe(e, t, r);
388
480
  }
389
481
  destroy() {
390
482
  this.ipcAdapter.destroy();
@@ -401,23 +493,23 @@ var q = class {
401
493
  async getSelectedContent(e) {
402
494
  return await this.ipcAdapter.getSelectedContent(e);
403
495
  }
404
- async replaceContent(e, t, n = null) {
405
- await this.ipcAdapter.replaceContent(e, t, n);
496
+ async replaceContent(e, t, r = null) {
497
+ await this.ipcAdapter.replaceContent(e, t, r);
406
498
  }
407
499
  async selectContent(e, t = null) {
408
500
  await this.ipcAdapter.selectContent(e, t);
409
501
  }
410
- async replaceMultipleContents(e) {
411
- await this.ipcAdapter.replaceMultipleContents(e);
502
+ async replaceMultipleContents(e, t) {
503
+ await this.ipcAdapter.replaceMultipleContents(e, t);
412
504
  }
413
- onAgenticAgentResults(e, t, n = null) {
414
- return this.ipcAdapter.onAgenticAgentResults(e, t, n);
505
+ onAgenticAgentResults(e, t, r = null) {
506
+ return this.ipcAdapter.onAgenticAgentResults(e, t, r);
415
507
  }
416
508
  onAgenticStreamComplete(e = null) {
417
509
  return this.ipcAdapter.onAgenticStreamComplete(e);
418
510
  }
419
- onAgenticIssueStatusChanged(e, t, n) {
420
- return this.ipcAdapter.onAgenticIssueStatusChanged(e, t, n);
511
+ onAgenticIssueStatusChanged(e, t, r) {
512
+ return this.ipcAdapter.onAgenticIssueStatusChanged(e, t, r);
421
513
  }
422
514
  onAgenticIssuesCleared(e = null) {
423
515
  return this.ipcAdapter.onAgenticIssuesCleared(e);
@@ -443,48 +535,48 @@ var q = class {
443
535
  getTargetOrigin() {
444
536
  return this.ipcAdapter.getTargetOrigin();
445
537
  }
446
- }, Z = class {
538
+ }, le = class {
447
539
  ipc;
448
540
  plugin;
449
541
  iframe;
450
542
  window;
451
543
  targetOrigin;
452
544
  latestSidebarBuildInfo = null;
453
- constructor(e, t, n, r, i = "*") {
454
- this.plugin = e, this.iframe = t, this.window = n ?? window, this.targetOrigin = i, this.ipc = new N((a) => {
545
+ constructor(e, t, r, n, i = "*") {
546
+ this.plugin = e, this.iframe = t, this.window = r ?? window, this.targetOrigin = i, this.ipc = new F((a) => {
455
547
  this.iframe.contentWindow?.postMessage(a, this.targetOrigin);
456
- }, r), this.window.addEventListener("message", this.handleMessage, !1), this.registerReceivers();
548
+ }, n), this.window.addEventListener("message", this.handleMessage, !1), this.registerReceivers();
457
549
  }
458
550
  handleMessage = (e) => {
459
- const t = this.window.location.origin, n = this.targetOrigin;
460
- e.origin !== t && (n !== "*" && e.origin !== n || e.data && typeof e.data == "object" && this.ipc.handleMessage(e.data));
551
+ const t = this.window.location.origin, r = this.targetOrigin;
552
+ e.origin !== t && (r !== "*" && e.origin !== r || e.data && typeof e.data == "object" && this.ipc.handleMessage(e.data));
461
553
  };
462
554
  registerReceivers() {
463
555
  if (this.ipc.receive("getInitConfig", async (e) => {
464
- const t = X(e);
556
+ const t = ae(e);
465
557
  return this.latestSidebarBuildInfo = t, {
466
558
  ...await this.plugin.getInitConfig(t ?? void 0),
467
- hostAdapterVersion: V
559
+ hostAdapterVersion: Y
468
560
  };
469
- }), this.ipc.receive("getContent", async () => await this.plugin.getContent()), this.ipc.receive("getSelectedContent", async () => await this.plugin.getSelectedContent()), this.ipc.receive("replaceContent", async (e, t, n) => {
470
- await this.plugin.replaceContent(e, t, typeof n == "string" ? n : null);
561
+ }), this.ipc.receive("getContent", async () => await this.plugin.getContent()), this.ipc.receive("getSelectedContent", async () => await this.plugin.getSelectedContent()), this.ipc.receive("replaceContent", async (e, t, r) => {
562
+ await this.plugin.replaceContent(e, t, typeof r == "string" ? r : null);
471
563
  }), this.ipc.receive("selectContent", async (e, t) => {
472
564
  await this.plugin.selectContent(e, typeof t == "string" ? t : null);
473
- }), this.ipc.receive("replaceMultipleContents", async (e) => {
474
- await this.plugin.replaceMultipleContents(e);
475
- }), this.ipc.receive("onAgenticAgentResults", async (e, t, n) => {
565
+ }), this.ipc.receiveWithProgress("replaceMultipleContents", async (e, t) => {
566
+ await this.plugin.replaceMultipleContents(t, { reportProgress: e });
567
+ }), this.ipc.receive("onAgenticAgentResults", async (e, t, r) => {
476
568
  if (!Array.isArray(t))
477
569
  return;
478
- const r = this.plugin.onAgenticAgentResults;
479
- r && await r(e, t, typeof n == "string" ? n : null);
570
+ const n = this.plugin.onAgenticAgentResults;
571
+ n && await n(e, t, typeof r == "string" ? r : null);
480
572
  }), this.ipc.receive("onAgenticStreamComplete", async (e) => {
481
573
  const t = this.plugin.onAgenticStreamComplete;
482
574
  t && await t(typeof e == "string" ? e : null);
483
- }), this.ipc.receive("onAgenticIssueStatusChanged", async (e, t, n) => {
484
- const r = this.plugin.onAgenticIssueStatusChanged;
485
- if (r && !(t !== "active" && t !== "resolved" && t !== "dismissed" || n !== "user" && n !== "host"))
575
+ }), this.ipc.receive("onAgenticIssueStatusChanged", async (e, t, r) => {
576
+ const n = this.plugin.onAgenticIssueStatusChanged;
577
+ if (n && !(t !== "active" && t !== "resolved" && t !== "dismissed" || r !== "user" && r !== "host"))
486
578
  try {
487
- await r(e, t, n);
579
+ await n(e, t, r);
488
580
  } catch {
489
581
  }
490
582
  }), this.ipc.receive("onAgenticIssuesCleared", async (e) => {
@@ -508,14 +600,14 @@ var q = class {
508
600
  }
509
601
  if (this.plugin.addComment) {
510
602
  const e = this.plugin.addComment;
511
- this.ipc.receive("addComment", async (t, n) => {
512
- await e(t, typeof n == "string" ? n : null);
603
+ this.ipc.receive("addComment", async (t, r) => {
604
+ await e(t, typeof r == "string" ? r : null);
513
605
  });
514
606
  }
515
607
  if (this.plugin.onIntegrationSettingsChange) {
516
608
  const e = this.plugin.onIntegrationSettingsChange;
517
- this.ipc.receive("onIntegrationSettingsChange", async (t, n) => {
518
- await e(t, n);
609
+ this.ipc.receive("onIntegrationSettingsChange", async (t, r) => {
610
+ await e(t, r);
519
611
  });
520
612
  }
521
613
  }
@@ -552,10 +644,10 @@ var q = class {
552
644
  destroy() {
553
645
  this.window.removeEventListener("message", this.handleMessage), this.ipc.destroy();
554
646
  }
555
- }, Q = class {
647
+ }, ce = class {
556
648
  ipcAdapter;
557
- constructor(e, t, n) {
558
- this.ipcAdapter = new Z(e, t, n?.win, n?.config, n?.targetOrigin);
649
+ constructor(e, t, r) {
650
+ this.ipcAdapter = new le(e, t, r?.win, r?.config, r?.targetOrigin);
559
651
  }
560
652
  destroy() {
561
653
  this.ipcAdapter.destroy();
@@ -590,7 +682,7 @@ var q = class {
590
682
  configure(e) {
591
683
  this.ipcAdapter.configure(e);
592
684
  }
593
- }, ee = `
685
+ }, de = `
594
686
  <div class="sidebar-load-overlay-card">
595
687
  <div class="sidebar-load-overlay-title">Sidebar failed to load</div>
596
688
  <div class="sidebar-load-overlay-description">Check your connection or try again.</div>
@@ -611,16 +703,16 @@ var q = class {
611
703
  <span>Retry</span>
612
704
  </button>
613
705
  </div>
614
- `, te = () => {
706
+ `, ge = () => {
615
707
  const e = document.createElement("div");
616
- e.className = "sidebar-load-overlay", e.style.display = "none", e.innerHTML = ee;
708
+ e.className = "sidebar-load-overlay", e.style.display = "none", e.innerHTML = de;
617
709
  const t = e.querySelector(".sidebar-load-overlay-button");
618
710
  if (!t) throw new Error("Missing retry button in load overlay template.");
619
711
  return {
620
712
  overlay: e,
621
713
  button: t
622
714
  };
623
- }, T = "markupai-sidebar-load-overlay-styles", ne = `
715
+ }, M = "markupai-sidebar-load-overlay-styles", pe = `
624
716
  :root {
625
717
  --background: #f5f5f4;
626
718
  --foreground: #333332;
@@ -712,110 +804,110 @@ var q = class {
712
804
  box-shadow: 0 0 0 2px
713
805
  color-mix(in srgb, var(--accent, #ef4640) 60%, transparent);
714
806
  }
715
- `, re = (e) => {
807
+ `, ue = (e) => {
716
808
  const t = e ?? document;
717
- if (t.getElementById(T)) return;
718
- const n = t.createElement("style");
719
- n.id = T, n.textContent = ne, t.head.appendChild(n);
720
- }, ie = 8e3, ae = 12e3, oe = (e, t, n = {}) => {
721
- re(e.ownerDocument);
722
- const { sidebarUrl: r, targetOrigin: i, timeoutMs: a = ie, retryIntervalMs: o = ae, messageListenWindow: s } = n, l = s ?? (typeof globalThis.window < "u" ? globalThis.window : globalThis), p = () => r ?? t.src, j = () => {
809
+ if (t.getElementById(M)) return;
810
+ const r = t.createElement("style");
811
+ r.id = M, r.textContent = pe, t.head.appendChild(r);
812
+ }, he = 8e3, fe = 12e3, me = (e, t, r = {}) => {
813
+ ue(e.ownerDocument);
814
+ const { sidebarUrl: n, targetOrigin: i, timeoutMs: a = he, retryIntervalMs: s = fe, messageListenWindow: o } = r, l = o ?? (typeof globalThis.window < "u" ? globalThis.window : globalThis), c = () => n ?? t.src, G = () => {
723
815
  if (i) return i;
724
816
  try {
725
- return new URL(p()).origin;
817
+ return new URL(c()).origin;
726
818
  } catch {
727
819
  return "*";
728
820
  }
729
- }, { overlay: y, button: A } = te();
821
+ }, { overlay: y, button: C } = ge();
730
822
  e.appendChild(y);
731
- let u = !1, h, d;
732
- const g = (c) => {
733
- y.style.display = c ? "flex" : "none";
823
+ let u = !1, h, g;
824
+ const p = (d) => {
825
+ y.style.display = d ? "flex" : "none";
734
826
  };
735
- g(!1);
827
+ p(!1);
736
828
  const f = () => {
737
829
  h && (globalThis.clearTimeout(h), h = void 0);
738
- }, C = () => {
830
+ }, b = () => {
739
831
  f(), h = globalThis.setTimeout(() => {
740
- u || g(!0);
832
+ u || p(!0);
741
833
  }, a);
742
- }, b = (c) => {
743
- const m = c?.preserveOverlay ?? !0;
744
- u = !1, m || g(!1), t.src = p(), C();
745
- }, F = () => {
746
- d || o <= 0 || (d = globalThis.setInterval(() => {
747
- u || b({ preserveOverlay: !0 });
748
- }, o));
749
- }, S = () => {
750
- d && (globalThis.clearInterval(d), d = void 0);
751
- }, w = (c) => {
752
- if (!t.contentWindow || c.source !== t.contentWindow) return;
753
- const m = j();
754
- m !== "*" && c.origin !== m || (u = !0, f(), S(), g(!1));
755
- }, P = () => {
756
- f(), g(!0);
834
+ }, S = (d) => {
835
+ const m = d?.preserveOverlay ?? !0;
836
+ u = !1, m || p(!1), t.src = c(), b();
837
+ }, J = () => {
838
+ g || s <= 0 || (g = globalThis.setInterval(() => {
839
+ u || S({ preserveOverlay: !0 });
840
+ }, s));
841
+ }, w = () => {
842
+ g && (globalThis.clearInterval(g), g = void 0);
843
+ }, P = (d) => {
844
+ if (!t.contentWindow || d.source !== t.contentWindow) return;
845
+ const m = G();
846
+ m !== "*" && d.origin !== m || (u = !0, f(), w(), p(!1));
757
847
  }, E = () => {
758
- b();
848
+ f(), p(!0);
849
+ }, R = () => {
850
+ S();
759
851
  };
760
- return A.addEventListener("click", E), t.addEventListener("error", P), l.addEventListener("message", w), C(), F(), () => {
761
- f(), S(), t.removeEventListener("error", P), l.removeEventListener("message", w), A.removeEventListener("click", E), y.remove();
852
+ return C.addEventListener("click", R), t.addEventListener("error", E), l.addEventListener("message", P), b(), J(), () => {
853
+ f(), w(), t.removeEventListener("error", E), l.removeEventListener("message", P), C.removeEventListener("click", R), y.remove();
762
854
  };
763
- }, se = "Markup AI Sidebar", le = "clipboard-read; clipboard-write", Pe = "markupai.sidebarNextGen.overrideUrl", Ee = "https://sidebar.markup.ai/";
764
- function Re(e) {
855
+ }, ye = "Markup AI Sidebar", Ie = "clipboard-read; clipboard-write", Ne = "markupai.sidebarNextGen.overrideUrl", Be = "https://sidebar.markup.ai/";
856
+ function Ue(e) {
765
857
  try {
766
858
  return "localStorage" in globalThis && globalThis.localStorage.getItem("markupai.sidebarNextGen.overrideUrl")?.trim() || e;
767
859
  } catch {
768
860
  return e;
769
861
  }
770
862
  }
771
- var ce = "markupai.sidebarNextGen.authOverride";
772
- function Oe(e, t) {
863
+ var ve = "markupai.sidebarNextGen.authOverride";
864
+ function He(e, t) {
773
865
  if (!t) return e;
774
866
  try {
775
867
  if (!("localStorage" in globalThis)) return e;
776
- const n = globalThis.localStorage.getItem(ce)?.trim();
777
- if (!n) return e;
778
- const r = JSON.parse(n);
779
- return r !== null && typeof r == "object" && "type" in r && (r.type === "mediation" || r.type === "popup") ? r : e;
868
+ const r = globalThis.localStorage.getItem(ve)?.trim();
869
+ if (!r) return e;
870
+ const n = JSON.parse(r);
871
+ return n !== null && typeof n == "object" && "type" in n && (n.type === "mediation" || n.type === "popup") ? n : e;
780
872
  } catch {
781
873
  return e;
782
874
  }
783
875
  }
784
- function Te(e, t) {
876
+ function $e(e, t) {
785
877
  try {
786
878
  return new URL(e).origin;
787
- } catch (n) {
788
- return t?.onInvalidUrl?.(e, n), "*";
879
+ } catch (r) {
880
+ return t?.onInvalidUrl?.(e, r), "*";
789
881
  }
790
882
  }
791
- function De(e, t = "Expected SidebarAdapter from createSidebarHost") {
883
+ function je(e, t = "Expected SidebarAdapter from createSidebarHost") {
792
884
  if (e.adapter === null) throw new Error(t);
793
885
  }
794
- function de(e) {
795
- const { iframe: t, iframeMount: n } = e;
796
- if (t !== void 0 && n !== void 0) throw new Error("createSidebarHost: pass only one of `iframe` or `iframeMount`");
886
+ function Ae(e) {
887
+ const { iframe: t, iframeMount: r } = e;
888
+ if (t !== void 0 && r !== void 0) throw new Error("createSidebarHost: pass only one of `iframe` or `iframeMount`");
797
889
  if (t !== void 0) return {
798
890
  iframe: t,
799
891
  removeMountedIframe: null
800
892
  };
801
- if (n === void 0) throw new Error("createSidebarHost: pass either `iframe` or `iframeMount`");
802
- const { container: r, src: i, allow: a = le } = n, o = document.createElement("iframe");
803
- return o.title = se, o.src = i, a && o.setAttribute("allow", a), r.appendChild(o), {
804
- iframe: o,
893
+ if (r === void 0) throw new Error("createSidebarHost: pass either `iframe` or `iframeMount`");
894
+ const { container: n, src: i, allow: a = Ie } = r, s = document.createElement("iframe");
895
+ return s.title = ye, s.src = i, a && s.setAttribute("allow", a), n.appendChild(s), {
896
+ iframe: s,
805
897
  removeMountedIframe: () => {
806
- o.remove();
898
+ s.remove();
807
899
  }
808
900
  };
809
901
  }
810
- function xe(e) {
811
- const { plugin: t, loadOverlayContainer: n, loadOverlayOptions: r, adapterOptions: i } = e, { iframe: a, removeMountedIframe: o } = de(e), s = n !== void 0 ? oe(n, a, r ?? {}) : null;
902
+ function Fe(e) {
903
+ const { plugin: t, loadOverlayContainer: r, loadOverlayOptions: n, adapterOptions: i } = e, { iframe: a, removeMountedIframe: s } = Ae(e), o = r !== void 0 ? me(r, a, n ?? {}) : null;
812
904
  if (t !== void 0) {
813
- const l = new Q(t, a, i);
905
+ const l = new ce(t, a, i);
814
906
  return {
815
907
  iframe: a,
816
908
  adapter: l,
817
909
  destroy: () => {
818
- s?.(), l.destroy(), o?.();
910
+ o?.(), l.destroy(), s?.();
819
911
  }
820
912
  };
821
913
  }
@@ -823,18 +915,18 @@ function xe(e) {
823
915
  iframe: a,
824
916
  adapter: null,
825
917
  destroy: () => {
826
- s?.(), o?.();
918
+ o?.(), s?.();
827
919
  }
828
920
  };
829
921
  }
830
- var H = "sidebarContainer", D = "markupai-sidebar-host-shell-styles";
831
- function U(e) {
922
+ var V = "sidebarContainer", x = "markupai-sidebar-host-shell-styles";
923
+ function W(e) {
832
924
  if (typeof CSS < "u" && typeof CSS.escape == "function") return CSS.escape(e);
833
925
  if (!/^[a-zA-Z_][\w-]*$/.test(e)) throw new Error(String.raw`sidebar host shell: containerId must match /^[a-zA-Z_][\w-]*$/ when CSS.escape is unavailable (got ${JSON.stringify(e)})`);
834
926
  return e;
835
927
  }
836
- function $(e = H) {
837
- const t = U(e);
928
+ function z(e = V) {
929
+ const t = W(e);
838
930
  return `
839
931
  html {
840
932
  height: 100%;
@@ -859,89 +951,93 @@ body {
859
951
  }
860
952
  `.trim();
861
953
  }
862
- var Me = $();
863
- function ge(e) {
954
+ var Ve = z();
955
+ function Ce(e) {
864
956
  return e instanceof Document ? e : e.ownerDocument;
865
957
  }
866
- function pe(e, t, n) {
867
- if (!t || e.getElementById(D)) return;
868
- const r = e.createElement("style");
869
- r.id = D, r.textContent = $(n), e.head.appendChild(r);
958
+ function be(e, t, r) {
959
+ if (!t || e.getElementById(x)) return;
960
+ const n = e.createElement("style");
961
+ n.id = x, n.textContent = z(r), e.head.appendChild(n);
870
962
  }
871
- function _e(e) {
872
- const { root: t = typeof document < "u" ? document : void 0, containerId: n = H, includeDefaultStyles: r = !0 } = e ?? {};
963
+ function We(e) {
964
+ const { root: t = typeof document < "u" ? document : void 0, containerId: r = V, includeDefaultStyles: n = !0 } = e ?? {};
873
965
  if (t === void 0) throw new Error("ensureSidebarHostShell: no document — pass `root` in non-browser environments");
874
- const i = ge(t);
875
- pe(i, r, n);
876
- const a = t instanceof Document ? i.getElementById(n) : t.querySelector(`#${U(n)}`);
966
+ const i = Ce(t);
967
+ be(i, n, r);
968
+ const a = t instanceof Document ? i.getElementById(r) : t.querySelector(`#${W(r)}`);
877
969
  if (a instanceof HTMLElement && (t instanceof Document || t.contains(a))) return a;
878
970
  if (!(t instanceof Document)) {
879
- const s = i.createElement("div");
880
- return s.id = n, t.appendChild(s), s;
971
+ const o = i.createElement("div");
972
+ return o.id = r, t.appendChild(o), o;
881
973
  }
882
- const o = i.createElement("div");
883
- return o.id = n, i.body.appendChild(o), o;
974
+ const s = i.createElement("div");
975
+ return s.id = r, i.body.appendChild(s), s;
884
976
  }
885
- function ue() {
977
+ function Se() {
886
978
  return ' <meta name="viewport" content="width=device-width, initial-scale=1.0" />';
887
979
  }
888
- function Le(e) {
889
- const { title: t = "Markup AI Sidebar", headInnerHtml: n = "", includePluginHostHead: r = !1, bodyScriptsHtml: i, htmlLang: a = "en", htmlAttrs: o = `lang="${a}" style="height:100%"`, bodyAttrs: s = 'style="height:100%;margin:0"' } = e, l = [r ? ue() : "", n].filter((p) => p.trim().length > 0).join(`
980
+ function ze(e) {
981
+ const { title: t = "Markup AI Sidebar", headInnerHtml: r = "", includePluginHostHead: n = !1, bodyScriptsHtml: i, htmlLang: a = "en", htmlAttrs: s = `lang="${a}" style="height:100%"`, bodyAttrs: o = 'style="height:100%;margin:0"' } = e, l = [n ? Se() : "", r].filter((c) => c.trim().length > 0).join(`
890
982
  `);
891
983
  return `<!DOCTYPE html>
892
- <html ${o}>
984
+ <html ${s}>
893
985
  <head>
894
986
  <base target="_top" />
895
987
  <meta charset="UTF-8" />
896
- <title>${he(t)}</title>${l ? `
988
+ <title>${we(t)}</title>${l ? `
897
989
  ${l}` : ""}
898
990
  </head>
899
- <body ${s}>
991
+ <body ${o}>
900
992
  ${i}
901
993
  </body>
902
994
  </html>
903
995
  `;
904
996
  }
905
- function he(e) {
997
+ function we(e) {
906
998
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
907
999
  }
908
1000
  export {
909
- V as ADAPTER_VERSION,
910
- ce as AUTH_CONFIG_OVERRIDE_STORAGE_KEY,
911
- G as DEFAULT_IPC_CONFIG,
912
- ye as DEFAULT_SIDEBAR_CONFIG,
913
- W as DeferredPromise,
914
- N as IPCCore,
915
- fe as MimeType,
916
- we as PluginAdapter,
917
- q as PluginIPCAdapter,
918
- M as ReplaceBatchError,
919
- Ee as SIDEBAR_DEFAULT_PRODUCTION_BASE_URL,
920
- H as SIDEBAR_HOST_CONTAINER_ID,
921
- Me as SIDEBAR_HOST_SHELL_CSS,
922
- le as SIDEBAR_IFRAME_DEFAULT_ALLOW,
923
- se as SIDEBAR_IFRAME_DEFAULT_TITLE,
924
- Pe as SIDEBAR_URL_OVERRIDE_STORAGE_KEY,
925
- Q as SidebarAdapter,
926
- Z as SidebarIPCAdapter,
927
- me as TEXT_MIME_TYPES,
928
- v as TextLookupError,
929
- De as assertSidebarHostAdapter,
930
- Se as buildDocumentReference,
931
- Le as buildSidebarHostHtmlDocument,
932
- $ as buildSidebarHostShellCss,
933
- ue as buildSidebarPluginHostHeadInnerHtml,
934
- xe as createSidebarHost,
935
- _e as ensureSidebarHostShell,
936
- Oe as getAuthConfigWithOverride,
937
- Re as getSidebarBaseUrlWithOverride,
938
- O as ipcErrorReconstructors,
939
- be as isDocumentReference,
940
- ve as isIntegrationSettingField,
941
- Ie as isIntegrationSettingsSchema,
942
- Ae as isReplaceBatchError,
943
- Ce as isTextLookupError,
944
- z as reconstructError,
945
- oe as setupSidebarLoadOverlay,
946
- Te as sidebarPostMessageTargetOrigin
1001
+ Y as ADAPTER_VERSION,
1002
+ ve as AUTH_CONFIG_OVERRIDE_STORAGE_KEY,
1003
+ j as DEFAULT_IPC_CONFIG,
1004
+ Re as DEFAULT_SIDEBAR_CONFIG,
1005
+ K as DeferredPromise,
1006
+ F as IPCCore,
1007
+ N as IpcTimeoutError,
1008
+ Q as LATE_RESULT_WINDOW_MS,
1009
+ ee as MAX_IPC_TIMEOUT_MS,
1010
+ Pe as MimeType,
1011
+ ke as PluginAdapter,
1012
+ oe as PluginIPCAdapter,
1013
+ L as ReplaceBatchError,
1014
+ Be as SIDEBAR_DEFAULT_PRODUCTION_BASE_URL,
1015
+ V as SIDEBAR_HOST_CONTAINER_ID,
1016
+ Ve as SIDEBAR_HOST_SHELL_CSS,
1017
+ Ie as SIDEBAR_IFRAME_DEFAULT_ALLOW,
1018
+ ye as SIDEBAR_IFRAME_DEFAULT_TITLE,
1019
+ Ne as SIDEBAR_URL_OVERRIDE_STORAGE_KEY,
1020
+ ce as SidebarAdapter,
1021
+ le as SidebarIPCAdapter,
1022
+ Ee as TEXT_MIME_TYPES,
1023
+ A as TextLookupError,
1024
+ je as assertSidebarHostAdapter,
1025
+ Le as buildDocumentReference,
1026
+ ze as buildSidebarHostHtmlDocument,
1027
+ z as buildSidebarHostShellCss,
1028
+ Se as buildSidebarPluginHostHeadInnerHtml,
1029
+ Fe as createSidebarHost,
1030
+ We as ensureSidebarHostShell,
1031
+ He as getAuthConfigWithOverride,
1032
+ Ue as getSidebarBaseUrlWithOverride,
1033
+ T as ipcErrorReconstructors,
1034
+ _e as isDocumentReference,
1035
+ Te as isIntegrationSettingField,
1036
+ Oe as isIntegrationSettingsSchema,
1037
+ De as isIpcTimeoutError,
1038
+ Me as isReplaceBatchError,
1039
+ xe as isTextLookupError,
1040
+ X as reconstructError,
1041
+ me as setupSidebarLoadOverlay,
1042
+ $e as sidebarPostMessageTargetOrigin
947
1043
  };