@useago/sdk 1.9.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -0
- package/README.md +53 -0
- package/dist/angular.cjs +1 -1
- package/dist/angular.d.cts +313 -0
- package/dist/angular.d.ts +313 -0
- package/dist/angular.js +1 -1
- package/dist/{createConversationSession-BaaXBQ5b.js → createConversationSession-B1Qn-y0I.js} +1 -1
- package/dist/{createConversationSession-CU0b-t1W.cjs → createConversationSession-B3v_xOU7.cjs} +1 -1
- package/dist/{createFormCollector-DfN1xZBy.cjs → createFormCollector-FvwDOqnV.cjs} +1 -1
- package/dist/{createFormCollector-Cf7kGhCB.js → createFormCollector-m79zk_NA.js} +1 -1
- package/dist/createMockClient-BEOXI8yW.cjs +1 -0
- package/dist/{createMockClient-5YF-ZbVu.js → createMockClient-Beao82tu.js} +15 -3
- package/dist/devtools.d.cts +313 -0
- package/dist/devtools.d.ts +313 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +389 -4
- package/dist/index.d.ts +389 -4
- package/dist/index.js +118 -114
- package/dist/react.cjs +1 -1
- package/dist/react.d.cts +313 -0
- package/dist/react.d.ts +313 -0
- package/dist/react.js +8 -6
- package/dist/sheetController-BThJRtOu.cjs +1 -0
- package/dist/sheetController-aEKXIvjk.js +343 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.cts +313 -0
- package/dist/testing.d.ts +313 -0
- package/dist/testing.js +1 -1
- package/dist/types-Ct1hlKwg.js +2408 -0
- package/dist/types-mcW8vB1U.cjs +10 -0
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +505 -0
- package/dist/vue.d.ts +505 -0
- package/dist/vue.js +1 -1
- package/dist/widget.cjs +6 -4
- package/dist/widget.d.cts +585 -2
- package/dist/widget.d.ts +585 -2
- package/dist/widget.js +3985 -995
- package/llms-full.txt +125 -6
- package/package.json +1 -1
- package/dist/createMockClient-BZbOe-23.cjs +0 -1
- package/dist/sheetController-CBUVOroo.js +0 -205
- package/dist/sheetController-DY-sC13T.cjs +0 -1
- package/dist/types-CPga11Of.js +0 -2068
- package/dist/types-D3YQl1jx.cjs +0 -9
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
var p = /* @__PURE__ */ new WeakMap(), N = [
|
|
2
|
+
"position",
|
|
3
|
+
"top",
|
|
4
|
+
"left",
|
|
5
|
+
"right",
|
|
6
|
+
"width"
|
|
7
|
+
];
|
|
8
|
+
function T(e, a) {
|
|
9
|
+
return a.map((t) => ({
|
|
10
|
+
style: e,
|
|
11
|
+
prop: t,
|
|
12
|
+
value: e.getPropertyValue(t),
|
|
13
|
+
priority: e.getPropertyPriority(t)
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
function k(e) {
|
|
17
|
+
for (const { style: a, prop: t, value: r, priority: o } of e) r ? a.setProperty(t, r, o) : a.removeProperty(t);
|
|
18
|
+
}
|
|
19
|
+
function V(e, a = document) {
|
|
20
|
+
const t = p.get(a);
|
|
21
|
+
if (t) {
|
|
22
|
+
t.owners.add(e);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const r = a.body, o = a.documentElement, s = a.defaultView?.scrollY ?? 0;
|
|
26
|
+
p.set(a, {
|
|
27
|
+
owners: /* @__PURE__ */ new Set([e]),
|
|
28
|
+
saved: [...T(r.style, N), ...T(o.style, ["overflow"])],
|
|
29
|
+
scrollY: s
|
|
30
|
+
}), r.style.position = "fixed", r.style.top = `-${s}px`, r.style.left = "0", r.style.right = "0", r.style.width = "100%", o.style.overflow = "hidden";
|
|
31
|
+
}
|
|
32
|
+
function z(e, a = document) {
|
|
33
|
+
const t = p.get(a);
|
|
34
|
+
!t || !t.owners.delete(e) || t.owners.size > 0 || (p.delete(a), k(t.saved), a.defaultView?.scrollTo(0, t.scrollY));
|
|
35
|
+
}
|
|
36
|
+
function j(e, a) {
|
|
37
|
+
const t = e.replace("#", ""), r = Number.parseInt(t.substring(0, 2), 16), o = Number.parseInt(t.substring(2, 4), 16), s = Number.parseInt(t.substring(4, 6), 16), n = (u) => Math.min(255, Math.round(u + (255 - u) * (a / 100))), l = (u) => u.toString(16).padStart(2, "0");
|
|
38
|
+
return `#${l(n(r))}${l(n(o))}${l(n(s))}`;
|
|
39
|
+
}
|
|
40
|
+
function q(e) {
|
|
41
|
+
return /^#?[0-9A-F]{6}$/i.test(e);
|
|
42
|
+
}
|
|
43
|
+
function O(e, a, t) {
|
|
44
|
+
const r = (1 - Math.abs(2 * t - 1)) * a, o = (e % 360 + 360) % 360 / 60, s = o | 0, n = r * (1 - Math.abs(o % 2 - 1)), [l, u, g] = [
|
|
45
|
+
[
|
|
46
|
+
r,
|
|
47
|
+
n,
|
|
48
|
+
0
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
n,
|
|
52
|
+
r,
|
|
53
|
+
0
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
0,
|
|
57
|
+
r,
|
|
58
|
+
n
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
0,
|
|
62
|
+
n,
|
|
63
|
+
r
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
n,
|
|
67
|
+
0,
|
|
68
|
+
r
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
r,
|
|
72
|
+
0,
|
|
73
|
+
n
|
|
74
|
+
]
|
|
75
|
+
][s], f = t - r / 2;
|
|
76
|
+
return [
|
|
77
|
+
Math.round((l + f) * 255),
|
|
78
|
+
Math.round((u + f) * 255),
|
|
79
|
+
Math.round((g + f) * 255)
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
function C(e) {
|
|
83
|
+
const a = e.trim(), t = /^hsla?\(\s*([\d.-]+)(?:deg)?[\s,]+([\d.]+)%[\s,]+([\d.]+)%/i.exec(a);
|
|
84
|
+
if (t) {
|
|
85
|
+
const [n, l, u] = t.slice(1, 4).map(Number);
|
|
86
|
+
return [
|
|
87
|
+
n,
|
|
88
|
+
l,
|
|
89
|
+
u
|
|
90
|
+
].some(Number.isNaN) ? null : O(n, Math.min(l, 100) / 100, Math.min(u, 100) / 100);
|
|
91
|
+
}
|
|
92
|
+
const r = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(a);
|
|
93
|
+
if (r) {
|
|
94
|
+
const n = r.slice(1, 4).map(Number);
|
|
95
|
+
return n.some((l) => Number.isNaN(l) || l < 0 || l > 255) ? null : n;
|
|
96
|
+
}
|
|
97
|
+
const o = a.replace("#", ""), s = o.length === 3 ? o.split("").map((n) => n + n).join("") : o;
|
|
98
|
+
return /^[0-9a-f]{6}$/i.test(s) ? [
|
|
99
|
+
Number.parseInt(s.substring(0, 2), 16),
|
|
100
|
+
Number.parseInt(s.substring(2, 4), 16),
|
|
101
|
+
Number.parseInt(s.substring(4, 6), 16)
|
|
102
|
+
] : null;
|
|
103
|
+
}
|
|
104
|
+
function _(e) {
|
|
105
|
+
const a = C(e);
|
|
106
|
+
if (!a) return null;
|
|
107
|
+
const [t, r, o] = a.map((s) => {
|
|
108
|
+
const n = s / 255;
|
|
109
|
+
return n <= 0.03928 ? n / 12.92 : ((n + 0.055) / 1.055) ** 2.4;
|
|
110
|
+
});
|
|
111
|
+
return 0.2126 * t + 0.7152 * r + 0.0722 * o;
|
|
112
|
+
}
|
|
113
|
+
function F(e, a) {
|
|
114
|
+
const t = _(e), r = _(a);
|
|
115
|
+
return t === null || r === null ? null : (Math.max(t, r) + 0.05) / (Math.min(t, r) + 0.05);
|
|
116
|
+
}
|
|
117
|
+
var L = /(?:repeating-)?(?:linear|radial|conic)-gradient\(/i;
|
|
118
|
+
function U(e) {
|
|
119
|
+
return !!e && L.test(e);
|
|
120
|
+
}
|
|
121
|
+
function w(e) {
|
|
122
|
+
return e.match(/#[0-9a-f]{3,8}|(?:rgba?|hsla?)\([^()]*\)|\btransparent\b/gi) ?? [];
|
|
123
|
+
}
|
|
124
|
+
function I(e) {
|
|
125
|
+
const a = e.trim().toLowerCase();
|
|
126
|
+
if (a === "transparent") return !0;
|
|
127
|
+
const t = /\/\s*([\d.]+)%?\s*\)$/.exec(a);
|
|
128
|
+
if (t) return Number.parseFloat(t[1]) === 0;
|
|
129
|
+
const r = /^(?:rgba|hsla)\([^)]*,\s*([\d.]+)%?\s*\)$/.exec(a);
|
|
130
|
+
if (r) return Number.parseFloat(r[1]) === 0;
|
|
131
|
+
if (!a.startsWith("#")) return !1;
|
|
132
|
+
const o = a.slice(1);
|
|
133
|
+
return /^[0-9a-f]+$/.test(o) ? o.length === 8 ? o.slice(6) === "00" : o.length === 4 ? o[3] === "0" : !1 : !1;
|
|
134
|
+
}
|
|
135
|
+
var b = "#FFFFFF", H = "#000000", G = "#FFFFFF";
|
|
136
|
+
function P(e) {
|
|
137
|
+
if (!e) return b;
|
|
138
|
+
const a = U(e) ? w(e) : [e], t = (a.some(I) ? [...a, G] : a).map((r) => F(r, b)).filter((r) => r !== null);
|
|
139
|
+
return t.length && Math.min(...t) < 3 ? H : b;
|
|
140
|
+
}
|
|
141
|
+
var $ = '"IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', Q = `var(--ago-font, ${$})`, y = {
|
|
142
|
+
font: "--ago-font",
|
|
143
|
+
radius: "--ago-radius",
|
|
144
|
+
messageRadius: "--ago-message-radius",
|
|
145
|
+
brand: "--ago-brand-color",
|
|
146
|
+
brandText: "--ago-brand-text-color",
|
|
147
|
+
headerBg: "--ago-header-background",
|
|
148
|
+
headerText: "--ago-header-text-color",
|
|
149
|
+
panelBg: "--ago-panel-background",
|
|
150
|
+
messagesBg: "--ago-messages-background",
|
|
151
|
+
text: "--ago-text-color",
|
|
152
|
+
mutedText: "--ago-muted-text-color",
|
|
153
|
+
border: "--ago-border-color",
|
|
154
|
+
accent: "--ago-accent-color",
|
|
155
|
+
agentBubbleBg: "--ago-agent-bubble-background",
|
|
156
|
+
agentBubbleText: "--ago-agent-bubble-text-color",
|
|
157
|
+
userBubbleBg: "--ago-user-bubble-background",
|
|
158
|
+
userBubbleText: "--ago-user-bubble-text-color",
|
|
159
|
+
launcherBg: "--ago-launcher-background",
|
|
160
|
+
launcherText: "--ago-launcher-text-color",
|
|
161
|
+
sendBg: "--ago-send-button-background",
|
|
162
|
+
panelWidth: "--ago-panel-width"
|
|
163
|
+
}, Z = "var(--ago-brand-color, #03182f)", J = "var(--ago-brand-text-color, #fff)", ee = "var(--ago-header-background, var(--ago-brand-color, #03182f))", ae = "var(--ago-header-text-color, #e8f0fe)", te = "var(--ago-panel-background, #fff)", re = "var(--ago-messages-background, #fbfbfb)", ne = "var(--ago-text-color, #30373e)", oe = "var(--ago-muted-text-color, #6b6d6f)", se = "var(--ago-border-color, #dee3e8)", ie = "var(--ago-accent-color, #1b5fc4)", le = "var(--ago-agent-bubble-background, #f1f3f5)", A = "var(--ago-radius, 16px)", ue = "var(--ago-message-radius, 16px)", ce = "var(--ago-message-radius, 20px)", ge = "var(--ago-launcher-background, #007bff)", fe = "var(--ago-launcher-text-color, #fff)", de = "var(--ago-send-button-background, var(--ago-brand-color, #03182f))", be = "var(--ago-user-bubble-background, #fff)", pe = "var(--ago-user-bubble-text-color, #0a0a0a)", he = "var(--ago-agent-bubble-text-color, var(--ago-text-color, #30373e))", me = "var(--ago-panel-background, #f8faff)", ve = "var(--ago-accent-color, #003edf)", xe = "#e3edff", Ee = "#e5e5e5", Be = "var(--ago-border-color, #e4e4e7)", Re = "var(--ago-muted-text-color, #71717a)", Te = "var(--ago-panel-width, 550px)", _e = "0 1px 2px 0 rgba(0,0,0,0.05)", ye = "0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)", Ae = "0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)", Me = "rgba(15, 15, 15, 0.16) 0px 5px 40px 0px";
|
|
164
|
+
function De(e, a) {
|
|
165
|
+
if (a)
|
|
166
|
+
for (const t of Object.keys(y)) {
|
|
167
|
+
const r = a[t];
|
|
168
|
+
r != null && e.style.setProperty(y[t], r);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function Se(e) {
|
|
172
|
+
if (!e) return {};
|
|
173
|
+
const a = {};
|
|
174
|
+
return e.button && (a.launcherBg = e.button, a.sendBg = e.button), e.header && (a.headerBg = e.header, a.headerText = P(e.header)), e.agentMessage && (a.agentBubbleBg = e.agentMessage), e.agentMessageFont && (a.agentBubbleText = e.agentMessageFont), e.background && (a.panelBg = e.background, a.messagesBg = e.background), e.font && (a.text = e.font), e.userMessage && (a.userBubbleBg = e.userMessage), e.userMessageFont && (a.userBubbleText = e.userMessageFont), a;
|
|
175
|
+
}
|
|
176
|
+
function K(e, a) {
|
|
177
|
+
Object.assign(e.style, a);
|
|
178
|
+
}
|
|
179
|
+
function Ne(e = {}) {
|
|
180
|
+
const a = document.createElement("div");
|
|
181
|
+
return K(a, e), a;
|
|
182
|
+
}
|
|
183
|
+
var M = "ago-chat-widget-keyframes";
|
|
184
|
+
function ke() {
|
|
185
|
+
if (typeof document > "u" || document.getElementById(M)) return;
|
|
186
|
+
const e = document.createElement("style");
|
|
187
|
+
e.id = M, e.textContent = "@keyframes ago-pulse { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }@keyframes ago-spin { to { transform: rotate(360deg); } }@keyframes ago-scale-in { 50% { transform: translateX(-10px) translateY(-5px) scale(1.1); } }@keyframes ago-appear { 0%, 98% { opacity: 0; } 100% { opacity: 1; } }@keyframes ago-skeleton-pulse { 50% { opacity: 0.5; } }.ago-chat-input--embed textarea::placeholder { font-style: italic; color: #9ca3af; opacity: 1; }", document.head.appendChild(e);
|
|
188
|
+
}
|
|
189
|
+
var X = "2147483000";
|
|
190
|
+
function W(e, a = "0px") {
|
|
191
|
+
return e === void 0 ? a : typeof e == "number" ? `${e}px` : e;
|
|
192
|
+
}
|
|
193
|
+
function Y(e) {
|
|
194
|
+
return `(max-width: ${e}px), (max-height: 500px) and (orientation: landscape)`;
|
|
195
|
+
}
|
|
196
|
+
function Oe(e = {}) {
|
|
197
|
+
const a = e.breakpoint ?? 768, t = e.peekHeight ?? 152, r = W(e.bottomOffset), o = e.initialState ?? "peek", s = /* @__PURE__ */ new Set();
|
|
198
|
+
let n = o, l = !1;
|
|
199
|
+
const u = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia(Y(a)) : void 0;
|
|
200
|
+
let g = h();
|
|
201
|
+
const f = x(!1, o);
|
|
202
|
+
function D(i, c) {
|
|
203
|
+
if (!i) return {
|
|
204
|
+
style: {},
|
|
205
|
+
attrs: {
|
|
206
|
+
role: null,
|
|
207
|
+
"aria-modal": null,
|
|
208
|
+
"aria-label": null
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
const R = {
|
|
212
|
+
position: "fixed",
|
|
213
|
+
left: "0",
|
|
214
|
+
right: "0",
|
|
215
|
+
bottom: r,
|
|
216
|
+
zIndex: X,
|
|
217
|
+
display: "flex",
|
|
218
|
+
flexDirection: "column",
|
|
219
|
+
borderRadius: c === "full" ? "0" : `${A} ${A} 0 0`,
|
|
220
|
+
paddingBottom: "env(safe-area-inset-bottom)"
|
|
221
|
+
};
|
|
222
|
+
return c === "full" ? {
|
|
223
|
+
style: {
|
|
224
|
+
...R,
|
|
225
|
+
top: "0",
|
|
226
|
+
height: "auto",
|
|
227
|
+
paddingTop: "env(safe-area-inset-top)"
|
|
228
|
+
},
|
|
229
|
+
attrs: {
|
|
230
|
+
role: "dialog",
|
|
231
|
+
"aria-modal": "true",
|
|
232
|
+
tabindex: "-1"
|
|
233
|
+
}
|
|
234
|
+
} : {
|
|
235
|
+
style: {
|
|
236
|
+
...R,
|
|
237
|
+
top: "auto",
|
|
238
|
+
minHeight: `calc(${t}px + env(safe-area-inset-bottom))`,
|
|
239
|
+
height: "auto"
|
|
240
|
+
},
|
|
241
|
+
attrs: {
|
|
242
|
+
role: null,
|
|
243
|
+
"aria-modal": null,
|
|
244
|
+
tabindex: "-1"
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function x(i, c) {
|
|
249
|
+
return {
|
|
250
|
+
compact: i,
|
|
251
|
+
state: c,
|
|
252
|
+
isModal: i && c === "full",
|
|
253
|
+
surface: D(i, c)
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function h() {
|
|
257
|
+
return x(!!u?.matches, n);
|
|
258
|
+
}
|
|
259
|
+
function m() {
|
|
260
|
+
g = h();
|
|
261
|
+
for (const i of s) i();
|
|
262
|
+
}
|
|
263
|
+
function v(i, c) {
|
|
264
|
+
l || n === i || (n = i, m(), e.onStateChange?.(i, c));
|
|
265
|
+
}
|
|
266
|
+
function E() {
|
|
267
|
+
if (!l) {
|
|
268
|
+
if (!u?.matches && n !== o) {
|
|
269
|
+
n = o, m(), e.onStateChange?.(o, "breakpoint");
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
m();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
let d = !1;
|
|
276
|
+
function S() {
|
|
277
|
+
d || !u || (u.addEventListener("change", E), d = !0, g = h());
|
|
278
|
+
}
|
|
279
|
+
function B() {
|
|
280
|
+
!d || !u || (u.removeEventListener("change", E), d = !1);
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
subscribe(i) {
|
|
284
|
+
return s.add(i), s.size === 1 && S(), () => {
|
|
285
|
+
s.delete(i), s.size === 0 && B();
|
|
286
|
+
};
|
|
287
|
+
},
|
|
288
|
+
getSnapshot: () => g,
|
|
289
|
+
getServerSnapshot: () => f,
|
|
290
|
+
expand: (i = "api") => v("full", i),
|
|
291
|
+
collapse: (i = "api") => v("peek", i),
|
|
292
|
+
toggle: (i = "api") => v(n === "full" ? "peek" : "full", i),
|
|
293
|
+
destroy() {
|
|
294
|
+
l || (l = !0, B(), s.clear());
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
export {
|
|
299
|
+
Ae as A,
|
|
300
|
+
q as B,
|
|
301
|
+
Me as C,
|
|
302
|
+
A as D,
|
|
303
|
+
xe as E,
|
|
304
|
+
De as F,
|
|
305
|
+
P as H,
|
|
306
|
+
Se as I,
|
|
307
|
+
K as L,
|
|
308
|
+
ne as M,
|
|
309
|
+
be as N,
|
|
310
|
+
de as O,
|
|
311
|
+
pe as P,
|
|
312
|
+
Ne as R,
|
|
313
|
+
te as S,
|
|
314
|
+
ve as T,
|
|
315
|
+
V as U,
|
|
316
|
+
j as V,
|
|
317
|
+
z as W,
|
|
318
|
+
re as _,
|
|
319
|
+
he as a,
|
|
320
|
+
oe as b,
|
|
321
|
+
J as c,
|
|
322
|
+
Re as d,
|
|
323
|
+
Q as f,
|
|
324
|
+
fe as g,
|
|
325
|
+
ge as h,
|
|
326
|
+
le as i,
|
|
327
|
+
_e as j,
|
|
328
|
+
ye as k,
|
|
329
|
+
me as l,
|
|
330
|
+
ae as m,
|
|
331
|
+
Oe as n,
|
|
332
|
+
se as o,
|
|
333
|
+
ee as p,
|
|
334
|
+
ie as r,
|
|
335
|
+
Z as s,
|
|
336
|
+
Y as t,
|
|
337
|
+
Be as u,
|
|
338
|
+
ue as v,
|
|
339
|
+
Te as w,
|
|
340
|
+
Ee as x,
|
|
341
|
+
ce as y,
|
|
342
|
+
ke as z
|
|
343
|
+
};
|
package/dist/testing.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./createMockClient-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./createMockClient-BEOXI8yW.cjs");exports.createMockClient=e.createMockClient;
|