@solostylist/ui-kit 1.0.162 → 1.0.163

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/{ArrowUpward-DvTpkKgd.js → ArrowUpward-DhTFpzoh.js} +1 -1
  2. package/dist/{Box-DqmXop3Z.js → Box-Ha0cQ4KO.js} +1 -1
  3. package/dist/ButtonBase-DfTfJ_ou.js +1105 -0
  4. package/dist/{ChevronLeft-zg9wurzn.js → ChevronLeft-CBuFk2Fh.js} +1 -1
  5. package/dist/{ChevronRight-BKIP5v8z.js → ChevronRight-CnDWPrOm.js} +1 -1
  6. package/dist/{Close-D4kX7Vbc.js → Close-BRlEKA2Q.js} +1 -1
  7. package/dist/{DefaultPropsProvider-ClLA4IsM.js → DefaultPropsProvider-CaCsvQaq.js} +1 -1
  8. package/dist/{ExpandMore-mZGpvXf6.js → ExpandMore-DTWX_mHf.js} +1 -1
  9. package/dist/{Favorite-DmSF47XC.js → Favorite-DS5Gpq2s.js} +1 -1
  10. package/dist/{Menu-Cx9465L8.js → Menu-CWq-a1Wz.js} +5 -5
  11. package/dist/{MenuItem-DPprLtbJ.js → MenuItem-DY_qFSPR.js} +4 -4
  12. package/dist/{Paper-GzSZS-Pr.js → Paper-hkbPWyBT.js} +26 -27
  13. package/dist/{Select-32LY-KQR.js → Select-DabtQlJT.js} +6 -6
  14. package/dist/{Stack-CGZpcupa.js → Stack-Cq2r2NmC.js} +2 -2
  15. package/dist/{Typography-Dgg8buRq.js → Typography-B7LOtCzI.js} +3 -3
  16. package/dist/{createSvgIcon-Dq42_0tn.js → createSvgIcon-DxwgGAVe.js} +2 -2
  17. package/dist/index-BGvzecIA.js +218 -0
  18. package/dist/{index-VB-2NIdQ.js → index-CfKHZ86U.js} +1 -1
  19. package/dist/main.d.ts +0 -4
  20. package/dist/main.js +90 -94
  21. package/dist/{mergeSlotProps-CbVWfTAi.js → mergeSlotProps-Dl_rJtoN.js} +1 -1
  22. package/dist/s-accordion/s-accordion.js +7 -7
  23. package/dist/s-breadcrumbs/s-breadcrumbs.js +1 -1
  24. package/dist/s-carousel/s-carousel.js +1 -1
  25. package/dist/s-chat-input/s-chat-input.js +3 -3
  26. package/dist/s-chat-message/s-chat-message.js +1 -1
  27. package/dist/s-comment-message/s-comment-message.js +3 -3
  28. package/dist/s-copyable-text/s-copyable-text.js +1 -1
  29. package/dist/s-data-table/s-data-table.js +5 -5
  30. package/dist/s-date-picker/s-date-picker.js +5 -5
  31. package/dist/s-datetime-picker/s-datetime-picker.js +9 -9
  32. package/dist/s-dialog/s-dialog.js +1 -1
  33. package/dist/s-dialog-confirm/s-dialog-confirm.js +2 -2
  34. package/dist/s-dialog-message/s-dialog-message.js +2 -2
  35. package/dist/s-file-dropzone/s-file-dropzone.js +4 -4
  36. package/dist/s-file-icon/s-file-icon.js +1 -1
  37. package/dist/s-flex-box/s-flex-box.js +1 -1
  38. package/dist/s-image-comparison/s-image-comparison.js +3 -3
  39. package/dist/s-image-modal/s-image-modal.js +3 -3
  40. package/dist/s-label/s-label.js +1 -1
  41. package/dist/s-language-switcher/s-language-switcher.js +5 -5
  42. package/dist/s-multi-select/s-multi-select.js +3 -3
  43. package/dist/s-review/s-review.js +1 -1
  44. package/dist/s-scroll-to-top/s-scroll-to-top.js +3 -3
  45. package/dist/s-select/s-select.js +1 -1
  46. package/dist/s-text-editor/s-text-editor-toolbar.js +4 -4
  47. package/dist/s-text-editor/s-text-editor.js +1 -1
  48. package/dist/s-text-field/s-text-field.js +1 -1
  49. package/dist/s-text-shimmer/s-text-shimmer.js +1 -1
  50. package/dist/s-theme-demo/s-theme-demo.js +2 -2
  51. package/dist/s-theme-switch/s-theme-switch.js +1 -1
  52. package/dist/s-tip/s-tip.js +3 -3
  53. package/dist/{styled-BD_erj7E.js → styled-B0Z4EDy9.js} +1 -1
  54. package/dist/theme/components/avatar.js +1 -1
  55. package/dist/theme/components/chip.js +1 -1
  56. package/dist/theme/customizations/inputs.js +1 -1
  57. package/dist/theme/customizations/navigation.js +1 -1
  58. package/dist/{useMobilePicker-CBFfceXe.js → useMobilePicker-DgxcRrRB.js} +84 -85
  59. package/package.json +2 -4
  60. package/dist/ButtonBase-INrHi5Tf.js +0 -912
  61. package/dist/TransitionGroup-BK0MDPKM.js +0 -197
  62. package/dist/chunk-6WTWBXEJ-CEca0jKr.js +0 -4903
  63. package/dist/emotion-serialize.esm-lgBmL_7o.js +0 -195
  64. package/dist/index--x2dvtup.js +0 -30
  65. package/dist/s-copilot-kit-provider/index.d.ts +0 -2
  66. package/dist/s-copilot-kit-provider/index.js +0 -4
  67. package/dist/s-copilot-kit-provider/package.json +0 -5
  68. package/dist/s-copilot-kit-provider/s-copilot-kit-provider.d.ts +0 -35
  69. package/dist/s-copilot-kit-provider/s-copilot-kit-provider.js +0 -9
  70. package/dist/s-smart-text-field/index.d.ts +0 -2
  71. package/dist/s-smart-text-field/index.js +0 -4
  72. package/dist/s-smart-text-field/package.json +0 -5
  73. package/dist/s-smart-text-field/s-smart-text-field.d.ts +0 -42
  74. package/dist/s-smart-text-field/s-smart-text-field.js +0 -17619
