omnix-chat 2.5.9 → 3.0.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +1 -1
  3. package/dist/omnix-chat.es.js +775 -737
  4. package/dist/omnix-chat.es.js.map +1 -1
  5. package/dist/omnix-chat.umd.cjs +15 -15
  6. package/dist/omnix-chat.umd.js +15 -15
  7. package/dist/omnix-chat.umd.js.map +1 -1
  8. package/dist/react-types-4kCc9MAv.cjs.js.map +1 -1
  9. package/dist/react-types-D6g7_-_a.js.map +1 -1
  10. package/dist/react.cjs +173 -122
  11. package/dist/react.cjs.js +173 -122
  12. package/dist/react.cjs.js.map +1 -1
  13. package/dist/react.es.js +518 -441
  14. package/dist/react.es.js.map +1 -1
  15. package/dist/react.legacy-types-B3OBHme4.cjs.js.map +1 -1
  16. package/dist/react.legacy-types-C11EZiOU.js.map +1 -1
  17. package/dist/react.legacy.cjs +93 -39
  18. package/dist/react.legacy.cjs.js +93 -39
  19. package/dist/react.legacy.cjs.js.map +1 -1
  20. package/dist/react.legacy.es.js +142 -62
  21. package/dist/react.legacy.es.js.map +1 -1
  22. package/dist/src/core/client/instance.d.ts +8 -1
  23. package/dist/src/core/client/instance.d.ts.map +1 -1
  24. package/dist/src/core/lib/errors.d.ts +1 -1
  25. package/dist/src/core/lib/errors.d.ts.map +1 -1
  26. package/dist/src/core/page/page-action-feedback-wish-response.d.ts +3 -1
  27. package/dist/src/core/page/page-action-feedback-wish-response.d.ts.map +1 -1
  28. package/dist/src/core/services/page-action.service.d.ts +6 -1
  29. package/dist/src/core/services/page-action.service.d.ts.map +1 -1
  30. package/dist/src/index.d.ts +1 -1
  31. package/dist/src/index.d.ts.map +1 -1
  32. package/dist/src/react/usePageAction.d.ts +16 -2
  33. package/dist/src/react/usePageAction.d.ts.map +1 -1
  34. package/dist/src/react/usePageActions.d.ts +15 -1
  35. package/dist/src/react/usePageActions.d.ts.map +1 -1
  36. package/dist/src/types.d.ts +23 -0
  37. package/dist/src/types.d.ts.map +1 -1
  38. package/dist/src/utils/sdk-version.d.ts +1 -1
  39. package/package.json +1 -1
@@ -5005,10 +5005,30 @@ function cs(e) {
5005
5005
  description: e.description === null ? null : z(e.description) ?? null,
5006
5006
  pageScope: e.pageScope === null ? null : z(e.pageScope) ?? null,
5007
5007
  sortOrder: B(e.sortOrder) ?? 0,
5008
+ rolloutRestricted: e.rolloutRestricted === !0,
5008
5009
  myFeedback: ss(e.myFeedback)
5009
5010
  };
5010
5011
  }
