bstp-agent-widget 0.2.92 → 0.2.93

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.
@@ -15638,25 +15638,25 @@ var sb = {
15638
15638
  root: "_root_gud67_1",
15639
15639
  resizeHandle: "_resizeHandle_gud67_13"
15640
15640
  }, cb = {
15641
- header: "_header_1q9jc_32",
15642
- headerLeft: "_headerLeft_1q9jc_43",
15643
- headerInfo: "_headerInfo_1q9jc_49",
15644
- orbContainer: "_orbContainer_1q9jc_56",
15645
- orbOuter: "_orbOuter_1q9jc_66",
15646
- orbPulse: "_orbPulse_1q9jc_1",
15647
- orbMiddle: "_orbMiddle_1q9jc_75",
15648
- orbInner: "_orbInner_1q9jc_84",
15649
- orbFloat: "_orbFloat_1q9jc_1",
15650
- headerMeta: "_headerMeta_1q9jc_96",
15651
- statusDot: "_statusDot_1q9jc_102",
15652
- statusText: "_statusText_1q9jc_116",
15653
- closeButton: "_closeButton_1q9jc_124",
15654
- title: "_title_1q9jc_128",
15655
- topSubHeader: "_topSubHeader_1q9jc_137",
15656
- subHeaderLeft: "_subHeaderLeft_1q9jc_147",
15657
- subHeaderIcon: "_subHeaderIcon_1q9jc_153",
15658
- subHeaderTitle: "_subHeaderTitle_1q9jc_164",
15659
- subHeaderStatus: "_subHeaderStatus_1q9jc_170"
15641
+ header: "_header_k8anj_25",
15642
+ headerLeft: "_headerLeft_k8anj_36",
15643
+ headerInfo: "_headerInfo_k8anj_42",
15644
+ orbContainer: "_orbContainer_k8anj_49",
15645
+ orbOuter: "_orbOuter_k8anj_59",
15646
+ orbPulse: "_orbPulse_k8anj_1",
15647
+ orbMiddle: "_orbMiddle_k8anj_68",
15648
+ orbInner: "_orbInner_k8anj_77",
15649
+ orbFloat: "_orbFloat_k8anj_1",
15650
+ headerMeta: "_headerMeta_k8anj_89",
15651
+ statusDot: "_statusDot_k8anj_95",
15652
+ statusText: "_statusText_k8anj_109",
15653
+ closeButton: "_closeButton_k8anj_117",
15654
+ title: "_title_k8anj_121",
15655
+ topSubHeader: "_topSubHeader_k8anj_130",
15656
+ subHeaderLeft: "_subHeaderLeft_k8anj_140",
15657
+ subHeaderIcon: "_subHeaderIcon_k8anj_146",
15658
+ subHeaderTitle: "_subHeaderTitle_k8anj_157",
15659
+ subHeaderStatus: "_subHeaderStatus_k8anj_163"
15660
15660
  };
15661
15661
  //#endregion
15662
15662
  //#region src/icons/IconAgentOrb.tsx
@@ -20657,12 +20657,12 @@ function wT({ panelTitle: e, isLoading: t, isOnline: n, onClose: r }) {
20657
20657
  });
20658
20658
  }
20659
20659
  var TT = {
20660
- body: "_body_1cocr_1",
20661
- messageBubble: "_messageBubble_1cocr_9",
20662
- messageBubbleUser: "_messageBubbleUser_1cocr_15",
20663
- userText: "_userText_1cocr_20",
20664
- messageBubbleAssistant: "_messageBubbleAssistant_1cocr_27",
20665
- messageList: "_messageList_1cocr_33"
20660
+ body: "_body_qciga_1",
20661
+ messageBubble: "_messageBubble_qciga_9",
20662
+ messageBubbleUser: "_messageBubbleUser_qciga_15",
20663
+ userText: "_userText_qciga_20",
20664
+ messageBubbleAssistant: "_messageBubbleAssistant_qciga_27",
20665
+ messageList: "_messageList_qciga_33"
20666
20666
  };
20667
20667
  //#endregion
20668
20668
  //#region node_modules/marked/lib/marked.esm.js
@@ -28188,10 +28188,11 @@ function SP({ messages: e, isLoading: t, error: n, scrollViewportRef: r, onWidge
28188
28188
  });
28189
28189
  }