@@ -1,4903 +0,0 @@
1
- import { j as c } from "./jsx-runtime-OVHDjVDe.js";
2
- import we, { useState as M, useCallback as C, createContext as Qt, useContext as Ht, useRef as K, useEffect as H, useMemo as ie, useReducer as Xt } from "react";
3
- import { v4 as Jt } from "uuid";
4
- import { flushSync as xr } from "react-dom";
5
- var yr = "1.10.4";
6
- function br(e) {
7
- return typeof e == "object" && e !== null;
8
- }
9
- function kr(e, t) {
10
- if (!!!e)
11
- throw new Error(
12
- "Unexpected invariant triggered."
13
- );
14
- }
15
- const Nr = /\r\n|[\n\r]/g;
16
- function $e(e, t) {
17
- let n = 0, r = 1;
18
- for (const i of e.body.matchAll(Nr)) {
19
- if (typeof i.index == "number" || kr(!1), i.index >= t)
20
- break;
21
- n = i.index + i[0].length, r += 1;
22
- }
23
- return {
24
- line: r,
25
- column: t + 1 - n
26
- };
27
- }
28
- function Ar(e) {
29
- return Zt(
30
- e.source,
31
- $e(e.source, e.start)
32
- );
33
- }
34
- function Zt(e, t) {
35
- const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, a = e.locationOffset.line - 1, s = t.line + a, l = t.line === 1 ? n : 0, d = t.column + l, o = `${e.name}:${s}:${d}
36
- `, u = r.split(/\r\n|[\n\r]/g), g = u[i];
37
- if (g.length > 120) {
38
- const m = Math.floor(d / 80), h = d % 80, f = [];
39
- for (let N = 0; N < g.length; N += 80)
40
- f.push(g.slice(N, N + 80));
41
- return o + wt([
42
- [`${s} |`, f[0]],
43
- ...f.slice(1, m + 1).map((N) => ["|", N]),
44
- ["|", "^".padStart(h)],
45
- ["|", f[m + 1]]
46
- ]);
47
- }
48
- return o + wt([
49
- // Lines specified like this: ["prefix", "string"],
50
- [`${s - 1} |`, u[i - 1]],
51
- [`${s} |`, g],
52
- ["|", "^".padStart(d)],
53
- [`${s + 1} |`, u[i + 1]]
54
- ]);
55
- }
56
- function wt(e) {
57
- const t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
58
- return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
59
- `);
60
- }
61
- function wr(e) {
62
- const t = e[0];
63
- return t == null || "kind" in t || "length" in t ? {
64
- nodes: t,
65
- source: e[1],
66
- positions: e[2],
67
- path: e[3],
68
- originalError: e[4],
69
- extensions: e[5]
70
- } : t;
71
- }
72
- let Sr = class _t extends Error {
73
- /**
74
- * An array of `{ line, column }` locations within the source GraphQL document
75
- * which correspond to this error.
76
- *
77
- * Errors during validation often contain multiple locations, for example to
78
- * point out two things with the same name. Errors during execution include a
79
- * single location, the field which produced the error.
80
- *
81
- * Enumerable, and appears in the result of JSON.stringify().
82
- */
83
- /**
84
- * An array describing the JSON-path into the execution response which
85
- * corresponds to this error. Only included for errors during execution.
86
- *
87
- * Enumerable, and appears in the result of JSON.stringify().
88
- */
89
- /**
90
- * An array of GraphQL AST Nodes corresponding to this error.
91
- */
92
- /**
93
- * The source GraphQL document for the first location of this error.
94
- *
95
- * Note that if this Error represents more than one node, the source may not
96
- * represent nodes after the first node.
97
- */
98
- /**
99
- * An array of character offsets within the source GraphQL document
100
- * which correspond to this error.
101
- */
102
- /**
103
- * The original error thrown from a field resolver during execution.
104
- */
105
- /**
106
- * Extension fields to add to the formatted error.
107
- */
108
- /**
109
- * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
110
- */
111
- constructor(t, ...n) {
112
- var r, i, a;
113
- const { nodes: s, source: l, positions: d, path: o, originalError: u, extensions: g } = wr(n);
114
- super(t), this.name = "GraphQLError", this.path = o ?? void 0, this.originalError = u ?? void 0, this.nodes = St(
115
- Array.isArray(s) ? s : s ? [s] : void 0
116
- );
117
- const m = St(
118
- (r = this.nodes) === null || r === void 0 ? void 0 : r.map((f) => f.loc).filter((f) => f != null)
119
- );
120
- this.source = l ?? (m == null || (i = m[0]) === null || i === void 0 ? void 0 : i.source), this.positions = d ?? (m == null ? void 0 : m.map((f) => f.start)), this.locations = d && l ? d.map((f) => $e(l, f)) : m == null ? void 0 : m.map((f) => $e(f.source, f.start));
121
- const h = br(
122
- u == null ? void 0 : u.extensions
123
- ) ? u == null ? void 0 : u.extensions : void 0;
124
- this.extensions = (a = g ?? h) !== null && a !== void 0 ? a : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
125
- message: {
126
- writable: !0,
127
- enumerable: !0
128
- },
129
- name: {
130
- enumerable: !1
131
- },
132
- nodes: {
133
- enumerable: !1
134
- },
135
- source: {
136
- enumerable: !1
137
- },
138
- positions: {
139
- enumerable: !1
140
- },
141
- originalError: {
142
- enumerable: !1
143
- }
144
- }), u != null && u.stack ? Object.defineProperty(this, "stack", {
145
- value: u.stack,
146
- writable: !0,
147
- configurable: !0
148
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, _t) : Object.defineProperty(this, "stack", {
149
- value: Error().stack,
150
- writable: !0,
151
- configurable: !0
152
- });
153
- }
154
- get [Symbol.toStringTag]() {
155
- return "GraphQLError";
156
- }
157
- toString() {
158
- let t = this.message;
159
- if (this.nodes)
160
- for (const n of this.nodes)
161
- n.loc && (t += `
162
-
163
- ` + Ar(n.loc));
164
- else if (this.source && this.locations)
165
- for (const n of this.locations)
166
- t += `
167
-
168
- ` + Zt(this.source, n);
169
- return t;
170
- }
171
- toJSON() {
172
- const t = {
173
- message: this.message
174
- };
175
- return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
176
- }
177
- };
178
- function St(e) {
179
- return e === void 0 || e.length === 0 ? void 0 : e;
180
- }
181
- function $t(e, t = "unset") {
182
- try {
183
- return JSON.parse(e);
184
- } catch {
185
- return t === "unset" ? null : t;
186
- }
187
- }
188
- function Na() {
189
- return /Mac|iMac|Macintosh/i.test(navigator.userAgent);
190
- }
191
- var he = yr, te = /* @__PURE__ */ ((e) => (e.CRITICAL = "critical", e.WARNING = "warning", e.INFO = "info", e))(te || {}), st = /* @__PURE__ */ ((e) => (e.BANNER = "banner", e.TOAST = "toast", e.SILENT = "silent", e.DEV_ONLY = "dev_only", e))(st || {}), $ = {
192
- COPILOT_ERROR: "CopilotError",
193
- COPILOT_API_DISCOVERY_ERROR: "CopilotApiDiscoveryError",
194
- COPILOT_REMOTE_ENDPOINT_DISCOVERY_ERROR: "CopilotKitRemoteEndpointDiscoveryError",
195
- COPILOT_KIT_AGENT_DISCOVERY_ERROR: "CopilotKitAgentDiscoveryError",
196
- COPILOT_KIT_LOW_LEVEL_ERROR: "CopilotKitLowLevelError",
197
- COPILOT_KIT_VERSION_MISMATCH_ERROR: "CopilotKitVersionMismatchError",
198
- RESOLVED_COPILOT_KIT_ERROR: "ResolvedCopilotKitError",
199
- CONFIGURATION_ERROR: "ConfigurationError",
200
- MISSING_PUBLIC_API_KEY_ERROR: "MissingPublicApiKeyError"
201
- }, ne = /* @__PURE__ */ ((e) => (e.NETWORK_ERROR = "NETWORK_ERROR", e.NOT_FOUND = "NOT_FOUND", e.AGENT_NOT_FOUND = "AGENT_NOT_FOUND", e.API_NOT_FOUND = "API_NOT_FOUND", e.REMOTE_ENDPOINT_NOT_FOUND = "REMOTE_ENDPOINT_NOT_FOUND", e.AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR", e.MISUSE = "MISUSE", e.UNKNOWN = "UNKNOWN", e.VERSION_MISMATCH = "VERSION_MISMATCH", e.CONFIGURATION_ERROR = "CONFIGURATION_ERROR", e.MISSING_PUBLIC_API_KEY_ERROR = "MISSING_PUBLIC_API_KEY_ERROR", e.UPGRADE_REQUIRED_ERROR = "UPGRADE_REQUIRED_ERROR", e))(ne || {}), le = "https://docs.copilotkit.ai", de = (e) => `See more: [${e}](${e})`, ye = {
202
- NETWORK_ERROR: {
203
- statusCode: 503,
204
- troubleshootingUrl: `${le}/troubleshooting/common-issues#i-am-getting-a-network-errors--api-not-found`,
205
- visibility: "banner",
206
- severity: "critical"
207
- /* CRITICAL */
208
- },
209
- NOT_FOUND: {
210
- statusCode: 404,
211
- troubleshootingUrl: `${le}/troubleshooting/common-issues#i-am-getting-a-network-errors--api-not-found`,
212
- visibility: "banner",
213
- severity: "critical"
214
- /* CRITICAL */
215
- },
216
- AGENT_NOT_FOUND: {
217
- statusCode: 500,
218
- troubleshootingUrl: `${le}/coagents/troubleshooting/common-issues#i-am-getting-agent-not-found-error`,
219
- visibility: "banner",
220
- severity: "critical"
221
- /* CRITICAL */
222
- },
223
- API_NOT_FOUND: {
224
- statusCode: 404,
225
- troubleshootingUrl: `${le}/troubleshooting/common-issues#i-am-getting-a-network-errors--api-not-found`,
226
- visibility: "banner",
227
- severity: "critical"
228
- /* CRITICAL */
229
- },
230
- REMOTE_ENDPOINT_NOT_FOUND: {
231
- statusCode: 404,
232
- troubleshootingUrl: `${le}/troubleshooting/common-issues#i-am-getting-copilotkits-remote-endpoint-not-found-error`,
233
- visibility: "banner",
234
- severity: "critical"
235
- /* CRITICAL */
236
- },
237
- AUTHENTICATION_ERROR: {
238
- statusCode: 401,
239
- troubleshootingUrl: `${le}/troubleshooting/common-issues#authentication-errors`,
240
- visibility: "banner",
241
- severity: "critical"
242
- /* CRITICAL */
243
- },
244
- MISUSE: {
245
- statusCode: 400,
246
- troubleshootingUrl: null,
247
- visibility: "dev_only",
248
- severity: "warning"
249
- /* WARNING */
250
- },
251
- UNKNOWN: {
252
- statusCode: 500,
253
- visibility: "toast",
254
- severity: "critical"
255
- /* CRITICAL */
256
- },
257
- CONFIGURATION_ERROR: {
258
- statusCode: 400,
259
- troubleshootingUrl: null,
260
- severity: "warning",
261
- visibility: "banner"
262
- /* BANNER */
263
- },
264
- MISSING_PUBLIC_API_KEY_ERROR: {
265
- statusCode: 400,
266
- troubleshootingUrl: null,
267
- severity: "critical",
268
- visibility: "banner"
269
- /* BANNER */
270
- },
271
- UPGRADE_REQUIRED_ERROR: {
272
- statusCode: 402,
273
- troubleshootingUrl: null,
274
- severity: "warning",
275
- visibility: "banner"
276
- /* BANNER */
277
- },
278
- VERSION_MISMATCH: {
279
- statusCode: 400,
280
- troubleshootingUrl: null,
281
- visibility: "dev_only",
282
- severity: "info"
283
- /* INFO */
284
- }
285
- }, P = class extends Sr {
286
- constructor({
287
- message: e = "Unknown error occurred",
288
- code: t,
289
- severity: n,
290
- visibility: r
291
- }) {
292
- const i = $.COPILOT_ERROR, a = ye[t], { statusCode: s } = a, l = r ?? a.visibility ?? "toast", d = n ?? ("severity" in a ? a.severity : void 0);
293
- super(e, {
294
- extensions: {
295
- name: i,
296
- statusCode: s,
297
- code: t,
298
- visibility: l,
299
- severity: d,
300
- troubleshootingUrl: "troubleshootingUrl" in a ? a.troubleshootingUrl : null,
301
- originalError: {
302
- message: e,
303
- stack: new Error().stack
304
- }
305
- }
306
- }), this.code = t, this.name = i, this.statusCode = s, this.severity = d, this.visibility = l;
307
- }
308
- }, en = ({
309
- reactCoreVersion: e,
310
- runtimeVersion: t,
311
- runtimeClientGqlVersion: n
312
- }) => `Version mismatch detected: @copilotkit/runtime@${t ?? ""} is not compatible with @copilotkit/react-core@${e} and @copilotkit/runtime-client-gql@${n}. Please ensure all installed copilotkit packages are on the same version.`, Er = class extends P {
313
- constructor({
314
- reactCoreVersion: e,
315
- runtimeVersion: t,
316
- runtimeClientGqlVersion: n
317
- }) {
318
- super({
319
- message: en({
320
- reactCoreVersion: e,
321
- runtimeVersion: t,
322
- runtimeClientGqlVersion: n
323
- }),
324
- code: "VERSION_MISMATCH"
325
- }), this.name = $.COPILOT_KIT_VERSION_MISMATCH_ERROR;
326
- }
327
- }, be = class extends P {
328
- constructor(e = {}) {
329
- const t = e.url ?? "";
330
- let n = "";
331
- t != null && t.includes("/info") ? n = "when fetching CopilotKit info" : t.includes("/actions/execute") ? n = "when attempting to execute actions." : t.includes("/agents/state") ? n = "when attempting to get agent state." : t.includes("/agents/execute") && (n = "when attempting to execute agent(s).");
332
- const r = e.message ?? (e.url ? `Failed to find CopilotKit API endpoint at url ${e.url} ${n}` : "Failed to find CopilotKit API endpoint."), i = e.code ?? "API_NOT_FOUND", a = `${r}.
333
-
334
- ${de(ye[i].troubleshootingUrl)}`;
335
- super({ message: a, code: i }), this.name = $.COPILOT_API_DISCOVERY_ERROR;
336
- }
337
- }, ot = class extends be {
338
- constructor(e) {
339
- const t = (e == null ? void 0 : e.message) ?? (e != null && e.url ? `Failed to find or contact remote endpoint at url ${e.url}` : "Failed to find or contact remote endpoint");
340
- super({ message: t, code: "REMOTE_ENDPOINT_NOT_FOUND" }), this.name = $.COPILOT_REMOTE_ENDPOINT_DISCOVERY_ERROR;
341
- }
342
- }, tn = class extends P {
343
- constructor(e) {
344
- const { agentName: t, availableAgents: n } = e, r = "AGENT_NOT_FOUND", i = de(ye[r].troubleshootingUrl);
345
- let a;
346
- if (n.length) {
347
- const s = n.map((l) => l.name).join(", ");
348
- t ? a = `Agent '${t}' was not found. Available agents are: ${s}. Please verify the agent name in your configuration and ensure it matches one of the available agents.
349
-
350
- ${i}` : a = `The requested agent was not found. Available agents are: ${s}. Please verify the agent name in your configuration and ensure it matches one of the available agents.
351
-
352
- ${i}`;
353
- } else
354
- a = `${t ? `Agent '${t}'` : "The requested agent"} was not found. Please set up at least one agent before proceeding. ${i}`;
355
- super({ message: a, code: r }), this.name = $.COPILOT_KIT_AGENT_DISCOVERY_ERROR;
356
- }
357
- }, Cr = class extends P {
358
- constructor({ error: e, url: t, message: n }) {
359
- let r = "NETWORK_ERROR";
360
- const i = e.code, a = n ?? Tr({ errorCode: i, url: t });
361
- super({ message: a, code: r }), this.name = $.COPILOT_KIT_LOW_LEVEL_ERROR;
362
- }
363
- }, Or = class extends P {
364
- constructor({
365
- status: e,
366
- message: t,
367
- code: n,
368
- isRemoteEndpoint: r,
369
- url: i
370
- }) {
371
- let a = n;
372
- if (!a)
373
- switch (e) {
374
- case 400:
375
- throw new be({ message: t, url: i });
376
- case 404:
377
- throw r ? new ot({ message: t, url: i }) : new be({ message: t, url: i });
378
- default:
379
- a = "UNKNOWN";
380
- break;
381
- }
382
- super({ message: t, code: a }), this.name = $.RESOLVED_COPILOT_KIT_ERROR;
383
- }
384
- }, nn = class extends P {
385
- constructor(e) {
386
- super({
387
- message: e,
388
- code: "CONFIGURATION_ERROR"
389
- /* CONFIGURATION_ERROR */
390
- }), this.name = $.CONFIGURATION_ERROR, this.severity = "warning";
391
- }
392
- }, Ir = class extends nn {
393
- constructor(e) {
394
- super(e), this.name = $.MISSING_PUBLIC_API_KEY_ERROR, this.severity = "critical";
395
- }
396
- };
397
- async function Rr({
398
- runtimeVersion: e,
399
- runtimeClientGqlVersion: t
400
- }) {
401
- if (!(!e || e === "" || !t) && (he !== e || he !== t || e !== t))
402
- return {
403
- runtimeVersion: e,
404
- runtimeClientGqlVersion: t,
405
- reactCoreVersion: he,
406
- message: en({
407
- runtimeVersion: e,
408
- runtimeClientGqlVersion: t,
409
- reactCoreVersion: he
410
- })
411
- };
412
- }
413
- var Tr = ({ errorCode: e, url: t }) => {
414
- const n = ye.NETWORK_ERROR.troubleshootingUrl, r = (i = `Failed to fetch from url ${t}.`) => `${i}.
415
-
416
- Possible reasons:
417
- - -The server may have an error preventing it from returning a response (Check the server logs for more info).
418
- - -The server might be down or unreachable
419
- - -There might be a network issue (e.g., DNS failure, connection timeout)
420
- - -The URL might be incorrect
421
- - -The server is not running on the specified port
422
-
423
- ${de(n)}`;
424
- if (t.includes("/info"))
425
- return r(`Failed to fetch CopilotKit agents/action information from url ${t}.`);
426
- if (t.includes("/actions/execute"))
427
- return r(`Fetch call to ${t} to execute actions failed.`);
428
- if (t.includes("/agents/state"))
429
- return r(`Fetch call to ${t} to get agent state failed.`);
430
- if (t.includes("/agents/execute"))
431
- return r(`Fetch call to ${t} to execute agent(s) failed.`);
432
- switch (e) {
433
- case "ECONNREFUSED":
434
- return `Connection to ${t} was refused. Ensure the server is running and accessible.
435
-
436
- ${de(n)}`;
437
- case "ENOTFOUND":
438
- return `The server on ${t} could not be found. Check the URL or your network configuration.
439
-
440
- ${de(ye.NOT_FOUND.troubleshootingUrl)}`;
441
- case "ETIMEDOUT":
442
- return `The connection to ${t} timed out. The server might be overloaded or taking too long to respond.
443
-
444
- ${de(n)}`;
445
- default:
446
- return;
447
- }
448
- };
449
- function lt() {
450
- return "ck-" + Jt();
451
- }
452
- function Mr() {
453
- return Jt();
454
- }
455
- var rn = "https://api.cloud.copilotkit.ai", Fr = "v1", Dr = `${rn}/copilotkit/${Fr}`, an = "X-CopilotCloud-Public-Api-Key", jr = /* @__PURE__ */ ((e) => (e.Chat = "Chat", e.Suggestion = "Suggestion", e.Task = "Task", e.TextareaCompletion = "TextareaCompletion", e.TextareaPopover = "TextareaPopover", e))(jr || {}), sn = /* @__PURE__ */ ((e) => (e.Assistant = "assistant", e.Developer = "developer", e.System = "system", e.Tool = "tool", e.User = "user", e))(sn || {}), Lr = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "generateCopilotResponse" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "GenerateCopilotResponseInput" } } } }, { kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "properties" } }, type: { kind: "NamedType", name: { kind: "Name", value: "JSONObject" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "generateCopilotResponse" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }, { kind: "Argument", name: { kind: "Name", value: "properties" }, value: { kind: "Variable", name: { kind: "Name", value: "properties" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "threadId" } }, { kind: "Field", name: { kind: "Name", value: "runId" } }, { kind: "Field", name: { kind: "Name", value: "extensions" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "openaiAssistantAPI" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "runId" } }, { kind: "Field", name: { kind: "Name", value: "threadId" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CopilotResponse" } }, directives: [{ kind: "Directive", name: { kind: "Name", value: "defer" } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "status" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BaseResponseStatus" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "FailedResponseStatus" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "reason" } }, { kind: "Field", name: { kind: "Name", value: "details" } }] } }] } }] } }, { kind: "Field", name: { kind: "Name", value: "messages" }, directives: [{ kind: "Directive", name: { kind: "Name", value: "stream" } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BaseMessageOutput" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "createdAt" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BaseMessageOutput" } }, directives: [{ kind: "Directive", name: { kind: "Name", value: "defer" } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "status" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SuccessMessageStatus" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "FailedMessageStatus" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" } }, { kind: "Field", name: { kind: "Name", value: "reason" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "PendingMessageStatus" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "TextMessageOutput" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "content" }, directives: [{ kind: "Directive", name: { kind: "Name", value: "stream" } }] }, { kind: "Field", name: { kind: "Name", value: "role" } }, { kind: "Field", name: { kind: "Name", value: "parentMessageId" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ImageMessageOutput" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "format" } }, { kind: "Field", name: { kind: "Name", value: "bytes" } }, { kind: "Field", name: { kind: "Name", value: "role" } }, { kind: "Field", name: { kind: "Name", value: "parentMessageId" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ActionExecutionMessageOutput" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "arguments" }, directives: [{ kind: "Directive", name: { kind: "Name", value: "stream" } }] }, { kind: "Field", name: { kind: "Name", value: "parentMessageId" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ResultMessageOutput" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "result" } }, { kind: "Field", name: { kind: "Name", value: "actionExecutionId" } }, { kind: "Field", name: { kind: "Name", value: "actionName" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "AgentStateMessageOutput" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "threadId" } }, { kind: "Field", name: { kind: "Name", value: "state" } }, { kind: "Field", name: { kind: "Name", value: "running" } }, { kind: "Field", name: { kind: "Name", value: "agentName" } }, { kind: "Field", name: { kind: "Name", value: "nodeName" } }, { kind: "Field", name: { kind: "Name", value: "runId" } }, { kind: "Field", name: { kind: "Name", value: "active" } }, { kind: "Field", name: { kind: "Name", value: "role" } }] } }] } }, { kind: "Field", name: { kind: "Name", value: "metaEvents" }, directives: [{ kind: "Directive", name: { kind: "Name", value: "stream" } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "LangGraphInterruptEvent" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "type" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "value" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CopilotKitLangGraphInterruptEvent" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "type" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "messages" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BaseMessageOutput" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "createdAt" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "BaseMessageOutput" } }, directives: [{ kind: "Directive", name: { kind: "Name", value: "defer" } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "status" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "SuccessMessageStatus" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "FailedMessageStatus" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" } }, { kind: "Field", name: { kind: "Name", value: "reason" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "PendingMessageStatus" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "code" } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "TextMessageOutput" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "content" } }, { kind: "Field", name: { kind: "Name", value: "role" } }, { kind: "Field", name: { kind: "Name", value: "parentMessageId" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ActionExecutionMessageOutput" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "arguments" } }, { kind: "Field", name: { kind: "Name", value: "parentMessageId" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ResultMessageOutput" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "result" } }, { kind: "Field", name: { kind: "Name", value: "actionExecutionId" } }, { kind: "Field", name: { kind: "Name", value: "actionName" } }] } }] } }, { kind: "Field", name: { kind: "Name", value: "value" } }] } }] } }] } }] } }] } }] }, Pr = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "availableAgents" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "availableAgents" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "agents" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "description" } }] } }] } }] } }] }, Ur = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "loadAgentState" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "LoadAgentStateInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "loadAgentState" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "threadId" } }, { kind: "Field", name: { kind: "Name", value: "threadExists" } }, { kind: "Field", name: { kind: "Name", value: "state" } }, { kind: "Field", name: { kind: "Name", value: "messages" } }] } }] } }] }, Se = class {
456
- constructor(e) {
457
- e.id ?? (e.id = lt()), e.status ?? (e.status = {
458
- code: "Success"
459
- /* Success */
460
- }), e.createdAt ?? (e.createdAt = /* @__PURE__ */ new Date()), Object.assign(this, e);
461
- }
462
- isTextMessage() {
463
- return this.type === "TextMessage";
464
- }
465
- isActionExecutionMessage() {
466
- return this.type === "ActionExecutionMessage";
467
- }
468
- isResultMessage() {
469
- return this.type === "ResultMessage";
470
- }
471
- isAgentStateMessage() {
472
- return this.type === "AgentStateMessage";
473
- }
474
- isImageMessage() {
475
- return this.type === "ImageMessage";
476
- }
477
- }, Aa = sn, on = class extends Se {
478
- constructor(e) {
479
- super(e), this.type = "TextMessage";
480
- }
481
- }, ln = class extends Se {
482
- constructor(e) {
483
- super(e), this.type = "ActionExecutionMessage";
484
- }
485
- }, cn = class extends Se {
486
- constructor(e) {
487
- super(e), this.type = "ResultMessage";
488
- }
489
- static decodeResult(e) {
490
- return $t(e, e);
491
- }
492
- static encodeResult(e) {
493
- return e === void 0 ? "" : typeof e == "string" ? e : JSON.stringify(e);
494
- }
495
- }, dn = class extends Se {
496
- constructor(e) {
497
- super(e), this.type = "AgentStateMessage";
498
- }
499
- }, un = class extends Se {
500
- constructor(e) {
501
- super(e), this.type = "ImageMessage";
502
- }
503
- }, Kr = {
504
- "\n mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {\n generateCopilotResponse(data: $data, properties: $properties) {\n threadId\n runId\n extensions {\n openaiAssistantAPI {\n runId\n threadId\n }\n }\n ... on CopilotResponse @defer {\n status {\n ... on BaseResponseStatus {\n code\n }\n ... on FailedResponseStatus {\n reason\n details\n }\n }\n }\n messages @stream {\n __typename\n ... on BaseMessageOutput {\n id\n createdAt\n }\n ... on BaseMessageOutput @defer {\n status {\n ... on SuccessMessageStatus {\n code\n }\n ... on FailedMessageStatus {\n code\n reason\n }\n ... on PendingMessageStatus {\n code\n }\n }\n }\n ... on TextMessageOutput {\n content @stream\n role\n parentMessageId\n }\n ... on ImageMessageOutput {\n format\n bytes\n role\n parentMessageId\n }\n ... on ActionExecutionMessageOutput {\n name\n arguments @stream\n parentMessageId\n }\n ... on ResultMessageOutput {\n result\n actionExecutionId\n actionName\n }\n ... on AgentStateMessageOutput {\n threadId\n state\n running\n agentName\n nodeName\n runId\n active\n role\n }\n }\n metaEvents @stream {\n ... on LangGraphInterruptEvent {\n type\n name\n value\n }\n\n ... on CopilotKitLangGraphInterruptEvent {\n type\n name\n data {\n messages {\n __typename\n ... on BaseMessageOutput {\n id\n createdAt\n }\n ... on BaseMessageOutput @defer {\n status {\n ... on SuccessMessageStatus {\n code\n }\n ... on FailedMessageStatus {\n code\n reason\n }\n ... on PendingMessageStatus {\n code\n }\n }\n }\n ... on TextMessageOutput {\n content\n role\n parentMessageId\n }\n ... on ActionExecutionMessageOutput {\n name\n arguments\n parentMessageId\n }\n ... on ResultMessageOutput {\n result\n actionExecutionId\n actionName\n }\n }\n value\n }\n }\n }\n }\n }\n": Lr,
505
- "\n query availableAgents {\n availableAgents {\n agents {\n name\n id\n description\n }\n }\n }\n": Pr,
506
- "\n query loadAgentState($data: LoadAgentStateInput!) {\n loadAgentState(data: $data) {\n threadId\n threadExists\n state\n messages\n }\n }\n": Ur
507
- };
508
- function ct(e) {
509
- return Kr[e] ?? {};
510
- }
511
- var zr = ct(
512
- /** GraphQL **/
513
- `
514
- query availableAgents {
515
- availableAgents {
516
- agents {
517
- name
518
- id
519
- description
520
- }
521
- }
522
- }
523
- `
524
- ), Vr = ct(
525
- /** GraphQL **/
526
- `
527
- query loadAgentState($data: LoadAgentStateInput!) {
528
- loadAgentState(data: $data) {
529
- threadId
530
- threadExists
531
- state
532
- messages
533
- }
534
- }
535
- `
536
- ), Gr = ct(
537
- /** GraphQL **/
538
- `
539
- mutation generateCopilotResponse($data: GenerateCopilotResponseInput!, $properties: JSONObject) {
540
- generateCopilotResponse(data: $data, properties: $properties) {
541
- threadId
542
- runId
543
- extensions {
544
- openaiAssistantAPI {
545
- runId
546
- threadId
547
- }
548
- }
549
- ... on CopilotResponse @defer {
550
- status {
551
- ... on BaseResponseStatus {
552
- code
553
- }
554
- ... on FailedResponseStatus {
555
- reason
556
- details
557
- }
558
- }
559
- }
560
- messages @stream {
561
- __typename
562
- ... on BaseMessageOutput {
563
- id
564
- createdAt
565
- }
566
- ... on BaseMessageOutput @defer {
567
- status {
568
- ... on SuccessMessageStatus {
569
- code
570
- }
571
- ... on FailedMessageStatus {
572
- code
573
- reason
574
- }
575
- ... on PendingMessageStatus {
576
- code
577
- }
578
- }
579
- }
580
- ... on TextMessageOutput {
581
- content @stream
582
- role
583
- parentMessageId
584
- }
585
- ... on ImageMessageOutput {
586
- format
587
- bytes
588
- role
589
- parentMessageId
590
- }
591
- ... on ActionExecutionMessageOutput {
592
- name
593
- arguments @stream
594
- parentMessageId
595
- }
596
- ... on ResultMessageOutput {
597
- result
598
- actionExecutionId
599
- actionName
600
- }
601
- ... on AgentStateMessageOutput {
602
- threadId
603
- state
604
- running
605
- agentName
606
- nodeName
607
- runId
608
- active
609
- role
610
- }
611
- }
612
- metaEvents @stream {
613
- ... on LangGraphInterruptEvent {
614
- type
615
- name
616
- value
617
- }
618
-
619
- ... on CopilotKitLangGraphInterruptEvent {
620
- type
621
- name
622
- data {
623
- messages {
624
- __typename
625
- ... on BaseMessageOutput {
626
- id
627
- createdAt
628
- }
629
- ... on BaseMessageOutput @defer {
630
- status {
631
- ... on SuccessMessageStatus {
632
- code
633
- }
634
- ... on FailedMessageStatus {
635
- code
636
- reason
637
- }
638
- ... on PendingMessageStatus {
639
- code
640
- }
641
- }
642
- }
643
- ... on TextMessageOutput {
644
- content
645
- role
646
- parentMessageId
647
- }
648
- ... on ActionExecutionMessageOutput {
649
- name
650
- arguments
651
- parentMessageId
652
- }
653
- ... on ResultMessageOutput {
654
- result
655
- actionExecutionId
656
- actionName
657
- }
658
- }
659
- value
660
- }
661
- }
662
- }
663
- }
664
- }
665
- `
666
- ), ue = {
667
- NAME: "Name",
668
- OPERATION_DEFINITION: "OperationDefinition",
669
- FIELD: "Field"
670
- };
671
- class et extends Error {
672
- constructor(t, n, r, i, a, s, l) {
673
- super(t), this.name = "GraphQLError", this.message = t, a && (this.path = a), n && (this.nodes = Array.isArray(n) ? n : [n]), r && (this.source = r), i && (this.positions = i), s && (this.originalError = s);
674
- var d = l;
675
- if (!d && s) {
676
- var o = s.extensions;
677
- o && typeof o == "object" && (d = o);
678
- }
679
- this.extensions = d || {};
680
- }
681
- toJSON() {
682
- return {
683
- ...this,
684
- message: this.message
685
- };
686
- }
687
- toString() {
688
- return this.message;
689
- }
690
- get [Symbol.toStringTag]() {
691
- return "GraphQLError";
692
- }
693
- }
694
- var b, v;
695
- function L(e) {
696
- return new et(`Syntax Error: Unexpected token at ${v} in ${e}`);
697
- }
698
- function Et(e) {
699
- if (e.lastIndex = v, e.test(b))
700
- return b.slice(v, v = e.lastIndex);
701
- }
702
- var Ie = / +(?=[^\s])/y;
703
- function Wr(e) {
704
- for (var t = e.split(`
705
- `), n = "", r = 0, i = 0, a = t.length - 1, s = 0; s < t.length; s++)
706
- Ie.lastIndex = 0, Ie.test(t[s]) && (s && (!r || Ie.lastIndex < r) && (r = Ie.lastIndex), i = i || s, a = s);
707
- for (var l = i; l <= a; l++)
708
- l !== i && (n += `
709
- `), n += t[l].slice(r).replace(/\\"""/g, '"""');
710
- return n;
711
- }
712
- function O() {
713
- for (var e = 0 | b.charCodeAt(v++); e === 9 || e === 10 || e === 13 || e === 32 || e === 35 || e === 44 || e === 65279; e = 0 | b.charCodeAt(v++))
714
- if (e === 35)
715
- for (; (e = 0 | b.charCodeAt(v++)) && e !== 10 && e !== 13; )
716
- ;
717
- v--;
718
- }
719
- function dt() {
720
- for (var e = v, t = 0 | b.charCodeAt(v++); t >= 48 && t <= 57 || t >= 65 && t <= 90 || t === 95 || t >= 97 && t <= 122; t = 0 | b.charCodeAt(v++))
721
- ;
722
- if (e === v - 1)
723
- throw L("Name");
724
- var n = b.slice(e, --v);
725
- return O(), n;
726
- }
727
- function z() {
728
- return {
729
- kind: "Name",
730
- value: dt()
731
- };
732
- }
733
- var Br = /(?:"""|(?:[\s\S]*?[^\\])""")/y, qr = /(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;
734
- function pe(e) {
735
- var t;
736
- switch (b.charCodeAt(v)) {
737
- case 91:
738
- v++, O();
739
- for (var n = []; b.charCodeAt(v) !== 93; )
740
- n.push(pe(e));
741
- return v++, O(), {
742
- kind: "ListValue",
743
- values: n
744
- };
745
- case 123:
746
- v++, O();
747
- for (var r = []; b.charCodeAt(v) !== 125; ) {
748
- var i = z();
749
- if (b.charCodeAt(v++) !== 58)
750
- throw L("ObjectField");
751
- O(), r.push({
752
- kind: "ObjectField",
753
- name: i,
754
- value: pe(e)
755
- });
756
- }
757
- return v++, O(), {
758
- kind: "ObjectValue",
759
- fields: r
760
- };
761
- case 36:
762
- if (e)
763
- throw L("Variable");
764
- return v++, {
765
- kind: "Variable",
766
- name: z()
767
- };
768
- case 34:
769
- if (b.charCodeAt(v + 1) === 34 && b.charCodeAt(v + 2) === 34) {
770
- if (v += 3, (t = Et(Br)) == null)
771
- throw L("StringValue");
772
- return O(), {
773
- kind: "StringValue",
774
- value: Wr(t.slice(0, -3)),
775
- block: !0
776
- };
777
- } else {
778
- var a = v, s;
779
- v++;
780
- var l = !1;
781
- for (s = 0 | b.charCodeAt(v++); s === 92 && (v++, l = !0) || s !== 10 && s !== 13 && s !== 34 && s; s = 0 | b.charCodeAt(v++))
782
- ;
783
- if (s !== 34)
784
- throw L("StringValue");
785
- return t = b.slice(a, v), O(), {
786
- kind: "StringValue",
787
- value: l ? JSON.parse(t) : t.slice(1, -1),
788
- block: !1
789
- };
790
- }
791
- case 45:
792
- case 48:
793
- case 49:
794
- case 50:
795
- case 51:
796
- case 52:
797
- case 53:
798
- case 54:
799
- case 55:
800
- case 56:
801
- case 57:
802
- for (var d = v++, o; (o = 0 | b.charCodeAt(v++)) >= 48 && o <= 57; )
803
- ;
804
- var u = b.slice(d, --v);
805
- if ((o = b.charCodeAt(v)) === 46 || o === 69 || o === 101) {
806
- if ((t = Et(qr)) == null)
807
- throw L("FloatValue");
808
- return O(), {
809
- kind: "FloatValue",
810
- value: u + t
811
- };
812
- } else
813
- return O(), {
814
- kind: "IntValue",
815
- value: u
816
- };
817
- case 110:
818
- if (b.charCodeAt(v + 1) === 117 && b.charCodeAt(v + 2) === 108 && b.charCodeAt(v + 3) === 108)
819
- return v += 4, O(), {
820
- kind: "NullValue"
821
- };
822
- break;
823
- case 116:
824
- if (b.charCodeAt(v + 1) === 114 && b.charCodeAt(v + 2) === 117 && b.charCodeAt(v + 3) === 101)
825
- return v += 4, O(), {
826
- kind: "BooleanValue",
827
- value: !0
828
- };
829
- break;
830
- case 102:
831
- if (b.charCodeAt(v + 1) === 97 && b.charCodeAt(v + 2) === 108 && b.charCodeAt(v + 3) === 115 && b.charCodeAt(v + 4) === 101)
832
- return v += 5, O(), {
833
- kind: "BooleanValue",
834
- value: !1
835
- };
836
- break;
837
- }
838
- return {
839
- kind: "EnumValue",
840
- value: dt()
841
- };
842
- }
843
- function pn(e) {
844
- if (b.charCodeAt(v) === 40) {
845
- var t = [];
846
- v++, O();
847
- do {
848
- var n = z();
849
- if (b.charCodeAt(v++) !== 58)
850
- throw L("Argument");
851
- O(), t.push({
852
- kind: "Argument",
853
- name: n,
854
- value: pe(e)
855
- });
856
- } while (b.charCodeAt(v) !== 41);
857
- return v++, O(), t;
858
- }
859
- }
860
- function ee(e) {
861
- if (b.charCodeAt(v) === 64) {
862
- var t = [];
863
- do
864
- v++, t.push({
865
- kind: "Directive",
866
- name: z(),
867
- arguments: pn(e)
868
- });
869
- while (b.charCodeAt(v) === 64);
870
- return t;
871
- }
872
- }
873
- function Yr() {
874
- for (var e = 0; b.charCodeAt(v) === 91; )
875
- e++, v++, O();
876
- var t = {
877
- kind: "NamedType",
878
- name: z()
879
- };
880
- do
881
- if (b.charCodeAt(v) === 33 && (v++, O(), t = {
882
- kind: "NonNullType",
883
- type: t
884
- }), e) {
885
- if (b.charCodeAt(v++) !== 93)
886
- throw L("NamedType");
887
- O(), t = {
888
- kind: "ListType",
889
- type: t
890
- };
891
- }
892
- while (e--);
893
- return t;
894
- }
895
- function Fe() {
896
- if (b.charCodeAt(v++) !== 123)
897
- throw L("SelectionSet");
898
- return O(), De();
899
- }
900
- function De() {
901
- var e = [];
902
- do
903
- if (b.charCodeAt(v) === 46) {
904
- if (b.charCodeAt(++v) !== 46 || b.charCodeAt(++v) !== 46)
905
- throw L("SelectionSet");
906
- switch (v++, O(), b.charCodeAt(v)) {
907
- case 64:
908
- e.push({
909
- kind: "InlineFragment",
910
- typeCondition: void 0,
911
- directives: ee(!1),
912
- selectionSet: Fe()
913
- });
914
- break;
915
- case 111:
916
- b.charCodeAt(v + 1) === 110 ? (v += 2, O(), e.push({
917
- kind: "InlineFragment",
918
- typeCondition: {
919
- kind: "NamedType",
920
- name: z()
921
- },
922
- directives: ee(!1),
923
- selectionSet: Fe()
924
- })) : e.push({
925
- kind: "FragmentSpread",
926
- name: z(),
927
- directives: ee(!1)
928
- });
929
- break;
930
- case 123:
931
- v++, O(), e.push({
932
- kind: "InlineFragment",
933
- typeCondition: void 0,
934
- directives: void 0,
935
- selectionSet: De()
936
- });
937
- break;
938
- default:
939
- e.push({
940
- kind: "FragmentSpread",
941
- name: z(),
942
- directives: ee(!1)
943
- });
944
- }
945
- } else {
946
- var t = z(), n = void 0;
947
- b.charCodeAt(v) === 58 && (v++, O(), n = t, t = z());
948
- var r = pn(!1), i = ee(!1), a = void 0;
949
- b.charCodeAt(v) === 123 && (v++, O(), a = De()), e.push({
950
- kind: "Field",
951
- alias: n,
952
- name: t,
953
- arguments: r,
954
- directives: i,
955
- selectionSet: a
956
- });
957
- }
958
- while (b.charCodeAt(v) !== 125);
959
- return v++, O(), {
960
- kind: "SelectionSet",
961
- selections: e
962
- };
963
- }
964
- function Qr() {
965
- if (O(), b.charCodeAt(v) === 40) {
966
- var e = [];
967
- v++, O();
968
- do {
969
- var t = void 0;
970
- if (b.charCodeAt(v) === 34 && (t = pe(!0)), b.charCodeAt(v++) !== 36)
971
- throw L("Variable");
972
- var n = z();
973
- if (b.charCodeAt(v++) !== 58)
974
- throw L("VariableDefinition");
975
- O();
976
- var r = Yr(), i = void 0;
977
- b.charCodeAt(v) === 61 && (v++, O(), i = pe(!0)), O();
978
- var a = {
979
- kind: "VariableDefinition",
980
- variable: {
981
- kind: "Variable",
982
- name: n
983
- },
984
- type: r,
985
- defaultValue: i,
986
- directives: ee(!0)
987
- };
988
- t && (a.description = t), e.push(a);
989
- } while (b.charCodeAt(v) !== 41);
990
- return v++, O(), e;
991
- }
992
- }
993
- function Hr(e) {
994
- var t = z();
995
- if (b.charCodeAt(v++) !== 111 || b.charCodeAt(v++) !== 110)
996
- throw L("FragmentDefinition");
997
- O();
998
- var n = {
999
- kind: "FragmentDefinition",
1000
- name: t,
1001
- typeCondition: {
1002
- kind: "NamedType",
1003
- name: z()
1004
- },
1005
- directives: ee(!1),
1006
- selectionSet: Fe()
1007
- };
1008
- return e && (n.description = e), n;
1009
- }
1010
- function Ct() {
1011
- var e = [];
1012
- do {
1013
- var t = void 0;
1014
- if (b.charCodeAt(v) === 34 && (t = pe(!0)), b.charCodeAt(v) === 123) {
1015
- if (t)
1016
- throw L("Document");
1017
- v++, O(), e.push({
1018
- kind: "OperationDefinition",
1019
- operation: "query",
1020
- name: void 0,
1021
- variableDefinitions: void 0,
1022
- directives: void 0,
1023
- selectionSet: De()
1024
- });
1025
- } else {
1026
- var n = dt();
1027
- switch (n) {
1028
- case "fragment":
1029
- e.push(Hr(t));
1030
- break;
1031
- case "query":
1032
- case "mutation":
1033
- case "subscription":
1034
- var r, i = void 0;
1035
- (r = b.charCodeAt(v)) !== 40 && r !== 64 && r !== 123 && (i = z());
1036
- var a = {
1037
- kind: "OperationDefinition",
1038
- operation: n,
1039
- name: i,
1040
- variableDefinitions: Qr(),
1041
- directives: ee(!1),
1042
- selectionSet: Fe()
1043
- };
1044
- t && (a.description = t), e.push(a);
1045
- break;
1046
- default:
1047
- throw L("Document");
1048
- }
1049
- }
1050
- } while (v < b.length);
1051
- return e;
1052
- }
1053
- function Xr(e, t) {
1054
- return b = e.body ? e.body : e, v = 0, O(), t && t.noLocation ? {
1055
- kind: "Document",
1056
- definitions: Ct()
1057
- } : {
1058
- kind: "Document",
1059
- definitions: Ct(),
1060
- loc: {
1061
- start: 0,
1062
- end: b.length,
1063
- startToken: void 0,
1064
- endToken: void 0,
1065
- source: {
1066
- body: b,
1067
- name: "graphql.web",
1068
- locationOffset: {
1069
- line: 1,
1070
- column: 1
1071
- }
1072
- }
1073
- }
1074
- };
1075
- }
1076
- function U(e, t, n) {
1077
- for (var r = "", i = 0; i < e.length; i++)
1078
- i && (r += t), r += n(e[i]);
1079
- return r;
1080
- }
1081
- function Jr(e) {
1082
- return JSON.stringify(e);
1083
- }
1084
- function Zr(e) {
1085
- return `"""
1086
- ` + e.replace(/"""/g, '\\"""') + `
1087
- """`;
1088
- }
1089
- var Q = `
1090
- `, j = {
1091
- OperationDefinition(e) {
1092
- var t = "";
1093
- e.description && (t += j.StringValue(e.description) + `
1094
- `), t += e.operation, e.name && (t += " " + e.name.value), e.variableDefinitions && e.variableDefinitions.length && (e.name || (t += " "), t += "(" + U(e.variableDefinitions, ", ", j.VariableDefinition) + ")"), e.directives && e.directives.length && (t += " " + U(e.directives, " ", j.Directive));
1095
- var n = j.SelectionSet(e.selectionSet);
1096
- return t !== "query" ? t + " " + n : n;
1097
- },
1098
- VariableDefinition(e) {
1099
- var t = "";
1100
- return e.description && (t += j.StringValue(e.description) + " "), t += j.Variable(e.variable) + ": " + Z(e.type), e.defaultValue && (t += " = " + Z(e.defaultValue)), e.directives && e.directives.length && (t += " " + U(e.directives, " ", j.Directive)), t;
1101
- },
1102
- Field(e) {
1103
- var t = e.alias ? e.alias.value + ": " + e.name.value : e.name.value;
1104
- if (e.arguments && e.arguments.length) {
1105
- var n = U(e.arguments, ", ", j.Argument);
1106
- t.length + n.length + 2 > 80 ? t += "(" + (Q += " ") + U(e.arguments, Q, j.Argument) + (Q = Q.slice(0, -2)) + ")" : t += "(" + n + ")";
1107
- }
1108
- return e.directives && e.directives.length && (t += " " + U(e.directives, " ", j.Directive)), e.selectionSet && e.selectionSet.selections.length && (t += " " + j.SelectionSet(e.selectionSet)), t;
1109
- },
1110
- StringValue(e) {
1111
- return e.block ? Zr(e.value).replace(/\n/g, Q) : Jr(e.value);
1112
- },
1113
- BooleanValue: (e) => "" + e.value,
1114
- NullValue: (e) => "null",
1115
- IntValue: (e) => e.value,
1116
- FloatValue: (e) => e.value,
1117
- EnumValue: (e) => e.value,
1118
- Name: (e) => e.value,
1119
- Variable: (e) => "$" + e.name.value,
1120
- ListValue: (e) => "[" + U(e.values, ", ", Z) + "]",
1121
- ObjectValue: (e) => "{" + U(e.fields, ", ", j.ObjectField) + "}",
1122
- ObjectField: (e) => e.name.value + ": " + Z(e.value),
1123
- Document(e) {
1124
- return !e.definitions || !e.definitions.length ? "" : U(e.definitions, `
1125
-
1126
- `, Z);
1127
- },
1128
- SelectionSet: (e) => "{" + (Q += " ") + U(e.selections, Q, Z) + (Q = Q.slice(0, -2)) + "}",
1129
- Argument: (e) => e.name.value + ": " + Z(e.value),
1130
- FragmentSpread(e) {
1131
- var t = "..." + e.name.value;
1132
- return e.directives && e.directives.length && (t += " " + U(e.directives, " ", j.Directive)), t;
1133
- },
1134
- InlineFragment(e) {
1135
- var t = "...";
1136
- return e.typeCondition && (t += " on " + e.typeCondition.name.value), e.directives && e.directives.length && (t += " " + U(e.directives, " ", j.Directive)), t += " " + j.SelectionSet(e.selectionSet);
1137
- },
1138
- FragmentDefinition(e) {
1139
- var t = "";
1140
- return e.description && (t += j.StringValue(e.description) + `
1141
- `), t += "fragment " + e.name.value, t += " on " + e.typeCondition.name.value, e.directives && e.directives.length && (t += " " + U(e.directives, " ", j.Directive)), t + " " + j.SelectionSet(e.selectionSet);
1142
- },
1143
- Directive(e) {
1144
- var t = "@" + e.name.value;
1145
- return e.arguments && e.arguments.length && (t += "(" + U(e.arguments, ", ", j.Argument) + ")"), t;
1146
- },
1147
- NamedType: (e) => e.name.value,
1148
- ListType: (e) => "[" + Z(e.type) + "]",
1149
- NonNullType: (e) => Z(e.type) + "!"
1150
- }, Z = (e) => j[e.kind](e);
1151
- function _r(e) {
1152
- return Q = `
1153
- `, j[e.kind] ? j[e.kind](e) : "";
1154
- }
1155
- var fn = () => {
1156
- }, G = fn;
1157
- function q(e) {
1158
- return {
1159
- tag: 0,
1160
- 0: e
1161
- };
1162
- }
1163
- function Ee(e) {
1164
- return {
1165
- tag: 1,
1166
- 0: e
1167
- };
1168
- }
1169
- var Ot = () => typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator", $r = (e) => e;
1170
- function V(e) {
1171
- return (t) => (n) => {
1172
- var r = G;
1173
- t(((i) => {
1174
- i === 0 ? n(0) : i.tag === 0 ? (r = i[0], n(i)) : e(i[0]) ? n(i) : r(0);
1175
- }));
1176
- };
1177
- }
1178
- function Re(e) {
1179
- return (t) => (n) => t(((r) => {
1180
- r === 0 || r.tag === 0 ? n(r) : n(Ee(e(r[0])));
1181
- }));
1182
- }
1183
- function gn(e) {
1184
- return (t) => (n) => {
1185
- var r = [], i = G, a = !1, s = !1;
1186
- t(((l) => {
1187
- s || (l === 0 ? (s = !0, r.length || n(0)) : l.tag === 0 ? i = l[0] : (a = !1, (function(o) {
1188
- var u = G;
1189
- o(((g) => {
1190
- if (g === 0) {
1191
- if (r.length) {
1192
- var m = r.indexOf(u);
1193
- m > -1 && (r = r.slice()).splice(m, 1), r.length || (s ? n(0) : a || (a = !0, i(0)));
1194
- }
1195
- } else g.tag === 0 ? (r.push(u = g[0]), u(0)) : r.length && (n(g), u(0));
1196
- }));
1197
- })(e(l[0])), a || (a = !0, i(0))));
1198
- })), n(q(((l) => {
1199
- if (l === 1) {
1200
- s || (s = !0, i(1));
1201
- for (var d = 0, o = r, u = r.length; d < u; d++)
1202
- o[d](1);
1203
- r.length = 0;
1204
- } else {
1205
- !s && !a ? (a = !0, i(0)) : a = !1;
1206
- for (var g = 0, m = r, h = r.length; g < h; g++)
1207
- m[g](0);
1208
- }
1209
- })));
1210
- };
1211
- }
1212
- function ei(e) {
1213
- return gn($r)(e);
1214
- }
1215
- function ke(e) {
1216
- return ei(ii(e));
1217
- }
1218
- function mn(e) {
1219
- return (t) => (n) => {
1220
- var r = !1;
1221
- t(((i) => {
1222
- if (!r) if (i === 0)
1223
- r = !0, n(0), e();
1224
- else if (i.tag === 0) {
1225
- var a = i[0];
1226
- n(q(((s) => {
1227
- s === 1 ? (r = !0, a(1), e()) : a(s);
1228
- })));
1229
- } else
1230
- n(i);
1231
- }));
1232
- };
1233
- }
1234
- function Ve(e) {
1235
- return (t) => (n) => {
1236
- var r = !1;
1237
- t(((i) => {
1238
- if (!r) if (i === 0)
1239
- r = !0, n(0);
1240
- else if (i.tag === 0) {
1241
- var a = i[0];
1242
- n(q(((s) => {
1243
- s === 1 && (r = !0), a(s);
1244
- })));
1245
- } else
1246
- e(i[0]), n(i);
1247
- }));
1248
- };
1249
- }
1250
- function It(e) {
1251
- return (t) => (n) => t(((r) => {
1252
- r === 0 ? n(0) : r.tag === 0 ? (n(r), e()) : n(r);
1253
- }));
1254
- }
1255
- function Ne(e) {
1256
- var t = [], n = G, r = !1;
1257
- return (i) => {
1258
- t.push(i), t.length === 1 && e(((a) => {
1259
- if (a === 0) {
1260
- for (var s = 0, l = t, d = t.length; s < d; s++)
1261
- l[s](0);
1262
- t.length = 0;
1263
- } else if (a.tag === 0)
1264
- n = a[0];
1265
- else {
1266
- r = !1;
1267
- for (var o = 0, u = t, g = t.length; o < g; o++)
1268
- u[o](a);
1269
- }
1270
- })), i(q(((a) => {
1271
- if (a === 1) {
1272
- var s = t.indexOf(i);
1273
- s > -1 && (t = t.slice()).splice(s, 1), t.length || n(1);
1274
- } else r || (r = !0, n(0));
1275
- })));
1276
- };
1277
- }
1278
- function Rt(e) {
1279
- return (t) => (n) => {
1280
- var r = G, i = G, a = !1, s = !1, l = !1, d = !1;
1281
- t(((o) => {
1282
- d || (o === 0 ? (d = !0, l || n(0)) : o.tag === 0 ? r = o[0] : (l && (i(1), i = G), a ? a = !1 : (a = !0, r(0)), (function(g) {
1283
- l = !0, g(((m) => {
1284
- l && (m === 0 ? (l = !1, d ? n(0) : a || (a = !0, r(0))) : m.tag === 0 ? (s = !1, (i = m[0])(0)) : (n(m), s ? s = !1 : i(0)));
1285
- }));
1286
- })(e(o[0]))));
1287
- })), n(q(((o) => {
1288
- o === 1 ? (d || (d = !0, r(1)), l && (l = !1, i(1))) : (!d && !a && (a = !0, r(0)), l && !s && (s = !0, i(0)));
1289
- })));
1290
- };
1291
- }
1292
- function vn(e) {
1293
- return (t) => (n) => {
1294
- var r = G, i = !1, a = 0;
1295
- t(((s) => {
1296
- i || (s === 0 ? (i = !0, n(0)) : s.tag === 0 ? r = s[0] : a++ < e ? (n(s), !i && a >= e && (i = !0, n(0), r(1))) : n(s));
1297
- })), n(q(((s) => {
1298
- s === 1 && !i ? (i = !0, r(1)) : s === 0 && !i && a < e && r(0);
1299
- })));
1300
- };
1301
- }
1302
- function hn(e) {
1303
- return (t) => (n) => {
1304
- var r = G, i = G, a = !1;
1305
- t(((s) => {
1306
- a || (s === 0 ? (a = !0, i(1), n(0)) : s.tag === 0 ? (r = s[0], e(((l) => {
1307
- l === 0 || (l.tag === 0 ? (i = l[0])(0) : (a = !0, i(1), r(1), n(0)));
1308
- }))) : n(s));
1309
- })), n(q(((s) => {
1310
- s === 1 && !a ? (a = !0, r(1), i(1)) : a || r(0);
1311
- })));
1312
- };
1313
- }
1314
- function ti(e, t) {
1315
- return (n) => (r) => {
1316
- var i = G, a = !1;
1317
- n(((s) => {
1318
- a || (s === 0 ? (a = !0, r(0)) : s.tag === 0 ? (i = s[0], r(s)) : e(s[0]) ? r(s) : (a = !0, r(s), r(0), i(1)));
1319
- }));
1320
- };
1321
- }
1322
- function ni(e) {
1323
- return (t) => e()(t);
1324
- }
1325
- function xn(e) {
1326
- return (t) => {
1327
- var n = e[Ot()] && e[Ot()]() || e, r = !1, i = !1, a = !1, s;
1328
- t(q((async (l) => {
1329
- if (l === 1)
1330
- r = !0, n.return && n.return();
1331
- else if (i)
1332
- a = !0;
1333
- else {
1334
- for (a = i = !0; a && !r; )
1335
- if ((s = await n.next()).done)
1336
- r = !0, n.return && await n.return(), t(0);
1337
- else
1338
- try {
1339
- a = !1, t(Ee(s.value));
1340
- } catch (d) {
1341
- if (n.throw)
1342
- (r = !!(await n.throw(d)).done) && t(0);
1343
- else
1344
- throw d;
1345
- }
1346
- i = !1;
1347
- }
1348
- })));
1349
- };
1350
- }
1351
- function ri(e) {
1352
- return e[Symbol.asyncIterator] ? xn(e) : (t) => {
1353
- var n = e[Symbol.iterator](), r = !1, i = !1, a = !1, s;
1354
- t(q(((l) => {
1355
- if (l === 1)
1356
- r = !0, n.return && n.return();
1357
- else if (i)
1358
- a = !0;
1359
- else {
1360
- for (a = i = !0; a && !r; )
1361
- if ((s = n.next()).done)
1362
- r = !0, n.return && n.return(), t(0);
1363
- else
1364
- try {
1365
- a = !1, t(Ee(s.value));
1366
- } catch (d) {
1367
- if (n.throw)
1368
- (r = !!n.throw(d).done) && t(0);
1369
- else
1370
- throw d;
1371
- }
1372
- i = !1;
1373
- }
1374
- })));
1375
- };
1376
- }
1377
- var ii = ri;
1378
- function Xe(e) {
1379
- return (t) => {
1380
- var n = !1;
1381
- t(q(((r) => {
1382
- r === 1 ? n = !0 : n || (n = !0, t(Ee(e)), t(0));
1383
- })));
1384
- };
1385
- }
1386
- function ai(e) {
1387
- return (t) => {
1388
- var n = !1, r = e({
1389
- next(i) {
1390
- n || t(Ee(i));
1391
- },
1392
- complete() {
1393
- n || (n = !0, t(0));
1394
- }
1395
- });
1396
- t(q(((i) => {
1397
- i === 1 && !n && (n = !0, r());
1398
- })));
1399
- };
1400
- }
1401
- function Tt() {
1402
- var e, t;
1403
- return {
1404
- source: Ne(ai(((n) => (e = n.next, t = n.complete, fn)))),
1405
- next(n) {
1406
- e && e(n);
1407
- },
1408
- complete() {
1409
- t && t();
1410
- }
1411
- };
1412
- }
1413
- function je(e) {
1414
- return (t) => {
1415
- var n = G, r = !1;
1416
- return t(((i) => {
1417
- i === 0 ? r = !0 : i.tag === 0 ? (n = i[0])(0) : r || (e(i[0]), n(0));
1418
- })), {
1419
- unsubscribe() {
1420
- r || (r = !0, n(1));
1421
- }
1422
- };
1423
- };
1424
- }
1425
- function si(e) {
1426
- je(((t) => {
1427
- }))(e);
1428
- }
1429
- function oi(e) {
1430
- return new Promise(((t) => {
1431
- var n = G, r;
1432
- e(((i) => {
1433
- i === 0 ? Promise.resolve(r).then(t) : i.tag === 0 ? (n = i[0])(0) : (r = i[0], n(0));
1434
- }));
1435
- }));
1436
- }
1437
- var li = (e) => e && typeof e.message == "string" && (e.extensions || e.name === "GraphQLError") ? e : typeof e == "object" && typeof e.message == "string" ? new et(e.message, e.nodes, e.source, e.positions, e.path, e, e.extensions || {}) : new et(e);
1438
- class ut extends Error {
1439
- constructor(t) {
1440
- var n = (t.graphQLErrors || []).map(li), r = ((i, a) => {
1441
- var s = "";
1442
- if (i)
1443
- return `[Network] ${i.message}`;
1444
- if (a)
1445
- for (var l = 0, d = a.length; l < d; l++)
1446
- s && (s += `
1447
- `), s += `[GraphQL] ${a[l].message}`;
1448
- return s;
1449
- })(t.networkError, n);
1450
- super(r), this.name = "CombinedError", this.message = r, this.graphQLErrors = n, this.networkError = t.networkError, this.response = t.response;
1451
- }
1452
- toString() {
1453
- return this.message;
1454
- }
1455
- }
1456
- var Te = (e, t) => {
1457
- for (var n = 0 | (t || 5381), r = 0, i = 0 | e.length; r < i; r++)
1458
- n = (n << 5) + n + e.charCodeAt(r);
1459
- return n;
1460
- }, ae = /* @__PURE__ */ new Set(), Mt = /* @__PURE__ */ new WeakMap(), ce = (e, t) => {
1461
- if (e === null || ae.has(e))
1462
- return "null";
1463
- if (typeof e != "object")
1464
- return JSON.stringify(e) || "";
1465
- if (e.toJSON)
1466
- return ce(e.toJSON(), t);
1467
- if (Array.isArray(e)) {
1468
- for (var n = "[", r = 0, i = e.length; r < i; r++)
1469
- n.length > 1 && (n += ","), n += ce(e[r], t) || "null";
1470
- return n += "]";
1471
- } else if (!t && (Pe !== fe && e instanceof Pe || Ue !== fe && e instanceof Ue))
1472
- return "null";
1473
- var a = Object.keys(e).sort();
1474
- if (!a.length && e.constructor && Object.getPrototypeOf(e).constructor !== Object.prototype.constructor) {
1475
- var s = Mt.get(e) || Math.random().toString(36).slice(2);
1476
- return Mt.set(e, s), ce({
1477
- __key: s
1478
- }, t);
1479
- }
1480
- ae.add(e);
1481
- for (var l = "{", d = 0, o = a.length; d < o; d++) {
1482
- var u = ce(e[a[d]], t);
1483
- u && (l.length > 1 && (l += ","), l += ce(a[d], t) + ":" + u);
1484
- }
1485
- return ae.delete(e), l += "}";
1486
- }, tt = (e, t, n) => {
1487
- if (!(n == null || typeof n != "object" || n.toJSON || ae.has(n))) if (Array.isArray(n))
1488
- for (var r = 0, i = n.length; r < i; r++)
1489
- tt(e, `${t}.${r}`, n[r]);
1490
- else if (n instanceof Pe || n instanceof Ue)
1491
- e.set(t, n);
1492
- else {
1493
- ae.add(n);
1494
- for (var a in n)
1495
- tt(e, `${t}.${a}`, n[a]);
1496
- }
1497
- }, Le = (e, t) => (ae.clear(), ce(e, t || !1));
1498
- class fe {
1499
- }
1500
- var Pe = typeof File < "u" ? File : fe, Ue = typeof Blob < "u" ? Blob : fe, ci = /("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g, di = /(?:#[^\n\r]+)?(?:[\r\n]+|$)/g, ui = (e, t) => t % 2 == 0 ? e.replace(di, `
1501
- `) : e, Ft = (e) => e.split(ci).map(ui).join("").trim(), Dt = /* @__PURE__ */ new Map(), Me = /* @__PURE__ */ new Map(), pt = (e) => {
1502
- var t;
1503
- return typeof e == "string" ? t = Ft(e) : e.loc && Me.get(e.__key) === e ? t = e.loc.source.body : (t = Dt.get(e) || Ft(_r(e)), Dt.set(e, t)), typeof e != "string" && !e.loc && (e.loc = {
1504
- start: 0,
1505
- end: t.length,
1506
- source: {
1507
- body: t,
1508
- name: "gql",
1509
- locationOffset: {
1510
- line: 1,
1511
- column: 1
1512
- }
1513
- }
1514
- }), t;
1515
- }, jt = (e) => {
1516
- var t;
1517
- if (e.documentId)
1518
- t = Te(e.documentId);
1519
- else if (t = Te(pt(e)), e.definitions) {
1520
- var n = bn(e);
1521
- n && (t = Te(`
1522
- # ${n}`, t));
1523
- }
1524
- return t;
1525
- }, yn = (e) => {
1526
- var t, n;
1527
- return typeof e == "string" ? (t = jt(e), n = Me.get(t) || Xr(e, {
1528
- noLocation: !0
1529
- })) : (t = e.__key || jt(e), n = Me.get(t) || e), n.loc || pt(n), n.__key = t, Me.set(t, n), n;
1530
- }, Je = (e, t, n) => {
1531
- var r = t || {}, i = yn(e), a = Le(r, !0), s = i.__key;
1532
- return a !== "{}" && (s = Te(a, s)), {
1533
- key: s,
1534
- query: i,
1535
- variables: r,
1536
- extensions: n
1537
- };
1538
- }, bn = (e) => {
1539
- for (var t = 0, n = e.definitions.length; t < n; t++) {
1540
- var r = e.definitions[t];
1541
- if (r.kind === ue.OPERATION_DEFINITION)
1542
- return r.name ? r.name.value : void 0;
1543
- }
1544
- }, pi = (e) => {
1545
- for (var t = 0, n = e.definitions.length; t < n; t++) {
1546
- var r = e.definitions[t];
1547
- if (r.kind === ue.OPERATION_DEFINITION)
1548
- return r.operation;
1549
- }
1550
- }, nt = (e, t, n) => {
1551
- if (!("data" in t || "errors" in t && Array.isArray(t.errors)))
1552
- throw new Error("No Content");
1553
- var r = e.kind === "subscription";
1554
- return {
1555
- operation: e,
1556
- data: t.data,
1557
- error: Array.isArray(t.errors) ? new ut({
1558
- graphQLErrors: t.errors,
1559
- response: n
1560
- }) : void 0,
1561
- extensions: t.extensions ? {
1562
- ...t.extensions
1563
- } : void 0,
1564
- hasNext: t.hasNext == null ? r : t.hasNext,
1565
- stale: !1
1566
- };
1567
- }, Ke = (e, t) => {
1568
- if (typeof e == "object" && e != null) {
1569
- if (Array.isArray(e)) {
1570
- e = [...e];
1571
- for (var n = 0, r = t.length; n < r; n++)
1572
- e[n] = Ke(e[n], t[n]);
1573
- return e;
1574
- }
1575
- if (!e.constructor || e.constructor === Object) {
1576
- e = {
1577
- ...e
1578
- };
1579
- for (var i in t)
1580
- e[i] = Ke(e[i], t[i]);
1581
- return e;
1582
- }
1583
- }
1584
- return t;
1585
- }, fi = (e, t, n, r) => {
1586
- var i = e.error ? e.error.graphQLErrors : [], a = !!e.extensions || !!(t.payload || t).extensions, s = {
1587
- ...e.extensions,
1588
- ...(t.payload || t).extensions
1589
- }, l = t.incremental;
1590
- "path" in t && (l = [t]);
1591
- var d = {
1592
- data: e.data
1593
- };
1594
- if (l)
1595
- for (var o = function() {
1596
- var m = l[u];
1597
- Array.isArray(m.errors) && i.push(...m.errors), m.extensions && (Object.assign(s, m.extensions), a = !0);
1598
- var h = "data", f = d, N = [];
1599
- if (m.path)
1600
- N = m.path;
1601
- else if (r) {
1602
- var E = r.find(((x) => x.id === m.id));
1603
- m.subPath ? N = [...E.path, ...m.subPath] : N = E.path;
1604
- }
1605
- for (var I = 0, S = N.length; I < S; h = N[I++])
1606
- f = f[h] = Array.isArray(f[h]) ? [...f[h]] : {
1607
- ...f[h]
1608
- };
1609
- if (m.items)
1610
- for (var R = +h >= 0 ? h : 0, p = 0, k = m.items.length; p < k; p++)
1611
- f[R + p] = Ke(f[R + p], m.items[p]);
1612
- else m.data !== void 0 && (f[h] = Ke(f[h], m.data));
1613
- }, u = 0, g = l.length; u < g; u++)
1614
- o();
1615
- else
1616
- d.data = (t.payload || t).data || e.data, i = t.errors || t.payload && t.payload.errors || i;
1617
- return {
1618
- operation: e.operation,
1619
- data: d.data,
1620
- error: i.length ? new ut({
1621
- graphQLErrors: i,
1622
- response: n
1623
- }) : void 0,
1624
- extensions: a ? s : void 0,
1625
- hasNext: t.hasNext != null ? t.hasNext : e.hasNext,
1626
- stale: !1
1627
- };
1628
- }, gi = (e, t, n) => ({
1629
- operation: e,
1630
- data: void 0,
1631
- error: new ut({
1632
- networkError: t,
1633
- response: n
1634
- }),
1635
- extensions: void 0,
1636
- hasNext: !1,
1637
- stale: !1
1638
- });
1639
- function mi(e) {
1640
- var t = {
1641
- query: void 0,
1642
- documentId: void 0,
1643
- operationName: bn(e.query),
1644
- variables: e.variables || void 0,
1645
- extensions: e.extensions
1646
- };
1647
- return "documentId" in e.query && e.query.documentId && (!e.query.definitions || !e.query.definitions.length) ? t.documentId = e.query.documentId : (!e.extensions || !e.extensions.persistedQuery || e.extensions.persistedQuery.miss) && (t.query = pt(e.query)), t;
1648
- }
1649
- var vi = (e, t) => {
1650
- var n = e.kind === "query" && e.context.preferGetMethod;
1651
- if (!n || !t)
1652
- return e.context.url;
1653
- var r = hi(e.context.url);
1654
- for (var i in t) {
1655
- var a = t[i];
1656
- a && r[1].set(i, typeof a == "object" ? Le(a) : a);
1657
- }
1658
- var s = r.join("?");
1659
- return s.length > 2047 && n !== "force" ? (e.context.preferGetMethod = !1, e.context.url) : s;
1660
- }, hi = (e) => {
1661
- var t = e.indexOf("?");
1662
- return t > -1 ? [e.slice(0, t), new URLSearchParams(e.slice(t + 1))] : [e, new URLSearchParams()];
1663
- }, xi = (e, t) => {
1664
- if (t && !(e.kind === "query" && e.context.preferGetMethod)) {
1665
- var n = Le(t), r = ((l) => {
1666
- var d = /* @__PURE__ */ new Map();
1667
- return (Pe !== fe || Ue !== fe) && (ae.clear(), tt(d, "variables", l)), d;
1668
- })(t.variables);
1669
- if (r.size) {
1670
- var i = new FormData();
1671
- i.append("operations", n), i.append("map", Le({
1672
- ...[...r.keys()].map(((l) => [l]))
1673
- }));
1674
- var a = 0;
1675
- for (var s of r.values())
1676
- i.append("" + a++, s);
1677
- return i;
1678
- }
1679
- return n;
1680
- }
1681
- }, yi = (e, t) => {
1682
- var n = {
1683
- accept: e.kind === "subscription" ? "text/event-stream, multipart/mixed" : "application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed"
1684
- }, r = (typeof e.context.fetchOptions == "function" ? e.context.fetchOptions() : e.context.fetchOptions) || {};
1685
- if (r.headers)
1686
- if (((s) => "has" in s && !Object.keys(s).length)(r.headers))
1687
- r.headers.forEach(((s, l) => {
1688
- n[l] = s;
1689
- }));
1690
- else if (Array.isArray(r.headers))
1691
- r.headers.forEach(((s, l) => {
1692
- Array.isArray(s) ? n[s[0]] ? n[s[0]] = `${n[s[0]]},${s[1]}` : n[s[0]] = s[1] : n[l] = s;
1693
- }));
1694
- else
1695
- for (var i in r.headers)
1696
- n[i.toLowerCase()] = r.headers[i];
1697
- var a = xi(e, t);
1698
- return typeof a == "string" && !n["content-type"] && (n["content-type"] = "application/json"), {
1699
- ...r,
1700
- method: a ? "POST" : "GET",
1701
- body: a,
1702
- headers: n
1703
- };
1704
- }, bi = /boundary="?([^=";]+)"?/i, ki = /data: ?([^\n]+)/;
1705
- async function* Lt(e) {
1706
- if (e.body[Symbol.asyncIterator])
1707
- for await (var t of e.body)
1708
- yield t;
1709
- else {
1710
- var n = e.body.getReader(), r;
1711
- try {
1712
- for (; !(r = await n.read()).done; )
1713
- yield r.value;
1714
- } finally {
1715
- n.cancel();
1716
- }
1717
- }
1718
- }
1719
- async function* Pt(e, t) {
1720
- var n = typeof TextDecoder < "u" ? new TextDecoder() : null, r = "", i;
1721
- for await (var a of e)
1722
- for (r += a.constructor.name === "Buffer" ? a.toString() : n.decode(a, {
1723
- stream: !0
1724
- }); (i = r.indexOf(t)) > -1; )
1725
- yield r.slice(0, i), r = r.slice(i + t.length);
1726
- }
1727
- async function* Ni(e, t, n) {
1728
- var r = !0, i = null, a;
1729
- try {
1730
- yield await Promise.resolve();
1731
- var s = (a = await (e.context.fetch || fetch)(t, n)).headers.get("Content-Type") || "", l;
1732
- /multipart\/mixed/i.test(s) ? l = (async function* (g, m) {
1733
- var h = g.match(bi), f = "--" + (h ? h[1] : "-"), N = !0, E;
1734
- for await (var I of Pt(Lt(m), `\r
1735
- ` + f)) {
1736
- if (N) {
1737
- N = !1;
1738
- var S = I.indexOf(f);
1739
- if (S > -1)
1740
- I = I.slice(S + f.length);
1741
- else
1742
- continue;
1743
- }
1744
- try {
1745
- yield E = JSON.parse(I.slice(I.indexOf(`\r
1746
- \r
1747
- `) + 4));
1748
- } catch (R) {
1749
- if (!E)
1750
- throw R;
1751
- }
1752
- if (E && E.hasNext === !1)
1753
- break;
1754
- }
1755
- E && E.hasNext !== !1 && (yield {
1756
- hasNext: !1
1757
- });
1758
- })(s, a) : /text\/event-stream/i.test(s) ? l = (async function* (g) {
1759
- var m;
1760
- for await (var h of Pt(Lt(g), `
1761
-
1762
- `)) {
1763
- var f = h.match(ki);
1764
- if (f) {
1765
- var N = f[1];
1766
- try {
1767
- yield m = JSON.parse(N);
1768
- } catch (E) {
1769
- if (!m)
1770
- throw E;
1771
- }
1772
- if (m && m.hasNext === !1)
1773
- break;
1774
- }
1775
- }
1776
- m && m.hasNext !== !1 && (yield {
1777
- hasNext: !1
1778
- });
1779
- })(a) : /text\//i.test(s) ? l = (async function* (g) {
1780
- var m = await g.text();
1781
- try {
1782
- var h = JSON.parse(m);
1783
- process.env.NODE_ENV !== "production" && console.warn('Found response with content-type "text/plain" but it had a valid "application/json" response.'), yield h;
1784
- } catch {
1785
- throw new Error(m);
1786
- }
1787
- })(a) : l = (async function* (g) {
1788
- yield JSON.parse(await g.text());
1789
- })(a);
1790
- var d;
1791
- for await (var o of l)
1792
- o.pending && !i ? d = o.pending : o.pending && (d = [...d, ...o.pending]), i = i ? fi(i, o, a, d) : nt(e, o, a), r = !1, yield i, r = !0;
1793
- i || (yield i = nt(e, {}, a));
1794
- } catch (u) {
1795
- if (!r)
1796
- throw u;
1797
- yield gi(e, a && (a.status < 200 || a.status >= 300) && a.statusText ? new Error(a.statusText) : u, a);
1798
- }
1799
- }
1800
- function Ai(e, t, n) {
1801
- var r;
1802
- return typeof AbortController < "u" && (n.signal = (r = new AbortController()).signal), mn((() => {
1803
- r && r.abort();
1804
- }))(V(((i) => !!i))(xn(Ni(e, t, n))));
1805
- }
1806
- var rt = (e, t) => {
1807
- if (Array.isArray(e))
1808
- for (var n = 0, r = e.length; n < r; n++)
1809
- rt(e[n], t);
1810
- else if (typeof e == "object" && e !== null)
1811
- for (var i in e)
1812
- i === "__typename" && typeof e[i] == "string" ? t.add(e[i]) : rt(e[i], t);
1813
- return t;
1814
- }, it = (e) => {
1815
- if ("definitions" in e) {
1816
- for (var t = [], n = 0, r = e.definitions.length; n < r; n++) {
1817
- var i = it(e.definitions[n]);
1818
- t.push(i);
1819
- }
1820
- return {
1821
- ...e,
1822
- definitions: t
1823
- };
1824
- }
1825
- if ("directives" in e && e.directives && e.directives.length) {
1826
- for (var a = [], s = {}, l = 0, d = e.directives.length; l < d; l++) {
1827
- var o = e.directives[l], u = o.name.value;
1828
- u[0] !== "_" ? a.push(o) : u = u.slice(1), s[u] = o;
1829
- }
1830
- e = {
1831
- ...e,
1832
- directives: a,
1833
- _directives: s
1834
- };
1835
- }
1836
- if ("selectionSet" in e) {
1837
- var g = [], m = e.kind === ue.OPERATION_DEFINITION;
1838
- if (e.selectionSet) {
1839
- for (var h = 0, f = e.selectionSet.selections.length; h < f; h++) {
1840
- var N = e.selectionSet.selections[h];
1841
- m = m || N.kind === ue.FIELD && N.name.value === "__typename" && !N.alias;
1842
- var E = it(N);
1843
- g.push(E);
1844
- }
1845
- return m || g.push({
1846
- kind: ue.FIELD,
1847
- name: {
1848
- kind: ue.NAME,
1849
- value: "__typename"
1850
- },
1851
- _generated: !0
1852
- }), {
1853
- ...e,
1854
- selectionSet: {
1855
- ...e.selectionSet,
1856
- selections: g
1857
- }
1858
- };
1859
- }
1860
- }
1861
- return e;
1862
- }, Ut = /* @__PURE__ */ new Map(), wi = (e) => {
1863
- var t = yn(e), n = Ut.get(t.__key);
1864
- return n || (Ut.set(t.__key, n = it(t)), Object.defineProperty(n, "__key", {
1865
- value: t.__key,
1866
- enumerable: !1
1867
- })), n;
1868
- };
1869
- function Kt(e) {
1870
- var t = (n) => e(n);
1871
- return t.toPromise = () => oi(vn(1)(V(((n) => !n.stale && !n.hasNext))(t))), t.then = (n, r) => t.toPromise().then(n, r), t.subscribe = (n) => je(n)(t), t;
1872
- }
1873
- function Ae(e, t, n) {
1874
- return {
1875
- ...t,
1876
- kind: e,
1877
- context: t.context ? {
1878
- ...t.context,
1879
- ...n
1880
- } : n || t.context
1881
- };
1882
- }
1883
- var zt = (e, t) => Ae(e.kind, e, {
1884
- meta: {
1885
- ...e.context.meta,
1886
- ...t
1887
- }
1888
- }), Si = () => {
1889
- }, Ze = ({ kind: e }) => e !== "mutation" && e !== "query", Ei = (e) => {
1890
- var t = wi(e.query);
1891
- if (t !== e.query) {
1892
- var n = Ae(e.kind, e);
1893
- return n.query = t, n;
1894
- } else
1895
- return e;
1896
- }, Ci = ({ forward: e, client: t, dispatchDebug: n }) => {
1897
- var r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = (s) => s.kind === "query" && s.context.requestPolicy !== "network-only" && (s.context.requestPolicy === "cache-only" || r.has(s.key));
1898
- return (s) => {
1899
- var l = Re(((o) => {
1900
- var u = r.get(o.key);
1901
- process.env.NODE_ENV !== "production" && n({
1902
- operation: o,
1903
- ...u ? {
1904
- type: "cacheHit",
1905
- message: "The result was successfully retrieved from the cache"
1906
- } : {
1907
- type: "cacheMiss",
1908
- message: "The result could not be retrieved from the cache"
1909
- },
1910
- source: "cacheExchange"
1911
- });
1912
- var g = u || nt(o, {
1913
- data: null
1914
- });
1915
- return g = {
1916
- ...g,
1917
- operation: zt(o, {
1918
- cacheOutcome: u ? "hit" : "miss"
1919
- })
1920
- }, o.context.requestPolicy === "cache-and-network" && (g.stale = !0, Vt(t, o)), g;
1921
- }))(V(((o) => !Ze(o) && a(o)))(s)), d = Ve(((o) => {
1922
- var { operation: u } = o;
1923
- if (u) {
1924
- var g = u.context.additionalTypenames || [];
1925
- if (o.operation.kind !== "subscription" && (g = ((k) => [...rt(k, /* @__PURE__ */ new Set())])(o.data).concat(g)), o.operation.kind === "mutation" || o.operation.kind === "subscription") {
1926
- var m = /* @__PURE__ */ new Set();
1927
- process.env.NODE_ENV !== "production" && n({
1928
- type: "cacheInvalidation",
1929
- message: `The following typenames have been invalidated: ${g}`,
1930
- operation: u,
1931
- data: {
1932
- typenames: g,
1933
- response: o
1934
- },
1935
- source: "cacheExchange"
1936
- });
1937
- for (var h = 0; h < g.length; h++) {
1938
- var f = g[h], N = i.get(f);
1939
- N || i.set(f, N = /* @__PURE__ */ new Set());
1940
- for (var E of N.values())
1941
- m.add(E);
1942
- N.clear();
1943
- }
1944
- for (var I of m.values())
1945
- r.has(I) && (u = r.get(I).operation, r.delete(I), Vt(t, u));
1946
- } else if (u.kind === "query" && o.data) {
1947
- r.set(u.key, o);
1948
- for (var S = 0; S < g.length; S++) {
1949
- var R = g[S], p = i.get(R);
1950
- p || i.set(R, p = /* @__PURE__ */ new Set()), p.add(u.key);
1951
- }
1952
- }
1953
- }
1954
- }))(e(V(((o) => o.kind !== "query" || o.context.requestPolicy !== "cache-only"))(Re(((o) => zt(o, {
1955
- cacheOutcome: "miss"
1956
- })))(ke([Re(Ei)(V(((o) => !Ze(o) && !a(o)))(s)), V(((o) => Ze(o)))(s)])))));
1957
- return ke([l, d]);
1958
- };
1959
- }, Vt = (e, t) => e.reexecuteOperation(Ae(t.kind, t, {
1960
- requestPolicy: "network-only"
1961
- })), Oi = ({ forward: e, dispatchDebug: t }) => (n) => {
1962
- var r = gn(((a) => {
1963
- var s = mi(a), l = vi(a, s), d = yi(a, s);
1964
- process.env.NODE_ENV !== "production" && t({
1965
- type: "fetchRequest",
1966
- message: "A fetch request is being executed.",
1967
- operation: a,
1968
- data: {
1969
- url: l,
1970
- fetchOptions: d
1971
- },
1972
- source: "fetchExchange"
1973
- });
1974
- var o = hn(V(((u) => u.kind === "teardown" && u.key === a.key))(n))(Ai(a, l, d));
1975
- return process.env.NODE_ENV !== "production" ? Ve(((u) => {
1976
- var g = u.data ? void 0 : u.error;
1977
- process.env.NODE_ENV !== "production" && t({
1978
- type: g ? "fetchError" : "fetchSuccess",
1979
- message: `A ${g ? "failed" : "successful"} fetch response has been returned.`,
1980
- operation: a,
1981
- data: {
1982
- url: l,
1983
- fetchOptions: d,
1984
- value: g || u
1985
- },
1986
- source: "fetchExchange"
1987
- });
1988
- }))(o) : o;
1989
- }))(V(((a) => a.kind !== "teardown" && (a.kind !== "subscription" || !!a.context.fetchSubscriptions)))(n)), i = e(V(((a) => a.kind === "teardown" || a.kind === "subscription" && !a.context.fetchSubscriptions))(n));
1990
- return ke([r, i]);
1991
- }, Ii = (e) => ({ client: t, forward: n, dispatchDebug: r }) => e.reduceRight(((i, a) => {
1992
- var s = !1;
1993
- return a({
1994
- client: t,
1995
- forward(l) {
1996
- if (process.env.NODE_ENV !== "production") {
1997
- if (s)
1998
- throw new Error("forward() must only be called once in each Exchange.");
1999
- s = !0;
2000
- }
2001
- return Ne(i(Ne(l)));
2002
- },
2003
- dispatchDebug(l) {
2004
- process.env.NODE_ENV !== "production" && r({
2005
- timestamp: Date.now(),
2006
- source: a.name,
2007
- ...l
2008
- });
2009
- }
2010
- });
2011
- }), n), Ri = ({ dispatchDebug: e }) => (t) => (process.env.NODE_ENV !== "production" && (t = Ve(((n) => {
2012
- if (n.kind !== "teardown" && process.env.NODE_ENV !== "production") {
2013
- var r = `No exchange has handled operations of kind "${n.kind}". Check whether you've added an exchange responsible for these operations.`;
2014
- process.env.NODE_ENV !== "production" && e({
2015
- type: "fallbackCatch",
2016
- message: r,
2017
- operation: n,
2018
- source: "fallbackExchange"
2019
- }), console.warn(r);
2020
- }
2021
- }))(t)), V(((n) => !1))(t)), Ti = function e(t) {
2022
- if (process.env.NODE_ENV !== "production" && !t.url)
2023
- throw new Error("You are creating an urql-client without a url.");
2024
- var n = 0, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), s = [], l = {
2025
- url: t.url,
2026
- fetchSubscriptions: t.fetchSubscriptions,
2027
- fetchOptions: t.fetchOptions,
2028
- fetch: t.fetch,
2029
- preferGetMethod: t.preferGetMethod,
2030
- requestPolicy: t.requestPolicy || "cache-first"
2031
- }, d = Tt();
2032
- function o(p) {
2033
- (p.kind === "mutation" || p.kind === "teardown" || !a.has(p.key)) && (p.kind === "teardown" ? a.delete(p.key) : p.kind !== "mutation" && a.add(p.key), d.next(p));
2034
- }
2035
- var u = !1;
2036
- function g(p) {
2037
- if (p && o(p), !u) {
2038
- for (u = !0; u && (p = s.shift()); )
2039
- o(p);
2040
- u = !1;
2041
- }
2042
- }
2043
- var m = (p) => {
2044
- var k = hn(V(((x) => x.kind === "teardown" && x.key === p.key))(d.source))(V(((x) => x.operation.kind === p.kind && x.operation.key === p.key && (!x.operation.context._instance || x.operation.context._instance === p.context._instance)))(R));
2045
- return p.kind !== "query" ? k = ti(((x) => !!x.hasNext))(k) : k = Rt(((x) => {
2046
- var T = Xe(x);
2047
- return x.stale || x.hasNext ? T : ke([T, Re((() => (x.stale = !0, x)))(vn(1)(V(((F) => F.key === p.key))(d.source)))]);
2048
- }))(k), p.kind !== "mutation" ? k = mn((() => {
2049
- a.delete(p.key), r.delete(p.key), i.delete(p.key), u = !1;
2050
- for (var x = s.length - 1; x >= 0; x--)
2051
- s[x].key === p.key && s.splice(x, 1);
2052
- o(Ae("teardown", p, p.context));
2053
- }))(Ve(((x) => {
2054
- if (x.stale)
2055
- if (!x.hasNext)
2056
- a.delete(p.key);
2057
- else
2058
- for (var T = 0; T < s.length; T++) {
2059
- var F = s[T];
2060
- if (F.key === x.operation.key) {
2061
- a.delete(F.key);
2062
- break;
2063
- }
2064
- }
2065
- else x.hasNext || a.delete(p.key);
2066
- r.set(p.key, x);
2067
- }))(k)) : k = It((() => {
2068
- o(p);
2069
- }))(k), Ne(k);
2070
- }, h = this instanceof e ? this : Object.create(e.prototype), f = Object.assign(h, {
2071
- suspense: !!t.suspense,
2072
- operations$: d.source,
2073
- reexecuteOperation(p) {
2074
- if (p.kind === "teardown")
2075
- g(p);
2076
- else if (p.kind === "mutation")
2077
- s.push(p), Promise.resolve().then(g);
2078
- else if (i.has(p.key)) {
2079
- for (var k = !1, x = 0; x < s.length; x++)
2080
- s[x].key === p.key && (s[x] = p, k = !0);
2081
- k || a.has(p.key) && p.context.requestPolicy !== "network-only" ? (a.delete(p.key), Promise.resolve().then(g)) : (s.push(p), Promise.resolve().then(g));
2082
- }
2083
- },
2084
- createRequestOperation(p, k, x) {
2085
- x || (x = {});
2086
- var T;
2087
- if (process.env.NODE_ENV !== "production" && p !== "teardown" && (T = pi(k.query)) !== p)
2088
- throw new Error(`Expected operation of type "${p}" but found "${T}"`);
2089
- return Ae(p, k, {
2090
- _instance: p === "mutation" ? n = n + 1 | 0 : void 0,
2091
- ...l,
2092
- ...x,
2093
- requestPolicy: x.requestPolicy || l.requestPolicy,
2094
- suspense: x.suspense || x.suspense !== !1 && f.suspense
2095
- });
2096
- },
2097
- executeRequestOperation(p) {
2098
- return p.kind === "mutation" ? Kt(m(p)) : Kt(ni((() => {
2099
- var k = i.get(p.key);
2100
- k || i.set(p.key, k = m(p)), k = It((() => {
2101
- g(p);
2102
- }))(k);
2103
- var x = r.get(p.key);
2104
- return p.kind === "query" && x && (x.stale || x.hasNext) ? Rt(Xe)(ke([k, V(((T) => T === r.get(p.key)))(Xe(x))])) : k;
2105
- })));
2106
- },
2107
- executeQuery(p, k) {
2108
- var x = f.createRequestOperation("query", p, k);
2109
- return f.executeRequestOperation(x);
2110
- },
2111
- executeSubscription(p, k) {
2112
- var x = f.createRequestOperation("subscription", p, k);
2113
- return f.executeRequestOperation(x);
2114
- },
2115
- executeMutation(p, k) {
2116
- var x = f.createRequestOperation("mutation", p, k);
2117
- return f.executeRequestOperation(x);
2118
- },
2119
- readQuery(p, k, x) {
2120
- var T = null;
2121
- return je(((F) => {
2122
- T = F;
2123
- }))(f.query(p, k, x)).unsubscribe(), T;
2124
- },
2125
- query: (p, k, x) => f.executeQuery(Je(p, k), x),
2126
- subscription: (p, k, x) => f.executeSubscription(Je(p, k), x),
2127
- mutation: (p, k, x) => f.executeMutation(Je(p, k), x)
2128
- }), N = Si;
2129
- if (process.env.NODE_ENV !== "production") {
2130
- var { next: E, source: I } = Tt();
2131
- f.subscribeToDebugTarget = (p) => je(p)(I), N = E;
2132
- }
2133
- var S = Ii(t.exchanges), R = Ne(S({
2134
- client: f,
2135
- dispatchDebug: N,
2136
- forward: Ri({
2137
- dispatchDebug: N
2138
- })
2139
- })(d.source));
2140
- return si(R), f;
2141
- }, kn = "1.10.4", _e = (e, t) => async (...n) => {
2142
- var r, i;
2143
- const a = (i = (r = n[1]) == null ? void 0 : r.headers) == null ? void 0 : i["x-copilotcloud-public-api-key"];
2144
- try {
2145
- const s = await fetch(n[0], { ...n[1] ?? {}, signal: e }), l = a ? null : await Rr({
2146
- runtimeVersion: s.headers.get("X-CopilotKit-Runtime-Version"),
2147
- runtimeClientGqlVersion: kn
2148
- });
2149
- if (s.status !== 200 && s.status >= 400 && s.status <= 500)
2150
- throw l ? new Er(l) : new Or({ status: s.status });
2151
- return l && t && t(l.message), s;
2152
- } catch (s) {
2153
- throw s.message.includes("BodyStreamBuffer was aborted") || s.message.includes("signal is aborted without reason") || s instanceof P ? s : new Cr({ error: s, url: n[0] });
2154
- }
2155
- }, at = class {
2156
- constructor(e) {
2157
- const t = {};
2158
- this.handleGQLErrors = e.handleGQLErrors, this.handleGQLWarning = e.handleGQLWarning, e.headers && Object.assign(t, e.headers), e.publicApiKey && (t["x-copilotcloud-public-api-key"] = e.publicApiKey), this.client = new Ti({
2159
- url: e.url,
2160
- exchanges: [Ci, Oi],
2161
- fetchOptions: {
2162
- headers: {
2163
- ...t,
2164
- "X-CopilotKit-Runtime-Client-GQL-Version": kn
2165
- },
2166
- ...e.credentials ? { credentials: e.credentials } : {}
2167
- }
2168
- });
2169
- }
2170
- generateCopilotResponse({
2171
- data: e,
2172
- properties: t,
2173
- signal: n
2174
- }) {
2175
- const r = _e(n, this.handleGQLWarning), i = this.client.mutation(Gr, { data: e, properties: t }, { fetch: r });
2176
- return i.subscribe(({ error: a }) => {
2177
- a && this.handleGQLErrors && this.handleGQLErrors(a);
2178
- }), i;
2179
- }
2180
- asStream(e) {
2181
- const t = this.handleGQLErrors;
2182
- return new ReadableStream({
2183
- start(n) {
2184
- e.subscribe(({ data: r, hasNext: i, error: a }) => {
2185
- var s;
2186
- if (a) {
2187
- if (a.message.includes("BodyStreamBuffer was aborted") || a.message.includes("signal is aborted without reason")) {
2188
- i || n.close(), console.warn("Abort error suppressed");
2189
- return;
2190
- }
2191
- if ((s = a.extensions) != null && s.visibility) {
2192
- const l = {
2193
- ...a,
2194
- graphQLErrors: [
2195
- {
2196
- message: a.message,
2197
- extensions: a.extensions
2198
- }
2199
- ]
2200
- };
2201
- t && t(l);
2202
- return;
2203
- }
2204
- n.error(a), t && t(a);
2205
- } else
2206
- n.enqueue(r), i || n.close();
2207
- });
2208
- }
2209
- });
2210
- }
2211
- availableAgents() {
2212
- const e = _e();
2213
- return this.client.query(zr, {}, { fetch: e });
2214
- }
2215
- loadAgentState(e) {
2216
- const t = _e(), n = this.client.query(
2217
- Vr,
2218
- { data: e },
2219
- { fetch: t }
2220
- );
2221
- return n.toPromise().then(({ error: r }) => {
2222
- r && this.handleGQLErrors && this.handleGQLErrors(r);
2223
- }).catch(() => {
2224
- }), n;
2225
- }
2226
- static removeGraphQLTypename(e) {
2227
- return Array.isArray(e) ? e.forEach((t) => at.removeGraphQLTypename(t)) : typeof e == "object" && e !== null && (delete e.__typename, Object.keys(e).forEach((t) => {
2228
- typeof e[t] == "object" && e[t] !== null && at.removeGraphQLTypename(e[t]);
2229
- })), e;
2230
- }
2231
- };
2232
- function Gt(e) {
2233
- return ` \r
2234
- `.indexOf(e) >= 0;
2235
- }
2236
- function Mi(e) {
2237
- for (var t = [
2238
- "topLevel"
2239
- /* TOP_LEVEL */
2240
- ], n = 0, r, i, a, s = function(S) {
2241
- return t.push(S);
2242
- }, l = function(S) {
2243
- return t[t.length - 1] = S;
2244
- }, d = function(S) {
2245
- r == null && (r = n, i = t.length, a = S);
2246
- }, o = function(S) {
2247
- S === a && (r = void 0, i = void 0, a = void 0);
2248
- }, u = function() {
2249
- return t.pop();
2250
- }, g = function() {
2251
- return n--;
2252
- }, m = function(S) {
2253
- if ("0" <= S && S <= "9") {
2254
- s(
2255
- "number"
2256
- /* NUMBER */
2257
- );
2258
- return;
2259
- }
2260
- switch (S) {
2261
- case '"':
2262
- s(
2263
- "string"
2264
- /* STRING */
2265
- );
2266
- return;
2267
- case "-":
2268
- s(
2269
- "numberNeedsDigit"
2270
- /* NUMBER_NEEDS_DIGIT */
2271
- );
2272
- return;
2273
- case "t":
2274
- s(
2275
- "true"
2276
- /* TRUE */
2277
- );
2278
- return;
2279
- case "f":
2280
- s(
2281
- "false"
2282
- /* FALSE */
2283
- );
2284
- return;
2285
- case "n":
2286
- s(
2287
- "null"
2288
- /* NULL */
2289
- );
2290
- return;
2291
- case "[":
2292
- s(
2293
- "arrayNeedsValue"
2294
- /* ARRAY_NEEDS_VALUE */
2295
- );
2296
- return;
2297
- case "{":
2298
- s(
2299
- "objectNeedsKey"
2300
- /* OBJECT_NEEDS_KEY */
2301
- );
2302
- return;
2303
- }
2304
- }, h = e.length; n < h; n++) {
2305
- var f = e[n];
2306
- switch (t[t.length - 1]) {
2307
- case "topLevel":
2308
- m(f);
2309
- break;
2310
- case "string":
2311
- switch (f) {
2312
- case '"':
2313
- u();
2314
- break;
2315
- case "\\":
2316
- d(
2317
- "stringEscape"
2318
- /* STRING_ESCAPE */
2319
- ), s(
2320
- "stringEscaped"
2321
- /* STRING_ESCAPED */
2322
- );
2323
- break;
2324
- }
2325
- break;
2326
- case "stringEscaped":
2327
- f === "u" ? s(
2328
- "stringUnicode"
2329
- /* STRING_UNICODE */
2330
- ) : (o(
2331
- "stringEscape"
2332
- /* STRING_ESCAPE */
2333
- ), u());
2334
- break;
2335
- case "stringUnicode":
2336
- n - e.lastIndexOf("u", n) === 4 && (o(
2337
- "stringEscape"
2338
- /* STRING_ESCAPE */
2339
- ), u());
2340
- break;
2341
- case "number":
2342
- f === "." ? l(
2343
- "numberNeedsDigit"
2344
- /* NUMBER_NEEDS_DIGIT */
2345
- ) : f === "e" || f === "E" ? l(
2346
- "numberNeedsExponent"
2347
- /* NUMBER_NEEDS_EXPONENT */
2348
- ) : (f < "0" || f > "9") && (g(), u());
2349
- break;
2350
- case "numberNeedsDigit":
2351
- l(
2352
- "number"
2353
- /* NUMBER */
2354
- );
2355
- break;
2356
- case "numberNeedsExponent":
2357
- l(
2358
- f === "+" || f === "-" ? "numberNeedsDigit" : "number"
2359
- /* NUMBER_NEEDS_DIGIT */
2360
- );
2361
- break;
2362
- case "true":
2363
- case "false":
2364
- case "null":
2365
- (f < "a" || f > "z") && (g(), u());
2366
- break;
2367
- case "arrayNeedsValue":
2368
- f === "]" ? u() : Gt(f) || (o(
2369
- "collectionItem"
2370
- /* COLLECTION_ITEM */
2371
- ), l(
2372
- "arrayNeedsComma"
2373
- /* ARRAY_NEEDS_COMMA */
2374
- ), m(f));
2375
- break;
2376
- case "arrayNeedsComma":
2377
- f === "]" ? u() : f === "," && (d(
2378
- "collectionItem"
2379
- /* COLLECTION_ITEM */
2380
- ), l(
2381
- "arrayNeedsValue"
2382
- /* ARRAY_NEEDS_VALUE */
2383
- ));
2384
- break;
2385
- case "objectNeedsKey":
2386
- f === "}" ? u() : f === '"' && (d(
2387
- "collectionItem"
2388
- /* COLLECTION_ITEM */
2389
- ), l(
2390
- "objectNeedsColon"
2391
- /* OBJECT_NEEDS_COLON */
2392
- ), s(
2393
- "string"
2394
- /* STRING */
2395
- ));
2396
- break;
2397
- case "objectNeedsColon":
2398
- f === ":" && l(
2399
- "objectNeedsValue"
2400
- /* OBJECT_NEEDS_VALUE */
2401
- );
2402
- break;
2403
- case "objectNeedsValue":
2404
- Gt(f) || (o(
2405
- "collectionItem"
2406
- /* COLLECTION_ITEM */
2407
- ), l(
2408
- "objectNeedsComma"
2409
- /* OBJECT_NEEDS_COMMA */
2410
- ), m(f));
2411
- break;
2412
- case "objectNeedsComma":
2413
- f === "}" ? u() : f === "," && (d(
2414
- "collectionItem"
2415
- /* COLLECTION_ITEM */
2416
- ), l(
2417
- "objectNeedsKey"
2418
- /* OBJECT_NEEDS_KEY */
2419
- ));
2420
- break;
2421
- }
2422
- }
2423
- i != null && (t.length = i);
2424
- for (var N = [
2425
- r != null ? e.slice(0, r) : e
2426
- ], E = function(S) {
2427
- return N.push(S.slice(e.length - e.lastIndexOf(S[0])));
2428
- }, I = t.length - 1; I >= 0; I--)
2429
- switch (t[I]) {
2430
- case "string":
2431
- N.push('"');
2432
- break;
2433
- case "numberNeedsDigit":
2434
- case "numberNeedsExponent":
2435
- N.push("0");
2436
- break;
2437
- case "true":
2438
- E("true");
2439
- break;
2440
- case "false":
2441
- E("false");
2442
- break;
2443
- case "null":
2444
- E("null");
2445
- break;
2446
- case "arrayNeedsValue":
2447
- case "arrayNeedsComma":
2448
- N.push("]");
2449
- break;
2450
- case "objectNeedsKey":
2451
- case "objectNeedsColon":
2452
- case "objectNeedsValue":
2453
- case "objectNeedsComma":
2454
- N.push("}");
2455
- break;
2456
- }
2457
- return N.join("");
2458
- }
2459
- function wa(e) {
2460
- return e.filter((t) => !t.isAgentStateMessage());
2461
- }
2462
- function Sa(e) {
2463
- return e.map((t) => {
2464
- if (t.isTextMessage())
2465
- return {
2466
- id: t.id,
2467
- createdAt: t.createdAt,
2468
- textMessage: {
2469
- content: t.content,
2470
- role: t.role,
2471
- parentMessageId: t.parentMessageId
2472
- }
2473
- };
2474
- if (t.isActionExecutionMessage())
2475
- return {
2476
- id: t.id,
2477
- createdAt: t.createdAt,
2478
- actionExecutionMessage: {
2479
- name: t.name,
2480
- arguments: JSON.stringify(t.arguments),
2481
- parentMessageId: t.parentMessageId
2482
- }
2483
- };
2484
- if (t.isResultMessage())
2485
- return {
2486
- id: t.id,
2487
- createdAt: t.createdAt,
2488
- resultMessage: {
2489
- result: t.result,
2490
- actionExecutionId: t.actionExecutionId,
2491
- actionName: t.actionName
2492
- }
2493
- };
2494
- if (t.isAgentStateMessage())
2495
- return {
2496
- id: t.id,
2497
- createdAt: t.createdAt,
2498
- agentStateMessage: {
2499
- threadId: t.threadId,
2500
- role: t.role,
2501
- agentName: t.agentName,
2502
- nodeName: t.nodeName,
2503
- runId: t.runId,
2504
- active: t.active,
2505
- running: t.running,
2506
- state: JSON.stringify(t.state)
2507
- }
2508
- };
2509
- if (t.isImageMessage())
2510
- return {
2511
- id: t.id,
2512
- createdAt: t.createdAt,
2513
- imageMessage: {
2514
- format: t.format,
2515
- bytes: t.bytes,
2516
- role: t.role,
2517
- parentMessageId: t.parentMessageId
2518
- }
2519
- };
2520
- throw new Error("Unknown message type");
2521
- });
2522
- }
2523
- function Ea(e) {
2524
- return e.map((t) => {
2525
- if (t.__typename === "TextMessageOutput")
2526
- return new on({
2527
- id: t.id,
2528
- role: t.role,
2529
- content: t.content.join(""),
2530
- parentMessageId: t.parentMessageId,
2531
- createdAt: /* @__PURE__ */ new Date(),
2532
- status: t.status || {
2533
- code: "Pending"
2534
- /* Pending */
2535
- }
2536
- });
2537
- if (t.__typename === "ActionExecutionMessageOutput")
2538
- return new ln({
2539
- id: t.id,
2540
- name: t.name,
2541
- arguments: Di(t.arguments),
2542
- parentMessageId: t.parentMessageId,
2543
- createdAt: /* @__PURE__ */ new Date(),
2544
- status: t.status || {
2545
- code: "Pending"
2546
- /* Pending */
2547
- }
2548
- });
2549
- if (t.__typename === "ResultMessageOutput")
2550
- return new cn({
2551
- id: t.id,
2552
- result: t.result,
2553
- actionExecutionId: t.actionExecutionId,
2554
- actionName: t.actionName,
2555
- createdAt: /* @__PURE__ */ new Date(),
2556
- status: t.status || {
2557
- code: "Pending"
2558
- /* Pending */
2559
- }
2560
- });
2561
- if (t.__typename === "AgentStateMessageOutput")
2562
- return new dn({
2563
- id: t.id,
2564
- threadId: t.threadId,
2565
- role: t.role,
2566
- agentName: t.agentName,
2567
- nodeName: t.nodeName,
2568
- runId: t.runId,
2569
- active: t.active,
2570
- running: t.running,
2571
- state: $t(t.state, {}),
2572
- createdAt: /* @__PURE__ */ new Date()
2573
- });
2574
- if (t.__typename === "ImageMessageOutput")
2575
- return new un({
2576
- id: t.id,
2577
- format: t.format,
2578
- bytes: t.bytes,
2579
- role: t.role,
2580
- parentMessageId: t.parentMessageId,
2581
- createdAt: /* @__PURE__ */ new Date(),
2582
- status: t.status || {
2583
- code: "Pending"
2584
- /* Pending */
2585
- }
2586
- });
2587
- throw new Error("Unknown message type");
2588
- });
2589
- }
2590
- function Fi(e) {
2591
- const t = [];
2592
- for (const n of e)
2593
- "content" in n ? t.push(
2594
- new on({
2595
- id: n.id,
2596
- role: n.role,
2597
- content: n.content,
2598
- parentMessageId: n.parentMessageId,
2599
- createdAt: n.createdAt || /* @__PURE__ */ new Date(),
2600
- status: n.status || {
2601
- code: "Success"
2602
- /* Success */
2603
- }
2604
- })
2605
- ) : "arguments" in n ? t.push(
2606
- new ln({
2607
- id: n.id,
2608
- name: n.name,
2609
- arguments: n.arguments,
2610
- parentMessageId: n.parentMessageId,
2611
- createdAt: n.createdAt || /* @__PURE__ */ new Date(),
2612
- status: n.status || {
2613
- code: "Success"
2614
- /* Success */
2615
- }
2616
- })
2617
- ) : "result" in n ? t.push(
2618
- new cn({
2619
- id: n.id,
2620
- result: n.result,
2621
- actionExecutionId: n.actionExecutionId,
2622
- actionName: n.actionName,
2623
- createdAt: n.createdAt || /* @__PURE__ */ new Date(),
2624
- status: n.status || {
2625
- code: "Success"
2626
- /* Success */
2627
- }
2628
- })
2629
- ) : "state" in n ? t.push(
2630
- new dn({
2631
- id: n.id,
2632
- threadId: n.threadId,
2633
- role: n.role,
2634
- agentName: n.agentName,
2635
- nodeName: n.nodeName,
2636
- runId: n.runId,
2637
- active: n.active,
2638
- running: n.running,
2639
- state: n.state,
2640
- createdAt: n.createdAt || /* @__PURE__ */ new Date()
2641
- })
2642
- ) : "format" in n && "bytes" in n && t.push(
2643
- new un({
2644
- id: n.id,
2645
- format: n.format,
2646
- bytes: n.bytes,
2647
- role: n.role,
2648
- parentMessageId: n.parentMessageId,
2649
- createdAt: n.createdAt || /* @__PURE__ */ new Date(),
2650
- status: n.status || {
2651
- code: "Success"
2652
- /* Success */
2653
- }
2654
- })
2655
- );
2656
- return t;
2657
- }
2658
- function Di(e) {
2659
- try {
2660
- return e.length ? JSON.parse(Mi(e.join(""))) : {};
2661
- } catch {
2662
- return {};
2663
- }
2664
- }
2665
- var ji = Object.defineProperty, Li = Object.defineProperties, Pi = Object.getOwnPropertyDescriptors, ze = Object.getOwnPropertySymbols, Nn = Object.prototype.hasOwnProperty, An = Object.prototype.propertyIsEnumerable, Wt = (e, t, n) => t in e ? ji(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, D = (e, t) => {
2666
- for (var n in t || (t = {}))
2667
- Nn.call(t, n) && Wt(e, n, t[n]);
2668
- if (ze)
2669
- for (var n of ze(t))
2670
- An.call(t, n) && Wt(e, n, t[n]);
2671
- return e;
2672
- }, W = (e, t) => Li(e, Pi(t)), Bt = (e) => typeof e == "symbol" ? e : e + "", xe = (e, t) => {
2673
- var n = {};
2674
- for (var r in e)
2675
- Nn.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
2676
- if (e != null && ze)
2677
- for (var r of ze(e))
2678
- t.indexOf(r) < 0 && An.call(e, r) && (n[r] = e[r]);
2679
- return n;
2680
- }, _ = (e, t, n) => new Promise((r, i) => {
2681
- var a = (d) => {
2682
- try {
2683
- l(n.next(d));
2684
- } catch (o) {
2685
- i(o);
2686
- }
2687
- }, s = (d) => {
2688
- try {
2689
- l(n.throw(d));
2690
- } catch (o) {
2691
- i(o);
2692
- }
2693
- }, l = (d) => d.done ? r(d.value) : Promise.resolve(d.value).then(a, s);
2694
- l((n = n.apply(e, t)).next());
2695
- }), Ui = 1e3 * 60 * 5, Ki = class {
2696
- constructor() {
2697
- this.activeKey = null, this.intervalId = null, this.instanceCount = 0, this.lastResponse = null;
2698
- }
2699
- start(e, t) {
2700
- return _(this, null, function* () {
2701
- if (this.instanceCount++, this.activeKey === e)
2702
- return;
2703
- this.intervalId && clearInterval(this.intervalId);
2704
- const n = () => _(this, null, function* () {
2705
- try {
2706
- const i = yield fetch(`${rn}/ciu`, {
2707
- method: "GET",
2708
- headers: {
2709
- [an]: e
2710
- }
2711
- }).then((a) => a.json());
2712
- return this.lastResponse = i, t == null || t(i), i;
2713
- } catch {
2714
- return null;
2715
- }
2716
- }), r = yield n();
2717
- return this.intervalId = setInterval(n, Ui), this.activeKey = e, r;
2718
- });
2719
- }
2720
- getLastResponse() {
2721
- return this.lastResponse;
2722
- }
2723
- stop() {
2724
- this.instanceCount--, this.instanceCount === 0 && this.intervalId && (clearInterval(this.intervalId), this.intervalId = null, this.activeKey = null, this.lastResponse = null);
2725
- }
2726
- }, wn = Qt(void 0);
2727
- function zi(e) {
2728
- if (e.severity)
2729
- switch (e.severity) {
2730
- case te.CRITICAL:
2731
- return "critical";
2732
- case te.WARNING:
2733
- return "warning";
2734
- case te.INFO:
2735
- return "info";
2736
- default:
2737
- return "info";
2738
- }
2739
- const t = e.message.toLowerCase();
2740
- return t.includes("api key") || t.includes("401") || t.includes("unauthorized") || t.includes("authentication") || t.includes("incorrect api key") ? "critical" : "info";
2741
- }
2742
- function Vi(e) {
2743
- switch (e) {
2744
- case "critical":
2745
- return {
2746
- background: "#fee2e2",
2747
- border: "#dc2626",
2748
- text: "#7f1d1d",
2749
- icon: "#dc2626"
2750
- };
2751
- case "warning":
2752
- return {
2753
- background: "#fef3c7",
2754
- border: "#d97706",
2755
- text: "#78350f",
2756
- icon: "#d97706"
2757
- };
2758
- case "info":
2759
- return {
2760
- background: "#dbeafe",
2761
- border: "#2563eb",
2762
- text: "#1e3a8a",
2763
- icon: "#2563eb"
2764
- };
2765
- }
2766
- }
2767
- function Sn() {
2768
- const e = Ht(wn);
2769
- if (!e)
2770
- throw new Error("useToast must be used within a ToastProvider");
2771
- return e;
2772
- }
2773
- function Gi({
2774
- enabled: e,
2775
- children: t
2776
- }) {
2777
- const [n, r] = M([]), [i, a] = M(null), s = C((g) => {
2778
- r((m) => m.filter((h) => h.id !== g));
2779
- }, []), l = C(
2780
- (g) => {
2781
- var m;
2782
- if (!e)
2783
- return;
2784
- const h = (m = g.id) != null ? m : Math.random().toString(36).substring(2, 9);
2785
- r((f) => f.find((N) => N.id === h) ? f : [...f, W(D({}, g), { id: h })]), g.duration && setTimeout(() => {
2786
- s(h);
2787
- }, g.duration);
2788
- },
2789
- [e, s]
2790
- ), d = C(
2791
- (g) => {
2792
- !e && g !== null || a(g);
2793
- },
2794
- [e]
2795
- ), o = C((g) => {
2796
- console.warn("addGraphQLErrorsToast is deprecated. All errors now show as banners.");
2797
- }, []), u = {
2798
- toasts: n,
2799
- addToast: l,
2800
- addGraphQLErrorsToast: o,
2801
- removeToast: s,
2802
- enabled: e,
2803
- bannerError: i,
2804
- setBannerError: d
2805
- };
2806
- return /* @__PURE__ */ c.jsxs(wn.Provider, { value: u, children: [
2807
- i && (() => {
2808
- const g = zi(i), m = Vi(g);
2809
- return /* @__PURE__ */ c.jsx(
2810
- "div",
2811
- {
2812
- style: {
2813
- position: "fixed",
2814
- bottom: "20px",
2815
- left: "50%",
2816
- transform: "translateX(-50%)",
2817
- zIndex: 9999,
2818
- backgroundColor: m.background,
2819
- border: `1px solid ${m.border}`,
2820
- borderLeft: `4px solid ${m.border}`,
2821
- borderRadius: "8px",
2822
- padding: "12px 16px",
2823
- fontSize: "13px",
2824
- boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
2825
- backdropFilter: "blur(8px)",
2826
- maxWidth: "min(90vw, 700px)",
2827
- width: "100%",
2828
- boxSizing: "border-box",
2829
- overflow: "hidden"
2830
- },
2831
- children: /* @__PURE__ */ c.jsxs(
2832
- "div",
2833
- {
2834
- style: {
2835
- display: "flex",
2836
- justifyContent: "space-between",
2837
- alignItems: "center",
2838
- gap: "10px"
2839
- },
2840
- children: [
2841
- /* @__PURE__ */ c.jsxs(
2842
- "div",
2843
- {
2844
- style: {
2845
- display: "flex",
2846
- alignItems: "center",
2847
- gap: "8px",
2848
- flex: 1,
2849
- minWidth: 0
2850
- },
2851
- children: [
2852
- /* @__PURE__ */ c.jsx(
2853
- "div",
2854
- {
2855
- style: {
2856
- width: "12px",
2857
- height: "12px",
2858
- borderRadius: "50%",
2859
- backgroundColor: m.border,
2860
- flexShrink: 0
2861
- }
2862
- }
2863
- ),
2864
- /* @__PURE__ */ c.jsxs(
2865
- "div",
2866
- {
2867
- style: {
2868
- display: "flex",
2869
- alignItems: "center",
2870
- gap: "10px",
2871
- flex: 1,
2872
- minWidth: 0
2873
- },
2874
- children: [
2875
- /* @__PURE__ */ c.jsx(
2876
- "div",
2877
- {
2878
- style: {
2879
- color: m.text,
2880
- lineHeight: "1.4",
2881
- fontWeight: "400",
2882
- fontSize: "13px",
2883
- flex: 1,
2884
- wordBreak: "break-all",
2885
- overflowWrap: "break-word",
2886
- maxWidth: "550px",
2887
- overflow: "hidden",
2888
- display: "-webkit-box",
2889
- WebkitLineClamp: 10,
2890
- WebkitBoxOrient: "vertical"
2891
- },
2892
- children: (() => {
2893
- let h = i.message;
2894
- const f = h.match(/'message':\s*'([^']+)'/);
2895
- return f ? f[1] : (h = h.split(" - ")[0], h = h.split(": Error code")[0], h = h.replace(/:\s*\d{3}$/, ""), h = h.replace(/See more:.*$/g, ""), h = h.trim(), h || "Configuration error occurred.");
2896
- })()
2897
- }
2898
- ),
2899
- (() => {
2900
- const h = i.message, f = /\[([^\]]+)\]\(([^)]+)\)/g, N = /(https?:\/\/[^\s)]+)/g;
2901
- let E = null, I = "See More";
2902
- const S = f.exec(h);
2903
- if (S)
2904
- E = S[2], I = "See More";
2905
- else {
2906
- const R = N.exec(h);
2907
- R && (E = R[0].replace(/[.,;:'"]*$/, ""), I = "See More");
2908
- }
2909
- return E ? /* @__PURE__ */ c.jsx(
2910
- "button",
2911
- {
2912
- onClick: () => window.open(E, "_blank", "noopener,noreferrer"),
2913
- style: {
2914
- background: m.border,
2915
- color: "white",
2916
- border: "none",
2917
- borderRadius: "5px",
2918
- padding: "4px 10px",
2919
- fontSize: "11px",
2920
- fontWeight: "500",
2921
- cursor: "pointer",
2922
- transition: "all 0.2s ease",
2923
- flexShrink: 0
2924
- },
2925
- onMouseEnter: (R) => {
2926
- R.currentTarget.style.opacity = "0.9", R.currentTarget.style.transform = "translateY(-1px)";
2927
- },
2928
- onMouseLeave: (R) => {
2929
- R.currentTarget.style.opacity = "1", R.currentTarget.style.transform = "translateY(0)";
2930
- },
2931
- children: I
2932
- }
2933
- ) : null;
2934
- })()
2935
- ]
2936
- }
2937
- )
2938
- ]
2939
- }
2940
- ),
2941
- /* @__PURE__ */ c.jsx(
2942
- "button",
2943
- {
2944
- onClick: () => d(null),
2945
- style: {
2946
- background: "transparent",
2947
- border: "none",
2948
- color: m.text,
2949
- cursor: "pointer",
2950
- padding: "2px",
2951
- borderRadius: "3px",
2952
- fontSize: "14px",
2953
- lineHeight: "1",
2954
- opacity: 0.6,
2955
- transition: "all 0.2s ease",
2956
- flexShrink: 0
2957
- },
2958
- title: "Dismiss",
2959
- onMouseEnter: (h) => {
2960
- h.currentTarget.style.opacity = "1", h.currentTarget.style.background = "rgba(0, 0, 0, 0.05)";
2961
- },
2962
- onMouseLeave: (h) => {
2963
- h.currentTarget.style.opacity = "0.6", h.currentTarget.style.background = "transparent";
2964
- },
2965
- children: "×"
2966
- }
2967
- )
2968
- ]
2969
- }
2970
- )
2971
- }
2972
- );
2973
- })(),
2974
- t
2975
- ] });
2976
- }
2977
- function En({
2978
- severity: e = te.CRITICAL,
2979
- message: t = "",
2980
- onClose: n,
2981
- actions: r
2982
- }) {
2983
- if (!t || !e)
2984
- return null;
2985
- const a = {
2986
- [te.INFO]: {
2987
- bg: "#f8fafc",
2988
- border: "#e2e8f0",
2989
- text: "#475569",
2990
- accent: "#3b82f6"
2991
- },
2992
- [te.WARNING]: {
2993
- bg: "#fffbeb",
2994
- border: "#fbbf24",
2995
- text: "#92400e",
2996
- accent: "#f59e0b"
2997
- },
2998
- [te.CRITICAL]: {
2999
- bg: "#fef2f2",
3000
- border: "#fecaca",
3001
- text: "#dc2626",
3002
- accent: "#ef4444"
3003
- }
3004
- }[e];
3005
- return /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
3006
- /* @__PURE__ */ c.jsx("style", { children: `
3007
- @keyframes slideUp {
3008
- from { opacity: 0; transform: translateX(-50%) translateY(8px); }
3009
- to { opacity: 1; transform: translateX(-50%) translateY(0); }
3010
- }
3011
-
3012
- .usage-banner {
3013
- position: fixed;
3014
- bottom: 24px;
3015
- left: 50%;
3016
- transform: translateX(-50%);
3017
- width: min(600px, calc(100vw - 32px));
3018
- z-index: 10000;
3019
- animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
3020
- }
3021
-
3022
- .banner-content {
3023
- background: linear-gradient(135deg, ${a.bg} 0%, ${a.bg}f5 100%);
3024
- border: 1px solid ${a.border};
3025
- border-radius: 12px;
3026
- padding: 18px 20px;
3027
- box-shadow:
3028
- 0 4px 24px rgba(0, 0, 0, 0.08),
3029
- 0 2px 8px rgba(0, 0, 0, 0.04),
3030
- inset 0 1px 0 rgba(255, 255, 255, 0.7);
3031
- display: flex;
3032
- align-items: center;
3033
- gap: 16px;
3034
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
3035
- backdrop-filter: blur(12px);
3036
- position: relative;
3037
- overflow: hidden;
3038
- }
3039
-
3040
- .banner-content::before {
3041
- content: '';
3042
- position: absolute;
3043
- top: 0;
3044
- left: 0;
3045
- right: 0;
3046
- height: 1px;
3047
- background: linear-gradient(90deg, transparent, ${a.accent}40, transparent);
3048
- }
3049
-
3050
- .banner-message {
3051
- color: ${a.text};
3052
- font-size: 14px;
3053
- line-height: 1.5;
3054
- font-weight: 500;
3055
- flex: 1;
3056
- letter-spacing: -0.01em;
3057
- }
3058
-
3059
- .close-btn {
3060
- background: rgba(0, 0, 0, 0.05);
3061
- border: none;
3062
- color: ${a.text};
3063
- cursor: pointer;
3064
- padding: 0;
3065
- border-radius: 6px;
3066
- opacity: 0.6;
3067
- transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
3068
- font-size: 14px;
3069
- line-height: 1;
3070
- flex-shrink: 0;
3071
- width: 24px;
3072
- height: 24px;
3073
- display: flex;
3074
- align-items: center;
3075
- justify-content: center;
3076
- }
3077
-
3078
- .close-btn:hover {
3079
- opacity: 1;
3080
- background: rgba(0, 0, 0, 0.08);
3081
- transform: scale(1.05);
3082
- }
3083
-
3084
- .btn-primary {
3085
- background: linear-gradient(135deg, ${a.accent} 0%, ${a.accent}e6 100%);
3086
- color: white;
3087
- border: none;
3088
- border-radius: 8px;
3089
- padding: 10px 18px;
3090
- font-size: 13px;
3091
- font-weight: 600;
3092
- cursor: pointer;
3093
- transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
3094
- font-family: inherit;
3095
- flex-shrink: 0;
3096
- box-shadow:
3097
- 0 2px 8px ${a.accent}30,
3098
- inset 0 1px 0 rgba(255, 255, 255, 0.2);
3099
- letter-spacing: -0.01em;
3100
- }
3101
-
3102
- .btn-primary:hover {
3103
- transform: translateY(-1px) scale(1.02);
3104
- box-shadow:
3105
- 0 4px 12px ${a.accent}40,
3106
- inset 0 1px 0 rgba(255, 255, 255, 0.25);
3107
- }
3108
-
3109
- .btn-primary:active {
3110
- transform: translateY(0) scale(0.98);
3111
- transition: all 0.08s cubic-bezier(0.16, 1, 0.3, 1);
3112
- }
3113
-
3114
- @media (max-width: 640px) {
3115
- .usage-banner {
3116
- width: calc(100vw - 24px);
3117
- }
3118
-
3119
- .banner-content {
3120
- padding: 16px;
3121
- gap: 12px;
3122
- }
3123
-
3124
- .banner-message {
3125
- font-size: 13px;
3126
- line-height: 1.45;
3127
- }
3128
-
3129
- .btn-primary {
3130
- padding: 8px 14px;
3131
- font-size: 12px;
3132
- }
3133
-
3134
- .close-btn {
3135
- width: 22px;
3136
- height: 22px;
3137
- font-size: 12px;
3138
- }
3139
- }
3140
- ` }),
3141
- /* @__PURE__ */ c.jsx("div", { className: "usage-banner", children: /* @__PURE__ */ c.jsxs("div", { className: "banner-content", children: [
3142
- /* @__PURE__ */ c.jsx("div", { className: "banner-message", children: t }),
3143
- (r == null ? void 0 : r.primary) && /* @__PURE__ */ c.jsx("button", { className: "btn-primary", onClick: r.primary.onClick, children: r.primary.label }),
3144
- n && /* @__PURE__ */ c.jsx("button", { className: "close-btn", onClick: n, title: "Close", children: "×" })
3145
- ] }) })
3146
- ] });
3147
- }
3148
- var Cn = (e) => {
3149
- switch (e.code) {
3150
- case ne.MISSING_PUBLIC_API_KEY_ERROR:
3151
- return {
3152
- primary: {
3153
- label: "Show me how",
3154
- onClick: () => window.open(
3155
- "https://docs.copilotkit.ai/premium#how-do-i-get-access-to-premium-features",
3156
- "_blank",
3157
- "noopener,noreferrer"
3158
- )
3159
- }
3160
- };
3161
- case ne.UPGRADE_REQUIRED_ERROR:
3162
- return {
3163
- primary: {
3164
- label: "Upgrade",
3165
- onClick: () => window.open("https://cloud.copilotkit.ai", "_blank", "noopener,noreferrer")
3166
- }
3167
- };
3168
- default:
3169
- return;
3170
- }
3171
- }, qt = new Ki(), Wi = class extends we.Component {
3172
- constructor(e) {
3173
- super(e), this.state = {
3174
- hasError: !1
3175
- };
3176
- }
3177
- static getDerivedStateFromError(e) {
3178
- return { hasError: !0, error: e };
3179
- }
3180
- componentDidMount() {
3181
- this.props.publicApiKey && qt.start(this.props.publicApiKey, (e) => {
3182
- this.setState((t) => {
3183
- var n;
3184
- return (e == null ? void 0 : e.severity) !== ((n = t.status) == null ? void 0 : n.severity) ? { status: e ?? void 0 } : null;
3185
- });
3186
- });
3187
- }
3188
- componentWillUnmount() {
3189
- qt.stop();
3190
- }
3191
- componentDidCatch(e, t) {
3192
- console.error("CopilotKit Error:", e, t);
3193
- }
3194
- render() {
3195
- var e, t, n, r;
3196
- if (this.state.hasError) {
3197
- if (this.state.error instanceof P)
3198
- return /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
3199
- this.props.children,
3200
- this.props.showUsageBanner && /* @__PURE__ */ c.jsx(
3201
- En,
3202
- {
3203
- severity: (t = (e = this.state.status) == null ? void 0 : e.severity) != null ? t : this.state.error.severity,
3204
- message: (r = (n = this.state.status) == null ? void 0 : n.message) != null ? r : this.state.error.message,
3205
- actions: Cn(this.state.error)
3206
- }
3207
- )
3208
- ] });
3209
- throw this.state.error;
3210
- }
3211
- return this.props.children;
3212
- }
3213
- };
3214
- function Bi() {
3215
- return typeof window > "u" ? !1 : window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "0.0.0.0";
3216
- }
3217
- function se(e) {
3218
- return e !== void 0 ? e : Bi();
3219
- }
3220
- var On = {
3221
- actions: {},
3222
- setAction: () => {
3223
- },
3224
- removeAction: () => {
3225
- },
3226
- coAgentStateRenders: {},
3227
- setCoAgentStateRender: () => {
3228
- },
3229
- removeCoAgentStateRender: () => {
3230
- },
3231
- chatComponentsCache: { current: { actions: {}, coAgentStateRenders: {} } },
3232
- getContextString: (e, t) => re(),
3233
- addContext: () => "",
3234
- removeContext: () => {
3235
- },
3236
- getAllContext: () => [],
3237
- getFunctionCallHandler: () => re(),
3238
- isLoading: !1,
3239
- setIsLoading: () => re(),
3240
- chatInstructions: "",
3241
- setChatInstructions: () => re(),
3242
- additionalInstructions: [],
3243
- setAdditionalInstructions: () => re(),
3244
- getDocumentsContext: (e) => re(),
3245
- addDocumentContext: () => re(),
3246
- removeDocumentContext: () => {
3247
- },
3248
- runtimeClient: {},
3249
- copilotApiConfig: new class {
3250
- get chatApiEndpoint() {
3251
- throw new Error("Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!");
3252
- }
3253
- get headers() {
3254
- return {};
3255
- }
3256
- get body() {
3257
- return {};
3258
- }
3259
- }(),
3260
- chatSuggestionConfiguration: {},
3261
- addChatSuggestionConfiguration: () => {
3262
- },
3263
- removeChatSuggestionConfiguration: () => {
3264
- },
3265
- showDevConsole: !1,
3266
- coagentStates: {},
3267
- setCoagentStates: () => {
3268
- },
3269
- coagentStatesRef: { current: {} },
3270
- setCoagentStatesWithRef: () => {
3271
- },
3272
- agentSession: null,
3273
- setAgentSession: () => {
3274
- },
3275
- forwardedParameters: {},
3276
- agentLock: null,
3277
- threadId: "",
3278
- setThreadId: () => {
3279
- },
3280
- runId: null,
3281
- setRunId: () => {
3282
- },
3283
- chatAbortControllerRef: { current: null },
3284
- availableAgents: [],
3285
- extensions: {},
3286
- setExtensions: () => {
3287
- },
3288
- langGraphInterruptAction: null,
3289
- setLangGraphInterruptAction: () => null,
3290
- removeLangGraphInterruptAction: () => null,
3291
- onError: () => {
3292
- },
3293
- bannerError: null,
3294
- setBannerError: () => {
3295
- },
3296
- internalErrorHandlers: {},
3297
- setInternalErrorHandler: () => {
3298
- },
3299
- removeInternalErrorHandler: () => {
3300
- }
3301
- }, In = we.createContext(On);
3302
- function ft() {
3303
- const e = we.useContext(In);
3304
- if (e === On)
3305
- throw new Error("Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!");
3306
- return e;
3307
- }
3308
- function re(e) {
3309
- throw new Error("Remember to wrap your app in a `<CopilotKit> {...} </CopilotKit>` !!!");
3310
- }
3311
- var Rn = {
3312
- messages: [],
3313
- setMessages: () => [],
3314
- // suggestions state
3315
- suggestions: [],
3316
- setSuggestions: () => []
3317
- }, Tn = we.createContext(Rn);
3318
- function qi() {
3319
- const e = we.useContext(Tn);
3320
- if (e === Rn)
3321
- throw new Error(
3322
- "A messages consuming component was not wrapped with `<CopilotMessages> {...} </CopilotMessages>`"
3323
- );
3324
- return e;
3325
- }
3326
- var Mn = Qt(null);
3327
- function Yi() {
3328
- const e = Ht(Mn);
3329
- if (!e)
3330
- throw new Error("useMessagesTap must be used inside <MessagesTapProvider>");
3331
- return e;
3332
- }
3333
- function Qi({ children: e }) {
3334
- const t = K([]), n = K({
3335
- getMessagesFromTap: () => t.current,
3336
- updateTapMessages: (r) => {
3337
- t.current = r;
3338
- }
3339
- });
3340
- return /* @__PURE__ */ c.jsx(Mn.Provider, { value: n.current, children: e });
3341
- }
3342
- function Hi({ children: e }) {
3343
- const [t, n] = M([]), r = K(), i = K(), a = K(), { updateTapMessages: s } = Yi(), { threadId: l, agentSession: d, runtimeClient: o, showDevConsole: u, onError: g, copilotApiConfig: m } = ft(), { setBannerError: h } = Sn(), f = C(
3344
- (p, k) => _(this, null, function* () {
3345
- if (!(!g || !m.publicApiKey))
3346
- try {
3347
- const x = {
3348
- type: "error",
3349
- timestamp: Date.now(),
3350
- context: {
3351
- source: "ui",
3352
- request: {
3353
- operation: "loadAgentState",
3354
- url: m.chatApiEndpoint,
3355
- startTime: Date.now()
3356
- },
3357
- technical: {
3358
- environment: "browser",
3359
- userAgent: typeof navigator < "u" ? navigator.userAgent : void 0,
3360
- stackTrace: k instanceof Error ? k.stack : void 0
3361
- }
3362
- },
3363
- error: p
3364
- };
3365
- yield g(x);
3366
- } catch (x) {
3367
- console.error("Error in CopilotMessages onError handler:", x);
3368
- }
3369
- }),
3370
- [g, m.publicApiKey, m.chatApiEndpoint]
3371
- ), N = (p) => {
3372
- const k = p.extensions, x = k == null ? void 0 : k.originalError;
3373
- if (x != null && x.stack) {
3374
- if (x.stack.includes("CopilotApiDiscoveryError"))
3375
- return new be({ message: x.message });
3376
- if (x.stack.includes("CopilotKitRemoteEndpointDiscoveryError"))
3377
- return new ot({ message: x.message });
3378
- if (x.stack.includes("CopilotKitAgentDiscoveryError"))
3379
- return new tn({
3380
- agentName: "",
3381
- availableAgents: []
3382
- });
3383
- }
3384
- const T = (x == null ? void 0 : x.message) || p.message, F = k == null ? void 0 : k.code;
3385
- return F ? new P({ message: T, code: F }) : null;
3386
- }, E = C(
3387
- (p) => {
3388
- var k;
3389
- if ((k = p.graphQLErrors) != null && k.length) {
3390
- const x = p.graphQLErrors, T = (F) => {
3391
- const X = F.extensions, oe = X == null ? void 0 : X.visibility;
3392
- if (!se(u)) {
3393
- console.error("CopilotKit Error (hidden in production):", F.message);
3394
- return;
3395
- }
3396
- if (oe === st.SILENT) {
3397
- console.error("CopilotKit Silent Error:", F.message);
3398
- return;
3399
- }
3400
- const ge = N(F);
3401
- if (ge)
3402
- h(ge), f(ge, F);
3403
- else {
3404
- const Ce = new P({
3405
- message: F.message,
3406
- code: ne.UNKNOWN
3407
- });
3408
- h(Ce), f(Ce, F);
3409
- }
3410
- };
3411
- x.forEach(T);
3412
- } else if (!se(u))
3413
- console.error("CopilotKit Error (hidden in production):", p);
3414
- else {
3415
- const T = new P({
3416
- message: (p == null ? void 0 : p.message) || String(p),
3417
- code: ne.UNKNOWN
3418
- });
3419
- h(T), f(T, p);
3420
- }
3421
- },
3422
- [h, u, f]
3423
- );
3424
- H(() => {
3425
- if (!l || l === r.current || l === r.current && (d == null ? void 0 : d.agentName) === i.current)
3426
- return;
3427
- _(this, null, function* () {
3428
- var k, x, T;
3429
- if (!(d != null && d.agentName))
3430
- return;
3431
- const F = yield o.loadAgentState({
3432
- threadId: l,
3433
- agentName: d == null ? void 0 : d.agentName
3434
- });
3435
- if (F.error) {
3436
- r.current = l, i.current = d == null ? void 0 : d.agentName, E(F.error);
3437
- return;
3438
- }
3439
- const X = (x = (k = F.data) == null ? void 0 : k.loadAgentState) == null ? void 0 : x.messages;
3440
- if (X !== a.current && (T = F.data) != null && T.loadAgentState) {
3441
- a.current = X, r.current = l, i.current = d == null ? void 0 : d.agentName;
3442
- const oe = Fi(JSON.parse(X || "[]"));
3443
- n(oe);
3444
- }
3445
- });
3446
- }, [l, d == null ? void 0 : d.agentName]), H(() => {
3447
- s(t);
3448
- }, [t, s]);
3449
- const I = ie(() => e, [e]), [S, R] = M([]);
3450
- return /* @__PURE__ */ c.jsx(
3451
- Tn.Provider,
3452
- {
3453
- value: {
3454
- messages: t,
3455
- setMessages: n,
3456
- suggestions: S,
3457
- setSuggestions: R
3458
- },
3459
- children: I
3460
- }
3461
- );
3462
- }
3463
- var Xi = () => /* @__PURE__ */ c.jsx(
3464
- "svg",
3465
- {
3466
- width: "13.3967723px",
3467
- height: "12px",
3468
- viewBox: "0 0 13.3967723 12",
3469
- version: "1.1",
3470
- xmlns: "http://www.w3.org/2000/svg",
3471
- children: /* @__PURE__ */ c.jsx("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ c.jsx("g", { id: "exclamation-triangle", fill: "#CD2121", children: /* @__PURE__ */ c.jsx(
3472
- "path",
3473
- {
3474
- d: "M5.39935802,0.75 C5.97670802,-0.25 7.42007802,-0.25 7.99742802,0.75 L13.193588,9.75 C13.770888,10.75 13.049288,12 11.894588,12 L1.50223802,12 C0.34753802,12 -0.37414898,10.75 0.20319802,9.75 L5.39935802,0.75 Z M6.69838802,2.5 C7.11260802,2.5 7.44838802,2.83579 7.44838802,3.25 L7.44838802,6.25 C7.44838802,6.66421 7.11260802,7 6.69838802,7 C6.28417802,7 5.94838802,6.66421 5.94838802,6.25 L5.94838802,3.25 C5.94838802,2.83579 6.28417802,2.5 6.69838802,2.5 Z M6.69838802,10.5 C7.25067802,10.5 7.69838802,10.0523 7.69838802,9.5 C7.69838802,8.9477 7.25067802,8.5 6.69838802,8.5 C6.14610802,8.5 5.69838802,8.9477 5.69838802,9.5 C5.69838802,10.0523 6.14610802,10.5 6.69838802,10.5 Z",
3475
- id: "Shape"
3476
- }
3477
- ) }) })
3478
- }
3479
- ), Ji = () => /* @__PURE__ */ c.jsx(
3480
- "svg",
3481
- {
3482
- width: "14px",
3483
- height: "14px",
3484
- viewBox: "0 0 14 14",
3485
- version: "1.1",
3486
- xmlns: "http://www.w3.org/2000/svg",
3487
- children: /* @__PURE__ */ c.jsx("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ c.jsx("g", { id: "Group-2", transform: "translate(-118, 0)", fill: "#1BC030", fillRule: "nonzero", children: /* @__PURE__ */ c.jsx("g", { id: "Group", transform: "translate(118, 0)", children: /* @__PURE__ */ c.jsx(
3488
- "path",
3489
- {
3490
- d: "M0,7 C0,3.13384615 3.13384615,0 7,0 C10.8661538,0 14,3.13384615 14,7 C14,10.8661538 10.8661538,14 7,14 C3.13384615,14 0,10.8661538 0,7 Z M9.59179487,5.69764103 C9.70905818,5.54139023 9.73249341,5.33388318 9.65303227,5.15541491 C9.57357113,4.97694665 9.40367989,4.85551619 9.20909814,4.83811118 C9.01451638,4.82070616 8.82577109,4.91005717 8.71589744,5.07158974 L6.39261538,8.32389744 L5.22666667,7.15794872 C5.01450582,6.96025518 4.68389046,6.9660885 4.47883563,7.17114332 C4.27378081,7.37619815 4.26794748,7.70681351 4.46564103,7.91897436 L6.08102564,9.53435897 C6.19289944,9.64614839 6.3482622,9.70310251 6.50588106,9.69010587 C6.66349993,9.67710922 6.80743532,9.59547613 6.89948718,9.46687179 L9.59179487,5.69764103 L9.59179487,5.69764103 Z",
3491
- id: "Shape"
3492
- }
3493
- ) }) }) })
3494
- }
3495
- ), Fn = () => /* @__PURE__ */ c.jsxs(
3496
- "svg",
3497
- {
3498
- width: "33px",
3499
- height: "35px",
3500
- viewBox: "0 0 33 35",
3501
- version: "1.1",
3502
- xmlns: "http://www.w3.org/2000/svg",
3503
- children: [
3504
- /* @__PURE__ */ c.jsx("title", { children: "bd5c9079-929b-4d55-bdc9-16d1c8181b71" }),
3505
- /* @__PURE__ */ c.jsx("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ c.jsx(
3506
- "image",
3507
- {
3508
- x: "0",
3509
- y: "0",
3510
- width: "33",
3511
- height: "35",
3512
- xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI0AAACXCAYAAAAoE9hYAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAjaADAAQAAAABAAAAlwAAAACI8Oz3AABAAElEQVR4Ae2dCYAlVXnvv6q79d7TMz37sIMgKKBCkLhkSKK4xJUMQVzAqJBgNDGJa2LsvJfERI0aiEbwRXnoQ2VYRASiQUFRUGQm7DAwzDBbT+/rvbfvXu/3P1V1+84CzEw3MNPD6a579nOqzvev73znO0t59rzZbQu88sXndp2w4gVLp5oG+6+47ivDu010kAb6B+lzP+Vjr1zZk0xV/ddMVIufap/34g+e+s9rX9351U1dT5npIIpMHkTPusePmto+tKhctVWPDW1/c27hIVNbCsFbCpa7/aR/f/SWFV2ZX974zsNG97iwOZjwedDshqiZlL3AD9JH9Y8PpTYMPJEuLj7+pclE5vBquXZ6MV/56Zu/ueGnmWpqzer3HzKym+xzPsib80+4lw/Y09Pjr7lm9GO+eR+eKI4tXdeRsomXv8a6Dj3eqn6iRoPl5qW83o60vyaT9O5IWPX2llrH+hsuXJbfy6oO2OTPg2Yn0p1/6ueWFK1wWTKReo1XDZoeqw7YxhcfYfNf9NtWSHTYVLVqxSAIqoFlU76NzEt6mzqSCQBkt3up1NrlHUdsXX22V92p2DnlfR40O5Az8N57+pfPgcv8YzLZdHjKS3i9uS1254Kitf3271qq81ATGkq1wPJCDVexEtS8oFZKpBLZeWl/w7yE98uUZ3cnLPhNefSFmx7s8Uo7VDEHPM+DpoGI71v5xaODkn02kUi9Ne03Jz3Ps2Jh3O4ubbCB006yzqNPsYrfYhbUrBwEBnZstBLYBFIzSDIXQB5LeOY3JXoXJv3/afP9H9dqdtv8XHb9mp5T5kQX9rwg3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GquojrcUZMn2DJ5m1veMMM3/KnuveP3NFsXvIsVNt/AWc5CSaw49RGSGA0mN7lVit8ybqXj1jP4XCdPRg2inW/7fJOa2mSJvrz3Abdrti2jNb7Bg/TU33VxgevsJs/PDNOFhb6zPyKC6WGOmy82MX9L4GrMAXCbLXnw4+10L06yJqu7XbaSPbZmPB1oIm6pPl0Q1oUrp0EnAjpfxXAXApgJp6Zlmgotae3xUa2vQau8nc0AtsumIPZnfGC/7IqK+iK5TtQyo3YpS/TScsRW9opg5YYlO5fYKX0ByjzgwBEanUSOTEui2MDjf0vlrLr7VvvmRUBcac7mLNeBxqNlADJmTzlPwMYzXlcgv8yttBufdaeXBynhsIt8OEK3qupVyOcpnr9Dhruh1EOKnjztT2Ds1ja+q0yPm5fOp2uCwD1MKzesLnTyv6plHUuwDiH8FAu0CIoC6SFvZH837ar3ill4+5BV6/4ecfOLeBAw/HyryLiMwDmFdg3Min5aTS+Tz9zvXNps+H/s18fwQ7FcwDOayDosXAHWLIH54l0Nlrn4oRkLR1g9BX4t8I81iAbPW5VvgE5NbyMyf8zzKsySnL5NXMspd0w9v3cIvM+CMSr39s3G7d7MJbhwWUWIrt8hYeXAu9ndFGfZ2j9C8Lizv/Zb5ce5qEm7j2cibbT6cN/i+7qOMAxDzejA38hdiu6CKYDYBLVWolRQh9bMzZYOcdHtQqHErYEQHEmqgMWk3TeFgDzU5jKf9v3znv02X+guVVjEsFXH+A6kcdaD1Aub29v//VzChi1b49X4vdRhLr11vsHN1pz7Qj8bDKrLULpdyJzKocw1OwCKBm2zYKPCh1PiQ87sujILdnw1gKQrQiMDNmTj5nP0P2F714fHlStCp43M2kBT2t9EXjfBlBydEu37Pfn+J7/zXkIt50IxO3oK1rgKgEaU5YYAJhaUOCLawjufOW8i0Pnlm1/bo/7mAll9uO8/x9teQya14m6TgAAAABJRU5ErkJggg=="
3513
- }
3514
- ) })
3515
- ]
3516
- }
3517
- );
3518
- function Zi({ isOpen: e, onClose: t, hasApiKey: n }) {
3519
- const r = ft(), i = qi(), [a, s] = M("actions");
3520
- if (H(() => {
3521
- const o = (u) => {
3522
- u.key === "Escape" && t();
3523
- };
3524
- return e && (document.addEventListener("keydown", o), document.body.style.overflow = "hidden"), () => {
3525
- document.removeEventListener("keydown", o), document.body.style.overflow = "unset";
3526
- };
3527
- }, [e, t]), !e)
3528
- return null;
3529
- const l = n ? r : {
3530
- actions: {
3531
- search_web: { name: "search_web", description: "Search the web for information" },
3532
- send_email: { name: "send_email", description: "Send an email to a contact" },
3533
- create_document: { name: "create_document", description: "Create a new document" },
3534
- analyze_code: {
3535
- name: "analyze_code",
3536
- description: "Analyze code for issues and improvements"
3537
- },
3538
- generate_tests: {
3539
- name: "generate_tests",
3540
- description: "Generate unit tests for functions"
3541
- }
3542
- },
3543
- getAllContext: () => [
3544
- {
3545
- content: "User preferences: dark mode enabled, TypeScript preferred",
3546
- metadata: { source: "settings" }
3547
- },
3548
- {
3549
- content: "Current project: Building a React application with CopilotKit",
3550
- metadata: { source: "project" }
3551
- },
3552
- {
3553
- content: "Recent activity: Implemented authentication system",
3554
- metadata: { source: "activity" }
3555
- },
3556
- {
3557
- content: "Development environment: VS Code, Node.js 18, React 18",
3558
- metadata: { source: "environment" }
3559
- }
3560
- ],
3561
- coagentStates: {
3562
- "main-agent": { status: "active", lastUpdate: Date.now() },
3563
- "code-assistant": { status: "active", lastUpdate: Date.now() - 15e3 },
3564
- "search-agent": { status: "idle", lastUpdate: Date.now() - 6e4 }
3565
- },
3566
- getDocumentsContext: () => [
3567
- {
3568
- content: "README.md: Project setup and installation instructions",
3569
- metadata: { type: "documentation" }
3570
- },
3571
- {
3572
- content: "API Documentation: CopilotKit integration guide",
3573
- metadata: { type: "documentation" }
3574
- },
3575
- {
3576
- content: "package.json: Project dependencies and scripts",
3577
- metadata: { type: "configuration" }
3578
- }
3579
- ]
3580
- }, d = n ? i : {
3581
- messages: [
3582
- {
3583
- id: "1",
3584
- role: "user",
3585
- content: "Help me implement a todo list with drag and drop functionality"
3586
- },
3587
- {
3588
- id: "2",
3589
- role: "assistant",
3590
- content: "I'll help you create a todo list with drag and drop. Let me start by setting up the basic components and then add the drag and drop functionality using React DnD."
3591
- },
3592
- { id: "3", role: "user", content: "Can you also add priority levels and due dates?" },
3593
- {
3594
- id: "4",
3595
- role: "assistant",
3596
- content: "Absolutely! I'll enhance the todo items with priority levels (high, medium, low) and due date functionality. This will make your todo list much more powerful for task management."
3597
- },
3598
- { id: "5", role: "user", content: "Perfect! How about adding categories or tags?" }
3599
- ]
3600
- };
3601
- return /* @__PURE__ */ c.jsx(
3602
- "div",
3603
- {
3604
- style: {
3605
- position: "fixed",
3606
- top: 0,
3607
- left: 0,
3608
- right: 0,
3609
- bottom: 0,
3610
- zIndex: 9999,
3611
- backgroundColor: "rgba(0, 0, 0, 0.3)",
3612
- display: "flex",
3613
- alignItems: "center",
3614
- justifyContent: "center",
3615
- padding: "16px"
3616
- },
3617
- onClick: t,
3618
- children: /* @__PURE__ */ c.jsxs(
3619
- "div",
3620
- {
3621
- style: {
3622
- width: "1152px",
3623
- maxWidth: "95vw",
3624
- height: "80vh",
3625
- backgroundColor: "white",
3626
- borderRadius: "12px",
3627
- boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
3628
- display: "flex",
3629
- flexDirection: "column",
3630
- overflow: "hidden",
3631
- position: "relative"
3632
- },
3633
- onClick: (o) => o.stopPropagation(),
3634
- children: [
3635
- /* @__PURE__ */ c.jsxs(
3636
- "div",
3637
- {
3638
- style: {
3639
- display: "flex",
3640
- alignItems: "center",
3641
- justifyContent: "space-between",
3642
- padding: "24px",
3643
- borderBottom: "1px solid #e5e7eb",
3644
- minHeight: "73px",
3645
- flexShrink: 0,
3646
- filter: n ? "none" : "blur(0.3px)",
3647
- opacity: n ? 1 : 0.95
3648
- },
3649
- children: [
3650
- /* @__PURE__ */ c.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
3651
- /* @__PURE__ */ c.jsx(Fn, {}),
3652
- /* @__PURE__ */ c.jsx(
3653
- "h1",
3654
- {
3655
- style: {
3656
- fontWeight: "bold",
3657
- fontSize: "20px",
3658
- color: "#1f2937",
3659
- margin: 0
3660
- },
3661
- children: "Inspector"
3662
- }
3663
- ),
3664
- /* @__PURE__ */ c.jsxs(
3665
- "span",
3666
- {
3667
- style: {
3668
- fontSize: "14px",
3669
- color: "#6b7280",
3670
- backgroundColor: "#f3f4f6",
3671
- padding: "4px 8px",
3672
- borderRadius: "4px"
3673
- },
3674
- children: [
3675
- "v",
3676
- he
3677
- ]
3678
- }
3679
- )
3680
- ] }),
3681
- /* @__PURE__ */ c.jsx(
3682
- "button",
3683
- {
3684
- onClick: t,
3685
- style: {
3686
- color: "#9ca3af",
3687
- fontSize: "24px",
3688
- fontWeight: "300",
3689
- border: "none",
3690
- background: "none",
3691
- cursor: "pointer",
3692
- padding: "4px"
3693
- },
3694
- onMouseEnter: (o) => o.currentTarget.style.color = "#4b5563",
3695
- onMouseLeave: (o) => o.currentTarget.style.color = "#9ca3af",
3696
- children: "×"
3697
- }
3698
- )
3699
- ]
3700
- }
3701
- ),
3702
- /* @__PURE__ */ c.jsx(
3703
- "div",
3704
- {
3705
- style: {
3706
- display: "flex",
3707
- borderBottom: "1px solid #e5e7eb",
3708
- backgroundColor: "#f9fafb",
3709
- minHeight: "50px",
3710
- flexShrink: 0,
3711
- filter: n ? "none" : "blur(0.3px)",
3712
- opacity: n ? 1 : 0.9
3713
- },
3714
- children: [
3715
- { id: "actions", label: "Actions", count: Object.keys(l.actions).length },
3716
- { id: "readables", label: "Readables", count: l.getAllContext().length },
3717
- {
3718
- id: "agent",
3719
- label: "Agent Status",
3720
- count: Object.keys(l.coagentStates).length
3721
- },
3722
- { id: "messages", label: "Messages", count: d.messages.length },
3723
- {
3724
- id: "context",
3725
- label: "Context",
3726
- count: l.getDocumentsContext([]).length
3727
- }
3728
- ].map((o) => /* @__PURE__ */ c.jsxs(
3729
- "button",
3730
- {
3731
- onClick: () => s(o.id),
3732
- style: {
3733
- padding: "12px 24px",
3734
- fontSize: "14px",
3735
- fontWeight: "500",
3736
- border: "none",
3737
- cursor: "pointer",
3738
- backgroundColor: a === o.id ? "white" : "transparent",
3739
- color: a === o.id ? "#2563eb" : "#6b7280",
3740
- borderBottom: a === o.id ? "2px solid #2563eb" : "none",
3741
- transition: "all 0.2s"
3742
- },
3743
- onMouseEnter: (u) => {
3744
- a !== o.id && (u.currentTarget.style.color = "#1f2937", u.currentTarget.style.backgroundColor = "#f3f4f6");
3745
- },
3746
- onMouseLeave: (u) => {
3747
- a !== o.id && (u.currentTarget.style.color = "#6b7280", u.currentTarget.style.backgroundColor = "transparent");
3748
- },
3749
- children: [
3750
- o.label,
3751
- o.count > 0 && /* @__PURE__ */ c.jsx(
3752
- "span",
3753
- {
3754
- style: {
3755
- marginLeft: "8px",
3756
- backgroundColor: "#e5e7eb",
3757
- color: "#374151",
3758
- padding: "2px 8px",
3759
- borderRadius: "9999px",
3760
- fontSize: "12px"
3761
- },
3762
- children: o.count
3763
- }
3764
- )
3765
- ]
3766
- },
3767
- o.id
3768
- ))
3769
- }
3770
- ),
3771
- /* @__PURE__ */ c.jsxs(
3772
- "div",
3773
- {
3774
- style: {
3775
- height: "calc(100% - 142px)",
3776
- overflow: "auto",
3777
- padding: "24px",
3778
- backgroundColor: "#f9fafb",
3779
- filter: n ? "none" : "blur(0.3px)",
3780
- opacity: n ? 1 : 0.85
3781
- },
3782
- children: [
3783
- a === "actions" && /* @__PURE__ */ c.jsx(_i, { context: l }),
3784
- a === "readables" && /* @__PURE__ */ c.jsx($i, { context: l }),
3785
- a === "agent" && /* @__PURE__ */ c.jsx(ea, { context: l }),
3786
- a === "messages" && /* @__PURE__ */ c.jsx(ta, { messagesContext: d }),
3787
- a === "context" && /* @__PURE__ */ c.jsx(na, { context: l })
3788
- ]
3789
- }
3790
- ),
3791
- /* @__PURE__ */ c.jsxs(
3792
- "div",
3793
- {
3794
- style: {
3795
- padding: "16px 24px",
3796
- borderTop: "1px solid #e5e7eb",
3797
- backgroundColor: "white",
3798
- display: "flex",
3799
- justifyContent: "space-between",
3800
- alignItems: "center",
3801
- minHeight: "57px",
3802
- flexShrink: 0,
3803
- filter: n ? "none" : "blur(0.3px)",
3804
- opacity: n ? 1 : 0.9
3805
- },
3806
- children: [
3807
- /* @__PURE__ */ c.jsx("div", { style: { fontSize: "14px", color: "#6b7280" }, children: /* @__PURE__ */ c.jsx(
3808
- "a",
3809
- {
3810
- href: "https://github.com/CopilotKit/CopilotKit/issues",
3811
- target: "_blank",
3812
- rel: "noopener noreferrer",
3813
- style: { color: "#2563eb", textDecoration: "none" },
3814
- onMouseEnter: (o) => o.currentTarget.style.textDecoration = "underline",
3815
- onMouseLeave: (o) => o.currentTarget.style.textDecoration = "none",
3816
- children: "Report an issue"
3817
- }
3818
- ) }),
3819
- /* @__PURE__ */ c.jsx("div", { style: { fontSize: "14px", color: "#6b7280" }, children: /* @__PURE__ */ c.jsx(
3820
- "a",
3821
- {
3822
- href: "https://mcp.copilotkit.ai/",
3823
- target: "_blank",
3824
- rel: "noopener noreferrer",
3825
- style: { color: "#2563eb", textDecoration: "none" },
3826
- onMouseEnter: (o) => o.currentTarget.style.textDecoration = "underline",
3827
- onMouseLeave: (o) => o.currentTarget.style.textDecoration = "none",
3828
- children: "Add MCP Server →"
3829
- }
3830
- ) })
3831
- ]
3832
- }
3833
- ),
3834
- !n && /* @__PURE__ */ c.jsx(
3835
- "div",
3836
- {
3837
- style: {
3838
- position: "absolute",
3839
- top: 0,
3840
- left: 0,
3841
- right: 0,
3842
- bottom: 0,
3843
- backgroundColor: "rgba(255, 255, 255, 0.2)",
3844
- backdropFilter: "blur(2px)",
3845
- WebkitBackdropFilter: "blur(2px)",
3846
- display: "flex",
3847
- alignItems: "center",
3848
- justifyContent: "center",
3849
- borderRadius: "12px",
3850
- zIndex: 10
3851
- },
3852
- onClick: (o) => o.stopPropagation(),
3853
- children: /* @__PURE__ */ c.jsxs(
3854
- "button",
3855
- {
3856
- onClick: () => window.open("https://cloud.copilotkit.ai/sign-in", "_blank"),
3857
- style: {
3858
- // Following button system specifications
3859
- height: "48px",
3860
- padding: "12px 24px",
3861
- backgroundColor: "#030507",
3862
- // textPrimary token
3863
- color: "#FFFFFF",
3864
- borderRadius: "12px",
3865
- // Medium radius token
3866
- border: "none",
3867
- cursor: "pointer",
3868
- fontSize: "14px",
3869
- // Medium Semi Bold typography
3870
- fontWeight: "600",
3871
- fontFamily: "'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif",
3872
- lineHeight: "22px",
3873
- boxShadow: "0 4px 16px rgba(3, 5, 7, 0.2), 0 1px 3px rgba(3, 5, 7, 0.1)",
3874
- transition: "all 200ms ease",
3875
- // 200ms ease as per specs
3876
- display: "inline-flex",
3877
- alignItems: "center",
3878
- gap: "8px",
3879
- textTransform: "uppercase",
3880
- letterSpacing: "0.5px"
3881
- },
3882
- onMouseEnter: (o) => {
3883
- o.currentTarget.style.backgroundColor = "#575758", o.currentTarget.style.transform = "translateY(-1px)", o.currentTarget.style.boxShadow = "0 6px 20px rgba(3, 5, 7, 0.25), 0 2px 4px rgba(3, 5, 7, 0.15)";
3884
- },
3885
- onMouseLeave: (o) => {
3886
- o.currentTarget.style.backgroundColor = "#030507", o.currentTarget.style.transform = "translateY(0)", o.currentTarget.style.boxShadow = "0 4px 16px rgba(3, 5, 7, 0.2), 0 1px 3px rgba(3, 5, 7, 0.1)";
3887
- },
3888
- onMouseDown: (o) => {
3889
- o.currentTarget.style.backgroundColor = "#858589", o.currentTarget.style.transform = "translateY(0)";
3890
- },
3891
- onMouseUp: (o) => {
3892
- o.currentTarget.style.backgroundColor = "#575758", o.currentTarget.style.transform = "translateY(-1px)";
3893
- },
3894
- onFocus: (o) => {
3895
- o.currentTarget.style.outline = "2px solid #BEC9FF", o.currentTarget.style.outlineOffset = "2px";
3896
- },
3897
- onBlur: (o) => {
3898
- o.currentTarget.style.outline = "none";
3899
- },
3900
- children: [
3901
- "Get License Key",
3902
- /* @__PURE__ */ c.jsx("span", { style: { fontSize: "16px", marginLeft: "-4px" }, children: "→" })
3903
- ]
3904
- }
3905
- )
3906
- }
3907
- )
3908
- ]
3909
- }
3910
- )
3911
- }
3912
- );
3913
- }
3914
- function _i({ context: e }) {
3915
- const t = Object.values(e.actions);
3916
- return t.length === 0 ? /* @__PURE__ */ c.jsxs("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
3917
- /* @__PURE__ */ c.jsx("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No actions available" }),
3918
- /* @__PURE__ */ c.jsx("p", { style: { fontSize: "14px", margin: 0 }, children: "Actions will appear here when registered" })
3919
- ] }) : /* @__PURE__ */ c.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: t.map((n, r) => /* @__PURE__ */ c.jsx(
3920
- "div",
3921
- {
3922
- style: {
3923
- backgroundColor: "white",
3924
- padding: "16px",
3925
- borderRadius: "8px",
3926
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
3927
- border: "1px solid #e5e7eb"
3928
- },
3929
- children: /* @__PURE__ */ c.jsxs(
3930
- "div",
3931
- {
3932
- style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" },
3933
- children: [
3934
- /* @__PURE__ */ c.jsxs("div", { style: { flex: 1 }, children: [
3935
- /* @__PURE__ */ c.jsx("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 4px 0" }, children: n.name }),
3936
- n.description && /* @__PURE__ */ c.jsx("p", { style: { fontSize: "14px", color: "#4b5563", margin: "0 0 12px 0" }, children: n.description }),
3937
- n.parameters && n.parameters.length > 0 && /* @__PURE__ */ c.jsxs("div", { style: { marginTop: "12px" }, children: [
3938
- /* @__PURE__ */ c.jsx(
3939
- "p",
3940
- {
3941
- style: {
3942
- fontSize: "12px",
3943
- fontWeight: "500",
3944
- color: "#6b7280",
3945
- textTransform: "uppercase",
3946
- margin: "0 0 4px 0"
3947
- },
3948
- children: "Parameters:"
3949
- }
3950
- ),
3951
- /* @__PURE__ */ c.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: n.parameters.map((i, a) => /* @__PURE__ */ c.jsxs("div", { style: { fontSize: "14px" }, children: [
3952
- /* @__PURE__ */ c.jsx("span", { style: { fontFamily: "monospace", color: "#374151" }, children: i.name }),
3953
- i.required && /* @__PURE__ */ c.jsx("span", { style: { marginLeft: "4px", fontSize: "12px", color: "#ef4444" }, children: "*required" }),
3954
- i.type && /* @__PURE__ */ c.jsxs("span", { style: { marginLeft: "8px", fontSize: "12px", color: "#6b7280" }, children: [
3955
- "(",
3956
- i.type,
3957
- ")"
3958
- ] })
3959
- ] }, a)) })
3960
- ] })
3961
- ] }),
3962
- /* @__PURE__ */ c.jsx("div", { style: { marginLeft: "16px" }, children: n.status === "available" ? /* @__PURE__ */ c.jsx(Ji, {}) : /* @__PURE__ */ c.jsx(Xi, {}) })
3963
- ]
3964
- }
3965
- )
3966
- },
3967
- r
3968
- )) });
3969
- }
3970
- function $i({ context: e }) {
3971
- const t = e.getAllContext();
3972
- return t.length === 0 ? /* @__PURE__ */ c.jsxs("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
3973
- /* @__PURE__ */ c.jsx("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No readable context available" }),
3974
- /* @__PURE__ */ c.jsx("p", { style: { fontSize: "14px", margin: 0 }, children: "Readable context will appear here when provided" })
3975
- ] }) : /* @__PURE__ */ c.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: t.map((n, r) => /* @__PURE__ */ c.jsx(
3976
- "div",
3977
- {
3978
- style: {
3979
- backgroundColor: "white",
3980
- padding: "16px",
3981
- borderRadius: "8px",
3982
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
3983
- border: "1px solid #e5e7eb"
3984
- },
3985
- children: /* @__PURE__ */ c.jsx(
3986
- "div",
3987
- {
3988
- style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" },
3989
- children: /* @__PURE__ */ c.jsxs("div", { style: { flex: 1 }, children: [
3990
- /* @__PURE__ */ c.jsx("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 4px 0" }, children: n.name || `Readable ${r + 1}` }),
3991
- n.description && /* @__PURE__ */ c.jsx("p", { style: { fontSize: "14px", color: "#4b5563", margin: "0 0 12px 0" }, children: n.description }),
3992
- n.value && /* @__PURE__ */ c.jsx(
3993
- "pre",
3994
- {
3995
- style: {
3996
- marginTop: "12px",
3997
- padding: "8px",
3998
- backgroundColor: "#f9fafb",
3999
- borderRadius: "4px",
4000
- fontSize: "12px",
4001
- overflowX: "auto",
4002
- margin: "12px 0 0 0"
4003
- },
4004
- children: JSON.stringify(n.value, null, 2)
4005
- }
4006
- )
4007
- ] })
4008
- }
4009
- )
4010
- },
4011
- r
4012
- )) });
4013
- }
4014
- function ea({ context: e }) {
4015
- const t = e.coagentStates || {}, n = Object.entries(t);
4016
- return n.length === 0 ? /* @__PURE__ */ c.jsxs("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
4017
- /* @__PURE__ */ c.jsx("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No agent states available" }),
4018
- /* @__PURE__ */ c.jsx("p", { style: { fontSize: "14px", margin: 0 }, children: "Agent states will appear here when agents are active" })
4019
- ] }) : /* @__PURE__ */ c.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: n.map(([r, i]) => /* @__PURE__ */ c.jsxs(
4020
- "div",
4021
- {
4022
- style: {
4023
- backgroundColor: "white",
4024
- padding: "24px",
4025
- borderRadius: "8px",
4026
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
4027
- border: "1px solid #e5e7eb"
4028
- },
4029
- children: [
4030
- /* @__PURE__ */ c.jsxs(
4031
- "div",
4032
- {
4033
- style: {
4034
- display: "flex",
4035
- alignItems: "center",
4036
- justifyContent: "space-between",
4037
- marginBottom: "16px"
4038
- },
4039
- children: [
4040
- /* @__PURE__ */ c.jsx("h3", { style: { fontWeight: "600", fontSize: "18px", color: "#1f2937", margin: 0 }, children: r }),
4041
- /* @__PURE__ */ c.jsx(
4042
- "span",
4043
- {
4044
- style: {
4045
- padding: "4px 12px",
4046
- borderRadius: "9999px",
4047
- fontSize: "12px",
4048
- fontWeight: "500",
4049
- backgroundColor: i.status === "running" ? "#dcfce7" : i.status === "complete" ? "#dbeafe" : "#f3f4f6",
4050
- color: i.status === "running" ? "#166534" : i.status === "complete" ? "#1e40af" : "#1f2937"
4051
- },
4052
- children: i.status || "idle"
4053
- }
4054
- )
4055
- ]
4056
- }
4057
- ),
4058
- i.state && /* @__PURE__ */ c.jsxs("div", { style: { marginBottom: "12px" }, children: [
4059
- /* @__PURE__ */ c.jsx(
4060
- "p",
4061
- {
4062
- style: {
4063
- fontSize: "12px",
4064
- fontWeight: "500",
4065
- color: "#6b7280",
4066
- textTransform: "uppercase",
4067
- margin: "0 0 4px 0"
4068
- },
4069
- children: "Current State:"
4070
- }
4071
- ),
4072
- /* @__PURE__ */ c.jsx(
4073
- "pre",
4074
- {
4075
- style: {
4076
- padding: "12px",
4077
- backgroundColor: "#f9fafb",
4078
- borderRadius: "4px",
4079
- fontSize: "12px",
4080
- overflowX: "auto",
4081
- margin: 0
4082
- },
4083
- children: JSON.stringify(i.state, null, 2)
4084
- }
4085
- )
4086
- ] }),
4087
- i.running && /* @__PURE__ */ c.jsxs(
4088
- "div",
4089
- {
4090
- style: {
4091
- marginTop: "16px",
4092
- display: "flex",
4093
- alignItems: "center",
4094
- fontSize: "14px",
4095
- color: "#4b5563"
4096
- },
4097
- children: [
4098
- /* @__PURE__ */ c.jsx("div", { style: { marginRight: "8px" }, children: /* @__PURE__ */ c.jsxs(
4099
- "svg",
4100
- {
4101
- width: "16",
4102
- height: "16",
4103
- viewBox: "0 0 16 16",
4104
- style: { animation: "spin 1s linear infinite" },
4105
- children: [
4106
- /* @__PURE__ */ c.jsx("style", { children: "@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }" }),
4107
- /* @__PURE__ */ c.jsx(
4108
- "circle",
4109
- {
4110
- cx: "8",
4111
- cy: "8",
4112
- r: "6",
4113
- fill: "none",
4114
- stroke: "#4b5563",
4115
- strokeWidth: "2",
4116
- strokeDasharray: "9 3"
4117
- }
4118
- )
4119
- ]
4120
- }
4121
- ) }),
4122
- /* @__PURE__ */ c.jsx("span", { children: "Agent is currently running..." })
4123
- ]
4124
- }
4125
- )
4126
- ]
4127
- },
4128
- r
4129
- )) });
4130
- }
4131
- function ta({ messagesContext: e }) {
4132
- const t = e.messages || [];
4133
- return t.length === 0 ? /* @__PURE__ */ c.jsxs("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
4134
- /* @__PURE__ */ c.jsx("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No messages yet" }),
4135
- /* @__PURE__ */ c.jsx("p", { style: { fontSize: "14px", margin: 0 }, children: "Messages will appear here as the conversation progresses" })
4136
- ] }) : /* @__PURE__ */ c.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: t.map((n, r) => /* @__PURE__ */ c.jsxs(
4137
- "div",
4138
- {
4139
- style: {
4140
- padding: "16px",
4141
- borderRadius: "8px",
4142
- backgroundColor: n.role === "user" ? "#eff6ff" : n.role === "assistant" ? "#f9fafb" : "#fefce8",
4143
- border: `1px solid ${n.role === "user" ? "#c7d2fe" : n.role === "assistant" ? "#e5e7eb" : "#fde047"}`,
4144
- marginLeft: n.role === "user" ? "48px" : "0",
4145
- marginRight: n.role === "assistant" ? "48px" : "0"
4146
- },
4147
- children: [
4148
- /* @__PURE__ */ c.jsxs(
4149
- "div",
4150
- {
4151
- style: {
4152
- display: "flex",
4153
- alignItems: "flex-start",
4154
- justifyContent: "space-between",
4155
- marginBottom: "8px"
4156
- },
4157
- children: [
4158
- /* @__PURE__ */ c.jsx(
4159
- "span",
4160
- {
4161
- style: {
4162
- fontWeight: "500",
4163
- fontSize: "14px",
4164
- color: "#374151",
4165
- textTransform: "capitalize"
4166
- },
4167
- children: n.role || "system"
4168
- }
4169
- ),
4170
- n.timestamp && /* @__PURE__ */ c.jsx("span", { style: { fontSize: "12px", color: "#6b7280" }, children: new Date(n.timestamp).toLocaleTimeString() })
4171
- ]
4172
- }
4173
- ),
4174
- /* @__PURE__ */ c.jsx("div", { style: { fontSize: "14px", color: "#1f2937", whiteSpace: "pre-wrap" }, children: n.content || "" })
4175
- ]
4176
- },
4177
- r
4178
- )) });
4179
- }
4180
- function na({ context: e }) {
4181
- const t = e.getDocumentsContext([]);
4182
- return t.length === 0 ? /* @__PURE__ */ c.jsxs("div", { style: { textAlign: "center", padding: "48px 0", color: "#6b7280" }, children: [
4183
- /* @__PURE__ */ c.jsx("p", { style: { fontSize: "18px", margin: "0 0 8px 0" }, children: "No document context available" }),
4184
- /* @__PURE__ */ c.jsx("p", { style: { fontSize: "14px", margin: 0 }, children: "Document context will appear here when provided" })
4185
- ] }) : /* @__PURE__ */ c.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "16px" }, children: t.map((n, r) => /* @__PURE__ */ c.jsxs(
4186
- "div",
4187
- {
4188
- style: {
4189
- backgroundColor: "white",
4190
- padding: "16px",
4191
- borderRadius: "8px",
4192
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.1)",
4193
- border: "1px solid #e5e7eb"
4194
- },
4195
- children: [
4196
- /* @__PURE__ */ c.jsx("h3", { style: { fontWeight: "600", color: "#1f2937", margin: "0 0 8px 0" }, children: n.name || `Document ${r + 1}` }),
4197
- n.content && /* @__PURE__ */ c.jsx(
4198
- "pre",
4199
- {
4200
- style: {
4201
- padding: "12px",
4202
- backgroundColor: "#f9fafb",
4203
- borderRadius: "4px",
4204
- fontSize: "12px",
4205
- overflowX: "auto",
4206
- margin: 0
4207
- },
4208
- children: n.content
4209
- }
4210
- )
4211
- ]
4212
- },
4213
- r
4214
- )) });
4215
- }
4216
- function ra({ position: e = "bottom-right" }) {
4217
- const n = !!ft().copilotApiConfig.publicApiKey, [r, i] = M(!1), [a, s] = M(!1), [l, d] = M(!1), [o, u] = M(null), [g, m] = M(!1), h = K(null), f = K(null);
4218
- H(() => {
4219
- if (m(!0), typeof window < "u" && !o) {
4220
- const S = {
4221
- x: 24,
4222
- y: window.innerHeight - 60 - 24
4223
- };
4224
- u(S);
4225
- }
4226
- }, [e]);
4227
- const N = (E) => {
4228
- E.preventDefault(), o && (h.current = {
4229
- startX: E.clientX,
4230
- startY: E.clientY,
4231
- buttonX: o.x,
4232
- buttonY: o.y
4233
- }, d(!0));
4234
- };
4235
- return H(() => {
4236
- if (!l)
4237
- return;
4238
- const E = (S) => {
4239
- if (S.preventDefault(), S.stopPropagation(), !h.current)
4240
- return;
4241
- const R = S.clientX - h.current.startX, p = S.clientY - h.current.startY;
4242
- let k = h.current.buttonX + R, x = h.current.buttonY + p;
4243
- k = Math.max(0, Math.min(k, window.innerWidth - 60)), x = Math.max(0, Math.min(x, window.innerHeight - 60)), u({ x: k, y: x });
4244
- }, I = (S) => {
4245
- S.preventDefault(), S.stopPropagation(), d(!1), h.current = null;
4246
- };
4247
- return document.addEventListener("mousemove", E, { capture: !0, passive: !1 }), document.addEventListener("mouseup", I, { capture: !0, passive: !1 }), () => {
4248
- document.removeEventListener("mousemove", E, { capture: !0 }), document.removeEventListener("mouseup", I, { capture: !0 });
4249
- };
4250
- }, [l]), !g || !o ? null : /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
4251
- /* @__PURE__ */ c.jsxs(
4252
- "button",
4253
- {
4254
- ref: f,
4255
- onClick: () => {
4256
- l || i(!0);
4257
- },
4258
- onMouseDown: N,
4259
- onMouseEnter: () => s(!0),
4260
- onMouseLeave: () => s(!1),
4261
- style: {
4262
- position: "fixed",
4263
- left: `${o.x}px`,
4264
- top: `${o.y}px`,
4265
- zIndex: 2147483647,
4266
- width: "60px",
4267
- height: "60px",
4268
- background: l ? "#000000" : a ? "#111111" : "#000000",
4269
- color: "white",
4270
- borderRadius: "50%",
4271
- boxShadow: l ? "0 8px 32px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4)" : a ? "0 12px 40px rgba(0, 0, 0, 0.7), 0 6px 20px rgba(0, 0, 0, 0.5)" : "0 6px 20px rgba(0, 0, 0, 0.5), 0 3px 10px rgba(0, 0, 0, 0.3)",
4272
- transition: l ? "none" : "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
4273
- display: "flex",
4274
- alignItems: "center",
4275
- justifyContent: "center",
4276
- border: "none",
4277
- cursor: l ? "grabbing" : "grab",
4278
- opacity: 1,
4279
- userSelect: "none",
4280
- transform: l ? "scale(1.05)" : a ? "scale(1.1)" : "scale(1)",
4281
- backdropFilter: "blur(10px)",
4282
- pointerEvents: "auto",
4283
- isolation: "isolate"
4284
- },
4285
- title: n ? "Open Inspector (Drag to move)" : "Inspector (License Key Required, Drag to move)",
4286
- children: [
4287
- /* @__PURE__ */ c.jsx(
4288
- "div",
4289
- {
4290
- style: {
4291
- width: "28px",
4292
- height: "28px",
4293
- display: "flex",
4294
- alignItems: "center",
4295
- justifyContent: "center",
4296
- filter: "drop-shadow(0 2px 4px rgba(0,0,0,0.2))"
4297
- },
4298
- children: /* @__PURE__ */ c.jsx(Fn, {})
4299
- }
4300
- ),
4301
- !n && /* @__PURE__ */ c.jsx(
4302
- "div",
4303
- {
4304
- style: {
4305
- position: "absolute",
4306
- top: "-2px",
4307
- right: "-2px",
4308
- width: "18px",
4309
- height: "18px",
4310
- background: "linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%)",
4311
- borderRadius: "50%",
4312
- display: "flex",
4313
- alignItems: "center",
4314
- justifyContent: "center",
4315
- boxShadow: "0 2px 8px rgba(255, 107, 107, 0.4)",
4316
- border: "2px solid white"
4317
- },
4318
- children: /* @__PURE__ */ c.jsx("span", { style: { fontSize: "10px", color: "white", fontWeight: "bold" }, children: "!" })
4319
- }
4320
- )
4321
- ]
4322
- }
4323
- ),
4324
- /* @__PURE__ */ c.jsx(
4325
- Zi,
4326
- {
4327
- isOpen: r,
4328
- onClose: () => i(!1),
4329
- hasApiKey: n
4330
- }
4331
- )
4332
- ] });
4333
- }
4334
- var ia = () => {
4335
- const [e, t] = Xt(sa, /* @__PURE__ */ new Map()), n = C((a, s) => {
4336
- const l = lt();
4337
- return t({
4338
- type: "ADD_ELEMENT",
4339
- value: a,
4340
- id: l,
4341
- categories: s
4342
- }), l;
4343
- }, []), r = C((a) => {
4344
- t({ type: "REMOVE_ELEMENT", id: a });
4345
- }, []), i = C(
4346
- (a) => {
4347
- const s = new Set(a), l = [];
4348
- return e.forEach((d) => {
4349
- oa(s, d.categories) && l.push(d.value);
4350
- }), l;
4351
- },
4352
- [e]
4353
- );
4354
- return { addElement: n, removeElement: r, allElements: i };
4355
- }, aa = ia;
4356
- function sa(e, t) {
4357
- switch (t.type) {
4358
- case "ADD_ELEMENT": {
4359
- const { value: n, id: r, categories: i } = t, a = {
4360
- id: r,
4361
- value: n,
4362
- categories: new Set(i)
4363
- }, s = new Map(e);
4364
- return s.set(r, a), s;
4365
- }
4366
- case "REMOVE_ELEMENT": {
4367
- const n = new Map(e);
4368
- return n.delete(t.id), n;
4369
- }
4370
- default:
4371
- return e;
4372
- }
4373
- }
4374
- function oa(e, t) {
4375
- const [n, r] = e.size <= t.size ? [e, t] : [t, e];
4376
- for (let i of n)
4377
- if (r.has(i))
4378
- return !0;
4379
- return !1;
4380
- }
4381
- var Dn = (e, t) => e.reduce((n, r) => {
4382
- if (r.id !== t) {
4383
- const i = W(D({}, r), { children: Dn(r.children, t) });
4384
- n.push(i);
4385
- }
4386
- return n;
4387
- }, []), jn = (e, t, n) => n ? e.map((r) => r.id === n ? W(D({}, r), { children: [...r.children, t] }) : r.children.length ? W(D({}, r), { children: jn(r.children, t, n) }) : r) : [...e, t], Ln = (e, t) => t === 0 ? (e + 1).toString() : t === 1 ? String.fromCharCode(65 + e) : t === 2 ? String.fromCharCode(97 + e) : "-", Pn = (e, t = "", n = 0) => {
4388
- const r = " ".repeat(3).repeat(n), i = t.length + r.length, a = " ".repeat(i), s = e.value.split(`
4389
- `), l = `${r}${t}${s[0]}`, d = s.slice(1).map((g) => `${a}${g}`).join(`
4390
- `);
4391
- let o = `${l}
4392
- `;
4393
- d && (o += `${d}
4394
- `);
4395
- const u = " ".repeat(t.length);
4396
- return e.children.forEach(
4397
- (g, m) => o += Pn(
4398
- g,
4399
- `${u}${Ln(m, n + 1)}. `,
4400
- n + 1
4401
- )
4402
- ), o;
4403
- };
4404
- function la(e, t) {
4405
- switch (t.type) {
4406
- case "ADD_NODE": {
4407
- const { value: n, parentId: r, id: i } = t, a = {
4408
- id: i,
4409
- value: n,
4410
- children: [],
4411
- categories: new Set(t.categories)
4412
- };
4413
- try {
4414
- return jn(e, a, r);
4415
- } catch (s) {
4416
- return console.error(`Error while adding node with id ${i}: ${s}`), e;
4417
- }
4418
- }
4419
- case "REMOVE_NODE":
4420
- return Dn(e, t.id);
4421
- default:
4422
- return e;
4423
- }
4424
- }
4425
- var ca = () => {
4426
- const [e, t] = Xt(la, []), n = C(
4427
- (s, l, d) => {
4428
- const o = lt();
4429
- return t({
4430
- type: "ADD_NODE",
4431
- value: s,
4432
- parentId: d,
4433
- id: o,
4434
- categories: l
4435
- }), o;
4436
- },
4437
- []
4438
- ), r = C((s) => {
4439
- t({ type: "REMOVE_NODE", id: s });
4440
- }, []), i = C(() => e, [e]), a = C(
4441
- (s) => {
4442
- const l = new Set(s);
4443
- let d = "";
4444
- return e.forEach((o, u) => {
4445
- ua(l, o.categories) && (u !== 0 && (d += `
4446
- `), d += Pn(o, `${Ln(u, 0)}. `));
4447
- }), d;
4448
- },
4449
- [e]
4450
- );
4451
- return { tree: e, addElement: n, printTree: a, removeElement: r, getAllElements: i };
4452
- }, da = ca;
4453
- function ua(e, t) {
4454
- const [n, r] = e.size <= t.size ? [e, t] : [t, e];
4455
- for (let i of n)
4456
- if (r.has(i))
4457
- return !0;
4458
- return !1;
4459
- }
4460
- var pa = (e) => {
4461
- const { setBannerError: t } = Sn(), n = e, { showDevConsole: r, onError: i } = n, a = xe(n, ["showDevConsole", "onError"]), s = K(null), l = (o, u) => _(void 0, null, function* () {
4462
- try {
4463
- const g = {
4464
- type: "error",
4465
- timestamp: Date.now(),
4466
- context: {
4467
- source: "ui",
4468
- request: {
4469
- operation: "runtimeClient",
4470
- url: a.url,
4471
- startTime: Date.now()
4472
- },
4473
- technical: {
4474
- environment: "browser",
4475
- userAgent: typeof navigator < "u" ? navigator.userAgent : void 0,
4476
- stackTrace: u instanceof Error ? u.stack : void 0
4477
- }
4478
- },
4479
- error: o
4480
- };
4481
- yield i(g);
4482
- } catch (g) {
4483
- console.error("Error in onError handler:", g);
4484
- }
4485
- });
4486
- return ie(() => new at(W(D({}, a), {
4487
- handleGQLErrors: (o) => {
4488
- var u;
4489
- if ((u = o.graphQLErrors) != null && u.length) {
4490
- const g = o.graphQLErrors, m = (h) => {
4491
- const f = h.extensions, N = f == null ? void 0 : f.visibility, E = se(r ?? !1);
4492
- if (N === st.SILENT) {
4493
- console.error("CopilotKit Silent Error:", h.message);
4494
- return;
4495
- }
4496
- if (!E) {
4497
- console.error("CopilotKit Error (hidden in production):", h.message);
4498
- return;
4499
- }
4500
- const I = Date.now(), S = h.message;
4501
- if (s.current && s.current.message === S && I - s.current.timestamp < 150)
4502
- return;
4503
- s.current = { message: S, timestamp: I };
4504
- const R = fa(h);
4505
- if (R)
4506
- t(R), l(R, h);
4507
- else {
4508
- const p = new P({
4509
- message: h.message,
4510
- code: ne.UNKNOWN
4511
- });
4512
- t(p), l(p, h);
4513
- }
4514
- };
4515
- g.forEach(m);
4516
- } else if (!se(r ?? !1))
4517
- console.error("CopilotKit Error (hidden in production):", o);
4518
- else {
4519
- const m = new P({
4520
- message: (o == null ? void 0 : o.message) || String(o),
4521
- code: ne.UNKNOWN
4522
- });
4523
- t(m), l(m, o);
4524
- }
4525
- },
4526
- handleGQLWarning: (o) => {
4527
- console.warn(o);
4528
- const u = new P({
4529
- message: o,
4530
- code: ne.UNKNOWN
4531
- });
4532
- t(u);
4533
- }
4534
- })), [a, t, r, i]);
4535
- };
4536
- function fa(e) {
4537
- var t, n, r;
4538
- const i = e.extensions, a = i == null ? void 0 : i.originalError, s = (a == null ? void 0 : a.message) || e.message, l = i == null ? void 0 : i.code;
4539
- return l ? new P({ message: s, code: l }) : (t = a == null ? void 0 : a.stack) != null && t.includes("CopilotApiDiscoveryError") ? new be({ message: s }) : (n = a == null ? void 0 : a.stack) != null && n.includes("CopilotKitRemoteEndpointDiscoveryError") ? new ot({ message: s }) : (r = a == null ? void 0 : a.stack) != null && r.includes("CopilotKitAgentDiscoveryError") ? new tn({
4540
- agentName: "",
4541
- availableAgents: []
4542
- }) : null;
4543
- }
4544
- function Ca(e) {
4545
- var t = e, { children: n } = t, r = xe(t, ["children"]);
4546
- const i = se(r.showDevConsole), a = r.publicApiKey || r.publicLicenseKey;
4547
- return /* @__PURE__ */ c.jsx(Gi, { enabled: i, children: /* @__PURE__ */ c.jsx(Wi, { publicApiKey: a, showUsageBanner: i, children: /* @__PURE__ */ c.jsx(ga, W(D({}, r), { children: n })) }) });
4548
- }
4549
- function ga(e) {
4550
- const t = e, { children: n } = t, r = xe(t, ["children"]);
4551
- ha(e);
4552
- const i = r.publicLicenseKey || r.publicApiKey, a = r.runtimeUrl || Dr, [s, l] = M({}), [d, o] = M({}), u = K({
4553
- actions: {},
4554
- coAgentStateRenders: {}
4555
- }), { addElement: g, removeElement: m, printTree: h, getAllElements: f } = da(), [N, E] = M(!1), [I, S] = M(""), [R, p] = M({}), [k, x] = M({}), [T, F] = M([]), {
4556
- addElement: X,
4557
- removeElement: oe,
4558
- allElements: Ge
4559
- } = aa(), ge = C((y, A) => {
4560
- l((w) => W(D({}, w), {
4561
- [y]: A
4562
- }));
4563
- }, []), Ce = C((y) => {
4564
- l((A) => {
4565
- const w = D({}, A);
4566
- return delete w[y], w;
4567
- });
4568
- }, []), Un = C((y, A) => {
4569
- o((w) => W(D({}, w), {
4570
- [y]: A
4571
- }));
4572
- }, []), Kn = C((y) => {
4573
- o((A) => {
4574
- const w = D({}, A);
4575
- return delete w[y], w;
4576
- });
4577
- }, []), zn = C(
4578
- (y, A) => {
4579
- const w = y.map((B) => `${B.name} (${B.sourceApplication}):
4580
- ${B.getContents()}`).join(`
4581
-
4582
- `), J = h(A);
4583
- return `${w}
4584
-
4585
- ${J}`;
4586
- },
4587
- [h]
4588
- ), Vn = C(
4589
- (y, A, w = Yt) => g(y, w, A),
4590
- [g]
4591
- ), Gn = C(
4592
- (y) => {
4593
- m(y);
4594
- },
4595
- [m]
4596
- ), Wn = C(() => f(), [f]), Bn = C(
4597
- (y) => ma(Object.values(y || s)),
4598
- [s]
4599
- ), qn = C(
4600
- (y) => Ge(y),
4601
- [Ge]
4602
- ), Yn = C(
4603
- (y, A = Yt) => X(y, A),
4604
- [X]
4605
- ), Qn = C(
4606
- (y) => {
4607
- oe(y);
4608
- },
4609
- [oe]
4610
- ), Y = ie(() => {
4611
- var y, A;
4612
- let w;
4613
- return i && (w = {
4614
- guardrails: {
4615
- input: {
4616
- restrictToTopic: {
4617
- enabled: !!r.guardrails_c,
4618
- validTopics: ((y = r.guardrails_c) == null ? void 0 : y.validTopics) || [],
4619
- invalidTopics: ((A = r.guardrails_c) == null ? void 0 : A.invalidTopics) || []
4620
- }
4621
- }
4622
- }
4623
- }), W(D({
4624
- publicApiKey: i
4625
- }, w ? { cloud: w } : {}), {
4626
- chatApiEndpoint: a,
4627
- headers: r.headers || {},
4628
- properties: r.properties || {},
4629
- transcribeAudioUrl: r.transcribeAudioUrl,
4630
- textToSpeechUrl: r.textToSpeechUrl,
4631
- credentials: r.credentials
4632
- });
4633
- }, [
4634
- i,
4635
- r.headers,
4636
- r.properties,
4637
- r.transcribeAudioUrl,
4638
- r.textToSpeechUrl,
4639
- r.credentials,
4640
- r.cloudRestrictToTopic,
4641
- r.guardrails_c
4642
- ]), Hn = ie(() => {
4643
- const y = Object.values(R || {}).reduce((A, w) => w.status === "authenticated" && w.authHeaders ? D(D({}, A), Object.entries(w.authHeaders).reduce(
4644
- (J, [B, ve]) => W(D({}, J), {
4645
- [B.startsWith("X-Custom-") ? B : `X-Custom-${B}`]: ve
4646
- }),
4647
- {}
4648
- )) : A, {});
4649
- return D(D(D({}, Y.headers || {}), Y.publicApiKey ? { [an]: Y.publicApiKey } : {}), y);
4650
- }, [Y.headers, Y.publicApiKey, R]), [We, gt] = M({}), Xn = C((y) => {
4651
- gt((A) => D(D({}, A), y));
4652
- }, []), Jn = C((y) => {
4653
- gt((A) => {
4654
- const w = A, { [y]: J } = w;
4655
- return xe(w, [Bt(y)]);
4656
- });
4657
- }, []), Be = K(r.onError);
4658
- H(() => {
4659
- Be.current = r.onError;
4660
- }, [r.onError]);
4661
- const mt = K({});
4662
- H(() => {
4663
- mt.current = We;
4664
- }, [We]);
4665
- const vt = C(
4666
- (y) => _(this, null, function* () {
4667
- if (Y.publicApiKey && Be.current)
4668
- try {
4669
- yield Be.current(y);
4670
- } catch (w) {
4671
- console.error("Error in public onError handler:", w);
4672
- }
4673
- const A = Object.values(mt.current);
4674
- yield Promise.all(
4675
- A.map(
4676
- (w) => Promise.resolve(w(y)).catch(
4677
- (J) => console.error("Error in internal error handler:", J)
4678
- )
4679
- )
4680
- );
4681
- }),
4682
- [Y.publicApiKey]
4683
- ), ht = pa({
4684
- url: Y.chatApiEndpoint,
4685
- publicApiKey: i,
4686
- headers: Hn,
4687
- credentials: Y.credentials,
4688
- showDevConsole: se(r.showDevConsole),
4689
- onError: vt
4690
- }), [Zn, Oe] = M({}), _n = C(
4691
- (y, A) => {
4692
- Oe((w) => W(D({}, w), { [y]: A }));
4693
- },
4694
- [Oe]
4695
- ), $n = C(
4696
- (y) => {
4697
- Oe((A) => {
4698
- const w = A, { [y]: J } = w;
4699
- return xe(w, [Bt(y)]);
4700
- });
4701
- },
4702
- [Oe]
4703
- ), [er, tr] = M([]), [nr, xt] = M({}), qe = K({}), rr = C(
4704
- (y) => {
4705
- const A = typeof y == "function" ? y(qe.current) : y;
4706
- qe.current = A, xt((w) => A);
4707
- },
4708
- []
4709
- ), yt = K(!1);
4710
- H(() => {
4711
- if (yt.current)
4712
- return;
4713
- _(this, null, function* () {
4714
- var A;
4715
- const w = yield ht.availableAgents();
4716
- (A = w.data) != null && A.availableAgents && tr(w.data.availableAgents.agents), yt.current = !0;
4717
- });
4718
- }, []);
4719
- let bt = null;
4720
- r.agent && (bt = {
4721
- agentName: r.agent
4722
- });
4723
- const [ir, Ye] = M(bt);
4724
- H(() => {
4725
- r.agent ? Ye({
4726
- agentName: r.agent
4727
- }) : Ye(null);
4728
- }, [r.agent]);
4729
- const [ar, kt] = M(r.threadId || Mr()), sr = C(
4730
- (y) => {
4731
- if (r.threadId)
4732
- throw new Error("Cannot call setThreadId() when threadId is provided via props.");
4733
- kt(y);
4734
- },
4735
- [r.threadId]
4736
- );
4737
- H(() => {
4738
- r.threadId !== void 0 && kt(r.threadId);
4739
- }, [r.threadId]);
4740
- const [or, lr] = M(null), cr = K(null), Qe = se(r.showDevConsole), [dr, ur] = M(null), Nt = C((y) => {
4741
- ur((A) => {
4742
- if (A == null)
4743
- return y;
4744
- if (y == null)
4745
- return null;
4746
- let w = A.event;
4747
- return y.event && (w = D(D({}, A.event), y.event)), W(D(D({}, A), y), { event: w });
4748
- });
4749
- }, []), pr = C(() => {
4750
- Nt(null);
4751
- }, []), fr = ie(() => n, [n]), [me, At] = M(null), gr = ie(() => {
4752
- var y;
4753
- return (y = r.agent) != null ? y : null;
4754
- }, [r.agent]), mr = ie(
4755
- () => {
4756
- var y;
4757
- return (y = r.forwardedParameters) != null ? y : {};
4758
- },
4759
- [r.forwardedParameters]
4760
- ), vr = C(
4761
- (y) => {
4762
- x((A) => {
4763
- const w = typeof y == "function" ? y(A) : y;
4764
- return Object.keys(w).length === Object.keys(A).length && // @ts-ignore
4765
- Object.entries(w).every(([ve, He]) => A[ve] === He) ? A : w;
4766
- });
4767
- },
4768
- [x]
4769
- ), hr = C(
4770
- (y) => {
4771
- p((A) => {
4772
- const w = typeof y == "function" ? y(A) : y;
4773
- return Object.keys(w).length === Object.keys(A).length && // @ts-ignore
4774
- Object.entries(w).every(([ve, He]) => A[ve] === He) ? A : w;
4775
- });
4776
- },
4777
- [p]
4778
- );
4779
- return /* @__PURE__ */ c.jsxs(
4780
- In.Provider,
4781
- {
4782
- value: {
4783
- actions: s,
4784
- chatComponentsCache: u,
4785
- getFunctionCallHandler: Bn,
4786
- setAction: ge,
4787
- removeAction: Ce,
4788
- coAgentStateRenders: d,
4789
- setCoAgentStateRender: Un,
4790
- removeCoAgentStateRender: Kn,
4791
- getContextString: zn,
4792
- addContext: Vn,
4793
- removeContext: Gn,
4794
- getAllContext: Wn,
4795
- getDocumentsContext: qn,
4796
- addDocumentContext: Yn,
4797
- removeDocumentContext: Qn,
4798
- copilotApiConfig: Y,
4799
- isLoading: N,
4800
- setIsLoading: E,
4801
- chatSuggestionConfiguration: Zn,
4802
- addChatSuggestionConfiguration: _n,
4803
- removeChatSuggestionConfiguration: $n,
4804
- chatInstructions: I,
4805
- setChatInstructions: S,
4806
- additionalInstructions: T,
4807
- setAdditionalInstructions: F,
4808
- showDevConsole: Qe,
4809
- coagentStates: nr,
4810
- setCoagentStates: xt,
4811
- coagentStatesRef: qe,
4812
- setCoagentStatesWithRef: rr,
4813
- agentSession: ir,
4814
- setAgentSession: Ye,
4815
- runtimeClient: ht,
4816
- forwardedParameters: mr,
4817
- agentLock: gr,
4818
- threadId: ar,
4819
- setThreadId: sr,
4820
- runId: or,
4821
- setRunId: lr,
4822
- chatAbortControllerRef: cr,
4823
- availableAgents: er,
4824
- authConfig_c: r.authConfig_c,
4825
- authStates_c: R,
4826
- setAuthStates_c: hr,
4827
- extensions: k,
4828
- setExtensions: vr,
4829
- langGraphInterruptAction: dr,
4830
- setLangGraphInterruptAction: Nt,
4831
- removeLangGraphInterruptAction: pr,
4832
- bannerError: me,
4833
- setBannerError: At,
4834
- onError: vt,
4835
- internalErrorHandlers: We,
4836
- setInternalErrorHandler: Xn,
4837
- removeInternalErrorHandler: Jn
4838
- },
4839
- children: [
4840
- /* @__PURE__ */ c.jsx(Qi, { children: /* @__PURE__ */ c.jsxs(Hi, { children: [
4841
- fr,
4842
- Qe && /* @__PURE__ */ c.jsx(ra, {})
4843
- ] }) }),
4844
- me && Qe && /* @__PURE__ */ c.jsx(
4845
- En,
4846
- {
4847
- severity: me.severity,
4848
- message: me.message,
4849
- onClose: () => At(null),
4850
- actions: Cn(me)
4851
- }
4852
- )
4853
- ]
4854
- }
4855
- );
4856
- }
4857
- var Yt = ["global"];
4858
- function ma(e) {
4859
- return (t) => _(this, [t], function* ({ name: n, args: r }) {
4860
- let i = {};
4861
- for (let l of e)
4862
- i[l.name] = l;
4863
- const a = i[n];
4864
- let s;
4865
- return a && (yield new Promise((l, d) => {
4866
- xr(() => _(this, null, function* () {
4867
- var o;
4868
- try {
4869
- s = yield (o = a.handler) == null ? void 0 : o.call(a, r), l();
4870
- } catch (u) {
4871
- d(u);
4872
- }
4873
- }));
4874
- }), yield new Promise((l) => setTimeout(l, 20))), s;
4875
- });
4876
- }
4877
- function va(e) {
4878
- return e.replace(/_c$/, "").split("_").map((t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase()).join(" ");
4879
- }
4880
- function ha(e) {
4881
- const t = Object.keys(e).filter((r) => r.endsWith("_c")), n = e.publicApiKey || e.publicLicenseKey;
4882
- if (!e.runtimeUrl && !n)
4883
- throw new nn(
4884
- "Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'"
4885
- );
4886
- if (t.length > 0 && !n)
4887
- throw new Ir(
4888
- `Missing required prop: 'publicApiKey' or 'publicLicenseKey' to use cloud features: ${t.map(va).join(", ")}`
4889
- );
4890
- }
4891
- export {
4892
- Ca as C,
4893
- Aa as R,
4894
- on as T,
4895
- an as a,
4896
- jr as b,
4897
- Sa as c,
4898
- Ea as d,
4899
- Yt as e,
4900
- wa as f,
4901
- Na as i,
4902
- ft as u
4903
- };