@pluno/product-agent-web 0.1.187 → 0.1.188

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.
@@ -470,8 +470,8 @@ const vi = [
470
470
  ], hi = [
471
471
  ...vi,
472
472
  ...aa
473
- ], fi = (t) => hi.some((e) => e.value === t), fd = globalThis.fetch.bind(globalThis), Rs = '.pluno-pa-widget-host[data-pluno-product-agent-ui="widget"]', md = '.pluno-pa-widget[data-pluno-product-agent-ui-root="widget"]', wd = ".pluno-pa-widget__panel", bd = ".pluno-pa-widget__timeline", Zo = `${Rs}[data-pluno-sdk-preview-channel]`;
474
- let yd = 0;
473
+ ], fi = (t) => hi.some((e) => e.value === t), fd = (t) => t.value === "gpt-5.6-sol" ? `${t.label} (50% off)` : t.label, md = globalThis.fetch.bind(globalThis), Rs = '.pluno-pa-widget-host[data-pluno-product-agent-ui="widget"]', wd = '.pluno-pa-widget[data-pluno-product-agent-ui-root="widget"]', bd = ".pluno-pa-widget__panel", yd = ".pluno-pa-widget__timeline", Zo = `${Rs}[data-pluno-sdk-preview-channel]`;
474
+ let _d = 0;
475
475
  function Qo(t) {
476
476
  const e = {};
477
477
  for (const r of [
@@ -522,7 +522,7 @@ function hs(t, e, n) {
522
522
  source: "web_sdk",
523
523
  category: t,
524
524
  name: e,
525
- sequence: ++yd,
525
+ sequence: ++_d,
526
526
  wallTime: (/* @__PURE__ */ new Date()).toISOString(),
527
527
  monotonicMs: performance.now(),
528
528
  data: n
@@ -531,27 +531,27 @@ function hs(t, e, n) {
531
531
  }
532
532
  class si extends Error {
533
533
  }
534
- function _d(t) {
534
+ function Sd(t) {
535
535
  return t === 408 || t === 425 || t === 429 || t >= 500;
536
536
  }
537
- const Sd = "https://app.pluno.ai", vd = 2e4, xd = 1e4, Id = 1e4, Td = 1e4, Cd = 1e4, kd = 3e3, Ed = 3e4, Ad = 1e3, er = 3e4, tr = 0.2, nr = 6e4, ir = 15e3, _n = 8, sr = "Browser connection was interrupted.", or = 15e3, Md = "Pluno could not send this message. Try it again.", rr = 2e3, Pd = 1e3, Rd = 100, ar = 8e3, lr = 3, Ld = [300, 1e3], la = 50 * 1024 * 1024, Dd = /* @__PURE__ */ new Set([
537
+ const vd = "https://app.pluno.ai", xd = 2e4, Id = 1e4, Td = 1e4, Cd = 1e4, kd = 1e4, Ed = 3e3, Ad = 3e4, Md = 1e3, er = 3e4, tr = 0.2, nr = 6e4, ir = 15e3, _n = 8, sr = "Browser connection was interrupted.", or = 15e3, Pd = "Pluno could not send this message. Try it again.", rr = 2e3, Rd = 1e3, Ld = 100, ar = 8e3, lr = 3, Dd = [300, 1e3], la = 50 * 1024 * 1024, Ud = /* @__PURE__ */ new Set([
538
538
  ".jpeg:image/jpeg",
539
539
  ".jpg:image/jpeg",
540
540
  ".pdf:application/pdf",
541
541
  ".png:image/png",
542
542
  ".webp:image/webp"
543
- ]), Ud = ".pdf,.png,.jpg,.jpeg,.webp", no = 64e3, fs = 4e3, io = 30, Nd = 2e3, Od = 1e3, da = "Image is too large for model vision input.", qd = 100, pa = "pluno.productAgent.state.", Ls = "pluno.productAgent.pendingEvents.", Di = "pluno.productAgent.activeToolCalls.", zd = 100;
543
+ ]), Nd = ".pdf,.png,.jpg,.jpeg,.webp", no = 64e3, fs = 4e3, io = 30, Od = 2e3, qd = 1e3, da = "Image is too large for model vision input.", zd = 100, pa = "pluno.productAgent.state.", Ls = "pluno.productAgent.pendingEvents.", Di = "pluno.productAgent.activeToolCalls.", Bd = 100;
544
544
  function Sn(t, e = 0) {
545
545
  const n = t === 0 ? 0 : Math.min(3e4, 1e3 * 2 ** (t - 1));
546
546
  return Math.max(e, n);
547
547
  }
548
548
  const mi = /* @__PURE__ */ new Set();
549
549
  let oi = null;
550
- function Bd(t, e = Math.random) {
551
- const n = Math.min(er, Ad * 2 ** t), i = 1 - tr + e() * tr * 2;
550
+ function Wd(t, e = Math.random) {
551
+ const n = Math.min(er, Md * 2 ** t), i = 1 - tr + e() * tr * 2;
552
552
  return Math.min(er, Math.round(n * i));
553
553
  }
554
- function Wd(t, e, n) {
554
+ function Fd(t, e, n) {
555
555
  return new Promise((i, s) => {
556
556
  const o = setTimeout(() => s(new Error(n)), e);
557
557
  t.then(
@@ -568,9 +568,9 @@ class so {
568
568
  constructor(e, n) {
569
569
  this.options = e, this.transportIdentity = n, this.personalModelSelectionOverride = e.productVariant === "personal" && fi(e.model) ? e.model : null, this.state = {
570
570
  ...this.state,
571
- starterPrompts: yp(e.initialStarterPrompts)
571
+ starterPrompts: _p(e.initialStarterPrompts)
572
572
  };
573
- const i = e.restorePersistedState === !1 ? null : uc(e.clientId, e.expectedPersistedSessionId);
573
+ const i = e.restorePersistedState === !1 ? null : gc(e.clientId, e.expectedPersistedSessionId);
574
574
  i && (this.state = {
575
575
  ...this.state,
576
576
  ...i,
@@ -591,9 +591,9 @@ class so {
591
591
  taskStatus: null,
592
592
  isRetrying: !1,
593
593
  lastError: null
594
- }), this.queuedClientEvents = bc(
595
- hc(e.clientId),
596
- fc(e.clientId)
594
+ }), this.queuedClientEvents = yc(
595
+ fc(e.clientId),
596
+ mc(e.clientId)
597
597
  );
598
598
  const s = [...this.queuedClientEvents].reverse().find(
599
599
  (o) => o.type === "chat.user_message" && typeof o.clientMessageId == "string"
@@ -706,10 +706,10 @@ class so {
706
706
  n.skipStoredTransportIdentityCollisionCheck === !0
707
707
  ), s = new so({
708
708
  ...e,
709
- backendUrl: op(e.backendUrl ?? Sd),
710
- clientId: e.clientId ?? Ip(),
709
+ backendUrl: rp(e.backendUrl ?? vd),
710
+ clientId: e.clientId ?? Tp(),
711
711
  productVariant: e.productVariant ?? "customer_embedded",
712
- entrySurface: rp(e.entrySurface)
712
+ entrySurface: ap(e.entrySurface)
713
713
  }, i);
714
714
  try {
715
715
  Nl().catch((o) => {
@@ -743,14 +743,14 @@ class so {
743
743
  this.state.status === "reconnecting" ? { status: "reconnecting" } : { status: "connecting", lastError: null }
744
744
  );
745
745
  try {
746
- if (this.token = this.options.token ?? (this.options.tokenProvider ? await Wd(this.options.tokenProvider(), Id, "Pluno token provider timed out") : null), e !== this.connectionAttemptId || this.state.status === "closed")
746
+ if (this.token = this.options.token ?? (this.options.tokenProvider ? await Fd(this.options.tokenProvider(), Td, "Pluno token provider timed out") : null), e !== this.connectionAttemptId || this.state.status === "closed")
747
747
  return;
748
748
  if (!this.token && !this.options.webSocketFactory)
749
749
  throw new Error("Pluno requires a token or tokenProvider");
750
- const n = lp(this.options.backendUrl), i = this.options.webSocketFactory?.(n) ?? new WebSocket(n);
750
+ const n = dp(this.options.backendUrl), i = this.options.webSocketFactory?.(n) ?? new WebSocket(n);
751
751
  this.socket = i, this.socketConnectTimer = window.setTimeout(() => {
752
752
  this.socket === i && i.readyState === WebSocket.CONNECTING && (X("web-sdk.agent", "Pluno socket opening timed out; reconnecting"), this.replaceTimedOutSocket(i));
753
- }, Td), i.addEventListener("open", () => {
753
+ }, Cd), i.addEventListener("open", () => {
754
754
  this.socket !== i || (this.clearSocketConnectTimer(), X("web-sdk.agent", "Pluno socket opened", {
755
755
  queuedClientEventCount: this.queuedClientEvents.length,
756
756
  isThinking: this.state.isThinking
@@ -762,13 +762,13 @@ class so {
762
762
  pageUrl: location.href
763
763
  }) : !0)) || (this.socketAuthTimer = window.setTimeout(() => {
764
764
  this.socket === i && (X("web-sdk.agent", "Pluno socket authentication timed out; reconnecting"), this.replaceTimedOutSocket(i));
765
- }, Cd));
765
+ }, kd));
766
766
  }), i.addEventListener("message", (s) => {
767
- this.socket === i && this.handleServerEvent(wp(s.data));
767
+ this.socket === i && this.handleServerEvent(bp(s.data));
768
768
  }), i.addEventListener("sendfailure", (s) => {
769
769
  if (this.socket !== i)
770
770
  return;
771
- const o = bp(s?.detail?.data);
771
+ const o = yp(s?.detail?.data);
772
772
  o?.type === "chat.user_message" && o.clientMessageId === this.pendingClientMessageId && !this.queuedClientEvents.some(
773
773
  (r) => r.type === "chat.user_message" && r.clientMessageId === o.clientMessageId
774
774
  ) && (this.queuedClientEvents.push(o), Lt(this.options.clientId, this.queuedClientEvents), this.setState({ pendingMessageStatus: "reconnecting" })), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.socket = null, this.setReconnectingState(), this.scheduleReconnect(), i.readyState !== WebSocket.CLOSED && i.readyState !== WebSocket.CLOSING && i.close();
@@ -804,7 +804,7 @@ class so {
804
804
  this.connectionAttemptId += 1, this.setState({ status: "closed", pendingMessageStatus: null, isThinking: !1, isRetrying: !1 }), this.clearSocketPhaseTimers(), this.stopHeartbeat(), this.clearStarterPromptUrlRefreshTimer(), this.clearRetryTimers(), this.clearThinkingWatchdog(), this.clearPendingDeliveryTimers(), this.pendingClientMessageId = null, this.pendingUserMessageEvent = null, this.failedUserMessageEvent = null, this.clearSessionLoadRequest(), this.rejectPendingSessionHistoryRequests("Pluno disconnected."), this.rejectPendingSessionMutationRequests(this.pendingSessionPinRequests, "Pluno disconnected."), this.rejectPendingSessionMutationRequests(this.pendingSessionRenameRequests, "Pluno disconnected."), this.reconnectTimer !== null && (window.clearTimeout(this.reconnectTimer), this.reconnectTimer = null), this.queuedClientEvents = [], this.pendingWidgetLifecycleEvents = [], this.clearPendingWarmupAckTimer(), this.pendingPassiveWarmupEvent = null, this.pendingComposerWarmup = null, this.activeComposerWarmupId = null, this.activeComposerWarmupScope = null, this.nonTranscriptToolCallIds.clear(), this.socket?.close(), this.socket = null;
805
805
  }
806
806
  destroy() {
807
- this.disconnect(), this.locationChangeCleanup?.(), this.locationChangeCleanup = null, this.cleanupSessionBrowserApis(), this.pageLifecycleCleanup?.(), this.pageLifecycleCleanup = null, this.activeBrowserToolCalls.clear(), yc(this.options.clientId), this.transportIdentity.release(), this.networkCaptureCleanup?.(), this.networkCaptureCleanup = null, this.networkBatchTimer !== null && (window.clearTimeout(this.networkBatchTimer), this.networkBatchTimer = null), this.queuedNetworkEvents = [], this.detachedSessionIds.clear(), this.detachedClientMessageIds.clear(), this.deferredDetachedSessionEvents.clear();
807
+ this.disconnect(), this.locationChangeCleanup?.(), this.locationChangeCleanup = null, this.cleanupSessionBrowserApis(), this.pageLifecycleCleanup?.(), this.pageLifecycleCleanup = null, this.activeBrowserToolCalls.clear(), _c(this.options.clientId), this.transportIdentity.release(), this.networkCaptureCleanup?.(), this.networkCaptureCleanup = null, this.networkBatchTimer !== null && (window.clearTimeout(this.networkBatchTimer), this.networkBatchTimer = null), this.queuedNetworkEvents = [], this.detachedSessionIds.clear(), this.detachedClientMessageIds.clear(), this.deferredDetachedSessionEvents.clear();
808
808
  for (const e of Object.values(this.listeners))
809
809
  e?.clear();
810
810
  }
@@ -911,7 +911,7 @@ class so {
911
911
  sessionId: this.state.sessionId ?? void 0,
912
912
  clientMessageId: l,
913
913
  initiatedBy: n.initiatedBy,
914
- invocation: ap(n.invocation ?? n.initiatedBy),
914
+ invocation: lp(n.invocation ?? n.initiatedBy),
915
915
  entrySurface: this.options.entrySurface,
916
916
  content: i,
917
917
  pageContent: I && oo() || void 0,
@@ -1050,7 +1050,7 @@ class so {
1050
1050
  const i = await this.fetchEmbedAttachmentUpload(e);
1051
1051
  if (i.ok)
1052
1052
  return await i.json();
1053
- if (Nc(i.status) && this.options.tokenProvider && !n) {
1053
+ if (Oc(i.status) && this.options.tokenProvider && !n) {
1054
1054
  n = !0;
1055
1055
  const s = await this.fetchEmbedAttachmentUpload(e);
1056
1056
  if (s.ok)
@@ -1075,7 +1075,7 @@ class so {
1075
1075
  if (!this.state.sessionId)
1076
1076
  return;
1077
1077
  this.send({ type: "run.stop", sessionId: this.state.sessionId, reason: "user_requested" });
1078
- const e = nc(
1078
+ const e = ic(
1079
1079
  this.state.messages,
1080
1080
  this.state.assistantDraftRespondsToUserMessageId,
1081
1081
  this.state.assistantDraftRunId,
@@ -1283,7 +1283,7 @@ class so {
1283
1283
  });
1284
1284
  if (!u.ok) {
1285
1285
  const h = await u.text() || `History request failed (${u.status})`;
1286
- throw _d(u.status) ? new Error(h) : new si(h);
1286
+ throw Sd(u.status) ? new Error(h) : new si(h);
1287
1287
  }
1288
1288
  const p = await u.json();
1289
1289
  if (!p?.session || !Array.isArray(p.items))
@@ -1390,7 +1390,7 @@ class so {
1390
1390
  if (this.state.starterPromptsLoading || this.transientStarterPromptsRequestInFlight || this.transientStarterPromptsRequestAttempted)
1391
1391
  return;
1392
1392
  this.transientStarterPromptsRequestInFlight = !0, this.transientStarterPromptsRequestAttempted = !0, this.setState({ starterPromptsLoading: !0 });
1393
- const e = dp();
1393
+ const e = pp();
1394
1394
  this.sendNow(
1395
1395
  Fe({
1396
1396
  type: "starter_prompts.page_context",
@@ -1401,13 +1401,13 @@ class so {
1401
1401
  ) || (this.transientStarterPromptsRequestInFlight = !1, this.transientStarterPromptsRequestAttempted = !1, this.setState({ starterPromptsLoading: !1 }));
1402
1402
  }
1403
1403
  startStarterPromptUrlWatcher() {
1404
- this.locationChangeCleanup || (this.locationChangeCleanup = pp(() => this.handleStarterPromptUrlChange()));
1404
+ this.locationChangeCleanup || (this.locationChangeCleanup = cp(() => this.handleStarterPromptUrlChange()));
1405
1405
  }
1406
1406
  handleStarterPromptUrlChange() {
1407
1407
  const e = location.href;
1408
1408
  e !== this.lastStarterPromptPageUrl && (this.activeComposerWarmupScope && !this.activeComposerWarmupScope.endsWith(`:${e}`) && this.clearPendingComposerWarmup(), this.lastStarterPromptPageUrl = e, this.clearStarterPromptUrlRefreshTimer(), this.starterPromptUrlRefreshTimer = window.setTimeout(() => {
1409
1409
  this.starterPromptUrlRefreshTimer = null, this.refreshStarterPromptsForCurrentUrl();
1410
- }, zd));
1410
+ }, Bd));
1411
1411
  }
1412
1412
  refreshStarterPromptsForCurrentUrl() {
1413
1413
  this.socket?.readyState !== WebSocket.OPEN || this.state.status === "closed" || (this.setState({ starterPromptsLoading: this.state.messages.length === 0 }), this.sendNow({
@@ -1454,8 +1454,8 @@ class so {
1454
1454
  return;
1455
1455
  this.clearPendingWarmupAckTimer();
1456
1456
  const n = Math.min(
1457
- kd * 2 ** e.retryAttempt,
1458
- Ed
1457
+ Ed * 2 ** e.retryAttempt,
1458
+ Ad
1459
1459
  );
1460
1460
  e.retryAttempt += 1, this.pendingWarmupAckTimer = window.setTimeout(() => {
1461
1461
  this.pendingWarmupAckTimer = null, this.flushPendingComposerWarmup();
@@ -1579,16 +1579,16 @@ class so {
1579
1579
  this.activeResponseRunId = n, this.setState({ turnPhase: "thinking", lastError: null }), this.markThinkingProgress();
1580
1580
  return;
1581
1581
  }
1582
- if ($d(e) && this.markThinkingProgress(), e.type === "auth.ok") {
1582
+ if (jd(e) && this.markThinkingProgress(), e.type === "auth.ok") {
1583
1583
  this.clearSocketAuthTimer(), this.reconnectAttempts = 0;
1584
- const n = Tp(e.user);
1584
+ const n = Cp(e.user);
1585
1585
  this.authenticatedSocket !== this.socket && this.authenticatedUserId && n && n.id !== this.authenticatedUserId && this.resetForAuthenticationScopeChange(), this.authenticatedUserId = n?.id ?? null, this.authenticatedSocket = this.socket, this.flushPendingWidgetLifecycleEvents(), this.flushPendingComposerWarmup(), this.flushQueuedClientEvents(), this.pendingClientMessageId && (this.setState({ pendingMessageStatus: "sending" }), this.schedulePendingDeliveryAck(this.pendingClientMessageId)), this.flushPendingPassiveWarmup(), this.startHeartbeat();
1586
- const i = _p(e), s = Object.prototype.hasOwnProperty.call(e, "appearance");
1586
+ const i = Sp(e), s = Object.prototype.hasOwnProperty.call(e, "appearance");
1587
1587
  X("web-sdk.agent", "Received auth.ok appearance", {
1588
1588
  hasAppearance: s,
1589
1589
  rawAppearance: e.appearance,
1590
1590
  normalizedAppearance: i
1591
- }), this.runtimeHelperJavascript = Sp(e.runtimeHelpers)?.javascript ?? null;
1591
+ }), this.runtimeHelperJavascript = vp(e.runtimeHelpers)?.javascript ?? null;
1592
1592
  const o = ur(e, "starterPrompts"), r = Object.prototype.hasOwnProperty.call(e, "starterPrompts"), l = e.starterPromptsLoading === !0, d = {
1593
1593
  user: n,
1594
1594
  status: "connected",
@@ -1626,7 +1626,7 @@ class so {
1626
1626
  runId: d?.runId
1627
1627
  }), u = this.filterStoppedSnapshotItems(n, i), p = e.pendingMessageStatus === "sending" ? "sending" : e.pendingMessageStatus === "queued" ? "reconnecting" : null, h = typeof e.pendingClientMessageId == "string" ? e.pendingClientMessageId : null, y = e.isRetrying === !0, b = e.turnPhase === "sending" || e.turnPhase === "starting" || e.turnPhase === "thinking" ? e.turnPhase : null;
1628
1628
  p && h && (this.pendingClientMessageId = h);
1629
- let f = Lp(
1629
+ let f = Dp(
1630
1630
  e.assistantDraft
1631
1631
  );
1632
1632
  f && this.findStoppedTurn(i, {
@@ -1635,9 +1635,9 @@ class so {
1635
1635
  }) && (f = void 0);
1636
1636
  const m = f !== void 0;
1637
1637
  this.rememberUserMessageClientMessageIds(u);
1638
- const I = Xp(u);
1638
+ const I = Jp(u);
1639
1639
  if (I) {
1640
- const R = Jp(u, I);
1640
+ const R = Zp(u, I);
1641
1641
  this.retryAttemptsByClientMessageId[I] = Math.max(
1642
1642
  this.retryAttemptsByClientMessageId[I] ?? 0,
1643
1643
  R
@@ -1656,12 +1656,12 @@ class so {
1656
1656
  H,
1657
1657
  q,
1658
1658
  B,
1659
- Zp(u, le)
1659
+ Qp(u, le)
1660
1660
  )
1661
- ), ee = m ? f?.content ?? "" : this.state.assistantDraft, ye = !!f?.content && !Z, $ = P && (!ee || Z), ge = Kp(A), k = $ && ge ? "completed" : c ? "stopped" : $ ? "failed" : null;
1662
- if (!P && Yp(this.state.messages, u))
1661
+ ), ee = m ? f?.content ?? "" : this.state.assistantDraft, ye = !!f?.content && !Z, $ = P && (!ee || Z), ge = Vp(A), k = $ && ge ? "completed" : c ? "stopped" : $ ? "failed" : null;
1662
+ if (!P && Xp(this.state.messages, u))
1663
1663
  return;
1664
- this.lastUserMessagePageUrl = Vp(u);
1664
+ this.lastUserMessagePageUrl = Yp(u);
1665
1665
  const W = $ || c ? null : Us(u);
1666
1666
  if (this.latestRecoverableClientMessageId = W, ge && this.clearRetryTimers(), this.setState({
1667
1667
  sessionId: J(e.session, "id") ?? this.state.sessionId,
@@ -1727,14 +1727,14 @@ class so {
1727
1727
  this.options.backendUrl
1728
1728
  );
1729
1729
  n === this.sessionActivityRequestId && (this.sessionActivityRequestId = null), this.setState({
1730
- messages: Wp(this.state.messages, s)
1730
+ messages: Fp(this.state.messages, s)
1731
1731
  });
1732
1732
  return;
1733
1733
  }
1734
1734
  if (e.type === "sessions.page") {
1735
1735
  const n = typeof e.requestId == "string" ? e.requestId : null, i = n ? this.pendingSessionHistoryRequests.get(n) : null;
1736
1736
  n && i && (window.clearTimeout(i.timeout), this.pendingSessionHistoryRequests.delete(n), i.resolve({
1737
- sessions: Cp(e.sessions),
1737
+ sessions: kp(e.sessions),
1738
1738
  nextCursor: typeof e.nextCursor == "string" ? e.nextCursor : null
1739
1739
  }));
1740
1740
  return;
@@ -1777,8 +1777,8 @@ class so {
1777
1777
  return;
1778
1778
  const i = ma(e.item, this.options.backendUrl);
1779
1779
  if (i) {
1780
- const s = ic(n, i), o = i.callId ? this.pendingToolLoadingByCallId.get(i.callId) : void 0;
1781
- i.callId && o !== void 0 && (i.loading = o, this.pendingToolLoadingByCallId.delete(i.callId)), rt(i) && (this.retryableClientMessageId = null, this.clearRetryTimers(), this.clearRunAckResyncRetryTimer()), ec(n) && this.clearRunAckResyncRetryTimer();
1780
+ const s = sc(n, i), o = i.callId ? this.pendingToolLoadingByCallId.get(i.callId) : void 0;
1781
+ i.callId && o !== void 0 && (i.loading = o, this.pendingToolLoadingByCallId.delete(i.callId)), rt(i) && (this.retryableClientMessageId = null, this.clearRetryTimers(), this.clearRunAckResyncRetryTimer()), tc(n) && this.clearRunAckResyncRetryTimer();
1782
1782
  const r = Ds(this.state.messages, i), l = hr(r), d = mr(
1783
1783
  n,
1784
1784
  this.state.assistantDraft,
@@ -1861,7 +1861,7 @@ class so {
1861
1861
  );
1862
1862
  this.setState({
1863
1863
  sessionId: n,
1864
- messages: Np(
1864
+ messages: Op(
1865
1865
  d,
1866
1866
  typeof e.responseId == "string" ? e.responseId : null,
1867
1867
  i,
@@ -1884,9 +1884,9 @@ class so {
1884
1884
  if (n)
1885
1885
  this.nonTranscriptToolCallIds.add(n);
1886
1886
  else {
1887
- const i = zp(e);
1887
+ const i = Bp(e);
1888
1888
  if (i) {
1889
- const s = Op(
1889
+ const s = qp(
1890
1890
  this.state.messages,
1891
1891
  i
1892
1892
  );
@@ -1953,7 +1953,7 @@ class so {
1953
1953
  this.state.messages,
1954
1954
  c,
1955
1955
  u
1956
- ), h = Gp(
1956
+ ), h = Kp(
1957
1957
  p,
1958
1958
  c,
1959
1959
  u
@@ -2193,7 +2193,7 @@ class so {
2193
2193
  ...this.state.isThinking ? {} : { turnPhase: null },
2194
2194
  isRetrying: !1,
2195
2195
  ...this.state.isThinking ? {} : { taskStatus: "failed" },
2196
- lastError: Md,
2196
+ lastError: Pd,
2197
2197
  lastErrorCode: "message_delivery_failed"
2198
2198
  });
2199
2199
  }
@@ -2208,7 +2208,7 @@ class so {
2208
2208
  n,
2209
2209
  typeof e.runId == "string" ? e.runId : null
2210
2210
  ), !(!this.state.isThinking || !n) && this.setState({
2211
- messages: oc(
2211
+ messages: rc(
2212
2212
  this.state.messages,
2213
2213
  n
2214
2214
  )
@@ -2323,7 +2323,7 @@ class so {
2323
2323
  if (!n || !i || !s)
2324
2324
  return;
2325
2325
  const l = s === "execute_code", d = s === "execute_code_in_browser_tab" && r !== null && typeof r == "object" && r.tabId === "local:current";
2326
- if (!l && !d || !Ic(r)) {
2326
+ if (!l && !d || !Tc(r)) {
2327
2327
  this.setToolMessageLoading(i, !1), this.send({
2328
2328
  type: "tool.result",
2329
2329
  sessionId: n,
@@ -2372,7 +2372,7 @@ class so {
2372
2372
  let c = null, u;
2373
2373
  c = await this.executeRuntimeHelper(), u = await pr(
2374
2374
  r,
2375
- ip(e.runtimeContext, this.options.backendUrl)
2375
+ sp(e.runtimeContext, this.options.backendUrl)
2376
2376
  ).catch((p) => ({
2377
2377
  ok: !1,
2378
2378
  exception: {
@@ -2385,11 +2385,11 @@ class so {
2385
2385
  toolName: s,
2386
2386
  summary: r.summary,
2387
2387
  rawInput: Fe(r),
2388
- rawOutput: Fe(vp(u, c))
2388
+ rawOutput: Fe(xp(u, c))
2389
2389
  }), yr(this.options.clientId, this.activeBrowserToolCalls.values()));
2390
2390
  }
2391
2391
  setToolMessageLoading(e, n) {
2392
- const i = qp(
2392
+ const i = zp(
2393
2393
  this.state.messages,
2394
2394
  e,
2395
2395
  n
@@ -2407,10 +2407,10 @@ class so {
2407
2407
  };
2408
2408
  }
2409
2409
  installSessionBrowserApis() {
2410
- this.cleanupSessionBrowserApis(), this.sessionBrowserApisCleanup = Kd();
2410
+ this.cleanupSessionBrowserApis(), this.sessionBrowserApisCleanup = Vd();
2411
2411
  }
2412
2412
  cleanupSessionBrowserApis() {
2413
- this.sessionBrowserApisCleanup && (tp(this.sessionBrowserApisCleanup), this.sessionBrowserApisCleanup = null);
2413
+ this.sessionBrowserApisCleanup && (np(this.sessionBrowserApisCleanup), this.sessionBrowserApisCleanup = null);
2414
2414
  }
2415
2415
  async executeRuntimeHelper() {
2416
2416
  if (!this.runtimeHelperJavascript?.trim())
@@ -2418,15 +2418,15 @@ class so {
2418
2418
  const e = await pr({
2419
2419
  javascript: this.runtimeHelperJavascript
2420
2420
  });
2421
- return e.ok === !1 ? xp(e) : null;
2421
+ return e.ok === !1 ? Ip(e) : null;
2422
2422
  }
2423
2423
  enableNetworkCapture() {
2424
- this.networkCaptureCleanup || (this.networkCaptureCleanup = Fd((e) => {
2425
- Mc(e.url, this.options.backendUrl) || this.enqueueNetworkEvent(e);
2424
+ this.networkCaptureCleanup || (this.networkCaptureCleanup = Hd((e) => {
2425
+ Pc(e.url, this.options.backendUrl) || this.enqueueNetworkEvent(e);
2426
2426
  }));
2427
2427
  }
2428
2428
  enqueueNetworkEvent(e) {
2429
- this.queuedNetworkEvents.length >= Rd || (this.queuedNetworkEvents.push(Ac(e)), this.networkBatchTimer === null && (this.networkBatchTimer = window.setTimeout(() => {
2429
+ this.queuedNetworkEvents.length >= Ld || (this.queuedNetworkEvents.push(Mc(e)), this.networkBatchTimer === null && (this.networkBatchTimer = window.setTimeout(() => {
2430
2430
  this.networkBatchTimer = null;
2431
2431
  const n = this.queuedNetworkEvents.splice(0, this.queuedNetworkEvents.length);
2432
2432
  n.length === 0 || this.socket?.readyState !== WebSocket.OPEN || this.sendNow({
@@ -2435,12 +2435,12 @@ class so {
2435
2435
  page: we(),
2436
2436
  events: n
2437
2437
  });
2438
- }, Pd)));
2438
+ }, Rd)));
2439
2439
  }
2440
2440
  scheduleReconnect() {
2441
2441
  if (this.reconnectTimer !== null || this.state.status === "closed")
2442
2442
  return;
2443
- const e = Bd(this.reconnectAttempts);
2443
+ const e = Wd(this.reconnectAttempts);
2444
2444
  this.reconnectAttempts += 1, this.reconnectTimer = window.setTimeout(() => {
2445
2445
  this.reconnectTimer = null, this.connect().catch((n) => {
2446
2446
  X("web-sdk.agent", "Pluno reconnect failed; retrying", {
@@ -2456,8 +2456,8 @@ class so {
2456
2456
  const e = this.socket;
2457
2457
  !e || !this.sendNow({ type: "runtime.ping" }) || (this.clearHeartbeatAckTimer(), this.heartbeatAckTimer = window.setTimeout(() => {
2458
2458
  this.socket === e && (X("web-sdk.agent", "Pluno heartbeat acknowledgement timed out; reconnecting"), this.replaceTimedOutSocket(e));
2459
- }, xd));
2460
- }, vd);
2459
+ }, Id));
2460
+ }, xd);
2461
2461
  }
2462
2462
  stopHeartbeat() {
2463
2463
  this.heartbeatTimer !== null && (window.clearInterval(this.heartbeatTimer), this.heartbeatTimer = null), this.clearHeartbeatAckTimer();
@@ -2495,7 +2495,7 @@ class so {
2495
2495
  ...e.lastError === null && e.lastErrorCode === void 0 ? { lastErrorCode: null } : {},
2496
2496
  ...e.lastError !== void 0 && e.lastErrorSecuritySettingsUrl === void 0 ? { lastErrorSecuritySettingsUrl: null } : {}
2497
2497
  };
2498
- this.state = r, gc(this.options.clientId, this.state), this.emit("state", this.getState()), hs("state", this.state.status, {
2498
+ this.state = r, hc(this.options.clientId, this.state), this.emit("state", this.getState()), hs("state", this.state.status, {
2499
2499
  status: this.state.status,
2500
2500
  sessionId: this.state.sessionId,
2501
2501
  messageCount: this.state.messages.length,
@@ -2518,13 +2518,13 @@ class so {
2518
2518
  }
2519
2519
  }
2520
2520
  const ms = /* @__PURE__ */ new WeakMap();
2521
- function Fd(t) {
2522
- const e = window.__plunoProductAgentNetworkCapture ?? Hd();
2521
+ function Hd(t) {
2522
+ const e = window.__plunoProductAgentNetworkCapture ?? $d();
2523
2523
  return e.subscribers.add(t), () => {
2524
2524
  e.subscribers.delete(t), !(e.subscribers.size > 0) && (e.destroy(), window.__plunoProductAgentNetworkCapture === e && delete window.__plunoProductAgentNetworkCapture);
2525
2525
  };
2526
2526
  }
2527
- function Hd() {
2527
+ function $d() {
2528
2528
  const t = /* @__PURE__ */ new Set(), e = (h) => {
2529
2529
  t.forEach((y) => {
2530
2530
  try {
@@ -2541,7 +2541,7 @@ function Hd() {
2541
2541
  throw I;
2542
2542
  }
2543
2543
  try {
2544
- const I = y instanceof Request ? y : null, _ = Tc(y, I), T = Ma(b?.headers ?? I?.headers);
2544
+ const I = y instanceof Request ? y : null, _ = Cc(y, I), T = Ma(b?.headers ?? I?.headers);
2545
2545
  if (!Yt(_, T, b?.body)) {
2546
2546
  const P = {
2547
2547
  requestId: ys("fetch"),
@@ -2554,7 +2554,7 @@ function Hd() {
2554
2554
  };
2555
2555
  m.then(
2556
2556
  (z) => {
2557
- Cc(z, P, f, e).catch(() => {
2557
+ kc(z, P, f, e).catch(() => {
2558
2558
  e({
2559
2559
  ...P,
2560
2560
  responseStatus: z.status,
@@ -2596,7 +2596,7 @@ function Hd() {
2596
2596
  () => {
2597
2597
  queueMicrotask(() => {
2598
2598
  try {
2599
- const f = Rc(this.getAllResponseHeaders());
2599
+ const f = Lc(this.getAllResponseHeaders());
2600
2600
  e({
2601
2601
  requestId: b.requestId,
2602
2602
  url: b.url,
@@ -2606,7 +2606,7 @@ function Hd() {
2606
2606
  resourceType: "xhr",
2607
2607
  responseStatus: this.status,
2608
2608
  responseHeaders: f,
2609
- responseBody: Ec(this, f),
2609
+ responseBody: Ac(this, f),
2610
2610
  errorText: this.status === 0 ? "XHR request failed or was aborted" : void 0,
2611
2611
  startedAt: b.startedAt,
2612
2612
  durationMs: Date.now() - b.startedAtMs
@@ -2702,7 +2702,7 @@ function dr(t) {
2702
2702
  const e = typeof t == "function" ? t() : t;
2703
2703
  return e && Object.keys(e).length > 0 ? e : void 0;
2704
2704
  }
2705
- function $d(t) {
2705
+ function jd(t) {
2706
2706
  return t.type === "run.model_started" || t.type === "conversation.state" || t.type === "session.updated" || t.type === "session.item" || t.type === "chat.assistant_delta" || t.type === "chat.assistant_done" || t.type === "tool.call";
2707
2707
  }
2708
2708
  function ri(t) {
@@ -2723,27 +2723,27 @@ function Rt(t) {
2723
2723
  }
2724
2724
  return null;
2725
2725
  }
2726
- const jd = 5e3, Gd = 12e4;
2727
- function Kd() {
2726
+ const Gd = 5e3, Kd = 12e4;
2727
+ function Vd() {
2728
2728
  const t = [
2729
- Yd(),
2730
- Vd()
2729
+ Xd(),
2730
+ Yd()
2731
2731
  ].filter((e) => typeof e == "function");
2732
2732
  return () => {
2733
2733
  for (const e of t.reverse())
2734
2734
  e();
2735
2735
  };
2736
2736
  }
2737
- function Vd() {
2737
+ function Yd() {
2738
2738
  return ia(globalThis, "getPageSnapshot", async () => oo());
2739
2739
  }
2740
- function Yd() {
2740
+ function Xd() {
2741
2741
  return ia(globalThis, "pageImages", {
2742
- inspectImage: async (e, n) => await Xd(e, n)
2742
+ inspectImage: async (e, n) => await Jd(e, n)
2743
2743
  });
2744
2744
  }
2745
- async function Xd(t, e = {}) {
2746
- const n = ep(e.name), i = await Jd(t);
2745
+ async function Jd(t, e = {}) {
2746
+ const n = tp(e.name), i = await Zd(t);
2747
2747
  return i.ok ? i.sizeBytes > 8 * 1024 * 1024 ? {
2748
2748
  type: "pluno.pageImages.inspectImage",
2749
2749
  imageAttached: !1,
@@ -2761,15 +2761,15 @@ async function Xd(t, e = {}) {
2761
2761
  imageAttachmentError: i.error
2762
2762
  };
2763
2763
  }
2764
- async function Jd(t) {
2764
+ async function Zd(t) {
2765
2765
  return t instanceof Blob ? t.type.startsWith("image/") ? t.size === 0 ? { ok: !1, error: "Page image is empty." } : t.size > 8 * 1024 * 1024 ? { ok: !1, error: da } : {
2766
2766
  ok: !0,
2767
2767
  mimeType: t.type,
2768
2768
  sizeBytes: t.size,
2769
- dataUrl: await np(t)
2770
- } : { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : typeof t != "string" ? { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : Zd(t);
2769
+ dataUrl: await ip(t)
2770
+ } : { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : typeof t != "string" ? { ok: !1, error: "Page image must be an image Blob or complete data:image/* URL." } : Qd(t);
2771
2771
  }
2772
- function Zd(t) {
2772
+ function Qd(t) {
2773
2773
  if (!t.startsWith("data:") || !t.includes(","))
2774
2774
  return { ok: !1, error: "Page image must be a complete data:image/* URL, not bare base64." };
2775
2775
  const [e, n] = t.slice(5).split(",", 2), i = e.split(";").map((l) => l.trim()).filter(Boolean), s = i[0] ?? "";
@@ -2780,7 +2780,7 @@ function Zd(t) {
2780
2780
  const o = n.replace(/[ \t\r\n\f]+/g, "");
2781
2781
  if (!/^[A-Za-z0-9+/]*={0,2}$/.test(o))
2782
2782
  return { ok: !1, error: "Page image data URL has invalid base64." };
2783
- const r = Qd(o);
2783
+ const r = ep(o);
2784
2784
  return r === null ? { ok: !1, error: "Page image data URL has invalid base64." } : r === 0 ? { ok: !1, error: "Page image is empty." } : {
2785
2785
  ok: !0,
2786
2786
  mimeType: s,
@@ -2788,22 +2788,22 @@ function Zd(t) {
2788
2788
  dataUrl: `data:${s};base64,${o}`
2789
2789
  };
2790
2790
  }
2791
- function Qd(t) {
2791
+ function ep(t) {
2792
2792
  if (t.length === 0 || t.length % 4 !== 0)
2793
2793
  return null;
2794
2794
  const e = t.length - t.replace(/=+$/, "").length;
2795
2795
  return e > 2 ? null : t.length / 4 * 3 - e;
2796
2796
  }
2797
- function ep(t) {
2797
+ function tp(t) {
2798
2798
  return (typeof t == "string" ? t.trim() : "") || "Page image";
2799
2799
  }
2800
- function tp(t) {
2800
+ function np(t) {
2801
2801
  try {
2802
2802
  t();
2803
2803
  } catch {
2804
2804
  }
2805
2805
  }
2806
- function np(t) {
2806
+ function ip(t) {
2807
2807
  return new Promise((e, n) => {
2808
2808
  const i = new FileReader();
2809
2809
  i.onload = () => {
@@ -2817,7 +2817,7 @@ function np(t) {
2817
2817
  }
2818
2818
  async function pr(t, e) {
2819
2819
  const n = Object.getPrototypeOf(async function() {
2820
- }).constructor, i = t.timeoutMs ?? jd, s = Date.now(), o = [];
2820
+ }).constructor, i = t.timeoutMs ?? Gd, s = Date.now(), o = [];
2821
2821
  let r;
2822
2822
  const l = {
2823
2823
  log: console.log,
@@ -2835,7 +2835,7 @@ async function pr(t, e) {
2835
2835
  r = window.setTimeout(() => p(c), i);
2836
2836
  })
2837
2837
  ]);
2838
- return u === c ? sp(i) : {
2838
+ return u === c ? op(i) : {
2839
2839
  ok: !0,
2840
2840
  result: u,
2841
2841
  console: o,
@@ -2864,7 +2864,7 @@ async function pr(t, e) {
2864
2864
  e?.deactivate(), r !== void 0 && window.clearTimeout(r), console.log = l.log, console.info = l.info, console.warn = l.warn, console.error = l.error;
2865
2865
  }
2866
2866
  }
2867
- function ip(t, e) {
2867
+ function sp(t, e) {
2868
2868
  if (!t || typeof t != "object")
2869
2869
  return;
2870
2870
  const n = t.sandboxFilesToken;
@@ -2874,7 +2874,7 @@ function ip(t, e) {
2874
2874
  const s = () => {
2875
2875
  if (!i)
2876
2876
  throw new Error("sandboxFiles is only available during browser-code execution");
2877
- }, o = async (l, d) => await fd(`${e.replace(/\/$/, "")}${l}`, d);
2877
+ }, o = async (l, d) => await md(`${e.replace(/\/$/, "")}${l}`, d);
2878
2878
  return {
2879
2879
  value: Object.freeze({
2880
2880
  upload: async (l) => {
@@ -2908,7 +2908,7 @@ function ip(t, e) {
2908
2908
  }
2909
2909
  };
2910
2910
  }
2911
- function sp(t) {
2911
+ function op(t) {
2912
2912
  return {
2913
2913
  ok: !1,
2914
2914
  exception: {
@@ -2922,10 +2922,10 @@ function sp(t) {
2922
2922
  }
2923
2923
  };
2924
2924
  }
2925
- function op(t) {
2925
+ function rp(t) {
2926
2926
  return t.replace(/\/+$/, "");
2927
2927
  }
2928
- function rp(t) {
2928
+ function ap(t) {
2929
2929
  const e = {
2930
2930
  sidepanel: "extension_sidepanel",
2931
2931
  browser_extension_page_ui: "extension_widget",
@@ -2937,13 +2937,13 @@ function rp(t) {
2937
2937
  };
2938
2938
  return t && t in e ? e[t] : t ?? "embedded_custom_ui";
2939
2939
  }
2940
- function ap(t) {
2940
+ function lp(t) {
2941
2941
  return t === "pluno" ? "scheduled_continuation" : t ?? "user";
2942
2942
  }
2943
2943
  function ca(t, e = location.origin) {
2944
2944
  return /origin (?:is not allowed|does not match browser origin)/i.test(t) ? `Pluno widget blocked on ${e}: this domain is not allowed. Add ${e} in Pluno under Integration > Domains.` : null;
2945
2945
  }
2946
- function lp(t) {
2946
+ function dp(t) {
2947
2947
  const e = new URL("/api/product-agent/embed/ws", t);
2948
2948
  return e.protocol = e.protocol === "https:" ? "wss:" : "ws:", e.toString();
2949
2949
  }
@@ -2956,19 +2956,19 @@ function we() {
2956
2956
  ...t ? { plunoProductAgentUi: t } : {}
2957
2957
  };
2958
2958
  }
2959
- function dp() {
2959
+ function pp() {
2960
2960
  return {
2961
2961
  pageUrl: location.href,
2962
2962
  pageTitle: document.title,
2963
2963
  htmlContent: oo()
2964
2964
  };
2965
2965
  }
2966
- function pp(t) {
2967
- return mi.add(t), oi || (oi = cp()), () => {
2966
+ function cp(t) {
2967
+ return mi.add(t), oi || (oi = up()), () => {
2968
2968
  mi.delete(t), mi.size === 0 && (oi?.(), oi = null);
2969
2969
  };
2970
2970
  }
2971
- function cp() {
2971
+ function up() {
2972
2972
  const t = () => {
2973
2973
  for (const o of Array.from(mi))
2974
2974
  o();
@@ -2999,12 +2999,12 @@ function oo() {
2999
2999
  );
3000
3000
  for (const f of s.slice(0, 3))
3001
3001
  n("Active overlay", ws(Cn(f), e));
3002
- const o = up(), r = o ? ws(Cn(o), e) : "";
3002
+ const o = gp(), r = o ? ws(Cn(o), e) : "";
3003
3003
  n("Main page content", r), n("Additional visible page text", ws(Cn(document.body), e));
3004
3004
  const l = t.map(([f, m]) => `${f}:
3005
3005
  ${m}`).join(`
3006
3006
 
3007
- `).trim().slice(0, 12e3), d = gp(s, o).trim(), c = `Simplified DOM outline:
3007
+ `).trim().slice(0, 12e3), d = hp(s, o).trim(), c = `Simplified DOM outline:
3008
3008
  `, u = `
3009
3009
 
3010
3010
  Visible page text:
@@ -3032,10 +3032,10 @@ function ua(t) {
3032
3032
  const e = window.getComputedStyle(t);
3033
3033
  return e.display !== "none" && e.visibility !== "hidden" && t.getClientRects().length > 0;
3034
3034
  }
3035
- function up() {
3035
+ function gp() {
3036
3036
  return Array.from(document.querySelectorAll("main, [role='main'], article")).filter(ua).sort((t, e) => Cn(e).length - Cn(t).length)[0] ?? null;
3037
3037
  }
3038
- function gp(t, e) {
3038
+ function hp(t, e) {
3039
3039
  const n = /* @__PURE__ */ new Set([
3040
3040
  "main",
3041
3041
  "nav",
@@ -3115,7 +3115,7 @@ function gp(t, e) {
3115
3115
  "data-test",
3116
3116
  "data-qa",
3117
3117
  "data-cy"
3118
- ], c = ["aria-label", "placeholder", "data-testid", "data-test", "data-qa", "data-cy"], { priorityElements: u, priorityTargets: p } = hp(), h = new Set(t);
3118
+ ], c = ["aria-label", "placeholder", "data-testid", "data-test", "data-qa", "data-cy"], { priorityElements: u, priorityTargets: p } = fp(), h = new Set(t);
3119
3119
  e && h.add(e);
3120
3120
  let y = 0;
3121
3121
  const b = (T) => {
@@ -3185,7 +3185,7 @@ function gp(t, e) {
3185
3185
  `);
3186
3186
  }, I = [], _ = Jt(window.getSelection()?.toString() ?? "");
3187
3187
  _ && I.push(`--- selected text ---
3188
- ${JSON.stringify(_)}`), p.length > 0 && I.push(fp(p, n, d, r));
3188
+ ${JSON.stringify(_)}`), p.length > 0 && I.push(mp(p, n, d, r));
3189
3189
  for (const T of t.slice(0, 3))
3190
3190
  I.push(m(T, "active overlay DOM", /* @__PURE__ */ new Set()));
3191
3191
  if (e && I.push(m(e, "main DOM", /* @__PURE__ */ new Set())), document.body) {
@@ -3200,7 +3200,7 @@ function ga(t, e, n, i) {
3200
3200
  const s = t.tagName.toLowerCase();
3201
3201
  let o = s;
3202
3202
  const r = t.getAttribute("id");
3203
- r && mp(r) && (o += `#${r}`);
3203
+ r && wp(r) && (o += `#${r}`);
3204
3204
  for (const l of e) {
3205
3205
  const d = t.getAttribute(l);
3206
3206
  d && d.length <= 160 && (l !== "role" || !n.has(d)) && (o += `[${l}=${JSON.stringify(d)}]`);
@@ -3213,7 +3213,7 @@ function ga(t, e, n, i) {
3213
3213
  t.hasAttribute(l) && (o += `[${l}]`);
3214
3214
  return `${o}${i ? ` ${JSON.stringify(i)}` : ""}`;
3215
3215
  }
3216
- function hp() {
3216
+ function fp() {
3217
3217
  const t = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Map(), n = (l, d) => {
3218
3218
  if (!l)
3219
3219
  return;
@@ -3256,7 +3256,7 @@ function hp() {
3256
3256
  priorityTargets: Array.from(e, ([l, d]) => ({ element: l, labels: Array.from(d) }))
3257
3257
  };
3258
3258
  }
3259
- function fp(t, e, n, i) {
3259
+ function mp(t, e, n, i) {
3260
3260
  const s = ["--- active/current elements ---"];
3261
3261
  for (const o of t) {
3262
3262
  const r = [];
@@ -3292,7 +3292,7 @@ function ha(t) {
3292
3292
  Array.from(t.childNodes).filter((e) => e.nodeType === Node.TEXT_NODE).map((e) => e.textContent ?? "").join(" ")
3293
3293
  );
3294
3294
  }
3295
- function mp(t) {
3295
+ function wp(t) {
3296
3296
  return t.length <= 64 && /^[A-Za-z_][A-Za-z0-9_:.-]*$/.test(t) && !/[a-f0-9]{12,}/i.test(t) && !/:r[0-9a-z]+:/i.test(t);
3297
3297
  }
3298
3298
  function fa() {
@@ -3311,23 +3311,23 @@ function fa() {
3311
3311
  },
3312
3312
  {
3313
3313
  name: "widget_root",
3314
- selector: md,
3314
+ selector: wd,
3315
3315
  description: "Finds Pluno's widget root inside the widget host shadow root."
3316
3316
  },
3317
3317
  {
3318
3318
  name: "widget_panel",
3319
- selector: wd,
3319
+ selector: bd,
3320
3320
  description: "Finds Pluno's open chat panel inside the widget host shadow root."
3321
3321
  },
3322
3322
  {
3323
3323
  name: "widget_timeline",
3324
- selector: bd,
3324
+ selector: yd,
3325
3325
  description: "Finds Pluno's chat timeline inside the widget host shadow root."
3326
3326
  }
3327
3327
  ]
3328
3328
  };
3329
3329
  }
3330
- function wp(t) {
3330
+ function bp(t) {
3331
3331
  try {
3332
3332
  const e = JSON.parse(t);
3333
3333
  return e && typeof e == "object" ? e : { type: "error", message: "Invalid server event" };
@@ -3335,7 +3335,7 @@ function wp(t) {
3335
3335
  return { type: "error", message: "Invalid server event" };
3336
3336
  }
3337
3337
  }
3338
- function bp(t) {
3338
+ function yp(t) {
3339
3339
  if (typeof t != "string")
3340
3340
  return null;
3341
3341
  try {
@@ -3351,10 +3351,10 @@ function ur(t, e) {
3351
3351
  const n = t[e];
3352
3352
  return Array.isArray(n) ? n.filter((i) => typeof i == "string" && i.trim().length > 0) : [];
3353
3353
  }
3354
- function yp(t) {
3354
+ function _p(t) {
3355
3355
  return Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim().length > 0) : [];
3356
3356
  }
3357
- function _p(t) {
3357
+ function Sp(t) {
3358
3358
  if (!t || typeof t != "object")
3359
3359
  return null;
3360
3360
  const e = t, n = e.appearance, i = n && typeof n == "object" ? n : e, s = typeof i.accentColor == "string" ? i.accentColor : null, o = i.colorScheme === "dark" ? "dark" : i.colorScheme === "light" ? "light" : null, r = typeof i.fontFamily == "string" && i.fontFamily.trim() ? i.fontFamily : null, l = typeof i.scribbleStyle == "boolean" ? i.scribbleStyle : null;
@@ -3365,13 +3365,13 @@ function _p(t) {
3365
3365
  ...l !== null ? { scribbleStyle: l } : {}
3366
3366
  };
3367
3367
  }
3368
- function Sp(t) {
3368
+ function vp(t) {
3369
3369
  if (!t || typeof t != "object")
3370
3370
  return null;
3371
3371
  const e = t.javascript;
3372
3372
  return typeof e != "string" || !e.trim() ? null : { javascript: e };
3373
3373
  }
3374
- function vp(t, e) {
3374
+ function xp(t, e) {
3375
3375
  return e ? t && typeof t == "object" ? {
3376
3376
  ...t,
3377
3377
  helperError: e
@@ -3381,13 +3381,13 @@ function vp(t, e) {
3381
3381
  helperError: e
3382
3382
  } : t;
3383
3383
  }
3384
- function xp(t) {
3384
+ function Ip(t) {
3385
3385
  if (!t || typeof t != "object")
3386
3386
  return t;
3387
3387
  const e = t;
3388
3388
  return typeof e.exception?.message == "string" ? e.exception.message : typeof e.error == "string" ? e.error : t;
3389
3389
  }
3390
- function Ip() {
3390
+ function Tp() {
3391
3391
  const t = "pluno.productAgent.clientId", e = window.localStorage.getItem(t);
3392
3392
  if (e)
3393
3393
  return e;
@@ -3397,7 +3397,7 @@ function Ip() {
3397
3397
  function tt() {
3398
3398
  return crypto.randomUUID();
3399
3399
  }
3400
- function Tp(t) {
3400
+ function Cp(t) {
3401
3401
  if (!t || typeof t != "object")
3402
3402
  return null;
3403
3403
  const e = t, n = typeof e.id == "string" ? e.id : null;
@@ -3413,7 +3413,7 @@ function gr(t, e) {
3413
3413
  t.map((n) => ma(n, e)).filter((n) => n !== null)
3414
3414
  ) : [];
3415
3415
  }
3416
- function Cp(t) {
3416
+ function kp(t) {
3417
3417
  return Array.isArray(t) ? t.flatMap((e) => {
3418
3418
  if (!e || typeof e != "object")
3419
3419
  return [];
@@ -3449,7 +3449,7 @@ function ma(t, e) {
3449
3449
  role: o,
3450
3450
  ...s.phase === "commentary" || s.phase === "final_answer" ? { phase: s.phase } : {},
3451
3451
  content: Fl(
3452
- Dp(s.content),
3452
+ Up(s.content),
3453
3453
  e
3454
3454
  ),
3455
3455
  createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
@@ -3496,7 +3496,7 @@ function ma(t, e) {
3496
3496
  scheduledCheckInId: r.id ?? void 0,
3497
3497
  scheduledCheckInAt: r.dueAt
3498
3498
  };
3499
- const l = Ep(s.output), d = Ap(s.output);
3499
+ const l = Ap(s.output), d = Mp(s.output);
3500
3500
  return l ? {
3501
3501
  id: String(n.id ?? crypto.randomUUID()),
3502
3502
  role: "tool",
@@ -3526,7 +3526,7 @@ function ma(t, e) {
3526
3526
  return s.type === "function_call" || s.type === "tool_call" || s.type === "web_search_call" || s.type === "mcp_call" || s.type === "tab_lifecycle_decision" ? {
3527
3527
  id: String(n.id ?? crypto.randomUUID()),
3528
3528
  role: "tool",
3529
- content: s.type === "mcp_call" ? kp(s) : Pp(s),
3529
+ content: s.type === "mcp_call" ? Ep(s) : Rp(s),
3530
3530
  createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
3531
3531
  ...Me(s) !== null ? { causalSequence: Me(s) } : {},
3532
3532
  respondsToUserMessageId: He(s) ?? void 0,
@@ -3538,7 +3538,7 @@ function ma(t, e) {
3538
3538
  } : s.type === "run_status" || s.type === "run_error" ? s.type === "run_error" && s.stage === "tool_execution" ? null : {
3539
3539
  id: String(n.id ?? crypto.randomUUID()),
3540
3540
  role: "system",
3541
- content: Mp(s),
3541
+ content: Pp(s),
3542
3542
  createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
3543
3543
  ...Me(s) !== null ? { causalSequence: Me(s) } : {},
3544
3544
  respondsToUserMessageId: He(s) ?? void 0,
@@ -3550,11 +3550,11 @@ function ma(t, e) {
3550
3550
  ...typeof s.securitySettingsUrl == "string" ? { securitySettingsUrl: s.securitySettingsUrl } : {}
3551
3551
  } : null;
3552
3552
  }
3553
- function kp(t) {
3553
+ function Ep(t) {
3554
3554
  const n = (typeof t.server_label == "string" ? t.server_label : "").replace(/^pipedream_/, "").split(/[_-]+/).filter(Boolean).map((i) => `${i.charAt(0).toUpperCase()}${i.slice(1)}`).join(" ");
3555
3555
  return n ? `🔌 Using ${n}` : "🔌 Using connected integration";
3556
3556
  }
3557
- function Ep(t) {
3557
+ function Ap(t) {
3558
3558
  if (typeof t != "string")
3559
3559
  return null;
3560
3560
  try {
@@ -3571,7 +3571,7 @@ function Ep(t) {
3571
3571
  return null;
3572
3572
  }
3573
3573
  }
3574
- function Ap(t) {
3574
+ function Mp(t) {
3575
3575
  if (typeof t != "string")
3576
3576
  return null;
3577
3577
  try {
@@ -3586,10 +3586,10 @@ function Ap(t) {
3586
3586
  return null;
3587
3587
  }
3588
3588
  }
3589
- function Mp(t) {
3589
+ function Pp(t) {
3590
3590
  return t.type === "run_status" && t.status === "steered" ? "Steered" : typeof t.message == "string" && t.message.trim().length > 0 ? t.message : "";
3591
3591
  }
3592
- function Pp(t) {
3592
+ function Rp(t) {
3593
3593
  if (t.type === "web_search_call") {
3594
3594
  const e = t.action;
3595
3595
  if (e && typeof e == "object") {
@@ -3601,9 +3601,9 @@ function Pp(t) {
3601
3601
  }
3602
3602
  return "🔎 Searching the web";
3603
3603
  }
3604
- return Rp(t);
3604
+ return Lp(t);
3605
3605
  }
3606
- function Rp(t) {
3606
+ function Lp(t) {
3607
3607
  if (typeof t.summary == "string" && t.summary.trim().length > 0)
3608
3608
  return Xt(t.summary);
3609
3609
  if (typeof t.arguments == "string")
@@ -3620,7 +3620,7 @@ function Xt(t) {
3620
3620
  const e = t.trim() || "Run tool", n = e.codePointAt(0) ?? 0;
3621
3621
  return n >= 126976 && n <= 129791 || n >= 9728 && n <= 10175 || n >= 127462 && n <= 127487 ? e : `🛠️ ${e}`;
3622
3622
  }
3623
- function Lp(t) {
3623
+ function Dp(t) {
3624
3624
  if (t == null)
3625
3625
  return t;
3626
3626
  if (typeof t != "object")
@@ -3642,7 +3642,7 @@ function vn(t) {
3642
3642
  function Me(t) {
3643
3643
  return typeof t.causalSequence == "number" && Number.isSafeInteger(t.causalSequence) ? t.causalSequence : null;
3644
3644
  }
3645
- function Dp(t) {
3645
+ function Up(t) {
3646
3646
  return typeof t == "string" ? t : Array.isArray(t) ? t.map((e) => {
3647
3647
  if (!e || typeof e != "object")
3648
3648
  return "";
@@ -3651,9 +3651,9 @@ function Dp(t) {
3651
3651
  }).filter(Boolean).join("") : "";
3652
3652
  }
3653
3653
  function Ds(t, e) {
3654
- const n = ya(t, e), i = Bp(
3655
- Up(
3656
- jp(t, e),
3654
+ const n = ya(t, e), i = Wp(
3655
+ Np(
3656
+ Gp(t, e),
3657
3657
  n
3658
3658
  ),
3659
3659
  n
@@ -3665,7 +3665,7 @@ function Ds(t, e) {
3665
3665
  const o = [...i];
3666
3666
  return o[s] = n, Os(o);
3667
3667
  }
3668
- function Up(t, e) {
3668
+ function Np(t, e) {
3669
3669
  const n = e.assistantDraftItemId;
3670
3670
  return n ? t.map(
3671
3671
  (i) => i.dataType === "assistant_draft" && i.id === n ? e : i
@@ -3674,7 +3674,7 @@ function Up(t, e) {
3674
3674
  function bs(t, e, n) {
3675
3675
  return e !== null ? t.respondsToUserMessageId === e : n !== null && t.runId === n;
3676
3676
  }
3677
- function Np(t, e, n, i) {
3677
+ function Op(t, e, n, i) {
3678
3678
  if (n === null) return t;
3679
3679
  let s = -1;
3680
3680
  for (let r = t.length - 1; r >= 0; r -= 1) {
@@ -3691,7 +3691,7 @@ function Np(t, e, n, i) {
3691
3691
  respondsToUserMessageId: n
3692
3692
  }, o;
3693
3693
  }
3694
- function Op(t, e) {
3694
+ function qp(t, e) {
3695
3695
  const n = t.findIndex(
3696
3696
  (s) => !s.id.startsWith("transient-activity:") && s.callId === e.callId
3697
3697
  );
@@ -3708,12 +3708,12 @@ function Op(t, e) {
3708
3708
  ...i[n].runId ? {} : { runId: e.runId }
3709
3709
  }, i;
3710
3710
  }
3711
- function qp(t, e, n) {
3711
+ function zp(t, e, n) {
3712
3712
  let i = !1;
3713
3713
  const s = t.map((o) => o.callId !== e || o.loading === n ? o : (i = !0, { ...o, loading: n }));
3714
3714
  return i ? s : t;
3715
3715
  }
3716
- function zp(t) {
3716
+ function Bp(t) {
3717
3717
  if (t.hiddenFromTranscript === !0)
3718
3718
  return null;
3719
3719
  const e = typeof t.callId == "string" ? t.callId : null, n = typeof t.toolName == "string" ? t.toolName : null;
@@ -3733,7 +3733,7 @@ function zp(t) {
3733
3733
  loading: !0
3734
3734
  };
3735
3735
  }
3736
- function Bp(t, e) {
3736
+ function Wp(t, e) {
3737
3737
  if (e.id.startsWith("transient-activity:"))
3738
3738
  return t;
3739
3739
  const n = e.toolName === "tab_lifecycle";
@@ -3751,16 +3751,16 @@ function wa(t, e) {
3751
3751
  ba
3752
3752
  );
3753
3753
  }
3754
- function Wp(t, e) {
3754
+ function Fp(t, e) {
3755
3755
  const n = new Map(t.map((i) => [i.id, i]));
3756
3756
  for (const i of e)
3757
3757
  n.set(i.id, i);
3758
3758
  return wa(
3759
3759
  t,
3760
3760
  [...n.values()]
3761
- ).sort(Fp);
3761
+ ).sort(Hp);
3762
3762
  }
3763
- function Fp(t, e) {
3763
+ function Hp(t, e) {
3764
3764
  if ((t.respondsToUserMessageId !== void 0 && t.respondsToUserMessageId === e.respondsToUserMessageId || t.respondsToUserMessageId === void 0 && e.respondsToUserMessageId === void 0 && t.runId !== void 0 && t.runId === e.runId) && t.causalSequence !== void 0 && e.causalSequence !== void 0 && t.causalSequence !== e.causalSequence)
3765
3765
  return t.causalSequence - e.causalSequence;
3766
3766
  const i = Date.parse(t.createdAt) - Date.parse(e.createdAt);
@@ -3793,22 +3793,22 @@ function ya(t, e) {
3793
3793
  if (!n?.attachments?.length)
3794
3794
  return e;
3795
3795
  const i = e.attachments.map((r) => {
3796
- const l = Hp(n.attachments ?? [], r);
3797
- return l ? $p(r, l) : r;
3796
+ const l = $p(n.attachments ?? [], r);
3797
+ return l ? jp(r, l) : r;
3798
3798
  }), s = { ...e, attachments: i }, o = Nt(e);
3799
3799
  return o && Object.defineProperty(s, "clientMessageId", {
3800
3800
  value: o,
3801
3801
  enumerable: !1
3802
3802
  }), s;
3803
3803
  }
3804
- function Hp(t, e) {
3804
+ function $p(t, e) {
3805
3805
  return e.id ? t.find((n) => n.id === e.id) ?? null : null;
3806
3806
  }
3807
- function $p(t, e) {
3807
+ function jp(t, e) {
3808
3808
  const { previewUrl: n } = e;
3809
3809
  return n ? { ...t, previewUrl: n } : t;
3810
3810
  }
3811
- function jp(t, e) {
3811
+ function Gp(t, e) {
3812
3812
  if (e.role !== "user")
3813
3813
  return t;
3814
3814
  const n = t.findIndex(
@@ -3859,7 +3859,7 @@ function hr(t) {
3859
3859
  }
3860
3860
  return !1;
3861
3861
  }
3862
- function Gp(t, e, n) {
3862
+ function Kp(t, e, n) {
3863
3863
  const i = new Set(
3864
3864
  t.filter(
3865
3865
  (s) => s.role === "user" && e !== null && Nt(s) === e
@@ -3879,7 +3879,7 @@ function Gp(t, e, n) {
3879
3879
  return !1;
3880
3880
  });
3881
3881
  }
3882
- function Kp(t) {
3882
+ function Vp(t) {
3883
3883
  const e = Sa(t);
3884
3884
  if (e === null)
3885
3885
  return t.some(rt);
@@ -3911,7 +3911,7 @@ function Zt(t) {
3911
3911
  }
3912
3912
  return null;
3913
3913
  }
3914
- function Vp(t) {
3914
+ function Yp(t) {
3915
3915
  const e = Zt(t);
3916
3916
  if (e === null)
3917
3917
  return null;
@@ -3933,7 +3933,7 @@ function Ii(t) {
3933
3933
  function fr(t) {
3934
3934
  return t?.type === "run_status" && t.status === "interrupted" && t.reason === "backend_restart";
3935
3935
  }
3936
- function Yp(t, e) {
3936
+ function Xp(t, e) {
3937
3937
  const n = Zt(e);
3938
3938
  if (n === null)
3939
3939
  return !1;
@@ -3958,7 +3958,7 @@ function Us(t) {
3958
3958
  const s = i.clientMessageId;
3959
3959
  return typeof s == "string" ? s : null;
3960
3960
  }
3961
- function Xp(t) {
3961
+ function Jp(t) {
3962
3962
  const e = Zt(t);
3963
3963
  if (e === null)
3964
3964
  return null;
@@ -3988,7 +3988,7 @@ function Ns(t, e) {
3988
3988
  const i = t.find((o) => J(o, "id") === n), s = xe(i);
3989
3989
  return s?.type === "message" && s.role === "user" && typeof s.clientMessageId == "string" ? s.clientMessageId : null;
3990
3990
  }
3991
- function Jp(t, e) {
3991
+ function Zp(t, e) {
3992
3992
  let n = 0;
3993
3993
  for (const i of t) {
3994
3994
  if (!i || typeof i != "object")
@@ -4002,7 +4002,7 @@ function Jp(t, e) {
4002
4002
  return n;
4003
4003
  }
4004
4004
  function mr(t, e, n, i, s, o) {
4005
- if (!e || !Qp(t))
4005
+ if (!e || !ec(t))
4006
4006
  return !1;
4007
4007
  const r = t;
4008
4008
  if (Ii(r) || n !== null && typeof r.id == "string" && r.id !== n)
@@ -4010,7 +4010,7 @@ function mr(t, e, n, i, s, o) {
4010
4010
  const l = He(r);
4011
4011
  return i !== null ? l !== null ? l === i : s !== null && ae(r) === s && o === i : s === null || ae(r) === s;
4012
4012
  }
4013
- function Zp(t, e) {
4013
+ function Qp(t, e) {
4014
4014
  for (let n = e - 1; n >= 0; n -= 1) {
4015
4015
  const i = xe(t[n]);
4016
4016
  if (i?.type === "message" && i.role === "user")
@@ -4024,7 +4024,7 @@ function va(t, e) {
4024
4024
  return t[n].id;
4025
4025
  return null;
4026
4026
  }
4027
- function Qp(t) {
4027
+ function ec(t) {
4028
4028
  if (!t || typeof t != "object")
4029
4029
  return !1;
4030
4030
  const e = t;
@@ -4033,22 +4033,22 @@ function Qp(t) {
4033
4033
  function rt(t) {
4034
4034
  return t.role === "assistant" && t.phase !== "commentary";
4035
4035
  }
4036
- function ec(t) {
4036
+ function tc(t) {
4037
4037
  if (!t || typeof t != "object")
4038
4038
  return !1;
4039
4039
  const e = t;
4040
4040
  return e.type === "message" && e.role === "user" ? !1 : e.type === "message" || e.type === "function_call" || e.type === "function_call_output" || e.type === "run_error" || e.type === "run_status";
4041
4041
  }
4042
4042
  function Os(t) {
4043
- return t.filter((e, n) => qt(e) ? !cc(t, n) && !xa(t, n) && !dc(t, n) && !pc(t, n) : tc(e) ? e.retryable === !0 && lc(t, n) ? !1 : !ac(t, n) : !0);
4043
+ return t.filter((e, n) => qt(e) ? !uc(t, n) && !xa(t, n) && !pc(t, n) && !cc(t, n) : nc(e) ? e.retryable === !0 && dc(t, n) ? !1 : !lc(t, n) : !0);
4044
4044
  }
4045
- function tc(t) {
4045
+ function nc(t) {
4046
4046
  return t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.steered !== !0);
4047
4047
  }
4048
4048
  function qt(t) {
4049
4049
  return t.role === "system" && t.dataType === "run_status" && t.loading === !0;
4050
4050
  }
4051
- function nc(t, e, n, i) {
4051
+ function ic(t, e, n, i) {
4052
4052
  const s = t.findIndex(
4053
4053
  (d, c) => qt(d) && !xa(t, c)
4054
4054
  ), o = s === -1 ? null : t[s], r = e ?? o?.respondsToUserMessageId ?? null, l = r ? t.find(
@@ -4063,7 +4063,7 @@ function nc(t, e, n, i) {
4063
4063
  function wi(t) {
4064
4064
  return t?.type === "run_status" && t.status === "stopped";
4065
4065
  }
4066
- function ic(t, e) {
4066
+ function sc(t, e) {
4067
4067
  return rt(e) ? "completed" : wi(t) ? "stopped" : !Ii(t) && (t?.type === "run_error" || t?.type === "run_status" && (t.status === "failed" || t.status === "interrupted")) ? "failed" : null;
4068
4068
  }
4069
4069
  function wr(t, e, n) {
@@ -4078,14 +4078,14 @@ function wr(t, e, n) {
4078
4078
  }
4079
4079
  function xa(t, e) {
4080
4080
  return t.some(
4081
- (n, i) => i !== e && n.role === "system" && (n.dataType === "run_error" || n.dataType === "run_status" && n.loading !== !0 && n.steered !== !0) && sc(
4081
+ (n, i) => i !== e && n.role === "system" && (n.dataType === "run_error" || n.dataType === "run_status" && n.loading !== !0 && n.steered !== !0) && oc(
4082
4082
  t,
4083
4083
  e,
4084
4084
  i
4085
4085
  )
4086
4086
  );
4087
4087
  }
4088
- function sc(t, e, n) {
4088
+ function oc(t, e, n) {
4089
4089
  const i = t[e], s = t[n];
4090
4090
  if (Pn(i, s))
4091
4091
  return !0;
@@ -4096,9 +4096,9 @@ function sc(t, e, n) {
4096
4096
  return t[o].id === i.respondsToUserMessageId;
4097
4097
  return !1;
4098
4098
  }
4099
- function oc(t, e) {
4099
+ function rc(t, e) {
4100
4100
  const n = [...t].reverse().find(
4101
- (i) => i.respondsToUserMessageId !== void 0 && i.respondsToUserMessageId !== e && br(i) && !rc(
4101
+ (i) => i.respondsToUserMessageId !== void 0 && i.respondsToUserMessageId !== e && br(i) && !ac(
4102
4102
  t,
4103
4103
  i.respondsToUserMessageId
4104
4104
  )
@@ -4110,12 +4110,12 @@ function oc(t, e) {
4110
4110
  function br(t) {
4111
4111
  return t.role === "tool" || qt(t) ? !0 : t.role === "assistant" && t.phase === "commentary";
4112
4112
  }
4113
- function rc(t, e) {
4113
+ function ac(t, e) {
4114
4114
  return t.some(
4115
4115
  (n) => n.respondsToUserMessageId === e && (rt(n) || n.role === "system" && (n.dataType === "run_error" || n.dataType === "run_status" && n.loading !== !0))
4116
4116
  );
4117
4117
  }
4118
- function ac(t, e) {
4118
+ function lc(t, e) {
4119
4119
  const n = t[e];
4120
4120
  for (let i = e + 1; i < t.length; i += 1) {
4121
4121
  const s = t[i];
@@ -4124,7 +4124,7 @@ function ac(t, e) {
4124
4124
  }
4125
4125
  return !1;
4126
4126
  }
4127
- function lc(t, e) {
4127
+ function dc(t, e) {
4128
4128
  const n = t[e];
4129
4129
  if (!n.respondsToUserMessageId)
4130
4130
  return !1;
@@ -4137,19 +4137,19 @@ function lc(t, e) {
4137
4137
  }
4138
4138
  return !1;
4139
4139
  }
4140
- function dc(t, e) {
4140
+ function pc(t, e) {
4141
4141
  const n = t[e];
4142
4142
  return t.some(
4143
4143
  (i, s) => s !== e && i.role === "assistant" && Pn(n, i)
4144
4144
  );
4145
4145
  }
4146
- function pc(t, e) {
4146
+ function cc(t, e) {
4147
4147
  const n = t[e];
4148
4148
  return t.some(
4149
4149
  (i, s) => s !== e && i.role === "tool" && Pn(n, i)
4150
4150
  );
4151
4151
  }
4152
- function cc(t, e) {
4152
+ function uc(t, e) {
4153
4153
  const n = t[e];
4154
4154
  for (let i = e + 1; i < t.length; i += 1)
4155
4155
  if (qt(t[i]) && Pn(n, t[i]))
@@ -4162,7 +4162,7 @@ function Pn(t, e) {
4162
4162
  function J(t, e) {
4163
4163
  return t && typeof t == "object" && typeof t[e] == "string" ? t[e] : null;
4164
4164
  }
4165
- function uc(t, e) {
4165
+ function gc(t, e) {
4166
4166
  try {
4167
4167
  const n = window.localStorage.getItem(`${pa}${t}`);
4168
4168
  if (!n)
@@ -4170,7 +4170,7 @@ function uc(t, e) {
4170
4170
  const i = JSON.parse(n), s = typeof i.sessionId == "string" ? i.sessionId : null;
4171
4171
  if (e !== void 0 && s !== e)
4172
4172
  return null;
4173
- const o = Array.isArray(i.messages) ? i.messages.map(vc).filter((r) => !!r) : [];
4173
+ const o = Array.isArray(i.messages) ? i.messages.map(xc).filter((r) => !!r) : [];
4174
4174
  return {
4175
4175
  sessionId: s,
4176
4176
  messages: o
@@ -4182,20 +4182,20 @@ function uc(t, e) {
4182
4182
  function Ia(t) {
4183
4183
  return t.role === "user" || t.role === "assistant" || t.dataType === "run_status" || t.dataType === "run_error";
4184
4184
  }
4185
- function gc(t, e) {
4185
+ function hc(t, e) {
4186
4186
  try {
4187
4187
  window.localStorage.setItem(
4188
4188
  `${pa}${t}`,
4189
4189
  JSON.stringify({
4190
4190
  sessionId: e.sessionId,
4191
- messages: e.messages.filter(Ia).slice(-qd).map(xc)
4191
+ messages: e.messages.filter(Ia).slice(-zd).map(Ic)
4192
4192
  })
4193
4193
  );
4194
4194
  } catch {
4195
4195
  return;
4196
4196
  }
4197
4197
  }
4198
- function hc(t) {
4198
+ function fc(t) {
4199
4199
  try {
4200
4200
  const e = window.localStorage.getItem(`${Ls}${t}`);
4201
4201
  if (!e)
@@ -4246,19 +4246,19 @@ function yr(t, e) {
4246
4246
  }
4247
4247
  Ta(t, e);
4248
4248
  }
4249
- function fc(t) {
4249
+ function mc(t) {
4250
4250
  try {
4251
4251
  const e = `${Di}${t}`, n = window.sessionStorage.getItem(e);
4252
4252
  if (window.sessionStorage.removeItem(e), !n)
4253
4253
  return [];
4254
4254
  const i = JSON.parse(n);
4255
- return Array.isArray(i) ? i.flatMap((s) => wc(s) ? [{
4255
+ return Array.isArray(i) ? i.flatMap((s) => bc(s) ? [{
4256
4256
  ...s.event,
4257
4257
  page: we(),
4258
4258
  rawOutput: {
4259
4259
  pageContextRestarted: !0,
4260
4260
  outcome: "unknown",
4261
- message: mc(location.href),
4261
+ message: wc(location.href),
4262
4262
  currentUrl: location.href,
4263
4263
  console: [],
4264
4264
  metadata: {
@@ -4275,17 +4275,17 @@ function fc(t) {
4275
4275
  return [];
4276
4276
  }
4277
4277
  }
4278
- function mc(t) {
4278
+ function wc(t) {
4279
4279
  return `The page context restarted. This is expected when the action included page navigation. Otherwise, it's unknown whether the action completed.
4280
4280
  Current URL: ${t}`;
4281
4281
  }
4282
- function wc(t) {
4282
+ function bc(t) {
4283
4283
  if (!t || typeof t != "object")
4284
4284
  return !1;
4285
4285
  const e = t, n = e.event;
4286
4286
  return typeof e.startedAtMs == "number" && typeof e.startedAtUrl == "string" && e.startedAtOrigin === location.origin && e.unloadOrigin === location.origin && typeof e.unloadUrl == "string" && ro(n) && n.type === "tool.result";
4287
4287
  }
4288
- function bc(t, e) {
4288
+ function yc(t, e) {
4289
4289
  const n = new Set(
4290
4290
  t.flatMap((i) => i.type === "tool.result" ? [i.callId] : [])
4291
4291
  );
@@ -4294,7 +4294,7 @@ function bc(t, e) {
4294
4294
  ...e.filter((i) => !n.has(i.callId))
4295
4295
  ];
4296
4296
  }
4297
- function yc(t) {
4297
+ function _c(t) {
4298
4298
  try {
4299
4299
  window.sessionStorage.removeItem(`${Di}${t}`);
4300
4300
  } catch {
@@ -4331,7 +4331,7 @@ function ka(t, e) {
4331
4331
  } : t;
4332
4332
  }
4333
4333
  function qs(t) {
4334
- return t.type || Sc(t.name) || "application/octet-stream";
4334
+ return t.type || vc(t.name) || "application/octet-stream";
4335
4335
  }
4336
4336
  function Ea(t) {
4337
4337
  Aa({
@@ -4341,21 +4341,21 @@ function Ea(t) {
4341
4341
  });
4342
4342
  }
4343
4343
  function Aa(t) {
4344
- const e = _c(t.name), n = t.mimeType.trim().toLowerCase();
4345
- if (!Dd.has(`${e}:${n}`))
4344
+ const e = Sc(t.name), n = t.mimeType.trim().toLowerCase();
4345
+ if (!Ud.has(`${e}:${n}`))
4346
4346
  throw new Error("This attachment type is not supported by the embedded model provider");
4347
4347
  if (t.sizeBytes <= 0 || t.sizeBytes >= la)
4348
4348
  throw new Error("Embedded attachments must be between 1 byte and less than 50 MB");
4349
4349
  }
4350
- function _c(t) {
4350
+ function Sc(t) {
4351
4351
  const e = t.trim().toLowerCase(), n = e.lastIndexOf(".");
4352
4352
  return n >= 0 ? e.slice(n) : "";
4353
4353
  }
4354
- function Sc(t) {
4354
+ function vc(t) {
4355
4355
  const e = t.toLowerCase();
4356
4356
  return e.endsWith(".png") ? "image/png" : e.endsWith(".jpg") || e.endsWith(".jpeg") ? "image/jpeg" : e.endsWith(".webp") ? "image/webp" : e.endsWith(".gif") ? "image/gif" : e.endsWith(".pdf") ? "application/pdf" : null;
4357
4357
  }
4358
- function vc(t) {
4358
+ function xc(t) {
4359
4359
  if (!t || typeof t != "object")
4360
4360
  return null;
4361
4361
  const e = t;
@@ -4377,7 +4377,7 @@ function vc(t) {
4377
4377
  loading: typeof e.loading == "boolean" ? e.loading : void 0
4378
4378
  };
4379
4379
  }
4380
- function xc(t) {
4380
+ function Ic(t) {
4381
4381
  return t.attachments?.length ? {
4382
4382
  ...t,
4383
4383
  attachments: t.attachments.map(Ti)
@@ -4401,9 +4401,9 @@ function ae(t) {
4401
4401
  const e = t.runId;
4402
4402
  return typeof e == "string" && e ? e : null;
4403
4403
  }
4404
- function Ic(t) {
4404
+ function Tc(t) {
4405
4405
  const e = t?.timeoutMs;
4406
- return !!t && typeof t == "object" && typeof t.summary == "string" && typeof t.javascript == "string" && (e === void 0 || typeof e == "number" && Number.isInteger(e) && e > 0 && e <= Gd);
4406
+ return !!t && typeof t == "object" && typeof t.summary == "string" && typeof t.javascript == "string" && (e === void 0 || typeof e == "number" && Number.isInteger(e) && e > 0 && e <= Kd);
4407
4407
  }
4408
4408
  function Ma(t) {
4409
4409
  const e = {};
@@ -4417,22 +4417,22 @@ function Ma(t) {
4417
4417
  return e;
4418
4418
  }
4419
4419
  function ao(t, e) {
4420
- return Na(t) ? Ni : ot(ki(e), Nd);
4420
+ return Na(t) ? Ni : ot(ki(e), Od);
4421
4421
  }
4422
- function Tc(t, e) {
4422
+ function Cc(t, e) {
4423
4423
  return typeof t == "string" ? t : t instanceof URL ? t.toString() : e?.url ?? "";
4424
4424
  }
4425
- async function Cc(t, e, n, i) {
4425
+ async function kc(t, e, n, i) {
4426
4426
  const s = Ma(t.headers);
4427
4427
  i({
4428
4428
  ...e,
4429
4429
  responseStatus: t.status,
4430
4430
  responseHeaders: s,
4431
- responseBody: await kc(t),
4431
+ responseBody: await Ec(t),
4432
4432
  durationMs: Date.now() - n
4433
4433
  });
4434
4434
  }
4435
- async function kc(t) {
4435
+ async function Ec(t) {
4436
4436
  if (!Pa(t.headers))
4437
4437
  return;
4438
4438
  let e = null, n = null;
@@ -4442,7 +4442,7 @@ async function kc(t) {
4442
4442
  const i = new Promise((l) => {
4443
4443
  n = window.setTimeout(() => {
4444
4444
  e?.cancel(), l("timeout");
4445
- }, Od);
4445
+ }, qd);
4446
4446
  }), s = new TextDecoder();
4447
4447
  let o = "", r = 0;
4448
4448
  for (; ; ) {
@@ -4464,7 +4464,7 @@ async function kc(t) {
4464
4464
  n !== null && window.clearTimeout(n);
4465
4465
  }
4466
4466
  }
4467
- function Ec(t, e) {
4467
+ function Ac(t, e) {
4468
4468
  if (Pa(new Headers(e)))
4469
4469
  try {
4470
4470
  return t.responseType === "" || t.responseType === "text" ? ot(t.responseText ?? "") : void 0;
@@ -4476,7 +4476,7 @@ function Sr(t) {
4476
4476
  if (typeof t == "string")
4477
4477
  return ot(t);
4478
4478
  }
4479
- function Ac(t) {
4479
+ function Mc(t) {
4480
4480
  return Fe({
4481
4481
  ...t,
4482
4482
  requestBody: vr(t.requestBody),
@@ -4502,7 +4502,7 @@ function Pa(t) {
4502
4502
  return n !== null && Number.isInteger(i) && i >= 0 && i <= no && (e.startsWith("text/") || e.includes("json") || e.includes("javascript"));
4503
4503
  }
4504
4504
  function Yt(t, e = {}, n) {
4505
- if (Pc(n))
4505
+ if (Rc(n))
4506
4506
  return !0;
4507
4507
  const i = Object.entries(e).find(([s]) => s.toLowerCase() === "content-type")?.[1]?.toLowerCase();
4508
4508
  if (i?.includes("multipart/form-data") || i?.includes("application/octet-stream"))
@@ -4517,7 +4517,7 @@ function Yt(t, e = {}, n) {
4517
4517
  return !0;
4518
4518
  }
4519
4519
  }
4520
- function Mc(t, e) {
4520
+ function Pc(t, e) {
4521
4521
  if (Yt(t))
4522
4522
  return !0;
4523
4523
  try {
@@ -4527,10 +4527,10 @@ function Mc(t, e) {
4527
4527
  return !0;
4528
4528
  }
4529
4529
  }
4530
- function Pc(t) {
4530
+ function Rc(t) {
4531
4531
  return t instanceof FormData || t instanceof Blob || t instanceof ArrayBuffer || ArrayBuffer.isView(t) || typeof ReadableStream < "u" && t instanceof ReadableStream;
4532
4532
  }
4533
- function Rc(t) {
4533
+ function Lc(t) {
4534
4534
  const e = {};
4535
4535
  for (const n of t.trim().split(/[\r\n]+/)) {
4536
4536
  const i = n.indexOf(":");
@@ -4561,27 +4561,27 @@ async function di(t, e) {
4561
4561
  try {
4562
4562
  return await t();
4563
4563
  } catch (s) {
4564
- if (n = s, i >= lr - 1 || !Dc(s))
4564
+ if (n = s, i >= lr - 1 || !Uc(s))
4565
4565
  throw s;
4566
- await Lc(i);
4566
+ await Dc(i);
4567
4567
  }
4568
4568
  throw n instanceof Error ? n : new Error(e);
4569
4569
  }
4570
- function Lc(t) {
4570
+ function Dc(t) {
4571
4571
  return new Promise((e) => {
4572
- window.setTimeout(e, Ld[t] ?? 0);
4572
+ window.setTimeout(e, Dd[t] ?? 0);
4573
4573
  });
4574
4574
  }
4575
- function Dc(t) {
4576
- return t instanceof bi ? Uc(t.status) : t instanceof TypeError;
4577
- }
4578
4575
  function Uc(t) {
4579
- return t === 408 || t === 409 || t === 429 || t >= 500;
4576
+ return t instanceof bi ? Nc(t.status) : t instanceof TypeError;
4580
4577
  }
4581
4578
  function Nc(t) {
4579
+ return t === 408 || t === 409 || t === 429 || t >= 500;
4580
+ }
4581
+ function Oc(t) {
4582
4582
  return t === 401 || t === 403;
4583
4583
  }
4584
- const Ni = "[REDACTED_SECRET]", at = "[REDACTED_TOKEN]", Oc = "[REDACTED_SIGNED_URL]", qc = 20, zc = /^(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|token|api_key|apiKey|apikey|key|secret|signature|sig|password|passwd|pwd|code|state|session|jwt|csrf|csrfToken|xsrf|xsrfToken)$/i, Ra = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, La = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, Da = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, Ua = /\b(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|api_key|apiKey|apikey|client_secret|clientSecret|password|secret|token|jwt|csrf|csrfToken|xsrf|xsrfToken)\b\s*[:=]\s*["']?[^"',&\s}]+/gi, Bc = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, Wc = /\bhttps?:\/\/[^\s"'<>]+/gi, Fc = /[),.;\]]+$/;
4584
+ const Ni = "[REDACTED_SECRET]", at = "[REDACTED_TOKEN]", qc = "[REDACTED_SIGNED_URL]", zc = 20, Bc = /^(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|token|api_key|apiKey|apikey|key|secret|signature|sig|password|passwd|pwd|code|state|session|jwt|csrf|csrfToken|xsrf|xsrfToken)$/i, Ra = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, La = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, Da = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, Ua = /\b(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|api_key|apiKey|apikey|client_secret|clientSecret|password|secret|token|jwt|csrf|csrfToken|xsrf|xsrfToken)\b\s*[:=]\s*["']?[^"',&\s}]+/gi, Wc = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, Fc = /\bhttps?:\/\/[^\s"'<>]+/gi, Hc = /[),.;\]]+$/;
4585
4585
  function Fe(t) {
4586
4586
  return Ci(t, 0, /* @__PURE__ */ new WeakSet());
4587
4587
  }
@@ -4590,7 +4590,7 @@ function Ci(t, e, n) {
4590
4590
  return t.startsWith("data:image/") || t.startsWith("data:application/pdf;") ? t : ki(t);
4591
4591
  if (t === null || typeof t != "object")
4592
4592
  return t;
4593
- if (e >= qc)
4593
+ if (e >= zc)
4594
4594
  return "[REDACTED_MAX_DEPTH]";
4595
4595
  if (n.has(t))
4596
4596
  return "[REDACTED_CIRCULAR]";
@@ -4598,37 +4598,37 @@ function Ci(t, e, n) {
4598
4598
  return t.map((s) => Ci(s, e + 1, n));
4599
4599
  const i = {};
4600
4600
  for (const [s, o] of Object.entries(t))
4601
- s === "pageContent" ? i[s] = o : Na(s) ? i[s] = Ni : i[s] = s.toLowerCase() === "url" ? Hc(o) : Ci(o, e + 1, n);
4601
+ s === "pageContent" ? i[s] = o : Na(s) ? i[s] = Ni : i[s] = s.toLowerCase() === "url" ? $c(o) : Ci(o, e + 1, n);
4602
4602
  return i;
4603
4603
  }
4604
4604
  function Na(t) {
4605
4605
  const e = t.replace(/[^a-z0-9]/gi, "").toLowerCase();
4606
4606
  return e.includes("authorization") || e.includes("cookie") || e.includes("password") || e.includes("passwd") || e === "pwd" || e.includes("secret") || e === "token" || e.endsWith("token") || e.includes("apikey") || e.includes("csrf") || e.includes("xsrf") || e === "jwt" || e === "session" || e === "signature" || e.includes("privatekey");
4607
4607
  }
4608
- function Hc(t) {
4608
+ function $c(t) {
4609
4609
  return typeof t == "string" ? Oa(t) : Ci(t, 0, /* @__PURE__ */ new WeakSet());
4610
4610
  }
4611
4611
  function Oa(t) {
4612
4612
  try {
4613
4613
  const e = new URL(t, location.href);
4614
4614
  for (const n of Array.from(e.searchParams.keys()))
4615
- zc.test(n) && e.searchParams.set(n, at);
4615
+ Bc.test(n) && e.searchParams.set(n, at);
4616
4616
  return e.username && (e.username = at), e.password && (e.password = at), e.toString();
4617
4617
  } catch {
4618
- return $c(t);
4618
+ return jc(t);
4619
4619
  }
4620
4620
  }
4621
4621
  function ki(t) {
4622
- return t.replace(Bc, Oc).replace(Wc, jc).replace(Ra, `Bearer ${at}`).replace(La, `Basic ${at}`).replace(Da, at).replace(Ua, (e, n) => `${n}: ${Ni}`);
4622
+ return t.replace(Wc, qc).replace(Fc, Gc).replace(Ra, `Bearer ${at}`).replace(La, `Basic ${at}`).replace(Da, at).replace(Ua, (e, n) => `${n}: ${Ni}`);
4623
4623
  }
4624
- function $c(t) {
4624
+ function jc(t) {
4625
4625
  return t.replace(Ra, `Bearer ${at}`).replace(La, `Basic ${at}`).replace(Da, at).replace(Ua, (e, n) => `${n}: ${Ni}`);
4626
4626
  }
4627
- function jc(t) {
4628
- const e = t.match(Fc)?.[0] ?? "", n = e ? t.slice(0, -e.length) : t;
4627
+ function Gc(t) {
4628
+ const e = t.match(Hc)?.[0] ?? "", n = e ? t.slice(0, -e.length) : t;
4629
4629
  return `${Oa(n)}${e}`;
4630
4630
  }
4631
- const Gc = "#7c3aed", Ei = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", Ai = "#2c2a1e", xr = [253, 250, 241], Ir = 3.5;
4631
+ const Kc = "#7c3aed", Ei = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", Ai = "#2c2a1e", xr = [253, 250, 241], Ir = 3.5;
4632
4632
  function qa(t) {
4633
4633
  const e = za(t);
4634
4634
  if (Tr(kn(e), xr) >= Ir)
@@ -4636,11 +4636,11 @@ function qa(t) {
4636
4636
  let i = kn(e);
4637
4637
  const s = kn(Ai);
4638
4638
  for (let o = 0; o < 6; o += 1)
4639
- if (i = Yc(i, s, 0.22), Tr(i, xr) >= Ir)
4639
+ if (i = Xc(i, s, 0.22), Tr(i, xr) >= Ir)
4640
4640
  return zs(i);
4641
4641
  return zs(i);
4642
4642
  }
4643
- function Kc() {
4643
+ function Vc() {
4644
4644
  let n = "M 280 120", i = !1, s = 0;
4645
4645
  for (let o = 150; o <= 1170; o += 62) {
4646
4646
  const r = (s % 3 - 1) * 18, l = i ? 280 - r : 1020 + r;
@@ -4648,7 +4648,7 @@ function Kc() {
4648
4648
  }
4649
4649
  return n;
4650
4650
  }
4651
- function Vc(t) {
4651
+ function Yc(t) {
4652
4652
  const e = za(t), n = Bs(kn(e));
4653
4653
  return n > 0.86 ? {
4654
4654
  top: "#ffffff",
@@ -4687,7 +4687,7 @@ function Vc(t) {
4687
4687
  }
4688
4688
  function za(t) {
4689
4689
  const e = t.trim();
4690
- return /^#[0-9a-f]{6}$/i.test(e) ? e.toLowerCase() : /^#[0-9a-f]{3}$/i.test(e) ? `#${e.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : Gc;
4690
+ return /^#[0-9a-f]{6}$/i.test(e) ? e.toLowerCase() : /^#[0-9a-f]{3}$/i.test(e) ? `#${e.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : Kc;
4691
4691
  }
4692
4692
  function kn(t) {
4693
4693
  return [
@@ -4711,7 +4711,7 @@ function Tr(t, e) {
4711
4711
  const n = Bs(t), i = Bs(e), [s, o] = n > i ? [n, i] : [i, n];
4712
4712
  return (s + 0.05) / (o + 0.05);
4713
4713
  }
4714
- function Yc(t, e, n) {
4714
+ function Xc(t, e, n) {
4715
4715
  const i = Ws(n);
4716
4716
  return [
4717
4717
  t[0] + (e[0] - t[0]) * i,
@@ -4720,17 +4720,17 @@ function Yc(t, e, n) {
4720
4720
  ];
4721
4721
  }
4722
4722
  function Ye(t, e, n) {
4723
- const [i, s, o] = Xc(kn(t));
4724
- return zs(Jc(i, Ws(s + n), Ws(o + e)));
4723
+ const [i, s, o] = Jc(kn(t));
4724
+ return zs(Zc(i, Ws(s + n), Ws(o + e)));
4725
4725
  }
4726
- function Xc([t, e, n]) {
4726
+ function Jc([t, e, n]) {
4727
4727
  const i = t / 255, s = e / 255, o = n / 255, r = Math.max(i, s, o), l = Math.min(i, s, o), d = (r + l) / 2;
4728
4728
  if (r === l)
4729
4729
  return [0, 0, d];
4730
4730
  const c = r - l, u = d > 0.5 ? c / (2 - r - l) : c / (r + l);
4731
4731
  return [(r === i ? (s - o) / c + (s < o ? 6 : 0) : r === s ? (o - i) / c + 2 : (i - s) / c + 4) / 6, u, d];
4732
4732
  }
4733
- function Jc(t, e, n) {
4733
+ function Zc(t, e, n) {
4734
4734
  if (e === 0)
4735
4735
  return [n * 255, n * 255, n * 255];
4736
4736
  const i = n < 0.5 ? n * (1 + e) : n + e - n * e, s = 2 * n - i;
@@ -4747,15 +4747,15 @@ function _s(t, e, n) {
4747
4747
  function Ws(t) {
4748
4748
  return Math.max(0, Math.min(1, t));
4749
4749
  }
4750
- const Zc = "https://app.pluno.ai", Qc = "/api/product-agent/embed/active-users", eu = 1800, tu = 15e3, nu = 250, iu = 1e3, su = 3e4;
4751
- function ou(t, e = {}) {
4750
+ const Qc = "https://app.pluno.ai", eu = "/api/product-agent/embed/active-users", tu = 1800, nu = 15e3, iu = 250, su = 1e3, ou = 3e4;
4751
+ function ru(t, e = {}) {
4752
4752
  let n = !1, i = null, s = null, o = null;
4753
4753
  const r = () => {
4754
4754
  o !== null && (window.clearInterval(o), o = null);
4755
4755
  }, l = (u) => {
4756
4756
  n || (s !== null && window.clearTimeout(s), s = window.setTimeout(() => {
4757
4757
  c();
4758
- }, lu(u)));
4758
+ }, du(u)));
4759
4759
  }, d = (u) => {
4760
4760
  if (r(), i === null) {
4761
4761
  i = u, t(u);
@@ -4767,27 +4767,27 @@ function ou(t, e = {}) {
4767
4767
  r();
4768
4768
  return;
4769
4769
  }
4770
- const y = Math.min(1, (performance.now() - h) / eu);
4771
- i = Math.round(p + (u - p) * du(y)), t(i), y >= 1 && (i = u, t(u), r());
4772
- }, nu);
4770
+ const y = Math.min(1, (performance.now() - h) / tu);
4771
+ i = Math.round(p + (u - p) * pu(y)), t(i), y >= 1 && (i = u, t(u), r());
4772
+ }, iu);
4773
4773
  }, c = async () => {
4774
4774
  try {
4775
- const u = await ru(e);
4775
+ const u = await au(e);
4776
4776
  if (n)
4777
4777
  return;
4778
4778
  d(u.count), l(u.refreshAfterMs);
4779
4779
  } catch {
4780
- l(tu);
4780
+ l(nu);
4781
4781
  }
4782
4782
  };
4783
4783
  return c(), () => {
4784
4784
  n = !0, s !== null && window.clearTimeout(s), r();
4785
4785
  };
4786
4786
  }
4787
- async function ru(t) {
4787
+ async function au(t) {
4788
4788
  if (t.loader)
4789
4789
  return t.loader();
4790
- const n = await (t.fetcher ?? fetch)(new URL(Qc, au(t.backendUrl ?? Zc)).toString(), {
4790
+ const n = await (t.fetcher ?? fetch)(new URL(eu, lu(t.backendUrl ?? Qc)).toString(), {
4791
4791
  cache: "no-store",
4792
4792
  credentials: "omit"
4793
4793
  });
@@ -4801,16 +4801,16 @@ async function ru(t) {
4801
4801
  function Cr(t) {
4802
4802
  return typeof t != "number" || !Number.isFinite(t) || t < 0 ? null : Math.round(t);
4803
4803
  }
4804
- function au(t) {
4805
- return t.endsWith("/") ? t : `${t}/`;
4806
- }
4807
4804
  function lu(t) {
4808
- return Math.min(su, Math.max(iu, t));
4805
+ return t.endsWith("/") ? t : `${t}/`;
4809
4806
  }
4810
4807
  function du(t) {
4808
+ return Math.min(ou, Math.max(su, t));
4809
+ }
4810
+ function pu(t) {
4811
4811
  return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
4812
4812
  }
4813
- const pu = [
4813
+ const cu = [
4814
4814
  "a[href]",
4815
4815
  "button",
4816
4816
  "input",
@@ -4834,23 +4834,23 @@ const pu = [
4834
4834
  ".pluno-pa-widget__message",
4835
4835
  ".timeline-item"
4836
4836
  ].join(",");
4837
- function cu(t, e, n) {
4838
- return t instanceof Element ? uu(
4837
+ function uu(t, e, n) {
4838
+ return t instanceof Element ? gu(
4839
4839
  e,
4840
4840
  n,
4841
- t.closest(pu) !== null
4841
+ t.closest(cu) !== null
4842
4842
  ) : !1;
4843
4843
  }
4844
- function uu(t, e, n) {
4844
+ function gu(t, e, n) {
4845
4845
  return t === 1 && !e && !n;
4846
4846
  }
4847
- function gu(t, e, n) {
4847
+ function hu(t, e, n) {
4848
4848
  return t instanceof Node && e !== null && !e.contains(t) && !n?.contains(t);
4849
4849
  }
4850
4850
  function kr(t, e) {
4851
4851
  return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
4852
4852
  }
4853
- function hu(t, e = Date.now(), n) {
4853
+ function fu(t, e = Date.now(), n) {
4854
4854
  const i = new Date(t), s = new Date(e), o = new Intl.DateTimeFormat(n, {
4855
4855
  hour: "2-digit",
4856
4856
  minute: "2-digit",
@@ -4874,13 +4874,13 @@ function hu(t, e = Date.now(), n) {
4874
4874
  year: "numeric"
4875
4875
  }).format(i)}, ${d}`;
4876
4876
  }
4877
- const fu = {
4877
+ const mu = {
4878
4878
  working: "⏳",
4879
4879
  completed: "✅",
4880
4880
  failed: "❗",
4881
4881
  stopped: "⏹️"
4882
- }, mu = /^(?:⌛|⏳|✅|❗|⏹️) Pluno(?:: )?/;
4883
- class wu {
4882
+ }, wu = /^(?:⌛|⏳|✅|❗|⏹️) Pluno(?:: )?/;
4883
+ class bu {
4884
4884
  constructor(e) {
4885
4885
  this.titleDocument = e;
4886
4886
  }
@@ -4914,11 +4914,11 @@ class wu {
4914
4914
  applyTitle() {
4915
4915
  if (!this.status)
4916
4916
  return;
4917
- const e = `${fu[this.status]} Pluno`, n = this.baseTitle ? `${e}: ${this.baseTitle}` : e;
4917
+ const e = `${mu[this.status]} Pluno`, n = this.baseTitle ? `${e}: ${this.baseTitle}` : e;
4918
4918
  this.lastAppliedTitle = n, this.titleDocument.getTitle() !== n && this.titleDocument.setTitle(n);
4919
4919
  }
4920
4920
  }
4921
- function bu(t) {
4921
+ function yu(t) {
4922
4922
  return {
4923
4923
  getTitle: () => t.title,
4924
4924
  setTitle: (e) => {
@@ -4935,14 +4935,14 @@ function bu(t) {
4935
4935
  };
4936
4936
  }
4937
4937
  function Er(t) {
4938
- return t.replace(mu, "");
4938
+ return t.replace(wu, "");
4939
4939
  }
4940
- function yu(t) {
4940
+ function _u(t) {
4941
4941
  return t === "sending" ? "Reading your message..." : "Thinking...";
4942
4942
  }
4943
- const _u = 6e4, Su = [100, 500, 1500, 4e3], Ba = 100, vu = 1e4, xu = 5e3;
4944
- let Iu = 0;
4945
- const Tu = "product-agent:sdk-preview-socket-connect", Cu = "product-agent:sdk-preview-socket-send", ku = "product-agent:sdk-preview-socket-close", Eu = "product-agent:sdk-preview-socket-open", Au = "product-agent:sdk-preview-socket-message", Mu = "product-agent:sdk-preview-socket-error", Pu = "product-agent:sdk-preview-socket-closed", Ar = "product-agent:sdk-preview-socket-id", Ru = "data-pluno-sdk-preview-channel", Wa = "data-pluno-auto-mounted", nt = "__plunoProductAgentAutoMountOwner", Lu = 1e4, Du = "Failed to load Pluno widget token", Mr = "Timed out loading Pluno widget token", Uu = "pluno.productAgent.widgetClientId.", Ss = /* @__PURE__ */ new Set(), Nu = "product-agent:preview-diagnostic", Fa = "pluno.productAgent.sharePromptsDisabled", Ou = 3, Pr = 'dialog[open], [aria-modal="true"], [role="dialog"]', Rr = 1500, qu = 5e3, zu = 500, Bu = "No recent chats for this page yet.", it = {
4943
+ const Su = 6e4, vu = [100, 500, 1500, 4e3], Ba = 100, xu = 1e4, Iu = 5e3;
4944
+ let Tu = 0;
4945
+ const Cu = "product-agent:sdk-preview-socket-connect", ku = "product-agent:sdk-preview-socket-send", Eu = "product-agent:sdk-preview-socket-close", Au = "product-agent:sdk-preview-socket-open", Mu = "product-agent:sdk-preview-socket-message", Pu = "product-agent:sdk-preview-socket-error", Ru = "product-agent:sdk-preview-socket-closed", Ar = "product-agent:sdk-preview-socket-id", Lu = "data-pluno-sdk-preview-channel", Wa = "data-pluno-auto-mounted", nt = "__plunoProductAgentAutoMountOwner", Du = 1e4, Uu = "Failed to load Pluno widget token", Mr = "Timed out loading Pluno widget token", Nu = "pluno.productAgent.widgetClientId.", Ss = /* @__PURE__ */ new Set(), Ou = "product-agent:preview-diagnostic", Fa = "pluno.productAgent.sharePromptsDisabled", qu = 3, Pr = 'dialog[open], [aria-modal="true"], [role="dialog"]', Rr = 1500, zu = 5e3, Bu = 500, Wu = "No recent chats for this page yet.", it = {
4946
4946
  launcherLabel: "Ask for anything...",
4947
4947
  accentColor: "#7c3aed",
4948
4948
  colorScheme: "light",
@@ -4950,7 +4950,7 @@ const Tu = "product-agent:sdk-preview-socket-connect", Cu = "product-agent:sdk-p
4950
4950
  scribbleStyle: !0,
4951
4951
  position: "bottom-right",
4952
4952
  movableLauncher: !0
4953
- }, Wu = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Lr = "pluno-pa-scribble-font", Ha = 190, $a = 41, Fu = 22, Hu = 32, $u = 1, ju = 48, lo = 420, Gu = 520, Ku = 0.24, po = 680, Vu = 800, Yu = 0.76, G = 8, Ot = 50, Fs = 12, ja = "http://www.w3.org/2000/svg", Hs = 26, $s = 8, Xu = 36, js = 16, Ju = 4, Dr = [
4953
+ }, Fu = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Lr = "pluno-pa-scribble-font", Ha = 190, $a = 41, Hu = 22, $u = 32, ju = 1, Gu = 48, lo = 420, Ku = 520, Vu = 0.24, po = 680, Yu = 800, Xu = 0.76, G = 8, Ot = 50, Fs = 12, ja = "http://www.w3.org/2000/svg", Hs = 26, $s = 8, Ju = 36, js = 16, Zu = 4, Dr = [
4954
4954
  {
4955
4955
  ellipseCx: "17.5",
4956
4956
  ellipseCy: "24.5",
@@ -4987,12 +4987,12 @@ const Tu = "product-agent:sdk-preview-socket-connect", Cu = "product-agent:sdk-p
4987
4987
  path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
4988
4988
  pathStrokeWidth: "2.45"
4989
4989
  }
4990
- ], Zu = 11, Qu = 13, Mi = 4, co = 10, uo = 40, eg = "movable-launcher-position-v2", Ga = "pluno-pa-widget-styles", Ka = "data-pluno-pa-widget-styles";
4990
+ ], Qu = 11, eg = 13, Mi = 4, co = 10, uo = 40, tg = "movable-launcher-position-v2", Ga = "pluno-pa-widget-styles", Ka = "data-pluno-pa-widget-styles";
4991
4991
  let Ur = 0;
4992
- function tg(t) {
4992
+ function ng(t) {
4993
4993
  return (e) => new st(e, t);
4994
4994
  }
4995
- async function ng(t = {}) {
4995
+ async function ig(t = {}) {
4996
4996
  const e = {
4997
4997
  layout: t.layout ?? "floating",
4998
4998
  mountTarget: t.mountTarget,
@@ -5062,7 +5062,7 @@ async function ng(t = {}) {
5062
5062
  integrationAuthStatusLoader: t.integrationAuthStatusLoader,
5063
5063
  integrationAuthHandler: t.integrationAuthHandler,
5064
5064
  personalChannelConnectionHandler: t.personalChannelConnectionHandler
5065
- }, n = ++Iu, i = Date.now();
5065
+ }, n = ++Tu, i = Date.now();
5066
5066
  ve(
5067
5067
  "web-sdk.widget",
5068
5068
  "Mounting widget with merged options",
@@ -5080,7 +5080,7 @@ async function ng(t = {}) {
5080
5080
  );
5081
5081
  const s = document.createElement("div");
5082
5082
  s.className = "pluno-pa-widget-host", s.style.setProperty("display", "block", "important"), s.setAttribute("data-pluno-product-agent-ui", "widget"), s.setAttribute("data-pluno-product-agent-layout", e.layout), e.sdkPreviewChannelId && s.setAttribute(
5083
- Ru,
5083
+ Lu,
5084
5084
  e.sdkPreviewChannelId
5085
5085
  );
5086
5086
  const o = s.attachShadow({ mode: "open" }), r = document.createElement("div");
@@ -5089,14 +5089,14 @@ async function ng(t = {}) {
5089
5089
  e.accentColor,
5090
5090
  e.scribbleStyle
5091
5091
  );
5092
- Eg(
5092
+ Ag(
5093
5093
  r,
5094
5094
  e.launcherLabel,
5095
5095
  l,
5096
5096
  e.movableLauncher,
5097
5097
  e.showLauncherMinimizeButton
5098
5098
  ), o.appendChild(r);
5099
- const d = $h(e), c = e.layout === "floating" ? e.initialDisplayState ?? Fh(e) : "shown";
5099
+ const d = jh(e), c = e.layout === "floating" ? e.initialDisplayState ?? Hh(e) : "shown";
5100
5100
  Qr(e, c);
5101
5101
  let u = e.movableLauncher ? d.launcherPosition : null, p = u !== null, h = d.panelSize, y = null;
5102
5102
  r.style.setProperty(
@@ -5115,7 +5115,7 @@ async function ng(t = {}) {
5115
5115
  fontFamily: e.fontFamily,
5116
5116
  scribbleStyle: e.scribbleStyle
5117
5117
  });
5118
- const b = e.mountTarget ?? await Wh(), f = b.ownerDocument, m = r.querySelector(
5118
+ const b = e.mountTarget ?? await Fh(), f = b.ownerDocument, m = r.querySelector(
5119
5119
  ".pluno-pa-widget__launcher"
5120
5120
  ), I = r.querySelector(
5121
5121
  ".pluno-pa-widget__launcher-drag-handle"
@@ -5226,7 +5226,7 @@ async function ng(t = {}) {
5226
5226
  }
5227
5227
  r.classList.toggle(
5228
5228
  "pluno-pa-widget--proactive-suggestion-below",
5229
- gg(
5229
+ hg(
5230
5230
  m.getBoundingClientRect(),
5231
5231
  ie.getBoundingClientRect().height
5232
5232
  )
@@ -5252,7 +5252,7 @@ async function ng(t = {}) {
5252
5252
  };
5253
5253
  let Bi = !1, Wi = !1;
5254
5254
  const en = (a) => {
5255
- Ri(e.billingStatus) || (Bi = !1), e.billingStatus?.usingPaidCreditFallback !== !0 && (Wi = !1), th(
5255
+ Ri(e.billingStatus) || (Bi = !1), e.billingStatus?.usingPaidCreditFallback !== !0 && (Wi = !1), nh(
5256
5256
  ye,
5257
5257
  e.billingStatus,
5258
5258
  a,
@@ -5266,7 +5266,7 @@ async function ng(t = {}) {
5266
5266
  }
5267
5267
  );
5268
5268
  };
5269
- he.hidden = !e.attachmentsEnabled, ge.disabled = !e.attachmentsEnabled, ge.accept = e.productVariant === "personal" ? "" : Ud, jr(_), jr(k);
5269
+ he.hidden = !e.attachmentsEnabled, ge.disabled = !e.attachmentsEnabled, ge.accept = e.productVariant === "personal" ? "" : Nd, jr(_), jr(k);
5270
5270
  let ue = [], Dn = !1, tn = null, Ze = null;
5271
5271
  const Fi = (a) => a === k ? "widget_composer" : a === _ ? "widget_launcher" : a && o.contains(a) ? "widget_control" : a === f.body ? "body" : a === f.documentElement ? "document" : a ? "host_page" : "none", ct = (a, g, w = {}) => {
5272
5272
  const v = pi(f), M = w.skipIfAlreadyFocused === !0 && v === a;
@@ -5298,7 +5298,7 @@ async function ng(t = {}) {
5298
5298
  preventScroll: !0,
5299
5299
  skipIfAlreadyFocused: !0
5300
5300
  }), nn = () => {
5301
- Yg(
5301
+ Xg(
5302
5302
  $,
5303
5303
  ue,
5304
5304
  (a) => {
@@ -5310,7 +5310,7 @@ async function ng(t = {}) {
5310
5310
  }, yo = e.loginRequired || e.signupRequired || e.token || e.webSocketFactory ? void 0 : e.tokenProvider ?? (e.tokenEndpoint ? async () => pl(e.tokenEndpoint) : void 0);
5311
5311
  if (!e.loginRequired && !e.signupRequired && !e.token && !yo && !e.webSocketFactory)
5312
5312
  throw new Error("Pluno widget requires token or tokenEndpoint");
5313
- const ul = window.fetch.bind(window), Hi = Hh(e.clientId);
5313
+ const ul = window.fetch.bind(window), Hi = $h(e.clientId);
5314
5314
  let C;
5315
5315
  try {
5316
5316
  const a = {
@@ -5384,8 +5384,8 @@ async function ng(t = {}) {
5384
5384
  });
5385
5385
  });
5386
5386
  b.appendChild(s);
5387
- const Un = e.manageTaskPageTitle && e.productVariant === "personal" && e.entrySurface === "main_web_chat" ? new wu(
5388
- bu(f)
5387
+ const Un = e.manageTaskPageTitle && e.productVariant === "personal" && e.entrySurface === "main_web_chat" ? new bu(
5388
+ yu(f)
5389
5389
  ) : null;
5390
5390
  ve(
5391
5391
  "web-sdk.widget",
@@ -5427,14 +5427,14 @@ async function ng(t = {}) {
5427
5427
  const g = document.createElement("button");
5428
5428
  g.type = "button", g.className = "pluno-pa-widget__history-item", g.disabled = Ee;
5429
5429
  const w = document.createElement("span");
5430
- w.className = "pluno-pa-widget__history-item-title", w.textContent = Tg(a);
5430
+ w.className = "pluno-pa-widget__history-item-title", w.textContent = Cg(a);
5431
5431
  const v = document.createElement("time");
5432
- v.className = "pluno-pa-widget__history-time", v.dateTime = a.lastActiveAt, v.textContent = kg(
5432
+ v.className = "pluno-pa-widget__history-time", v.dateTime = a.lastActiveAt, v.textContent = Eg(
5433
5433
  a.lastActiveAt,
5434
5434
  Date.now()
5435
5435
  );
5436
5436
  const M = document.createElement("small");
5437
- M.className = "pluno-pa-widget__history-path", M.textContent = Cg(a), g.append(w, v, M), g.addEventListener("click", () => {
5437
+ M.className = "pluno-pa-widget__history-path", M.textContent = kg(a), g.append(w, v, M), g.addEventListener("click", () => {
5438
5438
  Se = !1, Et = null, Be(), qe(!0, "newSession"), ze(), C.loadSession(a.id), un = null, Y(C.getState()), ut("history_session_selected");
5439
5439
  }), oe.appendChild(g);
5440
5440
  }
@@ -5460,7 +5460,7 @@ async function ng(t = {}) {
5460
5460
  {
5461
5461
  message: w instanceof Error ? w.message : String(w)
5462
5462
  }
5463
- ), Et = Bu;
5463
+ ), Et = Wu;
5464
5464
  } finally {
5465
5465
  if (g !== At || te)
5466
5466
  return;
@@ -5486,7 +5486,7 @@ async function ng(t = {}) {
5486
5486
  const g = En(r, a);
5487
5487
  return yi(
5488
5488
  r,
5489
- u ? _i(u, g) : cg(
5489
+ u ? _i(u, g) : ug(
5490
5490
  r,
5491
5491
  e.position,
5492
5492
  g
@@ -5494,12 +5494,12 @@ async function ng(t = {}) {
5494
5494
  g
5495
5495
  );
5496
5496
  }, ne = () => {
5497
- const a = _g(
5497
+ const a = Sg(
5498
5498
  o,
5499
5499
  _,
5500
5500
  k
5501
5501
  );
5502
- Kh(e, {
5502
+ Vh(e, {
5503
5503
  isOpen: r.classList.contains("pluno-pa-widget--open"),
5504
5504
  composerValue: k.value,
5505
5505
  focusedInput: a,
@@ -5529,8 +5529,8 @@ async function ng(t = {}) {
5529
5529
  )
5530
5530
  ), Wr(r), ne(), !v && e.layout === "floating" && C.recordWidgetLifecycle("minimized", w), g && Bn("minimized", w);
5531
5531
  }, Mt = (a, g = {}) => {
5532
- bg(a, {
5533
- debugVersion: eg,
5532
+ yg(a, {
5533
+ debugVersion: tg,
5534
5534
  launcherPosition: u,
5535
5535
  rootClasses: r.className,
5536
5536
  rootStyle: {
@@ -5562,7 +5562,7 @@ async function ng(t = {}) {
5562
5562
  Wr(r);
5563
5563
  return;
5564
5564
  }
5565
- wg(r, {
5565
+ bg(r, {
5566
5566
  x: a.x - g.x,
5567
5567
  y: a.y - g.y
5568
5568
  });
@@ -5609,7 +5609,7 @@ async function ng(t = {}) {
5609
5609
  };
5610
5610
  let Ro = () => {
5611
5611
  };
5612
- window.addEventListener("resize", Po), e.movableLauncher && I ? (cn(), Ro = ag({
5612
+ window.addEventListener("resize", Po), e.movableLauncher && I ? (cn(), Ro = lg({
5613
5613
  root: r,
5614
5614
  launcher: m,
5615
5615
  launcherDragHandle: I,
@@ -5666,7 +5666,7 @@ async function ng(t = {}) {
5666
5666
  g
5667
5667
  ), v = En(r), M = yi(
5668
5668
  r,
5669
- mg(
5669
+ wg(
5670
5670
  w,
5671
5671
  g,
5672
5672
  v,
@@ -5678,14 +5678,14 @@ async function ng(t = {}) {
5678
5678
  M,
5679
5679
  v
5680
5680
  ), p = !0, y = null, bt(r, M), Wn(w, M);
5681
- }, bl = e.movableLauncher && z ? lg({
5681
+ }, bl = e.movableLauncher && z ? dg({
5682
5682
  root: r,
5683
5683
  handle: z,
5684
5684
  getPosition: () => Lo().position,
5685
5685
  setPosition: wl,
5686
5686
  persist: ne
5687
5687
  }) : () => {
5688
- }, yl = q.length > 0 ? dg({
5688
+ }, yl = q.length > 0 ? pg({
5689
5689
  root: r,
5690
5690
  handles: q,
5691
5691
  getBounds: Lo,
@@ -5720,7 +5720,7 @@ async function ng(t = {}) {
5720
5720
  let un = null;
5721
5721
  const Uo = (a) => {
5722
5722
  const g = Date.now(), w = window.location.href;
5723
- a === "composer_input" && un?.scope === w && g - un.requestedAt < _u || (a === "composer_input" && (un = { scope: w, requestedAt: g }), C.warmup(a));
5723
+ a === "composer_input" && un?.scope === w && g - un.requestedAt < Su || (a === "composer_input" && (un = { scope: w, requestedAt: g }), C.warmup(a));
5724
5724
  }, We = (a = "", g = !0, w = !0, v = !0, M = "external_request") => {
5725
5725
  const F = r.classList.contains("pluno-pa-widget--open") || !P.hidden && !r.classList.contains("pluno-pa-widget--closing");
5726
5726
  !F && v && Uo("panel_open"), Do(), fn && (fn = !1, ts()), r.classList.contains("pluno-pa-widget--open") || (y = null), Oe !== null && (window.clearTimeout(Oe), Oe = null), pn("shown", !1), P.hidden = !1, B.hidden = !1, ks(
@@ -5830,7 +5830,7 @@ async function ng(t = {}) {
5830
5830
  return;
5831
5831
  }
5832
5832
  Zi(w, null);
5833
- }, zu)) : (Pt !== null && (window.clearInterval(Pt), Pt = null), Ke !== null && (window.clearTimeout(Ke), Ke = null), Fn = null);
5833
+ }, Bu)) : (Pt !== null && (window.clearInterval(Pt), Pt = null), Ke !== null && (window.clearTimeout(Ke), Ke = null), Fn = null);
5834
5834
  }, vl = () => {
5835
5835
  Pt !== null && (window.clearInterval(Pt), Pt = null), Ke !== null && (window.clearTimeout(Ke), Ke = null), de !== null && (window.clearTimeout(de), de = null);
5836
5836
  }, qo = (a) => {
@@ -5886,7 +5886,7 @@ async function ng(t = {}) {
5886
5886
  if (v)
5887
5887
  return hn(D, w), !0;
5888
5888
  const Ve = Date.now();
5889
- return Fn !== null && Ve - Fn <= qu ? (hn(D, w), !0) : (Fn = Ve, !0);
5889
+ return Fn !== null && Ve - Fn <= zu ? (hn(D, w), !0) : (Fn = Ve, !0);
5890
5890
  };
5891
5891
  M(a.relatedTarget) || window.setTimeout(() => {
5892
5892
  Qe === null && w.isConnected && M(Ji());
@@ -5970,7 +5970,7 @@ async function ng(t = {}) {
5970
5970
  ee.textContent = "", ee.hidden = !0, Ze = null;
5971
5971
  }, 3e3);
5972
5972
  }, Bo = (a) => {
5973
- yg(
5973
+ _g(
5974
5974
  C,
5975
5975
  a.value,
5976
5976
  a.attachments,
@@ -6030,7 +6030,7 @@ async function ng(t = {}) {
6030
6030
  }, ss = async (a) => {
6031
6031
  if (!e.attachmentsEnabled || a.length === 0)
6032
6032
  return;
6033
- const g = Qg(
6033
+ const g = eh(
6034
6034
  C,
6035
6035
  a,
6036
6036
  e.productVariant === "customer_embedded"
@@ -6117,9 +6117,9 @@ async function ng(t = {}) {
6117
6117
  }
6118
6118
  }), r.addEventListener("click", (a) => {
6119
6119
  const g = a.target instanceof Element ? a.target : null;
6120
- g?.closest("a[href]") && ne(), Se && gu(g, Ie, se) && (Se = !1, Be());
6120
+ g?.closest("a[href]") && ne(), Se && hu(g, Ie, se) && (Se = !1, Be());
6121
6121
  const v = window.getSelection(), M = !!(v && !v.isCollapsed && v.anchorNode && r.contains(v.anchorNode));
6122
- cu(a.target, a.detail, M) && ut("passive_surface_click");
6122
+ uu(a.target, a.detail, M) && ut("passive_surface_click");
6123
6123
  }), r.addEventListener("copy", (a) => {
6124
6124
  a.clipboardData && window.getSelection() && !window.getSelection()?.isCollapsed && window.getSelection()?.anchorNode && window.getSelection()?.focusNode && r.contains(window.getSelection()?.anchorNode ?? null) && r.contains(window.getSelection()?.focusNode ?? null) && window.getSelection()?.toString() && (a.clipboardData.clearData(), a.clipboardData.setData(
6125
6125
  "text/plain",
@@ -6145,7 +6145,7 @@ async function ng(t = {}) {
6145
6145
  return;
6146
6146
  }
6147
6147
  a.key !== "Escape" || !Se || (Se = !1, Be(), ut("history_escape"));
6148
- }), d.composerValue && (k.value = d.composerValue, xn(k)), e.layout === "page" ? We(k.value, !1, !0, !1, "external_request") : c === "minimized" ? pn("minimized", !1) : e.initialDisplayState === void 0 && d.isOpen && We(k.value, !1, !1, !1, "restored_state"), Sg(
6148
+ }), d.composerValue && (k.value = d.composerValue, xn(k)), e.layout === "page" ? We(k.value, !1, !0, !1, "external_request") : c === "minimized" ? pn("minimized", !1) : e.initialDisplayState === void 0 && d.isOpen && We(k.value, !1, !1, !1, "restored_state"), vg(
6149
6149
  d,
6150
6150
  r,
6151
6151
  _,
@@ -6278,7 +6278,7 @@ async function ng(t = {}) {
6278
6278
  Vt || (Vt = qi(
6279
6279
  "pluno-pa-widget__new-chat",
6280
6280
  "New chat",
6281
- Bg(),
6281
+ Wg(),
6282
6282
  !1
6283
6283
  ), Vt.addEventListener("click", () => ni()), Q.insertBefore(Vt, se));
6284
6284
  }, Y = (a) => {
@@ -6308,10 +6308,10 @@ async function ng(t = {}) {
6308
6308
  );
6309
6309
  return;
6310
6310
  }
6311
- const g = xg(a), w = g !== xo;
6311
+ const g = Ig(a), w = g !== xo;
6312
6312
  xo = g;
6313
6313
  const v = ht || It.enabled;
6314
- ht = !1, lh(
6314
+ ht = !1, dh(
6315
6315
  U,
6316
6316
  Xe,
6317
6317
  V,
@@ -6371,7 +6371,7 @@ async function ng(t = {}) {
6371
6371
  xt.add(D.id), on.add(D.id), ne(), wn = null, Y(C.getState());
6372
6372
  },
6373
6373
  onDisable: (D) => {
6374
- rn = !0, xt.add(D.id), on.add(D.id), ne(), Gh(e, !0), wn = null, Y(C.getState());
6374
+ rn = !0, xt.add(D.id), on.add(D.id), ne(), Kh(e, !0), wn = null, Y(C.getState());
6375
6375
  }
6376
6376
  } : void 0,
6377
6377
  e.proactiveSuggestion !== null || $e !== null
@@ -6382,9 +6382,9 @@ async function ng(t = {}) {
6382
6382
  gt = null, te || Y(C.getState());
6383
6383
  },
6384
6384
  Math.min(F, 2147483647)
6385
- )), v ? (Tt = U.scrollTop, ze()) : w && Ig(a) && gl();
6385
+ )), v ? (Tt = U.scrollTop, ze()) : w && Tg(a) && gl();
6386
6386
  }, jo = () => {
6387
- f.getSelection()?.isCollapsed !== !1 && wh(ei) && Y(C.getState());
6387
+ f.getSelection()?.isCollapsed !== !1 && bh(ei) && Y(C.getState());
6388
6388
  };
6389
6389
  f.addEventListener(
6390
6390
  "selectionchange",
@@ -6418,7 +6418,7 @@ async function ng(t = {}) {
6418
6418
  })
6419
6419
  );
6420
6420
  };
6421
- Ho = ou(
6421
+ Ho = ru(
6422
6422
  (a) => {
6423
6423
  Kt = a, !te && As(C.getState(), ls()) && Y(C.getState());
6424
6424
  },
@@ -6438,7 +6438,7 @@ async function ng(t = {}) {
6438
6438
  const g = rs && !a.isThinking, w = Io !== location.origin || To !== a.sessionId || Co !== (a.user?.id ?? null), v = rs !== a.isThinking, M = Gi !== "connected" && a.status === "connected", F = Gi === "connected" && a.status !== "connected";
6439
6439
  Io = location.origin, To = a.sessionId, Co = a.user?.id ?? null, Gi = a.status, rs = a.isThinking, F && (Ae !== null && (window.clearTimeout(Ae), Ae = null), At += 1, Ee = !1, Ge = [], ln = null, Et = null, On = !1, Be()), r.classList.contains("pluno-pa-widget--open") && a.status === "connected" && (w || v || M) && zn(), a.isThinking && !Jn() && bn && !jt && $t === null && _e?.hidden !== !1 && ($t = window.setTimeout(() => {
6440
6440
  $t = null, Tl();
6441
- }, vu)), (!a.isThinking || Jn()) && (Fo(), Xn()), g && !r.classList.contains("pluno-pa-widget--open") && (fn = !0), ts(), a.appearance ? (os = !0, ve(
6441
+ }, xu)), (!a.isThinking || Jn()) && (Fo(), Xn()), g && !r.classList.contains("pluno-pa-widget--open") && (fn = !0), ts(), a.appearance ? (os = !0, ve(
6442
6442
  "web-sdk.widget",
6443
6443
  "Agent state supplied appearance",
6444
6444
  {
@@ -6455,7 +6455,7 @@ async function ng(t = {}) {
6455
6455
  ), ps({}, "agent.state.appearance-cleared")), Y(a), Go(a), pe(), g && Do();
6456
6456
  });
6457
6457
  const ii = C.getState();
6458
- return ii.taskStatus && Un?.setStatus(ii.taskStatus), Y(ii), rn || Promise.resolve(jh(e)).then((a) => {
6458
+ return ii.taskStatus && Un?.setStatus(ii.taskStatus), Y(ii), rn || Promise.resolve(Gh(e)).then((a) => {
6459
6459
  !a || te || (rn = !0, ne(), Y(C.getState()));
6460
6460
  }).catch(() => {
6461
6461
  }), Go(ii), pe(), ns(), {
@@ -6581,11 +6581,11 @@ async function ng(t = {}) {
6581
6581
  function Nr(t, e) {
6582
6582
  return { accentColor: t, scribbleStyle: e };
6583
6583
  }
6584
- function ig(t) {
6585
- const e = sg(t);
6586
- return e === null ? "#fafafa" : og(e) > 0.5 ? "#18181b" : "#fafaf9";
6587
- }
6588
6584
  function sg(t) {
6585
+ const e = og(t);
6586
+ return e === null ? "#fafafa" : rg(e) > 0.5 ? "#18181b" : "#fafaf9";
6587
+ }
6588
+ function og(t) {
6589
6589
  const e = t.trim();
6590
6590
  return /^#[0-9a-f]{6}$/i.test(e) ? [
6591
6591
  Number.parseInt(e.slice(1, 3), 16),
@@ -6597,7 +6597,7 @@ function sg(t) {
6597
6597
  Number.parseInt(e[3] + e[3], 16)
6598
6598
  ] : null;
6599
6599
  }
6600
- function og([t, e, n]) {
6600
+ function rg([t, e, n]) {
6601
6601
  const i = (s) => {
6602
6602
  const o = s / 255;
6603
6603
  return o <= 0.03928 ? o / 12.92 : ((o + 0.055) / 1.055) ** 2.4;
@@ -6615,8 +6615,8 @@ function Or(t, e, n) {
6615
6615
  const i = n.scribbleStyle ? qa(n.accentColor) : n.accentColor;
6616
6616
  t.style.setProperty("--pluno-pa-accent", i), n.scribbleStyle ? t.style.setProperty(
6617
6617
  "--pluno-pa-accent-contrast",
6618
- ig(i)
6619
- ) : t.style.removeProperty("--pluno-pa-accent-contrast"), t.style.fontFamily = n.scribbleStyle ? Wu : n.fontFamily, n.scribbleStyle && rg(t.ownerDocument);
6618
+ sg(i)
6619
+ ) : t.style.removeProperty("--pluno-pa-accent-contrast"), t.style.fontFamily = n.scribbleStyle ? Fu : n.fontFamily, n.scribbleStyle && ag(t.ownerDocument);
6620
6620
  const s = Array.from(
6621
6621
  t.querySelectorAll(".pluno-pa-widget__character")
6622
6622
  );
@@ -6628,7 +6628,7 @@ function Or(t, e, n) {
6628
6628
  )
6629
6629
  );
6630
6630
  }
6631
- function rg(t) {
6631
+ function ag(t) {
6632
6632
  if (t.getElementById(Lr))
6633
6633
  return;
6634
6634
  const e = t.createElement("style");
@@ -6640,7 +6640,7 @@ function rg(t) {
6640
6640
  src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
6641
6641
  }`, t.head.appendChild(e), t.fonts?.load('16px "Architects Daughter"');
6642
6642
  }
6643
- function ag({
6643
+ function lg({
6644
6644
  root: t,
6645
6645
  launcher: e,
6646
6646
  launcherDragHandle: n,
@@ -6682,7 +6682,7 @@ function ag({
6682
6682
  e.removeEventListener("pointerdown", h), e.removeEventListener("pointermove", y), e.removeEventListener("pointerup", b), e.removeEventListener("pointercancel", f), e.removeEventListener("click", m, !0), n.removeEventListener("keydown", I);
6683
6683
  };
6684
6684
  }
6685
- function lg({
6685
+ function dg({
6686
6686
  root: t,
6687
6687
  handle: e,
6688
6688
  getPosition: n,
@@ -6713,7 +6713,7 @@ function lg({
6713
6713
  e.removeEventListener("pointerdown", u), e.removeEventListener("pointermove", p), e.removeEventListener("pointerup", h), e.removeEventListener("pointercancel", y), e.removeEventListener("keydown", b);
6714
6714
  };
6715
6715
  }
6716
- function dg({
6716
+ function pg({
6717
6717
  root: t,
6718
6718
  handles: e,
6719
6719
  getBounds: n,
@@ -6834,38 +6834,38 @@ function Br({
6834
6834
  function En(t, e = !0) {
6835
6835
  const n = be();
6836
6836
  if (t.classList.contains("pluno-pa-widget--minimized")) {
6837
- const o = typeof window.matchMedia == "function" && window.matchMedia("(hover: none), (pointer: coarse)").matches ? Hu : Fu;
6837
+ const o = typeof window.matchMedia == "function" && window.matchMedia("(hover: none), (pointer: coarse)").matches ? $u : Hu;
6838
6838
  return { width: o, height: o };
6839
6839
  }
6840
6840
  const i = t.getBoundingClientRect(), s = !t.classList.contains("pluno-pa-widget--open") && !t.classList.contains("pluno-pa-widget--closing");
6841
6841
  return {
6842
6842
  width: e && s && i.width > 0 ? i.width : Math.min(Ha, n.width - 36),
6843
- height: e && s && i.height > 0 ? i.height : t.classList.contains("pluno-pa-widget--scribble") ? ju : $a
6843
+ height: e && s && i.height > 0 ? i.height : t.classList.contains("pluno-pa-widget--scribble") ? Gu : $a
6844
6844
  };
6845
6845
  }
6846
- function pg() {
6846
+ function cg() {
6847
6847
  const t = be();
6848
6848
  return {
6849
6849
  width: Math.min(
6850
6850
  Le(
6851
- t.width * Ku,
6851
+ t.width * Vu,
6852
6852
  lo,
6853
- Gu
6853
+ Ku
6854
6854
  ),
6855
6855
  t.width - G * 2
6856
6856
  ),
6857
6857
  height: Math.min(
6858
6858
  Le(
6859
- t.height * Yu,
6859
+ t.height * Xu,
6860
6860
  po,
6861
- Vu
6861
+ Yu
6862
6862
  ),
6863
6863
  t.height - Ot - G
6864
6864
  )
6865
6865
  };
6866
6866
  }
6867
6867
  function Dt(t = null) {
6868
- return t ? Oi(t) : pg();
6868
+ return t ? Oi(t) : cg();
6869
6869
  }
6870
6870
  function Oi(t) {
6871
6871
  const e = be();
@@ -6902,7 +6902,7 @@ function vs(t, e) {
6902
6902
  const n = Oi(e);
6903
6903
  t.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), t.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
6904
6904
  }
6905
- function cg(t, e, n) {
6905
+ function ug(t, e, n) {
6906
6906
  const i = Number.parseFloat(t.style.left), s = Number.parseFloat(t.style.top);
6907
6907
  if (Number.isFinite(i) && Number.isFinite(s))
6908
6908
  return { x: i, y: s };
@@ -6921,9 +6921,9 @@ function xs(t, e, n) {
6921
6921
  t,
6922
6922
  _i(e, i),
6923
6923
  i
6924
- ) : ug(n === "bottom-left" ? "bottom-left" : "bottom-right", i, $u);
6924
+ ) : gg(n === "bottom-left" ? "bottom-left" : "bottom-right", i, ju);
6925
6925
  }
6926
- function ug(t, e, n) {
6926
+ function gg(t, e, n) {
6927
6927
  const i = be();
6928
6928
  return {
6929
6929
  x: t.endsWith("right") ? Math.max(0, i.width - e.width - n) : n,
@@ -6931,7 +6931,7 @@ function ug(t, e, n) {
6931
6931
  };
6932
6932
  }
6933
6933
  function yi(t, e, n) {
6934
- const i = be(), s = G + fg(t);
6934
+ const i = be(), s = G + mg(t);
6935
6935
  return {
6936
6936
  x: Le(
6937
6937
  e.x,
@@ -6951,7 +6951,7 @@ function yi(t, e, n) {
6951
6951
  )
6952
6952
  };
6953
6953
  }
6954
- function gg(t, e) {
6954
+ function hg(t, e) {
6955
6955
  if (e <= 0)
6956
6956
  return !1;
6957
6957
  const n = be(), i = t.top - G - Fs, s = n.height - t.bottom - G - Fs;
@@ -6965,19 +6965,19 @@ function _i(t, e) {
6965
6965
  };
6966
6966
  }
6967
6967
  function Is(t, e) {
6968
- const n = hg(t, e), i = be();
6968
+ const n = fg(t, e), i = be();
6969
6969
  return {
6970
6970
  anchor: n,
6971
6971
  x: n.endsWith("right") ? i.width - t.x - e.width : t.x,
6972
6972
  y: n.startsWith("bottom") ? i.height - t.y - e.height : t.y
6973
6973
  };
6974
6974
  }
6975
- function hg(t, e) {
6975
+ function fg(t, e) {
6976
6976
  const n = be(), i = t.x + e.width / 2, o = t.y + e.height / 2 <= n.height / 2 ? "top" : "bottom", r = i <= n.width / 2 ? "left" : "right";
6977
6977
  return `${o}-${r}`;
6978
6978
  }
6979
- function fg(t) {
6980
- return t.classList.contains("pluno-pa-widget--scribble") ? Qu : Zu;
6979
+ function mg(t) {
6980
+ return t.classList.contains("pluno-pa-widget--scribble") ? eg : Qu;
6981
6981
  }
6982
6982
  function Ts(t, e, n, i = null) {
6983
6983
  const s = En(t), o = Dt(i), r = {
@@ -6986,7 +6986,7 @@ function Ts(t, e, n, i = null) {
6986
6986
  };
6987
6987
  return In(r, o);
6988
6988
  }
6989
- function mg(t, e, n, i) {
6989
+ function wg(t, e, n, i) {
6990
6990
  return {
6991
6991
  x: i === "bottom-left" ? t.x : t.x + e.width - n.width,
6992
6992
  y: t.y + e.height - n.height
@@ -7023,7 +7023,7 @@ function bt(t, e) {
7023
7023
  }
7024
7024
  t.style.left = `${e.x}px`, t.style.top = `${e.y}px`, t.style.right = "auto", t.style.bottom = "auto";
7025
7025
  }
7026
- function wg(t, e) {
7026
+ function bg(t, e) {
7027
7027
  t.style.setProperty("--pluno-pa-panel-offset-x", `${e.x}px`), t.style.setProperty("--pluno-pa-panel-offset-y", `${e.y}px`);
7028
7028
  }
7029
7029
  function Wr(t) {
@@ -7057,23 +7057,23 @@ function ve(t, e, n) {
7057
7057
  details: n
7058
7058
  }, o = i.__plunoProductAgentDiagnostics__ ?? [];
7059
7059
  o.push(s), o.length > 120 && o.splice(0, o.length - 120), i.__plunoProductAgentDiagnostics__ = o, i.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...o], window.dispatchEvent(
7060
- new CustomEvent(Nu, { detail: s })
7060
+ new CustomEvent(Ou, { detail: s })
7061
7061
  );
7062
7062
  }
7063
- function bg(t, e) {
7063
+ function yg(t, e) {
7064
7064
  ve("web-sdk.widget.position", t, e);
7065
7065
  }
7066
- async function yg(t, e, n, i) {
7066
+ async function _g(t, e, n, i) {
7067
7067
  i(), await t.sendMessage(e, {
7068
- attachments: n.length > 0 ? n.map(vg) : void 0
7068
+ attachments: n.length > 0 ? n.map(xg) : void 0
7069
7069
  });
7070
7070
  }
7071
- function _g(t, e, n) {
7071
+ function Sg(t, e, n) {
7072
7072
  const i = t.activeElement;
7073
7073
  return i === n ? "composer" : i === e ? "launcher" : null;
7074
7074
  }
7075
- function Sg(t, e, n, i, s) {
7076
- if (!t.focusedInput || !t.focusedInputAt || Date.now() - t.focusedInputAt > xu)
7075
+ function vg(t, e, n, i, s) {
7076
+ if (!t.focusedInput || !t.focusedInputAt || Date.now() - t.focusedInputAt > Iu)
7077
7077
  return;
7078
7078
  const o = t.focusedInput === "composer" ? i : n;
7079
7079
  if (o === i && !e.classList.contains("pluno-pa-widget--open") || o === n && e.classList.contains("pluno-pa-widget--open"))
@@ -7089,7 +7089,7 @@ function pi(t) {
7089
7089
  e = e.shadowRoot.activeElement;
7090
7090
  return e;
7091
7091
  }
7092
- function vg(t) {
7092
+ function xg(t) {
7093
7093
  return t;
7094
7094
  }
7095
7095
  function xn(t) {
@@ -7100,7 +7100,7 @@ function Tn(t, e = () => !0) {
7100
7100
  e() && (t.scrollTop = t.scrollHeight);
7101
7101
  });
7102
7102
  }
7103
- function xg(t) {
7103
+ function Ig(t) {
7104
7104
  const e = t.messages[t.messages.length - 1];
7105
7105
  return [
7106
7106
  t.messages.length,
@@ -7113,13 +7113,13 @@ function xg(t) {
7113
7113
  t.lastError ?? ""
7114
7114
  ].join(":");
7115
7115
  }
7116
- function Ig(t) {
7116
+ function Tg(t) {
7117
7117
  return t.messages.length > 0 || t.assistantDraft.length > 0 || t.pendingMessageStatus !== null || t.isThinking || !!t.lastError;
7118
7118
  }
7119
- function Tg(t) {
7119
+ function Cg(t) {
7120
7120
  return t.firstUserMessage?.trim() ? t.firstUserMessage : t.title?.trim() ? t.title : "Untitled chat";
7121
7121
  }
7122
- function Cg(t) {
7122
+ function kg(t) {
7123
7123
  const e = t.currentPage;
7124
7124
  if (typeof e?.url == "string" && e.url.trim())
7125
7125
  try {
@@ -7130,7 +7130,7 @@ function Cg(t) {
7130
7130
  }
7131
7131
  return typeof e?.origin == "string" && e.origin.trim() ? e.origin : "Current origin";
7132
7132
  }
7133
- function kg(t, e) {
7133
+ function Eg(t, e) {
7134
7134
  const n = new Date(t).getTime();
7135
7135
  if (!Number.isFinite(n))
7136
7136
  return "now";
@@ -7146,24 +7146,24 @@ function kg(t, e) {
7146
7146
  }
7147
7147
  return "now";
7148
7148
  }
7149
- function Eg(t, e, n, i, s) {
7150
- t.appendChild(zg()), t.appendChild(
7151
- Ag(
7149
+ function Ag(t, e, n, i, s) {
7150
+ t.appendChild(Bg()), t.appendChild(
7151
+ Mg(
7152
7152
  e,
7153
7153
  n,
7154
7154
  i,
7155
7155
  s
7156
7156
  )
7157
- ), t.appendChild(Lg()), t.appendChild(
7157
+ ), t.appendChild(Dg()), t.appendChild(
7158
7158
  qi(
7159
7159
  "pluno-pa-widget__close",
7160
7160
  "Close",
7161
7161
  Ks(16),
7162
7162
  !0
7163
7163
  )
7164
- ), t.appendChild(Mg(n, i));
7164
+ ), t.appendChild(Pg(n, i));
7165
7165
  }
7166
- function Ag(t, e, n, i) {
7166
+ function Mg(t, e, n, i) {
7167
7167
  const s = document.createElement("form");
7168
7168
  if (s.className = "pluno-pa-widget__launcher", i && s.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
7169
7169
  s.classList.add("pluno-pa-widget__launcher--movable");
@@ -7192,7 +7192,7 @@ function Ag(t, e, n, i) {
7192
7192
  }
7193
7193
  return s;
7194
7194
  }
7195
- function Mg(t, e) {
7195
+ function Pg(t, e) {
7196
7196
  const n = document.createElement("section");
7197
7197
  n.className = "pluno-pa-widget__panel", n.hidden = !0, n.appendChild(
7198
7198
  Ja("pluno-pa-widget__scribble-spirals--panel", 16)
@@ -7205,7 +7205,7 @@ function Mg(t, e) {
7205
7205
  const s = document.createElement("div");
7206
7206
  s.className = "pluno-pa-widget__timeline-wrap";
7207
7207
  const o = document.createElement("main");
7208
- o.className = "pluno-pa-widget__timeline", o.appendChild(Ng(t));
7208
+ o.className = "pluno-pa-widget__timeline", o.appendChild(Og(t));
7209
7209
  const r = document.createElement("div");
7210
7210
  r.className = "pluno-pa-widget__timeline-bottom-sentinel", r.setAttribute("aria-hidden", "true"), o.appendChild(r), s.appendChild(o);
7211
7211
  const l = document.createElement("div");
@@ -7217,10 +7217,10 @@ function Mg(t, e) {
7217
7217
  qi(
7218
7218
  "pluno-pa-widget__history",
7219
7219
  Gs(),
7220
- Fg(),
7220
+ Hg(),
7221
7221
  !0
7222
7222
  )
7223
- ), s.appendChild(c), s.appendChild(Ug()), n.appendChild(s), n.appendChild(Pg()), n.appendChild(Rg()), n.appendChild(Dg()), n.appendChild(yt("left", "Resize Pluno from left")), n.appendChild(
7223
+ ), s.appendChild(c), s.appendChild(Ng()), n.appendChild(s), n.appendChild(Rg()), n.appendChild(Lg()), n.appendChild(Ug()), n.appendChild(yt("left", "Resize Pluno from left")), n.appendChild(
7224
7224
  yt("right", "Resize Pluno from right")
7225
7225
  ), n.appendChild(yt("top", "Resize Pluno from top")), n.appendChild(
7226
7226
  yt("bottom", "Resize Pluno from bottom")
@@ -7241,7 +7241,7 @@ function yt(t, e) {
7241
7241
  `pluno-pa-widget__resize-handle--${t}`
7242
7242
  ].join(" "), n.dataset.resizeDirection = t, n.setAttribute("aria-label", e), n.title = e, n;
7243
7243
  }
7244
- function Pg() {
7244
+ function Rg() {
7245
7245
  const t = document.createElement("div");
7246
7246
  t.className = "pluno-pa-widget__notify-suggestion", t.hidden = !0;
7247
7247
  const e = document.createElement("span");
@@ -7255,7 +7255,7 @@ function Pg() {
7255
7255
  const o = document.createElement("button");
7256
7256
  return o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-never", o.textContent = "Never", n.append(i, s, o), t.append(e, n), t;
7257
7257
  }
7258
- function Rg() {
7258
+ function Lg() {
7259
7259
  const t = document.createElement("div");
7260
7260
  t.className = "pluno-pa-widget__notify-suggestion pluno-pa-widget__tab-groups-suggestion", t.hidden = !0;
7261
7261
  const e = document.createElement("span");
@@ -7267,7 +7267,7 @@ function Rg() {
7267
7267
  const s = document.createElement("button");
7268
7268
  return s.type = "button", s.className = "pluno-pa-widget__notify-suggestion-later pluno-pa-widget__tab-groups-suggestion-dismiss", s.textContent = "Not now", n.append(i, s), t.append(e, n), t;
7269
7269
  }
7270
- function Lg() {
7270
+ function Dg() {
7271
7271
  const t = document.createElement("aside");
7272
7272
  t.className = "pluno-pa-widget__proactive-suggestion", t.hidden = !0;
7273
7273
  const e = document.createElement("button");
@@ -7279,7 +7279,7 @@ function Lg() {
7279
7279
  const s = document.createElement("div");
7280
7280
  s.className = "pluno-pa-widget__proactive-suggestion-actions";
7281
7281
  const o = document.createElement("button");
7282
- o.type = "button", o.className = "pluno-pa-widget__proactive-suggestion-edit", o.setAttribute("aria-label", "Edit suggestion"), o.title = "Edit suggestion", o.appendChild(Wg());
7282
+ o.type = "button", o.className = "pluno-pa-widget__proactive-suggestion-edit", o.setAttribute("aria-label", "Edit suggestion"), o.title = "Edit suggestion", o.appendChild(Fg());
7283
7283
  const r = document.createElement("button");
7284
7284
  r.type = "button", r.className = "pluno-pa-widget__proactive-suggestion-never-show", r.textContent = "Don’t suggest this again";
7285
7285
  const l = document.createElement("button");
@@ -7295,7 +7295,7 @@ function Lg() {
7295
7295
  const h = document.createElement("button");
7296
7296
  return h.type = "button", h.className = "pluno-pa-widget__proactive-suggestion-feedback-submit", h.textContent = "Send feedback", h.disabled = !0, d.append(c, u, p, h), t.append(e, n, i, s, d), t;
7297
7297
  }
7298
- function Dg() {
7298
+ function Ug() {
7299
7299
  const t = document.createElement("form");
7300
7300
  t.className = "pluno-pa-widget__composer";
7301
7301
  const e = document.createElement("div");
@@ -7309,7 +7309,7 @@ function Dg() {
7309
7309
  const o = document.createElement("input");
7310
7310
  o.className = "pluno-pa-widget__attachment-input", o.type = "file", o.multiple = !0, o.tabIndex = -1, o.setAttribute("aria-hidden", "true"), s.appendChild(o);
7311
7311
  const r = document.createElement("button");
7312
- r.type = "button", r.className = "pluno-pa-widget__attach", r.setAttribute("aria-label", "Attach files"), r.title = "Attach files", r.appendChild($g()), r.appendChild(jg()), s.appendChild(r);
7312
+ r.type = "button", r.className = "pluno-pa-widget__attach", r.setAttribute("aria-label", "Attach files"), r.title = "Attach files", r.appendChild(jg()), r.appendChild(Gg()), s.appendChild(r);
7313
7313
  const l = document.createElement("textarea");
7314
7314
  l.className = "pluno-pa-widget__input", l.rows = 1, l.placeholder = "Ask for anything...", s.appendChild(l);
7315
7315
  const d = document.createElement("button");
@@ -7346,14 +7346,14 @@ function Fr(t) {
7346
7346
  const e = document.createElement("button");
7347
7347
  e.type = "button", e.className = "pluno-pa-widget__model-option", e.dataset.model = t.value;
7348
7348
  const n = document.createElement("span");
7349
- n.textContent = t.label;
7349
+ n.textContent = fd(t);
7350
7350
  const i = document.createElement("span");
7351
7351
  return i.className = "pluno-pa-widget__model-price", i.textContent = t.price, e.append(n, i), e.setAttribute("role", "option"), e;
7352
7352
  }
7353
7353
  function Gs() {
7354
7354
  return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
7355
7355
  }
7356
- function Ug() {
7356
+ function Ng() {
7357
7357
  const t = document.createElement("section");
7358
7358
  t.className = "pluno-pa-widget__history-panel", t.hidden = !0, t.setAttribute("aria-label", Gs());
7359
7359
  const e = document.createElement("div");
@@ -7372,7 +7372,7 @@ function Ug() {
7372
7372
  const o = document.createElement("p");
7373
7373
  return o.className = "pluno-pa-widget__history-status", o.hidden = !0, t.append(e, s, o), t;
7374
7374
  }
7375
- function Ng(t) {
7375
+ function Og(t) {
7376
7376
  const e = document.createElement("div");
7377
7377
  return e.className = "pluno-pa-widget__empty-state", e.appendChild(
7378
7378
  lt(
@@ -7400,14 +7400,14 @@ function Ya(t, e) {
7400
7400
  function lt(t, e) {
7401
7401
  const n = `pluno-pa-character-${Ur}`;
7402
7402
  Ur += 1;
7403
- const i = e.scribbleStyle ? qg(e.accentColor, n) : Og(e.accentColor, n), s = t.split(/\s+/).filter(Boolean);
7403
+ const i = e.scribbleStyle ? zg(e.accentColor, n) : qg(e.accentColor, n), s = t.split(/\s+/).filter(Boolean);
7404
7404
  return i.setAttribute(
7405
7405
  "class",
7406
7406
  s.includes("pluno-pa-widget__character") ? t : `pluno-pa-widget__character ${t}`
7407
7407
  ), i.setAttribute("aria-hidden", "true"), i.setAttribute("focusable", "false"), i.removeAttribute("role"), i.removeAttribute("aria-label"), i;
7408
7408
  }
7409
- function Og(t, e) {
7410
- const n = Vc(t), i = {
7409
+ function qg(t, e) {
7410
+ const n = Yc(t), i = {
7411
7411
  boltFill: `${e}-boltFill`,
7412
7412
  boltEdge: `${e}-boltEdge`,
7413
7413
  boltGlow: `${e}-boltGlow`,
@@ -7603,7 +7603,7 @@ function Og(t, e) {
7603
7603
  i
7604
7604
  ), s;
7605
7605
  }
7606
- function qg(t, e) {
7606
+ function zg(t, e) {
7607
7607
  const n = qa(t), i = {
7608
7608
  clip: `${e}-scribbleBoltClip`,
7609
7609
  wobble: `${e}-scribbleBoltWobble`
@@ -7634,7 +7634,7 @@ function qg(t, e) {
7634
7634
  "clip-path": Re(i.clip)
7635
7635
  });
7636
7636
  return E(c, "path", {
7637
- d: Kc(),
7637
+ d: Vc(),
7638
7638
  fill: "none",
7639
7639
  stroke: n,
7640
7640
  "stroke-width": "56",
@@ -7734,7 +7734,7 @@ function qi(t, e, n, i) {
7734
7734
  const s = document.createElement("button");
7735
7735
  return s.type = "button", s.className = t, s.setAttribute("aria-label", e), s.title = e, s.hidden = i, s.appendChild(n), s;
7736
7736
  }
7737
- function zg() {
7737
+ function Bg() {
7738
7738
  const t = O("svg", {
7739
7739
  class: "pluno-pa-widget__scribble-defs",
7740
7740
  "aria-hidden": "true",
@@ -7764,7 +7764,7 @@ function ks(t, e) {
7764
7764
  0,
7765
7765
  e - js * 2
7766
7766
  ), i = Math.max(
7767
- Ju,
7767
+ Zu,
7768
7768
  Math.floor(
7769
7769
  (n - $s * 2) / Hs
7770
7770
  )
@@ -7777,7 +7777,7 @@ function Za(t, e) {
7777
7777
  const n = e * Hs + $s * 2;
7778
7778
  t.dataset.spiralCount = `${e}`, t.setAttribute(
7779
7779
  "viewBox",
7780
- `0 0 ${n} ${Xu}`
7780
+ `0 0 ${n} ${Ju}`
7781
7781
  ), t.replaceChildren();
7782
7782
  for (let i = 0; i < e; i += 1) {
7783
7783
  const s = Dr[i % Dr.length], o = O("g", {
@@ -7859,7 +7859,7 @@ function Ks(t) {
7859
7859
  );
7860
7860
  return e.appendChild(O("path", { d: "m6 9 6 6 6-6" })), e;
7861
7861
  }
7862
- function Bg() {
7862
+ function Wg() {
7863
7863
  const t = De(
7864
7864
  "0 0 24 24",
7865
7865
  17,
@@ -7878,7 +7878,7 @@ function Bg() {
7878
7878
  })
7879
7879
  ), t;
7880
7880
  }
7881
- function Wg() {
7881
+ function Fg() {
7882
7882
  const t = De(
7883
7883
  "0 0 24 24",
7884
7884
  14,
@@ -7893,7 +7893,7 @@ function Wg() {
7893
7893
  })
7894
7894
  ), t.appendChild(O("path", { d: "m15 5 4 4" })), t;
7895
7895
  }
7896
- function Fg() {
7896
+ function Hg() {
7897
7897
  const t = De(
7898
7898
  "0 0 24 24",
7899
7899
  17,
@@ -7904,7 +7904,7 @@ function Fg() {
7904
7904
  );
7905
7905
  return t.appendChild(O("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), t.appendChild(O("path", { d: "M3 4v5h5" })), t.appendChild(O("path", { d: "M12 7v5l3 2" })), t;
7906
7906
  }
7907
- function Hg(t) {
7907
+ function $g(t) {
7908
7908
  const e = De(
7909
7909
  "0 0 16 16",
7910
7910
  14,
@@ -7945,7 +7945,7 @@ function Qa() {
7945
7945
  O("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
7946
7946
  ), t.appendChild(O("polyline", { points: "5 12 12 5 19 12" })), t;
7947
7947
  }
7948
- function $g() {
7948
+ function jg() {
7949
7949
  const t = De(
7950
7950
  "0 0 24 24",
7951
7951
  16,
@@ -7963,7 +7963,7 @@ function $g() {
7963
7963
  })
7964
7964
  ), t;
7965
7965
  }
7966
- function jg() {
7966
+ function Gg() {
7967
7967
  const t = De("0 0 24 24", 19, 19, "none", "currentColor");
7968
7968
  return t.setAttribute(
7969
7969
  "class",
@@ -7978,7 +7978,7 @@ function jg() {
7978
7978
  })
7979
7979
  ), t;
7980
7980
  }
7981
- function Gg() {
7981
+ function Kg() {
7982
7982
  const t = De("0 0 24 24", 18, 18, "currentColor");
7983
7983
  return t.appendChild(
7984
7984
  O("rect", {
@@ -7990,7 +7990,7 @@ function Gg() {
7990
7990
  })
7991
7991
  ), t;
7992
7992
  }
7993
- function Kg() {
7993
+ function Vg() {
7994
7994
  const t = De(
7995
7995
  "0 0 24 24",
7996
7996
  12,
@@ -8001,7 +8001,7 @@ function Kg() {
8001
8001
  );
8002
8002
  return t.appendChild(O("path", { d: "M18 6 6 18" })), t.appendChild(O("path", { d: "m6 6 12 12" })), t;
8003
8003
  }
8004
- function Vg() {
8004
+ function Yg() {
8005
8005
  const t = De(
8006
8006
  "0 0 24 24",
8007
8007
  13,
@@ -8076,18 +8076,18 @@ function nl(t) {
8076
8076
  e.input.value === n && e.input.selectionStart === e.start && e.input.selectionEnd === e.end && tl(e);
8077
8077
  });
8078
8078
  }
8079
- function Yg(t, e, n) {
8079
+ function Xg(t, e, n) {
8080
8080
  t.replaceChildren(), t.hidden = e.length === 0;
8081
8081
  for (let i = 0; i < e.length; i += 1) {
8082
8082
  const s = e[i], o = document.createElement("div");
8083
- o.className = "pluno-pa-widget__attachment", o.appendChild(Xg(s));
8083
+ o.className = "pluno-pa-widget__attachment", o.appendChild(Jg(s));
8084
8084
  const r = document.createElement("span");
8085
8085
  r.textContent = s.name, o.appendChild(r);
8086
8086
  const l = document.createElement("button");
8087
- l.type = "button", l.setAttribute("aria-label", `Remove ${s.name}`), l.appendChild(Kg()), l.addEventListener("click", () => n(i)), o.appendChild(l), t.appendChild(o);
8087
+ l.type = "button", l.setAttribute("aria-label", `Remove ${s.name}`), l.appendChild(Vg()), l.addEventListener("click", () => n(i)), o.appendChild(l), t.appendChild(o);
8088
8088
  }
8089
8089
  }
8090
- function Xg(t) {
8090
+ function Jg(t) {
8091
8091
  const e = go(t), n = Pi(t);
8092
8092
  if (e === "image" && n) {
8093
8093
  const i = document.createElement("img");
@@ -8108,7 +8108,7 @@ function Xg(t) {
8108
8108
  }
8109
8109
  return Ut(t);
8110
8110
  }
8111
- function Jg(t, e) {
8111
+ function Zg(t, e) {
8112
8112
  const n = go(t), i = Pi(t);
8113
8113
  if (n === "image" && i) {
8114
8114
  const s = document.createElement("img");
@@ -8116,7 +8116,7 @@ function Jg(t, e) {
8116
8116
  let o = t;
8117
8117
  return s.updateProductAgentAttachment = (r) => {
8118
8118
  o = r;
8119
- }, Zg(
8119
+ }, Qg(
8120
8120
  s,
8121
8121
  () => o,
8122
8122
  i,
@@ -8149,7 +8149,7 @@ function Jg(t, e) {
8149
8149
  }
8150
8150
  return Ut(t, "message");
8151
8151
  }
8152
- function Zg(t, e, n, i, s, o) {
8152
+ function Qg(t, e, n, i, s, o) {
8153
8153
  let r = n;
8154
8154
  const l = n.startsWith("data:") || n.startsWith(`blob:${window.location.origin}/`), d = () => {
8155
8155
  t.isConnected && t.replaceWith(
@@ -8187,7 +8187,7 @@ function Zg(t, e, n, i, s, o) {
8187
8187
  );
8188
8188
  }, h = () => {
8189
8189
  o();
8190
- const y = Su[u];
8190
+ const y = vu[u];
8191
8191
  if (u += 1, y === void 0) {
8192
8192
  d();
8193
8193
  return;
@@ -8220,22 +8220,22 @@ function Gr(t) {
8220
8220
  const e = go(t);
8221
8221
  return e === "image" ? "IMG" : e === "pdf" ? "PDF" : e === "video" ? "VID" : "FILE";
8222
8222
  }
8223
- function Qg(t, e, n) {
8223
+ function eh(t, e, n) {
8224
8224
  if (!e)
8225
8225
  return [];
8226
8226
  const i = Array.from(e);
8227
8227
  return n && i.forEach(Ea), i.map((s) => ({
8228
8228
  ...t.createLocalAttachment(s),
8229
- previewUrl: eh(s)
8229
+ previewUrl: th(s)
8230
8230
  }));
8231
8231
  }
8232
- function eh(t) {
8232
+ function th(t) {
8233
8233
  return typeof URL.createObjectURL == "function" ? URL.createObjectURL(t) : void 0;
8234
8234
  }
8235
8235
  function ci(t) {
8236
8236
  return !!(t && Array.from(t.types).includes("Files"));
8237
8237
  }
8238
- function th(t, e, n = null, i = !1, s, o = !1, r) {
8238
+ function nh(t, e, n = null, i = !1, s, o = !1, r) {
8239
8239
  const l = Pe(
8240
8240
  e,
8241
8241
  n
@@ -8245,17 +8245,17 @@ function th(t, e, n = null, i = !1, s, o = !1, r) {
8245
8245
  return;
8246
8246
  }
8247
8247
  t.hidden = !1, t.replaceChildren(), t.className = "pluno-pa-widget__billing-status", l ? t.appendChild(
8248
- ih(e, n)
8248
+ sh(e, n)
8249
8249
  ) : d ? t.appendChild(
8250
- nh(
8250
+ ih(
8251
8251
  e,
8252
8252
  r
8253
8253
  )
8254
8254
  ) : Ri(e) && t.appendChild(
8255
- sh(e, s)
8255
+ oh(e, s)
8256
8256
  );
8257
8257
  }
8258
- function nh(t, e) {
8258
+ function ih(t, e) {
8259
8259
  const n = document.createElement("div");
8260
8260
  if (n.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--fallback", e) {
8261
8261
  const o = document.createElement("button");
@@ -8266,7 +8266,7 @@ function nh(t, e) {
8266
8266
  const s = document.createElement("a");
8267
8267
  return s.href = t.pricingUrl, s.target = "_blank", s.rel = "noopener noreferrer", s.textContent = "upgrade here", i.appendChild(s), n.appendChild(i), n;
8268
8268
  }
8269
- function ih(t, e) {
8269
+ function sh(t, e) {
8270
8270
  const n = document.createElement("div");
8271
8271
  n.className = "pluno-pa-widget__billing-action-card";
8272
8272
  const i = !t.paymentIssue && (t.limitExceeded || e === "limit_exceeded"), s = i && t.onboardingIncomplete === !0, o = document.createElement("strong");
@@ -8287,7 +8287,7 @@ function ih(t, e) {
8287
8287
  );
8288
8288
  return n;
8289
8289
  }
8290
- function sh(t, e) {
8290
+ function oh(t, e) {
8291
8291
  const n = document.createElement("div");
8292
8292
  if (n.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low", e) {
8293
8293
  const o = document.createElement("button");
@@ -8296,7 +8296,7 @@ function sh(t, e) {
8296
8296
  const i = document.createElement("strong");
8297
8297
  i.textContent = "Credits running low", n.appendChild(i);
8298
8298
  const s = document.createElement("span");
8299
- return s.textContent = rh(t) ?? "Credits are running low for this period.", n.appendChild(s), n.appendChild(
8299
+ return s.textContent = ah(t) ?? "Credits are running low for this period.", n.appendChild(s), n.appendChild(
8300
8300
  il(
8301
8301
  t,
8302
8302
  "Upgrade",
@@ -8308,9 +8308,9 @@ function Vs(t, e) {
8308
8308
  return t !== null && (t.usingPaidCreditFallback === !0 || Pe(t, e) || Ri(t) || ho(e));
8309
8309
  }
8310
8310
  function Kr(t, e, n) {
8311
- return Vs(e, n) || oh(e) ? !0 : !Vs(t, n);
8311
+ return Vs(e, n) || rh(e) ? !0 : !Vs(t, n);
8312
8312
  }
8313
- function oh(t) {
8313
+ function rh(t) {
8314
8314
  return t != null && (t.creditsUsed !== null || t.creditLimit !== null || t.creditsRemaining !== null || t.usingPaidCreditFallback === !0 || Pe(t));
8315
8315
  }
8316
8316
  function Pe(t, e = null) {
@@ -8322,10 +8322,10 @@ function ho(t) {
8322
8322
  function Ri(t) {
8323
8323
  return t != null && t.usingPaidCreditFallback !== !0 && !Pe(t) && t.creditLimit !== null && t.creditLimit > 0 && t.creditsRemaining !== null && t.creditsRemaining > 0 && t.creditsRemaining / t.creditLimit <= 0.2;
8324
8324
  }
8325
- function rh(t) {
8326
- return t.creditsRemaining === null ? null : `${ah(t.creditsRemaining)} credits left`;
8327
- }
8328
8325
  function ah(t) {
8326
+ return t.creditsRemaining === null ? null : `${lh(t.creditsRemaining)} credits left`;
8327
+ }
8328
+ function lh(t) {
8329
8329
  return new Intl.NumberFormat("en-US", {
8330
8330
  maximumFractionDigits: 0
8331
8331
  }).format(Math.ceil(t));
@@ -8354,8 +8354,8 @@ function As(t, e) {
8354
8354
  (i) => !sl(i)
8355
8355
  ).length === 0 && !t.assistantDraft && !t.lastError && !t.isThinking && !e;
8356
8356
  }
8357
- function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z, H, q, B = !1) {
8358
- const Z = _h(o), ee = /* @__PURE__ */ new Map();
8357
+ function dh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z, H, q, B = !1) {
8358
+ const Z = Sh(o), ee = /* @__PURE__ */ new Map();
8359
8359
  for (const S of Z) {
8360
8360
  const x = S.scheduledCheckInAt ? Si(S.scheduledCheckInAt) : null;
8361
8361
  if (!x || !S.scheduledCheckInAt)
@@ -8366,7 +8366,7 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z,
8366
8366
  label: x
8367
8367
  });
8368
8368
  }
8369
- const ye = [...ee.values()].sort((S, x) => Date.parse(S.dueAt) - Date.parse(x.dueAt)), $ = Sh(
8369
+ const ye = [...ee.values()].sort((S, x) => Date.parse(S.dueAt) - Date.parse(x.dueAt)), $ = vh(
8370
8370
  Z.filter(
8371
8371
  (S) => !sl(S) && !S.scheduledCheckInAt
8372
8372
  )
@@ -8413,7 +8413,7 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z,
8413
8413
  const N = document.createElement("button");
8414
8414
  N.type = "button", N.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", N.disabled = !0, N.tabIndex = -1, N.textContent = "Finding example tasks...", ie.appendChild(N);
8415
8415
  } else
8416
- for (let N = 0; N < Ou; N += 1) {
8416
+ for (let N = 0; N < qu; N += 1) {
8417
8417
  const K = document.createElement("button");
8418
8418
  K.type = "button", K.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", K.disabled = !0, K.tabIndex = -1, K.textContent = "", ie.appendChild(K);
8419
8419
  }
@@ -8429,14 +8429,14 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z,
8429
8429
  let V = null, Q = null, se = [], Ie = [];
8430
8430
  const oe = $.some(Js), dt = $.some(
8431
8431
  (S) => S.role === "tool" && Yr(S, $, o.lastError === null)
8432
- ), Te = o.turnPhase ? yu(o.turnPhase) : "Thinking...";
8432
+ ), Te = o.turnPhase ? _u(o.turnPhase) : "Thinking...";
8433
8433
  let Ue = !1;
8434
8434
  const fe = () => {
8435
8435
  if (se.length === 0)
8436
8436
  return Ue = !1, !1;
8437
8437
  const S = se.some(
8438
8438
  (j) => Yr(j, $, o.lastError === null)
8439
- ), x = Mh(
8439
+ ), x = Ph(
8440
8440
  se,
8441
8441
  S,
8442
8442
  p,
@@ -8454,7 +8454,7 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z,
8454
8454
  for (let S = 0; S < $.length; S += 1) {
8455
8455
  const x = $[S];
8456
8456
  if (x.role === "tool" && x.integrationAuthRequest && z) {
8457
- const N = dh(
8457
+ const N = ph(
8458
8458
  x.integrationAuthRequest,
8459
8459
  z.states.get(
8460
8460
  x.integrationAuthRequest.authRequestId
@@ -8468,7 +8468,7 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z,
8468
8468
  }
8469
8469
  if (x.role === "tool" && x.personalChannelConnectionRequest && H) {
8470
8470
  Ie.push(
8471
- ph(
8471
+ ch(
8472
8472
  x.personalChannelConnectionRequest,
8473
8473
  H.onConnect
8474
8474
  )
@@ -8481,7 +8481,7 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z,
8481
8481
  }
8482
8482
  if (x.role === "system" && x.dataType === "run_status" && x.steered === !0) {
8483
8483
  if (!fe()) {
8484
- const K = Lh(f());
8484
+ const K = Dh(f());
8485
8485
  R(K), V = null, Q = K;
8486
8486
  }
8487
8487
  continue;
@@ -8531,7 +8531,7 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z,
8531
8531
  const N = An(f());
8532
8532
  R(N), V = null, Q = N;
8533
8533
  }
8534
- const ie = ch(
8534
+ const ie = uh(
8535
8535
  x,
8536
8536
  L,
8537
8537
  h,
@@ -8572,7 +8572,7 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z,
8572
8572
  }
8573
8573
  const Ne = q ? q.actionCandidate ?? (o.isThinking ? null : Kl(Z)) : null;
8574
8574
  if (q && Ne && !q.dismissedCandidateIds.has(Ne.id)) {
8575
- const S = kh(Ne, {
8575
+ const S = Eh(Ne, {
8576
8576
  isActing: q.actionCandidate?.id === Ne.id,
8577
8577
  error: q.error,
8578
8578
  characterIconOptions: q.characterIconOptions,
@@ -8588,7 +8588,7 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z,
8588
8588
  for (const S of ye) {
8589
8589
  const x = document.createElement("div");
8590
8590
  x.className = "pluno-pa-widget__next-check-in", x.append(
8591
- Hg(S.dueAt),
8591
+ $g(S.dueAt),
8592
8592
  document.createTextNode(S.label)
8593
8593
  ), R(x), V = null, Q = x;
8594
8594
  }
@@ -8596,15 +8596,15 @@ function lh(t, e, n, i, s, o, r, l, d, c, u, p, h, y, b, f, m, I, _, T, A, P, z,
8596
8596
  "pluno-pa-widget__message--bottom-reserve"
8597
8597
  ), Q?.classList.add(
8598
8598
  "pluno-pa-widget__bottom-reserve-compact"
8599
- ), R(e), bh(
8599
+ ), R(e), yh(
8600
8600
  h,
8601
8601
  k
8602
- ), yh(
8602
+ ), _h(
8603
8603
  y,
8604
8604
  W
8605
8605
  ), _t(t, he), c ? Tn(t, u) : t.scrollTop = ge;
8606
8606
  }
8607
- function dh(t, e, n) {
8607
+ function ph(t, e, n) {
8608
8608
  const i = document.createElement("section");
8609
8609
  i.className = "pluno-pa-widget__integration-auth-card", i.setAttribute("aria-label", `Connect ${t.appName}`);
8610
8610
  const s = document.createElement("div");
@@ -8622,7 +8622,7 @@ function dh(t, e, n) {
8622
8622
  const d = document.createElement("button");
8623
8623
  return d.type = "button", d.className = "pluno-pa-widget__integration-auth-button", d.disabled = e.status === "checking" || e.status === "connecting" || e.status === "completed", e.status === "checking" ? d.textContent = "Checking connection..." : e.status === "connecting" ? d.textContent = "Connecting..." : e.status === "completed" ? d.textContent = "Connected" : e.status === "expired" || e.status === "cancelled" ? d.textContent = `Reconnect ${t.appName}` : e.status === "error" ? d.textContent = "Try again" : d.textContent = `Connect ${t.appName}`, d.addEventListener("click", () => n(t)), i.appendChild(d), i;
8624
8624
  }
8625
- function ph(t, e) {
8625
+ function ch(t, e) {
8626
8626
  const n = document.createElement("section");
8627
8627
  n.className = "pluno-pa-widget__integration-auth-card", n.setAttribute("aria-label", "Connect WhatsApp");
8628
8628
  const i = document.createElement("div");
@@ -8634,18 +8634,18 @@ function ph(t, e) {
8634
8634
  const l = document.createElement("button");
8635
8635
  return l.type = "button", l.className = "pluno-pa-widget__integration-auth-button", l.textContent = "Pair WhatsApp", l.addEventListener("click", () => e(t)), n.appendChild(l), n;
8636
8636
  }
8637
- function ch(t, e, n, i, s) {
8638
- const o = gh(t), r = fh(
8637
+ function uh(t, e, n, i, s) {
8638
+ const o = hh(t), r = mh(
8639
8639
  t,
8640
8640
  e
8641
8641
  ), l = n.get(o);
8642
8642
  if (l)
8643
- return uh(
8643
+ return gh(
8644
8644
  l.node,
8645
8645
  t.attachments ?? []
8646
8646
  ), l.node.classList.remove(
8647
8647
  "pluno-pa-widget__message--bottom-reserve"
8648
- ), i.add(o), l.renderSignature === r ? (l.renderDeferred = !1, l.node) : mh(l.node) ? (l.renderDeferred = !0, l.node) : (Vr(
8648
+ ), i.add(o), l.renderSignature === r ? (l.renderDeferred = !1, l.node) : wh(l.node) ? (l.renderDeferred = !0, l.node) : (Vr(
8649
8649
  l.node,
8650
8650
  t,
8651
8651
  e,
@@ -8664,18 +8664,18 @@ function ch(t, e, n, i, s) {
8664
8664
  }
8665
8665
  function Vr(t, e, n, i) {
8666
8666
  if (t.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, t.removeAttribute("data-phase"), e.role === "assistant" ? (e.phase && (t.dataset.phase = e.phase), t.replaceChildren(), fo(t, n)) : t.textContent = n, e.role === "user" && e.attachments?.length && t.appendChild(
8667
- Ih(
8667
+ Th(
8668
8668
  e.attachments,
8669
8669
  i
8670
8670
  )
8671
8671
  ), e.phase !== "commentary" && (e.role === "user" || e.dataType !== "assistant_draft")) {
8672
8672
  const s = document.createElement("div");
8673
8673
  s.className = "pluno-pa-widget__message-actions";
8674
- const o = Ch(e.createdAt), r = Th(n);
8674
+ const o = kh(e.createdAt), r = Ch(n);
8675
8675
  e.role === "user" ? s.append(o, r) : s.append(r, o), t.appendChild(s);
8676
8676
  }
8677
8677
  }
8678
- function uh(t, e) {
8678
+ function gh(t, e) {
8679
8679
  const n = t.querySelector(
8680
8680
  ".pluno-pa-widget__message-attachments"
8681
8681
  );
@@ -8683,11 +8683,11 @@ function uh(t, e) {
8683
8683
  for (let i = 0; i < e.length; i += 1)
8684
8684
  n.children[i]?.firstElementChild?.updateProductAgentAttachment?.(e[i]);
8685
8685
  }
8686
- function gh(t) {
8687
- const e = hh(t), n = t.assistantDraftItemId;
8686
+ function hh(t) {
8687
+ const e = fh(t), n = t.assistantDraftItemId;
8688
8688
  return `${t.role}:${e ?? n ?? t.id}`;
8689
8689
  }
8690
- function hh(t) {
8690
+ function fh(t) {
8691
8691
  const e = t.clientMessageId;
8692
8692
  if (e)
8693
8693
  return e;
@@ -8696,7 +8696,7 @@ function hh(t) {
8696
8696
  );
8697
8697
  return n ? t.id.slice(n.length) : null;
8698
8698
  }
8699
- function fh(t, e) {
8699
+ function mh(t, e) {
8700
8700
  return JSON.stringify({
8701
8701
  role: t.role,
8702
8702
  content: e,
@@ -8718,7 +8718,7 @@ function fh(t, e) {
8718
8718
  })
8719
8719
  });
8720
8720
  }
8721
- function mh(t) {
8721
+ function wh(t) {
8722
8722
  const e = t.ownerDocument.getSelection();
8723
8723
  if (!e || e.isCollapsed)
8724
8724
  return !1;
@@ -8727,16 +8727,16 @@ function mh(t) {
8727
8727
  return !0;
8728
8728
  return !1;
8729
8729
  }
8730
- function wh(t) {
8730
+ function bh(t) {
8731
8731
  return Array.from(t.values()).some(
8732
8732
  (e) => e.renderDeferred === !0
8733
8733
  );
8734
8734
  }
8735
- function bh(t, e) {
8735
+ function yh(t, e) {
8736
8736
  for (const n of t.keys())
8737
8737
  e.has(n) || t.delete(n);
8738
8738
  }
8739
- function yh(t, e) {
8739
+ function _h(t, e) {
8740
8740
  for (const n of t.keys())
8741
8741
  e.has(n) || t.delete(n);
8742
8742
  }
@@ -8754,7 +8754,7 @@ function _t(t, e) {
8754
8754
  n = n.nextSibling, t.removeChild(i);
8755
8755
  }
8756
8756
  }
8757
- function _h(t) {
8757
+ function Sh(t) {
8758
8758
  if (!t.assistantDraft)
8759
8759
  return [...t.messages];
8760
8760
  if (t.assistantDraftItemId && t.messages.some(
@@ -8795,7 +8795,7 @@ function _h(t) {
8795
8795
  ...t.messages.slice(s)
8796
8796
  ];
8797
8797
  }
8798
- function Sh(t) {
8798
+ function vh(t) {
8799
8799
  const e = t.map((p, h) => ({
8800
8800
  message: p.role === "assistant" && p.phase === "commentary" ? { ...p, role: "tool" } : p,
8801
8801
  originalIndex: h
@@ -8853,13 +8853,13 @@ function Sh(t) {
8853
8853
  }
8854
8854
  function Yr(t, e, n) {
8855
8855
  return !n || !t.respondsToUserMessageId || t.steered === !0 ? !1 : !e.some(
8856
- (i) => (vh(i) || xh(i)) && vt(t, i)
8856
+ (i) => (xh(i) || Ih(i)) && vt(t, i)
8857
8857
  );
8858
8858
  }
8859
- function vh(t) {
8859
+ function xh(t) {
8860
8860
  return t.role === "assistant" && t.phase !== "commentary";
8861
8861
  }
8862
- function xh(t) {
8862
+ function Ih(t) {
8863
8863
  return t.role === "system" && (t.dataType === "run_error" || t.dataType === "run_status" && t.loading !== !0);
8864
8864
  }
8865
8865
  function vt(t, e) {
@@ -8890,28 +8890,28 @@ function Xr(t, e, n, i, s, o, r, l) {
8890
8890
  }
8891
8891
  t.appendChild(d);
8892
8892
  }
8893
- function Ih(t, e) {
8893
+ function Th(t, e) {
8894
8894
  const n = document.createElement("div");
8895
8895
  n.className = "pluno-pa-widget__message-attachments";
8896
8896
  for (const i of t) {
8897
8897
  const s = document.createElement("div");
8898
8898
  s.className = "pluno-pa-widget__message-attachment", s.appendChild(
8899
- Jg(i, e)
8899
+ Zg(i, e)
8900
8900
  ), n.appendChild(s);
8901
8901
  }
8902
8902
  return n;
8903
8903
  }
8904
- function Th(t) {
8904
+ function Ch(t) {
8905
8905
  const e = document.createElement("button");
8906
- return e.type = "button", e.className = "pluno-pa-widget__message-copy", e.setAttribute("aria-label", "Copy message"), e.title = "Copy message", e.appendChild(Vg()), e.addEventListener("click", (n) => {
8906
+ return e.type = "button", e.className = "pluno-pa-widget__message-copy", e.setAttribute("aria-label", "Copy message"), e.title = "Copy message", e.appendChild(Yg()), e.addEventListener("click", (n) => {
8907
8907
  n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(t), n.detail > 0 && e.blur();
8908
8908
  }), e;
8909
8909
  }
8910
- function Ch(t) {
8910
+ function kh(t) {
8911
8911
  const e = document.createElement("time");
8912
- return e.className = "pluno-pa-widget__message-timestamp", e.dateTime = t, e.textContent = hu(t), e;
8912
+ return e.className = "pluno-pa-widget__message-timestamp", e.dateTime = t, e.textContent = fu(t), e;
8913
8913
  }
8914
- function kh(t, e) {
8914
+ function Eh(t, e) {
8915
8915
  const n = Xl(t.id), i = document.createElement("article");
8916
8916
  i.className = "pluno-pa-widget__share-prompt";
8917
8917
  const s = document.createElement("div");
@@ -8950,18 +8950,18 @@ function kh(t, e) {
8950
8950
  const h = document.createElement("button");
8951
8951
  h.type = "button", h.className = "pluno-pa-widget__share-prompt-draft", h.disabled = e.isActing, h.addEventListener("click", () => {
8952
8952
  e.onReferralCopy(t);
8953
- }), e.isActing ? (h.appendChild(Uh()), h.appendChild(document.createTextNode("Copying..."))) : h.textContent = "Copy invite link", c.appendChild(h);
8953
+ }), e.isActing ? (h.appendChild(Nh()), h.appendChild(document.createTextNode("Copying..."))) : h.textContent = "Copy invite link", c.appendChild(h);
8954
8954
  } else
8955
- for (const h of Eh()) {
8955
+ for (const h of Ah()) {
8956
8956
  const y = document.createElement("a");
8957
- y.className = "pluno-pa-widget__share-prompt-social", y.href = h.href, y.target = "_blank", y.rel = "noopener noreferrer", y.setAttribute("aria-label", `Open ${h.label}`), y.title = h.label, y.appendChild(Ah(h.id)), y.addEventListener("click", () => e.onSocialShare(t)), c.appendChild(y);
8957
+ y.className = "pluno-pa-widget__share-prompt-social", y.href = h.href, y.target = "_blank", y.rel = "noopener noreferrer", y.setAttribute("aria-label", `Open ${h.label}`), y.title = h.label, y.appendChild(Mh(h.id)), y.addEventListener("click", () => e.onSocialShare(t)), c.appendChild(y);
8958
8958
  }
8959
8959
  const u = document.createElement("button");
8960
8960
  u.type = "button", u.className = "pluno-pa-widget__share-prompt-dismiss", u.setAttribute("aria-label", "Dismiss share prompt"), u.title = "Dismiss", u.textContent = "Dismiss", u.addEventListener("click", () => e.onDismiss(t)), c.appendChild(u), d.appendChild(c);
8961
8961
  const p = document.createElement("button");
8962
8962
  return p.type = "button", p.className = "pluno-pa-widget__share-prompt-disable", p.textContent = "Don't ask again", p.addEventListener("click", () => e.onDisable(t)), d.appendChild(p), s.appendChild(d), i.appendChild(s), i;
8963
8963
  }
8964
- function Eh() {
8964
+ function Ah() {
8965
8965
  const t = "https://pluno.ai/browser", e = `I just used @pluno_ai to get work done directly inside my tools. Worth trying: ${t}`;
8966
8966
  return [
8967
8967
  {
@@ -8981,7 +8981,7 @@ function Eh() {
8981
8981
  }
8982
8982
  ];
8983
8983
  }
8984
- function Ah(t) {
8984
+ function Mh(t) {
8985
8985
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
8986
8986
  e.setAttribute("class", "pluno-pa-widget__share-prompt-platform-logo"), e.setAttribute("viewBox", "0 0 32 32"), e.setAttribute("aria-hidden", "true");
8987
8987
  const n = (i, s) => {
@@ -8996,12 +8996,12 @@ function sl(t) {
8996
8996
  function Li(t) {
8997
8997
  return t.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
8998
8998
  }
8999
- function Mh(t, e, n, i, s, o, r) {
8999
+ function Ph(t, e, n, i, s, o, r) {
9000
9000
  const l = t.length > 0 && t.every((T) => T.steered === !0);
9001
9001
  e = e && !l;
9002
- const d = Dh(t);
9002
+ const d = Uh(t);
9003
9003
  s.add(d);
9004
- let c = Rh(
9004
+ let c = Lh(
9005
9005
  i,
9006
9006
  d,
9007
9007
  t
@@ -9044,7 +9044,7 @@ function Mh(t, e, n, i, s, o, r) {
9044
9044
  h.className = "pluno-pa-widget__tool-group", h.dataset.responseGroupKey = d, h.classList.toggle("pluno-pa-widget__tool-group--active", e), h.title = new Date(
9045
9045
  t[t.length - 1].createdAt
9046
9046
  ).toLocaleString();
9047
- const y = Ph(
9047
+ const y = Rh(
9048
9048
  t,
9049
9049
  e,
9050
9050
  u.lines,
@@ -9069,7 +9069,7 @@ function Mh(t, e, n, i, s, o, r) {
9069
9069
  b.open ? "Activity" : _
9070
9070
  ), _t(b, [u.summary, y]), _t(h, [u.character, b]), h;
9071
9071
  }
9072
- function Ph(t, e, n, i) {
9072
+ function Rh(t, e, n, i) {
9073
9073
  const s = [...t].reverse().find((l) => l.phase !== "commentary"), o = [], r = /* @__PURE__ */ new Set();
9074
9074
  for (const l of t) {
9075
9075
  const d = ol(l);
@@ -9085,7 +9085,7 @@ function Ph(t, e, n, i) {
9085
9085
  r.has(l) || i.delete(l);
9086
9086
  return _t(n, o), n;
9087
9087
  }
9088
- function Rh(t, e, n) {
9088
+ function Lh(t, e, n) {
9089
9089
  const i = t.get(e);
9090
9090
  if (i)
9091
9091
  return i;
@@ -9122,7 +9122,7 @@ function Jr(t, e = "Thinking...") {
9122
9122
  const n = An(t);
9123
9123
  return n.classList.add("pluno-pa-widget__thinking-marker"), n.appendChild(Mn(e)), n;
9124
9124
  }
9125
- function Lh(t) {
9125
+ function Dh(t) {
9126
9126
  const e = An(t), n = document.createElement("div");
9127
9127
  return n.className = "pluno-pa-widget__status", n.textContent = "Steered", e.appendChild(n), e;
9128
9128
  }
@@ -9134,16 +9134,16 @@ function Mn(t = "Thinking...") {
9134
9134
  const i = document.createElement("span");
9135
9135
  return i.textContent = t, e.appendChild(i), e;
9136
9136
  }
9137
- function Dh(t) {
9137
+ function Uh(t) {
9138
9138
  const e = t[0];
9139
9139
  return e ? `tools:${Xs(e)}` : "tools:empty";
9140
9140
  }
9141
- function Uh() {
9141
+ function Nh() {
9142
9142
  const t = document.createElement("span");
9143
9143
  return t.className = "pluno-pa-widget__spinner", t.setAttribute("aria-hidden", "true"), t;
9144
9144
  }
9145
9145
  function al(t, e) {
9146
- t.setAttribute("aria-label", e ? "Stop" : "Send"), t.classList.toggle("pluno-pa-widget__send--stop", e), t.replaceChildren(e ? Gg() : Qa());
9146
+ t.setAttribute("aria-label", e ? "Stop" : "Send"), t.classList.toggle("pluno-pa-widget__send--stop", e), t.replaceChildren(e ? Kg() : Qa());
9147
9147
  }
9148
9148
  function Ms(t) {
9149
9149
  let e = t.trim();
@@ -9158,18 +9158,18 @@ function Ms(t) {
9158
9158
  }
9159
9159
  return n.push(i.trim()), n.length > 1 ? n : null;
9160
9160
  }
9161
- function Nh(t) {
9161
+ function Oh(t) {
9162
9162
  const e = t.trim();
9163
9163
  if (/^:?-{3,}:?$/.test(e))
9164
9164
  return e.startsWith(":") && e.endsWith(":") ? "center" : e.endsWith(":") ? "right" : e.startsWith(":") ? "left" : null;
9165
9165
  }
9166
- function Oh(t, e) {
9166
+ function qh(t, e) {
9167
9167
  const n = Ms(t[e] ?? ""), i = Ms(t[e + 1] ?? "");
9168
9168
  if (!n || !i || n.length !== i.length)
9169
9169
  return null;
9170
9170
  const s = [];
9171
9171
  for (const p of i) {
9172
- const h = Nh(p);
9172
+ const h = Oh(p);
9173
9173
  if (h === void 0)
9174
9174
  return null;
9175
9175
  s.push(h);
@@ -9216,7 +9216,7 @@ function fo(t, e) {
9216
9216
  `), h.appendChild(y), t.appendChild(h);
9217
9217
  continue;
9218
9218
  }
9219
- const r = Oh(n, i);
9219
+ const r = qh(n, i);
9220
9220
  if (r) {
9221
9221
  t.appendChild(r.element), i = r.nextIndex;
9222
9222
  continue;
@@ -9275,7 +9275,7 @@ function St(t, e) {
9275
9275
  St(l, r.slice(1, -1)), t.appendChild(l);
9276
9276
  } else {
9277
9277
  const l = r.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
9278
- if (l && qh(l[2])) {
9278
+ if (l && zh(l[2])) {
9279
9279
  const d = document.createElement("a");
9280
9280
  d.href = l[2], d.target = Hl(l[2]) ? "_blank" : "_top", d.rel = "noreferrer", d.textContent = l[1], t.appendChild(d);
9281
9281
  } else
@@ -9285,7 +9285,7 @@ function St(t, e) {
9285
9285
  }
9286
9286
  i < e.length && t.appendChild(document.createTextNode(e.slice(i)));
9287
9287
  }
9288
- function qh(t) {
9288
+ function zh(t) {
9289
9289
  if (t.startsWith("/") || t.startsWith("#"))
9290
9290
  return !0;
9291
9291
  try {
@@ -9296,7 +9296,7 @@ function qh(t) {
9296
9296
  }
9297
9297
  }
9298
9298
  function Zr(t, e) {
9299
- if (zh(t))
9299
+ if (Bh(t))
9300
9300
  return;
9301
9301
  const n = `
9302
9302
  :host {
@@ -12449,18 +12449,18 @@ function Zr(t, e) {
12449
12449
  }
12450
12450
  }
12451
12451
  `;
12452
- if (Bh(t, n))
12452
+ if (Wh(t, n))
12453
12453
  return;
12454
12454
  const i = t.ownerDocument.createElement("style");
12455
12455
  i.id = Ga, i.textContent = n, t.appendChild(i), ll(t);
12456
12456
  }
12457
- function zh(t) {
12457
+ function Bh(t) {
12458
12458
  return t.getElementById(Ga) !== null || t.host instanceof HTMLElement && t.host.getAttribute(Ka) === "true";
12459
12459
  }
12460
12460
  function ll(t) {
12461
12461
  t.host instanceof HTMLElement && t.host.setAttribute(Ka, "true");
12462
12462
  }
12463
- function Bh(t, e) {
12463
+ function Wh(t, e) {
12464
12464
  if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in t))
12465
12465
  return !1;
12466
12466
  try {
@@ -12470,7 +12470,7 @@ function Bh(t, e) {
12470
12470
  return !1;
12471
12471
  }
12472
12472
  }
12473
- async function Wh() {
12473
+ async function Fh() {
12474
12474
  return document.body ? document.body : await new Promise((t) => {
12475
12475
  const e = new MutationObserver(() => {
12476
12476
  document.body && (e.disconnect(), t(document.body));
@@ -12484,7 +12484,7 @@ function mo(t) {
12484
12484
  function dl(t) {
12485
12485
  return `${mo(t)}.displayState`;
12486
12486
  }
12487
- function Fh(t) {
12487
+ function Hh(t) {
12488
12488
  try {
12489
12489
  return window.sessionStorage.getItem(
12490
12490
  dl(t)
@@ -12506,7 +12506,7 @@ function Qr(t, e) {
12506
12506
  return;
12507
12507
  }
12508
12508
  }
12509
- function Hh(t) {
12509
+ function $h(t) {
12510
12510
  if (t)
12511
12511
  return { clientId: t, release: () => {
12512
12512
  } };
@@ -12514,7 +12514,7 @@ function Hh(t) {
12514
12514
  for (; Ss.has(e); )
12515
12515
  e += 1;
12516
12516
  Ss.add(e);
12517
- const n = `${Uu}${e}`;
12517
+ const n = `${Nu}${e}`;
12518
12518
  let i = crypto.randomUUID();
12519
12519
  try {
12520
12520
  i = window.sessionStorage.getItem(n) ?? i, window.sessionStorage.setItem(n, i);
@@ -12528,7 +12528,7 @@ function Hh(t) {
12528
12528
  }
12529
12529
  };
12530
12530
  }
12531
- function $h(t) {
12531
+ function jh(t) {
12532
12532
  try {
12533
12533
  const e = window.localStorage.getItem(mo(t));
12534
12534
  if (!e)
@@ -12542,8 +12542,8 @@ function $h(t) {
12542
12542
  openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
12543
12543
  (i) => typeof i == "string"
12544
12544
  ) : [],
12545
- launcherPosition: Vh(n.launcherPosition) ? n.launcherPosition : null,
12546
- panelSize: Yh(n.panelSize) ? Oi(n.panelSize) : null,
12545
+ launcherPosition: Yh(n.launcherPosition) ? n.launcherPosition : null,
12546
+ panelSize: Xh(n.panelSize) ? Oi(n.panelSize) : null,
12547
12547
  seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((i) => typeof i == "string").slice(-Ba) : [],
12548
12548
  sharePromptsDisabled: n.sharePromptsDisabled === !0
12549
12549
  };
@@ -12551,7 +12551,7 @@ function $h(t) {
12551
12551
  return ea();
12552
12552
  }
12553
12553
  }
12554
- async function jh(t) {
12554
+ async function Gh(t) {
12555
12555
  if (t.loadSharePromptsDisabled)
12556
12556
  return t.loadSharePromptsDisabled();
12557
12557
  try {
@@ -12560,7 +12560,7 @@ async function jh(t) {
12560
12560
  return !1;
12561
12561
  }
12562
12562
  }
12563
- function Gh(t, e) {
12563
+ function Kh(t, e) {
12564
12564
  if (t.persistSharePromptsDisabled) {
12565
12565
  Promise.resolve(t.persistSharePromptsDisabled(e)).catch(
12566
12566
  () => {
@@ -12587,7 +12587,7 @@ function ea() {
12587
12587
  sharePromptsDisabled: !1
12588
12588
  };
12589
12589
  }
12590
- function Kh(t, e) {
12590
+ function Vh(t, e) {
12591
12591
  try {
12592
12592
  window.localStorage.setItem(
12593
12593
  mo(t),
@@ -12597,13 +12597,13 @@ function Kh(t, e) {
12597
12597
  return;
12598
12598
  }
12599
12599
  }
12600
- function Vh(t) {
12600
+ function Yh(t) {
12601
12601
  if (!t || typeof t != "object")
12602
12602
  return !1;
12603
12603
  const e = t;
12604
12604
  return Number.isFinite(e.x) && Number.isFinite(e.y) && (e.anchor === "top-left" || e.anchor === "top-right" || e.anchor === "bottom-left" || e.anchor === "bottom-right");
12605
12605
  }
12606
- function Yh(t) {
12606
+ function Xh(t) {
12607
12607
  if (!t || typeof t != "object")
12608
12608
  return !1;
12609
12609
  const e = t;
@@ -12629,7 +12629,7 @@ async function pl(t, e) {
12629
12629
  throw new Error("Pluno token endpoint did not return a token");
12630
12630
  return i.token;
12631
12631
  }
12632
- function Xh(t) {
12632
+ function Jh(t) {
12633
12633
  let e = !1, n = !1;
12634
12634
  const i = async () => {
12635
12635
  const s = new AbortController();
@@ -12637,7 +12637,7 @@ function Xh(t) {
12637
12637
  const r = new Promise((l, d) => {
12638
12638
  const c = window.setTimeout(() => {
12639
12639
  o = !0, s.abort(), d(new Error(Mr));
12640
- }, Lu);
12640
+ }, Du);
12641
12641
  s.signal.addEventListener(
12642
12642
  "abort",
12643
12643
  () => window.clearTimeout(c),
@@ -12651,7 +12651,7 @@ function Xh(t) {
12651
12651
  ]);
12652
12652
  return s.abort(), l;
12653
12653
  } catch (l) {
12654
- throw s.abort(), o ? new Error(Mr) : l instanceof Error && l.message.startsWith("Pluno widget blocked on ") ? l : new Error(Du);
12654
+ throw s.abort(), o ? new Error(Mr) : l instanceof Error && l.message.startsWith("Pluno widget blocked on ") ? l : new Error(Uu);
12655
12655
  }
12656
12656
  };
12657
12657
  return {
@@ -12675,29 +12675,29 @@ function Xh(t) {
12675
12675
  };
12676
12676
  }
12677
12677
  const ta = /* @__PURE__ */ new WeakSet();
12678
- function Jh(t) {
12678
+ function Zh(t) {
12679
12679
  return Object.keys(t.dataset).some((e) => e.startsWith("pluno"));
12680
12680
  }
12681
12681
  function na(t) {
12682
12682
  const e = t.pathname.split("/");
12683
12683
  return e[e.length - 1] ?? "";
12684
12684
  }
12685
- function Zh(t, e) {
12685
+ function Qh(t, e) {
12686
12686
  const n = new URL(t.src, document.baseURI);
12687
12687
  return n.href === e.href || n.pathname === e.pathname ? !0 : na(n) === na(e);
12688
12688
  }
12689
12689
  class st extends EventTarget {
12690
12690
  constructor(e, n) {
12691
- super(), this.channelId = n, this.url = e, this.addPreviewListener(Eu, () => {
12691
+ super(), this.channelId = n, this.url = e, this.addPreviewListener(Au, () => {
12692
12692
  this.readyState = st.OPEN, this.dispatchEvent(new Event("open"));
12693
- }), this.addPreviewListener(Au, (i) => {
12693
+ }), this.addPreviewListener(Mu, (i) => {
12694
12694
  const s = i;
12695
12695
  this.dispatchEvent(
12696
12696
  new MessageEvent("message", { data: s.detail?.data ?? "" })
12697
12697
  );
12698
- }), this.addPreviewListener(Mu, () => {
12698
+ }), this.addPreviewListener(Pu, () => {
12699
12699
  this.readyState = st.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
12700
- }), this.addPreviewListener(Pu, (i) => {
12700
+ }), this.addPreviewListener(Ru, (i) => {
12701
12701
  const s = i;
12702
12702
  this.readyState = st.CLOSED, this.dispatchEvent(
12703
12703
  new CloseEvent("close", {
@@ -12709,7 +12709,7 @@ class st extends EventTarget {
12709
12709
  }), window.dispatchEvent(
12710
12710
  new CustomEvent(
12711
12711
  ui(
12712
- Tu,
12712
+ Cu,
12713
12713
  this.channelId
12714
12714
  ),
12715
12715
  {
@@ -12729,7 +12729,7 @@ class st extends EventTarget {
12729
12729
  binaryType = "blob";
12730
12730
  bufferedAmount = 0;
12731
12731
  readyState = st.CONNECTING;
12732
- socketId = Qh();
12732
+ socketId = ef();
12733
12733
  listeners = /* @__PURE__ */ new Map();
12734
12734
  send(e) {
12735
12735
  if (this.readyState !== st.OPEN)
@@ -12739,7 +12739,7 @@ class st extends EventTarget {
12739
12739
  );
12740
12740
  window.dispatchEvent(
12741
12741
  new CustomEvent(
12742
- ui(Cu, this.channelId),
12742
+ ui(ku, this.channelId),
12743
12743
  {
12744
12744
  detail: {
12745
12745
  socketId: this.socketId,
@@ -12752,7 +12752,7 @@ class st extends EventTarget {
12752
12752
  close(e, n) {
12753
12753
  this.readyState !== st.CLOSED && (this.readyState = st.CLOSING, window.dispatchEvent(
12754
12754
  new CustomEvent(
12755
- ui(ku, this.channelId),
12755
+ ui(Eu, this.channelId),
12756
12756
  {
12757
12757
  detail: { socketId: this.socketId, code: e, reason: n }
12758
12758
  }
@@ -12774,7 +12774,7 @@ class st extends EventTarget {
12774
12774
  this.listeners.clear();
12775
12775
  }
12776
12776
  }
12777
- function Qh() {
12777
+ function ef() {
12778
12778
  const t = window.sessionStorage.getItem(
12779
12779
  Ar
12780
12780
  );
@@ -12786,7 +12786,7 @@ function Qh() {
12786
12786
  function ui(t, e) {
12787
12787
  return `${t}:${e}`;
12788
12788
  }
12789
- function ef(t) {
12789
+ function tf(t) {
12790
12790
  const e = document.currentScript;
12791
12791
  if (e instanceof HTMLScriptElement)
12792
12792
  return [e];
@@ -12794,11 +12794,11 @@ function ef(t) {
12794
12794
  return Array.from(
12795
12795
  document.querySelectorAll("script[type='module'][src]")
12796
12796
  ).filter(
12797
- (s) => s instanceof HTMLScriptElement && Jh(s) && Zh(s, i)
12797
+ (s) => s instanceof HTMLScriptElement && Zh(s) && Qh(s, i)
12798
12798
  );
12799
12799
  }
12800
- function tf(t) {
12801
- for (const e of ef(t))
12800
+ function nf(t) {
12801
+ for (const e of tf(t))
12802
12802
  ta.has(e) || e.dataset.plunoAutoMount === "false" || (ta.add(e), cl(e).catch((n) => {
12803
12803
  console.error("Failed to mount Pluno widget", n);
12804
12804
  }));
@@ -12811,18 +12811,18 @@ function cl(t) {
12811
12811
  const d = e[nt];
12812
12812
  return d ? d.mountPromise : cl(t);
12813
12813
  });
12814
- if (nf(n.host))
12814
+ if (sf(n.host))
12815
12815
  return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
12816
12816
  n.destroy?.(), delete e[nt];
12817
12817
  }
12818
- const i = t.dataset.plunoPreviewChannel, s = t.dataset.plunoTokenEndpoint, o = !t.dataset.plunoToken && !i && s ? Xh(s) : null;
12818
+ const i = t.dataset.plunoPreviewChannel, s = t.dataset.plunoTokenEndpoint, o = !t.dataset.plunoToken && !i && s ? Jh(s) : null;
12819
12819
  let r;
12820
- const l = ng({
12820
+ const l = ig({
12821
12821
  token: t.dataset.plunoToken,
12822
12822
  tokenProvider: o?.loadToken,
12823
12823
  tokenEndpoint: s,
12824
12824
  backendUrl: t.dataset.plunoBackendUrl,
12825
- webSocketFactory: i ? tg(i) : void 0,
12825
+ webSocketFactory: i ? ng(i) : void 0,
12826
12826
  launcherLabel: t.dataset.plunoLauncherLabel,
12827
12827
  accentColor: t.dataset.plunoAccentColor,
12828
12828
  colorScheme: t.dataset.plunoColorScheme === "dark" ? "dark" : "light",
@@ -12848,11 +12848,11 @@ function cl(t) {
12848
12848
  retryPendingTokenFailureOnce: o?.retryPendingFailureOnce ?? null
12849
12849
  }, e[nt] = r, l;
12850
12850
  }
12851
- function nf(t) {
12851
+ function sf(t) {
12852
12852
  return t.isConnected && t.getAttribute(Wa) === "true" && !!t.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!t.shadowRoot?.querySelector(".pluno-pa-widget__panel");
12853
12853
  }
12854
- tf(import.meta.url);
12854
+ nf(import.meta.url);
12855
12855
  export {
12856
- tg as createProductAgentPreviewBridgeWebSocketFactory,
12857
- ng as mountPlunoProductAgentWidget
12856
+ ng as createProductAgentPreviewBridgeWebSocketFactory,
12857
+ ig as mountPlunoProductAgentWidget
12858
12858
  };