5011
5012
  function ls(e) {
5013
+ if (!is(e)) return null;
5014
+ let t = z(e.actionKey);
5015
+ if (!t || typeof e.allowed != "boolean") return null;
5016
+ let n = z(e.reason) ?? (e.allowed ? "open" : "denied");
5017
+ return {
5018
+ actionKey: t,
5019
+ allowed: e.allowed,
5020
+ reason: n
5021
+ };
5022
+ }
5023
+ function us(e) {
5024
+ let t = L(e), n = Array.isArray(t) ? t : is(t) && Array.isArray(t.items) ? t.items : [], r = /* @__PURE__ */ new Set(), i = [];
5025
+ for (let e of n) {
5026
+ let t = ls(e);
5027
+ !t || r.has(t.actionKey) || (r.add(t.actionKey), i.push(t));
5028
+ }
5029
+ return i;
5030
+ }
5031
+ function ds(e) {
5012
5032
  if (!is(e)) return null;
5013
5033
  let t = B(e.id), n = B(e.pageActionId), r = z(e.actionKey), i = z(e.pageActionName), a = B(e.appClientId), o = B(e.userId), s = B(e.rating), c = z(e.createdAt), l = z(e.updatedAt);
5014
5034
  return t == null || n == null || !r || !i || a == null || o == null || s == null || !c || !l ? null : {
@@ -5024,7 +5044,7 @@ function ls(e) {
5024
5044
  updatedAt: l
5025
5045
  };
5026
5046
  }
5027
- function us() {
5047
+ function fs() {
5028
5048
  return {
5029
5049
  1: 0,
5030
5050
  2: 0,
@@ -5033,8 +5053,8 @@ function us() {
5033
5053
  5: 0
5034
5054
  };
5035
5055
  }
5036
- function ds(e) {
5037
- let t = us();
5056
+ function ps(e) {
5057
+ let t = fs();
5038
5058
  if (!is(e)) return t;
5039
5059
  for (let n of [
5040
5060
  "1",
@@ -5048,7 +5068,7 @@ function ds(e) {
5048
5068
  }
5049
5069
  return t;
5050
5070
  }
5051
- function fs(e) {
5071
+ function ms(e) {
5052
5072
  if (!is(e)) return null;
5053
5073
  let t = B(e.pageActionId), n = z(e.actionKey), r = z(e.pageActionName), i = B(e.count);
5054
5074
  return t == null || !n || !r || i == null ? null : {
@@ -5057,10 +5077,10 @@ function fs(e) {
5057
5077
  pageActionName: r,
5058
5078
  count: i,
5059
5079
  avgRating: e.avgRating === null || e.avgRating === void 0 ? null : B(e.avgRating) ?? null,
5060
- ratingDistribution: ds(e.ratingDistribution)
5080
+ ratingDistribution: ps(e.ratingDistribution)
5061
5081
  };
5062
5082
  }
5063
- function ps(e) {
5083
+ function hs(e) {
5064
5084
  if (!is(e)) return null;
5065
5085
  let t = B(e.id), n = B(e.appClientId), r = B(e.userId), i = z(e.title), a = z(e.description), o = os(e.status), s = z(e.createdAt), c = z(e.updatedAt);
5066
5086
  return t == null || n == null || r == null || !i || !a || !o || !s || !c ? null : {
@@ -5078,7 +5098,7 @@ function ps(e) {
5078
5098
  updatedAt: c
5079
5099
  };
5080
5100
  }
5081
- function ms(e) {
5101
+ function gs(e) {
5082
5102
  let t = L(e), n = Array.isArray(t) ? t : is(t) && Array.isArray(t.items) ? t.items : [], r = /* @__PURE__ */ new Set(), i = [];
5083
5103
  for (let e of n) {
5084
5104
  let t = cs(e);
@@ -5086,21 +5106,21 @@ function ms(e) {
5086
5106
  }
5087
5107
  return i;
5088
5108
  }
5089
- function hs(e) {
5109
+ function _s(e) {
5090
5110
  let t = L(e);
5091
- return t == null ? null : ls(t);
5111
+ return t == null ? null : ds(t);
5092
5112
  }
5093
- function gs(e) {
5094
- let t = fs(L(e));
5113
+ function vs(e) {
5114
+ let t = ms(L(e));
5095
5115
  if (!t) throw Error("Invalid page-action feedback summary");
5096
5116
  return t;
5097
5117
  }
5098
- function _s(e) {
5099
- let t = ps(L(e));
5118
+ function ys(e) {
5119
+ let t = hs(L(e));
5100
5120
  if (!t) throw Error("Invalid page-action wish");
5101
5121
  return t;
5102
5122
  }
5103
- function vs(e) {
5123
+ function bs(e) {
5104
5124
  let t = L(e);
5105
5125
  if (!is(t)) return {
5106
5126
  items: [],
@@ -5109,7 +5129,7 @@ function vs(e) {
5109
5129
  pageSize: 20,
5110
5130
  hasMore: !1
5111
5131
  };
5112
- let n = (Array.isArray(t.items) ? t.items : []).map((e) => ps(e)).filter((e) => e != null), r = B(t.total) ?? n.length, i = B(t.page) ?? 1, a = B(t.pageSize) ?? 20;
5132
+ let n = (Array.isArray(t.items) ? t.items : []).map((e) => hs(e)).filter((e) => e != null), r = B(t.total) ?? n.length, i = B(t.page) ?? 1, a = B(t.pageSize) ?? 20;
5113
5133
  return {
5114
5134
  items: n,
5115
5135
  total: r,
@@ -5120,29 +5140,29 @@ function vs(e) {
5120
5140
  }
5121
5141
  //#endregion
5122
5142
  //#region src/core/services/page-action.service.ts
5123
- function ys(e) {
5143
+ function xs(e) {
5124
5144
  return encodeURIComponent(e.trim());
5125
5145
  }
5126
- function bs(e) {
5146
+ function Ss(e) {
5127
5147
  return typeof e == "object" && !!e && !Array.isArray(e);
5128
5148
  }
5129
- function xs(e) {
5149
+ function Cs(e) {
5130
5150
  if (!(e instanceof p) || e.code !== "TRANSPORT_FAILED") return null;
5131
5151
  let t = e.details;
5132
- if (!bs(t) || t.status !== 409) return null;
5152
+ if (!Ss(t) || t.status !== 409) return null;
5133
5153
  let n = [];
5134
- t.data != null && n.push(t.data), bs(t.body) && (t.body.data != null && n.push(t.body.data), n.push(t.body));
5135
- for (let e of n) if (bs(e)) try {
5154
+ t.data != null && n.push(t.data), Ss(t.body) && (t.body.data != null && n.push(t.body.data), n.push(t.body));
5155
+ for (let e of n) if (Ss(e)) try {
5136
5156
  if (e.code === "PAGE_ACTION_ALREADY_ACTIVE") return {
5137
5157
  kind: "already_active",
5138
5158
  ...es(e)
5139
5159
  };
5140
- if (bs(e.data) && e.data.code === "PAGE_ACTION_ALREADY_ACTIVE") return {
5160
+ if (Ss(e.data) && e.data.code === "PAGE_ACTION_ALREADY_ACTIVE") return {
5141
5161
  kind: "already_active",
5142
5162
  ...es(e.data)
5143
5163
  };
5144
5164
  } catch {}
5145
- if (t.serverCode === "PAGE_ACTION_ALREADY_ACTIVE" && bs(t.data)) try {
5165
+ if (t.serverCode === "PAGE_ACTION_ALREADY_ACTIVE" && Ss(t.data)) try {
5146
5166
  return {
5147
5167
  kind: "already_active",
5148
5168
  ...es(t.data)
@@ -5152,7 +5172,7 @@ function xs(e) {
5152
5172
  }
5153
5173
  return null;
5154
5174
  }
5155
- var Ss = class {
5175
+ var ws = class {
5156
5176
  constructor(e) {
5157
5177
  f(this, "http", void 0), this.http = e;
5158
5178
  }
@@ -5164,7 +5184,7 @@ var Ss = class {
5164
5184
  body: e
5165
5185
  }));
5166
5186
  } catch (e) {
5167
- let t = xs(e);
5187
+ let t = Cs(e);
5168
5188
  if (t) return t;
5169
5189
  throw e;
5170
5190
  }
@@ -5184,14 +5204,22 @@ var Ss = class {
5184
5204
  }
5185
5205
  async listCatalog(e = {}, t) {
5186
5206
  let n = e.pageScope?.trim();
5187
- return ms(await this.http.request("/page-action/catalog", {
5207
+ return gs(await this.http.request("/page-action/catalog", {
5188
5208
  method: "GET",
5189
5209
  signal: t,
5190
5210
  searchParams: n ? { pageScope: n } : void 0
5191
5211
  }));
5192
5212
  }
5213
+ async checkRollout(e, t) {
5214
+ let n = Array.from(new Set(e.map((e) => e.trim()).filter((e) => e.length > 0)));
5215
+ return n.length === 0 ? [] : us(await this.http.request("/page-action/rollout-check", {
5216
+ method: "POST",
5217
+ signal: t,
5218
+ body: { actionKeys: n }
5219
+ }));
5220
+ }
5193
5221
  async upsertFeedback(e, t, n) {
5194
- let r = hs(await this.http.request(`/page-action/feedback/${ys(e)}`, {
5222
+ let r = _s(await this.http.request(`/page-action/feedback/${xs(e)}`, {
5195
5223
  method: "PUT",
5196
5224
  signal: n,
5197
5225
  body: t
@@ -5200,25 +5228,25 @@ var Ss = class {
5200
5228
  return r;
5201
5229
  }
5202
5230
  async getMyFeedback(e, t) {
5203
- return hs(await this.http.request(`/page-action/feedback/${ys(e)}`, {
5231
+ return _s(await this.http.request(`/page-action/feedback/${xs(e)}`, {
5204
5232
  method: "GET",
5205
5233
  signal: t
5206
5234
  }));
5207
5235
  }
5208
5236
  async removeMyFeedback(e, t) {
5209
- await this.http.request(`/page-action/feedback/${ys(e)}`, {
5237
+ await this.http.request(`/page-action/feedback/${xs(e)}`, {
5210
5238
  method: "DELETE",
5211
5239
  signal: t
5212
5240
  });
5213
5241
  }
5214
5242
  async getFeedbackSummary(e, t) {
5215
- return gs(await this.http.request(`/page-action/feedback/${ys(e)}/summary`, {
5243
+ return vs(await this.http.request(`/page-action/feedback/${xs(e)}/summary`, {
5216
5244
  method: "GET",
5217
5245
  signal: t
5218
5246
  }));
5219
5247
  }
5220
5248
  async createWish(e, t) {
5221
- return _s(await this.http.request("/page-action/wishes", {
5249
+ return ys(await this.http.request("/page-action/wishes", {
5222
5250
  method: "POST",
5223
5251
  signal: t,
5224
5252
  body: e
@@ -5226,25 +5254,25 @@ var Ss = class {
5226
5254
  }
5227
5255
  async listWishes(e = {}, t) {
5228
5256
  let n = {};
5229
- return e.page != null && (n.page = e.page), e.pageSize != null && (n.pageSize = e.pageSize), e.status && (n.status = e.status), e.keyword && (n.keyword = e.keyword), e.pageScope && (n.pageScope = e.pageScope), e.relatedActionKey && (n.relatedActionKey = e.relatedActionKey), vs(await this.http.request("/page-action/wishes", {
5257
+ return e.page != null && (n.page = e.page), e.pageSize != null && (n.pageSize = e.pageSize), e.status && (n.status = e.status), e.keyword && (n.keyword = e.keyword), e.pageScope && (n.pageScope = e.pageScope), e.relatedActionKey && (n.relatedActionKey = e.relatedActionKey), bs(await this.http.request("/page-action/wishes", {
5230
5258
  method: "GET",
5231
5259
  signal: t,
5232
5260
  searchParams: n
5233
5261
  }));
5234
5262
  }
5235
5263
  async getWish(e, t) {
5236
- return _s(await this.http.request(`/page-action/wishes/${e}`, {
5264
+ return ys(await this.http.request(`/page-action/wishes/${e}`, {
5237
5265
  method: "GET",
5238
5266
  signal: t
5239
5267
  }));
5240
5268
  }
5241
5269
  async cancelWish(e, t) {
5242
- return _s(await this.http.request(`/page-action/wishes/${e}/cancel`, {
5270
+ return ys(await this.http.request(`/page-action/wishes/${e}/cancel`, {
5243
5271
  method: "PATCH",
5244
5272
  signal: t
5245
5273
  }));
5246
5274
  }
5247
- }, Cs = class {
5275
+ }, Ts = class {
5248
5276
  constructor(e) {
5249
5277
  f(this, "http", void 0), this.http = e;
5250
5278
  }
@@ -5268,15 +5296,15 @@ var Ss = class {
5268
5296
  };
5269
5297
  //#endregion
5270
5298
  //#region src/core/approval/entity-reference.ts
5271
- function ws(e) {
5299
+ function Es(e) {
5272
5300
  return typeof e == "object" && !!e && !Array.isArray(e);
5273
5301
  }
5274
- function Ts(e) {
5302
+ function Ds(e) {
5275
5303
  if (typeof e != "string") return null;
5276
5304
  let t = e.trim();
5277
5305
  return t.length > 0 ? t : null;
5278
5306
  }
5279
- function Es(e) {
5307
+ function Os(e) {
5280
5308
  if (typeof e == "number" && Number.isFinite(e)) return e;
5281
5309
  if (typeof e == "string" && e.trim().length > 0) {
5282
5310
  let t = Number(e);
@@ -5284,39 +5312,39 @@ function Es(e) {
5284
5312
  }
5285
5313
  return null;
5286
5314
  }
5287
- function Ds(e) {
5315
+ function ks(e) {
5288
5316
  return e == null ? null : typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : null;
5289
5317
  }
5290
- function Os(e) {
5291
- if (!ws(e)) return null;
5292
- let t = Ts(e.key), n = Ts(e.label), r = Ds(e.value);
5318
+ function As(e) {
5319
+ if (!Es(e)) return null;
5320
+ let t = Ds(e.key), n = Ds(e.label), r = ks(e.value);
5293
5321
  return !t || !n || r == null ? null : {
5294
5322
  key: t,
5295
5323
  label: n,
5296
5324
  value: r
5297
5325
  };
5298
5326
  }
5299
- function ks(e) {
5300
- return Array.isArray(e) ? e.map((e) => Os(e)).filter((e) => e != null) : [];
5327
+ function js(e) {
5328
+ return Array.isArray(e) ? e.map((e) => As(e)).filter((e) => e != null) : [];
5301
5329
  }
5302
- function As(e) {
5330
+ function Ms(e) {
5303
5331
  if (!Array.isArray(e)) return [];
5304
5332
  let t = [];
5305
5333
  for (let n of e) {
5306
- let e = Ts(n);
5334
+ let e = Ds(n);
5307
5335
  e && t.push(e);
5308
5336
  }
5309
5337
  return t;
5310
5338
  }
5311
- function js(e, t, n) {
5312
- let r = Ts(e.toolName);
5339
+ function Ns(e, t, n) {
5340
+ let r = Ds(e.toolName);
5313
5341
  return n === "fetch_data" ? r ?? t : n === "load_page_context" ? "load_page_context" : n === "summarize_images" ? "summarize_images" : r ?? (n || t);
5314
5342
  }
5315
- function Ms(e) {
5316
- if (!ws(e)) return null;
5317
- let t = Ts(e.kind);
5343
+ function Ps(e) {
5344
+ if (!Es(e)) return null;
5345
+ let t = Ds(e.kind);
5318
5346
  if (!t) return null;
5319
- let n = Ts(e.title) ?? t, r = Array.isArray(e.fields), i = ws(e.record) ? e.record : null;
5347
+ let n = Ds(e.title) ?? t, r = Array.isArray(e.fields), i = Es(e.record) ? e.record : null;
5320
5348
  return !r && i ? {
5321
5349
  kind: t,
5322
5350
  title: n,
@@ -5326,35 +5354,35 @@ function Ms(e) {
5326
5354
  } : {
5327
5355
  kind: t,
5328
5356
  title: n,
5329
- fields: ks(e.fields),
5330
- imageUrls: As(e.imageUrls)
5357
+ fields: js(e.fields),
5358
+ imageUrls: Ms(e.imageUrls)
5331
5359
  };
5332
5360
  }
5333
- function Ns(e) {
5334
- if (!ws(e)) return null;
5335
- let t = Ts(e.ref), n = Ts(e.action);
5361
+ function Fs(e) {
5362
+ if (!Es(e)) return null;
5363
+ let t = Ds(e.ref), n = Ds(e.action);
5336
5364
  if (!t || !n) return null;
5337
- let r = ks(e.fields), i = As(e.imageUrls);
5365
+ let r = js(e.fields), i = Ms(e.imageUrls);
5338
5366
  return {
5339
5367
  ref: t,
5340
5368
  action: n,
5341
- title: Ts(e.title) ?? js(e, t, n),
5342
- toolName: Ts(e.toolName),
5343
- toolId: Es(e.toolId),
5369
+ title: Ds(e.title) ?? Ns(e, t, n),
5370
+ toolName: Ds(e.toolName),
5371
+ toolId: Os(e.toolId),
5344
5372
  data: e.data,
5345
5373
  fields: r,
5346
5374
  imageUrls: i.length > 0 ? i : void 0
5347
5375
  };
5348
5376
  }
5349
- function Ps(e) {
5350
- if (!ws(e)) return null;
5351
- let t = Array.isArray(e.inlineRecords) ? e.inlineRecords.map((e) => Ms(e)).filter((e) => e != null) : [], n = Array.isArray(e.sources) ? e.sources.map((e) => Ns(e)).filter((e) => e != null).sort((e, t) => e.ref.localeCompare(t.ref)) : [], r = t.some((e) => e.legacyRecord != null);
5377
+ function Is(e) {
5378
+ if (!Es(e)) return null;
5379
+ let t = Array.isArray(e.inlineRecords) ? e.inlineRecords.map((e) => Ps(e)).filter((e) => e != null) : [], n = Array.isArray(e.sources) ? e.sources.map((e) => Fs(e)).filter((e) => e != null).sort((e, t) => e.ref.localeCompare(t.ref)) : [], r = t.some((e) => e.legacyRecord != null);
5352
5380
  return {
5353
- page: Ts(e.page),
5354
- routePath: Ts(e.routePath),
5355
- entityType: Ts(e.entityType),
5356
- entityId: Ts(e.entityId),
5357
- anchorLabel: Ts(e.anchorLabel),
5381
+ page: Ds(e.page),
5382
+ routePath: Ds(e.routePath),
5383
+ entityType: Ds(e.entityType),
5384
+ entityId: Ds(e.entityId),
5385
+ anchorLabel: Ds(e.anchorLabel),
5358
5386
  inlineRecords: t,
5359
5387
  sources: n,
5360
5388
  legacy: r || void 0
@@ -5362,56 +5390,56 @@ function Ps(e) {
5362
5390
  }
5363
5391
  //#endregion
5364
5392
  //#region src/core/approval/approval-response.ts
5365
- function Fs(e) {
5393
+ function Ls(e) {
5366
5394
  return typeof e == "object" && !!e && !Array.isArray(e);
5367
5395
  }
5368
- function Is(e) {
5396
+ function Rs(e) {
5369
5397
  return typeof e == "string" && e.trim().length > 0 ? e.trim() : void 0;
5370
5398
  }
5371
- function Ls(e) {
5399
+ function zs(e) {
5372
5400
  if (typeof e == "number" && Number.isFinite(e)) return e;
5373
5401
  if (typeof e == "string" && e.trim().length > 0) {
5374
5402
  let t = Number(e);
5375
5403
  return Number.isFinite(t) ? t : void 0;
5376
5404
  }
5377
5405
  }
5378
- function Rs(e) {
5379
- let t = Is(e);
5406
+ function Bs(e) {
5407
+ let t = Rs(e);
5380
5408
  if (t === "chat" || t === "page_action" || t === "webhook") return t;
5381
5409
  }
5382
- function zs(e) {
5383
- let t = Is(e);
5410
+ function Vs(e) {
5411
+ let t = Rs(e);
5384
5412
  if (t === "pending" || t === "approved" || t === "rejected" || t === "cancelled" || t === "expired") return t;
5385
5413
  }
5386
- function Bs(e) {
5387
- if (!Fs(e)) return null;
5388
- let t = Ls(e.id);
5414
+ function Hs(e) {
5415
+ if (!Ls(e)) return null;
5416
+ let t = zs(e.id);
5389
5417
  return t == null ? null : {
5390
5418
  id: t,
5391
- username: Is(e.username) ?? null,
5392
- employeeId: Is(e.employeeId) ?? null
5419
+ username: Rs(e.username) ?? null,
5420
+ employeeId: Rs(e.employeeId) ?? null
5393
5421
  };
5394
5422
  }
5395
- function Vs(e) {
5396
- if (!Fs(e)) return null;
5397
- let t = Ls(e.retryCount) ?? 0, n = e.retryMax === null ? null : Ls(e.retryMax) ?? null;
5423
+ function Us(e) {
5424
+ if (!Ls(e)) return null;
5425
+ let t = zs(e.retryCount) ?? 0, n = e.retryMax === null ? null : zs(e.retryMax) ?? null;
5398
5426
  return {
5399
5427
  retryCount: t,
5400
5428
  retryMax: n,
5401
5429
  canRetry: e.canRetry === !1 ? !1 : e.canRetry === !0 || n == null || t < n
5402
5430
  };
5403
5431
  }
5404
- function Hs(e) {
5405
- if (!Fs(e)) return null;
5406
- let t = Is(e.tool);
5432
+ function Ws(e) {
5433
+ if (!Ls(e)) return null;
5434
+ let t = Rs(e.tool);
5407
5435
  return t ? {
5408
5436
  tool: t,
5409
- riskLevel: Is(e.riskLevel) ?? "L2"
5437
+ riskLevel: Rs(e.riskLevel) ?? "L2"
5410
5438
  } : null;
5411
5439
  }
5412
- function Us(e) {
5413
- if (!Fs(e)) return null;
5414
- let t = Ls(e.id), n = Rs(e.source), r = zs(e.status), i = Is(e.title), a = Is(e.createdAt);
5440
+ function Gs(e) {
5441
+ if (!Ls(e)) return null;
5442
+ let t = zs(e.id), n = Bs(e.source), r = Vs(e.status), i = Rs(e.title), a = Rs(e.createdAt);
5415
5443
  if (t == null || !n || !r || !i || !a) return null;
5416
5444
  let o = ut({
5417
5445
  writeDraft: Oe(e.writeDraft),
@@ -5424,57 +5452,57 @@ function Us(e) {
5424
5452
  source: n,
5425
5453
  status: r,
5426
5454
  title: i,
5427
- summary: Is(e.summary) ?? null,
5428
- workflowId: Ls(e.workflowId) ?? 0,
5429
- workflowVersion: Ls(e.workflowVersion) ?? 0,
5430
- workflowKey: Is(e.workflowKey) ?? null,
5431
- workflowName: Is(e.workflowName) ?? null,
5432
- nodeId: Is(e.nodeId) ?? "",
5433
- sessionId: Is(e.sessionId) ?? null,
5434
- pageActionRunId: Ls(e.pageActionRunId) ?? null,
5435
- initiator: Bs(e.initiator),
5455
+ summary: Rs(e.summary) ?? null,
5456
+ workflowId: zs(e.workflowId) ?? 0,
5457
+ workflowVersion: zs(e.workflowVersion) ?? 0,
5458
+ workflowKey: Rs(e.workflowKey) ?? null,
5459
+ workflowName: Rs(e.workflowName) ?? null,
5460
+ nodeId: Rs(e.nodeId) ?? "",
5461
+ sessionId: Rs(e.sessionId) ?? null,
5462
+ pageActionRunId: zs(e.pageActionRunId) ?? null,
5463
+ initiator: Hs(e.initiator),
5436
5464
  createdAt: a,
5437
- decidedAt: Is(e.decidedAt) ?? null,
5465
+ decidedAt: Rs(e.decidedAt) ?? null,
5438
5466
  previewBlocks: e.previewBlocks ?? null,
5439
- pendingWrite: Hs(e.pendingWrite),
5467
+ pendingWrite: Ws(e.pendingWrite),
5440
5468
  writeDraft: s?.writeDraft ?? null,
5441
5469
  editPolicy: s?.editPolicy ?? null,
5442
5470
  writeDrafts: o.length > 1 ? o.map((e) => e.writeDraft) : null,
5443
5471
  editPolicies: o.length > 1 ? o.map((e) => e.editPolicy) : null,
5444
- draftReview: Vs(e.draftReview),
5445
- entityReference: Ps(e.entityReference)
5472
+ draftReview: Us(e.draftReview),
5473
+ entityReference: Is(e.entityReference)
5446
5474
  };
5447
5475
  }
5448
- function Ws(e, t = 50) {
5449
- let n = Fs(e) ? e : null, r = (Array.isArray(n?.items) ? n.items : []).map((e) => Us(e)).filter((e) => e != null).filter((e) => e.source !== "chat");
5476
+ function Ks(e, t = 50) {
5477
+ let n = Ls(e) ? e : null, r = (Array.isArray(n?.items) ? n.items : []).map((e) => Gs(e)).filter((e) => e != null).filter((e) => e.source !== "chat");
5450
5478
  return {
5451
5479
  items: r,
5452
5480
  hasMore: r.length >= t
5453
5481
  };
5454
5482
  }
5455
- function Gs(e) {
5456
- let t = Us(e);
5483
+ function qs(e) {
5484
+ let t = Gs(e);
5457
5485
  return t ? {
5458
5486
  ...t,
5459
5487
  decidedAt: t.decidedAt ?? null
5460
5488
  } : null;
5461
5489
  }
5462
- function Ks(e) {
5463
- let t = Fs(e) ? e : null;
5490
+ function Js(e) {
5491
+ let t = Ls(e) ? e : null;
5464
5492
  return {
5465
5493
  resumed: t?.resumed === !0,
5466
5494
  suspended: t?.suspended === !0 || void 0
5467
5495
  };
5468
5496
  }
5469
- function qs(e) {
5470
- return Ks(e);
5497
+ function Ys(e) {
5498
+ return Js(e);
5471
5499
  }
5472
- function Js(e) {
5473
- return { ok: (Fs(e) ? e : null)?.ok === !0 };
5500
+ function Xs(e) {
5501
+ return { ok: (Ls(e) ? e : null)?.ok === !0 };
5474
5502
  }
5475
5503
  //#endregion
5476
5504
  //#region src/core/services/approval.service.ts
5477
- var Ys = class {
5505
+ var Zs = class {
5478
5506
  constructor(e) {
5479
5507
  f(this, "http", void 0), this.http = e;
5480
5508
  }
@@ -5483,34 +5511,34 @@ var Ys = class {
5483
5511
  limit: String(t),
5484
5512
  offset: String(e.offset ?? 0)
5485
5513
  };
5486
- return e.status && (n.status = e.status), Ws(L(await this.http.request("/approval/inbox", {
5514
+ return e.status && (n.status = e.status), Ks(L(await this.http.request("/approval/inbox", {
5487
5515
  method: "GET",
5488
5516
  signal: e.signal,
5489
5517
  searchParams: n
5490
5518
  })), t);
5491
5519
  }
5492
5520
  async getById(e, t) {
5493
- return Gs(L(await this.http.request(`/approval/${e}`, {
5521
+ return qs(L(await this.http.request(`/approval/${e}`, {
5494
5522
  method: "GET",
5495
5523
  signal: t
5496
5524
  })));
5497
5525
  }
5498
5526
  async decide(e, t, n, r) {
5499
5527
  let i = { decision: t };
5500
- return n?.trim() && (i.reason = n.trim()), qs(L(await this.http.request(`/approval/${e}/decide`, {
5528
+ return n?.trim() && (i.reason = n.trim()), Ys(L(await this.http.request(`/approval/${e}/decide`, {
5501
5529
  method: "POST",
5502
5530
  signal: r,
5503
5531
  body: i
5504
5532
  })));
5505
5533
  }
5506
5534
  async confirm(e, t) {
5507
- return Ks(L(await this.http.request(`/approval/${e}/confirm`, {
5535
+ return Js(L(await this.http.request(`/approval/${e}/confirm`, {
5508
5536
  method: "POST",
5509
5537
  signal: t
5510
5538
  })));
5511
5539
  }
5512
5540
  async reject(e, t, n) {
5513
- return Js(L(await this.http.request(`/approval/${e}/reject`, {
5541
+ return Xs(L(await this.http.request(`/approval/${e}/reject`, {
5514
5542
  method: "POST",
5515
5543
  signal: n,
5516
5544
  body: t?.trim() ? { reason: t.trim() } : {}
@@ -5519,32 +5547,32 @@ var Ys = class {
5519
5547
  };
5520
5548
  //#endregion
5521
5549
  //#region src/core/services/app-tool.service.ts
5522
- function Xs(e) {
5550
+ function Qs(e) {
5523
5551
  return typeof e == "object" && !!e && !Array.isArray(e);
5524
5552
  }
5525
- function Zs(e) {
5553
+ function $s(e) {
5526
5554
  return typeof e == "string" && e.trim() ? e.trim() : void 0;
5527
5555
  }
5528
- function Qs(e) {
5556
+ function ec(e) {
5529
5557
  if (typeof e == "number" && Number.isFinite(e)) return e;
5530
5558
  }
5531
- function $s(e) {
5532
- if (!Xs(e)) return null;
5533
- let t = Zs(e.definitionKey), n = Zs(e.name), r = Qs(e.toolId);
5559
+ function tc(e) {
5560
+ if (!Qs(e)) return null;
5561
+ let t = $s(e.definitionKey), n = $s(e.name), r = ec(e.toolId);
5534
5562
  return !t || !n || r === void 0 ? null : {
5535
5563
  definitionKey: t,
5536
5564
  name: n,
5537
- description: Zs(e.description) ?? "",
5538
- riskLevel: Zs(e.riskLevel) ?? "L1",
5539
- method: Zs(e.method) ?? "",
5540
- path: Zs(e.path) ?? "",
5565
+ description: $s(e.description) ?? "",
5566
+ riskLevel: $s(e.riskLevel) ?? "L1",
5567
+ method: $s(e.method) ?? "",
5568
+ path: $s(e.path) ?? "",
5541
5569
  inputSchema: e.inputSchema ?? null,
5542
5570
  toolId: r
5543
5571
  };
5544
5572
  }
5545
- function ec(e) {
5546
- if (!Xs(e)) throw new p("TRANSPORT_FAILED", "Invalid app tool invoke response");
5547
- let t = Zs(e.definitionKey), n = Zs(e.name), r = Qs(e.toolId), i = Qs(e.latencyMs) ?? 0;
5573
+ function nc(e) {
5574
+ if (!Qs(e)) throw new p("TRANSPORT_FAILED", "Invalid app tool invoke response");
5575
+ let t = $s(e.definitionKey), n = $s(e.name), r = ec(e.toolId), i = ec(e.latencyMs) ?? 0;
5548
5576
  if (!t || !n || r === void 0) throw new p("TRANSPORT_FAILED", "Invalid app tool invoke response shape");
5549
5577
  return {
5550
5578
  ok: e.ok === !0,
@@ -5553,16 +5581,16 @@ function ec(e) {
5553
5581
  name: n,
5554
5582
  latencyMs: i,
5555
5583
  output: e.output,
5556
- httpStatus: Qs(e.httpStatus),
5557
- error: Zs(e.error)
5584
+ httpStatus: ec(e.httpStatus),
5585
+ error: $s(e.error)
5558
5586
  };
5559
5587
  }
5560
- function tc(e) {
5588
+ function rc(e) {
5561
5589
  if (!(e instanceof p)) return null;
5562
5590
  let t = e.details?.serverCode;
5563
5591
  return typeof t == "string" && t.trim() ? t.trim() : null;
5564
5592
  }
5565
- var nc = class {
5593
+ var ic = class {
5566
5594
  constructor(e) {
5567
5595
  f(this, "http", void 0), this.http = e;
5568
5596
  }
@@ -5571,12 +5599,12 @@ var nc = class {
5571
5599
  method: "GET",
5572
5600
  signal: e
5573
5601
  }));
5574
- return { items: Array.isArray(t?.items) ? t.items.map($s).filter((e) => e != null) : [] };
5602
+ return { items: Array.isArray(t?.items) ? t.items.map(tc).filter((e) => e != null) : [] };
5575
5603
  }
5576
5604
  async invoke(e) {
5577
5605
  let t = e.definitionKey.trim();
5578
5606
  if (!t) throw new p("INVALID_OPTIONS", "definitionKey is required");
5579
- return ec(L(await this.http.request("/app/tools/invoke", {
5607
+ return nc(L(await this.http.request("/app/tools/invoke", {
5580
5608
  method: "POST",
5581
5609
  signal: e.signal,
5582
5610
  body: {
@@ -5585,7 +5613,7 @@ var nc = class {
5585
5613
  }
5586
5614
  })));
5587
5615
  }
5588
- }, rc = class {
5616
+ }, ac = class {
5589
5617
  constructor(e) {
5590
5618
  f(this, "context", void 0), f(this, "sessionId", null), f(this, "initialMessages", []), this.context = e.context;
5591
5619
  }
@@ -5613,39 +5641,39 @@ var nc = class {
5613
5641
  };
5614
5642
  //#endregion
5615
5643
  //#region src/core/feedback/feedback-utils.ts
5616
- function ic(e) {
5644
+ function oc(e) {
5617
5645
  return /^\d+$/.test(e);
5618
5646
  }
5619
- function ac(e) {
5620
- if (!ic(e)) return null;
5647
+ function sc(e) {
5648
+ if (!oc(e)) return null;
5621
5649
  let t = Number(e);
5622
5650
  return Number.isFinite(t) ? t : null;
5623
5651
  }
5624
5652
  //#endregion
5625
5653
  //#region src/core/chat/skill-intent-alignment.ts
5626
- function oc(e) {
5654
+ function cc(e) {
5627
5655
  return typeof e == "object" && !!e && !Array.isArray(e);
5628
5656
  }
5629
- function sc(e) {
5657
+ function lc(e) {
5630
5658
  if (typeof e == "string") try {
5631
- return sc(JSON.parse(e));
5659
+ return lc(JSON.parse(e));
5632
5660
  } catch {
5633
5661
  return [];
5634
5662
  }
5635
- return Array.isArray(e) ? e.filter((e) => oc(e) && typeof e.type == "string") : [];
5663
+ return Array.isArray(e) ? e.filter((e) => cc(e) && typeof e.type == "string") : [];
5636
5664
  }
5637
- function cc(e) {
5638
- let t = ce(e) ?? (oc(e) ? e : null);
5665
+ function uc(e) {
5666
+ let t = ce(e) ?? (cc(e) ? e : null);
5639
5667
  return t ? {
5640
- steps: sc(t.steps),
5641
- turnExecutionTimeline: sc(t.turnExecutionTimeline)
5668
+ steps: lc(t.steps),
5669
+ turnExecutionTimeline: lc(t.turnExecutionTimeline)
5642
5670
  } : null;
5643
5671
  }
5644
- function lc(e) {
5672
+ function dc(e) {
5645
5673
  return e.turnExecutionTimeline.length > 0 ? e.turnExecutionTimeline : e.steps;
5646
5674
  }
5647
- function uc(e) {
5648
- if (!oc(e)) return null;
5675
+ function fc(e) {
5676
+ if (!cc(e)) return null;
5649
5677
  let t = e.status;
5650
5678
  if (t !== "none" && t !== "aligned" && t !== "intent_first" && t !== "clarified") return null;
5651
5679
  let n = { status: t };
@@ -5653,68 +5681,68 @@ function uc(e) {
5653
5681
  let r = e.requestedSkillId;
5654
5682
  return typeof r == "number" && Number.isFinite(r) && (n.requestedSkillId = r), e.droppedExplicitSkill === !0 && (n.droppedExplicitSkill = !0), n;
5655
5683
  }
5656
- function dc(e) {
5684
+ function pc(e) {
5657
5685
  return e === "explicit" || e === "page_host" || e === "llm" ? e : "llm";
5658
5686
  }
5659
- function fc(e) {
5687
+ function mc(e) {
5660
5688
  return e === "explicit_skill" || e === "intent" ? e : "intent";
5661
5689
  }
5662
- function pc(e) {
5690
+ function hc(e) {
5663
5691
  return e === "inline_answer" || e === "entity_read_detail" || e === "none" ? e : "none";
5664
5692
  }
5665
- function mc(e) {
5693
+ function gc(e) {
5666
5694
  if (!e?.length) return null;
5667
5695
  let t = e.find((e) => e.type === "route_plan");
5668
- return !t?.output || !oc(t.output) ? null : t.output;
5696
+ return !t?.output || !cc(t.output) ? null : t.output;
5669
5697
  }
5670
- function hc(e) {
5671
- let t = mc(e);
5698
+ function _c(e) {
5699
+ let t = gc(e);
5672
5700
  if (!t) return null;
5673
- let n = uc(t.skillAlignment);
5701
+ let n = fc(t.skillAlignment);
5674
5702
  if (!n) return null;
5675
5703
  let r = typeof t.requestedSkillId == "number" && Number.isFinite(t.requestedSkillId) ? t.requestedSkillId : null;
5676
5704
  return {
5677
5705
  skillAlignment: n,
5678
- skillSelect: dc(t.skillSelect),
5679
- scopedToolsSource: fc(t.scopedToolsSource),
5680
- pageContextPlan: pc(t.pageContextPlan),
5706
+ skillSelect: pc(t.skillSelect),
5707
+ scopedToolsSource: mc(t.scopedToolsSource),
5708
+ pageContextPlan: hc(t.pageContextPlan),
5681
5709
  hostMutationIntent: !!t.hostMutationIntent,
5682
5710
  requestedSkillId: r
5683
5711
  };
5684
5712
  }
5685
- function gc(e) {
5686
- return hc(e)?.skillAlignment ?? null;
5713
+ function vc(e) {
5714
+ return _c(e)?.skillAlignment ?? null;
5687
5715
  }
5688
- function _c(e) {
5716
+ function yc(e) {
5689
5717
  return e ? e.scopedToolsSource === "explicit_skill" && e.skillAlignment.status === "aligned" && e.skillSelect === "explicit" : !1;
5690
5718
  }
5691
- function vc(e) {
5719
+ function bc(e) {
5692
5720
  return e?.skillAlignment.status === "intent_first";
5693
5721
  }
5694
- function yc(e) {
5722
+ function xc(e) {
5695
5723
  return e?.status === "intent_first";
5696
5724
  }
5697
- function bc(e) {
5725
+ function Sc(e) {
5698
5726
  return e?.skillAlignment.status === "clarified";
5699
5727
  }
5700
- function xc(e) {
5728
+ function Cc(e) {
5701
5729
  return e?.status === "clarified";
5702
5730
  }
5703
- function Sc(e) {
5731
+ function wc(e) {
5704
5732
  return `skill_intent_mismatch.${e}`;
5705
5733
  }
5706
- function Cc(e) {
5734
+ function Tc(e) {
5707
5735
  if (!e?.length) return null;
5708
5736
  for (let t = e.length - 1; t >= 0; --t) {
5709
5737
  let n = e[t];
5710
5738
  if (n.type !== "summarize") continue;
5711
5739
  let r = n.output;
5712
- if (!oc(r)) continue;
5740
+ if (!cc(r)) continue;
5713
5741
  let i = r.observations;
5714
5742
  if (Array.isArray(i)) for (let e of i) {
5715
- if (!oc(e) || e.name !== "skill_intent_mismatch") continue;
5743
+ if (!cc(e) || e.name !== "skill_intent_mismatch") continue;
5716
5744
  let t = e.output;
5717
- if (oc(t)) return {
5745
+ if (cc(t)) return {
5718
5746
  userMessage: typeof t.userMessage == "string" ? t.userMessage : void 0,
5719
5747
  mismatchCode: typeof t.mismatchCode == "string" ? t.mismatchCode : void 0,
5720
5748
  requestedSkillId: typeof t.requestedSkillId == "number" ? t.requestedSkillId : void 0,
@@ -5727,13 +5755,13 @@ function Cc(e) {
5727
5755
  }
5728
5756
  //#endregion
5729
5757
  //#region src/core/page/page-action-workflow-progress.ts
5730
- var wc = /* @__PURE__ */ new Set([
5758
+ var Ec = /* @__PURE__ */ new Set([
5731
5759
  "stage",
5732
5760
  "thought",
5733
5761
  "evidence",
5734
5762
  "ask",
5735
5763
  "outcome"
5736
- ]), Tc = 80, Ec = {
5764
+ ]), Dc = 80, Oc = {
5737
5765
  fetch_data: "gather",
5738
5766
  detect_clues: "gather",
5739
5767
  summarize_images: "gather",
@@ -5744,29 +5772,29 @@ var wc = /* @__PURE__ */ new Set([
5744
5772
  write_data: "produce",
5745
5773
  await_user_confirm: "other"
5746
5774
  };
5747
- function Dc(e) {
5775
+ function kc(e) {
5748
5776
  return typeof e == "object" && !!e && !Array.isArray(e);
5749
5777
  }
5750
5778
  function V(e) {
5751
5779
  return typeof e == "string" && e.trim().length > 0 ? e.trim() : void 0;
5752
5780
  }
5753
- function Oc(e) {
5781
+ function Ac(e) {
5754
5782
  return typeof e == "number" && Number.isFinite(e) ? e : null;
5755
5783
  }
5756
- function kc(e) {
5784
+ function jc(e) {
5757
5785
  let t = V(e);
5758
5786
  return t === "planning" || t === "gather" || t === "produce" || t === "other" ? t : null;
5759
5787
  }
5760
- function Ac(e) {
5788
+ function Mc(e) {
5761
5789
  let t = String(e ?? "").trim();
5762
- return t ? Ec[t] ?? null : null;
5790
+ return t ? Oc[t] ?? null : null;
5763
5791
  }
5764
- function jc(e) {
5792
+ function Nc(e) {
5765
5793
  let t = V(e);
5766
- return t && wc.has(t) ? t : null;
5794
+ return t && Ec.has(t) ? t : null;
5767
5795
  }
5768
- function Mc(e) {
5769
- if (!Dc(e)) return null;
5796
+ function Pc(e) {
5797
+ if (!kc(e)) return null;
5770
5798
  let t = V(e.key), n = V(e.label), r = V(e.value);
5771
5799
  return !t || !n || r == null ? null : {
5772
5800
  key: t,
@@ -5774,11 +5802,11 @@ function Mc(e) {
5774
5802
  value: r ?? ""
5775
5803
  };
5776
5804
  }
5777
- function Nc(e) {
5778
- if (!Dc(e)) return null;
5779
- let t = jc(e.kind);
5805
+ function Fc(e) {
5806
+ if (!kc(e)) return null;
5807
+ let t = Nc(e.kind);
5780
5808
  if (!t) return null;
5781
- let n = (Array.isArray(e.fields) ? e.fields : null)?.map(Mc).filter((e) => e != null).slice(0, 12), r = (Array.isArray(e.missing) ? e.missing : null)?.map((e) => V(e)).filter((e) => !!e).slice(0, 12), i = Oc(e.turn);
5809
+ let n = (Array.isArray(e.fields) ? e.fields : null)?.map(Pc).filter((e) => e != null).slice(0, 12), r = (Array.isArray(e.missing) ? e.missing : null)?.map((e) => V(e)).filter((e) => !!e).slice(0, 12), i = Ac(e.turn);
5782
5810
  return {
5783
5811
  kind: t,
5784
5812
  code: V(e.code),
@@ -5791,10 +5819,10 @@ function Nc(e) {
5791
5819
  missing: r && r.length > 0 ? r : void 0
5792
5820
  };
5793
5821
  }
5794
- function Pc(e) {
5795
- return Array.isArray(e) ? e.map(Nc).filter((e) => e != null).slice(0, 8) : [];
5822
+ function Ic(e) {
5823
+ return Array.isArray(e) ? e.map(Fc).filter((e) => e != null).slice(0, 8) : [];
5796
5824
  }
5797
- function Fc(e) {
5825
+ function Lc(e) {
5798
5826
  return [
5799
5827
  e.kind,
5800
5828
  e.code ?? "",
@@ -5804,23 +5832,23 @@ function Fc(e) {
5804
5832
  e.title ?? ""
5805
5833
  ].join("");
5806
5834
  }
5807
- function Ic(e, t) {
5835
+ function Rc(e, t) {
5808
5836
  let n = e ?? [], r = t ?? [];
5809
5837
  if (r.length === 0) return n;
5810
- let i = new Set(n.map(Fc)), a = [...n];
5838
+ let i = new Set(n.map(Lc)), a = [...n];
5811
5839
  for (let e of r) {
5812
- let t = Fc(e);
5840
+ let t = Lc(e);
5813
5841
  i.has(t) || (i.add(t), a.push(e));
5814
5842
  }
5815
- return a.length === n.length ? n : a.length > Tc ? a.slice(-80) : a;
5843
+ return a.length === n.length ? n : a.length > Dc ? a.slice(-80) : a;
5816
5844
  }
5817
- function Lc(e) {
5845
+ function zc(e) {
5818
5846
  return (e ?? []).some((e) => e.kind !== "stage");
5819
5847
  }
5820
- function Rc(e) {
5848
+ function Bc(e) {
5821
5849
  return (e ?? []).filter((e) => e.kind !== "stage").length;
5822
5850
  }
5823
- var zc = {
5851
+ var Vc = {
5824
5852
  itemCount: "相关条数",
5825
5853
  observationCount: "观测数",
5826
5854
  identity: "标识",
@@ -5828,7 +5856,7 @@ var zc = {
5828
5856
  rowCount: "行数",
5829
5857
  fetchedCount: "已获取",
5830
5858
  achieved: "已达成"
5831
- }, Bc = {
5859
+ }, Hc = {
5832
5860
  itemCount: "Items",
5833
5861
  observationCount: "Observations",
5834
5862
  identity: "ID",
@@ -5837,23 +5865,23 @@ var zc = {
5837
5865
  fetchedCount: "Fetched",
5838
5866
  achieved: "Achieved"
5839
5867
  };
5840
- function Vc(e) {
5868
+ function Uc(e) {
5841
5869
  let t = String(e ?? "").toLowerCase();
5842
5870
  return !t || t.startsWith("zh");
5843
5871
  }
5844
- function Hc(e, t) {
5872
+ function Wc(e, t) {
5845
5873
  let n = e.key.trim(), r = e.label.trim();
5846
- return (Vc(t) ? zc[n] : Bc[n]) || (r === n && zc[n] ? Vc(t) ? zc[n] : Bc[n] : r || n);
5874
+ return (Uc(t) ? Vc[n] : Hc[n]) || (r === n && Vc[n] ? Uc(t) ? Vc[n] : Hc[n] : r || n);
5847
5875
  }
5848
- function Uc(e) {
5876
+ function Gc(e) {
5849
5877
  let t = String(e.code ?? "");
5850
5878
  return e.kind === "evidence" && (t.endsWith("_summary") || t.endsWith("_empty") || t === "fetch_summary" || t === "fetch_empty");
5851
5879
  }
5852
- function Wc(e) {
5880
+ function Kc(e) {
5853
5881
  let t = String(e.code ?? "");
5854
5882
  return e.kind === "evidence" && (t.endsWith("_entity_preview") || t === "fetch_entity_preview");
5855
5883
  }
5856
- function Gc(e) {
5884
+ function qc(e) {
5857
5885
  let t = e ?? [], n = (e) => {
5858
5886
  for (let n = t.length - 1; n >= 0; --n) {
5859
5887
  let r = t[n];
@@ -5865,7 +5893,7 @@ function Gc(e) {
5865
5893
  };
5866
5894
  return n(["ask"]) || n(["outcome"]) || n(["evidence"]) || n(["thought"]) || null;
5867
5895
  }
5868
- function Kc(e) {
5896
+ function Jc(e) {
5869
5897
  let t = e ?? [], n = t.filter((e) => e.kind === "ask"), r = t.filter((e) => e.kind === "outcome"), i = t.filter((e) => e.kind !== "ask" && e.kind !== "outcome"), a = n.map((e) => ({
5870
5898
  type: "ask",
5871
5899
  item: e
@@ -5894,11 +5922,11 @@ function Kc(e) {
5894
5922
  continue;
5895
5923
  }
5896
5924
  if (e.kind === "evidence") {
5897
- if (Uc(e)) {
5925
+ if (Gc(e)) {
5898
5926
  u(), s = e;
5899
5927
  continue;
5900
5928
  }
5901
- if (Wc(e)) {
5929
+ if (Kc(e)) {
5902
5930
  c.push(e);
5903
5931
  continue;
5904
5932
  }
@@ -5915,13 +5943,13 @@ function Kc(e) {
5915
5943
  });
5916
5944
  return a;
5917
5945
  }
5918
- function qc(e) {
5919
- if (!Dc(e)) return null;
5946
+ function Yc(e) {
5947
+ if (!kc(e)) return null;
5920
5948
  let t = V(e.phase);
5921
5949
  if (t !== "start" && t !== "progress" && t !== "complete" && t !== "failed" && t !== "awaiting_approval") return null;
5922
- let n = Oc(e.actionRunId), r = Oc(e.generation), i = V(e.actionKey), a = V(e.nodeId) ?? "";
5950
+ let n = Ac(e.actionRunId), r = Ac(e.generation), i = V(e.actionKey), a = V(e.nodeId) ?? "";
5923
5951
  if (n == null || r == null || !i) return null;
5924
- let o = V(e.action) ?? (e.action === null ? null : void 0), s = V(e.progress) ?? null, c = kc(e.stageKind) ?? Ac(o ?? null) ?? Jc(s), l = V(e.narrative) ?? (e.narrative === null ? null : void 0), u = e.narrativeItems, d = u == null ? null : Pc(u);
5952
+ let o = V(e.action) ?? (e.action === null ? null : void 0), s = V(e.progress) ?? null, c = jc(e.stageKind) ?? Mc(o ?? null) ?? Xc(s), l = V(e.narrative) ?? (e.narrative === null ? null : void 0), u = e.narrativeItems, d = u == null ? null : Ic(u);
5925
5953
  return {
5926
5954
  phase: t,
5927
5955
  actionRunId: n,
@@ -5931,8 +5959,8 @@ function qc(e) {
5931
5959
  nodeId: a,
5932
5960
  action: o === void 0 ? void 0 : o,
5933
5961
  stageKind: c,
5934
- stageIndex: Oc(e.stageIndex),
5935
- stageTotal: Oc(e.stageTotal),
5962
+ stageIndex: Ac(e.stageIndex),
5963
+ stageTotal: Ac(e.stageTotal),
5936
5964
  progress: s,
5937
5965
  narrative: l === void 0 ? void 0 : l,
5938
5966
  narrativeItems: d,
@@ -5940,73 +5968,73 @@ function qc(e) {
5940
5968
  errorMessage: V(e.errorMessage)
5941
5969
  };
5942
5970
  }
5943
- function Jc(e) {
5971
+ function Xc(e) {
5944
5972
  let t = String(e ?? "").trim();
5945
5973
  return t === "planning" || t === "fetch_planning" ? "planning" : t === "host_llm_waiting" || t === "fetch_tools" ? "produce" : t === "fetching" || t === "fetch_data" ? "gather" : null;
5946
5974
  }
5947
- function Yc(e, t) {
5975
+ function Zc(e, t) {
5948
5976
  if (e == null || t == null || !Number.isFinite(e) || !Number.isFinite(t) || t <= 1) return null;
5949
5977
  let n = Math.trunc(e), r = Math.trunc(t);
5950
5978
  return r <= 1 ? null : n >= 0 && n < r ? n === 0 ? 1 : n : n === r ? r : null;
5951
5979
  }
5952
- function Xc(e) {
5953
- return Vc(e) ? "处理中…" : "Working…";
5954
- }
5955
- function Zc(e) {
5956
- return Vc(e) ? "查可用结果…" : "Checking prior results…";
5957
- }
5958
5980
  function Qc(e) {
5959
- return Vc(e) ? "已套用已有结果" : "Applied existing result";
5981
+ return Uc(e) ? "处理中…" : "Working…";
5960
5982
  }
5961
5983
  function $c(e) {
5962
- return Vc(e) ? "套用结果…" : "Applying result…";
5984
+ return Uc(e) ? "查可用结果…" : "Checking prior results…";
5963
5985
  }
5964
5986
  function el(e) {
5965
- return Vc(e) ? "请选择目标…" : "Pick a target…";
5987
+ return Uc(e) ? "已套用已有结果" : "Applied existing result";
5966
5988
  }
5967
5989
  function tl(e) {
5968
- return Vc(e) ? "正在执行…" : "Running…";
5990
+ return Uc(e) ? "套用结果…" : "Applying result…";
5969
5991
  }
5970
5992
  function nl(e) {
5971
- return Vc(e) ? "等待审批…" : "Awaiting approval…";
5993
+ return Uc(e) ? "请选择目标…" : "Pick a target…";
5972
5994
  }
5973
5995
  function rl(e) {
5974
- return Vc(e) ? "当前任务已在执行中" : "This task is already running";
5996
+ return Uc(e) ? "正在执行…" : "Running…";
5975
5997
  }
5976
5998
  function il(e) {
5977
- return Vc(e) ? "该操作正在等待审批,请在审批收件箱处理" : "This action is awaiting approval — open the approval inbox to continue";
5999
+ return Uc(e) ? "等待审批…" : "Awaiting approval…";
6000
+ }
6001
+ function al(e) {
6002
+ return Uc(e) ? "当前任务已在执行中" : "This task is already running";
6003
+ }
6004
+ function ol(e) {
6005
+ return Uc(e) ? "该操作正在等待审批,请在审批收件箱处理" : "This action is awaiting approval — open the approval inbox to continue";
5978
6006
  }
5979
- function al(e, t) {
6007
+ function sl(e, t) {
5980
6008
  if (e.phase === "complete" || e.phase === "failed") return null;
5981
- let n = Vc(t), r = e.stageKind ?? Jc(e.progress) ?? "other";
6009
+ let n = Uc(t), r = e.stageKind ?? Xc(e.progress) ?? "other";
5982
6010
  if (e.phase === "awaiting_approval") return n ? "等待审批…" : "Waiting for approval…";
5983
6011
  if (r === "planning") return n ? "正在规划步骤…" : "Planning steps…";
5984
6012
  if (r === "gather") {
5985
- let t = Yc(e.stageIndex, e.stageTotal);
6013
+ let t = Zc(e.stageIndex, e.stageTotal);
5986
6014
  return t != null && e.stageTotal != null ? n ? `正在收集信息(${t}/${Math.trunc(e.stageTotal)})…` : `Gathering info (${t}/${Math.trunc(e.stageTotal)})…` : n ? "正在收集信息…" : "Gathering info…";
5987
6015
  }
5988
6016
  return r === "produce" ? n ? "正在生成结果…" : "Generating results…" : n ? "处理中…" : "Working…";
5989
6017
  }
5990
6018
  //#endregion
5991
6019
  //#region src/core/page/page-action-client.ts
5992
- var ol = "page-action:";
5993
- function sl(e) {
6020
+ var cl = "page-action:";
6021
+ function ll(e) {
5994
6022
  return typeof e == "object" && !!e && !Array.isArray(e);
5995
6023
  }
5996
- function cl(e) {
6024
+ function ul(e) {
5997
6025
  return typeof e == "string" && e.trim().length > 0 ? e.trim() : void 0;
5998
6026
  }
5999
- function ll(e) {
6027
+ function dl(e) {
6000
6028
  try {
6001
6029
  return JSON.parse(e);
6002
6030
  } catch {
6003
6031
  return null;
6004
6032
  }
6005
6033
  }
6006
- function ul(e, t) {
6034
+ function fl(e, t) {
6007
6035
  throw new p("PAGE_ACTION_FAILED", e, { details: t });
6008
6036
  }
6009
- function dl(e) {
6037
+ function pl(e) {
6010
6038
  if (e instanceof p) {
6011
6039
  if (e.code === "TRANSPORT_ABORTED" || e.code === "PAGE_ACTION_FAILED") throw e;
6012
6040
  if (e.code === "TRANSPORT_FAILED") throw new p("PAGE_ACTION_FAILED", e.message, {
@@ -6016,75 +6044,75 @@ function dl(e) {
6016
6044
  }
6017
6045
  throw e;
6018
6046
  }
6019
- function fl(e) {
6047
+ function ml(e) {
6020
6048
  return e ? {
6021
6049
  ...e.page ? { page: e.page } : {},
6022
6050
  ...e.entity ? { entity: e.entity } : {}
6023
6051
  } : {};
6024
6052
  }
6025
- function pl(e) {
6053
+ function hl(e) {
6026
6054
  if (!bn(e)) return;
6027
6055
  let t = e.dsl;
6028
6056
  if (!t || t.op !== "arg.append") return;
6029
6057
  let n = t.chunk;
6030
6058
  return typeof n == "string" ? n : void 0;
6031
6059
  }
6032
- function ml(e) {
6033
- let t = cl(e.phase), n = typeof e.actionRunId == "number" ? e.actionRunId : null, r = cl(e.actionKey), i = typeof e.generation == "number" ? e.generation : null;
6060
+ function gl(e) {
6061
+ let t = ul(e.phase), n = typeof e.actionRunId == "number" ? e.actionRunId : null, r = ul(e.actionKey), i = typeof e.generation == "number" ? e.generation : null;
6034
6062
  return !t || n == null || !r || i == null || t !== "started" && t !== "stream" && t !== "completed" && t !== "failed" && t !== "awaiting_approval" ? null : {
6035
6063
  phase: t,
6036
6064
  actionRunId: n,
6037
6065
  actionKey: r,
6038
6066
  generation: i,
6039
- clientActionId: cl(e.clientActionId) ?? null,
6040
- streamId: cl(e.streamId) ?? null,
6067
+ clientActionId: ul(e.clientActionId) ?? null,
6068
+ streamId: ul(e.streamId) ?? null,
6041
6069
  text: typeof e.text == "string" ? e.text : void 0,
6042
6070
  dslOutcome: typeof e.dslOutcome == "string" ? e.dslOutcome : e.dslOutcome === null ? null : void 0,
6043
- errorCode: cl(e.errorCode),
6044
- errorMessage: cl(e.errorMessage),
6071
+ errorCode: ul(e.errorCode),
6072
+ errorMessage: ul(e.errorMessage),
6045
6073
  brainClarify: Po(e.brainClarify)
6046
6074
  };
6047
6075
  }
6048
- async function hl(e, t) {
6076
+ async function _l(e, t) {
6049
6077
  let n = 0, r = "", i = null, a = !1;
6050
6078
  for await (let o of e) {
6051
6079
  if (o.event === "ping") continue;
6052
6080
  if (o.event === "page_workflow") {
6053
- let e = qc(ll(o.data));
6081
+ let e = Yc(dl(o.data));
6054
6082
  e && t.onWorkflowProgress?.(e);
6055
6083
  continue;
6056
6084
  }
6057
6085
  if (o.event === "host_action") {
6058
- let e = In(ll(o.data));
6086
+ let e = In(dl(o.data));
6059
6087
  if (e) {
6060
6088
  t.onHostAction(e);
6061
- let n = pl(e);
6089
+ let n = hl(e);
6062
6090
  n && t.onChunk?.(n);
6063
6091
  } else t.debug && typeof console < "u" && typeof console.warn == "function" && console.warn("[agent-chat] page_action: ignored malformed host_action SSE frame");
6064
6092
  continue;
6065
6093
  }
6066
6094
  if (o.event !== "page_action") continue;
6067
- let e = ll(o.data);
6068
- if (!sl(e)) continue;
6069
- let s = ml(e);
6095
+ let e = dl(o.data);
6096
+ if (!ll(e)) continue;
6097
+ let s = gl(e);
6070
6098
  if (s && t.onLifecycle?.(s), typeof e.actionRunId == "number" && Number.isFinite(e.actionRunId) && (n = e.actionRunId), e.phase === "stream") {
6071
6099
  let n = typeof e.text == "string" ? e.text : "";
6072
6100
  n && (r += n, t.onChunk?.(n));
6073
6101
  continue;
6074
6102
  }
6075
6103
  if (e.phase === "completed" && (a = !0, r = typeof e.text == "string" ? e.text : "", i = typeof e.dslOutcome == "string" ? e.dslOutcome : e.dslOutcome === null ? null : i), e.phase === "failed") {
6076
- let t = cl(e.errorCode), r = cl(e.errorMessage) ?? "Page action invoke failed", i = Po(e.brainClarify);
6104
+ let t = ul(e.errorCode), r = ul(e.errorMessage) ?? "Page action invoke failed", i = Po(e.brainClarify);
6077
6105
  if (Fo(t) && i) return {
6078
6106
  actionRunId: n,
6079
6107
  text: i.question,
6080
6108
  dslOutcome: null,
6081
6109
  awaitingClarify: !0,
6082
- actionKey: cl(e.actionKey),
6083
- clientActionId: cl(e.clientActionId),
6110
+ actionKey: ul(e.actionKey),
6111
+ clientActionId: ul(e.clientActionId),
6084
6112
  brainClarify: i,
6085
6113
  message: i.question
6086
6114
  };
6087
- ul(r, {
6115
+ fl(r, {
6088
6116
  serverCode: t,
6089
6117
  actionRunId: n || void 0,
6090
6118
  phase: "failed",
@@ -6097,11 +6125,11 @@ async function hl(e, t) {
6097
6125
  dslOutcome: null,
6098
6126
  awaitingApproval: !0,
6099
6127
  status: "awaiting_approval",
6100
- actionKey: cl(e.actionKey),
6101
- clientActionId: cl(e.clientActionId)
6128
+ actionKey: ul(e.actionKey),
6129
+ clientActionId: ul(e.clientActionId)
6102
6130
  };
6103
6131
  }
6104
- return a || ul("Page action stream ended without completion", {
6132
+ return a || fl("Page action stream ended without completion", {
6105
6133
  actionRunId: n || void 0,
6106
6134
  phase: "incomplete"
6107
6135
  }), {
@@ -6110,8 +6138,8 @@ async function hl(e, t) {
6110
6138
  dslOutcome: i
6111
6139
  };
6112
6140
  }
6113
- var gl = hl;
6114
- function _l(e) {
6141
+ var vl = _l;
6142
+ function yl(e) {
6115
6143
  if (!e || typeof e.getBoundingClientRect != "function") return null;
6116
6144
  let t = e.getBoundingClientRect();
6117
6145
  return t.width <= 0 && t.height <= 0 ? null : {
@@ -6123,7 +6151,7 @@ function _l(e) {
6123
6151
  }
6124
6152
  //#endregion
6125
6153
  //#region src/core/page/page-action-reuse-cache.ts
6126
- function vl(e) {
6154
+ function bl(e) {
6127
6155
  return JSON.stringify({
6128
6156
  actionKey: e.actionKey.trim(),
6129
6157
  pageContext: e.pageContext ?? null,
@@ -6131,15 +6159,15 @@ function vl(e) {
6131
6159
  context: e.context && Object.keys(e.context).length > 0 ? e.context : null
6132
6160
  });
6133
6161
  }
6134
- var yl = class {
6162
+ var xl = class {
6135
6163
  constructor() {
6136
6164
  f(this, "byBodyKey", /* @__PURE__ */ new Map()), f(this, "bodyKeyByPageActionKey", /* @__PURE__ */ new Map());
6137
6165
  }
6138
6166
  get(e) {
6139
- return this.byBodyKey.get(vl(e)) ?? null;
6167
+ return this.byBodyKey.get(bl(e)) ?? null;
6140
6168
  }
6141
6169
  set(e, t) {
6142
- let n = vl(e);
6170
+ let n = bl(e);
6143
6171
  this.byBodyKey.set(n, t);
6144
6172
  let r = t.pageActionKey.trim();
6145
6173
  r && this.bodyKeyByPageActionKey.set(r, n);
@@ -6151,7 +6179,7 @@ var yl = class {
6151
6179
  n && (this.byBodyKey.delete(n), this.bodyKeyByPageActionKey.delete(t));
6152
6180
  }
6153
6181
  invalidateByBody(e) {
6154
- let t = vl(e), n = this.byBodyKey.get(t);
6182
+ let t = bl(e), n = this.byBodyKey.get(t);
6155
6183
  this.byBodyKey.delete(t), n?.pageActionKey && this.bodyKeyByPageActionKey.delete(n.pageActionKey.trim());
6156
6184
  }
6157
6185
  clear() {
@@ -6160,7 +6188,7 @@ var yl = class {
6160
6188
  };
6161
6189
  //#endregion
6162
6190
  //#region src/core/page/page-context-navigate.ts
6163
- function bl(e) {
6191
+ function Sl(e) {
6164
6192
  let t = e?.routePath?.trim();
6165
6193
  return t ? {
6166
6194
  kind: "routePath",
@@ -6169,64 +6197,64 @@ function bl(e) {
6169
6197
  }
6170
6198
  //#endregion
6171
6199
  //#region src/core/page/pending-page-action-apply.ts
6172
- var xl = "omnix-chat:pending-page-action-apply:", Sl = 18e5;
6173
- function Cl(e) {
6174
- return `${xl}${e.trim()}`;
6200
+ var Cl = "omnix-chat:pending-page-action-apply:", wl = 18e5;
6201
+ function Tl(e) {
6202
+ return `${Cl}${e.trim()}`;
6175
6203
  }
6176
- function wl(e) {
6204
+ function El(e) {
6177
6205
  let t = Date.parse(e.createdAt);
6178
- return Number.isFinite(t) ? Date.now() - t <= Sl : !1;
6206
+ return Number.isFinite(t) ? Date.now() - t <= wl : !1;
6179
6207
  }
6180
- function Tl(e) {
6208
+ function Dl(e) {
6181
6209
  if (typeof sessionStorage > "u") return null;
6182
6210
  try {
6183
- let t = sessionStorage.getItem(Cl(e));
6211
+ let t = sessionStorage.getItem(Tl(e));
6184
6212
  if (!t) return null;
6185
6213
  let n = JSON.parse(t);
6186
- return !n || typeof n.runId != "number" || !Number.isFinite(n.runId) || typeof n.actionKey != "string" || !n.actionKey.trim() ? null : wl(n) ? {
6214
+ return !n || typeof n.runId != "number" || !Number.isFinite(n.runId) || typeof n.actionKey != "string" || !n.actionKey.trim() ? null : El(n) ? {
6187
6215
  runId: Math.trunc(n.runId),
6188
6216
  actionKey: n.actionKey.trim(),
6189
6217
  pageContext: n.pageContext ?? null,
6190
6218
  createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString()
6191
- } : (sessionStorage.removeItem(Cl(e)), null);
6219
+ } : (sessionStorage.removeItem(Tl(e)), null);
6192
6220
  } catch {
6193
6221
  return null;
6194
6222
  }
6195
6223
  }
6196
- function El(e, t) {
6224
+ function Ol(e, t) {
6197
6225
  if (!(typeof sessionStorage > "u")) try {
6198
- sessionStorage.setItem(Cl(e), JSON.stringify(t));
6226
+ sessionStorage.setItem(Tl(e), JSON.stringify(t));
6199
6227
  } catch {}
6200
6228
  }
6201
- function Dl(e) {
6229
+ function kl(e) {
6202
6230
  if (!(typeof sessionStorage > "u")) try {
6203
- sessionStorage.removeItem(Cl(e));
6231
+ sessionStorage.removeItem(Tl(e));
6204
6232
  } catch {}
6205
6233
  }
6206
- function Ol(e) {
6234
+ function Al(e) {
6207
6235
  return e == null ? null : String(e).trim() || null;
6208
6236
  }
6209
- function kl(e, t) {
6237
+ function jl(e, t) {
6210
6238
  if (!e) return !1;
6211
6239
  let n = t.actionKey.trim();
6212
6240
  if (!n || e.actionKey !== n) return !1;
6213
6241
  let r = t.pageContext?.page?.trim() || null, i = e.pageContext?.page?.trim() || null;
6214
6242
  if (i && r !== i) return !1;
6215
- let a = Ol(t.pageContext?.entity?.id), o = Ol(e.pageContext?.entity?.id);
6243
+ let a = Al(t.pageContext?.entity?.id), o = Al(e.pageContext?.entity?.id);
6216
6244
  return !(o && a !== o);
6217
6245
  }
6218
6246
  //#endregion
6219
6247
  //#region src/core/automation/automation-run-tracker.ts
6220
- var Al = 6e4, jl = 18e5;
6248
+ var Ml = 6e4, Nl = 18e5;
6221
6249
  function H(e) {
6222
6250
  return e === "running" || e === "awaiting_approval";
6223
6251
  }
6224
- function Ml(e) {
6252
+ function Pl(e) {
6225
6253
  let t = 0;
6226
6254
  for (let n of e.values()) H(n.status) && (t += 1);
6227
6255
  return t;
6228
6256
  }
6229
- function Nl(e) {
6257
+ function Fl(e) {
6230
6258
  let t = /* @__PURE__ */ new Set();
6231
6259
  for (let n of e.values()) {
6232
6260
  if (!H(n.status)) continue;
@@ -6235,7 +6263,7 @@ function Nl(e) {
6235
6263
  }
6236
6264
  return t;
6237
6265
  }
6238
- function Pl(e, t) {
6266
+ function Il(e, t) {
6239
6267
  let n = t.trim();
6240
6268
  if (!n) return null;
6241
6269
  for (let t of e.values()) {
@@ -6245,22 +6273,22 @@ function Pl(e, t) {
6245
6273
  }
6246
6274
  return null;
6247
6275
  }
6248
- function Fl(e) {
6249
- let t = Date.now() - jl;
6276
+ function Ll(e) {
6277
+ let t = Date.now() - Nl;
6250
6278
  for (let [n, r] of e) {
6251
6279
  if (!H(r.status)) continue;
6252
6280
  let i = Date.parse(r.updatedAt);
6253
6281
  Number.isFinite(i) && i < t && e.delete(n);
6254
6282
  }
6255
6283
  }
6256
- function Il(e, t) {
6284
+ function Rl(e, t) {
6257
6285
  switch (t) {
6258
6286
  case "active": return H(e);
6259
6287
  case "all": return !0;
6260
6288
  default: return e === t;
6261
6289
  }
6262
6290
  }
6263
- function Ll(e) {
6291
+ function zl(e) {
6264
6292
  switch (e) {
6265
6293
  case "started":
6266
6294
  case "stream": return "running";
@@ -6270,8 +6298,8 @@ function Ll(e) {
6270
6298
  default: return null;
6271
6299
  }
6272
6300
  }
6273
- function Rl(e, t, n) {
6274
- let r = (/* @__PURE__ */ new Date()).toISOString(), i = e.status === "awaiting_approval" ? "awaiting_approval" : e.status === "running" ? "running" : e.status, a = n?.title?.trim() || zl(t);
6301
+ function Bl(e, t, n) {
6302
+ let r = (/* @__PURE__ */ new Date()).toISOString(), i = e.status === "awaiting_approval" ? "awaiting_approval" : e.status === "running" ? "running" : e.status, a = n?.title?.trim() || Vl(t);
6275
6303
  return {
6276
6304
  ref: {
6277
6305
  kind: "page_action_run",
@@ -6294,18 +6322,18 @@ function Rl(e, t, n) {
6294
6322
  }
6295
6323
  };
6296
6324
  }
6297
- function zl(e, t) {
6325
+ function Vl(e, t) {
6298
6326
  let n = t?.trim(), r = e.trim();
6299
- return n && n !== r && !Bl(n) ? n : !r || Bl(r) ? "PageAction" : (r.includes(".") ? r.slice(r.lastIndexOf(".") + 1) : r) || r;
6327
+ return n && n !== r && !Hl(n) ? n : !r || Hl(r) ? "PageAction" : (r.includes(".") ? r.slice(r.lastIndexOf(".") + 1) : r) || r;
6300
6328
  }
6301
- function Bl(e) {
6329
+ function Hl(e) {
6302
6330
  return /^[a-f0-9]{32,}$/i.test(e.trim());
6303
6331
  }
6304
- function Vl(e, t) {
6332
+ function Ul(e, t) {
6305
6333
  return e.findIndex((e) => e.ref.kind === "page_action_run" && e.ref.id === t);
6306
6334
  }
6307
- function Hl(e, t) {
6308
- let n = Vl(e, t.ref.id);
6335
+ function Wl(e, t) {
6336
+ let n = Ul(e, t.ref.id);
6309
6337
  if (n >= 0) {
6310
6338
  let r = [...e];
6311
6339
  return r[n] = {
@@ -6315,8 +6343,8 @@ function Hl(e, t) {
6315
6343
  }
6316
6344
  return [t, ...e];
6317
6345
  }
6318
- function Ul(e, t, n) {
6319
- let r = Vl(e, t);
6346
+ function Gl(e, t, n) {
6347
+ let r = Ul(e, t);
6320
6348
  if (r < 0) return e;
6321
6349
  let i = [...e], a = i[r];
6322
6350
  return i[r] = {
@@ -6329,12 +6357,12 @@ function Ul(e, t, n) {
6329
6357
  approval: n.approval === void 0 ? a.approval : n.approval
6330
6358
  }, i;
6331
6359
  }
6332
- function Wl(e, t) {
6360
+ function Kl(e, t) {
6333
6361
  return e.filter((e) => e.ref.kind !== "page_action_run" || e.ref.id !== t);
6334
6362
  }
6335
- function Gl(e, t) {
6363
+ function ql(e, t) {
6336
6364
  let n = new Set(e.filter((e) => e.ref.kind === "page_action_run").map((e) => e.ref.id)), r = [];
6337
- for (let e of t.values()) H(e.status) && (n.has(e.runId) || r.push(Rl({
6365
+ for (let e of t.values()) H(e.status) && (n.has(e.runId) || r.push(Bl({
6338
6366
  runId: e.runId,
6339
6367
  generation: 0,
6340
6368
  clientActionId: e.clientActionId,
@@ -6347,7 +6375,7 @@ function Gl(e, t) {
6347
6375
  for (let t of e) t.ref.kind === "page_action_run" && r.some((e) => e.ref.id === t.ref.id) || i.push(t);
6348
6376
  return i;
6349
6377
  }
6350
- function Kl(e, t, n = {}) {
6378
+ function Jl(e, t, n = {}) {
6351
6379
  let r = /* @__PURE__ */ new Set(), i = (/* @__PURE__ */ new Date()).toISOString(), a = Date.now(), o = n.fallbackActionKey?.trim() || null;
6352
6380
  for (let n of t) {
6353
6381
  if (n.ref.kind !== "page_action_run" || !H(n.taskStatus)) continue;
@@ -6374,18 +6402,18 @@ function Kl(e, t, n = {}) {
6374
6402
  }
6375
6403
  //#endregion
6376
6404
  //#region src/core/automation/automation-task-tab-store.ts
6377
- var ql = [
6405
+ var Yl = [
6378
6406
  "active",
6379
6407
  "awaiting_approval",
6380
6408
  "completed",
6381
6409
  "failed"
6382
6410
  ];
6383
- function Jl() {
6411
+ function Xl() {
6384
6412
  let e = /* @__PURE__ */ new Map();
6385
- for (let t of ql) e.set(t, Yl());
6413
+ for (let t of Yl) e.set(t, Zl());
6386
6414
  return e;
6387
6415
  }
6388
- function Yl() {
6416
+ function Zl() {
6389
6417
  return {
6390
6418
  items: [],
6391
6419
  hasMore: !1,
@@ -6393,11 +6421,11 @@ function Yl() {
6393
6421
  hydrated: !1
6394
6422
  };
6395
6423
  }
6396
- function Xl(e, t) {
6397
- return e.get(t) ?? Yl();
6424
+ function Ql(e, t) {
6425
+ return e.get(t) ?? Zl();
6398
6426
  }
6399
- function Zl(e, t, n) {
6400
- let r = Xl(e, t);
6427
+ function $l(e, t, n) {
6428
+ let r = Ql(e, t);
6401
6429
  e.set(t, {
6402
6430
  items: n.items ?? r.items,
6403
6431
  hasMore: n.hasMore ?? r.hasMore,
@@ -6407,7 +6435,7 @@ function Zl(e, t, n) {
6407
6435
  }
6408
6436
  //#endregion
6409
6437
  //#region src/core/page/page-action-rows.ts
6410
- function Ql(e) {
6438
+ function eu(e) {
6411
6439
  let t = e === "awaiting_approval", n = e === "awaiting_clarify", r = !t && !n && e !== "awaiting_reuse" && (e === "submitting" || e === "launched" || e === "streaming");
6412
6440
  return {
6413
6441
  awaitingApproval: t,
@@ -6416,7 +6444,7 @@ function Ql(e) {
6416
6444
  disabled: r || t || n
6417
6445
  };
6418
6446
  }
6419
- function $l(e) {
6447
+ function tu(e) {
6420
6448
  switch (e) {
6421
6449
  case "awaiting_approval": return "awaiting_approval";
6422
6450
  case "running": return "streaming";
@@ -6426,18 +6454,18 @@ function $l(e) {
6426
6454
  default: return "idle";
6427
6455
  }
6428
6456
  }
6429
- function eu(e) {
6457
+ function nu(e) {
6430
6458
  return e.rowKey?.trim() || (e.entityId == null ? null : String(e.entityId).trim() || null);
6431
6459
  }
6432
- function tu(e) {
6460
+ function ru(e) {
6433
6461
  return `run:${Math.trunc(e)}`;
6434
6462
  }
6435
- function nu(e, t = {}) {
6436
- let n = tu(Math.trunc(e)), r = t.rowKey?.trim();
6437
- return r && r !== n ? r : t.findRowKeyByRunId?.()?.trim() || eu({ entityId: t.entityId ?? null }) || r || n;
6463
+ function iu(e, t = {}) {
6464
+ let n = ru(Math.trunc(e)), r = t.rowKey?.trim();
6465
+ return r && r !== n ? r : t.findRowKeyByRunId?.()?.trim() || nu({ entityId: t.entityId ?? null }) || r || n;
6438
6466
  }
6439
6467
  function U(e) {
6440
- let t = Ql(e.phase);
6468
+ let t = eu(e.phase);
6441
6469
  return {
6442
6470
  ...e,
6443
6471
  message: e.message ?? null,
@@ -6451,14 +6479,14 @@ function U(e) {
6451
6479
  updatedAt: e.updatedAt ?? Date.now()
6452
6480
  };
6453
6481
  }
6454
- function ru(e) {
6482
+ function au(e) {
6455
6483
  return `${e.actionKey.trim()}::${e.rowKey.trim()}`;
6456
6484
  }
6457
- function iu(e) {
6485
+ function ou(e) {
6458
6486
  let t = e.trim();
6459
6487
  return !t || t === "*";
6460
6488
  }
6461
- var au = class {
6489
+ var su = class {
6462
6490
  constructor(e) {
6463
6491
  f(this, "slots", /* @__PURE__ */ new Map()), f(this, "syncInflight", /* @__PURE__ */ new Map()), f(this, "syncDirty", /* @__PURE__ */ new Set()), f(this, "liveRestoreInflight", /* @__PURE__ */ new Map()), f(this, "applyPhaseBySlot", /* @__PURE__ */ new Map()), f(this, "replayInflight", /* @__PURE__ */ new Set()), f(this, "deps", void 0), this.deps = e;
6464
6492
  }
@@ -6466,7 +6494,7 @@ var au = class {
6466
6494
  return this.applyPhaseBySlot.get(e) ?? "idle";
6467
6495
  }
6468
6496
  bind(e) {
6469
- let t = ru(e);
6497
+ let t = au(e);
6470
6498
  return this.slots.set(t, e), this.syncSlot(t), () => {
6471
6499
  this.slots.delete(t), this.syncInflight.delete(t), this.syncDirty.delete(t), this.applyPhaseBySlot.delete(t);
6472
6500
  };
@@ -6491,9 +6519,9 @@ var au = class {
6491
6519
  return this.applyPhaseBySlot.set(e, t), this.deps.onApplyPhaseChanged(e, t), { applyPhase: t };
6492
6520
  }
6493
6521
  matchesPending(e) {
6494
- if (iu(e.rowKey)) return null;
6522
+ if (ou(e.rowKey)) return null;
6495
6523
  let t = this.deps.getPendingPageActionApply();
6496
- return t && kl(t, {
6524
+ return t && jl(t, {
6497
6525
  actionKey: e.actionKey,
6498
6526
  pageContext: e.pageContext
6499
6527
  }) ? t : null;
@@ -6538,7 +6566,7 @@ var au = class {
6538
6566
  }
6539
6567
  let t = this.slots.get(e);
6540
6568
  if (!t) return { applyPhase: "idle" };
6541
- if (t.autoApplyPending && !iu(t.rowKey)) {
6569
+ if (t.autoApplyPending && !ou(t.rowKey)) {
6542
6570
  let n = this.matchesPending(t);
6543
6571
  if (n) {
6544
6572
  if (!t.ready) return this.setApplyPhase(e, "waiting_ready");
@@ -6556,23 +6584,23 @@ var au = class {
6556
6584
  }
6557
6585
  return t.autoResume && await this.runLiveRestore(t.actionKey), { applyPhase: this.getApplyPhase(e) };
6558
6586
  }
6559
- }, ou = "2.4.7";
6587
+ }, cu = "3.0.2";
6560
6588
  //#endregion
6561
6589
  //#region src/utils/id.ts
6562
- function su(e = "id") {
6590
+ function lu(e = "id") {
6563
6591
  let t = globalThis.crypto;
6564
6592
  return t?.randomUUID ? `${e}_${t.randomUUID().replace(/-/g, "").slice(0, 12)}` : `${e}_${Math.random().toString(36).slice(2, 14)}`;
6565
6593
  }
6566
6594
  //#endregion
6567
6595
  //#region src/core/client/instance.ts
6568
- function cu(e) {
6596
+ function uu(e) {
6569
6597
  return e.replace(/\/+$/, "");
6570
6598
  }
6571
- var lu = 20, uu = 20, du = 20;
6599
+ var du = 20, fu = 20, pu = 20;
6572
6600
  function W(e) {
6573
6601
  return e.trim().toLowerCase();
6574
6602
  }
6575
- function fu(e, t) {
6603
+ function mu(e, t) {
6576
6604
  let n = new Set(e.map((e) => W(e.sessionId))), r = [...e];
6577
6605
  for (let e of t) {
6578
6606
  let t = W(e.sessionId);
@@ -6580,7 +6608,7 @@ function fu(e, t) {
6580
6608
  }
6581
6609
  return r;
6582
6610
  }
6583
- function pu(e, t) {
6611
+ function hu(e, t) {
6584
6612
  let n = new Set(e.map((e) => String(e.id))), r = [];
6585
6613
  for (let e of t) {
6586
6614
  let t = String(e.id);
@@ -6588,14 +6616,14 @@ function pu(e, t) {
6588
6616
  }
6589
6617
  return [...r, ...e];
6590
6618
  }
6591
- function mu() {
6619
+ function gu() {
6592
6620
  return {
6593
6621
  phase: "thinking",
6594
6622
  thinkText: "",
6595
6623
  resultText: ""
6596
6624
  };
6597
6625
  }
6598
- function hu(e, t, n = {}) {
6626
+ function _u(e, t, n = {}) {
6599
6627
  let r = (n.content?.type === "text" ? n.content.text : void 0) ?? (t.resultText || e.content.text), i = n.blocks ?? t.resultBlocks ?? e.blocks, a = b(r), o = a ?? Te(i ?? []), s = a ? x(o) : r;
6600
6628
  return {
6601
6629
  ...e,
@@ -6610,15 +6638,15 @@ function hu(e, t, n = {}) {
6610
6638
  stream: void 0
6611
6639
  };
6612
6640
  }
6613
- function gu() {
6641
+ function vu() {
6614
6642
  return typeof navigator < "u" && navigator.language ? navigator.language : "en";
6615
6643
  }
6616
- function _u() {
6644
+ function yu() {
6617
6645
  return typeof window < "u" && window.location?.origin ? window.location.origin : "unknown://sdk";
6618
6646
  }
6619
- var vu = class {
6620
- constructor(e = su("inst")) {
6621
- f(this, "id", void 0), f(this, "bus", new vn()), f(this, "lifecycle", "uninitialized"), f(this, "state", null), f(this, "stateChangeListeners", /* @__PURE__ */ new Set()), f(this, "sessionEpoch", 0), f(this, "stateSnapshot", null), f(this, "authStoreUnsub", void 0), f(this, "prepareAbort", null), f(this, "prepareTimer", null), f(this, "lastPrepareFingerprint", null), f(this, "skillsLoadToken", 0), f(this, "pendingStreamTargets", /* @__PURE__ */ new Map()), f(this, "sessionStreamConnects", /* @__PURE__ */ new Map()), f(this, "sessionStreamSuppressReconnect", /* @__PURE__ */ new Set()), f(this, "sessionStreamReconnectTimers", /* @__PURE__ */ new Map()), f(this, "sessionStreamReconnectAttempts", /* @__PURE__ */ new Map()), f(this, "hostToolStreamManagers", /* @__PURE__ */ new Map()), f(this, "pageActionInFlightKeys", /* @__PURE__ */ new Set()), f(this, "approvalInboxRefreshPromise", null), f(this, "approvalPendingCountRefreshPromise", null), f(this, "pageActionAwaitingApprovalNotified", /* @__PURE__ */ new Set()), f(this, "automationTaskRefreshPromise", null), f(this, "automationTaskRefreshCacheKey", null), f(this, "automationTaskListPublishSeq", 0), f(this, "pageActionRunAborts", /* @__PURE__ */ new Map()), f(this, "pageActionRunStreamPromises", /* @__PURE__ */ new Map()), f(this, "pendingPageActionApply", null), f(this, "pageActionReusePromptHandler", null), f(this, "pageActionReuseDismissEpochByRowKey", /* @__PURE__ */ new Map()), f(this, "pageActionReuseHintCache", new yl()), f(this, "pageActionInvokeSnapshotsByRowKey", /* @__PURE__ */ new Map()), f(this, "pageActionInvokeSnapshotsByRunId", /* @__PURE__ */ new Map()), f(this, "pageActionFeedbackCatalogItems", []), f(this, "pageActionFeedbackNames", /* @__PURE__ */ new Map()), f(this, "automationRunRegistry", /* @__PURE__ */ new Map()), f(this, "pageActionRows", /* @__PURE__ */ new Map()), f(this, "pageActionRunToRowKey", /* @__PURE__ */ new Map()), f(this, "automationTasksLastSyncedAt", 0), f(this, "pendingRouteContextOverride", void 0), f(this, "pendingPageContext", void 0), f(this, "pendingAttachPageContext", void 0), f(this, "pendingContextMentionRegistry", /* @__PURE__ */ new Map()), f(this, "initGate", void 0), f(this, "loginGate", void 0), f(this, "pageActionCoordinator", void 0), f(this, "pageActionRowIdleTimers", /* @__PURE__ */ new Map()), f(this, "pageActionNarrativeClearTimers", /* @__PURE__ */ new Map()), this.id = e, this.pageActionCoordinator = new au({
6647
+ var bu = class {
6648
+ constructor(e = lu("inst")) {
6649
+ f(this, "id", void 0), f(this, "bus", new vn()), f(this, "lifecycle", "uninitialized"), f(this, "state", null), f(this, "stateChangeListeners", /* @__PURE__ */ new Set()), f(this, "sessionEpoch", 0), f(this, "stateSnapshot", null), f(this, "authStoreUnsub", void 0), f(this, "prepareAbort", null), f(this, "prepareTimer", null), f(this, "lastPrepareFingerprint", null), f(this, "skillsLoadToken", 0), f(this, "pendingStreamTargets", /* @__PURE__ */ new Map()), f(this, "sessionStreamConnects", /* @__PURE__ */ new Map()), f(this, "sessionStreamSuppressReconnect", /* @__PURE__ */ new Set()), f(this, "sessionStreamReconnectTimers", /* @__PURE__ */ new Map()), f(this, "sessionStreamReconnectAttempts", /* @__PURE__ */ new Map()), f(this, "hostToolStreamManagers", /* @__PURE__ */ new Map()), f(this, "pageActionInFlightKeys", /* @__PURE__ */ new Set()), f(this, "approvalInboxRefreshPromise", null), f(this, "approvalPendingCountRefreshPromise", null), f(this, "pageActionAwaitingApprovalNotified", /* @__PURE__ */ new Set()), f(this, "automationTaskRefreshPromise", null), f(this, "automationTaskRefreshCacheKey", null), f(this, "automationTaskListPublishSeq", 0), f(this, "pageActionRunAborts", /* @__PURE__ */ new Map()), f(this, "pageActionRunStreamPromises", /* @__PURE__ */ new Map()), f(this, "pendingPageActionApply", null), f(this, "pageActionReusePromptHandler", null), f(this, "pageActionReuseDismissEpochByRowKey", /* @__PURE__ */ new Map()), f(this, "pageActionReuseHintCache", new xl()), f(this, "pageActionInvokeSnapshotsByRowKey", /* @__PURE__ */ new Map()), f(this, "pageActionInvokeSnapshotsByRunId", /* @__PURE__ */ new Map()), f(this, "pageActionFeedbackCatalogItems", []), f(this, "pageActionFeedbackNames", /* @__PURE__ */ new Map()), f(this, "automationRunRegistry", /* @__PURE__ */ new Map()), f(this, "pageActionRows", /* @__PURE__ */ new Map()), f(this, "pageActionRunToRowKey", /* @__PURE__ */ new Map()), f(this, "automationTasksLastSyncedAt", 0), f(this, "pendingRouteContextOverride", void 0), f(this, "pendingPageContext", void 0), f(this, "pendingAttachPageContext", void 0), f(this, "pendingContextMentionRegistry", /* @__PURE__ */ new Map()), f(this, "initGate", void 0), f(this, "loginGate", void 0), f(this, "pageActionCoordinator", void 0), f(this, "pageActionRowIdleTimers", /* @__PURE__ */ new Map()), f(this, "pageActionNarrativeClearTimers", /* @__PURE__ */ new Map()), this.id = e, this.pageActionCoordinator = new su({
6622
6650
  ensureLoggedIn: () => this.ensureLoggedIn("pageActionSlotSync"),
6623
6651
  reconcileActivePageActions: (e) => this.reconcileActivePageActions(e),
6624
6652
  resumeActivePageActionStreams: (e) => this.resumeActivePageActionStreams(e),
@@ -6659,26 +6687,26 @@ var vu = class {
6659
6687
  throw new p("ALREADY_INITIALIZED", "AgentChat is already initialized with a different DSN. Call destroy() first.");
6660
6688
  }
6661
6689
  if (!e || typeof e != "object") throw new p("INVALID_OPTIONS", "init(options): options object is required");
6662
- let t = cu((e.baseUrl?.trim() || "http://localhost:3030").replace(/\s+/g, "")), n = te(e.dsn);
6690
+ let t = uu((e.baseUrl?.trim() || "http://localhost:3030").replace(/\s+/g, "")), n = te(e.dsn);
6663
6691
  await sn();
6664
6692
  let r = an.getState().getAccessTokenForDsn(n), i = typeof e.accountToken == "string" && e.accountToken.trim() || typeof e.userAccessToken == "string" && e.userAccessToken.trim() || r || null, a = lo({
6665
6693
  apiBase: t,
6666
6694
  defaultHeaders: {
6667
6695
  [m]: n,
6668
- "X-Agent-Sdk-Version": ou,
6696
+ "X-Agent-Sdk-Version": cu,
6669
6697
  ...e.headers ?? {}
6670
6698
  }
6671
- }), o = new uo(a), s = new _o(a), c = new Co(a), l = new wo(a), u = new To(a), d = new Ss(a), f = new Ys(a), ee = new Cs(a), ne = new nc(a), h = null, re = !1, g = null, _ = null;
6699
+ }), o = new uo(a), s = new _o(a), c = new Co(a), l = new wo(a), u = new To(a), d = new ws(a), f = new Zs(a), ee = new Ts(a), ne = new ic(a), h = null, re = !1, g = null, _ = null;
6672
6700
  try {
6673
6701
  h = await o.authenticate(n, i), re = !0, g = h.accessToken?.trim() ?? null, an.getState().setAuth(n, h), g && ae(a, g);
6674
6702
  } catch (t) {
6675
- _ = xu(t), e.debug && console.warn("[agent-chat] app-client auth failed during init:", _);
6703
+ _ = Cu(t), e.debug && console.warn("[agent-chat] app-client auth failed during init:", _);
6676
6704
  }
6677
- let ie = new po(a, () => ({ dsn: this.state?.dsn ?? n })), v = new rc({ context: {
6678
- sdkVersion: ou,
6679
- origin: _u(),
6680
- locale: e.locale ?? gu(),
6681
- user: e.user ?? bu(h?.user)
6705
+ let ie = new po(a, () => ({ dsn: this.state?.dsn ?? n })), v = new ac({ context: {
6706
+ sdkVersion: cu,
6707
+ origin: yu(),
6708
+ locale: e.locale ?? vu(),
6709
+ user: e.user ?? Su(h?.user)
6682
6710
  } });
6683
6711
  return this.state = {
6684
6712
  options: e,
@@ -6740,7 +6768,7 @@ var vu = class {
6740
6768
  automationTaskStatusFilter: "active",
6741
6769
  automationTaskActiveCount: 0,
6742
6770
  automationTaskItems: [],
6743
- automationTaskTabCaches: Jl(),
6771
+ automationTaskTabCaches: Xl(),
6744
6772
  automationRecentRunIds: [],
6745
6773
  automationTaskSelectedDetail: null,
6746
6774
  automationTaskDetailLoading: !1,
@@ -6787,7 +6815,7 @@ var vu = class {
6787
6815
  }
6788
6816
  logout() {
6789
6817
  let e = this.state;
6790
- e && (this.abortAllSessionStreams(e), this.cancelAllSessionStreamReconnects(), e.isLoggedIn = !1, v(e.http), an.getState().clearAuth(), e.session.reset(), e.sessions = [], e.sessionsPage = 0, e.sessionsHasMore = !1, e.sessionsLoadingMore = !1, e.activeSessionId = null, e.activeSessionMessagesPage = 0, e.activeSessionMessagesHasMore = !1, e.sessionMessagesLoadingMore = !1, e.sessionMessagesCache.clear(), e.agents = [], e.skills = [], e.selectedAgentId = null, e.autoAgent = null, e.selectedSkillId = null, e.agentsLoading = !1, e.skillsLoading = !1, e.agentsEmptyReason = null, e.userJwt = null, e.messages = [], e.sessionStreams.clear(), e.sessionRuns.clear(), e.writeConfirmationsBySession.clear(), e.approvalInboxItems = [], e.approvalInboxLoading = !1, e.approvalInboxLoadingMore = !1, e.approvalInboxHasMore = !1, e.approvalInboxStatusFilter = "pending", e.approvalInboxPendingCount = 0, e.automationTaskItems = [], e.automationTaskLoading = !1, e.automationTaskLoadingMore = !1, e.automationTaskHasMore = !1, e.automationTaskTotal = 0, e.automationTaskStatusFilter = "active", e.automationTaskTabCaches = Jl(), e.automationTaskActiveCount = 0, e.automationRecentRunIds = [], e.automationTaskSelectedDetail = null, e.automationTaskDetailLoading = !1, this.abortAllPageActionRunStreams(), this.pageActionInFlightKeys.clear(), this.pageActionAwaitingApprovalNotified.clear(), this.clearAutomationRunRegistry(), e.catalogHydrated = !1, this.pendingStreamTargets.clear(), this.sessionStreamConnects.clear(), this.hostToolStreamManagers.clear(), this.notifyStateChange());
6818
+ e && (this.abortAllSessionStreams(e), this.cancelAllSessionStreamReconnects(), e.isLoggedIn = !1, v(e.http), an.getState().clearAuth(), e.session.reset(), e.sessions = [], e.sessionsPage = 0, e.sessionsHasMore = !1, e.sessionsLoadingMore = !1, e.activeSessionId = null, e.activeSessionMessagesPage = 0, e.activeSessionMessagesHasMore = !1, e.sessionMessagesLoadingMore = !1, e.sessionMessagesCache.clear(), e.agents = [], e.skills = [], e.selectedAgentId = null, e.autoAgent = null, e.selectedSkillId = null, e.agentsLoading = !1, e.skillsLoading = !1, e.agentsEmptyReason = null, e.userJwt = null, e.messages = [], e.sessionStreams.clear(), e.sessionRuns.clear(), e.writeConfirmationsBySession.clear(), e.approvalInboxItems = [], e.approvalInboxLoading = !1, e.approvalInboxLoadingMore = !1, e.approvalInboxHasMore = !1, e.approvalInboxStatusFilter = "pending", e.approvalInboxPendingCount = 0, e.automationTaskItems = [], e.automationTaskLoading = !1, e.automationTaskLoadingMore = !1, e.automationTaskHasMore = !1, e.automationTaskTotal = 0, e.automationTaskStatusFilter = "active", e.automationTaskTabCaches = Xl(), e.automationTaskActiveCount = 0, e.automationRecentRunIds = [], e.automationTaskSelectedDetail = null, e.automationTaskDetailLoading = !1, this.abortAllPageActionRunStreams(), this.pageActionInFlightKeys.clear(), this.pageActionAwaitingApprovalNotified.clear(), this.clearAutomationRunRegistry(), e.catalogHydrated = !1, this.pendingStreamTargets.clear(), this.sessionStreamConnects.clear(), this.hostToolStreamManagers.clear(), this.notifyStateChange());
6791
6819
  }
6792
6820
  isLoggedIn() {
6793
6821
  return this.syncAuthFromStore(), this.state?.isLoggedIn ?? !1;
@@ -6882,6 +6910,9 @@ var vu = class {
6882
6910
  listPageActionFeedbackCatalog() {
6883
6911
  return this.pageActionFeedbackCatalogItems.slice();
6884
6912
  }
6913
+ async checkPageActionRollout(e, t) {
6914
+ return await this.ensureInitialized("checkPageActionRollout", { signal: t?.signal }), await this.ensureLoggedIn("checkPageActionRollout", { signal: t?.signal }), this.requireState("checkPageActionRollout").pageAction.checkRollout(e, t?.signal);
6915
+ }
6885
6916
  async getPageActionFeedback(e, t) {
6886
6917
  return await this.ensureInitialized("getPageActionFeedback", { signal: t?.signal }), await this.ensureLoggedIn("getPageActionFeedback", { signal: t?.signal }), this.requireState("getPageActionFeedback").pageAction.getMyFeedback(e, t?.signal);
6887
6918
  }
@@ -7037,10 +7068,10 @@ var vu = class {
7037
7068
  }
7038
7069
  isPageActionKeyActive(e) {
7039
7070
  let t = e?.trim();
7040
- return t ? Nl(this.automationRunRegistry).has(t) : !1;
7071
+ return t ? Fl(this.automationRunRegistry).has(t) : !1;
7041
7072
  }
7042
7073
  getActivePageActionKeyForActionKey(e) {
7043
- return Pl(this.automationRunRegistry, e);
7074
+ return Il(this.automationRunRegistry, e);
7044
7075
  }
7045
7076
  getPageActionRowState(e) {
7046
7077
  let t = e.trim();
@@ -7066,11 +7097,11 @@ var vu = class {
7066
7097
  if (await this.ensureLoggedIn("hydratePageActionByRunId"), this.requireState("hydratePageActionByRunId"), !Number.isFinite(e)) return null;
7067
7098
  let n = Math.trunc(e), r = await this.getAutomationTaskDetail(n, t.signal);
7068
7099
  if (!r) return null;
7069
- let i = nu(n, {
7100
+ let i = iu(n, {
7070
7101
  rowKey: t.rowKey,
7071
7102
  entityId: r.pageContext?.entity?.id ?? null,
7072
7103
  findRowKeyByRunId: () => this.findRowKeyByRunId(n) || this.findRowKeyByPageActionKey(r.pageActionKey)
7073
- }), a = t.actionKey?.trim() || r.actionKey?.trim() || this.automationRunRegistry.get(n)?.actionKey || r.title, o = r.taskStatus === "failed" && Fo(r.errorCode) && r.brainClarify != null, s = o ? "awaiting_clarify" : $l(r.taskStatus), c = Ql(s), l = this.pageActionRows.get(i), u = c.loading ? l?.progressLabel ?? Xc(this.state?.options.locale) : s === "awaiting_clarify" ? el(this.state?.options.locale) : s === "awaiting_approval" ? al({
7104
+ }), a = t.actionKey?.trim() || r.actionKey?.trim() || this.automationRunRegistry.get(n)?.actionKey || r.title, o = r.taskStatus === "failed" && Fo(r.errorCode) && r.brainClarify != null, s = o ? "awaiting_clarify" : tu(r.taskStatus), c = eu(s), l = this.pageActionRows.get(i), u = c.loading ? l?.progressLabel ?? Qc(this.state?.options.locale) : s === "awaiting_clarify" ? nl(this.state?.options.locale) : s === "awaiting_approval" ? sl({
7074
7105
  phase: "awaiting_approval",
7075
7106
  actionRunId: n,
7076
7107
  actionKey: a,
@@ -7176,7 +7207,7 @@ var vu = class {
7176
7207
  phase: l ? "awaiting_reuse" : "submitting",
7177
7208
  error: null,
7178
7209
  message: null,
7179
- progressLabel: c ? Zc(this.state?.options.locale) : l ? null : Xc(this.state?.options.locale),
7210
+ progressLabel: c ? $c(this.state?.options.locale) : l ? null : Qc(this.state?.options.locale),
7180
7211
  narrativeItems: [],
7181
7212
  approvalRequestId: this.pageActionRows.get(n)?.approvalRequestId ?? null
7182
7213
  }))), await this.ensureLoggedIn("invokePageAction", { signal: e.signal }), l) {
@@ -7194,26 +7225,27 @@ var vu = class {
7194
7225
  phase: "submitting",
7195
7226
  error: null,
7196
7227
  message: null,
7197
- progressLabel: Xc(this.state?.options.locale),
7228
+ progressLabel: Qc(this.state?.options.locale),
7198
7229
  narrativeItems: [],
7199
7230
  approvalRequestId: this.pageActionRows.get(n)?.approvalRequestId ?? null
7200
7231
  }))), await this.invokePageActionStream(t, e, n);
7201
7232
  } catch (t) {
7202
- if (n && !(t instanceof p && t.code === "PAGE_ACTION_ALREADY_ACTIVE")) {
7203
- let r = t instanceof Error ? t.message : String(t);
7233
+ let r = Tu(t);
7234
+ if (n && !(r instanceof p && r.code === "PAGE_ACTION_ALREADY_ACTIVE")) {
7235
+ let t = r instanceof Error ? r.message : String(r);
7204
7236
  this.upsertPageActionRow(U({
7205
7237
  rowKey: n,
7206
7238
  actionKey: e.actionKey.trim(),
7207
7239
  runId: this.pageActionRows.get(n)?.runId ?? null,
7208
7240
  pageActionKey: this.pageActionRows.get(n)?.pageActionKey ?? null,
7209
7241
  phase: "failed",
7210
- error: r,
7242
+ error: t,
7211
7243
  message: null,
7212
7244
  progressLabel: null,
7213
7245
  approvalRequestId: this.pageActionRows.get(n)?.approvalRequestId ?? null
7214
7246
  })), this.schedulePageActionRowIdleReset(n, 1600);
7215
7247
  }
7216
- throw t;
7248
+ throw r;
7217
7249
  } finally {
7218
7250
  this.releasePageActionLock(r);
7219
7251
  }
@@ -7410,7 +7442,7 @@ var vu = class {
7410
7442
  try {
7411
7443
  await this.postWriteGateAction(n, i, e, o.signal);
7412
7444
  } catch (e) {
7413
- let t = Su(e), a = t === "DRAFT_RETRY_LIMIT_EXCEEDED" || t === "INVALID_DRAFT_REVIEW_DECISION" || t === "EDITED_WRITE_ARGS_INVALID" || t === "EDITED_LOCKED_FIELD" || t === "EDITED_FIELD_NOT_ALLOWED" || t === "MULTI_WRITE_EDIT_NOT_SUPPORTED", o = {
7445
+ let t = wu(e), a = t === "DRAFT_RETRY_LIMIT_EXCEEDED" || t === "INVALID_DRAFT_REVIEW_DECISION" || t === "EDITED_WRITE_ARGS_INVALID" || t === "EDITED_LOCKED_FIELD" || t === "EDITED_FIELD_NOT_ALLOWED" || t === "MULTI_WRITE_EDIT_NOT_SUPPORTED", o = {
7414
7446
  ...r,
7415
7447
  awaiting: !0,
7416
7448
  submitting: !1,
@@ -7460,7 +7492,7 @@ var vu = class {
7460
7492
  }
7461
7493
  async fetchApprovalInbox(e = {}) {
7462
7494
  await this.ensureLoggedIn("refreshApprovalInbox");
7463
- let t = this.requireState("refreshApprovalInbox"), n = e.status ?? t.approvalInboxStatusFilter, r = e.limit ?? lu, i = e.offset ?? (e.append ? t.approvalInboxItems.length : 0), a = e.append === !0;
7495
+ let t = this.requireState("refreshApprovalInbox"), n = e.status ?? t.approvalInboxStatusFilter, r = e.limit ?? du, i = e.offset ?? (e.append ? t.approvalInboxItems.length : 0), a = e.append === !0;
7464
7496
  a ? t.approvalInboxLoadingMore = !0 : t.approvalInboxLoading = !0, this.notifyStateChange();
7465
7497
  try {
7466
7498
  let o = await t.approval.listInbox({
@@ -7544,10 +7576,10 @@ var vu = class {
7544
7576
  clientActionId: null
7545
7577
  }), i && this.bindPageActionRunToRow(n, i);
7546
7578
  let a = this.state;
7547
- a && (this.syncAutomationActiveCount(a), a.automationRecentRunIds = [n, ...a.automationRecentRunIds.filter((e) => e !== n)].slice(0, du), this.notifyStateChange()), this.bus.emit("automationTaskCenterChanged", void 0);
7579
+ a && (this.syncAutomationActiveCount(a), a.automationRecentRunIds = [n, ...a.automationRecentRunIds.filter((e) => e !== n)].slice(0, pu), this.notifyStateChange()), this.bus.emit("automationTaskCenterChanged", void 0);
7548
7580
  }
7549
7581
  reconcileAutomationTasksIfNeeded() {
7550
- this.state?.isLoggedIn && (Fl(this.automationRunRegistry), this.automationRunRegistry.size !== 0 && Date.now() - this.automationTasksLastSyncedAt > 6e4 && this.refreshAutomationTasks({
7582
+ this.state?.isLoggedIn && (Ll(this.automationRunRegistry), this.automationRunRegistry.size !== 0 && Date.now() - this.automationTasksLastSyncedAt > 6e4 && this.refreshAutomationTasks({
7551
7583
  status: "active",
7552
7584
  offset: 0
7553
7585
  }).catch(() => {}));
@@ -7573,7 +7605,7 @@ var vu = class {
7573
7605
  async ensureAutomationTaskTabLoaded(e, t = {}) {
7574
7606
  await this.ensureLoggedIn("ensureAutomationTaskTabLoaded", { signal: t.signal });
7575
7607
  let n = this.requireState("ensureAutomationTaskTabLoaded"), r = e ?? n.automationTaskStatusFilter;
7576
- if (r !== n.automationTaskStatusFilter && (this.commitAutomationTaskTabCache(n), n.automationTaskStatusFilter = r, this.restoreAutomationTaskTabView(n), n.automationTaskSelectedDetail = null), !Xl(n.automationTaskTabCaches, r).hydrated || t.refresh) {
7608
+ if (r !== n.automationTaskStatusFilter && (this.commitAutomationTaskTabCache(n), n.automationTaskStatusFilter = r, this.restoreAutomationTaskTabView(n), n.automationTaskSelectedDetail = null), !Ql(n.automationTaskTabCaches, r).hydrated || t.refresh) {
7577
7609
  await this.refreshAutomationTasks({
7578
7610
  status: r,
7579
7611
  offset: 0,
@@ -7593,20 +7625,20 @@ var vu = class {
7593
7625
  });
7594
7626
  }
7595
7627
  commitAutomationTaskTabCache(e) {
7596
- Zl(e.automationTaskTabCaches, e.automationTaskStatusFilter, {
7628
+ $l(e.automationTaskTabCaches, e.automationTaskStatusFilter, {
7597
7629
  items: e.automationTaskItems,
7598
7630
  hasMore: e.automationTaskHasMore,
7599
7631
  total: e.automationTaskTotal,
7600
- hydrated: Xl(e.automationTaskTabCaches, e.automationTaskStatusFilter).hydrated
7632
+ hydrated: Ql(e.automationTaskTabCaches, e.automationTaskStatusFilter).hydrated
7601
7633
  });
7602
7634
  }
7603
7635
  restoreAutomationTaskTabView(e) {
7604
- let t = Xl(e.automationTaskTabCaches, e.automationTaskStatusFilter);
7636
+ let t = Ql(e.automationTaskTabCaches, e.automationTaskStatusFilter);
7605
7637
  e.automationTaskItems = [...t.items], e.automationTaskHasMore = t.hasMore, e.automationTaskTotal = t.total, e.automationTaskLoading = !1, e.automationTaskLoadingMore = !1;
7606
7638
  }
7607
7639
  publishAutomationTaskTabCache(e, t, n, r, i) {
7608
- let a = Xl(e.automationTaskTabCaches, t), o = i ?? a.total;
7609
- Zl(e.automationTaskTabCaches, t, {
7640
+ let a = Ql(e.automationTaskTabCaches, t), o = i ?? a.total;
7641
+ $l(e.automationTaskTabCaches, t, {
7610
7642
  items: n,
7611
7643
  hasMore: r,
7612
7644
  total: o,
@@ -7648,7 +7680,7 @@ var vu = class {
7648
7680
  if (!Number.isFinite(r)) throw new p("INVALID_OPTIONS", "applyPageActionToPage requires a valid runId");
7649
7681
  let i = await this.hydrateAutomationTaskDetail(r, t.signal) ?? await this.getAutomationTaskDetail(r, t.signal);
7650
7682
  if (!i || i.ref.kind !== "page_action_run") throw new p("PAGE_ACTION_FAILED", `PageAction run ${r} not found`);
7651
- let a = i.pageContext, o = bl(a), s = {
7683
+ let a = i.pageContext, o = Sl(a), s = {
7652
7684
  runId: r,
7653
7685
  actionKey: i.actionKey,
7654
7686
  pageContext: a,
@@ -7727,7 +7759,7 @@ var vu = class {
7727
7759
  pageActionKey: a.pageActionKey,
7728
7760
  streamUrl: a.streamUrl,
7729
7761
  status: "completed"
7730
- }, s = a.pageContext, c = fl(s), l = this.pageActionRunToRowKey.get(r) ?? (s?.entity?.id == null ? null : String(s.entity.id).trim());
7762
+ }, s = a.pageContext, c = ml(s), l = this.pageActionRunToRowKey.get(r) ?? (s?.entity?.id == null ? null : String(s.entity.id).trim());
7731
7763
  try {
7732
7764
  await this.consumePageActionRunStream(n, {
7733
7765
  actionKey: a.actionKey,
@@ -7751,12 +7783,12 @@ var vu = class {
7751
7783
  if (this.pendingPageActionApply) return this.pendingPageActionApply;
7752
7784
  let e = this.state;
7753
7785
  if (!e?.dsn) return null;
7754
- let t = Tl(e.dsn);
7786
+ let t = Dl(e.dsn);
7755
7787
  return t && (this.pendingPageActionApply = t), this.pendingPageActionApply;
7756
7788
  }
7757
7789
  clearPendingPageActionApply() {
7758
7790
  let e = this.state;
7759
- this.pendingPageActionApply = null, e?.dsn && Dl(e.dsn), this.bus.emit("pendingPageActionApplyChanged", null), this.pageActionCoordinator.onPendingApplyChanged();
7791
+ this.pendingPageActionApply = null, e?.dsn && kl(e.dsn), this.bus.emit("pendingPageActionApplyChanged", null), this.pageActionCoordinator.onPendingApplyChanged();
7760
7792
  }
7761
7793
  async attachPageActionStream(e, t = {}) {
7762
7794
  await this.ensureLoggedIn("attachPageActionStream", { signal: t.signal });
@@ -7764,7 +7796,7 @@ var vu = class {
7764
7796
  if (!Number.isFinite(r) || this.pageActionRunAborts.has(r) || this.pageActionRunStreamPromises.has(r)) return !1;
7765
7797
  let i = await this.getAutomationTaskDetail(r, t.signal);
7766
7798
  if (!i || i.ref.kind !== "page_action_run" || i.taskStatus !== "running") return !1;
7767
- let a = nu(r, {
7799
+ let a = iu(r, {
7768
7800
  rowKey: t.rowKey,
7769
7801
  entityId: i.pageContext?.entity?.id ?? null,
7770
7802
  findRowKeyByRunId: () => this.findRowKeyByRunId(r) || this.findRowKeyByPageActionKey(i.pageActionKey)
@@ -7781,7 +7813,7 @@ var vu = class {
7781
7813
  pageActionKey: i.pageActionKey,
7782
7814
  streamUrl: i.streamUrl,
7783
7815
  status: "running"
7784
- }, s = i.pageContext, c = fl(s);
7816
+ }, s = i.pageContext, c = ml(s);
7785
7817
  return this.consumePageActionRunStream(n, {
7786
7818
  actionKey: i.actionKey,
7787
7819
  pageContext: s ?? void 0,
@@ -7817,10 +7849,10 @@ var vu = class {
7817
7849
  }
7818
7850
  setPendingPageActionApply(e) {
7819
7851
  let t = this.requireState("setPendingPageActionApply");
7820
- this.pendingPageActionApply = e, El(t.dsn, e), this.bus.emit("pendingPageActionApplyChanged", e), this.pageActionCoordinator.onPendingApplyChanged();
7852
+ this.pendingPageActionApply = e, Ol(t.dsn, e), this.bus.emit("pendingPageActionApplyChanged", e), this.pageActionCoordinator.onPendingApplyChanged();
7821
7853
  }
7822
7854
  matchesPendingPageActionApply(e) {
7823
- return kl(this.getPendingPageActionApply(), e);
7855
+ return jl(this.getPendingPageActionApply(), e);
7824
7856
  }
7825
7857
  async getDownReasonTags() {
7826
7858
  await this.ensureLoggedIn("getDownReasonTags");
@@ -7833,7 +7865,7 @@ var vu = class {
7833
7865
  await this.ensureLoggedIn("submitMessageFeedback");
7834
7866
  let n = this.requireState("submitMessageFeedback"), r = n.activeSessionId ?? n.session.getSession()?.sessionId ?? null;
7835
7867
  if (!r) throw new p("INVALID_OPTIONS", "submitMessageFeedback: no active session");
7836
- let i = ac(e);
7868
+ let i = sc(e);
7837
7869
  if (i === null) throw new p("INVALID_OPTIONS", "submitMessageFeedback: invalid messageId");
7838
7870
  let a = n.messages.find((t) => t.id === e);
7839
7871
  if (!a || a.role !== "agent") throw new p("INVALID_OPTIONS", "submitMessageFeedback: not an assistant message");
@@ -7852,7 +7884,7 @@ var vu = class {
7852
7884
  await this.ensureLoggedIn("removeMessageFeedback");
7853
7885
  let t = this.requireState("removeMessageFeedback"), n = t.activeSessionId ?? t.session.getSession()?.sessionId ?? null;
7854
7886
  if (!n) throw new p("INVALID_OPTIONS", "removeMessageFeedback: no active session");
7855
- let r = ac(e);
7887
+ let r = sc(e);
7856
7888
  if (r === null) throw new p("INVALID_OPTIONS", "removeMessageFeedback: invalid messageId");
7857
7889
  let i = t.messages.find((t) => t.id === e);
7858
7890
  if (!i || i.role !== "agent") throw new p("INVALID_OPTIONS", "removeMessageFeedback: not an assistant message");
@@ -8063,7 +8095,7 @@ var vu = class {
8063
8095
  this.isLoggedIn() && this.refreshApprovalPendingCount().catch(() => {});
8064
8096
  }
8065
8097
  shouldSkipActiveAutomationReconcile() {
8066
- return this.automationTasksLastSyncedAt !== 0 && Date.now() - this.automationTasksLastSyncedAt < Al;
8098
+ return this.automationTasksLastSyncedAt !== 0 && Date.now() - this.automationTasksLastSyncedAt < Ml;
8067
8099
  }
8068
8100
  refreshAutomationTasksBestEffort() {
8069
8101
  this.isLoggedIn() && (this.shouldSkipActiveAutomationReconcile() || this.refreshAutomationTasks({
@@ -8090,7 +8122,7 @@ var vu = class {
8090
8122
  await this.ensureLoggedIn("prepareSession");
8091
8123
  let n = this.requireState("prepareSession"), r = e.trim();
8092
8124
  if (!r) return null;
8093
- let i = yu(t), a = i.signal, o = this.buildPreparePageContext(n), s = this.buildPrepareFingerprint(r, o);
8125
+ let i = xu(t), a = i.signal, o = this.buildPreparePageContext(n), s = this.buildPrepareFingerprint(r, o);
8094
8126
  if (!i.force && s === this.lastPrepareFingerprint) return null;
8095
8127
  try {
8096
8128
  let e = await n.chat.prepareSession(r, o, a);
@@ -8165,7 +8197,7 @@ var vu = class {
8165
8197
  t.sessionsLoadingMore = !0, this.notifyStateChange();
8166
8198
  try {
8167
8199
  let n = await this.fetchSessionsPage(t, t.sessionsPage + 1, e);
8168
- t.sessions = fu(t.sessions, n.sessions), t.sessionsPage = n.page, t.sessionsHasMore = n.hasMore, this.bus.emit("sessions", { sessions: t.sessions });
8200
+ t.sessions = mu(t.sessions, n.sessions), t.sessionsPage = n.page, t.sessionsHasMore = n.hasMore, this.bus.emit("sessions", { sessions: t.sessions });
8169
8201
  } finally {
8170
8202
  t.sessionsLoadingMore = !1, this.notifyStateChange();
8171
8203
  }
@@ -8180,7 +8212,7 @@ var vu = class {
8180
8212
  if (!(!n || !t.activeSessionMessagesHasMore || t.sessionMessagesLoadingMore)) {
8181
8213
  t.sessionMessagesLoadingMore = !0, this.notifyStateChange();
8182
8214
  try {
8183
- let r = await this.fetchSessionMessagesPage(t, n, t.activeSessionMessagesPage + 1, e), i = r.messages.map((e) => this.toAgentMessage(e)), a = pu(t.messages, i);
8215
+ let r = await this.fetchSessionMessagesPage(t, n, t.activeSessionMessagesPage + 1, e), i = r.messages.map((e) => this.toAgentMessage(e)), a = hu(t.messages, i);
8184
8216
  t.messages = a, t.activeSessionMessagesPage = r.page, t.activeSessionMessagesHasMore = r.hasMore, t.session.setSession(n, a), this.writeSessionMessagesCache(t, n, a, r.page, r.hasMore), this.notifyStateChange(), this.syncMessageFeedbacks(t, n).catch(() => {});
8185
8217
  } finally {
8186
8218
  t.sessionMessagesLoadingMore = !1, this.notifyStateChange();
@@ -8264,8 +8296,8 @@ var vu = class {
8264
8296
  e.skillIntentBanner = null, e.skillIntentClarify = null, e.brainClarify = null, e.skillTurnActive = null;
8265
8297
  }
8266
8298
  applySkillTurnContract(e, t, n) {
8267
- let r = t.skillAlignment, i = Cc(n.steps), a = t.requestedSkillId ?? r.requestedSkillId ?? i?.requestedSkillId;
8268
- if (bc(t) && r.code) {
8299
+ let r = t.skillAlignment, i = Tc(n.steps), a = t.requestedSkillId ?? r.requestedSkillId ?? i?.requestedSkillId;
8300
+ if (Sc(t) && r.code) {
8269
8301
  let t = e.lastTurnUserMessage?.trim() ?? i?.userMessage?.trim() ?? "";
8270
8302
  if (!t) return;
8271
8303
  e.skillIntentClarify = {
@@ -8278,7 +8310,7 @@ var vu = class {
8278
8310
  }, e.skillIntentBanner = null, e.skillTurnActive = null;
8279
8311
  return;
8280
8312
  }
8281
- if (vc(t)) {
8313
+ if (bc(t)) {
8282
8314
  e.skillIntentBanner = {
8283
8315
  code: r.code ?? i?.mismatchCode,
8284
8316
  requestedSkillId: a ?? void 0,
@@ -8286,7 +8318,7 @@ var vu = class {
8286
8318
  }, e.skillIntentClarify = null, e.skillTurnActive = null;
8287
8319
  return;
8288
8320
  }
8289
- if (_c(t)) {
8321
+ if (yc(t)) {
8290
8322
  e.skillTurnActive = {
8291
8323
  requestedSkillId: a ?? void 0,
8292
8324
  requestedSkillName: i?.requestedSkillName ?? this.resolveSkillName(e, a)
@@ -8301,15 +8333,15 @@ var vu = class {
8301
8333
  async loadSkillIntentAlignment(e, t) {
8302
8334
  let n = e.appClientId;
8303
8335
  if (n == null) return;
8304
- let r = cc(await e.agentRun.getRun(n, t.runId));
8336
+ let r = uc(await e.agentRun.getRun(n, t.runId));
8305
8337
  if (!r) return;
8306
- let i = lc(r), a = Ro({ steps: i });
8338
+ let i = dc(r), a = Ro({ steps: i });
8307
8339
  a && this.isViewingSession(e, t.sessionId) ? e.brainClarify = {
8308
8340
  messageId: t.assistantMessageId,
8309
8341
  runId: t.runId,
8310
8342
  brainClarify: a
8311
8343
  } : (e.brainClarify?.runId === t.runId || e.brainClarify?.messageId === t.assistantMessageId) && (e.brainClarify = null);
8312
- let o = hc(i);
8344
+ let o = _c(i);
8313
8345
  if (!o) {
8314
8346
  a && this.notifyStateChange();
8315
8347
  return;
@@ -8514,7 +8546,7 @@ var vu = class {
8514
8546
  }
8515
8547
  resolvePageActionStreamSessionKey(e, t) {
8516
8548
  let n = e.clientActionId?.trim();
8517
- return n ? `${ol}${n}` : t == null ? `${ol}${su()}` : `${ol}${t}`;
8549
+ return n ? `${cl}${n}` : t == null ? `${cl}${lu()}` : `${cl}${t}`;
8518
8550
  }
8519
8551
  releasePageActionStreamManager(e) {
8520
8552
  this.hostToolStreamManagers.delete(W(e));
@@ -8564,7 +8596,7 @@ var vu = class {
8564
8596
  actionKey: a.actionKey,
8565
8597
  pageActionKey: a.pageActionKey,
8566
8598
  items: a.reusable.items,
8567
- sourceRect: _l(t.launchAnchor),
8599
+ sourceRect: yl(t.launchAnchor),
8568
8600
  launchAnchor: t.launchAnchor ?? null,
8569
8601
  invokeSnapshot: {
8570
8602
  pageContext: t.pageContext,
@@ -8587,7 +8619,7 @@ var vu = class {
8587
8619
  phase: "submitting",
8588
8620
  error: null,
8589
8621
  message: null,
8590
- progressLabel: Xc(this.state?.options.locale),
8622
+ progressLabel: Qc(this.state?.options.locale),
8591
8623
  narrativeItems: [],
8592
8624
  approvalRequestId: e?.approvalRequestId ?? null
8593
8625
  }));
@@ -8624,7 +8656,7 @@ var vu = class {
8624
8656
  return s ? this.applyPageActionReuse(t, n, a, s) : null;
8625
8657
  }
8626
8658
  async applyPageActionReuse(e, t, n, r) {
8627
- let i = r.ref.id, a = this.state?.options.locale, o = Qc(a), s = e.actionKey.trim(), c = t ? this.pageActionReuseDismissEpochByRowKey.get(t) ?? 0 : 0, l = () => t != null && (this.pageActionReuseDismissEpochByRowKey.get(t) ?? 0) !== c, u = (e) => {
8659
+ let i = r.ref.id, a = this.state?.options.locale, o = el(a), s = e.actionKey.trim(), c = t ? this.pageActionReuseDismissEpochByRowKey.get(t) ?? 0 : 0, l = () => t != null && (this.pageActionReuseDismissEpochByRowKey.get(t) ?? 0) !== c, u = (e) => {
8628
8660
  if (!t || l()) return;
8629
8661
  let r = this.pageActionRows.get(t);
8630
8662
  this.upsertPageActionRow(U({
@@ -8645,7 +8677,7 @@ var vu = class {
8645
8677
  phase: "streaming",
8646
8678
  loading: !0,
8647
8679
  disabled: !0,
8648
- progressLabel: $c(a),
8680
+ progressLabel: tl(a),
8649
8681
  message: null,
8650
8682
  error: null
8651
8683
  }), this.bus.emit("pageActionApplyStarted", {
@@ -8733,12 +8765,12 @@ var vu = class {
8733
8765
  }
8734
8766
  }
8735
8767
  async invokePageActionStream(e, t, n = null) {
8736
- let r = this.resolvePageActionContext(e, t), i = fl(r), a = this.buildPageActionInvokeBody(e, t), o = n ?? this.resolveInvokeRowKey(t), s;
8768
+ let r = this.resolvePageActionContext(e, t), i = ml(r), a = this.buildPageActionInvokeBody(e, t), o = n ?? this.resolveInvokeRowKey(t), s;
8737
8769
  try {
8738
8770
  s = await e.pageAction.invoke(a, t.signal);
8739
8771
  } catch (e) {
8740
8772
  let n = i.page?.trim() ?? r?.page?.trim() ?? t.actionKey?.split(".")[0]?.trim();
8741
- this.emitPageAgentError(n, "page_action", "page_action", e), dl(e);
8773
+ this.emitPageAgentError(n, "page_action", "page_action", e), pl(e);
8742
8774
  }
8743
8775
  if (s.kind === "already_active") {
8744
8776
  let n = s, a = {
@@ -8755,7 +8787,7 @@ var vu = class {
8755
8787
  pageActionKey: n.pageActionKey,
8756
8788
  rowKey: o
8757
8789
  });
8758
- let c = n.existingStatus === "awaiting_approval" ? il(this.state?.options.locale) : rl(this.state?.options.locale);
8790
+ let c = n.existingStatus === "awaiting_approval" ? ol(this.state?.options.locale) : al(this.state?.options.locale);
8759
8791
  if (o && this.syncPageActionRowFromAccepted(o, t.actionKey, a, {
8760
8792
  approvalRequestId: n.approvalRequestId,
8761
8793
  message: c
@@ -8798,7 +8830,7 @@ var vu = class {
8798
8830
  }), o && this.syncPageActionRowFromAccepted(o, t.actionKey, c), this.rememberPageActionInvokeSnapshot(t, o, c.runId);
8799
8831
  let l = {
8800
8832
  ...c,
8801
- sourceRect: _l(t.launchAnchor),
8833
+ sourceRect: yl(t.launchAnchor),
8802
8834
  launchAnchor: t.launchAnchor ?? null,
8803
8835
  rowKey: o,
8804
8836
  actionKey: t.actionKey.trim()
@@ -8819,7 +8851,7 @@ var vu = class {
8819
8851
  return await d;
8820
8852
  } catch (e) {
8821
8853
  let n = i.page?.trim() ?? r?.page?.trim() ?? t.actionKey?.split(".")[0]?.trim();
8822
- this.markTrackedAutomationRunFailed(c.runId, t.actionKey), this.emitPageAgentError(n, "page_action", "page_action", e), dl(e);
8854
+ this.markTrackedAutomationRunFailed(c.runId, t.actionKey), this.emitPageAgentError(n, "page_action", "page_action", e), pl(e);
8823
8855
  }
8824
8856
  }
8825
8857
  buildEarlyPageActionResult(e, t) {
@@ -8838,7 +8870,7 @@ var vu = class {
8838
8870
  };
8839
8871
  }
8840
8872
  finishAlreadyActiveInvoke(e, t, n) {
8841
- let r = this.pageActionRows.get(t), i = r?.awaitingApproval === !0 || r?.phase === "awaiting_approval", a = i ? il(this.state?.options.locale) : rl(this.state?.options.locale);
8873
+ let r = this.pageActionRows.get(t), i = r?.awaitingApproval === !0 || r?.phase === "awaiting_approval", a = i ? ol(this.state?.options.locale) : al(this.state?.options.locale);
8842
8874
  if (r) {
8843
8875
  let { loading: e, disabled: t, ...n } = r;
8844
8876
  this.upsertPageActionRow(U({
@@ -8884,7 +8916,7 @@ var vu = class {
8884
8916
  let o = new AbortController();
8885
8917
  this.pageActionRunAborts.set(n.runId, o), t.signal && (t.signal.aborted ? o.abort() : t.signal.addEventListener("abort", () => o.abort(), { once: !0 }));
8886
8918
  try {
8887
- let s = await hl(e.pageAction.streamRun(n.runId, o.signal), {
8919
+ let s = await _l(e.pageAction.streamRun(n.runId, o.signal), {
8888
8920
  onHostAction: (t) => {
8889
8921
  this.ingestHostActionSse(e, a, t, r, "page_action");
8890
8922
  },
@@ -8909,7 +8941,7 @@ var vu = class {
8909
8941
  this.pageActionAwaitingApprovalNotified.add(i);
8910
8942
  }
8911
8943
  this.emitPageActionAwaitingApproval(e, t, n, r);
8912
- let a = n.rowKey?.trim() || eu({
8944
+ let a = n.rowKey?.trim() || nu({
8913
8945
  rowKey: n.rowKey,
8914
8946
  entityId: t?.entity?.id ?? null
8915
8947
  }) || (typeof r.actionRunId == "number" ? this.pageActionRunToRowKey.get(r.actionRunId) : null);
@@ -8923,7 +8955,7 @@ var vu = class {
8923
8955
  phase: "awaiting_approval",
8924
8956
  error: null,
8925
8957
  message: e?.message ?? null,
8926
- progressLabel: e?.progressLabel ?? al({
8958
+ progressLabel: e?.progressLabel ?? sl({
8927
8959
  phase: "awaiting_approval",
8928
8960
  actionRunId: r.actionRunId ?? e?.runId ?? 0,
8929
8961
  actionKey: (r.actionKey ?? n.actionKey).trim(),
@@ -8968,7 +9000,7 @@ var vu = class {
8968
9000
  actionKey: e.actionKey,
8969
9001
  runId: t,
8970
9002
  brainClarify: e.brainClarify,
8971
- sourceRect: _l(r?.launchAnchor ?? null),
9003
+ sourceRect: yl(r?.launchAnchor ?? null),
8972
9004
  launchAnchor: r?.launchAnchor ?? null,
8973
9005
  invokeSnapshot: r ? {
8974
9006
  pageContext: r.pageContext,
@@ -9071,16 +9103,16 @@ var vu = class {
9071
9103
  this.automationRunRegistry.clear(), this.automationTasksLastSyncedAt = 0, this.pageActionRows.clear(), this.pageActionRunToRowKey.clear(), this.pageActionReuseHintCache.clear(), this.clearPageActionRowIdleTimers();
9072
9104
  }
9073
9105
  syncAutomationActiveCount(e) {
9074
- Fl(this.automationRunRegistry), e.automationTaskActiveCount = Ml(this.automationRunRegistry);
9106
+ Ll(this.automationRunRegistry), e.automationTaskActiveCount = Pl(this.automationRunRegistry);
9075
9107
  }
9076
9108
  resolveInvokeRowKey(e) {
9077
9109
  let t = this.state;
9078
- if (!t) return eu({
9110
+ if (!t) return nu({
9079
9111
  rowKey: e.rowKey,
9080
9112
  entityId: e.pageContext?.entity?.id ?? null
9081
9113
  });
9082
9114
  let n = this.resolvePageActionContext(t, e);
9083
- return eu({
9115
+ return nu({
9084
9116
  rowKey: e.rowKey,
9085
9117
  entityId: n?.entity?.id ?? null
9086
9118
  });
@@ -9109,7 +9141,7 @@ var vu = class {
9109
9141
  });
9110
9142
  }
9111
9143
  syncPageActionRowFromAccepted(e, t, n, r = {}) {
9112
- let i = n.status === "awaiting_approval" ? "awaiting_approval" : n.status === "running" ? "launched" : $l(n.status);
9144
+ let i = n.status === "awaiting_approval" ? "awaiting_approval" : n.status === "running" ? "launched" : tu(n.status);
9113
9145
  this.upsertPageActionRow(U({
9114
9146
  rowKey: e,
9115
9147
  actionKey: t.trim(),
@@ -9118,14 +9150,14 @@ var vu = class {
9118
9150
  phase: i,
9119
9151
  error: r.error ?? null,
9120
9152
  message: r.message ?? null,
9121
- progressLabel: i === "awaiting_approval" ? al({
9153
+ progressLabel: i === "awaiting_approval" ? sl({
9122
9154
  phase: "awaiting_approval",
9123
9155
  actionRunId: n.runId,
9124
9156
  actionKey: t.trim(),
9125
9157
  generation: n.generation,
9126
9158
  nodeId: "",
9127
9159
  stageKind: "other"
9128
- }, this.state?.options.locale) : i === "launched" || i === "streaming" ? this.pageActionRows.get(e)?.progressLabel ?? Xc(this.state?.options.locale) : null,
9160
+ }, this.state?.options.locale) : i === "launched" || i === "streaming" ? this.pageActionRows.get(e)?.progressLabel ?? Qc(this.state?.options.locale) : null,
9129
9161
  narrativeItems: this.pageActionRows.get(e)?.narrativeItems ?? [],
9130
9162
  approvalRequestId: r.approvalRequestId ?? null
9131
9163
  }));
@@ -9135,7 +9167,7 @@ var vu = class {
9135
9167
  if (!n) return;
9136
9168
  let r = this.pageActionRows.get(n);
9137
9169
  if (!r || e.phase === "failed" || r.phase === "idle" || r.phase === "completed" || r.phase === "failed" || r.phase === "awaiting_reuse") return;
9138
- let i = Ic(r.narrativeItems, e.narrativeItems), a = al(e, this.state?.options.locale), o = a == null || a === r.progressLabel, s = i === r.narrativeItems;
9170
+ let i = Rc(r.narrativeItems, e.narrativeItems), a = sl(e, this.state?.options.locale), o = a == null || a === r.progressLabel, s = i === r.narrativeItems;
9139
9171
  if (o && s) return;
9140
9172
  let c = e.phase === "awaiting_approval" ? "awaiting_approval" : r.phase === "submitting" || r.phase === "launched" || r.loading || r.phase === "streaming" ? "streaming" : r.phase;
9141
9173
  this.upsertPageActionRow(U({
@@ -9153,14 +9185,14 @@ var vu = class {
9153
9185
  if ((e.phase === "started" || e.phase === "stream") && (r?.phase === "idle" || r?.phase === "completed" || r?.phase === "failed" || r?.phase === "awaiting_reuse")) return;
9154
9186
  let i = e.phase === "failed" && Fo(e.errorCode) && e.brainClarify != null, a = e.phase === "started" || e.phase === "stream" ? "streaming" : e.phase === "awaiting_approval" ? "awaiting_approval" : e.phase === "completed" ? "completed" : i ? "awaiting_clarify" : e.phase === "failed" ? "failed" : "idle";
9155
9187
  if (e.phase === "stream" && r?.phase === "streaming" && r.progressLabel) return;
9156
- let o = a === "completed" || a === "failed" ? null : a === "awaiting_clarify" ? el(this.state?.options.locale) : a === "awaiting_approval" ? al({
9188
+ let o = a === "completed" || a === "failed" ? null : a === "awaiting_clarify" ? nl(this.state?.options.locale) : a === "awaiting_approval" ? sl({
9157
9189
  phase: "awaiting_approval",
9158
9190
  actionRunId: t,
9159
9191
  actionKey: e.actionKey || r?.actionKey || "",
9160
9192
  generation: e.generation,
9161
9193
  nodeId: "",
9162
9194
  stageKind: "other"
9163
- }, this.state?.options.locale) : r?.progressLabel ?? Xc(this.state?.options.locale);
9195
+ }, this.state?.options.locale) : r?.progressLabel ?? Qc(this.state?.options.locale);
9164
9196
  this.upsertPageActionRow(U({
9165
9197
  rowKey: n,
9166
9198
  actionKey: e.actionKey || r?.actionKey || `Run ${t}`,
@@ -9239,8 +9271,8 @@ var vu = class {
9239
9271
  trackAutomationRun(e, t) {
9240
9272
  let n = this.state;
9241
9273
  if (!n) return;
9242
- let r = (/* @__PURE__ */ new Date()).toISOString(), i = this.pageActionFeedbackNames.get(t.actionKey.trim()), a = n.options.locale, o = e.status === "awaiting_approval" ? nl(a) : tl(a), s = Rl(e, t.actionKey, {
9243
- title: zl(t.actionKey, i),
9274
+ let r = (/* @__PURE__ */ new Date()).toISOString(), i = this.pageActionFeedbackNames.get(t.actionKey.trim()), a = n.options.locale, o = e.status === "awaiting_approval" ? il(a) : rl(a), s = Bl(e, t.actionKey, {
9275
+ title: Vl(t.actionKey, i),
9244
9276
  subtitle: o
9245
9277
  }), c = t.rowKey?.trim() || null;
9246
9278
  if (H(e.status) && (this.automationRunRegistry.set(e.runId, {
@@ -9252,14 +9284,14 @@ var vu = class {
9252
9284
  registeredAt: r,
9253
9285
  updatedAt: r,
9254
9286
  clientActionId: e.clientActionId
9255
- }), c && this.bindPageActionRunToRow(e.runId, c)), Il(s.taskStatus, n.automationTaskStatusFilter)) {
9256
- let e = Hl(n.automationTaskItems, s);
9287
+ }), c && this.bindPageActionRunToRow(e.runId, c)), Rl(s.taskStatus, n.automationTaskStatusFilter)) {
9288
+ let e = Wl(n.automationTaskItems, s);
9257
9289
  this.publishAutomationTaskTabCache(n, n.automationTaskStatusFilter, e, n.automationTaskHasMore);
9258
9290
  }
9259
- n.automationRecentRunIds = [e.runId, ...n.automationRecentRunIds.filter((t) => t !== e.runId)].slice(0, du), this.syncAutomationActiveCount(n), this.notifyStateChange(), this.bus.emit("automationTaskCenterChanged", void 0);
9291
+ n.automationRecentRunIds = [e.runId, ...n.automationRecentRunIds.filter((t) => t !== e.runId)].slice(0, pu), this.syncAutomationActiveCount(n), this.notifyStateChange(), this.bus.emit("automationTaskCenterChanged", void 0);
9260
9292
  }
9261
9293
  applyPageActionRunLifecycle(e, t) {
9262
- let n = Ll(t.phase);
9294
+ let n = zl(t.phase);
9263
9295
  if (!n) return;
9264
9296
  let r = t.actionRunId, i = (/* @__PURE__ */ new Date()).toISOString(), a = this.automationRunRegistry.get(r);
9265
9297
  if (t.phase === "stream" && a?.status === "running") {
@@ -9300,22 +9332,22 @@ var vu = class {
9300
9332
  } } : {}
9301
9333
  };
9302
9334
  if (e.automationTaskStatusFilter === "active" && !H(n)) {
9303
- let t = Wl(e.automationTaskItems, r);
9335
+ let t = Kl(e.automationTaskItems, r);
9304
9336
  this.publishAutomationTaskTabCache(e, e.automationTaskStatusFilter, t, e.automationTaskHasMore);
9305
- } else if (Il(n, e.automationTaskStatusFilter)) {
9337
+ } else if (Rl(n, e.automationTaskStatusFilter)) {
9306
9338
  if (e.automationTaskItems.findIndex((e) => e.ref.kind === "page_action_run" && e.ref.id === r) >= 0) {
9307
- let t = Ul(e.automationTaskItems, r, c);
9339
+ let t = Gl(e.automationTaskItems, r, c);
9308
9340
  this.publishAutomationTaskTabCache(e, e.automationTaskStatusFilter, t, e.automationTaskHasMore);
9309
9341
  } else {
9310
- let i = Hl(e.automationTaskItems, {
9311
- ...Rl({
9342
+ let i = Wl(e.automationTaskItems, {
9343
+ ...Bl({
9312
9344
  runId: r,
9313
9345
  generation: t.generation,
9314
9346
  clientActionId: t.clientActionId ?? null,
9315
9347
  pageActionKey: a?.pageActionKey ?? null,
9316
9348
  streamUrl: "",
9317
9349
  status: n
9318
- }, t.actionKey, { title: zl(t.actionKey, this.pageActionFeedbackNames.get(t.actionKey.trim())) }),
9350
+ }, t.actionKey, { title: Vl(t.actionKey, this.pageActionFeedbackNames.get(t.actionKey.trim())) }),
9319
9351
  ...c
9320
9352
  });
9321
9353
  this.publishAutomationTaskTabCache(e, e.automationTaskStatusFilter, i, e.automationTaskHasMore);
@@ -9437,7 +9469,7 @@ var vu = class {
9437
9469
  }
9438
9470
  async fetchAutomationTasks(e = {}) {
9439
9471
  await this.ensureLoggedIn("refreshAutomationTasks");
9440
- let t = this.requireState("refreshAutomationTasks"), n = e.status ?? t.automationTaskStatusFilter, r = e.limit ?? uu, i = Xl(t.automationTaskTabCaches, n), a = e.offset ?? (e.append ? i.items.length : 0), o = e.append === !0;
9472
+ let t = this.requireState("refreshAutomationTasks"), n = e.status ?? t.automationTaskStatusFilter, r = e.limit ?? fu, i = Ql(t.automationTaskTabCaches, n), a = e.offset ?? (e.append ? i.items.length : 0), o = e.append === !0;
9441
9473
  if (o && t.automationTaskLoading) return {
9442
9474
  items: i.items,
9443
9475
  total: i.total,
@@ -9456,8 +9488,8 @@ var vu = class {
9456
9488
  });
9457
9489
  if (s !== this.automationTaskListPublishSeq) return c;
9458
9490
  t.automationTaskStatusFilter = n;
9459
- let l = o ? [...i.items, ...c.items] : n === "active" && a === 0 ? Gl(c.items, this.automationRunRegistry) : c.items, u = Yo(l.length, c.items.length, c.total, r);
9460
- return this.publishAutomationTaskTabCache(t, n, l, u, c.total), n === "active" && a === 0 && !o && (Kl(this.automationRunRegistry, c.items, { fallbackActionKey: e.actionKey }), this.automationTasksLastSyncedAt = Date.now()), this.syncAutomationActiveCount(t), c;
9491
+ let l = o ? [...i.items, ...c.items] : n === "active" && a === 0 ? ql(c.items, this.automationRunRegistry) : c.items, u = Yo(l.length, c.items.length, c.total, r);
9492
+ return this.publishAutomationTaskTabCache(t, n, l, u, c.total), n === "active" && a === 0 && !o && (Jl(this.automationRunRegistry, c.items, { fallbackActionKey: e.actionKey }), this.automationTasksLastSyncedAt = Date.now()), this.syncAutomationActiveCount(t), c;
9461
9493
  } finally {
9462
9494
  o ? t.automationTaskLoadingMore = !1 : t.automationTaskLoading = !1, this.notifyStateChange();
9463
9495
  }
@@ -9633,8 +9665,8 @@ var vu = class {
9633
9665
  let i = this.getSessionMessagesList(e, t).find((e) => e.id === r);
9634
9666
  if (!i || i.role !== "agent") return;
9635
9667
  let a = i.stream;
9636
- (a?.resultText || i.content.text || "").trim() ? this.replaceMessageInSession(e, t, hu(i, {
9637
- ...a ?? mu(),
9668
+ (a?.resultText || i.content.text || "").trim() ? this.replaceMessageInSession(e, t, _u(i, {
9669
+ ...a ?? gu(),
9638
9670
  phase: "complete"
9639
9671
  }, { status: "sent" }), r) : this.removeAgentMessageInSession(e, t, r), this.setStreamTargetMessageId(e, t, null), this.getSessionRunState(e, t).activeRunId = null, n.systemHint && this.appendSystemMessageInSession(e, t, n.systemHint), this.notifyStateChange();
9640
9672
  }
@@ -9760,7 +9792,7 @@ var vu = class {
9760
9792
  }
9761
9793
  appendAgentPlaceholderInSession(e, t) {
9762
9794
  let n = {
9763
- id: su("msg"),
9795
+ id: lu("msg"),
9764
9796
  role: "agent",
9765
9797
  content: {
9766
9798
  type: "text",
@@ -9776,7 +9808,7 @@ var vu = class {
9776
9808
  }
9777
9809
  appendSystemMessageInSession(e, t, n) {
9778
9810
  let r = {
9779
- id: su("msg"),
9811
+ id: lu("msg"),
9780
9812
  role: "system",
9781
9813
  content: {
9782
9814
  type: "text",
@@ -9825,8 +9857,8 @@ var vu = class {
9825
9857
  continue;
9826
9858
  }
9827
9859
  a = !0;
9828
- let t = e.stream ?? mu();
9829
- (t.resultText || e.content.text).trim() && i.push(hu(e, t, { status: "sent" }));
9860
+ let t = e.stream ?? gu();
9861
+ (t.resultText || e.content.text).trim() && i.push(_u(e, t, { status: "sent" }));
9830
9862
  }
9831
9863
  a && this.commitSessionMessages(e, n, i);
9832
9864
  }
@@ -9846,7 +9878,7 @@ var vu = class {
9846
9878
  }
9847
9879
  appendAgentPlaceholder(e) {
9848
9880
  let t = {
9849
- id: su("msg"),
9881
+ id: lu("msg"),
9850
9882
  role: "agent",
9851
9883
  content: {
9852
9884
  type: "text",
@@ -9862,7 +9894,7 @@ var vu = class {
9862
9894
  }
9863
9895
  appendOptimisticUserMessage(e, t, n, r) {
9864
9896
  let i = {
9865
- id: n ?? su("msg"),
9897
+ id: n ?? lu("msg"),
9866
9898
  role: "user",
9867
9899
  content: {
9868
9900
  type: "text",
@@ -9966,7 +9998,7 @@ var vu = class {
9966
9998
  case "think":
9967
9999
  if (!n) break;
9968
10000
  this.patchMessageInSession(r, e, n, (e) => {
9969
- let n = { ...e.stream ?? mu() }, r = t.mode === "append" ? `${n.thinkText}${t.text}` : t.text, i = !!n.resultText?.trim() || !!(n.resultBlocks ?? e.blocks ?? []).length;
10001
+ let n = { ...e.stream ?? gu() }, r = t.mode === "append" ? `${n.thinkText}${t.text}` : t.text, i = !!n.resultText?.trim() || !!(n.resultBlocks ?? e.blocks ?? []).length;
9970
10002
  return {
9971
10003
  ...e,
9972
10004
  status: "pending",
@@ -9986,7 +10018,7 @@ var vu = class {
9986
10018
  case "result":
9987
10019
  if (!n || t.mode === "replace" && this.isExistingSentAssistantText(r, e, t.text, n)) break;
9988
10020
  this.patchMessageInSession(r, e, n, (e) => {
9989
- let n = { ...e.stream ?? mu() }, r = t.mode === "append" ? `${n.resultText}${t.text}` : t.text;
10021
+ let n = { ...e.stream ?? gu() }, r = t.mode === "append" ? `${n.resultText}${t.text}` : t.text;
9990
10022
  return {
9991
10023
  ...e,
9992
10024
  status: "pending",
@@ -10012,7 +10044,7 @@ var vu = class {
10012
10044
  if (!n) break;
10013
10045
  let a = t.seq;
10014
10046
  this.patchMessageInSession(r, e, n, (e) => {
10015
- let n = { ...e.stream ?? mu() }, r = new Set(n.seenSeq ?? []);
10047
+ let n = { ...e.stream ?? gu() }, r = new Set(n.seenSeq ?? []);
10016
10048
  if (a != null && r.has(a)) return e;
10017
10049
  a != null && r.add(a);
10018
10050
  let i = n.resultBlocks ?? e.blocks ?? [], o = i;
@@ -10076,7 +10108,7 @@ var vu = class {
10076
10108
  if (n) {
10077
10109
  let e = i(n);
10078
10110
  if (e) {
10079
- let r = e.stream ?? mu();
10111
+ let r = e.stream ?? gu();
10080
10112
  a({
10081
10113
  ...e,
10082
10114
  status: "failed",
@@ -10095,12 +10127,12 @@ var vu = class {
10095
10127
  let o = i(n);
10096
10128
  if (!o) break;
10097
10129
  let s = W(e), c = r.writeConfirmationsBySession.get(s)?.awaiting, l = {
10098
- ...o.stream ?? mu(),
10130
+ ...o.stream ?? gu(),
10099
10131
  phase: "complete"
10100
10132
  }, u;
10101
10133
  if (t.serverMessage) {
10102
10134
  let e = this.toAgentMessage(t.serverMessage);
10103
- u = hu({
10135
+ u = _u({
10104
10136
  ...o,
10105
10137
  content: e.content,
10106
10138
  blocks: e.blocks ?? o.blocks
@@ -10109,7 +10141,7 @@ var vu = class {
10109
10141
  resultText: e.content.text,
10110
10142
  resultBlocks: e.blocks ?? l.resultBlocks
10111
10143
  }, { status: "sent" });
10112
- } else u = hu(o, l, { status: "sent" });
10144
+ } else u = _u(o, l, { status: "sent" });
10113
10145
  let d = this.resolveCompleteServerMessageId(t);
10114
10146
  d && d !== n && !this.getSessionMessagesList(r, e).some((e) => e.id === d) ? a({
10115
10147
  ...u,
@@ -10149,8 +10181,8 @@ var vu = class {
10149
10181
  let o = i(this.resolveStreamTargetMessageId(r, e));
10150
10182
  if (o && (o.status ?? "pending") === "pending") {
10151
10183
  let t = o.stream;
10152
- (t?.resultText || o.content.text || "").trim() ? a(hu(o, {
10153
- ...t ?? mu(),
10184
+ (t?.resultText || o.content.text || "").trim() ? a(_u(o, {
10185
+ ...t ?? gu(),
10154
10186
  phase: "complete"
10155
10187
  }, { status: "sent" }), o.id) : this.removeAgentMessageInSession(r, e, o.id), this.maybeNotifyBackgroundReply(r, e);
10156
10188
  }
@@ -10159,8 +10191,8 @@ var vu = class {
10159
10191
  if (t?.name === "AbortError") {
10160
10192
  let t = i(this.resolveStreamTargetMessageId(r, e));
10161
10193
  if (!t) return;
10162
- let n = t.stream ?? mu();
10163
- (n.resultText || t.content.text).trim() ? a(hu(t, {
10194
+ let n = t.stream ?? gu();
10195
+ (n.resultText || t.content.text).trim() ? a(_u(t, {
10164
10196
  ...n,
10165
10197
  phase: "complete"
10166
10198
  }, { status: "sent" }), t.id) : this.removeAgentMessageInSession(r, e, t.id);
@@ -10168,7 +10200,7 @@ var vu = class {
10168
10200
  }
10169
10201
  let n = i(this.resolveStreamTargetMessageId(r, e));
10170
10202
  if (n) {
10171
- let e = n.stream ?? mu();
10203
+ let e = n.stream ?? gu();
10172
10204
  a({
10173
10205
  ...n,
10174
10206
  status: "failed",
@@ -10199,13 +10231,13 @@ var vu = class {
10199
10231
  }
10200
10232
  resolveCompleteServerMessageId(e) {
10201
10233
  if (e.serverMessage?.id != null) return String(e.serverMessage.id);
10202
- if (e.messageId && ic(e.messageId)) return e.messageId;
10234
+ if (e.messageId && oc(e.messageId)) return e.messageId;
10203
10235
  }
10204
10236
  async alignPersistedMessageIds(e, t, n = {}) {
10205
- let r = n.preferLocalId?.trim(), i = n.preferServerId && ic(n.preferServerId) ? n.preferServerId : void 0;
10237
+ let r = n.preferLocalId?.trim(), i = n.preferServerId && oc(n.preferServerId) ? n.preferServerId : void 0;
10206
10238
  if (r && i) {
10207
10239
  let n = this.getSessionMessagesList(e, t), a = n.find((e) => e.id === r);
10208
- if (a && !ic(a.id) && !n.some((e) => e.id === i)) {
10240
+ if (a && !oc(a.id) && !n.some((e) => e.id === i)) {
10209
10241
  let a = n.map((e) => e.id === r ? {
10210
10242
  ...e,
10211
10243
  id: i
@@ -10216,15 +10248,15 @@ var vu = class {
10216
10248
  return;
10217
10249
  }
10218
10250
  }
10219
- let a = this.getSessionMessagesList(e, t), o = a.filter((e) => e.role === "agent" && e.status === "sent" && !e.stream && !ic(e.id));
10251
+ let a = this.getSessionMessagesList(e, t), o = a.filter((e) => e.role === "agent" && e.status === "sent" && !e.stream && !oc(e.id));
10220
10252
  if (o.length === 0) return;
10221
- let s = (await this.fetchSessionMessagesPage(e, t, 1)).messages.map((e) => this.toAgentMessage(e)).filter((e) => e.role === "agent"), c = new Set(a.filter((e) => e.role === "agent" && ic(e.id)).map((e) => e.id)), l = s.filter((e) => !c.has(e.id));
10253
+ let s = (await this.fetchSessionMessagesPage(e, t, 1)).messages.map((e) => this.toAgentMessage(e)).filter((e) => e.role === "agent"), c = new Set(a.filter((e) => e.role === "agent" && oc(e.id)).map((e) => e.id)), l = s.filter((e) => !c.has(e.id));
10222
10254
  if (l.length === 0) return;
10223
10255
  let u = Math.max(0, l.length - o.length), d = !1, f = a.map((t) => {
10224
10256
  let n = o.findIndex((e) => e.id === t.id);
10225
10257
  if (n < 0) return t;
10226
10258
  let r = l[u + n];
10227
- return !r || !ic(r.id) ? t : (d = !0, this.syncWriteConfirmationMessageId(e, t.id, r.id), {
10259
+ return !r || !oc(r.id) ? t : (d = !0, this.syncWriteConfirmationMessageId(e, t.id, r.id), {
10228
10260
  ...t,
10229
10261
  id: r.id,
10230
10262
  createdAt: r.createdAt
@@ -10233,7 +10265,7 @@ var vu = class {
10233
10265
  d && (this.commitSessionMessages(e, t, f), this.syncMessageFeedbacks(e, t).catch(() => {}));
10234
10266
  }
10235
10267
  maybeRebindStreamMessageId(e, t, n, r) {
10236
- if (!n || !r || !ic(r) || n === r || ic(n)) return n;
10268
+ if (!n || !r || !oc(r) || n === r || oc(n)) return n;
10237
10269
  let i = this.getSessionMessagesList(e, t);
10238
10270
  if (i.some((e) => e.id === r)) return n;
10239
10271
  if (!i.find((e) => e.id === n)) return r;
@@ -10272,7 +10304,7 @@ var vu = class {
10272
10304
  let t = [];
10273
10305
  for (let n of e) {
10274
10306
  if (n.role !== "agent" || n.status !== "sent" || n.stream) continue;
10275
- let e = ac(n.id);
10307
+ let e = sc(n.id);
10276
10308
  e !== null && t.push(e);
10277
10309
  }
10278
10310
  return t;
@@ -10281,7 +10313,7 @@ var vu = class {
10281
10313
  let n = this.getSessionMessagesList(e, t), r = this.collectFeedbackMessageIds(n);
10282
10314
  if (r.length === 0) return;
10283
10315
  let i = await e.feedback.batchFeedbacks(t, r), a = new Map(i.items.map((e) => [String(e.messageId), e])), o = !1, s = n.map((e) => {
10284
- if (e.role !== "agent" || !ic(e.id)) return e;
10316
+ if (e.role !== "agent" || !oc(e.id)) return e;
10285
10317
  let t = a.get(e.id) ?? null, n = e.feedback ?? null;
10286
10318
  return n === null && t === null || n && t && n.rating === t.rating && n.updatedAt === t.updatedAt ? e : (o = !0, {
10287
10319
  ...e,
@@ -10291,17 +10323,17 @@ var vu = class {
10291
10323
  o && this.commitSessionMessages(e, t, s);
10292
10324
  }
10293
10325
  };
10294
- function yu(e) {
10326
+ function xu(e) {
10295
10327
  return e == null ? {} : typeof e == "object" && "aborted" in e && typeof e.addEventListener == "function" ? { signal: e } : e;
10296
10328
  }
10297
- function bu(e) {
10329
+ function Su(e) {
10298
10330
  if (e) return {
10299
10331
  id: String(e.id),
10300
10332
  email: e.email,
10301
10333
  name: e.username
10302
10334
  };
10303
10335
  }
10304
- function xu(e) {
10336
+ function Cu(e) {
10305
10337
  return e instanceof p ? {
10306
10338
  code: e.code,
10307
10339
  message: e.message,
@@ -10312,7 +10344,7 @@ function xu(e) {
10312
10344
  cause: e
10313
10345
  };
10314
10346
  }
10315
- function Su(e) {
10347
+ function wu(e) {
10316
10348
  if (!(e instanceof p)) return;
10317
10349
  let t = e.details;
10318
10350
  if (t) {
@@ -10320,89 +10352,95 @@ function Su(e) {
10320
10352
  if (typeof t.code == "string") return t.code;
10321
10353
  }
10322
10354
  }
10323
- function Cu() {
10324
- return new vu();
10355
+ function Tu(e) {
10356
+ return !(e instanceof p) || e.code !== "TRANSPORT_FAILED" || e.details?.serverCode !== "PAGE_ACTION_ROLLOUT_DENIED" ? e : new p("PAGE_ACTION_ROLLOUT_DENIED", e.message || "PageAction not available for this user", {
10357
+ cause: e,
10358
+ details: e.details
10359
+ });
10360
+ }
10361
+ function Eu() {
10362
+ return new bu();
10325
10363
  }
10326
10364
  //#endregion
10327
10365
  //#region src/core/extension/omnix-extension-client.ts
10328
- function wu() {
10366
+ function Du() {
10329
10367
  if (typeof window > "u") return null;
10330
10368
  let e = window.OmnixExtension;
10331
10369
  return e && typeof e.ping == "function" ? e : null;
10332
10370
  }
10333
- function Tu() {
10334
- return wu() != null;
10371
+ function Ou() {
10372
+ return Du() != null;
10335
10373
  }
10336
- function Eu() {
10374
+ function ku() {
10337
10375
  if (!(typeof window > "u")) try {
10338
10376
  window.dispatchEvent(new CustomEvent(fn));
10339
10377
  } catch {}
10340
10378
  }
10341
- function Du(e = 8e3) {
10342
- return Tu() ? Promise.resolve(!0) : typeof window > "u" ? Promise.resolve(!1) : (Eu(), new Promise((t) => {
10379
+ function Au(e = 8e3) {
10380
+ return Ou() ? Promise.resolve(!0) : typeof window > "u" ? Promise.resolve(!1) : (ku(), new Promise((t) => {
10343
10381
  let n = !1, r = (e) => {
10344
10382
  n || (n = !0, window.removeEventListener(dn, i), clearInterval(a), clearTimeout(o), t(e));
10345
- }, i = () => r(Tu());
10383
+ }, i = () => r(Ou());
10346
10384
  window.addEventListener(dn, i);
10347
10385
  let a = window.setInterval(() => {
10348
- Eu(), Tu() && r(!0);
10349
- }, 500), o = window.setTimeout(() => r(Tu()), e);
10386
+ ku(), Ou() && r(!0);
10387
+ }, 500), o = window.setTimeout(() => r(Ou()), e);
10350
10388
  }));
10351
10389
  }
10352
- async function Ou(e = 3e3) {
10353
- let t = wu() ?? (await Du(e) ? wu() : null);
10390
+ async function ju(e = 3e3) {
10391
+ let t = Du() ?? (await Au(e) ? Du() : null);
10354
10392
  if (!t) throw Error("未检测到 Omnix 浏览器插件。请安装 omnix-token-sync 并刷新页面。");
10355
10393
  return t;
10356
10394
  }
10357
- async function ku(e, t) {
10358
- return t?.requireAuth !== !1 && hn(), e(await Ou(t?.waitMs));
10395
+ async function Mu(e, t) {
10396
+ return t?.requireAuth !== !1 && hn(), e(await ju(t?.waitMs));
10359
10397
  }
10360
- async function Au(e) {
10361
- return ku((e) => e.ping(), {
10398
+ async function Nu(e) {
10399
+ return Mu((e) => e.ping(), {
10362
10400
  ...e,
10363
10401
  requireAuth: !1
10364
10402
  });
10365
10403
  }
10366
- async function ju(e) {
10367
- return ku((e) => e.getStatus(), {
10404
+ async function Pu(e) {
10405
+ return Mu((e) => e.getStatus(), {
10368
10406
  ...e,
10369
10407
  requireAuth: !1
10370
10408
  });
10371
10409
  }
10372
- async function Mu(e) {
10373
- return ku((e) => e.syncPmsIntegration(), e);
10410
+ async function Fu(e) {
10411
+ return Mu((e) => e.syncPmsIntegration(), e);
10374
10412
  }
10375
- async function Nu(e, t) {
10376
- return ku((t) => t.gofo.track(e), {
10413
+ async function Iu(e, t) {
10414
+ return Mu((t) => t.gofo.track(e), {
10377
10415
  ...t,
10378
10416
  requireAuth: !1
10379
10417
  });
10380
10418
  }
10381
- async function Pu(e, t) {
10382
- return ku((t) => t.gofo.start(e), {
10419
+ async function Lu(e, t) {
10420
+ return Mu((t) => t.gofo.start(e), {
10383
10421
  ...t,
10384
10422
  requireAuth: !1
10385
10423
  });
10386
10424
  }
10387
- async function Fu(e, t) {
10388
- return ku((t) => t.gofo.getJob(e), {
10425
+ async function Ru(e, t) {
10426
+ return Mu((t) => t.gofo.getJob(e), {
10389
10427
  ...t,
10390
10428
  requireAuth: !1
10391
10429
  });
10392
10430
  }
10393
- async function Iu(e, t, n) {
10394
- return ku((n) => n.gofo.waitForJob(e, t), {
10431
+ async function zu(e, t, n) {
10432
+ return Mu((n) => n.gofo.waitForJob(e, t), {
10395
10433
  ...n,
10396
10434
  requireAuth: !1
10397
10435
  });
10398
10436
  }
10399
10437
  //#endregion
10400
10438
  //#region src/core/page/page-action-process-view.ts
10401
- function Lu(e) {
10439
+ function Bu(e) {
10402
10440
  return e === "submitting" || e === "launched" || e === "streaming" || e === "awaiting_approval" || e === "awaiting_clarify";
10403
10441
  }
10404
- function Ru(e) {
10405
- let t = e.narrativeItems ?? [], n = Lc(t), r = Lu(e.phase);
10442
+ function Vu(e) {
10443
+ let t = e.narrativeItems ?? [], n = zc(t), r = Bu(e.phase);
10406
10444
  return {
10407
10445
  phase: e.phase,
10408
10446
  loading: e.loading,
@@ -10411,23 +10449,23 @@ function Ru(e) {
10411
10449
  progressLabel: e.progressLabel,
10412
10450
  narrativeItems: t,
10413
10451
  hasProcess: n,
10414
- interestingCount: Rc(t),
10452
+ interestingCount: Bc(t),
10415
10453
  isLive: r,
10416
- headline: Gc(t),
10454
+ headline: qc(t),
10417
10455
  showProcessAffordance: n && r
10418
10456
  };
10419
10457
  }
10420
10458
  //#endregion
10421
10459
  //#region node_modules/.pnpm/dompurify@3.4.14/node_modules/dompurify/dist/purify.es.mjs
10422
- function zu(e, t) {
10460
+ function Hu(e, t) {
10423
10461
  (t == null || t > e.length) && (t = e.length);
10424
10462
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
10425
10463
  return r;
10426
10464
  }
10427
- function Bu(e) {
10465
+ function Uu(e) {
10428
10466
  if (Array.isArray(e)) return e;
10429
10467
  }
10430
- function Vu(e, t) {
10468
+ function Wu(e, t) {
10431
10469
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
10432
10470
  if (n != null) {
10433
10471
  var r, i, a, o, s = [], c = !0, l = !1;
@@ -10445,113 +10483,113 @@ function Vu(e, t) {
10445
10483
  return s;
10446
10484
  }
10447
10485
  }
10448
- function Hu() {
10486
+ function Gu() {
10449
10487
  throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
10450
10488
  }
10451
- function Uu(e, t) {
10452
- return Bu(e) || Vu(e, t) || Wu(e, t) || Hu();
10489
+ function Ku(e, t) {
10490
+ return Uu(e) || Wu(e, t) || qu(e, t) || Gu();
10453
10491
  }
10454
- function Wu(e, t) {
10492
+ function qu(e, t) {
10455
10493
  if (e) {
10456
- if (typeof e == "string") return zu(e, t);
10494
+ if (typeof e == "string") return Hu(e, t);
10457
10495
  var n = {}.toString.call(e).slice(8, -1);
10458
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? zu(e, t) : void 0;
10496
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Hu(e, t) : void 0;
10459
10497
  }
10460
10498
  }
10461
- var Gu = Object.entries, Ku = Object.setPrototypeOf, qu = Object.isFrozen, Ju = Object.getPrototypeOf, Yu = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, Xu = Object.create, Zu = typeof Reflect < "u" && Reflect, Qu = Zu.apply, $u = Zu.construct;
10499
+ var Ju = Object.entries, Yu = Object.setPrototypeOf, Xu = Object.isFrozen, Zu = Object.getPrototypeOf, Qu = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, $u = Object.create, ed = typeof Reflect < "u" && Reflect, td = ed.apply, nd = ed.construct;
10462
10500
  G || (G = function(e) {
10463
10501
  return e;
10464
10502
  }), K || (K = function(e) {
10465
10503
  return e;
10466
- }), Qu || (Qu = function(e, t) {
10504
+ }), td || (td = function(e, t) {
10467
10505
  var n = [...arguments].slice(2);
10468
10506
  return e.apply(t, n);
10469
- }), $u || ($u = function(e) {
10507
+ }), nd || (nd = function(e) {
10470
10508
  return new e(...[...arguments].slice(1));
10471
10509
  });
10472
- var ed = q(Array.prototype.forEach), td = q(Array.prototype.lastIndexOf), nd = q(Array.prototype.pop), rd = q(Array.prototype.push), id = q(Array.prototype.splice), ad = Array.isArray, od = q(String.prototype.toLowerCase), sd = q(String.prototype.toString), cd = q(String.prototype.match), ld = q(String.prototype.replace), ud = q(String.prototype.indexOf), dd = q(String.prototype.trim), fd = q(Number.prototype.toString), pd = q(Boolean.prototype.toString), md = typeof BigInt > "u" ? null : q(BigInt.prototype.toString), hd = typeof Symbol > "u" ? null : q(Symbol.prototype.toString), gd = q(Object.prototype.hasOwnProperty), _d = q(Object.prototype.toString), vd = q(RegExp.prototype.test), yd = bd(TypeError);
10510
+ var rd = q(Array.prototype.forEach), id = q(Array.prototype.lastIndexOf), ad = q(Array.prototype.pop), od = q(Array.prototype.push), sd = q(Array.prototype.splice), cd = Array.isArray, ld = q(String.prototype.toLowerCase), ud = q(String.prototype.toString), dd = q(String.prototype.match), fd = q(String.prototype.replace), pd = q(String.prototype.indexOf), md = q(String.prototype.trim), hd = q(Number.prototype.toString), gd = q(Boolean.prototype.toString), _d = typeof BigInt > "u" ? null : q(BigInt.prototype.toString), vd = typeof Symbol > "u" ? null : q(Symbol.prototype.toString), yd = q(Object.prototype.hasOwnProperty), bd = q(Object.prototype.toString), xd = q(RegExp.prototype.test), Sd = Cd(TypeError);
10473
10511
  function q(e) {
10474
10512
  return function(t) {
10475
10513
  t instanceof RegExp && (t.lastIndex = 0);
10476
10514
  var n = [...arguments].slice(1);
10477
- return Qu(e, t, n);
10515
+ return td(e, t, n);
10478
10516
  };
10479
10517
  }
10480
- function bd(e) {
10518
+ function Cd(e) {
10481
10519
  return function() {
10482
- return $u(e, [...arguments]);
10520
+ return nd(e, [...arguments]);
10483
10521
  };
10484
10522
  }
10485
10523
  function J(e, t) {
10486
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : od;
10487
- if (Ku && Ku(e, null), !ad(t)) return e;
10524
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ld;
10525
+ if (Yu && Yu(e, null), !cd(t)) return e;
10488
10526
  let r = t.length;
10489
10527
  for (; r--;) {
10490
10528
  let i = t[r];
10491
10529
  if (typeof i == "string") {
10492
10530
  let e = n(i);
10493
- e !== i && (qu(t) || (t[r] = e), i = e);
10531
+ e !== i && (Xu(t) || (t[r] = e), i = e);
10494
10532
  }
10495
10533
  e[i] = !0;
10496
10534
  }
10497
10535
  return e;
10498
10536
  }
10499
- function xd(e) {
10500
- for (let t = 0; t < e.length; t++) gd(e, t) || (e[t] = null);
10537
+ function wd(e) {
10538
+ for (let t = 0; t < e.length; t++) yd(e, t) || (e[t] = null);
10501
10539
  return e;
10502
10540
  }
10503
- function Sd(e) {
10504
- let t = Xu(null);
10505
- for (let r of Gu(e)) {
10506
- var n = Uu(r, 2);
10541
+ function Td(e) {
10542
+ let t = $u(null);
10543
+ for (let r of Ju(e)) {
10544
+ var n = Ku(r, 2);
10507
10545
  let i = n[0], a = n[1];
10508
- gd(e, i) && (t[i] = ad(a) ? xd(a) : a && typeof a == "object" && a.constructor === Object ? Sd(a) : a);
10546
+ yd(e, i) && (t[i] = cd(a) ? wd(a) : a && typeof a == "object" && a.constructor === Object ? Td(a) : a);
10509
10547
  }
10510
10548
  return t;
10511
10549
  }
10512
- function Cd(e) {
10550
+ function Ed(e) {
10513
10551
  switch (typeof e) {
10514
10552
  case "string": return e;
10515
- case "number": return fd(e);
10516
- case "boolean": return pd(e);
10517
- case "bigint": return md ? md(e) : "0";
10518
- case "symbol": return hd ? hd(e) : "Symbol()";
10519
- case "undefined": return _d(e);
10553
+ case "number": return hd(e);
10554
+ case "boolean": return gd(e);
10555
+ case "bigint": return _d ? _d(e) : "0";
10556
+ case "symbol": return vd ? vd(e) : "Symbol()";
10557
+ case "undefined": return bd(e);
10520
10558
  case "function":
10521
10559
  case "object": {
10522
- if (e === null) return _d(e);
10523
- let t = e, n = wd(t, "toString");
10560
+ if (e === null) return bd(e);
10561
+ let t = e, n = Dd(t, "toString");
10524
10562
  if (typeof n == "function") {
10525
10563
  let e = n(t);
10526
- return typeof e == "string" ? e : _d(e);
10564
+ return typeof e == "string" ? e : bd(e);
10527
10565
  }
10528
- return _d(e);
10566
+ return bd(e);
10529
10567
  }
10530
- default: return _d(e);
10568
+ default: return bd(e);
10531
10569
  }
10532
10570
  }
10533
- function wd(e, t) {
10571
+ function Dd(e, t) {
10534
10572
  for (; e !== null;) {
10535
- let n = Yu(e, t);
10573
+ let n = Qu(e, t);
10536
10574
  if (n) {
10537
10575
  if (n.get) return q(n.get);
10538
10576
  if (typeof n.value == "function") return q(n.value);
10539
10577
  }
10540
- e = Ju(e);
10578
+ e = Zu(e);
10541
10579
  }
10542
10580
  function n() {
10543
10581
  return null;
10544
10582
  }
10545
10583
  return n;
10546
10584
  }
10547
- function Td(e) {
10585
+ function Od(e) {
10548
10586
  try {
10549
- return vd(e, ""), !0;
10587
+ return xd(e, ""), !0;
10550
10588
  } catch {
10551
10589
  return !1;
10552
10590
  }
10553
10591
  }
10554
- var Ed = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Dd = G(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Od = G([
10592
+ var kd = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Ad = G(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), jd = G([
10555
10593
  "feBlend",
10556
10594
  "feColorMatrix",
10557
10595
  "feComponentTransfer",
@@ -10577,7 +10615,7 @@ var Ed = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
10577
10615
  "feSpotLight",
10578
10616
  "feTile",
10579
10617
  "feTurbulence"
10580
- ]), kd = G([
10618
+ ]), Md = G([
10581
10619
  "animate",
10582
10620
  "color-profile",
10583
10621
  "cursor",
@@ -10600,7 +10638,7 @@ var Ed = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
10600
10638
  "solidcolor",
10601
10639
  "unknown",
10602
10640
  "use"
10603
- ]), Ad = G(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), jd = G([
10641
+ ]), Nd = G(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Pd = G([
10604
10642
  "maction",
10605
10643
  "maligngroup",
10606
10644
  "malignmark",
@@ -10616,13 +10654,13 @@ var Ed = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
10616
10654
  "annotation-xml",
10617
10655
  "mprescripts",
10618
10656
  "none"
10619
- ]), Md = G(["#text"]), Nd = G(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Pd = G(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Fd = G(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Id = G([
10657
+ ]), Fd = G(["#text"]), Id = G(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Ld = G(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Rd = G(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), zd = G([
10620
10658
  "xlink:href",
10621
10659
  "xml:id",
10622
10660
  "xlink:title",
10623
10661
  "xml:space",
10624
10662
  "xmlns:xlink"
10625
- ]), Ld = K(/{{[\w\W]*|^[\w\W]*}}/g), Rd = K(/<%[\w\W]*|^[\w\W]*%>/g), zd = K(/\${[\w\W]*/g), Bd = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), Vd = K(/^aria-[\-\w]+$/), Hd = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Ud = K(/^(?:\w+script|data):/i), Wd = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Gd = K(/^html$/i), Kd = K(/^[a-z][.\w]*(-[.\w]+)+$/i), qd = K(/<[/\w!]/g), Jd = K(/<[/\w]/g), Yd = K(/<\/no(script|embed|frames)/i), Xd = K(/\/>/i), Zd = {
10663
+ ]), Bd = K(/{{[\w\W]*|^[\w\W]*}}/g), Vd = K(/<%[\w\W]*|^[\w\W]*%>/g), Hd = K(/\${[\w\W]*/g), Ud = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), Wd = K(/^aria-[\-\w]+$/), Gd = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Kd = K(/^(?:\w+script|data):/i), qd = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Jd = K(/^html$/i), Yd = K(/^[a-z][.\w]*(-[.\w]+)+$/i), Xd = K(/<[/\w!]/g), Zd = K(/<[/\w]/g), Qd = K(/<\/no(script|embed|frames)/i), $d = K(/\/>/i), ef = {
10626
10664
  element: 1,
10627
10665
  attribute: 2,
10628
10666
  text: 3,
@@ -10635,7 +10673,7 @@ var Ed = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
10635
10673
  documentType: 10,
10636
10674
  documentFragment: 11,
10637
10675
  notation: 12
10638
- }, Qd = [
10676
+ }, tf = [
10639
10677
  "style",
10640
10678
  "script",
10641
10679
  "xmp",
@@ -10644,14 +10682,14 @@ var Ed = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
10644
10682
  "noframes",
10645
10683
  "plaintext",
10646
10684
  "noscript"
10647
- ], $d = G(J({}, Qd)), ef = function() {
10685
+ ], nf = G(J({}, tf)), rf = function() {
10648
10686
  let e = {};
10649
- return ed(Qd, (t) => {
10687
+ return rd(tf, (t) => {
10650
10688
  e[t] = K(RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
10651
10689
  }), G(e);
10652
- }(), tf = function() {
10690
+ }(), af = function() {
10653
10691
  return typeof window > "u" ? null : window;
10654
- }, nf = function(e, t) {
10692
+ }, of = function(e, t) {
10655
10693
  if (typeof e != "object" || typeof e.createPolicy != "function") return null;
10656
10694
  let n = null, r = "data-tt-policy-suffix";
10657
10695
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
@@ -10668,7 +10706,7 @@ var Ed = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
10668
10706
  } catch {
10669
10707
  return console.warn("TrustedTypes policy " + i + " could not be created."), null;
10670
10708
  }
10671
- }, rf = function() {
10709
+ }, sf = function() {
10672
10710
  return {
10673
10711
  afterSanitizeAttributes: [],
10674
10712
  afterSanitizeElements: [],
@@ -10680,20 +10718,20 @@ var Ed = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
10680
10718
  uponSanitizeElement: [],
10681
10719
  uponSanitizeShadowNode: []
10682
10720
  };
10683
- }, af = function(e, t, n, r) {
10684
- return gd(e, t) && ad(e[t]) ? J(r.base ? Sd(r.base) : {}, e[t], r.transform) : n;
10685
- }, of = function(e, t, n) {
10686
- let r = gd(e, t) ? e[t] : void 0;
10687
- return r && typeof r == "object" ? Sd(r) : n();
10721
+ }, cf = function(e, t, n, r) {
10722
+ return yd(e, t) && cd(e[t]) ? J(r.base ? Td(r.base) : {}, e[t], r.transform) : n;
10723
+ }, lf = function(e, t, n) {
10724
+ let r = yd(e, t) ? e[t] : void 0;
10725
+ return r && typeof r == "object" ? Td(r) : n();
10688
10726
  };
10689
- function sf() {
10690
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : tf(), t = (e) => sf(e);
10691
- if (t.version = "3.4.14", t.removed = [], !e || !e.document || e.document.nodeType !== Zd.document || !e.Element) return t.isSupported = !1, t;
10727
+ function uf() {
10728
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : af(), t = (e) => uf(e);
10729
+ if (t.version = "3.4.14", t.removed = [], !e || !e.document || e.document.nodeType !== ef.document || !e.Element) return t.isSupported = !1, t;
10692
10730
  let n = e.document, r = n, i = r.currentScript;
10693
10731
  e.DocumentFragment;
10694
10732
  let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
10695
10733
  e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
10696
- let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = wd(d, "cloneNode"), p = wd(d, "remove"), ee = wd(d, "nextSibling"), m = wd(d, "childNodes"), te = wd(d, "parentNode"), ne = wd(d, "shadowRoot"), h = wd(d, "attributes"), re = o && o.prototype ? wd(o.prototype, "nodeType") : null, g = o && o.prototype ? wd(o.prototype, "nodeName") : null, _ = o && o.prototype ? wd(o.prototype, "ownerDocument") : null, ie = function(e) {
10734
+ let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Dd(d, "cloneNode"), p = Dd(d, "remove"), ee = Dd(d, "nextSibling"), m = Dd(d, "childNodes"), te = Dd(d, "parentNode"), ne = Dd(d, "shadowRoot"), h = Dd(d, "attributes"), re = o && o.prototype ? Dd(o.prototype, "nodeType") : null, g = o && o.prototype ? Dd(o.prototype, "nodeName") : null, _ = o && o.prototype ? Dd(o.prototype, "ownerDocument") : null, ie = function(e) {
10697
10735
  return re ? re(e) : e.nodeType;
10698
10736
  }, ae = function(e) {
10699
10737
  return g ? g(e) : e.nodeName;
@@ -10703,7 +10741,7 @@ function sf() {
10703
10741
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
10704
10742
  }
10705
10743
  let v, oe = "", se, ce = !1, y = 0, le = function() {
10706
- if (y > 0) throw yd("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
10744
+ if (y > 0) throw Sd("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
10707
10745
  }, ue = function(e) {
10708
10746
  le(), y++;
10709
10747
  try {
@@ -10719,21 +10757,21 @@ function sf() {
10719
10757
  y--;
10720
10758
  }
10721
10759
  }, fe = function() {
10722
- return ce || (se = nf(u, i), ce = !0), se;
10723
- }, b = n, x = b.implementation, pe = b.createNodeIterator, me = b.createDocumentFragment, he = b.getElementsByTagName, ge = r.importNode, S = rf();
10724
- t.isSupported = typeof Gu == "function" && typeof te == "function" && x && x.createHTMLDocument !== void 0;
10725
- let _e = Ld, ve = Rd, ye = zd, be = Bd, xe = Vd, Se = Ud, Ce = Wd, we = Kd, Te = Hd, C = null, Ee = J({}, [
10726
- ...Ed,
10727
- ...Dd,
10728
- ...Od,
10760
+ return ce || (se = of(u, i), ce = !0), se;
10761
+ }, b = n, x = b.implementation, pe = b.createNodeIterator, me = b.createDocumentFragment, he = b.getElementsByTagName, ge = r.importNode, S = sf();
10762
+ t.isSupported = typeof Ju == "function" && typeof te == "function" && x && x.createHTMLDocument !== void 0;
10763
+ let _e = Bd, ve = Vd, ye = Hd, be = Ud, xe = Wd, Se = Kd, Ce = qd, we = Yd, Te = Gd, C = null, Ee = J({}, [
10764
+ ...kd,
10729
10765
  ...Ad,
10730
- ...Md
10731
- ]), w = null, De = J({}, [
10766
+ ...jd,
10732
10767
  ...Nd,
10733
- ...Pd,
10734
- ...Fd,
10735
- ...Id
10736
- ]), T = Object.seal(Xu(null, {
10768
+ ...Fd
10769
+ ]), w = null, De = J({}, [
10770
+ ...Id,
10771
+ ...Ld,
10772
+ ...Rd,
10773
+ ...zd
10774
+ ]), T = Object.seal($u(null, {
10737
10775
  tagNameCheck: {
10738
10776
  writable: !0,
10739
10777
  configurable: !1,
@@ -10752,7 +10790,7 @@ function sf() {
10752
10790
  enumerable: !0,
10753
10791
  value: !1
10754
10792
  }
10755
- })), Oe = null, ke = null, E = Object.seal(Xu(null, {
10793
+ })), Oe = null, ke = null, E = Object.seal($u(null, {
10756
10794
  tagCheck: {
10757
10795
  writable: !0,
10758
10796
  configurable: !1,
@@ -10791,7 +10829,7 @@ function sf() {
10791
10829
  nt,
10792
10830
  rt,
10793
10831
  it
10794
- ], sd), lt = G([
10832
+ ], ud), lt = G([
10795
10833
  "mi",
10796
10834
  "mo",
10797
10835
  "mn",
@@ -10808,21 +10846,21 @@ function sf() {
10808
10846
  }, k = function() {
10809
10847
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
10810
10848
  if (ht && ht === e) return;
10811
- (!e || typeof e != "object") && (e = {}), e = Sd(e), D = mt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, O = D === "application/xhtml+xml" ? sd : od, C = af(e, "ALLOWED_TAGS", Ee, { transform: O }), w = af(e, "ALLOWED_ATTR", De, { transform: O }), st = af(e, "ALLOWED_NAMESPACES", ct, { transform: sd }), et = af(e, "ADD_URI_SAFE_ATTR", tt, {
10849
+ (!e || typeof e != "object") && (e = {}), e = Td(e), D = mt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, O = D === "application/xhtml+xml" ? ud : ld, C = cf(e, "ALLOWED_TAGS", Ee, { transform: O }), w = cf(e, "ALLOWED_ATTR", De, { transform: O }), st = cf(e, "ALLOWED_NAMESPACES", ct, { transform: ud }), et = cf(e, "ADD_URI_SAFE_ATTR", tt, {
10812
10850
  transform: O,
10813
10851
  base: tt
10814
- }), Qe = af(e, "ADD_DATA_URI_TAGS", $e, {
10852
+ }), Qe = cf(e, "ADD_DATA_URI_TAGS", $e, {
10815
10853
  transform: O,
10816
10854
  base: $e
10817
- }), Xe = af(e, "FORBID_CONTENTS", Ze, { transform: O }), Oe = af(e, "FORBID_TAGS", Sd({}), { transform: O }), ke = af(e, "FORBID_ATTR", Sd({}), { transform: O }), Ye = gd(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Sd(e.USE_PROFILES) : e.USE_PROFILES : !1, Ae = e.ALLOW_ARIA_ATTR !== !1, je = e.ALLOW_DATA_ATTR !== !1, Me = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Pe = e.SAFE_FOR_TEMPLATES || !1, Fe = e.SAFE_FOR_XML !== !1, Ie = e.WHOLE_DOCUMENT || !1, Ve = e.RETURN_DOM || !1, He = e.RETURN_DOM_FRAGMENT || !1, Ue = e.RETURN_TRUSTED_TYPE || !1, Be = e.FORCE_BODY || !1, We = e.SANITIZE_DOM !== !1, Ge = e.SANITIZE_NAMED_PROPS || !1, qe = e.KEEP_CONTENT !== !1, Je = e.IN_PLACE || !1, Te = Td(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Hd, at = typeof e.NAMESPACE == "string" ? e.NAMESPACE : it, ut = of(e, "MATHML_TEXT_INTEGRATION_POINTS", () => J({}, lt)), ft = of(e, "HTML_INTEGRATION_POINTS", () => J({}, dt));
10818
- let t = of(e, "CUSTOM_ELEMENT_HANDLING", () => Xu(null));
10819
- if (T = Xu(null), gd(t, "tagNameCheck") && _t(t.tagNameCheck) && (T.tagNameCheck = t.tagNameCheck), gd(t, "attributeNameCheck") && _t(t.attributeNameCheck) && (T.attributeNameCheck = t.attributeNameCheck), gd(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (T.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(T), Pe && (je = !1), He && (Ve = !0), Ye && (C = J({}, Md), w = Xu(null), Ye.html === !0 && (J(C, Ed), J(w, Nd)), Ye.svg === !0 && (J(C, Dd), J(w, Pd), J(w, Id)), Ye.svgFilters === !0 && (J(C, Od), J(w, Pd), J(w, Id)), Ye.mathMl === !0 && (J(C, Ad), J(w, Fd), J(w, Id))), E.tagCheck = null, E.attributeCheck = null, gd(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? E.tagCheck = e.ADD_TAGS : ad(e.ADD_TAGS) && (C === Ee && (C = Sd(C)), J(C, e.ADD_TAGS, O))), gd(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? E.attributeCheck = e.ADD_ATTR : ad(e.ADD_ATTR) && (w === De && (w = Sd(w)), J(w, e.ADD_ATTR, O))), gd(e, "ADD_FORBID_CONTENTS") && ad(e.ADD_FORBID_CONTENTS) && (Xe === Ze && (Xe = Sd(Xe)), J(Xe, e.ADD_FORBID_CONTENTS, O)), qe && (C["#text"] = !0), Ie && J(C, [
10855
+ }), Xe = cf(e, "FORBID_CONTENTS", Ze, { transform: O }), Oe = cf(e, "FORBID_TAGS", Td({}), { transform: O }), ke = cf(e, "FORBID_ATTR", Td({}), { transform: O }), Ye = yd(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Td(e.USE_PROFILES) : e.USE_PROFILES : !1, Ae = e.ALLOW_ARIA_ATTR !== !1, je = e.ALLOW_DATA_ATTR !== !1, Me = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ne = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Pe = e.SAFE_FOR_TEMPLATES || !1, Fe = e.SAFE_FOR_XML !== !1, Ie = e.WHOLE_DOCUMENT || !1, Ve = e.RETURN_DOM || !1, He = e.RETURN_DOM_FRAGMENT || !1, Ue = e.RETURN_TRUSTED_TYPE || !1, Be = e.FORCE_BODY || !1, We = e.SANITIZE_DOM !== !1, Ge = e.SANITIZE_NAMED_PROPS || !1, qe = e.KEEP_CONTENT !== !1, Je = e.IN_PLACE || !1, Te = Od(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Gd, at = typeof e.NAMESPACE == "string" ? e.NAMESPACE : it, ut = lf(e, "MATHML_TEXT_INTEGRATION_POINTS", () => J({}, lt)), ft = lf(e, "HTML_INTEGRATION_POINTS", () => J({}, dt));
10856
+ let t = lf(e, "CUSTOM_ELEMENT_HANDLING", () => $u(null));
10857
+ if (T = $u(null), yd(t, "tagNameCheck") && _t(t.tagNameCheck) && (T.tagNameCheck = t.tagNameCheck), yd(t, "attributeNameCheck") && _t(t.attributeNameCheck) && (T.attributeNameCheck = t.attributeNameCheck), yd(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (T.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(T), Pe && (je = !1), He && (Ve = !0), Ye && (C = J({}, Fd), w = $u(null), Ye.html === !0 && (J(C, kd), J(w, Id)), Ye.svg === !0 && (J(C, Ad), J(w, Ld), J(w, zd)), Ye.svgFilters === !0 && (J(C, jd), J(w, Ld), J(w, zd)), Ye.mathMl === !0 && (J(C, Nd), J(w, Rd), J(w, zd))), E.tagCheck = null, E.attributeCheck = null, yd(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? E.tagCheck = e.ADD_TAGS : cd(e.ADD_TAGS) && (C === Ee && (C = Td(C)), J(C, e.ADD_TAGS, O))), yd(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? E.attributeCheck = e.ADD_ATTR : cd(e.ADD_ATTR) && (w === De && (w = Td(w)), J(w, e.ADD_ATTR, O))), yd(e, "ADD_FORBID_CONTENTS") && cd(e.ADD_FORBID_CONTENTS) && (Xe === Ze && (Xe = Td(Xe)), J(Xe, e.ADD_FORBID_CONTENTS, O)), qe && (C["#text"] = !0), Ie && J(C, [
10820
10858
  "html",
10821
10859
  "head",
10822
10860
  "body"
10823
10861
  ]), C.table && (J(C, ["tbody"]), delete Oe.tbody), e.TRUSTED_TYPES_POLICY) {
10824
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw yd("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
10825
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw yd("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
10862
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Sd("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
10863
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Sd("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
10826
10864
  let t = v;
10827
10865
  v = e.TRUSTED_TYPES_POLICY;
10828
10866
  try {
@@ -10833,10 +10871,10 @@ function sf() {
10833
10871
  } else e.TRUSTED_TYPES_POLICY === null ? (v = void 0, oe = "") : (v === void 0 && (v = fe()), v && typeof oe == "string" && (oe = ue("")));
10834
10872
  G && G(e), ht = e;
10835
10873
  }, A = J({}, [
10836
- ...Dd,
10837
- ...Od,
10838
- ...kd
10839
- ]), vt = J({}, [...Ad, ...jd]), yt = function(e, t, n) {
10874
+ ...Ad,
10875
+ ...jd,
10876
+ ...Md
10877
+ ]), vt = J({}, [...Nd, ...Pd]), yt = function(e, t, n) {
10840
10878
  return t.namespaceURI === it ? e === "svg" : t.namespaceURI === nt ? e === "svg" && (n === "annotation-xml" || ut[n]) : !!A[e];
10841
10879
  }, bt = function(e, t, n) {
10842
10880
  return t.namespaceURI === it ? e === "math" : t.namespaceURI === rt ? e === "math" && ft[n] : !!vt[e];
@@ -10848,14 +10886,14 @@ function sf() {
10848
10886
  namespaceURI: at,
10849
10887
  tagName: "template"
10850
10888
  });
10851
- let n = od(e.tagName), r = od(t.tagName);
10889
+ let n = ld(e.tagName), r = ld(t.tagName);
10852
10890
  return st[e.namespaceURI] ? e.namespaceURI === rt ? yt(n, t, r) : e.namespaceURI === nt ? bt(n, t, r) : e.namespaceURI === it ? j(n, t, r) : !!(D === "application/xhtml+xml" && st[e.namespaceURI]) : !1;
10853
10891
  }, St = function(e) {
10854
- rd(t.removed, { element: e });
10892
+ od(t.removed, { element: e });
10855
10893
  try {
10856
10894
  te(e).removeChild(e);
10857
10895
  } catch {
10858
- if (p(e), !te(e)) throw yd("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
10896
+ if (p(e), !te(e)) throw Sd("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
10859
10897
  }
10860
10898
  }, Ct = function(e, t, n) {
10861
10899
  try {
@@ -10870,9 +10908,9 @@ function sf() {
10870
10908
  let t = m(e);
10871
10909
  if (t) {
10872
10910
  let e = [];
10873
- ed(t, (t) => {
10874
- rd(e, t);
10875
- }), ed(e, (e) => {
10911
+ rd(t, (t) => {
10912
+ od(e, t);
10913
+ }), rd(e, (e) => {
10876
10914
  try {
10877
10915
  p(e);
10878
10916
  } catch {}
@@ -10889,7 +10927,7 @@ function sf() {
10889
10927
  } catch {
10890
10928
  r = null;
10891
10929
  }
10892
- rd(t.removed, {
10930
+ od(t.removed, {
10893
10931
  attribute: r || null,
10894
10932
  from: n
10895
10933
  });
@@ -10918,7 +10956,7 @@ function sf() {
10918
10956
  let t = [e];
10919
10957
  for (; t.length > 0;) {
10920
10958
  let e = t.pop();
10921
- ie(e) === Zd.element && Et(e);
10959
+ ie(e) === ef.element && Et(e);
10922
10960
  let n = m(e);
10923
10961
  if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
10924
10962
  }
@@ -10929,13 +10967,13 @@ function sf() {
10929
10967
  let t = [e];
10930
10968
  for (; t.length > 0;) {
10931
10969
  let e = t.pop(), n = ie(e);
10932
- if (n === Zd.processingInstruction || n === Zd.comment && vd(Jd, e.data)) {
10970
+ if (n === ef.processingInstruction || n === ef.comment && xd(Zd, e.data)) {
10933
10971
  try {
10934
10972
  p(e);
10935
10973
  } catch {}
10936
10974
  continue;
10937
10975
  }
10938
- if (n === Zd.element) {
10976
+ if (n === ef.element) {
10939
10977
  let t = e, n = O(ae(e));
10940
10978
  try {
10941
10979
  t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Ot("for", n) && t.removeAttribute("for");
@@ -10948,7 +10986,7 @@ function sf() {
10948
10986
  let t = null, r = null;
10949
10987
  if (Be) e = "<remove></remove>" + e;
10950
10988
  else {
10951
- let t = cd(e, /^[\r\n\t ]+/);
10989
+ let t = dd(e, /^[\r\n\t ]+/);
10952
10990
  r = t && t[0];
10953
10991
  }
10954
10992
  D === "application/xhtml+xml" && at === it && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
@@ -10968,13 +11006,13 @@ function sf() {
10968
11006
  let t = _ ? _(e) : e.ownerDocument;
10969
11007
  return pe.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
10970
11008
  }, Mt = function(e) {
10971
- return e = ld(e, _e, " "), e = ld(e, ve, " "), e = ld(e, ye, " "), e;
11009
+ return e = fd(e, _e, " "), e = fd(e, ve, " "), e = fd(e, ye, " "), e;
10972
11010
  }, Nt = function(e) {
10973
11011
  e.normalize();
10974
11012
  let t = _ ? _(e) : e.ownerDocument, n = pe.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
10975
11013
  for (; r;) r.data = Mt(r.data), r = n.nextNode();
10976
11014
  let i = e.querySelectorAll?.call(e, "template");
10977
- i && ed(i, (e) => {
11015
+ i && rd(i, (e) => {
10978
11016
  Ft(e.content) && Nt(e.content);
10979
11017
  });
10980
11018
  }, Pt = function(e) {
@@ -10983,7 +11021,7 @@ function sf() {
10983
11021
  }, Ft = function(e) {
10984
11022
  if (!re || typeof e != "object" || !e) return !1;
10985
11023
  try {
10986
- return re(e) === Zd.documentFragment;
11024
+ return re(e) === ef.documentFragment;
10987
11025
  } catch {
10988
11026
  return !1;
10989
11027
  }
@@ -10996,14 +11034,14 @@ function sf() {
10996
11034
  }
10997
11035
  };
10998
11036
  function Lt(e, n, r) {
10999
- e.length !== 0 && ed(e, (e) => {
11037
+ e.length !== 0 && rd(e, (e) => {
11000
11038
  e.call(t, n, r, ht);
11001
11039
  });
11002
11040
  }
11003
11041
  let Rt = function(e, t) {
11004
- return !!(Fe && e.hasChildNodes() && !It(e.firstElementChild) && vd(qd, e.textContent) && vd(qd, e.innerHTML) || Fe && e.namespaceURI === it && $d[t] && (It(e.firstElementChild) || typeof e.textContent == "string" && vd(ef[t], e.textContent)) || e.nodeType === Zd.processingInstruction || Fe && e.nodeType === Zd.comment && vd(Jd, e.data));
11042
+ return !!(Fe && e.hasChildNodes() && !It(e.firstElementChild) && xd(Xd, e.textContent) && xd(Xd, e.innerHTML) || Fe && e.namespaceURI === it && nf[t] && (It(e.firstElementChild) || typeof e.textContent == "string" && xd(rf[t], e.textContent)) || e.nodeType === ef.processingInstruction || Fe && e.nodeType === ef.comment && xd(Zd, e.data));
11005
11043
  }, zt = function(e, t) {
11006
- return e instanceof RegExp ? vd(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
11044
+ return e instanceof RegExp ? xd(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
11007
11045
  }, Bt = function(e, t, n) {
11008
11046
  if (!Oe[t] && Kt(t) && zt(T.tagNameCheck, t)) return !1;
11009
11047
  if (qe && !Xe[t]) {
@@ -11018,7 +11056,7 @@ function sf() {
11018
11056
  }
11019
11057
  return St(e), !0;
11020
11058
  }, Vt = function(e, t, n, r) {
11021
- return e.length === 0 ? t : t === n || t === r ? Sd(t) : t;
11059
+ return e.length === 0 ? t : t === n || t === r ? Td(t) : t;
11022
11060
  }, Ht = function(e, t) {
11023
11061
  return e === t || te(e) !== null ? !1 : (Je && Dt(e), !0);
11024
11062
  }, Ut = function(e, n) {
@@ -11034,16 +11072,16 @@ function sf() {
11034
11072
  let t = Bt(e, r, n);
11035
11073
  return t === !1 && Lt(S.afterSanitizeElements, e, null), t;
11036
11074
  }
11037
- if (ie(e) === Zd.element && !xt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && vd(Yd, e.innerHTML)) return St(e), !0;
11038
- if (Pe && e.nodeType === Zd.text) {
11075
+ if (ie(e) === ef.element && !xt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && xd(Qd, e.innerHTML)) return St(e), !0;
11076
+ if (Pe && e.nodeType === ef.text) {
11039
11077
  let n = Mt(e.textContent);
11040
- e.textContent !== n && (rd(t.removed, { element: e.cloneNode() }), e.textContent = n);
11078
+ e.textContent !== n && (od(t.removed, { element: e.cloneNode() }), e.textContent = n);
11041
11079
  }
11042
11080
  return Lt(S.afterSanitizeElements, e, null), !1;
11043
11081
  }, Wt = function(e, t, r) {
11044
11082
  if (ke[t] || Ot(t, e) || We && (t === "id" || t === "name") && (r in n || r in gt)) return !1;
11045
11083
  let i = w[t] || E.attributeCheck instanceof Function && E.attributeCheck(t, e);
11046
- return je && vd(be, t) || Ae && vd(xe, t) ? !0 : i ? et[t] || vd(Te, ld(r, Ce, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && ud(r, "data:") === 0 && Qe[e] || Me && !vd(Se, ld(r, Ce, "")) ? !0 : !r : Kt(e) && zt(T.tagNameCheck, e) && zt(T.attributeNameCheck, t, e) || t === "is" && T.allowCustomizedBuiltInElements && zt(T.tagNameCheck, r);
11084
+ return je && xd(be, t) || Ae && xd(xe, t) ? !0 : i ? et[t] || xd(Te, fd(r, Ce, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && pd(r, "data:") === 0 && Qe[e] || Me && !xd(Se, fd(r, Ce, "")) ? !0 : !r : Kt(e) && zt(T.tagNameCheck, e) && zt(T.attributeNameCheck, t, e) || t === "is" && T.allowCustomizedBuiltInElements && zt(T.tagNameCheck, r);
11047
11085
  }, Gt = J({}, [
11048
11086
  "annotation-xml",
11049
11087
  "color-profile",
@@ -11054,7 +11092,7 @@ function sf() {
11054
11092
  "font-face-uri",
11055
11093
  "missing-glyph"
11056
11094
  ]), Kt = function(e) {
11057
- return !Gt[od(e)] && vd(we, e);
11095
+ return !Gt[ld(e)] && xd(we, e);
11058
11096
  }, qt = function(e, t, n, r) {
11059
11097
  if (v && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
11060
11098
  case "TrustedHTML": return ue(r);
@@ -11063,7 +11101,7 @@ function sf() {
11063
11101
  return r;
11064
11102
  }, Jt = function(e, n, r, i) {
11065
11103
  try {
11066
- r ? e.setAttributeNS(r, n, i) : e.setAttribute(n, i), Pt(e) ? St(e) : nd(t.removed);
11104
+ r ? e.setAttributeNS(r, n, i) : e.setAttribute(n, i), Pt(e) ? St(e) : ad(t.removed);
11067
11105
  } catch {
11068
11106
  Tt(n, e);
11069
11107
  }
@@ -11080,12 +11118,12 @@ function sf() {
11080
11118
  forceKeepAttr: void 0
11081
11119
  }, r = t.length, i = O(e.nodeName);
11082
11120
  for (; r--;) {
11083
- let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, l = O(o), u = c, d = o === "value" ? u : dd(u);
11084
- if (n.attrName = l, n.attrValue = d, n.keepAttr = !0, n.forceKeepAttr = void 0, Lt(S.uponSanitizeAttribute, e, n), d = n.attrValue, Ge && (l === "id" || l === "name") && ud(d, Ke) !== 0 && (Tt(o, e, a), d = Ke + d), Fe && vd(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
11121
+ let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, l = O(o), u = c, d = o === "value" ? u : md(u);
11122
+ if (n.attrName = l, n.attrValue = d, n.keepAttr = !0, n.forceKeepAttr = void 0, Lt(S.uponSanitizeAttribute, e, n), d = n.attrValue, Ge && (l === "id" || l === "name") && pd(d, Ke) !== 0 && (Tt(o, e, a), d = Ke + d), Fe && xd(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
11085
11123
  Tt(o, e, a);
11086
11124
  continue;
11087
11125
  }
11088
- if (l === "attributename" && cd(d, "href")) {
11126
+ if (l === "attributename" && dd(d, "href")) {
11089
11127
  Tt(o, e, a);
11090
11128
  continue;
11091
11129
  }
@@ -11094,7 +11132,7 @@ function sf() {
11094
11132
  Tt(o, e, a);
11095
11133
  continue;
11096
11134
  }
11097
- if (!Ne && vd(Xd, d)) {
11135
+ if (!Ne && xd($d, d)) {
11098
11136
  Tt(o, e, a);
11099
11137
  continue;
11100
11138
  }
@@ -11108,7 +11146,7 @@ function sf() {
11108
11146
  Lt(S.afterSanitizeAttributes, e, null);
11109
11147
  }, Xt = function(e) {
11110
11148
  let t = null, n = jt(e);
11111
- for (Lt(S.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (Lt(S.uponSanitizeShadowNode, t, null), Ut(t, e), Yt(t), Ft(t.content) && Xt(t.content), ie(t) === Zd.element) {
11149
+ for (Lt(S.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (Lt(S.uponSanitizeShadowNode, t, null), Ut(t, e), Yt(t), Ft(t.content) && Xt(t.content), ie(t) === ef.element) {
11112
11150
  let e = ne(t);
11113
11151
  Ft(e) && (Zt(e), Xt(e));
11114
11152
  }
@@ -11124,7 +11162,7 @@ function sf() {
11124
11162
  Xt(e.shadow);
11125
11163
  continue;
11126
11164
  }
11127
- let n = e.node, r = ie(n) === Zd.element, i = m(n);
11165
+ let n = e.node, r = ie(n) === ef.element, i = m(n);
11128
11166
  if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
11129
11167
  node: i[e],
11130
11168
  shadow: null
@@ -11153,24 +11191,24 @@ function sf() {
11153
11191
  };
11154
11192
  return t.sanitize = function(e) {
11155
11193
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
11156
- if (ot = !e, ot && (e = "<!-->"), typeof e != "string" && !It(e) && (e = Cd(e), typeof e != "string")) throw yd("dirty is not a string, aborting");
11194
+ if (ot = !e, ot && (e = "<!-->"), typeof e != "string" && !It(e) && (e = Ed(e), typeof e != "string")) throw Sd("dirty is not a string, aborting");
11157
11195
  if (!t.isSupported) return e;
11158
- Le ? (C = Re, w = ze) : k(n), (S.uponSanitizeElement.length > 0 || S.uponSanitizeAttribute.length > 0) && (C = Sd(C)), S.uponSanitizeAttribute.length > 0 && (w = Sd(w)), t.removed = [];
11196
+ Le ? (C = Re, w = ze) : k(n), (S.uponSanitizeElement.length > 0 || S.uponSanitizeAttribute.length > 0) && (C = Td(C)), S.uponSanitizeAttribute.length > 0 && (w = Td(w)), t.removed = [];
11159
11197
  let c = Je && typeof e != "string" && It(e);
11160
11198
  if (c) {
11161
11199
  kt(e);
11162
11200
  let t = ae(e);
11163
11201
  if (typeof t == "string") {
11164
11202
  let n = O(t);
11165
- if (!C[n] || Oe[n]) throw wt(e), yd("root node is forbidden and cannot be sanitized in-place");
11203
+ if (!C[n] || Oe[n]) throw wt(e), Sd("root node is forbidden and cannot be sanitized in-place");
11166
11204
  }
11167
- if (Pt(e)) throw wt(e), yd("root node is clobbered and cannot be sanitized in-place");
11205
+ if (Pt(e)) throw wt(e), Sd("root node is clobbered and cannot be sanitized in-place");
11168
11206
  try {
11169
11207
  Zt(e);
11170
11208
  } catch (t) {
11171
11209
  throw wt(e), t;
11172
11210
  }
11173
- } else if (It(e)) i = At("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === Zd.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Zt(a);
11211
+ } else if (It(e)) i = At("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === ef.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Zt(a);
11174
11212
  else {
11175
11213
  if (!Ve && !Pe && !Ie && e.indexOf("<") === -1) return v && Ue ? ue(e) : e;
11176
11214
  if (i = At(e), !i) return Ve ? null : Ue ? oe : "";
@@ -11181,11 +11219,11 @@ function sf() {
11181
11219
  let e = jt(l);
11182
11220
  for (; o = e.nextNode();) Ut(o, l), Yt(o), Ft(o.content) && Xt(o.content);
11183
11221
  } catch (n) {
11184
- throw c && (wt(e), ed(t.removed, (e) => {
11222
+ throw c && (wt(e), rd(t.removed, (e) => {
11185
11223
  e.element && Dt(e.element);
11186
11224
  })), n;
11187
11225
  }
11188
- if (c) return ed(t.removed, (e) => {
11226
+ if (c) return rd(t.removed, (e) => {
11189
11227
  e.element && Dt(e.element);
11190
11228
  }), Pe && Nt(e), e;
11191
11229
  if (Ve) {
@@ -11194,7 +11232,7 @@ function sf() {
11194
11232
  return (w.shadowroot || w.shadowrootmode) && (s = ge.call(r, s, !0)), s;
11195
11233
  }
11196
11234
  let u = Ie ? i.outerHTML : i.innerHTML;
11197
- return Ie && C["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && vd(Gd, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), Pe && (u = Mt(u)), v && Ue ? ue(u) : u;
11235
+ return Ie && C["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && xd(Jd, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), Pe && (u = Mt(u)), v && Ue ? ue(u) : u;
11198
11236
  }, t.setConfig = function() {
11199
11237
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
11200
11238
  k(e), Le = !0, Re = C, ze = w;
@@ -11205,30 +11243,30 @@ function sf() {
11205
11243
  let r = O(e), i = O(t);
11206
11244
  return Wt(r, i, n);
11207
11245
  }, t.addHook = function(e, t) {
11208
- typeof t == "function" && gd(S, e) && rd(S[e], t);
11246
+ typeof t == "function" && yd(S, e) && od(S[e], t);
11209
11247
  }, t.removeHook = function(e, t) {
11210
- if (gd(S, e)) {
11248
+ if (yd(S, e)) {
11211
11249
  if (t !== void 0) {
11212
- let n = td(S[e], t);
11213
- return n === -1 ? void 0 : id(S[e], n, 1)[0];
11250
+ let n = id(S[e], t);
11251
+ return n === -1 ? void 0 : sd(S[e], n, 1)[0];
11214
11252
  }
11215
- return nd(S[e]);
11253
+ return ad(S[e]);
11216
11254
  }
11217
11255
  }, t.removeHooks = function(e) {
11218
- gd(S, e) && (S[e] = []);
11256
+ yd(S, e) && (S[e] = []);
11219
11257
  }, t.removeAllHooks = function() {
11220
- S = rf();
11258
+ S = sf();
11221
11259
  }, t;
11222
11260
  }
11223
- var cf = sf(), lf = Object.defineProperty, uf = (e) => {
11261
+ var df = uf(), ff = Object.defineProperty, pf = (e) => {
11224
11262
  throw TypeError(e);
11225
- }, df = (e, t, n) => t in e ? lf(e, t, {
11263
+ }, mf = (e, t, n) => t in e ? ff(e, t, {
11226
11264
  enumerable: !0,
11227
11265
  configurable: !0,
11228
11266
  writable: !0,
11229
11267
  value: n
11230
- }) : e[t] = n, Y = (e, t, n) => df(e, typeof t == "symbol" ? t : t + "", n), ff = (e, t, n) => t.has(e) || uf("Cannot " + n), pf = (e, t, n) => t.has(e) ? uf("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), mf = (e, t, n) => (ff(e, t, "access private method"), n), hf, gf, _f;
11231
- function vf() {
11268
+ }) : e[t] = n, Y = (e, t, n) => mf(e, typeof t == "symbol" ? t : t + "", n), hf = (e, t, n) => t.has(e) || pf("Cannot " + n), gf = (e, t, n) => t.has(e) ? pf("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), _f = (e, t, n) => (hf(e, t, "access private method"), n), vf, yf, bf;
11269
+ function xf() {
11232
11270
  return {
11233
11271
  async: !1,
11234
11272
  breaks: !1,
@@ -11242,37 +11280,37 @@ function vf() {
11242
11280
  walkTokens: null
11243
11281
  };
11244
11282
  }
11245
- var yf = vf();
11246
- function bf(e) {
11247
- yf = e;
11283
+ var Sf = xf();
11284
+ function Cf(e) {
11285
+ Sf = e;
11248
11286
  }
11249
- var xf = /[&<>"']/, Sf = new RegExp(xf.source, "g"), Cf = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, wf = new RegExp(Cf.source, "g"), Tf = {
11287
+ var wf = /[&<>"']/, Tf = new RegExp(wf.source, "g"), Ef = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Df = new RegExp(Ef.source, "g"), Of = {
11250
11288
  "&": "&amp;",
11251
11289
  "<": "&lt;",
11252
11290
  ">": "&gt;",
11253
11291
  "\"": "&quot;",
11254
11292
  "'": "&#39;"
11255
- }, Ef = (e) => Tf[e];
11256
- function Df(e, t) {
11293
+ }, kf = (e) => Of[e];
11294
+ function Af(e, t) {
11257
11295
  if (t) {
11258
- if (xf.test(e)) return e.replace(Sf, Ef);
11259
- } else if (Cf.test(e)) return e.replace(wf, Ef);
11296
+ if (wf.test(e)) return e.replace(Tf, kf);
11297
+ } else if (Ef.test(e)) return e.replace(Df, kf);
11260
11298
  return e;
11261
11299
  }
11262
- var Of = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;
11263
- function kf(e) {
11264
- return e.replace(Of, (e, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""));
11300
+ var jf = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;
11301
+ function Mf(e) {
11302
+ return e.replace(jf, (e, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""));
11265
11303
  }
11266
- var Af = /(^|[^\[])\^/g;
11304
+ var Nf = /(^|[^\[])\^/g;
11267
11305
  function X(e, t) {
11268
11306
  e = typeof e == "string" ? e : e.source, t = t || "";
11269
11307
  let n = {
11270
- replace: (t, r) => (r = typeof r == "object" && "source" in r ? r.source : r, r = r.replace(Af, "$1"), e = e.replace(t, r), n),
11308
+ replace: (t, r) => (r = typeof r == "object" && "source" in r ? r.source : r, r = r.replace(Nf, "$1"), e = e.replace(t, r), n),
11271
11309
  getRegex: () => new RegExp(e, t)
11272
11310
  };
11273
11311
  return n;
11274
11312
  }
11275
- function jf(e) {
11313
+ function Pf(e) {
11276
11314
  try {
11277
11315
  e = encodeURI(e).replace(/%25/g, "%");
11278
11316
  } catch {
@@ -11280,8 +11318,8 @@ function jf(e) {
11280
11318
  }
11281
11319
  return e;
11282
11320
  }
11283
- var Mf = { exec: () => null };
11284
- function Nf(e, t) {
11321
+ var Ff = { exec: () => null };
11322
+ function If(e, t) {
11285
11323
  let n = e.replace(/\|/g, (e, t, n) => {
11286
11324
  let r = !1, i = t;
11287
11325
  for (; --i >= 0 && n[i] === "\\";) r = !r;
@@ -11294,7 +11332,7 @@ function Nf(e, t) {
11294
11332
  for (; r < n.length; r++) n[r] = n[r].trim().replace(/\\\|/g, "|");
11295
11333
  return n;
11296
11334
  }
11297
- function Pf(e, t, n) {
11335
+ function Lf(e, t, n) {
11298
11336
  let r = e.length;
11299
11337
  if (r === 0) return "";
11300
11338
  let i = 0;
@@ -11306,7 +11344,7 @@ function Pf(e, t, n) {
11306
11344
  }
11307
11345
  return e.slice(0, r - i);
11308
11346
  }
11309
- function Ff(e, t) {
11347
+ function Rf(e, t) {
11310
11348
  if (e.indexOf(t[1]) === -1) return -1;
11311
11349
  let n = 0;
11312
11350
  for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
@@ -11314,8 +11352,8 @@ function Ff(e, t) {
11314
11352
  else if (e[r] === t[1] && (n--, n < 0)) return r;
11315
11353
  return -1;
11316
11354
  }
11317
- function If(e, t, n, r) {
11318
- let i = t.href, a = t.title ? Df(t.title) : null, o = e[1].replace(/\\([\[\]])/g, "$1");
11355
+ function zf(e, t, n, r) {
11356
+ let i = t.href, a = t.title ? Af(t.title) : null, o = e[1].replace(/\\([\[\]])/g, "$1");
11319
11357
  if (e[0].charAt(0) !== "!") {
11320
11358
  r.state.inLink = !0;
11321
11359
  let e = {
@@ -11333,10 +11371,10 @@ function If(e, t, n, r) {
11333
11371
  raw: n,
11334
11372
  href: i,
11335
11373
  title: a,
11336
- text: Df(o)
11374
+ text: Af(o)
11337
11375
  };
11338
11376
  }
11339
- function Lf(e, t) {
11377
+ function Bf(e, t) {
11340
11378
  let n = e.match(/^(\s+)(?:```)/);
11341
11379
  if (n === null) return t;
11342
11380
  let r = n[1];
@@ -11347,9 +11385,9 @@ function Lf(e, t) {
11347
11385
  return n.length >= r.length ? e.slice(r.length) : e;
11348
11386
  }).join("\n");
11349
11387
  }
11350
- var Rf = class {
11388
+ var Vf = class {
11351
11389
  constructor(e) {
11352
- Y(this, "options"), Y(this, "rules"), Y(this, "lexer"), this.options = e || yf;
11390
+ Y(this, "options"), Y(this, "rules"), Y(this, "lexer"), this.options = e || Sf;
11353
11391
  }
11354
11392
  space(e) {
11355
11393
  let t = this.rules.block.newline.exec(e);
@@ -11366,14 +11404,14 @@ var Rf = class {
11366
11404
  type: "code",
11367
11405
  raw: t[0],
11368
11406
  codeBlockStyle: "indented",
11369
- text: this.options.pedantic ? e : Pf(e, "\n")
11407
+ text: this.options.pedantic ? e : Lf(e, "\n")
11370
11408
  };
11371
11409
  }
11372
11410
  }
11373
11411
  fences(e) {
11374
11412
  let t = this.rules.block.fences.exec(e);
11375
11413
  if (t) {
11376
- let e = t[0], n = Lf(e, t[3] || "");
11414
+ let e = t[0], n = Bf(e, t[3] || "");
11377
11415
  return {
11378
11416
  type: "code",
11379
11417
  raw: e,
@@ -11387,7 +11425,7 @@ var Rf = class {
11387
11425
  if (t) {
11388
11426
  let e = t[2].trim();
11389
11427
  if (/#$/.test(e)) {
11390
- let t = Pf(e, "#");
11428
+ let t = Lf(e, "#");
11391
11429
  (this.options.pedantic || !t || / $/.test(t)) && (e = t.trim());
11392
11430
  }
11393
11431
  return {
@@ -11409,7 +11447,7 @@ var Rf = class {
11409
11447
  blockquote(e) {
11410
11448
  let t = this.rules.block.blockquote.exec(e);
11411
11449
  if (t) {
11412
- let e = Pf(t[0].replace(/^ *>[ \t]?/gm, ""), "\n"), n = this.lexer.state.top;
11450
+ let e = Lf(t[0].replace(/^ *>[ \t]?/gm, ""), "\n"), n = this.lexer.state.top;
11413
11451
  this.lexer.state.top = !0;
11414
11452
  let r = this.lexer.blockTokens(e);
11415
11453
  return this.lexer.state.top = n, {
@@ -11504,7 +11542,7 @@ var Rf = class {
11504
11542
  let e = {
11505
11543
  type: "table",
11506
11544
  raw: t[0],
11507
- header: Nf(t[1]).map((e) => ({
11545
+ header: If(t[1]).map((e) => ({
11508
11546
  text: e,
11509
11547
  tokens: []
11510
11548
  })),
@@ -11517,7 +11555,7 @@ var Rf = class {
11517
11555
  let t = e.align[n];
11518
11556
  t && (/^ *-+: *$/.test(t) ? e.align[n] = "right" : /^ *:-+: *$/.test(t) ? e.align[n] = "center" : /^ *:-+ *$/.test(t) ? e.align[n] = "left" : e.align[n] = null);
11519
11557
  }
11520
- for (t = e.rows.length, n = 0; n < t; n++) e.rows[n] = Nf(e.rows[n], e.header.length).map((e) => ({
11558
+ for (t = e.rows.length, n = 0; n < t; n++) e.rows[n] = If(e.rows[n], e.header.length).map((e) => ({
11521
11559
  text: e,
11522
11560
  tokens: []
11523
11561
  }));
@@ -11563,7 +11601,7 @@ var Rf = class {
11563
11601
  if (t) return {
11564
11602
  type: "escape",
11565
11603
  raw: t[0],
11566
- text: Df(t[1])
11604
+ text: Af(t[1])
11567
11605
  };
11568
11606
  }
11569
11607
  tag(e) {
@@ -11583,10 +11621,10 @@ var Rf = class {
11583
11621
  let e = t[2].trim();
11584
11622
  if (!this.options.pedantic && /^</.test(e)) {
11585
11623
  if (!/>$/.test(e)) return;
11586
- let t = Pf(e.slice(0, -1), "\\");
11624
+ let t = Lf(e.slice(0, -1), "\\");
11587
11625
  if ((e.length - t.length) % 2 == 0) return;
11588
11626
  } else {
11589
- let e = Ff(t[2], "()");
11627
+ let e = Rf(t[2], "()");
11590
11628
  if (e > -1) {
11591
11629
  let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
11592
11630
  t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
@@ -11597,7 +11635,7 @@ var Rf = class {
11597
11635
  let e = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);
11598
11636
  e && (n = e[1], r = e[3]);
11599
11637
  } else r = t[3] ? t[3].slice(1, -1) : "";
11600
- return n = n.trim(), /^</.test(n) && (n = this.options.pedantic && !/>$/.test(e) ? n.slice(1) : n.slice(1, -1)), If(t, {
11638
+ return n = n.trim(), /^</.test(n) && (n = this.options.pedantic && !/>$/.test(e) ? n.slice(1) : n.slice(1, -1)), zf(t, {
11601
11639
  href: n && n.replace(this.rules.inline._escapes, "$1"),
11602
11640
  title: r && r.replace(this.rules.inline._escapes, "$1")
11603
11641
  }, t[0], this.lexer);
@@ -11615,7 +11653,7 @@ var Rf = class {
11615
11653
  text: e
11616
11654
  };
11617
11655
  }
11618
- return If(n, e, n[0], this.lexer);
11656
+ return zf(n, e, n[0], this.lexer);
11619
11657
  }
11620
11658
  }
11621
11659
  emStrong(e, t, n = "") {
@@ -11658,7 +11696,7 @@ var Rf = class {
11658
11696
  let t = this.rules.inline.code.exec(e);
11659
11697
  if (t) {
11660
11698
  let e = t[2].replace(/\n/g, " "), n = /[^ ]/.test(e), r = /^ /.test(e) && / $/.test(e);
11661
- return n && r && (e = e.substring(1, e.length - 1)), e = Df(e, !0), {
11699
+ return n && r && (e = e.substring(1, e.length - 1)), e = Af(e, !0), {
11662
11700
  type: "codespan",
11663
11701
  raw: t[0],
11664
11702
  text: e
@@ -11685,7 +11723,7 @@ var Rf = class {
11685
11723
  let t = this.rules.inline.autolink.exec(e);
11686
11724
  if (t) {
11687
11725
  let e, n;
11688
- return t[2] === "@" ? (e = Df(t[1]), n = "mailto:" + e) : (e = Df(t[1]), n = e), {
11726
+ return t[2] === "@" ? (e = Af(t[1]), n = "mailto:" + e) : (e = Af(t[1]), n = e), {
11689
11727
  type: "link",
11690
11728
  raw: t[0],
11691
11729
  text: e,
@@ -11702,13 +11740,13 @@ var Rf = class {
11702
11740
  let t;
11703
11741
  if (t = this.rules.inline.url.exec(e)) {
11704
11742
  let e, n;
11705
- if (t[2] === "@") e = Df(t[0]), n = "mailto:" + e;
11743
+ if (t[2] === "@") e = Af(t[0]), n = "mailto:" + e;
11706
11744
  else {
11707
11745
  let r;
11708
11746
  do
11709
11747
  r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])[0];
11710
11748
  while (r !== t[0]);
11711
- e = Df(t[0]), n = t[1] === "www." ? "http://" + t[0] : t[0];
11749
+ e = Af(t[0]), n = t[1] === "www." ? "http://" + t[0] : t[0];
11712
11750
  }
11713
11751
  return {
11714
11752
  type: "link",
@@ -11727,7 +11765,7 @@ var Rf = class {
11727
11765
  let t = this.rules.inline.text.exec(e);
11728
11766
  if (t) {
11729
11767
  let e;
11730
- return e = this.lexer.state.inRawBlock ? t[0] : Df(t[0]), {
11768
+ return e = this.lexer.state.inRawBlock ? t[0] : Af(t[0]), {
11731
11769
  type: "text",
11732
11770
  raw: t[0],
11733
11771
  text: e
@@ -11744,7 +11782,7 @@ var Rf = class {
11744
11782
  list: /^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,
11745
11783
  html: "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",
11746
11784
  def: /^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,
11747
- table: Mf,
11785
+ table: Ff,
11748
11786
  lheading: /^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
11749
11787
  _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
11750
11788
  text: /^[^\n]+/
@@ -11757,14 +11795,14 @@ Z._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Z._title = /(?:"(?:\\"?|[^"\\])*"|'[^'
11757
11795
  html: X("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Z._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
11758
11796
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
11759
11797
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
11760
- fences: Mf,
11798
+ fences: Ff,
11761
11799
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
11762
11800
  paragraph: X(Z.normal._paragraph).replace("hr", Z.hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Z.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
11763
11801
  };
11764
11802
  var Q = {
11765
11803
  escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
11766
11804
  autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
11767
- url: Mf,
11805
+ url: Ff,
11768
11806
  tag: "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",
11769
11807
  link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
11770
11808
  reflink: /^!?\[(label)\]\[(ref)\]/,
@@ -11777,7 +11815,7 @@ var Q = {
11777
11815
  },
11778
11816
  code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
11779
11817
  br: /^( {2,}|\\)\n(?!\s*$)/,
11780
- del: Mf,
11818
+ del: Ff,
11781
11819
  text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
11782
11820
  punctuation: /^((?![*_])[\spunctuation])/
11783
11821
  };
@@ -11810,9 +11848,9 @@ Q._punctuation = "\\p{P}$+<=>`^|~", Q.punctuation = X(Q.punctuation, "u").replac
11810
11848
  br: X(Q.br).replace("{2,}", "*").getRegex(),
11811
11849
  text: X(Q.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
11812
11850
  };
11813
- var zf = class e {
11851
+ var Hf = class e {
11814
11852
  constructor(e) {
11815
- Y(this, "tokens"), Y(this, "options"), Y(this, "state"), Y(this, "tokenizer"), Y(this, "inlineQueue"), this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || yf, this.options.tokenizer = this.options.tokenizer || new Rf(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
11853
+ Y(this, "tokens"), Y(this, "options"), Y(this, "state"), Y(this, "tokenizer"), Y(this, "inlineQueue"), this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || Sf, this.options.tokenizer = this.options.tokenizer || new Vf(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
11816
11854
  inLink: !1,
11817
11855
  inRawBlock: !1,
11818
11856
  top: !0
@@ -11993,13 +12031,13 @@ var zf = class e {
11993
12031
  }
11994
12032
  return t;
11995
12033
  }
11996
- }, Bf = class {
12034
+ }, Uf = class {
11997
12035
  constructor(e) {
11998
- Y(this, "options"), this.options = e || yf;
12036
+ Y(this, "options"), this.options = e || Sf;
11999
12037
  }
12000
12038
  code(e, t, n) {
12001
12039
  let r = (t || "").match(/^\S*/)?.[0];
12002
- return e = e.replace(/\n$/, "") + "\n", r ? "<pre><code class=\"language-" + Df(r) + "\">" + (n ? e : Df(e, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? e : Df(e, !0)) + "</code></pre>\n";
12040
+ return e = e.replace(/\n$/, "") + "\n", r ? "<pre><code class=\"language-" + Af(r) + "\">" + (n ? e : Af(e, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? e : Af(e, !0)) + "</code></pre>\n";
12003
12041
  }
12004
12042
  blockquote(e) {
12005
12043
  return `<blockquote>
@@ -12060,14 +12098,14 @@ ${e}</tr>
12060
12098
  return `<del>${e}</del>`;
12061
12099
  }
12062
12100
  link(e, t, n) {
12063
- let r = jf(e);
12101
+ let r = Pf(e);
12064
12102
  if (r === null) return n;
12065
12103
  e = r;
12066
12104
  let i = "<a href=\"" + e + "\"";
12067
12105
  return t && (i += " title=\"" + t + "\""), i += ">" + n + "</a>", i;
12068
12106
  }
12069
12107
  image(e, t, n) {
12070
- let r = jf(e);
12108
+ let r = Pf(e);
12071
12109
  if (r === null) return n;
12072
12110
  e = r;
12073
12111
  let i = `<img src="${e}" alt="${n}"`;
@@ -12076,7 +12114,7 @@ ${e}</tr>
12076
12114
  text(e) {
12077
12115
  return e;
12078
12116
  }
12079
- }, Vf = class {
12117
+ }, Wf = class {
12080
12118
  strong(e) {
12081
12119
  return e;
12082
12120
  }
@@ -12104,9 +12142,9 @@ ${e}</tr>
12104
12142
  br() {
12105
12143
  return "";
12106
12144
  }
12107
- }, Hf = class e {
12145
+ }, Gf = class e {
12108
12146
  constructor(e) {
12109
- Y(this, "options"), Y(this, "renderer"), Y(this, "textRenderer"), this.options = e || yf, this.options.renderer = this.options.renderer || new Bf(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new Vf();
12147
+ Y(this, "options"), Y(this, "renderer"), Y(this, "textRenderer"), this.options = e || Sf, this.options.renderer = this.options.renderer || new Uf(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new Wf();
12110
12148
  }
12111
12149
  static parse(t, n) {
12112
12150
  return new e(n).parse(t);
@@ -12143,7 +12181,7 @@ ${e}</tr>
12143
12181
  continue;
12144
12182
  case "heading": {
12145
12183
  let e = i;
12146
- n += this.renderer.heading(this.parseInline(e.tokens), e.depth, kf(this.parseInline(e.tokens, this.textRenderer)));
12184
+ n += this.renderer.heading(this.parseInline(e.tokens), e.depth, Mf(this.parseInline(e.tokens, this.textRenderer)));
12147
12185
  continue;
12148
12186
  }
12149
12187
  case "code": {
@@ -12298,9 +12336,9 @@ ${e}</tr>
12298
12336
  }
12299
12337
  return n;
12300
12338
  }
12301
- }, Uf = class {
12339
+ }, Kf = class {
12302
12340
  constructor(e) {
12303
- Y(this, "options"), this.options = e || yf;
12341
+ Y(this, "options"), this.options = e || Sf;
12304
12342
  }
12305
12343
  preprocess(e) {
12306
12344
  return e;
@@ -12309,10 +12347,10 @@ ${e}</tr>
12309
12347
  return e;
12310
12348
  }
12311
12349
  };
12312
- Y(Uf, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess"]));
12313
- var Wf = class {
12350
+ Y(Kf, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess"]));
12351
+ var qf = class {
12314
12352
  constructor(...e) {
12315
- pf(this, hf), Y(this, "defaults", vf()), Y(this, "options", this.setOptions), Y(this, "parse", mf(this, hf, gf).call(this, zf.lex, Hf.parse)), Y(this, "parseInline", mf(this, hf, gf).call(this, zf.lexInline, Hf.parseInline)), Y(this, "Parser", Hf), Y(this, "Renderer", Bf), Y(this, "TextRenderer", Vf), Y(this, "Lexer", zf), Y(this, "Tokenizer", Rf), Y(this, "Hooks", Uf), this.use(...e);
12353
+ gf(this, vf), Y(this, "defaults", xf()), Y(this, "options", this.setOptions), Y(this, "parse", _f(this, vf, yf).call(this, Hf.lex, Gf.parse)), Y(this, "parseInline", _f(this, vf, yf).call(this, Hf.lexInline, Gf.parseInline)), Y(this, "Parser", Gf), Y(this, "Renderer", Uf), Y(this, "TextRenderer", Wf), Y(this, "Lexer", Hf), Y(this, "Tokenizer", Vf), Y(this, "Hooks", Kf), this.use(...e);
12316
12354
  }
12317
12355
  walkTokens(e, t) {
12318
12356
  let n = [];
@@ -12360,7 +12398,7 @@ var Wf = class {
12360
12398
  }
12361
12399
  "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
12362
12400
  }), n.extensions = t), e.renderer) {
12363
- let t = this.defaults.renderer || new Bf(this.defaults);
12401
+ let t = this.defaults.renderer || new Uf(this.defaults);
12364
12402
  for (let n in e.renderer) {
12365
12403
  let r = e.renderer[n], i = n, a = t[i];
12366
12404
  t[i] = (...e) => {
@@ -12371,7 +12409,7 @@ var Wf = class {
12371
12409
  n.renderer = t;
12372
12410
  }
12373
12411
  if (e.tokenizer) {
12374
- let t = this.defaults.tokenizer || new Rf(this.defaults);
12412
+ let t = this.defaults.tokenizer || new Vf(this.defaults);
12375
12413
  for (let n in e.tokenizer) {
12376
12414
  let r = e.tokenizer[n], i = n, a = t[i];
12377
12415
  t[i] = (...e) => {
@@ -12382,10 +12420,10 @@ var Wf = class {
12382
12420
  n.tokenizer = t;
12383
12421
  }
12384
12422
  if (e.hooks) {
12385
- let t = this.defaults.hooks || new Uf();
12423
+ let t = this.defaults.hooks || new Kf();
12386
12424
  for (let n in e.hooks) {
12387
12425
  let r = e.hooks[n], i = n, a = t[i];
12388
- t[i] = Uf.passThroughHooks.has(n) ? (e) => {
12426
+ t[i] = Kf.passThroughHooks.has(n) ? (e) => {
12389
12427
  if (this.defaults.async) return Promise.resolve(r.call(t, e)).then((e) => a.call(t, e));
12390
12428
  let n = r.call(t, e);
12391
12429
  return a.call(t, n);
@@ -12416,20 +12454,20 @@ var Wf = class {
12416
12454
  }, this;
12417
12455
  }
12418
12456
  lexer(e, t) {
12419
- return zf.lex(e, t ?? this.defaults);
12457
+ return Hf.lex(e, t ?? this.defaults);
12420
12458
  }
12421
12459
  parser(e, t) {
12422
- return Hf.parse(e, t ?? this.defaults);
12460
+ return Gf.parse(e, t ?? this.defaults);
12423
12461
  }
12424
12462
  };
12425
- hf = /* @__PURE__ */ new WeakSet(), gf = function(e, t) {
12463
+ vf = /* @__PURE__ */ new WeakSet(), yf = function(e, t) {
12426
12464
  return (n, r) => {
12427
12465
  let i = { ...r }, a = {
12428
12466
  ...this.defaults,
12429
12467
  ...i
12430
12468
  };
12431
12469
  this.defaults.async === !0 && i.async === !1 && (a.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), a.async = !0);
12432
- let o = mf(this, hf, _f).call(this, !!a.silent, !!a.async);
12470
+ let o = _f(this, vf, bf).call(this, !!a.silent, !!a.async);
12433
12471
  if (n == null) return o(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
12434
12472
  if (typeof n != "string") return o(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
12435
12473
  if (a.hooks && (a.hooks.options = a), a.async) return Promise.resolve(a.hooks ? a.hooks.preprocess(n) : n).then((t) => e(t, a)).then((e) => a.walkTokens ? Promise.all(this.walkTokens(e, a.walkTokens)).then(() => e) : e).then((e) => t(e, a)).then((e) => a.hooks ? a.hooks.postprocess(e) : e).catch(o);
@@ -12443,64 +12481,64 @@ hf = /* @__PURE__ */ new WeakSet(), gf = function(e, t) {
12443
12481
  return o(e);
12444
12482
  }
12445
12483
  };
12446
- }, _f = function(e, t) {
12484
+ }, bf = function(e, t) {
12447
12485
  return (n) => {
12448
12486
  if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
12449
- let e = "<p>An error occurred:</p><pre>" + Df(n.message + "", !0) + "</pre>";
12487
+ let e = "<p>An error occurred:</p><pre>" + Af(n.message + "", !0) + "</pre>";
12450
12488
  return t ? Promise.resolve(e) : e;
12451
12489
  }
12452
12490
  if (t) return Promise.reject(n);
12453
12491
  throw n;
12454
12492
  };
12455
12493
  };
12456
- var Gf = new Wf();
12494
+ var Jf = new qf();
12457
12495
  function $(e, t) {
12458
- return Gf.parse(e, t);
12496
+ return Jf.parse(e, t);
12459
12497
  }
12460
12498
  $.options = $.setOptions = function(e) {
12461
- return Gf.setOptions(e), $.defaults = Gf.defaults, bf($.defaults), $;
12462
- }, $.getDefaults = vf, $.defaults = yf, $.use = function(...e) {
12463
- return Gf.use(...e), $.defaults = Gf.defaults, bf($.defaults), $;
12499
+ return Jf.setOptions(e), $.defaults = Jf.defaults, Cf($.defaults), $;
12500
+ }, $.getDefaults = xf, $.defaults = Sf, $.use = function(...e) {
12501
+ return Jf.use(...e), $.defaults = Jf.defaults, Cf($.defaults), $;
12464
12502
  }, $.walkTokens = function(e, t) {
12465
- return Gf.walkTokens(e, t);
12466
- }, $.parseInline = Gf.parseInline, $.Parser = Hf, $.parser = Hf.parse, $.Renderer = Bf, $.TextRenderer = Vf, $.Lexer = zf, $.lexer = zf.lex, $.Tokenizer = Rf, $.Hooks = Uf, $.parse = $, $.options, $.setOptions, $.use, $.walkTokens, $.parseInline, Hf.parse, zf.lex;
12503
+ return Jf.walkTokens(e, t);
12504
+ }, $.parseInline = Jf.parseInline, $.Parser = Gf, $.parser = Gf.parse, $.Renderer = Uf, $.TextRenderer = Wf, $.Lexer = Hf, $.lexer = Hf.lex, $.Tokenizer = Vf, $.Hooks = Kf, $.parse = $, $.options, $.setOptions, $.use, $.walkTokens, $.parseInline, Gf.parse, Hf.lex;
12467
12505
  //#endregion
12468
12506
  //#region src/chat/components/message/richTextSanitize.ts
12469
- var Kf = { USE_PROFILES: { html: !0 } }, qf = !1;
12470
- function Jf() {
12471
- qf || ($.setOptions({
12507
+ var Yf = { USE_PROFILES: { html: !0 } }, Xf = !1;
12508
+ function Zf() {
12509
+ Xf || ($.setOptions({
12472
12510
  gfm: !0,
12473
12511
  breaks: !0
12474
- }), qf = !0);
12475
- }
12476
- function Yf(e) {
12477
- return typeof e != "string" || !e.trim() ? "" : String(cf.sanitize(e, Kf));
12512
+ }), Xf = !0);
12478
12513
  }
12479
- var Xf = 128, Zf = /* @__PURE__ */ new Map();
12480
12514
  function Qf(e) {
12515
+ return typeof e != "string" || !e.trim() ? "" : String(df.sanitize(e, Yf));
12516
+ }
12517
+ var $f = 128, ep = /* @__PURE__ */ new Map();
12518
+ function tp(e) {
12481
12519
  if (typeof e != "string" || !e.trim()) return "";
12482
- let t = Zf.get(e);
12520
+ let t = ep.get(e);
12483
12521
  if (t !== void 0) return t;
12484
- Jf();
12522
+ Zf();
12485
12523
  let n = $.parse(e, { async: !1 });
12486
12524
  if (typeof n != "string") return "";
12487
- let r = Yf(n);
12488
- if (Zf.size >= Xf) {
12489
- let e = Zf.keys().next().value;
12490
- e !== void 0 && Zf.delete(e);
12525
+ let r = Qf(n);
12526
+ if (ep.size >= $f) {
12527
+ let e = ep.keys().next().value;
12528
+ e !== void 0 && ep.delete(e);
12491
12529
  }
12492
- return Zf.set(e, r), r;
12530
+ return ep.set(e, r), r;
12493
12531
  }
12494
12532
  //#endregion
12495
12533
  //#region src/types.ts
12496
- var $f = {
12534
+ var np = {
12497
12535
  PLAN_HOST_TOOL_STREAM: "plan_host_tool_stream",
12498
12536
  PLAN_HOST_TOOL: "plan_host_tool",
12499
12537
  AGENT_MUTATION_SUCCESS: "agent_mutation_success",
12500
12538
  HOST_TOOL_DISPATCH: "host_tool_dispatch",
12501
12539
  PAGE_ACTION_HOST_FILL: "page_action_host_fill"
12502
- }, ep = Cu();
12540
+ }, rp = Eu();
12503
12541
  //#endregion
12504
- export { tn as AUTH_CHANGED_EVENT, on as AUTH_REQUIRED_USER_MESSAGE, en as AUTH_STORAGE_KEY, ep as AgentChat, ep as default, vu as AgentChatClient, p as AgentChatError, nc as AppToolService, ko as BRAIN_ASK_USER_ERROR_CODE, ee as DEFAULT_BASE_URL, m as DSN_AUTH_HEADER, dn as EXTENSION_READY_EVENT, $f as HOST_ACTION_REASON, yn as HOST_TOOL_STREAM_PROTOCOL_VERSION, ci as HostToolStreamManager, ti as HostToolStreamRound, pn as SDK_AUTH_STORAGE_KEY, Nr as appendByDotPath, Ic as appendPageActionNarrativeItems, E as argumentsToEditorText, rr as buildClientSkillListQuery, je as buildConfirmWithEdits, Me as buildConfirmWithEditsFromArguments, ot as buildDraftReviewDecisionPayload, dt as buildDraftReviewEditorStates, Io as buildEntityCommit, Kc as buildNarrativeDisplayBlocks, Do as buildPageActionInvokePageContextSnapshot, rt as canEditDraftReview, jr as clearHostActionHandlers, bi as clearHostToolServerSyncKeys, xr as clearHostTools, Dl as clearPendingPageActionApplyStorage, ke as cloneWriteDraftArguments, Ei as coerceContextMentionPayload, gl as consumePageActionInvokeStream, hl as consumePageActionRunStream, Rc as countInterestingNarrativeItems, Cu as createAgentChat, Fr as createInitialHostToolStreamState, Xc as defaultPageActionProgressLabel, ki as defineContextMention, Ai as definePageContextMentions, et as deriveEditPolicyFromDraft, Sn as detectHostToolStreamProfile, kr as dispatchHostAction, ft as draftReviewBundleLabel, at as draftReviewHasEdits, Ae as editorTextToArguments, oi as executeBatchPlan, _r as executeHostToolsFromAction, Ro as extractBrainClarifyFromRunSteps, _i as flushPendingHostToolSyncs, Lo as formatBrainClarifyCandidateLabel, tc as getAppToolServerErrorCode, Pr as getByDotPath, Fu as getGofoTrackJob, mr as getHostToolStreamConfig, ju as getOmnixExtensionStatus, Ln as hostActionSseToAgentAction, it as initialPreviewEditorText, Fo as isBrainAskUserErrorCode, Nn as isDispatchableHostAction, st as isDraftReviewGateErrorCode, xn as isHostActionBatchPayload, Rn as isHostActionEnvelope, bn as isHostActionStreamPayload, Cr as isHostToolRegisteredGlobally, Sr as isHostToolRegisteredInScope, li as isHostToolStreamEnabled, Tu as isOmnixExtensionAvailable, mn as isOmnixSdkAuthenticated, Lu as isPageActionProcessLivePhase, _c as isRequestedSkillActuallyUsed, cn as isSdkAuthenticatedForDsn, mt as isStaleAgentRunEvent, Hc as localizeNarrativeFieldLabel, Qf as markdownToSafeHtml, kl as matchesPendingPageActionApply, Sc as mismatchI18nKey, te as normalizeDsn, Fn as normalizeHostAction, Ar as onHostAction, el as pageActionAwaitingClarifyLabel, Oo as parseAgentChatPageContext, cc as parseAgentRunDetail, Po as parseBrainClarifyPayload, _t as parseCancelRunResponse, ut as parseDraftReviewBundles, Ze as parseEditPolicyPublic, Pn as parseHostActionPayload, In as parseHostActionSsePayload, Pc as parseNarrativeItems, qc as parsePageWorkflowEvent, O as parseRunGeneration, gt as parseSessionRunState, Oe as parseWriteDraftPublic, Qr as passesHostActionGate, Gc as pickNarrativeHeadline, Au as pingOmnixExtension, ri as planBatchExecution, Tl as readPendingPageActionApply, mc as readRoutePlanStep, gc as readSkillAlignment, Cc as readSkillIntentMismatchObservation, hc as readSkillTurnContract, qr as reduceHostToolStream, Or as registerHostAction, dr as registerHostTool, vi as registerHostToolsWithSync, hn as requireOmnixSdkAuthentication, lc as resolveAlignmentSteps, ir as resolveDefaultSkillId, tt as resolveEditPolicy, bl as resolvePageContextNavigateTarget, al as resolvePageWorkflowProgressLabel, dl as rethrowPageActionError, hr as runHostTool, gr as runHostToolPreview, Yf as sanitizeRichHtml, Mr as setByDotPath, ei as shouldIngestHostActionStreamFrame, Lc as shouldOfferNarrativeProcess, xc as shouldShowClarifyCard, vc as shouldShowIntentFirstBanner, yc as shouldShowIntentFirstHint, bc as shouldShowSkillClarifyCard, ar as skillListHasPageFilter, Ti as slugContextMentionKey, Pu as startGofoTrack, Mu as syncOmnixPmsIntegration, Ru as toPageActionProcessView, Jr as toStreamSessionGate, Nu as trackGofoWaybill, yr as undeclareHostTool, br as undeclareHostTools, fr as unregisterHostTool, pr as unregisterHostTools, an as useAuthStore, sn as waitForAuthStoreRehydration, Iu as waitForGofoTrackJob, Du as waitForOmnixExtensionAvailable, ai as warnAccumulatorMismatch, El as writePendingPageActionApply };
12542
+ export { tn as AUTH_CHANGED_EVENT, on as AUTH_REQUIRED_USER_MESSAGE, en as AUTH_STORAGE_KEY, rp as AgentChat, rp as default, bu as AgentChatClient, p as AgentChatError, ic as AppToolService, ko as BRAIN_ASK_USER_ERROR_CODE, ee as DEFAULT_BASE_URL, m as DSN_AUTH_HEADER, dn as EXTENSION_READY_EVENT, np as HOST_ACTION_REASON, yn as HOST_TOOL_STREAM_PROTOCOL_VERSION, ci as HostToolStreamManager, ti as HostToolStreamRound, pn as SDK_AUTH_STORAGE_KEY, Nr as appendByDotPath, Rc as appendPageActionNarrativeItems, E as argumentsToEditorText, rr as buildClientSkillListQuery, je as buildConfirmWithEdits, Me as buildConfirmWithEditsFromArguments, ot as buildDraftReviewDecisionPayload, dt as buildDraftReviewEditorStates, Io as buildEntityCommit, Jc as buildNarrativeDisplayBlocks, Do as buildPageActionInvokePageContextSnapshot, rt as canEditDraftReview, jr as clearHostActionHandlers, bi as clearHostToolServerSyncKeys, xr as clearHostTools, kl as clearPendingPageActionApplyStorage, ke as cloneWriteDraftArguments, Ei as coerceContextMentionPayload, vl as consumePageActionInvokeStream, _l as consumePageActionRunStream, Bc as countInterestingNarrativeItems, Eu as createAgentChat, Fr as createInitialHostToolStreamState, Qc as defaultPageActionProgressLabel, ki as defineContextMention, Ai as definePageContextMentions, et as deriveEditPolicyFromDraft, Sn as detectHostToolStreamProfile, kr as dispatchHostAction, ft as draftReviewBundleLabel, at as draftReviewHasEdits, Ae as editorTextToArguments, oi as executeBatchPlan, _r as executeHostToolsFromAction, Ro as extractBrainClarifyFromRunSteps, _i as flushPendingHostToolSyncs, Lo as formatBrainClarifyCandidateLabel, rc as getAppToolServerErrorCode, Pr as getByDotPath, Ru as getGofoTrackJob, mr as getHostToolStreamConfig, Pu as getOmnixExtensionStatus, Ln as hostActionSseToAgentAction, it as initialPreviewEditorText, Fo as isBrainAskUserErrorCode, Nn as isDispatchableHostAction, st as isDraftReviewGateErrorCode, xn as isHostActionBatchPayload, Rn as isHostActionEnvelope, bn as isHostActionStreamPayload, Cr as isHostToolRegisteredGlobally, Sr as isHostToolRegisteredInScope, li as isHostToolStreamEnabled, Ou as isOmnixExtensionAvailable, mn as isOmnixSdkAuthenticated, Bu as isPageActionProcessLivePhase, yc as isRequestedSkillActuallyUsed, cn as isSdkAuthenticatedForDsn, mt as isStaleAgentRunEvent, Wc as localizeNarrativeFieldLabel, tp as markdownToSafeHtml, jl as matchesPendingPageActionApply, wc as mismatchI18nKey, te as normalizeDsn, Fn as normalizeHostAction, Ar as onHostAction, nl as pageActionAwaitingClarifyLabel, Oo as parseAgentChatPageContext, uc as parseAgentRunDetail, Po as parseBrainClarifyPayload, _t as parseCancelRunResponse, ut as parseDraftReviewBundles, Ze as parseEditPolicyPublic, Pn as parseHostActionPayload, In as parseHostActionSsePayload, Ic as parseNarrativeItems, Yc as parsePageWorkflowEvent, O as parseRunGeneration, gt as parseSessionRunState, Oe as parseWriteDraftPublic, Qr as passesHostActionGate, qc as pickNarrativeHeadline, Nu as pingOmnixExtension, ri as planBatchExecution, Dl as readPendingPageActionApply, gc as readRoutePlanStep, vc as readSkillAlignment, Tc as readSkillIntentMismatchObservation, _c as readSkillTurnContract, qr as reduceHostToolStream, Or as registerHostAction, dr as registerHostTool, vi as registerHostToolsWithSync, hn as requireOmnixSdkAuthentication, dc as resolveAlignmentSteps, ir as resolveDefaultSkillId, tt as resolveEditPolicy, Sl as resolvePageContextNavigateTarget, sl as resolvePageWorkflowProgressLabel, pl as rethrowPageActionError, hr as runHostTool, gr as runHostToolPreview, Qf as sanitizeRichHtml, Mr as setByDotPath, ei as shouldIngestHostActionStreamFrame, zc as shouldOfferNarrativeProcess, Cc as shouldShowClarifyCard, bc as shouldShowIntentFirstBanner, xc as shouldShowIntentFirstHint, Sc as shouldShowSkillClarifyCard, ar as skillListHasPageFilter, Ti as slugContextMentionKey, Lu as startGofoTrack, Fu as syncOmnixPmsIntegration, Vu as toPageActionProcessView, Jr as toStreamSessionGate, Iu as trackGofoWaybill, yr as undeclareHostTool, br as undeclareHostTools, fr as unregisterHostTool, pr as unregisterHostTools, an as useAuthStore, sn as waitForAuthStoreRehydration, zu as waitForGofoTrackJob, Au as waitForOmnixExtensionAvailable, ai as warnAccumulatorMismatch, Ol as writePendingPageActionApply };
12505
12543
 
12506
12544
  //# sourceMappingURL=omnix-chat.es.js.map