28190
28190
  var CP = {
28191
- footer: "_footer_16fk7_1",
28192
- inputWrapper: "_inputWrapper_16fk7_10",
28193
- actionGroup: "_actionGroup_16fk7_15",
28194
- poweredBy: "_poweredBy_16fk7_22"
28191
+ footer: "_footer_jvnzh_1",
28192
+ inputWrapper: "_inputWrapper_jvnzh_10",
28193
+ actionGroup: "_actionGroup_jvnzh_15",
28194
+ poweredBy: "_poweredBy_jvnzh_22",
28195
+ sendButton: "_sendButton_jvnzh_27"
28195
28196
  };
28196
28197
  //#endregion
28197
28198
  //#region src/icons/IconSend.tsx
@@ -28237,6 +28238,7 @@ function TP({ composerText: e, onComposerTextChange: t, isLoading: n, isListenin
28237
28238
  size: 32,
28238
28239
  radius: "xl",
28239
28240
  variant: "filled",
28241
+ className: CP.sendButton,
28240
28242
  children: /* @__PURE__ */ T(wP, {
28241
28243
  width: c.other.iconSize["icon-md"],
28242
28244
  height: c.other.iconSize["icon-md"]
@@ -34107,78 +34109,8 @@ function eH({ isListening: e, stopListening: t, reset: n, sendMessage: r, compos
34107
34109
  };
34108
34110
  }
34109
34111
  //#endregion
34110
- //#region src/features/agent-chat/components/AgentChatLauncher/AgentChatLauncher.tsx
34111
- function tH(e) {
34112
- GV();
34113
- let { panelWidth: t, panelHeight: n, panelHeaderHeight: r, panelTopOffset: i, zIndex: a, fabPosition: o, fabButtonLabel: s, panelTitle: c } = YV(e), l = v(!1), { messages: u, composerText: d, setComposerText: f, isLoading: p, error: m, sendMessage: h, sendInitialMessage: g, canSend: _ } = kV(), { actions: y, handleActionClick: b } = XV(u, h), { runtimeInfo: x, refreshRuntimeInfo: S } = AV(), { isOpen: C, open: D, close: O } = KV({
34114
- defaultOpen: !1,
34115
- persist: !0,
34116
- onOpen: async () => {
34117
- l.current || (l.current = !0, await S(), await g());
34118
- }
34119
- }), k = MV([u.length, p]), { isListening: A, isSupported: j, startListening: M, stopListening: N, reset: P } = NV({
34120
- lang: PV(),
34121
- continuous: !0,
34122
- pauseOnSubmit: !0,
34123
- onTextChange: f
34124
- }), { panelResizableWidth: F } = $V(e, t, C), { handleSubmit: ee, handleToggleVoice: te, handleClose: I } = eH({
34125
- isListening: A,
34126
- stopListening: N,
34127
- reset: P,
34128
- sendMessage: h,
34129
- composerText: d,
34130
- setComposerText: f,
34131
- startListening: M,
34132
- close: O
34133
- });
34134
- return /* @__PURE__ */ E(w, { children: [!C && /* @__PURE__ */ T(MP, {
34135
- onClick: () => void D(),
34136
- zIndex: a,
34137
- position: o,
34138
- label: s
34139
- }), C && /* @__PURE__ */ T(EP, {
34140
- visible: !0,
34141
- onClose: I,
34142
- messages: u,
34143
- composerText: d,
34144
- onComposerTextChange: f,
34145
- isLoading: p,
34146
- error: m,
34147
- canSend: _,
34148
- onSubmit: ee,
34149
- actions: y,
34150
- onActionClick: b,
34151
- isListening: A,
34152
- isVoiceSupported: j,
34153
- onToggleVoice: te,
34154
- panelTitle: c,
34155
- runtimeInfo: x,
34156
- scrollViewportRef: k,
34157
- panelWidth: t,
34158
- panelHeight: n,
34159
- panelHeaderHeight: r,
34160
- panelResizableWidth: F,
34161
- zIndex: a,
34162
- panelTopOffset: i
34163
- })] });
34164
- }
34165
- //#endregion
34166
- //#region src/providers/AgentChatProviders.tsx
34167
- function nH({ runtime: e, children: t }) {
34168
- return /* @__PURE__ */ T(GP.Provider, {
34169
- value: e,
34170
- children: t
34171
- });
34172
- }
34173
- function rH({ config: e, children: t }) {
34174
- return /* @__PURE__ */ T(qP.Provider, {
34175
- value: e,
34176
- children: t
34177
- });
34178
- }
34179
- //#endregion
34180
34112
  //#region src/utils/color-utils.ts
34181
- function iH(e) {
34113
+ function tH(e) {
34182
34114
  let t = 0, n = 0, r = 0;
34183
34115
  if (e.startsWith("rgb")) {
34184
34116
  let i = e.match(/\d+/g);
@@ -34193,12 +34125,16 @@ function iH(e) {
34193
34125
  b: r
34194
34126
  };
34195
34127
  }
34196
- function aH(e, t) {
34197
- let { r: n, g: r, b: i } = iH(e), a = t / 100;
34128
+ function nH(e, t) {
34129
+ let { r: n, g: r, b: i } = tH(e), a = t / 100;
34198
34130
  return `rgb(${Math.min(255, n + (255 - n) * a)}, ${Math.min(255, r + (255 - r) * a)}, ${Math.min(255, i + (255 - i) * a)})`;
34199
34131
  }
34200
- function oH(e) {
34201
- let { r: t, g: n, b: r } = iH(e);
34132
+ function rH(e, t) {
34133
+ let { r: n, g: r, b: i } = tH(e), a = t / 100;
34134
+ return `rgb(${Math.max(0, n - n * a)}, ${Math.max(0, r - r * a)}, ${Math.max(0, i - i * a)})`;
34135
+ }
34136
+ function iH(e) {
34137
+ let { r: t, g: n, b: r } = tH(e);
34202
34138
  return [
34203
34139
  `rgb(${t + 50}, ${n + 50}, ${r + 50})`,
34204
34140
  `rgb(${t + 40}, ${n + 40}, ${r + 40})`,
@@ -34215,10 +34151,10 @@ function oH(e) {
34215
34151
  }
34216
34152
  //#endregion
34217
34153
  //#region src/hooks/useAccentColor.ts
34218
- function sH(e) {
34219
- let t = _(() => {
34154
+ function aH(e) {
34155
+ let t = An(), n = _(() => {
34220
34156
  if (e) try {
34221
- let t = oH(e);
34157
+ let t = iH(e);
34222
34158
  if (t && t.length === 11) return nT({
34223
34159
  colors: { accent: t },
34224
34160
  primaryColor: "accent"
@@ -34230,28 +34166,100 @@ function sH(e) {
34230
34166
  }, [e]);
34231
34167
  return f(() => {
34232
34168
  try {
34233
- let t = document.documentElement, n = e || "#35355F", r = aH(n, 10), i = aH(n, 30);
34234
- t.style.setProperty("--agent-accent-color", n), t.style.setProperty("--agent-accent-color-light", aH(n, 20)), t.style.setProperty("--agent-accent-bg", r), t.style.setProperty("--agent-accent-bg-light", i), t.style.setProperty("--agent-accent-border", n), t.style.setProperty("--agent-accent-text", "#ffffff"), t.style.setProperty("--agent-accent-text-muted", "rgba(255, 255, 255, 0.8)");
34169
+ let n = document.documentElement, r = e || t.colors?.["brand-dark-blue"]?.[7] || "#18182B", i = nH(r, 80), a = rH(r, 15);
34170
+ n.style.setProperty("--agent-accent-color", r), n.style.setProperty("--agent-accent-color-light", nH(r, 40)), n.style.setProperty("--agent-accent-color-dark", a), n.style.setProperty("--agent-accent-bg", r), n.style.setProperty("--agent-accent-bg-light", i), n.style.setProperty("--agent-accent-border", r), n.style.setProperty("--agent-accent-text", "#ffffff"), n.style.setProperty("--agent-accent-text-muted", "rgba(255, 255, 255, 0.8)"), console.log("CSS variables set successfully");
34235
34171
  } catch (e) {
34236
34172
  console.error("Failed to set accent color CSS properties:", e);
34237
34173
  }
34238
- }, [e]), t;
34174
+ }, [e, t]), n;
34175
+ }
34176
+ //#endregion
34177
+ //#region src/features/agent-chat/components/AgentChatLauncher/AgentChatLauncher.tsx
34178
+ function oH(e) {
34179
+ GV();
34180
+ let { panelWidth: t, panelHeight: n, panelHeaderHeight: r, panelTopOffset: i, zIndex: a, fabPosition: o, fabButtonLabel: s, panelTitle: c, accentColor: l } = YV(e);
34181
+ aH(l);
34182
+ let u = v(!1), { messages: d, composerText: f, setComposerText: p, isLoading: m, error: h, sendMessage: g, sendInitialMessage: _, canSend: y } = kV(), { actions: b, handleActionClick: x } = XV(d, g), { runtimeInfo: S, refreshRuntimeInfo: C } = AV(), { isOpen: D, open: O, close: k } = KV({
34183
+ defaultOpen: !1,
34184
+ persist: !0,
34185
+ onOpen: async () => {
34186
+ u.current || (u.current = !0, await C(), await _());
34187
+ }
34188
+ }), A = MV([d.length, m]), { isListening: j, isSupported: M, startListening: N, stopListening: P, reset: F } = NV({
34189
+ lang: PV(),
34190
+ continuous: !0,
34191
+ pauseOnSubmit: !0,
34192
+ onTextChange: p
34193
+ }), { panelResizableWidth: ee } = $V(e, t, D), { handleSubmit: te, handleToggleVoice: I, handleClose: L } = eH({
34194
+ isListening: j,
34195
+ stopListening: P,
34196
+ reset: F,
34197
+ sendMessage: g,
34198
+ composerText: f,
34199
+ setComposerText: p,
34200
+ startListening: N,
34201
+ close: k
34202
+ });
34203
+ return /* @__PURE__ */ E(w, { children: [!D && /* @__PURE__ */ T(MP, {
34204
+ onClick: () => void O(),
34205
+ zIndex: a,
34206
+ position: o,
34207
+ label: s
34208
+ }), D && /* @__PURE__ */ T(EP, {
34209
+ visible: !0,
34210
+ onClose: L,
34211
+ messages: d,
34212
+ composerText: f,
34213
+ onComposerTextChange: p,
34214
+ isLoading: m,
34215
+ error: h,
34216
+ canSend: y,
34217
+ onSubmit: te,
34218
+ actions: b,
34219
+ onActionClick: x,
34220
+ isListening: j,
34221
+ isVoiceSupported: M,
34222
+ onToggleVoice: I,
34223
+ panelTitle: c,
34224
+ runtimeInfo: S,
34225
+ scrollViewportRef: A,
34226
+ panelWidth: t,
34227
+ panelHeight: n,
34228
+ panelHeaderHeight: r,
34229
+ panelResizableWidth: ee,
34230
+ zIndex: a,
34231
+ panelTopOffset: i
34232
+ })] });
34233
+ }
34234
+ //#endregion
34235
+ //#region src/providers/AgentChatProviders.tsx
34236
+ function sH({ runtime: e, children: t }) {
34237
+ return /* @__PURE__ */ T(GP.Provider, {
34238
+ value: e,
34239
+ children: t
34240
+ });
34241
+ }
34242
+ function cH({ config: e, children: t }) {
34243
+ return /* @__PURE__ */ T(qP.Provider, {
34244
+ value: e,
34245
+ children: t
34246
+ });
34239
34247
  }
34240
34248
  //#endregion
34241
34249
  //#region src/lib/agent-widget.tsx
34242
- function cH({ config: e, runtime: t, theme: n }) {
34250
+ function lH({ config: e, runtime: t, theme: n }) {
34243
34251
  return pI.locale || pI.activate("en"), /* @__PURE__ */ T(HO, {
34244
34252
  i18n: pI,
34245
34253
  children: /* @__PURE__ */ T(Gn, {
34246
- theme: sH(n?.accentColor),
34254
+ theme: aH(n?.accentColor),
34247
34255
  defaultColorScheme: "auto",
34248
34256
  children: /* @__PURE__ */ T(qL, {
34249
34257
  client: pV,
34250
- children: /* @__PURE__ */ T(rH, {
34258
+ children: /* @__PURE__ */ T(cH, {
34251
34259
  config: e,
34252
- children: /* @__PURE__ */ T(nH, {
34260
+ children: /* @__PURE__ */ T(sH, {
34253
34261
  runtime: t,
34254
- children: /* @__PURE__ */ T(tH, { ...n ?? {} })
34262
+ children: /* @__PURE__ */ T(oH, { ...n ?? {} })
34255
34263
  })
34256
34264
  })
34257
34265
  })
@@ -34260,7 +34268,7 @@ function cH({ config: e, runtime: t, theme: n }) {
34260
34268
  }
34261
34269
  //#endregion
34262
34270
  //#region src/lib/config.service.ts
34263
- var lH = {
34271
+ var uH = {
34264
34272
  url: {
34265
34273
  app: "http://localhost:4201",
34266
34274
  api: "https://cognitus-etiyacell.etiyacloud.com",
@@ -34307,8 +34315,8 @@ var lH = {
34307
34315
  }
34308
34316
  }
34309
34317
  };
34310
- function uH(e) {
34311
- let t = lH.genai?.init;
34318
+ function dH(e) {
34319
+ let t = uH.genai?.init;
34312
34320
  return !t || e.genai?.init ? e : {
34313
34321
  ...e,
34314
34322
  genai: {
@@ -34317,33 +34325,33 @@ function uH(e) {
34317
34325
  }
34318
34326
  };
34319
34327
  }
34320
- async function dH(e) {
34328
+ async function fH(e) {
34321
34329
  let t = `${(globalThis.__BASE_URL__ ?? "").replace(/\/$/, "")}/environment.json`, n = e ?? t;
34322
34330
  try {
34323
34331
  let e = await fetch(n);
34324
- return e.ok ? uH(await e.json()) : lH;
34332
+ return e.ok ? dH(await e.json()) : uH;
34325
34333
  } catch {
34326
- return lH;
34334
+ return uH;
34327
34335
  }
34328
34336
  }
34329
34337
  //#endregion
34330
34338
  //#region src/lib/mount-widget.tsx
34331
- var fH = /* @__PURE__ */ new WeakMap();
34332
- async function pH(e, t, n) {
34339
+ var pH = /* @__PURE__ */ new WeakMap();
34340
+ async function mH(e, t, n) {
34333
34341
  try {
34334
- bV(await dH(n?.environmentUrl));
34342
+ bV(await fH(n?.environmentUrl));
34335
34343
  } catch (e) {
34336
34344
  throw console.error("Failed to initialize agent widget rest services:", e), e;
34337
34345
  }
34338
- let r = fH.get(e);
34346
+ let r = pH.get(e);
34339
34347
  r && r.unmount();
34340
34348
  let i = D(e);
34341
- return i.render(/* @__PURE__ */ T(cH, { ...t })), fH.set(e, i), () => {
34342
- let t = fH.get(e);
34343
- t && (t.unmount(), fH.delete(e));
34349
+ return i.render(/* @__PURE__ */ T(lH, { ...t })), pH.set(e, i), () => {
34350
+ let t = pH.get(e);
34351
+ t && (t.unmount(), pH.delete(e));
34344
34352
  };
34345
34353
  }
34346
- function mH(e) {
34354
+ function hH(e) {
34347
34355
  let t = e.genai?.config;
34348
34356
  if (!t?.assistantId) throw Error("GenAI config is missing in environment.json.");
34349
34357
  return {
@@ -34351,24 +34359,24 @@ function mH(e) {
34351
34359
  agents: t.agents
34352
34360
  };
34353
34361
  }
34354
- function hH(e, t) {
34362
+ function gH(e, t) {
34355
34363
  return t ? {
34356
34364
  assistantId: t.assistantId ?? e.assistantId,
34357
34365
  agents: t.agents ?? e.agents
34358
34366
  } : e;
34359
34367
  }
34360
- function gH(e, t) {
34368
+ function _H(e, t) {
34361
34369
  return t ? (e.genai ||= {}, e.genai.config || (e.genai.config = {}), typeof t.assistantId == "number" && (e.genai.config.assistantId = t.assistantId), t.agents && (e.genai.config.agents = t.agents), e) : e;
34362
34370
  }
34363
- async function _H(e, t) {
34364
- let n = gH(await dH(t.environmentUrl), t.config);
34365
- return bV(n), pH(e, {
34366
- config: hH(mH(n), t.config),
34371
+ async function vH(e, t) {
34372
+ let n = _H(await fH(t.environmentUrl), t.config);
34373
+ return bV(n), mH(e, {
34374
+ config: gH(hH(n), t.config),
34367
34375
  runtime: t.runtime,
34368
34376
  theme: t.theme
34369
34377
  });
34370
34378
  }
34371
34379
  //#endregion
34372
- export { cH as AgentChatWidget, pH as mountAgentChatWidget, _H as mountAgentChatWidgetFromEnvironment };
34380
+ export { lH as AgentChatWidget, mH as mountAgentChatWidget, vH as mountAgentChatWidgetFromEnvironment };
34373
34381
 
34374
34382
  //# sourceMappingURL=agent-widget.js.map