@rpcbase/agents-sdk 0.12.0 → 0.14.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/dist/agents-sdk.css +1 -1
- package/dist/api/chat/handler.d.ts.map +1 -1
- package/dist/api/chat/models.d.ts +2 -2
- package/dist/api/chat/models.d.ts.map +1 -1
- package/dist/api/chat/runtimeConfig.d.ts +80 -0
- package/dist/api/chat/runtimeConfig.d.ts.map +1 -1
- package/dist/api/chat/toolApproval.d.ts +36 -0
- package/dist/api/chat/toolApproval.d.ts.map +1 -0
- package/dist/api/chat/toolApprovalHistory.d.ts +4 -0
- package/dist/api/chat/toolApprovalHistory.d.ts.map +1 -0
- package/dist/api/chatDb.d.ts +6 -1
- package/dist/api/chatDb.d.ts.map +1 -1
- package/dist/api/chatStore.d.ts +5 -0
- package/dist/api/chatStore.d.ts.map +1 -1
- package/dist/chat-models.browser.js +1 -1
- package/dist/chat-models.js +1 -1
- package/dist/{chatDb-CJCdqpjR.js → chatDb-DTjvCb7r.js} +33 -21
- package/dist/{chatDb-DLQOzat8.js → chatDb-DwhaaOmO.js} +33 -21
- package/dist/client-routes.browser.js +2 -2
- package/dist/client-routes.js +2 -2
- package/dist/components/ai-elements/tool.d.ts +6 -2
- package/dist/components/ai-elements/tool.d.ts.map +1 -1
- package/dist/components/message.d.ts.map +1 -1
- package/dist/{data-stream-handler-83PApswO.js → data-stream-handler-CrwpY1gX.js} +918 -813
- package/dist/{data-stream-handler-Cm6JVGl8.js → data-stream-handler-DG3Y--2n.js} +918 -813
- package/dist/{handler-C-CFaSnD.js → handler-0bIpqvbt.js} +1 -1
- package/dist/{handler-BTWWHJUs.js → handler-B-erVnQ6.js} +1 -1
- package/dist/handler-B4jvOK-L.js +1913 -0
- package/dist/{handler-D88wEmsv.js → handler-BLKbyYqI.js} +1 -1
- package/dist/{handler-BMF6eWg5.js → handler-BnDd10G3.js} +1 -1
- package/dist/{handler-DnkxwQzf.js → handler-Bsto5ImB.js} +1 -1
- package/dist/{handler-Cl7-HRxy.js → handler-By4I5hjo.js} +9 -9
- package/dist/{handler-C34eWXJg.js → handler-C3GOpsFS.js} +1 -1
- package/dist/{handler-DilZY3o3.js → handler-CNnPLVlT.js} +1 -1
- package/dist/{handler-DOtL2C2i.js → handler-CsNuMrRb.js} +1 -1
- package/dist/{handler-DiyNUz4m.js → handler-DAcB4fHJ.js} +1 -1
- package/dist/{handler-D003Oipd.js → handler-DUljRc5z.js} +1 -1
- package/dist/handler-DgrIym9_.js +1907 -0
- package/dist/{handler-CG2GBD33.js → handler-DtSnDhW2.js} +1 -1
- package/dist/{handler-DBuF7L41.js → handler-RTP9W4lT.js} +9 -9
- package/dist/{handler-CwoR5Bdv.js → handler-hTPifowr.js} +1 -1
- package/dist/index.browser.js +2 -2
- package/dist/index.js +2 -2
- package/dist/lib/ai/models.d.ts +1 -1
- package/dist/lib/ai/models.d.ts.map +1 -1
- package/dist/lib/ai/openai-reasoning.d.ts +2 -2
- package/dist/lib/ai/openai-reasoning.d.ts.map +1 -1
- package/dist/lib/db/schema.d.ts +1 -1
- package/dist/lib/db/schema.d.ts.map +1 -1
- package/dist/lib/tool-approval-decisions.d.ts +5 -0
- package/dist/lib/tool-approval-decisions.d.ts.map +1 -0
- package/dist/lib/types.d.ts +10 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/models/RBAgentsChatThread.d.ts +1 -0
- package/dist/models/RBAgentsChatThread.d.ts.map +1 -1
- package/dist/models/RBAgentsUsageEvent.d.ts +2 -1
- package/dist/models/RBAgentsUsageEvent.d.ts.map +1 -1
- package/dist/{models-BTzlEPg8.js → models-Bvdwv_p7.js} +14 -8
- package/dist/models.browser.js +6 -1
- package/dist/models.js +12 -1
- package/dist/openai-reasoning-CmTuRHwM.js +26 -0
- package/dist/routes.browser.js +8 -8
- package/dist/routes.js +8 -8
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +1 -1
- package/dist/tailwind-source.js +1 -1
- package/package.json +1 -1
- package/dist/handler-CVs03Ys2.js +0 -1568
- package/dist/handler-Z-tCrlQ_.js +0 -1562
- package/dist/openai-reasoning-BCA05blq.js +0 -19
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { l as e, o as t, r as n, s as r, u as i } from "./chunk-BO2N2NFS-BXeXbvYU.js";
|
|
2
2
|
import { i as a, n as o, r as s, s as c, t as l } from "./message-visibility-zTseZa3P.js";
|
|
3
|
-
import { a as u, i as d, r as f, s as p } from "./models-
|
|
4
|
-
import { a as m, i as h, n as g, r as _, t as v } from "./openai-reasoning-
|
|
3
|
+
import { a as u, i as d, r as f, s as p } from "./models-Bvdwv_p7.js";
|
|
4
|
+
import { a as m, i as h, n as g, r as _, t as v } from "./openai-reasoning-CmTuRHwM.js";
|
|
5
5
|
import * as y from "react";
|
|
6
6
|
import b, { Children as x, Component as S, Fragment as C, createContext as w, createElement as T, forwardRef as E, isValidElement as D, memo as O, useCallback as k, useContext as A, useEffect as j, useEffectEvent as M, useId as N, useImperativeHandle as P, useInsertionEffect as F, useLayoutEffect as I, useMemo as L, useRef as R, useState as z, useSyncExternalStore as ee, useSyncExternalStore as te } from "react";
|
|
7
7
|
import { Link as ne, Outlet as re, useLocation as ie, useNavigate as B, useRevalidator as ae, useRouteLoaderData as oe, useSearchParams as se } from "@rpcbase/router";
|
|
@@ -54944,7 +54944,7 @@ function NR(e, t = !0) {
|
|
|
54944
54944
|
//#endregion
|
|
54945
54945
|
//#region src/components/artifact-actions.tsx
|
|
54946
54946
|
function PR({ artifact: e, handleVersionChange: t, currentVersionIndex: n, isCurrentVersion: r, mode: i, metadata: a, setMetadata: o }) {
|
|
54947
|
-
let [s, c] = z(!1), l =
|
|
54947
|
+
let [s, c] = z(!1), l = vW.find((t) => t.kind === e.kind);
|
|
54948
54948
|
if (!l) throw Error("Artifact definition not found!");
|
|
54949
54949
|
let u = {
|
|
54950
54950
|
content: e.content,
|
|
@@ -55088,8 +55088,26 @@ function zR({ status: e }) {
|
|
|
55088
55088
|
};
|
|
55089
55089
|
}
|
|
55090
55090
|
//#endregion
|
|
55091
|
-
//#region src/
|
|
55092
|
-
var BR =
|
|
55091
|
+
//#region src/lib/tool-approval-decisions.ts
|
|
55092
|
+
var BR = (e) => e.type === "dynamic-tool" || e.type.startsWith("tool-"), VR = (e) => typeof e == "object" && !!e && !Array.isArray(e), HR = (e) => {
|
|
55093
|
+
let t = /* @__PURE__ */ new Map();
|
|
55094
|
+
for (let n of e) {
|
|
55095
|
+
if (n.type !== "data-tool-approval-decision") continue;
|
|
55096
|
+
let e = n.data;
|
|
55097
|
+
VR(e) && typeof e.toolCallId == "string" && typeof e.reason == "string" && e.reason.trim() && t.set(e.toolCallId, e.reason.trim());
|
|
55098
|
+
}
|
|
55099
|
+
return t.size === 0 ? e : e.map((e) => {
|
|
55100
|
+
if (!BR(e)) return e;
|
|
55101
|
+
let n = e, r = n.toolCallId ? t.get(n.toolCallId) : void 0;
|
|
55102
|
+
return !r || !n.approval || n.approval.reason ? e : {
|
|
55103
|
+
...e,
|
|
55104
|
+
approval: {
|
|
55105
|
+
...n.approval,
|
|
55106
|
+
reason: r
|
|
55107
|
+
}
|
|
55108
|
+
};
|
|
55109
|
+
});
|
|
55110
|
+
}, UR = he("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
|
|
55093
55111
|
variants: { variant: {
|
|
55094
55112
|
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
55095
55113
|
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
@@ -55098,15 +55116,15 @@ var BR = he("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs
|
|
|
55098
55116
|
} },
|
|
55099
55117
|
defaultVariants: { variant: "default" }
|
|
55100
55118
|
});
|
|
55101
|
-
function
|
|
55119
|
+
function WR({ className: e, variant: t, ...n }) {
|
|
55102
55120
|
return /* @__PURE__ */ V("div", {
|
|
55103
|
-
className: U(
|
|
55121
|
+
className: U(UR({ variant: t }), e),
|
|
55104
55122
|
...n
|
|
55105
55123
|
});
|
|
55106
55124
|
}
|
|
55107
55125
|
//#endregion
|
|
55108
55126
|
//#region ../../node_modules/@base-ui/react/collapsible/root/useCollapsibleRoot.mjs
|
|
55109
|
-
function
|
|
55127
|
+
function GR(e) {
|
|
55110
55128
|
let { open: t, defaultOpen: n, onOpenChange: r, disabled: i } = e, [a, o] = L_({
|
|
55111
55129
|
controlled: t,
|
|
55112
55130
|
default: n,
|
|
@@ -55140,28 +55158,28 @@ function HR(e) {
|
|
|
55140
55158
|
}
|
|
55141
55159
|
//#endregion
|
|
55142
55160
|
//#region ../../node_modules/@base-ui/react/collapsible/root/CollapsibleRootContext.mjs
|
|
55143
|
-
var
|
|
55144
|
-
process.env.NODE_ENV !== "production" && (
|
|
55145
|
-
function
|
|
55146
|
-
let e = y.useContext(
|
|
55161
|
+
var KR = /* @__PURE__ */ y.createContext(void 0);
|
|
55162
|
+
process.env.NODE_ENV !== "production" && (KR.displayName = "CollapsibleRootContext");
|
|
55163
|
+
function qR() {
|
|
55164
|
+
let e = y.useContext(KR);
|
|
55147
55165
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? fc(15) : "Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.");
|
|
55148
55166
|
return e;
|
|
55149
55167
|
}
|
|
55150
55168
|
//#endregion
|
|
55151
55169
|
//#region ../../node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelDataAttributes.mjs
|
|
55152
|
-
var
|
|
55170
|
+
var JR = function(e) {
|
|
55153
55171
|
return e.open = "data-open", e.closed = "data-closed", e[e.startingStyle = Jd.startingStyle] = "startingStyle", e[e.endingStyle = Jd.endingStyle] = "endingStyle", e;
|
|
55154
|
-
}({}),
|
|
55172
|
+
}({}), YR = /* @__PURE__ */ function(e) {
|
|
55155
55173
|
return e.panelOpen = "data-panel-open", e;
|
|
55156
|
-
}({}),
|
|
55157
|
-
return e ? { [
|
|
55158
|
-
} },
|
|
55174
|
+
}({}), XR = { [JR.open]: "" }, ZR = { [JR.closed]: "" }, QR = { open(e) {
|
|
55175
|
+
return e ? { [YR.panelOpen]: "" } : null;
|
|
55176
|
+
} }, $R = {
|
|
55159
55177
|
open(e) {
|
|
55160
|
-
return e ?
|
|
55178
|
+
return e ? XR : ZR;
|
|
55161
55179
|
},
|
|
55162
55180
|
...Zd
|
|
55163
|
-
},
|
|
55164
|
-
let { render: n, className: r, defaultOpen: i = !1, disabled: a = !1, onOpenChange: o, open: s, style: c, ...l } = e, u = J(o), d =
|
|
55181
|
+
}, ez = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
55182
|
+
let { render: n, className: r, defaultOpen: i = !1, disabled: a = !1, onOpenChange: o, open: s, style: c, ...l } = e, u = J(o), d = GR({
|
|
55165
55183
|
open: s,
|
|
55166
55184
|
defaultOpen: i,
|
|
55167
55185
|
onOpenChange: u,
|
|
@@ -55186,21 +55204,21 @@ var GR = function(e) {
|
|
|
55186
55204
|
state: f,
|
|
55187
55205
|
ref: t,
|
|
55188
55206
|
props: l,
|
|
55189
|
-
stateAttributesMapping:
|
|
55207
|
+
stateAttributesMapping: $R
|
|
55190
55208
|
});
|
|
55191
|
-
return /* @__PURE__ */ V(
|
|
55209
|
+
return /* @__PURE__ */ V(KR.Provider, {
|
|
55192
55210
|
value: p,
|
|
55193
55211
|
children: m
|
|
55194
55212
|
});
|
|
55195
55213
|
});
|
|
55196
|
-
process.env.NODE_ENV !== "production" && (
|
|
55214
|
+
process.env.NODE_ENV !== "production" && (ez.displayName = "CollapsibleRoot");
|
|
55197
55215
|
//#endregion
|
|
55198
55216
|
//#region ../../node_modules/@base-ui/react/collapsible/trigger/CollapsibleTrigger.mjs
|
|
55199
|
-
var
|
|
55200
|
-
...
|
|
55217
|
+
var tz = {
|
|
55218
|
+
...QR,
|
|
55201
55219
|
...Zd
|
|
55202
|
-
},
|
|
55203
|
-
let { panelId: n, open: r, handleTrigger: i, state: a, disabled: o } =
|
|
55220
|
+
}, nz = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
55221
|
+
let { panelId: n, open: r, handleTrigger: i, state: a, disabled: o } = qR(), { className: s, disabled: c = o, render: l, nativeButton: u = !0, style: d, ...f } = e, { getButtonProps: p, buttonRef: m } = Tp({
|
|
55204
55222
|
disabled: c,
|
|
55205
55223
|
focusableWhenDisabled: !0,
|
|
55206
55224
|
native: u
|
|
@@ -55217,18 +55235,18 @@ var QR = {
|
|
|
55217
55235
|
f,
|
|
55218
55236
|
p
|
|
55219
55237
|
],
|
|
55220
|
-
stateAttributesMapping:
|
|
55238
|
+
stateAttributesMapping: tz
|
|
55221
55239
|
});
|
|
55222
55240
|
});
|
|
55223
|
-
process.env.NODE_ENV !== "production" && (
|
|
55241
|
+
process.env.NODE_ENV !== "production" && (nz.displayName = "CollapsibleTrigger");
|
|
55224
55242
|
//#endregion
|
|
55225
55243
|
//#region ../../node_modules/@base-ui/react/collapsible/panel/useCollapsiblePanel.mjs
|
|
55226
|
-
var
|
|
55244
|
+
var rz = {
|
|
55227
55245
|
height: void 0,
|
|
55228
55246
|
width: void 0
|
|
55229
55247
|
};
|
|
55230
|
-
function
|
|
55231
|
-
let { externalRef: t, hiddenUntilFound: n, id: r, keepMounted: i, mounted: a, onOpenChange: o, open: s, setMounted: c, setOpen: l, transitionStatus: u } = e, d = y.useRef(null), f = y.useRef(null), [p, m] = y.useState(
|
|
55248
|
+
function iz(e) {
|
|
55249
|
+
let { externalRef: t, hiddenUntilFound: n, id: r, keepMounted: i, mounted: a, onOpenChange: o, open: s, setMounted: c, setOpen: l, transitionStatus: u } = e, d = y.useRef(null), f = y.useRef(null), [p, m] = y.useState(rz), h = y.useRef(rz), g = y.useRef(!1), _ = y.useRef(s), v = y.useRef(!1), [b, x] = y.useState(!1), S = y.useRef(null), C = xo(t, d), w = Do({
|
|
55232
55250
|
mounted: a,
|
|
55233
55251
|
open: s
|
|
55234
55252
|
}), T = Qd(d, !1, !1), E = !s && !a, D = b ? "idle" : u, O = s && (_.current || v.current), k = !s && a && f.current === "css-animation" && p.height === void 0 && p.width === void 0 ? h.current : p, A = n && E && f.current !== "css-animation", j = J((e, t = !0) => {
|
|
@@ -55250,37 +55268,37 @@ function tz(e) {
|
|
|
55250
55268
|
let e = d.current;
|
|
55251
55269
|
if (!e) return;
|
|
55252
55270
|
!s && S.current && M();
|
|
55253
|
-
let t =
|
|
55271
|
+
let t = oz(e, O);
|
|
55254
55272
|
if (f.current = t, s && u === "idle" && _.current && t === "css-animation") {
|
|
55255
|
-
h.current =
|
|
55273
|
+
h.current = az(e);
|
|
55256
55274
|
return;
|
|
55257
55275
|
}
|
|
55258
55276
|
if (s && u === "starting") {
|
|
55259
55277
|
let n = g.current;
|
|
55260
55278
|
if (g.current = !1, t === "none") {
|
|
55261
|
-
j(
|
|
55279
|
+
j(az(e)), x(!0);
|
|
55262
55280
|
return;
|
|
55263
55281
|
}
|
|
55264
55282
|
if (t === "css-transition") {
|
|
55265
|
-
let t =
|
|
55266
|
-
return j(
|
|
55283
|
+
let t = lz(e);
|
|
55284
|
+
return j(az(e)), n ? (N(cz(e, "transition-duration", "0s")), x(!0), t) : t;
|
|
55267
55285
|
}
|
|
55268
55286
|
if (t === "css-animation") {
|
|
55269
|
-
if (j(
|
|
55270
|
-
|
|
55287
|
+
if (j(az(e)), !n) {
|
|
55288
|
+
cz(e, "animation-name", "none")();
|
|
55271
55289
|
return;
|
|
55272
55290
|
}
|
|
55273
|
-
let t =
|
|
55291
|
+
let t = cz(e, "animation-name", "none"), r = cz(e, "animation-duration", "0s");
|
|
55274
55292
|
t(), N(r), x(!0);
|
|
55275
55293
|
return;
|
|
55276
55294
|
}
|
|
55277
55295
|
}
|
|
55278
55296
|
if (!s && a && (u === "idle" || u === "starting")) {
|
|
55279
55297
|
if (_.current = !1, v.current = !1, t === "none") {
|
|
55280
|
-
j(
|
|
55298
|
+
j(rz, !1), c(!1);
|
|
55281
55299
|
return;
|
|
55282
55300
|
}
|
|
55283
|
-
j(
|
|
55301
|
+
j(az(e));
|
|
55284
55302
|
return;
|
|
55285
55303
|
}
|
|
55286
55304
|
if (u !== "ending") return;
|
|
@@ -55288,12 +55306,12 @@ function tz(e) {
|
|
|
55288
55306
|
c(!1);
|
|
55289
55307
|
return;
|
|
55290
55308
|
}
|
|
55291
|
-
let n =
|
|
55309
|
+
let n = az(e);
|
|
55292
55310
|
if (!((n.height ?? 0) > 0 || (n.width ?? 0) > 0)) {
|
|
55293
55311
|
c(!1);
|
|
55294
55312
|
return;
|
|
55295
55313
|
}
|
|
55296
|
-
j(n), t === "css-animation" &&
|
|
55314
|
+
j(n), t === "css-animation" && cz(e, "animation-name", "none")();
|
|
55297
55315
|
}, [
|
|
55298
55316
|
a,
|
|
55299
55317
|
s,
|
|
@@ -55308,13 +55326,13 @@ function tz(e) {
|
|
|
55308
55326
|
open: !0,
|
|
55309
55327
|
ref: d,
|
|
55310
55328
|
onComplete() {
|
|
55311
|
-
s && j(
|
|
55329
|
+
s && j(rz, !1);
|
|
55312
55330
|
}
|
|
55313
55331
|
}), y.useEffect(() => {
|
|
55314
55332
|
if (s || !a || D !== "ending" || !d.current) return;
|
|
55315
55333
|
let e = new AbortController(), t = -1;
|
|
55316
55334
|
function n() {
|
|
55317
|
-
w.current.open || (c(!1), j(
|
|
55335
|
+
w.current.open || (c(!1), j(rz, !1));
|
|
55318
55336
|
}
|
|
55319
55337
|
return t = fa.request(() => {
|
|
55320
55338
|
e.signal.aborted || T(n, e.signal);
|
|
@@ -55345,7 +55363,7 @@ function tz(e) {
|
|
|
55345
55363
|
return {
|
|
55346
55364
|
height: k.height,
|
|
55347
55365
|
props: {
|
|
55348
|
-
...A ? { [
|
|
55366
|
+
...A ? { [JR.startingStyle]: "" } : void 0,
|
|
55349
55367
|
hidden: E,
|
|
55350
55368
|
id: r
|
|
55351
55369
|
},
|
|
@@ -55356,20 +55374,20 @@ function tz(e) {
|
|
|
55356
55374
|
width: k.width
|
|
55357
55375
|
};
|
|
55358
55376
|
}
|
|
55359
|
-
function
|
|
55377
|
+
function az(e) {
|
|
55360
55378
|
return {
|
|
55361
55379
|
height: e.scrollHeight,
|
|
55362
55380
|
width: e.scrollWidth
|
|
55363
55381
|
};
|
|
55364
55382
|
}
|
|
55365
|
-
function
|
|
55366
|
-
let n = _i(e).getComputedStyle(e), r = (n.animationName.split(",").map((e) => e.trim()).some((e) => e !== "" && e !== "none") || t) &&
|
|
55383
|
+
function oz(e, t = !1) {
|
|
55384
|
+
let n = _i(e).getComputedStyle(e), r = (n.animationName.split(",").map((e) => e.trim()).some((e) => e !== "" && e !== "none") || t) && sz(n.animationDuration), i = sz(n.transitionDuration);
|
|
55367
55385
|
return r && i ? (process.env.NODE_ENV !== "production" && vc("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.", "Only one of either animation type should be used."), "css-transition") : i ? "css-transition" : r ? "css-animation" : "none";
|
|
55368
55386
|
}
|
|
55369
|
-
function
|
|
55387
|
+
function sz(e) {
|
|
55370
55388
|
return e.split(",").map((e) => e.trim()).some((e) => e !== "" && Number.parseFloat(e) > 0);
|
|
55371
55389
|
}
|
|
55372
|
-
function
|
|
55390
|
+
function cz(e, t, n) {
|
|
55373
55391
|
let r = e.style.getPropertyValue(t), i = e.style.getPropertyPriority(t);
|
|
55374
55392
|
return e.style.setProperty(t, n), () => {
|
|
55375
55393
|
if (r === "") {
|
|
@@ -55379,7 +55397,7 @@ function az(e, t, n) {
|
|
|
55379
55397
|
e.style.setProperty(t, r, i);
|
|
55380
55398
|
};
|
|
55381
55399
|
}
|
|
55382
|
-
function
|
|
55400
|
+
function lz(e) {
|
|
55383
55401
|
let t = {
|
|
55384
55402
|
"justify-content": e.style.justifyContent,
|
|
55385
55403
|
"align-items": e.style.alignItems,
|
|
@@ -55405,20 +55423,20 @@ function oz(e) {
|
|
|
55405
55423
|
}
|
|
55406
55424
|
//#endregion
|
|
55407
55425
|
//#region ../../node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelCssVars.mjs
|
|
55408
|
-
var
|
|
55426
|
+
var uz = /* @__PURE__ */ function(e) {
|
|
55409
55427
|
return e.collapsiblePanelHeight = "--collapsible-panel-height", e.collapsiblePanelWidth = "--collapsible-panel-width", e;
|
|
55410
|
-
}({}),
|
|
55428
|
+
}({}), dz = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
55411
55429
|
let { className: n, hiddenUntilFound: r, keepMounted: i, render: a, id: o, style: s, ...c } = e;
|
|
55412
55430
|
process.env.NODE_ENV !== "production" && K(() => {
|
|
55413
55431
|
r && i === !1 && vc("The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.");
|
|
55414
55432
|
}, [r, i]);
|
|
55415
|
-
let { mounted: l, onOpenChange: u, open: d, panelId: f, setMounted: p, setPanelIdState: m, setOpen: h, state: g, transitionStatus: _ } =
|
|
55433
|
+
let { mounted: l, onOpenChange: u, open: d, panelId: f, setMounted: p, setPanelIdState: m, setOpen: h, state: g, transitionStatus: _ } = qR(), v = r ?? !1, y = i ?? !1;
|
|
55416
55434
|
K(() => {
|
|
55417
55435
|
if (o) return m(o), () => {
|
|
55418
55436
|
m(void 0);
|
|
55419
55437
|
};
|
|
55420
55438
|
}, [o, m]);
|
|
55421
|
-
let { height: b, props: x, ref: S, shouldPreventOpenAnimation: C, shouldRender: w, transitionStatus: T, width: E } =
|
|
55439
|
+
let { height: b, props: x, ref: S, shouldPreventOpenAnimation: C, shouldRender: w, transitionStatus: T, width: E } = iz({
|
|
55422
55440
|
externalRef: t,
|
|
55423
55441
|
hiddenUntilFound: v,
|
|
55424
55442
|
id: f,
|
|
@@ -55441,45 +55459,45 @@ var sz = /* @__PURE__ */ function(e) {
|
|
|
55441
55459
|
props: [
|
|
55442
55460
|
x,
|
|
55443
55461
|
{ style: {
|
|
55444
|
-
[
|
|
55445
|
-
[
|
|
55462
|
+
[uz.collapsiblePanelHeight]: b === void 0 ? "auto" : `${b}px`,
|
|
55463
|
+
[uz.collapsiblePanelWidth]: E === void 0 ? "auto" : `${E}px`
|
|
55446
55464
|
} },
|
|
55447
55465
|
c,
|
|
55448
55466
|
O ? { style: O } : void 0,
|
|
55449
55467
|
C ? { style: { animationName: "none" } } : void 0
|
|
55450
55468
|
],
|
|
55451
|
-
stateAttributesMapping:
|
|
55469
|
+
stateAttributesMapping: $R
|
|
55452
55470
|
});
|
|
55453
55471
|
return w ? k : null;
|
|
55454
55472
|
});
|
|
55455
|
-
process.env.NODE_ENV !== "production" && (
|
|
55473
|
+
process.env.NODE_ENV !== "production" && (dz.displayName = "CollapsiblePanel");
|
|
55456
55474
|
//#endregion
|
|
55457
55475
|
//#region src/components/ui/collapsible.tsx
|
|
55458
|
-
var
|
|
55476
|
+
var fz = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(ez, {
|
|
55459
55477
|
render: lm(e, t),
|
|
55460
55478
|
ref: r,
|
|
55461
55479
|
...n,
|
|
55462
55480
|
children: t
|
|
55463
55481
|
}));
|
|
55464
|
-
|
|
55465
|
-
var
|
|
55482
|
+
fz.displayName = "Collapsible";
|
|
55483
|
+
var pz = y.forwardRef(({ className: e, asChild: t = !1, children: n, ...r }, i) => /* @__PURE__ */ V(nz, {
|
|
55466
55484
|
className: U("cursor-pointer disabled:cursor-not-allowed", e),
|
|
55467
55485
|
render: lm(t, n),
|
|
55468
55486
|
ref: i,
|
|
55469
55487
|
...r,
|
|
55470
55488
|
children: n
|
|
55471
55489
|
}));
|
|
55472
|
-
|
|
55473
|
-
var
|
|
55490
|
+
pz.displayName = "CollapsibleTrigger";
|
|
55491
|
+
var mz = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(dz, {
|
|
55474
55492
|
render: lm(e, t),
|
|
55475
55493
|
ref: r,
|
|
55476
55494
|
...n,
|
|
55477
55495
|
children: t
|
|
55478
55496
|
}));
|
|
55479
|
-
|
|
55497
|
+
mz.displayName = "CollapsibleContent";
|
|
55480
55498
|
//#endregion
|
|
55481
55499
|
//#region src/components/ai-elements/code-block.tsx
|
|
55482
|
-
var
|
|
55500
|
+
var hz = w({ code: "" }), gz = {
|
|
55483
55501
|
name: "line-numbers",
|
|
55484
55502
|
line(e, t) {
|
|
55485
55503
|
e.children.unshift({
|
|
@@ -55500,8 +55518,8 @@ var fz = w({ code: "" }), pz = {
|
|
|
55500
55518
|
});
|
|
55501
55519
|
}
|
|
55502
55520
|
};
|
|
55503
|
-
async function
|
|
55504
|
-
let r = n ? [
|
|
55521
|
+
async function _z(e, t, n = !1) {
|
|
55522
|
+
let r = n ? [gz] : [];
|
|
55505
55523
|
return await Promise.all([qe(e, {
|
|
55506
55524
|
lang: t,
|
|
55507
55525
|
theme: "one-light",
|
|
@@ -55512,11 +55530,11 @@ async function mz(e, t, n = !1) {
|
|
|
55512
55530
|
transformers: r
|
|
55513
55531
|
})]);
|
|
55514
55532
|
}
|
|
55515
|
-
var
|
|
55533
|
+
var vz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, children: i, ...a }) => {
|
|
55516
55534
|
let [o, s] = z(""), [c, l] = z("");
|
|
55517
55535
|
j(() => {
|
|
55518
55536
|
let r = !1;
|
|
55519
|
-
return s(""), l(""),
|
|
55537
|
+
return s(""), l(""), _z(e, t, n).then(([e, t]) => {
|
|
55520
55538
|
r || (s(e), l(t));
|
|
55521
55539
|
}), () => {
|
|
55522
55540
|
r = !0;
|
|
@@ -55527,7 +55545,7 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55527
55545
|
n
|
|
55528
55546
|
]);
|
|
55529
55547
|
let u = o.length > 0 && c.length > 0;
|
|
55530
|
-
return /* @__PURE__ */ V(
|
|
55548
|
+
return /* @__PURE__ */ V(hz.Provider, {
|
|
55531
55549
|
value: { code: e },
|
|
55532
55550
|
children: /* @__PURE__ */ V("div", {
|
|
55533
55551
|
className: U("group relative w-full overflow-hidden rounded-md border bg-background text-foreground", r),
|
|
@@ -55550,10 +55568,10 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55550
55568
|
})
|
|
55551
55569
|
})
|
|
55552
55570
|
});
|
|
55553
|
-
},
|
|
55571
|
+
}, yz = ({ className: e, ...t }) => /* @__PURE__ */ V(fz, {
|
|
55554
55572
|
className: U("group not-prose w-full rounded-md border", e),
|
|
55555
55573
|
...t
|
|
55556
|
-
}),
|
|
55574
|
+
}), bz = {
|
|
55557
55575
|
"approval-requested": "Awaiting Approval",
|
|
55558
55576
|
"approval-responded": "Responded",
|
|
55559
55577
|
"input-available": "Running",
|
|
@@ -55561,7 +55579,7 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55561
55579
|
"output-available": "Completed",
|
|
55562
55580
|
"output-denied": "Denied",
|
|
55563
55581
|
"output-error": "Error"
|
|
55564
|
-
},
|
|
55582
|
+
}, xz = {
|
|
55565
55583
|
"approval-requested": /* @__PURE__ */ V(_h, { className: "size-4 text-muted-foreground" }),
|
|
55566
55584
|
"approval-responded": /* @__PURE__ */ V(mh, { className: "size-4 text-foreground" }),
|
|
55567
55585
|
"input-available": /* @__PURE__ */ V(_h, { className: "size-4 animate-pulse" }),
|
|
@@ -55569,32 +55587,32 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55569
55587
|
"output-available": /* @__PURE__ */ V(mh, { className: "size-4 text-foreground" }),
|
|
55570
55588
|
"output-denied": /* @__PURE__ */ V(hh, { className: "size-4 text-muted-foreground" }),
|
|
55571
55589
|
"output-error": /* @__PURE__ */ V(hh, { className: "size-4 text-destructive" })
|
|
55572
|
-
},
|
|
55590
|
+
}, Sz = (e, t) => t?.isAutomatic && t.approved === !0 ? "Auto-approved" : e === "approval-responded" && t?.approved === !0 ? "Approved" : bz[e], Cz = (e, t) => /* @__PURE__ */ H(WR, {
|
|
55573
55591
|
className: "gap-1.5 rounded-full text-xs",
|
|
55574
55592
|
variant: "secondary",
|
|
55575
|
-
children: [
|
|
55576
|
-
}),
|
|
55577
|
-
let
|
|
55578
|
-
return /* @__PURE__ */ H(
|
|
55593
|
+
children: [xz[e], Sz(e, t)]
|
|
55594
|
+
}), wz = ({ className: e, title: t, type: n, state: r, toolName: i, approval: a, ...o }) => {
|
|
55595
|
+
let s = n === "dynamic-tool" ? i : n.split("-").slice(1).join("-");
|
|
55596
|
+
return /* @__PURE__ */ H(pz, {
|
|
55579
55597
|
className: U("flex w-full items-center justify-between gap-4 p-3", e),
|
|
55580
|
-
...
|
|
55598
|
+
...o,
|
|
55581
55599
|
children: [/* @__PURE__ */ H("div", {
|
|
55582
55600
|
className: "flex items-center gap-2",
|
|
55583
55601
|
children: [
|
|
55584
55602
|
/* @__PURE__ */ V(Th, { className: "size-4 text-muted-foreground" }),
|
|
55585
55603
|
/* @__PURE__ */ V("span", {
|
|
55586
55604
|
className: "font-medium text-sm",
|
|
55587
|
-
children: t ??
|
|
55605
|
+
children: t ?? s
|
|
55588
55606
|
}),
|
|
55589
|
-
|
|
55607
|
+
Cz(r, a)
|
|
55590
55608
|
]
|
|
55591
55609
|
}), /* @__PURE__ */ V(dh, { className: "size-4 text-muted-foreground group-data-open:rotate-180" })]
|
|
55592
55610
|
});
|
|
55593
|
-
},
|
|
55611
|
+
}, Tz = ({ className: e, ...t }) => /* @__PURE__ */ V(mz, {
|
|
55594
55612
|
className: U("space-y-4 p-4 text-popover-foreground outline-none", e),
|
|
55595
55613
|
...t
|
|
55596
|
-
}),
|
|
55597
|
-
let [r, i] = z(!1), a = JSON.stringify(t, null, 2) ?? String(t), o = a.split("\n").length >
|
|
55614
|
+
}), Ez = 5, Dz = ({ className: e, input: t, ...n }) => {
|
|
55615
|
+
let [r, i] = z(!1), a = JSON.stringify(t, null, 2) ?? String(t), o = a.split("\n").length > Ez && !r;
|
|
55598
55616
|
return /* @__PURE__ */ H("div", {
|
|
55599
55617
|
className: U("space-y-2 overflow-hidden", e),
|
|
55600
55618
|
...n,
|
|
@@ -55603,7 +55621,7 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55603
55621
|
children: "Parameters"
|
|
55604
55622
|
}), /* @__PURE__ */ H("div", {
|
|
55605
55623
|
className: "relative rounded-md bg-muted/50",
|
|
55606
|
-
children: [/* @__PURE__ */ V(
|
|
55624
|
+
children: [/* @__PURE__ */ V(vz, {
|
|
55607
55625
|
className: U("transition-[max-height] duration-200", o && "max-h-[8.25rem]"),
|
|
55608
55626
|
code: a,
|
|
55609
55627
|
language: "json"
|
|
@@ -55618,13 +55636,13 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55618
55636
|
})] })]
|
|
55619
55637
|
})]
|
|
55620
55638
|
});
|
|
55621
|
-
},
|
|
55639
|
+
}, Oz = ({ className: e, output: t, errorText: n, ...r }) => {
|
|
55622
55640
|
if (!(t || n)) return null;
|
|
55623
55641
|
let i = /* @__PURE__ */ V("div", { children: t });
|
|
55624
|
-
return typeof t == "object" && !D(t) ? i = /* @__PURE__ */ V(
|
|
55642
|
+
return typeof t == "object" && !D(t) ? i = /* @__PURE__ */ V(vz, {
|
|
55625
55643
|
code: JSON.stringify(t, null, 2),
|
|
55626
55644
|
language: "json"
|
|
55627
|
-
}) : typeof t == "string" && (i = /* @__PURE__ */ V(
|
|
55645
|
+
}) : typeof t == "string" && (i = /* @__PURE__ */ V(vz, {
|
|
55628
55646
|
code: t,
|
|
55629
55647
|
language: "json"
|
|
55630
55648
|
})), /* @__PURE__ */ H("div", {
|
|
@@ -55638,7 +55656,7 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55638
55656
|
children: [n && /* @__PURE__ */ V("div", { children: n }), i]
|
|
55639
55657
|
})]
|
|
55640
55658
|
});
|
|
55641
|
-
},
|
|
55659
|
+
}, kz = (e, t) => {
|
|
55642
55660
|
switch (e) {
|
|
55643
55661
|
case "create": return t === "present" ? "Creating" : "Created";
|
|
55644
55662
|
case "update": return t === "present" ? "Updating" : "Updated";
|
|
@@ -55646,7 +55664,7 @@ var hz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
55646
55664
|
default: return null;
|
|
55647
55665
|
}
|
|
55648
55666
|
};
|
|
55649
|
-
function
|
|
55667
|
+
function Az({ type: e, result: t, isReadonly: n }) {
|
|
55650
55668
|
let { setArtifact: r } = ES();
|
|
55651
55669
|
return /* @__PURE__ */ H("button", {
|
|
55652
55670
|
className: "flex w-fit cursor-pointer flex-row items-center gap-2 rounded-xl border bg-background px-3 py-2",
|
|
@@ -55677,12 +55695,12 @@ function Ez({ type: e, result: t, isReadonly: n }) {
|
|
|
55677
55695
|
children: e === "create" ? /* @__PURE__ */ V(st, {}) : e === "update" ? /* @__PURE__ */ V(lt, {}) : e === "request-suggestions" ? /* @__PURE__ */ V(mt, {}) : null
|
|
55678
55696
|
}), /* @__PURE__ */ V("div", {
|
|
55679
55697
|
className: "text-left",
|
|
55680
|
-
children: `${
|
|
55698
|
+
children: `${kz(e, "past")} "${t.title}"`
|
|
55681
55699
|
})]
|
|
55682
55700
|
});
|
|
55683
55701
|
}
|
|
55684
|
-
var
|
|
55685
|
-
function
|
|
55702
|
+
var jz = O(Az, () => !0);
|
|
55703
|
+
function Mz({ type: e, args: t, isReadonly: n }) {
|
|
55686
55704
|
let { setArtifact: r } = ES();
|
|
55687
55705
|
return /* @__PURE__ */ H("button", {
|
|
55688
55706
|
className: "flex w-fit cursor-pointer flex-row items-start justify-between gap-3 rounded-xl border px-3 py-2",
|
|
@@ -55711,7 +55729,7 @@ function Oz({ type: e, args: t, isReadonly: n }) {
|
|
|
55711
55729
|
children: e === "create" ? /* @__PURE__ */ V(st, {}) : e === "update" ? /* @__PURE__ */ V(lt, {}) : e === "request-suggestions" ? /* @__PURE__ */ V(mt, {}) : null
|
|
55712
55730
|
}), /* @__PURE__ */ V("div", {
|
|
55713
55731
|
className: "text-left",
|
|
55714
|
-
children: `${
|
|
55732
|
+
children: `${kz(e, "present")} ${e === "create" && "title" in t && t.title ? `"${t.title}"` : e === "update" && "description" in t ? `"${t.description}"` : e === "request-suggestions" ? "for document" : ""}`
|
|
55715
55733
|
})]
|
|
55716
55734
|
}), /* @__PURE__ */ V("div", {
|
|
55717
55735
|
className: "mt-1 animate-spin",
|
|
@@ -55719,10 +55737,10 @@ function Oz({ type: e, args: t, isReadonly: n }) {
|
|
|
55719
55737
|
})]
|
|
55720
55738
|
});
|
|
55721
55739
|
}
|
|
55722
|
-
O(
|
|
55740
|
+
O(Mz, () => !0);
|
|
55723
55741
|
//#endregion
|
|
55724
55742
|
//#region src/components/document-preview.tsx
|
|
55725
|
-
function
|
|
55743
|
+
function Nz({ isReadonly: e, result: t, args: n }) {
|
|
55726
55744
|
let { artifact: r, setArtifact: i } = ES(), { data: a, isLoading: o } = NR(t?.id ?? "", !!t?.id), s = L(() => a?.[0], [a]), c = R(null);
|
|
55727
55745
|
if (j(() => {
|
|
55728
55746
|
let e = c.current?.getBoundingClientRect();
|
|
@@ -55739,7 +55757,7 @@ function kz({ isReadonly: e, result: t, args: n }) {
|
|
|
55739
55757
|
let e = t?.kind ?? n?.kind ?? r.kind, i = t?.title ?? n?.title ?? r.title;
|
|
55740
55758
|
return /* @__PURE__ */ H("div", {
|
|
55741
55759
|
className: "w-full max-w-[450px]",
|
|
55742
|
-
children: [i ? /* @__PURE__ */ V(
|
|
55760
|
+
children: [i ? /* @__PURE__ */ V(Iz, {
|
|
55743
55761
|
isStreaming: !0,
|
|
55744
55762
|
kind: e,
|
|
55745
55763
|
title: i
|
|
@@ -55766,21 +55784,21 @@ function kz({ isReadonly: e, result: t, args: n }) {
|
|
|
55766
55784
|
return l ? /* @__PURE__ */ H("div", {
|
|
55767
55785
|
className: "relative w-full max-w-[450px] cursor-pointer",
|
|
55768
55786
|
children: [
|
|
55769
|
-
/* @__PURE__ */ V(
|
|
55787
|
+
/* @__PURE__ */ V(Fz, {
|
|
55770
55788
|
hitboxRef: c,
|
|
55771
55789
|
result: t,
|
|
55772
55790
|
setArtifact: i
|
|
55773
55791
|
}),
|
|
55774
|
-
/* @__PURE__ */ V(
|
|
55792
|
+
/* @__PURE__ */ V(Iz, {
|
|
55775
55793
|
isStreaming: r.status === "streaming",
|
|
55776
55794
|
kind: l.kind,
|
|
55777
55795
|
title: l.title
|
|
55778
55796
|
}),
|
|
55779
|
-
/* @__PURE__ */ V(
|
|
55797
|
+
/* @__PURE__ */ V(Lz, { document: l })
|
|
55780
55798
|
]
|
|
55781
|
-
}) : /* @__PURE__ */ V(
|
|
55799
|
+
}) : /* @__PURE__ */ V(Pz, { artifactKind: r.kind });
|
|
55782
55800
|
}
|
|
55783
|
-
var
|
|
55801
|
+
var Pz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
|
|
55784
55802
|
className: "w-full max-w-[450px]",
|
|
55785
55803
|
children: [/* @__PURE__ */ H("div", {
|
|
55786
55804
|
className: "flex flex-row items-center justify-between gap-2 rounded-t-2xl border border-b-0 border-border/50 px-4 py-3 dark:bg-muted",
|
|
@@ -55795,7 +55813,7 @@ var Az = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
|
|
|
55795
55813
|
className: "h-[257px] overflow-hidden rounded-b-2xl border border-t-0 border-border/50 bg-muted p-6",
|
|
55796
55814
|
children: /* @__PURE__ */ V(cR, {})
|
|
55797
55815
|
})]
|
|
55798
|
-
}),
|
|
55816
|
+
}), Fz = O(({ hitboxRef: e, result: t, setArtifact: n }) => {
|
|
55799
55817
|
let r = k((e) => {
|
|
55800
55818
|
let r = e.currentTarget.getBoundingClientRect();
|
|
55801
55819
|
n((e) => ({
|
|
@@ -55826,7 +55844,7 @@ var Az = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
|
|
|
55826
55844
|
})
|
|
55827
55845
|
})
|
|
55828
55846
|
});
|
|
55829
|
-
}, (e, t) => !!ve(e.result, t.result)),
|
|
55847
|
+
}, (e, t) => !!ve(e.result, t.result)), Iz = O(({ title: e, kind: t, isStreaming: n }) => /* @__PURE__ */ H("div", {
|
|
55830
55848
|
className: "flex flex-row items-center justify-between gap-2 rounded-t-2xl border border-b-0 border-border/50 px-4 py-3 dark:bg-muted",
|
|
55831
55849
|
children: [/* @__PURE__ */ H("div", {
|
|
55832
55850
|
className: "flex flex-row items-center gap-2.5",
|
|
@@ -55841,7 +55859,7 @@ var Az = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
|
|
|
55841
55859
|
children: e
|
|
55842
55860
|
})]
|
|
55843
55861
|
}), /* @__PURE__ */ V("div", { className: "w-8" })]
|
|
55844
|
-
}), (e, t) => !(e.title !== t.title || e.isStreaming !== t.isStreaming)),
|
|
55862
|
+
}), (e, t) => !(e.title !== t.title || e.isStreaming !== t.isStreaming)), Lz = ({ document: e }) => {
|
|
55845
55863
|
let { artifact: t } = ES(), n = U("h-[257px] overflow-hidden rounded-b-2xl border border-t-0 border-border/50 dark:bg-muted", {
|
|
55846
55864
|
"p-4 sm:px-10 sm:py-10": e.kind === "text",
|
|
55847
55865
|
"p-0": e.kind === "code"
|
|
@@ -55886,16 +55904,16 @@ var Az = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
|
|
|
55886
55904
|
e.kind === "code" && /* @__PURE__ */ V("div", { className: "pointer-events-none absolute inset-y-0 right-0 w-12 bg-gradient-to-l from-muted to-transparent dark:from-muted" })
|
|
55887
55905
|
]
|
|
55888
55906
|
});
|
|
55889
|
-
},
|
|
55890
|
-
process.env.NODE_ENV !== "production" && (
|
|
55891
|
-
function
|
|
55892
|
-
let e = y.useContext(
|
|
55907
|
+
}, Rz = /* @__PURE__ */ y.createContext(void 0);
|
|
55908
|
+
process.env.NODE_ENV !== "production" && (Rz.displayName = "AvatarRootContext");
|
|
55909
|
+
function zz() {
|
|
55910
|
+
let e = y.useContext(Rz);
|
|
55893
55911
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? fc(13) : "Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>.");
|
|
55894
55912
|
return e;
|
|
55895
55913
|
}
|
|
55896
55914
|
//#endregion
|
|
55897
55915
|
//#region ../../node_modules/@base-ui/react/avatar/root/stateAttributesMapping.mjs
|
|
55898
|
-
var
|
|
55916
|
+
var Bz = { imageLoadingStatus: () => null }, Vz = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
55899
55917
|
let { className: n, render: r, style: i, ...a } = e, [o, s] = y.useState("idle"), c = { imageLoadingStatus: o }, l = y.useMemo(() => ({
|
|
55900
55918
|
imageLoadingStatus: o,
|
|
55901
55919
|
setImageLoadingStatus: s
|
|
@@ -55903,17 +55921,17 @@ var Iz = { imageLoadingStatus: () => null }, Lz = /* @__PURE__ */ y.forwardRef(f
|
|
|
55903
55921
|
state: c,
|
|
55904
55922
|
ref: t,
|
|
55905
55923
|
props: a,
|
|
55906
|
-
stateAttributesMapping:
|
|
55924
|
+
stateAttributesMapping: Bz
|
|
55907
55925
|
});
|
|
55908
|
-
return /* @__PURE__ */ V(
|
|
55926
|
+
return /* @__PURE__ */ V(Rz.Provider, {
|
|
55909
55927
|
value: l,
|
|
55910
55928
|
children: u
|
|
55911
55929
|
});
|
|
55912
55930
|
});
|
|
55913
|
-
process.env.NODE_ENV !== "production" && (
|
|
55931
|
+
process.env.NODE_ENV !== "production" && (Vz.displayName = "AvatarRoot");
|
|
55914
55932
|
//#endregion
|
|
55915
55933
|
//#region ../../node_modules/@base-ui/react/avatar/image/useImageLoadingStatus.mjs
|
|
55916
|
-
function
|
|
55934
|
+
function Hz(e, { referrerPolicy: t, crossOrigin: n, sizes: r, srcSet: i }) {
|
|
55917
55935
|
let [a, o] = y.useState("idle");
|
|
55918
55936
|
return K(() => {
|
|
55919
55937
|
if (!e && !i) return o("error"), ma;
|
|
@@ -55933,11 +55951,11 @@ function Rz(e, { referrerPolicy: t, crossOrigin: n, sizes: r, srcSet: i }) {
|
|
|
55933
55951
|
}
|
|
55934
55952
|
//#endregion
|
|
55935
55953
|
//#region ../../node_modules/@base-ui/react/avatar/image/AvatarImage.mjs
|
|
55936
|
-
var
|
|
55937
|
-
...
|
|
55954
|
+
var Uz = {
|
|
55955
|
+
...Bz,
|
|
55938
55956
|
...Zd
|
|
55939
|
-
},
|
|
55940
|
-
let { className: n, render: r, onLoadingStatusChange: i, style: a, ...o } = e, { setImageLoadingStatus: s } =
|
|
55957
|
+
}, Wz = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
55958
|
+
let { className: n, render: r, onLoadingStatusChange: i, style: a, ...o } = e, { setImageLoadingStatus: s } = zz(), c = Hz(o.src, o), l = c === "loaded", { mounted: u, transitionStatus: d, setMounted: f } = qd(l), p = y.useRef(null), m = J((e) => {
|
|
55941
55959
|
i?.(e), s(e);
|
|
55942
55960
|
});
|
|
55943
55961
|
K(() => {
|
|
@@ -55956,54 +55974,54 @@ var zz = {
|
|
|
55956
55974
|
},
|
|
55957
55975
|
ref: [t, p],
|
|
55958
55976
|
props: o,
|
|
55959
|
-
stateAttributesMapping:
|
|
55977
|
+
stateAttributesMapping: Uz,
|
|
55960
55978
|
enabled: u
|
|
55961
55979
|
});
|
|
55962
55980
|
return u ? h : null;
|
|
55963
55981
|
});
|
|
55964
|
-
process.env.NODE_ENV !== "production" && (
|
|
55982
|
+
process.env.NODE_ENV !== "production" && (Wz.displayName = "AvatarImage");
|
|
55965
55983
|
//#endregion
|
|
55966
55984
|
//#region ../../node_modules/@base-ui/react/avatar/fallback/AvatarFallback.mjs
|
|
55967
|
-
var
|
|
55968
|
-
let { className: n, render: r, delay: i, style: a, ...o } = e, { imageLoadingStatus: s } =
|
|
55985
|
+
var Gz = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
55986
|
+
let { className: n, render: r, delay: i, style: a, ...o } = e, { imageLoadingStatus: s } = zz(), [c, l] = y.useState(i === void 0), u = ca();
|
|
55969
55987
|
return y.useEffect(() => (i === void 0 ? l(!0) : u.start(i, () => l(!0)), u.clear), [u, i]), Lc("span", e, {
|
|
55970
55988
|
state: { imageLoadingStatus: s },
|
|
55971
55989
|
ref: t,
|
|
55972
55990
|
props: o,
|
|
55973
|
-
stateAttributesMapping:
|
|
55991
|
+
stateAttributesMapping: Bz,
|
|
55974
55992
|
enabled: s !== "loaded" && (i === void 0 || c)
|
|
55975
55993
|
});
|
|
55976
55994
|
});
|
|
55977
|
-
process.env.NODE_ENV !== "production" && (
|
|
55995
|
+
process.env.NODE_ENV !== "production" && (Gz.displayName = "AvatarFallback");
|
|
55978
55996
|
//#endregion
|
|
55979
55997
|
//#region src/components/ui/avatar.tsx
|
|
55980
|
-
var
|
|
55998
|
+
var Kz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Vz, {
|
|
55981
55999
|
ref: n,
|
|
55982
56000
|
className: U("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", e),
|
|
55983
56001
|
...t
|
|
55984
56002
|
}));
|
|
55985
|
-
|
|
55986
|
-
var
|
|
56003
|
+
Kz.displayName = "Avatar";
|
|
56004
|
+
var qz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Wz, {
|
|
55987
56005
|
ref: n,
|
|
55988
56006
|
className: U("aspect-square h-full w-full", e),
|
|
55989
56007
|
...t
|
|
55990
56008
|
}));
|
|
55991
|
-
|
|
55992
|
-
var
|
|
56009
|
+
qz.displayName = "AvatarImage";
|
|
56010
|
+
var Jz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Gz, {
|
|
55993
56011
|
ref: n,
|
|
55994
56012
|
className: U("flex h-full w-full items-center justify-center rounded-full bg-muted", e),
|
|
55995
56013
|
...t
|
|
55996
56014
|
}));
|
|
55997
|
-
|
|
55998
|
-
var
|
|
56015
|
+
Jz.displayName = "AvatarFallback";
|
|
56016
|
+
var Yz = ({ children: e, className: t, ...n }) => /* @__PURE__ */ V("div", {
|
|
55999
56017
|
className: U("flex flex-col gap-2 overflow-hidden rounded-lg px-4 py-3 text-foreground text-sm", "group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground", "group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground", "is-user:dark", t),
|
|
56000
56018
|
...n,
|
|
56001
56019
|
children: e
|
|
56002
|
-
}),
|
|
56020
|
+
}), Xz = ({ className: e, children: t, ...n }) => /* @__PURE__ */ V("div", {
|
|
56003
56021
|
className: U("flex items-center gap-1", e),
|
|
56004
56022
|
...n,
|
|
56005
56023
|
children: t
|
|
56006
|
-
}),
|
|
56024
|
+
}), Zz = ({ tooltip: e, children: t, label: n, className: r, variant: i = "ghost", size: a = "sm", ...o }) => {
|
|
56007
56025
|
let s = /* @__PURE__ */ H(Fm, {
|
|
56008
56026
|
className: U("relative size-9 p-1.5 text-muted-foreground hover:text-foreground", r),
|
|
56009
56027
|
size: a,
|
|
@@ -56022,7 +56040,7 @@ var Gz = ({ children: e, className: t, ...n }) => /* @__PURE__ */ V("div", {
|
|
|
56022
56040
|
};
|
|
56023
56041
|
//#endregion
|
|
56024
56042
|
//#region src/components/message-actions.tsx
|
|
56025
|
-
function
|
|
56043
|
+
function Qz({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
|
|
56026
56044
|
let [a, o] = GP(), [s, c] = z();
|
|
56027
56045
|
j(() => {
|
|
56028
56046
|
c(void 0);
|
|
@@ -56036,31 +56054,31 @@ function Jz({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
|
|
|
56036
56054
|
}
|
|
56037
56055
|
await o(u), le.success("Copied to clipboard!");
|
|
56038
56056
|
};
|
|
56039
|
-
return t.role === "user" ? /* @__PURE__ */ V(
|
|
56057
|
+
return t.role === "user" ? /* @__PURE__ */ V(Xz, {
|
|
56040
56058
|
className: "-mr-0.5 justify-end",
|
|
56041
56059
|
children: /* @__PURE__ */ H("div", {
|
|
56042
56060
|
className: "relative",
|
|
56043
|
-
children: [i && /* @__PURE__ */ V(
|
|
56061
|
+
children: [i && /* @__PURE__ */ V(Zz, {
|
|
56044
56062
|
className: "-left-10 absolute top-0 opacity-0 transition-opacity focus-visible:opacity-100 group-hover/message:opacity-100",
|
|
56045
56063
|
"data-testid": "message-edit-button",
|
|
56046
56064
|
onClick: () => i("edit"),
|
|
56047
56065
|
tooltip: "Edit",
|
|
56048
56066
|
children: /* @__PURE__ */ V(lt, {})
|
|
56049
|
-
}), /* @__PURE__ */ V(
|
|
56067
|
+
}), /* @__PURE__ */ V(Zz, {
|
|
56050
56068
|
onClick: d,
|
|
56051
56069
|
tooltip: "Copy",
|
|
56052
56070
|
children: /* @__PURE__ */ V(xt, {})
|
|
56053
56071
|
})]
|
|
56054
56072
|
})
|
|
56055
|
-
}) : /* @__PURE__ */ H(
|
|
56073
|
+
}) : /* @__PURE__ */ H(Xz, {
|
|
56056
56074
|
className: "-ml-0.5",
|
|
56057
56075
|
children: [
|
|
56058
|
-
/* @__PURE__ */ V(
|
|
56076
|
+
/* @__PURE__ */ V(Zz, {
|
|
56059
56077
|
onClick: d,
|
|
56060
56078
|
tooltip: "Copy",
|
|
56061
56079
|
children: /* @__PURE__ */ V(xt, {})
|
|
56062
56080
|
}),
|
|
56063
|
-
/* @__PURE__ */ V(
|
|
56081
|
+
/* @__PURE__ */ V(Zz, {
|
|
56064
56082
|
"data-testid": "message-upvote",
|
|
56065
56083
|
disabled: l?.isUpvoted,
|
|
56066
56084
|
onClick: () => {
|
|
@@ -56088,7 +56106,7 @@ function Jz({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
|
|
|
56088
56106
|
tooltip: "Upvote Response",
|
|
56089
56107
|
children: /* @__PURE__ */ V(St, {})
|
|
56090
56108
|
}),
|
|
56091
|
-
/* @__PURE__ */ V(
|
|
56109
|
+
/* @__PURE__ */ V(Zz, {
|
|
56092
56110
|
"data-testid": "message-downvote",
|
|
56093
56111
|
disabled: l && !l.isUpvoted,
|
|
56094
56112
|
onClick: () => {
|
|
@@ -56119,15 +56137,15 @@ function Jz({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
|
|
|
56119
56137
|
]
|
|
56120
56138
|
});
|
|
56121
56139
|
}
|
|
56122
|
-
var
|
|
56140
|
+
var $z = O(Qz, (e, t) => !(!ve(e.vote, t.vote) || e.isLoading !== t.isLoading)), eB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("textarea", {
|
|
56123
56141
|
className: U("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", e),
|
|
56124
56142
|
ref: n,
|
|
56125
56143
|
...t
|
|
56126
56144
|
}));
|
|
56127
|
-
|
|
56145
|
+
eB.displayName = "Textarea";
|
|
56128
56146
|
//#endregion
|
|
56129
56147
|
//#region src/components/message-editor.tsx
|
|
56130
|
-
function
|
|
56148
|
+
function tB({ message: e, setMode: t, setMessages: n, regenerate: r }) {
|
|
56131
56149
|
let [i, a] = z(!1), [o, s] = z(Nm(e)), c = R(null), l = k(() => {
|
|
56132
56150
|
c.current && (c.current.style.height = "auto", c.current.style.height = `${c.current.scrollHeight + 2}px`);
|
|
56133
56151
|
}, []);
|
|
@@ -56139,7 +56157,7 @@ function Zz({ message: e, setMode: t, setMessages: n, regenerate: r }) {
|
|
|
56139
56157
|
};
|
|
56140
56158
|
return /* @__PURE__ */ H("div", {
|
|
56141
56159
|
className: "flex w-full flex-col gap-2",
|
|
56142
|
-
children: [/* @__PURE__ */ V(
|
|
56160
|
+
children: [/* @__PURE__ */ V(eB, {
|
|
56143
56161
|
className: "w-full resize-none overflow-hidden rounded-xl bg-transparent text-base! outline-hidden",
|
|
56144
56162
|
"data-testid": "message-editor",
|
|
56145
56163
|
onChange: u,
|
|
@@ -56186,7 +56204,7 @@ function Zz({ message: e, setMode: t, setMessages: n, regenerate: r }) {
|
|
|
56186
56204
|
}
|
|
56187
56205
|
//#endregion
|
|
56188
56206
|
//#region src/hooks/use-controllable-state.ts
|
|
56189
|
-
function
|
|
56207
|
+
function nB({ prop: e, defaultProp: t, onChange: n }) {
|
|
56190
56208
|
let [r, i] = y.useState(t), a = e !== void 0, o = a ? e : r;
|
|
56191
56209
|
return [o, y.useCallback((e) => {
|
|
56192
56210
|
let t = typeof e == "function" ? e(o) : e;
|
|
@@ -56199,33 +56217,33 @@ function Qz({ prop: e, defaultProp: t, onChange: n }) {
|
|
|
56199
56217
|
}
|
|
56200
56218
|
//#endregion
|
|
56201
56219
|
//#region src/components/elements/reasoning.tsx
|
|
56202
|
-
var
|
|
56203
|
-
let e = A(
|
|
56220
|
+
var rB = w(null), iB = () => {
|
|
56221
|
+
let e = A(rB);
|
|
56204
56222
|
if (!e) throw Error("Reasoning components must be used within Reasoning");
|
|
56205
56223
|
return e;
|
|
56206
|
-
},
|
|
56207
|
-
let [c, l] =
|
|
56224
|
+
}, aB = 1e3, oB = O(({ className: e, isStreaming: t = !1, open: n, defaultOpen: r = !0, onOpenChange: i, duration: a, children: o, ...s }) => {
|
|
56225
|
+
let [c, l] = nB({
|
|
56208
56226
|
prop: n,
|
|
56209
56227
|
defaultProp: r,
|
|
56210
56228
|
onChange: i
|
|
56211
|
-
}), [u, d] =
|
|
56229
|
+
}), [u, d] = nB({
|
|
56212
56230
|
prop: a,
|
|
56213
56231
|
defaultProp: void 0
|
|
56214
56232
|
}), [f, p] = z(null);
|
|
56215
56233
|
return j(() => {
|
|
56216
|
-
t ? f === null && p(Date.now()) : f !== null && (d(Math.ceil((Date.now() - f) /
|
|
56234
|
+
t ? f === null && p(Date.now()) : f !== null && (d(Math.ceil((Date.now() - f) / aB)), p(null));
|
|
56217
56235
|
}, [
|
|
56218
56236
|
t,
|
|
56219
56237
|
f,
|
|
56220
56238
|
d
|
|
56221
|
-
]), /* @__PURE__ */ V(
|
|
56239
|
+
]), /* @__PURE__ */ V(rB.Provider, {
|
|
56222
56240
|
value: {
|
|
56223
56241
|
isStreaming: t,
|
|
56224
56242
|
isOpen: c,
|
|
56225
56243
|
setIsOpen: l,
|
|
56226
56244
|
duration: u
|
|
56227
56245
|
},
|
|
56228
|
-
children: /* @__PURE__ */ V(
|
|
56246
|
+
children: /* @__PURE__ */ V(fz, {
|
|
56229
56247
|
className: U("not-prose", e),
|
|
56230
56248
|
onOpenChange: (e) => {
|
|
56231
56249
|
l(e);
|
|
@@ -56235,9 +56253,9 @@ var $z = w(null), eB = () => {
|
|
|
56235
56253
|
children: o
|
|
56236
56254
|
})
|
|
56237
56255
|
});
|
|
56238
|
-
}),
|
|
56239
|
-
let { isStreaming: r, isOpen: i, duration: a } =
|
|
56240
|
-
return /* @__PURE__ */ V(
|
|
56256
|
+
}), sB = O(({ className: e, children: t, ...n }) => {
|
|
56257
|
+
let { isStreaming: r, isOpen: i, duration: a } = iB();
|
|
56258
|
+
return /* @__PURE__ */ V(pz, {
|
|
56241
56259
|
className: U("flex items-center gap-1 rounded-md px-1.5 py-0.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", e),
|
|
56242
56260
|
...n,
|
|
56243
56261
|
children: t ?? /* @__PURE__ */ H(ce, { children: [
|
|
@@ -56250,7 +56268,7 @@ var $z = w(null), eB = () => {
|
|
|
56250
56268
|
/* @__PURE__ */ V(dh, { className: U("size-2.5", i ? "rotate-180" : "rotate-0") })
|
|
56251
56269
|
] })
|
|
56252
56270
|
});
|
|
56253
|
-
}),
|
|
56271
|
+
}), cB = O(({ className: e, children: t, ...n }) => /* @__PURE__ */ V(mz, {
|
|
56254
56272
|
className: U("mt-1.5 text-sm text-muted-foreground leading-relaxed outline-hidden", e),
|
|
56255
56273
|
...n,
|
|
56256
56274
|
children: /* @__PURE__ */ V("div", {
|
|
@@ -56261,11 +56279,11 @@ var $z = w(null), eB = () => {
|
|
|
56261
56279
|
})
|
|
56262
56280
|
})
|
|
56263
56281
|
}));
|
|
56264
|
-
|
|
56282
|
+
oB.displayName = "Reasoning", sB.displayName = "ReasoningTrigger", cB.displayName = "ReasoningContent";
|
|
56265
56283
|
//#endregion
|
|
56266
56284
|
//#region src/components/message-reasoning.tsx
|
|
56267
|
-
var
|
|
56268
|
-
function
|
|
56285
|
+
var lB = 300;
|
|
56286
|
+
function uB({ isStreaming: e, reasoning: t }) {
|
|
56269
56287
|
let [n, r] = z(!1), i = t.trim().length > 0, a = R(null), o = R(e);
|
|
56270
56288
|
j(() => {
|
|
56271
56289
|
if (a.current !== null && (window.clearTimeout(a.current), a.current = null), e) {
|
|
@@ -56275,7 +56293,7 @@ function oB({ isStreaming: e, reasoning: t }) {
|
|
|
56275
56293
|
let t = o.current;
|
|
56276
56294
|
if (o.current = !1, !(!t || !i || !n)) return a.current = window.setTimeout(() => {
|
|
56277
56295
|
a.current = null, r(!1);
|
|
56278
|
-
},
|
|
56296
|
+
}, lB), () => {
|
|
56279
56297
|
a.current !== null && (window.clearTimeout(a.current), a.current = null);
|
|
56280
56298
|
};
|
|
56281
56299
|
}, [
|
|
@@ -56286,17 +56304,17 @@ function oB({ isStreaming: e, reasoning: t }) {
|
|
|
56286
56304
|
let s = (e) => {
|
|
56287
56305
|
e && a.current !== null && (window.clearTimeout(a.current), a.current = null), r(e);
|
|
56288
56306
|
};
|
|
56289
|
-
return /* @__PURE__ */ H(
|
|
56307
|
+
return /* @__PURE__ */ H(oB, {
|
|
56290
56308
|
"data-testid": "message-reasoning",
|
|
56291
56309
|
isStreaming: e,
|
|
56292
56310
|
onOpenChange: s,
|
|
56293
56311
|
open: n,
|
|
56294
|
-
children: [/* @__PURE__ */ V(
|
|
56312
|
+
children: [/* @__PURE__ */ V(sB, {}), /* @__PURE__ */ V(cB, { children: i || e ? t : "Reasoning summary unavailable." })]
|
|
56295
56313
|
});
|
|
56296
56314
|
}
|
|
56297
56315
|
//#endregion
|
|
56298
56316
|
//#region src/components/preview-attachment.tsx
|
|
56299
|
-
var
|
|
56317
|
+
var dB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
56300
56318
|
let { name: r, url: i, contentType: a } = e;
|
|
56301
56319
|
return /* @__PURE__ */ H("div", {
|
|
56302
56320
|
className: "group relative size-16 overflow-hidden rounded-lg border bg-muted",
|
|
@@ -56330,7 +56348,7 @@ var sB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
|
56330
56348
|
})
|
|
56331
56349
|
]
|
|
56332
56350
|
});
|
|
56333
|
-
},
|
|
56351
|
+
}, fB = ({ size: e = 40 }) => /* @__PURE__ */ H("svg", {
|
|
56334
56352
|
fill: "none",
|
|
56335
56353
|
height: e,
|
|
56336
56354
|
viewBox: "0 0 24 24",
|
|
@@ -56407,7 +56425,7 @@ var sB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
|
56407
56425
|
y2: "4.22"
|
|
56408
56426
|
})
|
|
56409
56427
|
]
|
|
56410
|
-
}),
|
|
56428
|
+
}), pB = ({ size: e = 40 }) => /* @__PURE__ */ V("svg", {
|
|
56411
56429
|
fill: "none",
|
|
56412
56430
|
height: e,
|
|
56413
56431
|
viewBox: "0 0 24 24",
|
|
@@ -56416,7 +56434,7 @@ var sB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
|
56416
56434
|
d: "M21 12.79A9 9 0 1 1 11.21 3A7 7 0 0 0 21 12.79z",
|
|
56417
56435
|
fill: "currentColor"
|
|
56418
56436
|
})
|
|
56419
|
-
}),
|
|
56437
|
+
}), mB = ({ size: e = 24 }) => /* @__PURE__ */ V("svg", {
|
|
56420
56438
|
fill: "none",
|
|
56421
56439
|
height: e,
|
|
56422
56440
|
viewBox: "0 0 24 24",
|
|
@@ -56427,7 +56445,7 @@ var sB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
|
56427
56445
|
stroke: "currentColor",
|
|
56428
56446
|
strokeWidth: "2"
|
|
56429
56447
|
})
|
|
56430
|
-
}),
|
|
56448
|
+
}), hB = {
|
|
56431
56449
|
latitude: 37.763283,
|
|
56432
56450
|
longitude: -122.41286,
|
|
56433
56451
|
generationtime_ms: .027894974,
|
|
@@ -56583,10 +56601,10 @@ var sB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
|
|
|
56583
56601
|
]
|
|
56584
56602
|
}
|
|
56585
56603
|
};
|
|
56586
|
-
function
|
|
56604
|
+
function gB(e) {
|
|
56587
56605
|
return Math.ceil(e);
|
|
56588
56606
|
}
|
|
56589
|
-
function
|
|
56607
|
+
function _B({ weatherAtLocation: e = hB }) {
|
|
56590
56608
|
let t = Math.max(...e.hourly.temperature_2m.slice(0, 24)), n = Math.min(...e.hourly.temperature_2m.slice(0, 24)), r = li(new Date(e.current.time), {
|
|
56591
56609
|
start: new Date(e.daily.sunrise[0]),
|
|
56592
56610
|
end: new Date(e.daily.sunset[0])
|
|
@@ -56619,10 +56637,10 @@ function pB({ weatherAtLocation: e = dB }) {
|
|
|
56619
56637
|
className: "flex items-center gap-3",
|
|
56620
56638
|
children: [/* @__PURE__ */ V("div", {
|
|
56621
56639
|
className: "text-primary-foreground/90",
|
|
56622
|
-
children: V(r ?
|
|
56640
|
+
children: V(r ? fB : pB, { size: 32 })
|
|
56623
56641
|
}), /* @__PURE__ */ H("div", {
|
|
56624
56642
|
className: "font-light text-3xl text-primary-foreground",
|
|
56625
|
-
children: [
|
|
56643
|
+
children: [gB(e.current.temperature_2m), /* @__PURE__ */ V("span", {
|
|
56626
56644
|
className: "text-lg text-primary-foreground/80",
|
|
56627
56645
|
children: e.current_units.temperature_2m
|
|
56628
56646
|
})]
|
|
@@ -56633,14 +56651,14 @@ function pB({ weatherAtLocation: e = dB }) {
|
|
|
56633
56651
|
className: "font-medium text-primary-foreground/90 text-xs",
|
|
56634
56652
|
children: [
|
|
56635
56653
|
"H: ",
|
|
56636
|
-
|
|
56654
|
+
gB(t),
|
|
56637
56655
|
"°"
|
|
56638
56656
|
]
|
|
56639
56657
|
}), /* @__PURE__ */ H("div", {
|
|
56640
56658
|
className: "text-primary-foreground/70 text-xs",
|
|
56641
56659
|
children: [
|
|
56642
56660
|
"L: ",
|
|
56643
|
-
|
|
56661
|
+
gB(n),
|
|
56644
56662
|
"°"
|
|
56645
56663
|
]
|
|
56646
56664
|
})]
|
|
@@ -56664,11 +56682,11 @@ function pB({ weatherAtLocation: e = dB }) {
|
|
|
56664
56682
|
}),
|
|
56665
56683
|
/* @__PURE__ */ V("div", {
|
|
56666
56684
|
className: "text-primary-foreground/60",
|
|
56667
|
-
children: /* @__PURE__ */ V(
|
|
56685
|
+
children: /* @__PURE__ */ V(mB, { size: 16 })
|
|
56668
56686
|
}),
|
|
56669
56687
|
/* @__PURE__ */ H("div", {
|
|
56670
56688
|
className: "font-medium text-primary-foreground text-xs",
|
|
56671
|
-
children: [
|
|
56689
|
+
children: [gB(l[t]), "°"]
|
|
56672
56690
|
})
|
|
56673
56691
|
]
|
|
56674
56692
|
}, e);
|
|
@@ -56693,7 +56711,7 @@ function pB({ weatherAtLocation: e = dB }) {
|
|
|
56693
56711
|
}
|
|
56694
56712
|
//#endregion
|
|
56695
56713
|
//#region src/components/message.tsx
|
|
56696
|
-
function
|
|
56714
|
+
function vB(e) {
|
|
56697
56715
|
if (typeof e != "string") return e;
|
|
56698
56716
|
try {
|
|
56699
56717
|
return JSON.parse(e);
|
|
@@ -56701,10 +56719,25 @@ function mB(e) {
|
|
|
56701
56719
|
return e;
|
|
56702
56720
|
}
|
|
56703
56721
|
}
|
|
56704
|
-
var
|
|
56705
|
-
function
|
|
56722
|
+
var yB = (e) => typeof e == "object" && !!e, bB = (e) => !yB(e) || typeof e.error != "string" ? null : e.error.trim() || null;
|
|
56723
|
+
function xB(e) {
|
|
56724
|
+
if (typeof e != "string") return null;
|
|
56725
|
+
let t = new Date(e);
|
|
56726
|
+
return Number.isNaN(t.getTime()) ? null : {
|
|
56727
|
+
dateTime: t.toISOString(),
|
|
56728
|
+
label: new Intl.DateTimeFormat(void 0, {
|
|
56729
|
+
hour: "2-digit",
|
|
56730
|
+
minute: "2-digit"
|
|
56731
|
+
}).format(t),
|
|
56732
|
+
title: new Intl.DateTimeFormat(void 0, {
|
|
56733
|
+
dateStyle: "medium",
|
|
56734
|
+
timeStyle: "medium"
|
|
56735
|
+
}).format(t)
|
|
56736
|
+
};
|
|
56737
|
+
}
|
|
56738
|
+
function SB({ addToolApprovalResponse: e, approvalId: t, denyReason: n }) {
|
|
56706
56739
|
return /* @__PURE__ */ H("div", {
|
|
56707
|
-
className: "flex items-center justify-end gap-2
|
|
56740
|
+
className: "flex items-center justify-end gap-2 px-4 py-3",
|
|
56708
56741
|
children: [/* @__PURE__ */ V(Fm, {
|
|
56709
56742
|
className: "h-8 px-3 text-muted-foreground hover:text-foreground",
|
|
56710
56743
|
onClick: () => {
|
|
@@ -56730,13 +56763,18 @@ function _B({ addToolApprovalResponse: e, approvalId: t, denyReason: n }) {
|
|
|
56730
56763
|
})]
|
|
56731
56764
|
});
|
|
56732
56765
|
}
|
|
56733
|
-
var
|
|
56766
|
+
var CB = new Set([
|
|
56734
56767
|
"text",
|
|
56735
56768
|
"code",
|
|
56736
56769
|
"image",
|
|
56737
56770
|
"sheet"
|
|
56738
|
-
]),
|
|
56739
|
-
|
|
56771
|
+
]), wB = new Set([
|
|
56772
|
+
"tool-createDocument",
|
|
56773
|
+
"tool-updateDocument",
|
|
56774
|
+
"tool-editDocument",
|
|
56775
|
+
"tool-requestSuggestions"
|
|
56776
|
+
]), TB = (e) => wB.has(e), EB = (e) => !(!yB(e) || !("id" in e || "title" in e || "kind" in e || "content" in e) || "id" in e && typeof e.id != "string" || "title" in e && typeof e.title != "string" || "kind" in e && (typeof e.kind != "string" || !CB.has(e.kind)) || "content" in e && typeof e.content != "string");
|
|
56777
|
+
function DB(e, t) {
|
|
56740
56778
|
let n = [];
|
|
56741
56779
|
for (let r = 0; r < t.length; r++) {
|
|
56742
56780
|
let i = t[r];
|
|
@@ -56763,13 +56801,13 @@ function bB(e, t) {
|
|
|
56763
56801
|
}
|
|
56764
56802
|
return n;
|
|
56765
56803
|
}
|
|
56766
|
-
var
|
|
56767
|
-
let [f, p] = z("view"), m = n.parts?.some((e) => e.type === "text" && e.text?.trim()), h = n.parts?.some((e) => a(e.type)), g = n.parts.filter((e) => e.type === "file"), _ =
|
|
56768
|
-
return ot(), /* @__PURE__ */
|
|
56804
|
+
var OB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoading: i, renderMessagePart: s, setMessages: c, regenerate: l, isReadonly: u, requiresScrollPadding: d }) => {
|
|
56805
|
+
let [f, p] = z("view"), m = n.parts?.some((e) => e.type === "text" && e.text?.trim()), h = n.parts?.some((e) => a(e.type)), g = n.parts.filter((e) => e.type === "file"), _ = DB(n.id, HR(n.parts)), v = xB(n.metadata?.createdAt);
|
|
56806
|
+
return ot(), /* @__PURE__ */ H("div", {
|
|
56769
56807
|
className: "group/message fade-in w-full animate-in duration-200",
|
|
56770
56808
|
"data-role": n.role,
|
|
56771
56809
|
"data-testid": `message-${n.role}`,
|
|
56772
|
-
children: /* @__PURE__ */ H("div", {
|
|
56810
|
+
children: [/* @__PURE__ */ H("div", {
|
|
56773
56811
|
className: U("flex w-full items-start gap-2 md:gap-3", {
|
|
56774
56812
|
"justify-end": n.role === "user" && f !== "edit",
|
|
56775
56813
|
"justify-start": n.role === "assistant"
|
|
@@ -56787,7 +56825,7 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56787
56825
|
g.length > 0 && /* @__PURE__ */ V("div", {
|
|
56788
56826
|
className: "flex flex-row justify-end gap-2",
|
|
56789
56827
|
"data-testid": "message-attachments",
|
|
56790
|
-
children: g.map((e) => /* @__PURE__ */ V(
|
|
56828
|
+
children: g.map((e) => /* @__PURE__ */ V(dB, { attachment: {
|
|
56791
56829
|
name: e.filename ?? "file",
|
|
56792
56830
|
contentType: e.mediaType,
|
|
56793
56831
|
url: e.url
|
|
@@ -56801,12 +56839,12 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56801
56839
|
part: t
|
|
56802
56840
|
});
|
|
56803
56841
|
if (m !== void 0) return /* @__PURE__ */ V(C, { children: m }, r);
|
|
56804
|
-
if (d === "reasoning" && o(t)) return /* @__PURE__ */ V(
|
|
56842
|
+
if (d === "reasoning" && o(t)) return /* @__PURE__ */ V(uB, {
|
|
56805
56843
|
isStreaming: t.state === "streaming",
|
|
56806
56844
|
reasoning: t.text ?? ""
|
|
56807
56845
|
}, r);
|
|
56808
56846
|
if (d === "text") {
|
|
56809
|
-
if (f === "view") return /* @__PURE__ */ V("div", { children: /* @__PURE__ */ V(
|
|
56847
|
+
if (f === "view") return /* @__PURE__ */ V("div", { children: /* @__PURE__ */ V(Yz, {
|
|
56810
56848
|
className: U({
|
|
56811
56849
|
"wrap-break-word w-fit rounded-2xl bg-primary px-3 py-2 text-left text-primary-foreground": n.role === "user",
|
|
56812
56850
|
"bg-transparent px-0 py-0 text-left": n.role === "assistant"
|
|
@@ -56818,7 +56856,7 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56818
56856
|
className: "flex w-full flex-row items-start gap-3",
|
|
56819
56857
|
children: [/* @__PURE__ */ V("div", { className: "size-8" }), /* @__PURE__ */ V("div", {
|
|
56820
56858
|
className: "min-w-0 flex-1",
|
|
56821
|
-
children: /* @__PURE__ */ V(
|
|
56859
|
+
children: /* @__PURE__ */ V(tB, {
|
|
56822
56860
|
message: n,
|
|
56823
56861
|
regenerate: l,
|
|
56824
56862
|
setMessages: c,
|
|
@@ -56828,93 +56866,141 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56828
56866
|
}, r);
|
|
56829
56867
|
}
|
|
56830
56868
|
if (d === "tool-getWeather") {
|
|
56831
|
-
let { toolCallId: n, state: r } = t, i = t.approval?.id, a = r === "output-denied" || r === "approval-responded" && t.approval?.approved === !1,
|
|
56832
|
-
return r === "output-available" ?
|
|
56833
|
-
className:
|
|
56834
|
-
children: /* @__PURE__ */ H(
|
|
56869
|
+
let { toolCallId: n, state: r } = t, i = t.approval?.id, a = t.approval, o = r === "output-denied" || r === "approval-responded" && t.approval?.approved === !1, s = "w-[min(100%,450px)]", c = bB(t.output);
|
|
56870
|
+
return r === "output-available" ? c ? /* @__PURE__ */ V("div", {
|
|
56871
|
+
className: s,
|
|
56872
|
+
children: /* @__PURE__ */ H(yz, {
|
|
56835
56873
|
className: "w-full",
|
|
56836
56874
|
defaultOpen: !0,
|
|
56837
|
-
children: [/* @__PURE__ */ V(
|
|
56875
|
+
children: [/* @__PURE__ */ V(wz, {
|
|
56876
|
+
approval: a,
|
|
56838
56877
|
state: "output-error",
|
|
56839
56878
|
type: "tool-getWeather"
|
|
56840
|
-
}), /* @__PURE__ */ V(
|
|
56841
|
-
errorText:
|
|
56879
|
+
}), /* @__PURE__ */ V(Tz, { children: /* @__PURE__ */ V(Oz, {
|
|
56880
|
+
errorText: c,
|
|
56842
56881
|
output: null
|
|
56843
56882
|
}) })]
|
|
56844
56883
|
})
|
|
56845
56884
|
}, n) : /* @__PURE__ */ V("div", {
|
|
56846
|
-
className:
|
|
56847
|
-
children: /* @__PURE__ */ V(
|
|
56885
|
+
className: s,
|
|
56886
|
+
children: /* @__PURE__ */ V(_B, { weatherAtLocation: t.output })
|
|
56848
56887
|
}, n) : r === "output-error" ? /* @__PURE__ */ V("div", {
|
|
56849
|
-
className:
|
|
56850
|
-
children: /* @__PURE__ */ H(
|
|
56888
|
+
className: s,
|
|
56889
|
+
children: /* @__PURE__ */ H(yz, {
|
|
56851
56890
|
className: "w-full",
|
|
56852
56891
|
defaultOpen: !0,
|
|
56853
|
-
children: [/* @__PURE__ */ V(
|
|
56892
|
+
children: [/* @__PURE__ */ V(wz, {
|
|
56893
|
+
approval: a,
|
|
56854
56894
|
state: r,
|
|
56855
56895
|
type: "tool-getWeather"
|
|
56856
|
-
}), /* @__PURE__ */ V(
|
|
56896
|
+
}), /* @__PURE__ */ V(Tz, { children: /* @__PURE__ */ V(Oz, {
|
|
56857
56897
|
errorText: t.errorText,
|
|
56858
56898
|
output: null
|
|
56859
56899
|
}) })]
|
|
56860
56900
|
})
|
|
56861
|
-
}, n) :
|
|
56862
|
-
className:
|
|
56863
|
-
children: /* @__PURE__ */ H(
|
|
56901
|
+
}, n) : o ? /* @__PURE__ */ V("div", {
|
|
56902
|
+
className: s,
|
|
56903
|
+
children: /* @__PURE__ */ H(yz, {
|
|
56864
56904
|
className: "w-full",
|
|
56865
56905
|
defaultOpen: !0,
|
|
56866
|
-
children: [/* @__PURE__ */ V(
|
|
56906
|
+
children: [/* @__PURE__ */ V(wz, {
|
|
56907
|
+
approval: a,
|
|
56867
56908
|
state: "output-denied",
|
|
56868
56909
|
type: "tool-getWeather"
|
|
56869
|
-
}), /* @__PURE__ */ V(
|
|
56910
|
+
}), /* @__PURE__ */ V(Tz, { children: /* @__PURE__ */ V("div", {
|
|
56870
56911
|
className: "px-4 py-3 text-muted-foreground text-sm",
|
|
56871
56912
|
children: "Weather lookup was denied."
|
|
56872
56913
|
}) })]
|
|
56873
56914
|
})
|
|
56874
56915
|
}, n) : r === "approval-responded" ? /* @__PURE__ */ V("div", {
|
|
56875
|
-
className:
|
|
56876
|
-
children: /* @__PURE__ */ H(
|
|
56916
|
+
className: s,
|
|
56917
|
+
children: /* @__PURE__ */ H(yz, {
|
|
56877
56918
|
className: "w-full",
|
|
56878
56919
|
defaultOpen: !0,
|
|
56879
|
-
children: [/* @__PURE__ */ V(
|
|
56920
|
+
children: [/* @__PURE__ */ V(wz, {
|
|
56921
|
+
approval: a,
|
|
56880
56922
|
state: r,
|
|
56881
56923
|
type: "tool-getWeather"
|
|
56882
|
-
}), /* @__PURE__ */
|
|
56924
|
+
}), /* @__PURE__ */ H(Tz, { children: [/* @__PURE__ */ V(Dz, { input: t.input }), a?.reason && /* @__PURE__ */ V("div", {
|
|
56925
|
+
className: "text-muted-foreground text-sm",
|
|
56926
|
+
children: a.reason
|
|
56927
|
+
})] })]
|
|
56883
56928
|
})
|
|
56884
56929
|
}, n) : /* @__PURE__ */ V("div", {
|
|
56885
|
-
className:
|
|
56886
|
-
children: /* @__PURE__ */ H(
|
|
56930
|
+
className: s,
|
|
56931
|
+
children: /* @__PURE__ */ H(yz, {
|
|
56887
56932
|
className: "w-full",
|
|
56888
56933
|
defaultOpen: !0,
|
|
56889
|
-
children: [/* @__PURE__ */ V(
|
|
56934
|
+
children: [/* @__PURE__ */ V(wz, {
|
|
56935
|
+
approval: a,
|
|
56890
56936
|
state: r,
|
|
56891
56937
|
type: "tool-getWeather"
|
|
56892
|
-
}), /* @__PURE__ */ H(
|
|
56893
|
-
|
|
56894
|
-
|
|
56895
|
-
|
|
56896
|
-
|
|
56938
|
+
}), /* @__PURE__ */ H(Tz, { children: [
|
|
56939
|
+
(r === "input-available" || r === "approval-requested") && /* @__PURE__ */ V(Dz, { input: t.input }),
|
|
56940
|
+
r === "approval-requested" && i && !a?.isAutomatic && /* @__PURE__ */ V(SB, {
|
|
56941
|
+
addToolApprovalResponse: e,
|
|
56942
|
+
approvalId: i,
|
|
56943
|
+
denyReason: "User denied weather lookup"
|
|
56944
|
+
}),
|
|
56945
|
+
a?.reason && /* @__PURE__ */ V("div", {
|
|
56946
|
+
className: "border-t pt-3 text-muted-foreground text-sm",
|
|
56947
|
+
children: a.reason
|
|
56948
|
+
})
|
|
56949
|
+
] })]
|
|
56897
56950
|
})
|
|
56898
56951
|
}, n);
|
|
56899
56952
|
}
|
|
56953
|
+
if (TB(d)) {
|
|
56954
|
+
let n = t, { approval: i } = n, a = n.state, o = a === "output-denied" || a === "approval-responded" && i?.approved === !1;
|
|
56955
|
+
if (a === "approval-requested" || a === "approval-responded" || a === "output-denied") {
|
|
56956
|
+
let t = n.toolCallId ?? r;
|
|
56957
|
+
return /* @__PURE__ */ V("div", {
|
|
56958
|
+
className: "w-[min(100%,450px)]",
|
|
56959
|
+
children: /* @__PURE__ */ H(yz, {
|
|
56960
|
+
className: "w-full",
|
|
56961
|
+
defaultOpen: !0,
|
|
56962
|
+
children: [/* @__PURE__ */ V(wz, {
|
|
56963
|
+
approval: i,
|
|
56964
|
+
state: o ? "output-denied" : a,
|
|
56965
|
+
type: d
|
|
56966
|
+
}), /* @__PURE__ */ H(Tz, { children: [
|
|
56967
|
+
n.input !== void 0 && /* @__PURE__ */ V(Dz, { input: vB(n.input) }),
|
|
56968
|
+
a === "approval-requested" && i && !i.isAutomatic && /* @__PURE__ */ V(SB, {
|
|
56969
|
+
addToolApprovalResponse: e,
|
|
56970
|
+
approvalId: i.id,
|
|
56971
|
+
denyReason: "User denied tool call"
|
|
56972
|
+
}),
|
|
56973
|
+
i?.reason && /* @__PURE__ */ V("div", {
|
|
56974
|
+
className: "text-muted-foreground text-sm",
|
|
56975
|
+
children: i.reason
|
|
56976
|
+
}),
|
|
56977
|
+
o && /* @__PURE__ */ V("div", {
|
|
56978
|
+
className: "text-muted-foreground text-sm",
|
|
56979
|
+
children: "This tool call was denied."
|
|
56980
|
+
})
|
|
56981
|
+
] })]
|
|
56982
|
+
})
|
|
56983
|
+
}, t);
|
|
56984
|
+
}
|
|
56985
|
+
}
|
|
56900
56986
|
if (d === "tool-createDocument") {
|
|
56901
|
-
let { toolCallId: e } = t, n = t.output, r =
|
|
56902
|
-
return
|
|
56987
|
+
let { toolCallId: e } = t, n = t.output, r = EB(n) ? n : void 0;
|
|
56988
|
+
return yB(n) && "error" in n ? /* @__PURE__ */ H("div", {
|
|
56903
56989
|
className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
|
|
56904
56990
|
children: ["Error creating document: ", String(n.error)]
|
|
56905
|
-
}, e) : /* @__PURE__ */ V(
|
|
56991
|
+
}, e) : /* @__PURE__ */ V(Nz, {
|
|
56906
56992
|
isReadonly: u,
|
|
56907
56993
|
result: r
|
|
56908
56994
|
}, e);
|
|
56909
56995
|
}
|
|
56910
56996
|
if (d === "tool-updateDocument") {
|
|
56911
|
-
let { toolCallId: e } = t, n = t.output, r =
|
|
56912
|
-
return
|
|
56997
|
+
let { toolCallId: e } = t, n = t.output, r = EB(n) ? n : void 0;
|
|
56998
|
+
return yB(n) && "error" in n ? /* @__PURE__ */ H("div", {
|
|
56913
56999
|
className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
|
|
56914
57000
|
children: ["Error updating document: ", String(n.error)]
|
|
56915
57001
|
}, e) : /* @__PURE__ */ V("div", {
|
|
56916
57002
|
className: "relative",
|
|
56917
|
-
children: /* @__PURE__ */ V(
|
|
57003
|
+
children: /* @__PURE__ */ V(Nz, {
|
|
56918
57004
|
args: r ? {
|
|
56919
57005
|
...r,
|
|
56920
57006
|
isUpdate: !0
|
|
@@ -56925,13 +57011,13 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56925
57011
|
}, e);
|
|
56926
57012
|
}
|
|
56927
57013
|
if (d === "tool-editDocument") {
|
|
56928
|
-
let { toolCallId: e } = t, n = t.output, r =
|
|
56929
|
-
return
|
|
57014
|
+
let { toolCallId: e } = t, n = t.output, r = EB(n) ? n : void 0;
|
|
57015
|
+
return yB(n) && "error" in n ? /* @__PURE__ */ H("div", {
|
|
56930
57016
|
className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
|
|
56931
57017
|
children: ["Error editing document: ", String(n.error)]
|
|
56932
57018
|
}, e) : /* @__PURE__ */ V("div", {
|
|
56933
57019
|
className: "relative",
|
|
56934
|
-
children: /* @__PURE__ */ V(
|
|
57020
|
+
children: /* @__PURE__ */ V(Nz, {
|
|
56935
57021
|
args: r ? {
|
|
56936
57022
|
...r,
|
|
56937
57023
|
isUpdate: !0
|
|
@@ -56943,17 +57029,17 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56943
57029
|
}
|
|
56944
57030
|
if (d === "tool-requestSuggestions") {
|
|
56945
57031
|
let { toolCallId: e, state: n } = t;
|
|
56946
|
-
return /* @__PURE__ */ H(
|
|
57032
|
+
return /* @__PURE__ */ H(yz, {
|
|
56947
57033
|
defaultOpen: !0,
|
|
56948
|
-
children: [/* @__PURE__ */ V(
|
|
57034
|
+
children: [/* @__PURE__ */ V(wz, {
|
|
56949
57035
|
state: n,
|
|
56950
57036
|
type: "tool-requestSuggestions"
|
|
56951
|
-
}), /* @__PURE__ */ H(
|
|
57037
|
+
}), /* @__PURE__ */ H(Tz, { children: [n === "input-available" && /* @__PURE__ */ V(Dz, { input: t.input }), n === "output-available" && /* @__PURE__ */ V(Oz, {
|
|
56952
57038
|
errorText: void 0,
|
|
56953
|
-
output:
|
|
57039
|
+
output: yB(t.output) && "error" in t.output ? /* @__PURE__ */ H("div", {
|
|
56954
57040
|
className: "rounded border p-2 text-destructive",
|
|
56955
57041
|
children: ["Error: ", String(t.output.error)]
|
|
56956
|
-
}) : /* @__PURE__ */ V(
|
|
57042
|
+
}) : /* @__PURE__ */ V(jz, {
|
|
56957
57043
|
isReadonly: u,
|
|
56958
57044
|
result: t.output,
|
|
56959
57045
|
type: "request-suggestions"
|
|
@@ -56965,32 +57051,38 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56965
57051
|
let n = t, i = n.toolCallId ?? r, a = n.state, o = n.approval?.id, s = typeof n.title == "string" ? n.title : void 0, c = typeof n.toolName == "string" ? n.toolName : "tool", l = n.state === "output-denied" || n.state === "approval-responded" && n.approval?.approved === !1;
|
|
56966
57052
|
return /* @__PURE__ */ V("div", {
|
|
56967
57053
|
className: "w-[min(100%,450px)]",
|
|
56968
|
-
children: /* @__PURE__ */ H(
|
|
57054
|
+
children: /* @__PURE__ */ H(yz, {
|
|
56969
57055
|
className: "w-full",
|
|
56970
57056
|
defaultOpen: !0,
|
|
56971
|
-
children: [d === "dynamic-tool" ? /* @__PURE__ */ V(
|
|
57057
|
+
children: [d === "dynamic-tool" ? /* @__PURE__ */ V(wz, {
|
|
57058
|
+
approval: n.approval,
|
|
56972
57059
|
state: l ? "output-denied" : a,
|
|
56973
57060
|
title: s,
|
|
56974
57061
|
toolName: c,
|
|
56975
57062
|
type: "dynamic-tool"
|
|
56976
|
-
}) : /* @__PURE__ */ V(
|
|
57063
|
+
}) : /* @__PURE__ */ V(wz, {
|
|
57064
|
+
approval: n.approval,
|
|
56977
57065
|
state: l ? "output-denied" : a,
|
|
56978
57066
|
title: s,
|
|
56979
57067
|
type: d
|
|
56980
|
-
}), /* @__PURE__ */ H(
|
|
56981
|
-
n.input !== void 0 && (n.state === "input-available" || n.state === "approval-requested" || n.state === "approval-responded" || n.state === "output-available" || n.state === "output-error" || n.state === "output-denied") && /* @__PURE__ */ V(
|
|
56982
|
-
n.state === "approval-requested" && o && /* @__PURE__ */ V(
|
|
57068
|
+
}), /* @__PURE__ */ H(Tz, { children: [
|
|
57069
|
+
n.input !== void 0 && (n.state === "input-available" || n.state === "approval-requested" || n.state === "approval-responded" || n.state === "output-available" || n.state === "output-error" || n.state === "output-denied") && /* @__PURE__ */ V(Dz, { input: vB(n.input) }),
|
|
57070
|
+
n.state === "approval-requested" && o && !n.approval?.isAutomatic && /* @__PURE__ */ V(SB, {
|
|
56983
57071
|
addToolApprovalResponse: e,
|
|
56984
57072
|
approvalId: o,
|
|
56985
57073
|
denyReason: "User denied tool call"
|
|
56986
57074
|
}),
|
|
57075
|
+
n.approval?.reason && /* @__PURE__ */ V("div", {
|
|
57076
|
+
className: "border-t pt-3 text-muted-foreground text-sm",
|
|
57077
|
+
children: n.approval.reason
|
|
57078
|
+
}),
|
|
56987
57079
|
l && /* @__PURE__ */ V("div", {
|
|
56988
57080
|
className: "border-t px-4 py-3 text-muted-foreground text-sm",
|
|
56989
57081
|
children: "This tool call was denied."
|
|
56990
57082
|
}),
|
|
56991
|
-
!l && (n.output !== void 0 || n.errorText !== void 0) && /* @__PURE__ */ V(
|
|
57083
|
+
!l && (n.output !== void 0 || n.errorText !== void 0) && /* @__PURE__ */ V(Oz, {
|
|
56992
57084
|
errorText: n.errorText,
|
|
56993
|
-
output: n.output === void 0 ? null :
|
|
57085
|
+
output: n.output === void 0 ? null : vB(n.output)
|
|
56994
57086
|
})
|
|
56995
57087
|
] })]
|
|
56996
57088
|
})
|
|
@@ -56998,7 +57090,7 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
56998
57090
|
}
|
|
56999
57091
|
return null;
|
|
57000
57092
|
}),
|
|
57001
|
-
!u && /* @__PURE__ */ V(
|
|
57093
|
+
!u && /* @__PURE__ */ V($z, {
|
|
57002
57094
|
chatId: t,
|
|
57003
57095
|
isLoading: i,
|
|
57004
57096
|
message: n,
|
|
@@ -57007,10 +57099,23 @@ var xB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
|
|
|
57007
57099
|
}, `action-${n.id}`)
|
|
57008
57100
|
]
|
|
57009
57101
|
})]
|
|
57010
|
-
})
|
|
57102
|
+
}), v && f === "view" ? /* @__PURE__ */ V("div", {
|
|
57103
|
+
className: U("mt-1 flex", {
|
|
57104
|
+
"justify-end pr-1": n.role === "user",
|
|
57105
|
+
"justify-start pl-10 md:pl-11": n.role === "assistant"
|
|
57106
|
+
}),
|
|
57107
|
+
children: /* @__PURE__ */ V("time", {
|
|
57108
|
+
"aria-label": v.title,
|
|
57109
|
+
className: "text-[10px] tabular-nums leading-none text-muted-foreground",
|
|
57110
|
+
dateTime: v.dateTime,
|
|
57111
|
+
suppressHydrationWarning: !0,
|
|
57112
|
+
title: v.title,
|
|
57113
|
+
children: v.label
|
|
57114
|
+
})
|
|
57115
|
+
}) : null]
|
|
57011
57116
|
});
|
|
57012
57117
|
};
|
|
57013
|
-
function
|
|
57118
|
+
function kB() {
|
|
57014
57119
|
let { waitingStatus: e } = ot();
|
|
57015
57120
|
return /* @__PURE__ */ V("div", {
|
|
57016
57121
|
className: "flex min-w-0 items-center gap-1 p-0 text-muted-foreground text-sm",
|
|
@@ -57020,7 +57125,7 @@ function SB() {
|
|
|
57020
57125
|
})
|
|
57021
57126
|
});
|
|
57022
57127
|
}
|
|
57023
|
-
var
|
|
57128
|
+
var AB = () => /* @__PURE__ */ V("div", {
|
|
57024
57129
|
className: "group/message fade-in w-full animate-in duration-300",
|
|
57025
57130
|
"data-role": "assistant",
|
|
57026
57131
|
"data-testid": "message-assistant-loading",
|
|
@@ -57034,19 +57139,19 @@ var CB = () => /* @__PURE__ */ V("div", {
|
|
|
57034
57139
|
})
|
|
57035
57140
|
}), /* @__PURE__ */ V("div", {
|
|
57036
57141
|
className: "min-w-0 flex-1",
|
|
57037
|
-
children: /* @__PURE__ */ V(
|
|
57142
|
+
children: /* @__PURE__ */ V(kB, {})
|
|
57038
57143
|
})]
|
|
57039
57144
|
})
|
|
57040
57145
|
});
|
|
57041
57146
|
//#endregion
|
|
57042
57147
|
//#region src/components/artifact-messages.tsx
|
|
57043
|
-
function
|
|
57148
|
+
function jB({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messages: i, renderMessagePart: a, setMessages: o, regenerate: s, isReadonly: c }) {
|
|
57044
57149
|
let { containerRef: l, endRef: u, onViewportEnter: d, onViewportLeave: f, hasSentMessage: p } = zR({ status: n });
|
|
57045
57150
|
return /* @__PURE__ */ H("div", {
|
|
57046
57151
|
className: "flex h-full flex-col items-center gap-4 overflow-y-scroll px-4 pt-20",
|
|
57047
57152
|
ref: l,
|
|
57048
57153
|
children: [
|
|
57049
|
-
i.map((l, u) => /* @__PURE__ */ V(
|
|
57154
|
+
i.map((l, u) => /* @__PURE__ */ V(OB, {
|
|
57050
57155
|
addToolApprovalResponse: e,
|
|
57051
57156
|
chatId: t,
|
|
57052
57157
|
isLoading: n === "streaming" && u === i.length - 1,
|
|
@@ -57060,7 +57165,7 @@ function wB({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messag
|
|
|
57060
57165
|
}, l.id)),
|
|
57061
57166
|
/* @__PURE__ */ V(hM, {
|
|
57062
57167
|
mode: "wait",
|
|
57063
|
-
children: n === "submitted" && !i.some((e) => e.parts?.some((e) => "state" in e && e.state === "approval-responded")) && /* @__PURE__ */ V(
|
|
57168
|
+
children: n === "submitted" && !i.some((e) => e.parts?.some((e) => "state" in e && e.state === "approval-responded")) && /* @__PURE__ */ V(AB, {}, "thinking")
|
|
57064
57169
|
}),
|
|
57065
57170
|
/* @__PURE__ */ V(cP.div, {
|
|
57066
57171
|
className: "min-h-[24px] min-w-[24px] shrink-0",
|
|
@@ -57071,10 +57176,10 @@ function wB({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messag
|
|
|
57071
57176
|
]
|
|
57072
57177
|
});
|
|
57073
57178
|
}
|
|
57074
|
-
function
|
|
57179
|
+
function MB(e, t) {
|
|
57075
57180
|
return e.artifactStatus === "streaming" && t.artifactStatus === "streaming" ? !0 : !(e.status !== t.status || e.status && t.status || e.messages.length !== t.messages.length || !ve(e.votes, t.votes) || e.renderMessagePart !== t.renderMessagePart);
|
|
57076
57181
|
}
|
|
57077
|
-
var
|
|
57182
|
+
var NB = O(jB, MB), PB = Ah, FB = Jp, IB = y.forwardRef(({ className: e, ...t }, n) => {
|
|
57078
57183
|
let { resolvedTheme: r, theme: i } = Vm();
|
|
57079
57184
|
return /* @__PURE__ */ V(yp, {
|
|
57080
57185
|
ref: n,
|
|
@@ -57084,24 +57189,24 @@ var EB = O(wB, TB), DB = Ah, OB = Jp, kB = y.forwardRef(({ className: e, ...t },
|
|
|
57084
57189
|
...t
|
|
57085
57190
|
});
|
|
57086
57191
|
});
|
|
57087
|
-
|
|
57088
|
-
var
|
|
57192
|
+
IB.displayName = "DialogOverlay";
|
|
57193
|
+
var LB = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(em, {
|
|
57089
57194
|
ref: r,
|
|
57090
57195
|
render: lm(e, t),
|
|
57091
57196
|
...n,
|
|
57092
57197
|
children: t
|
|
57093
57198
|
}));
|
|
57094
|
-
|
|
57095
|
-
var
|
|
57199
|
+
LB.displayName = "DialogTrigger";
|
|
57200
|
+
var RB = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(Op, {
|
|
57096
57201
|
ref: r,
|
|
57097
57202
|
render: lm(e, t),
|
|
57098
57203
|
...n,
|
|
57099
57204
|
children: t
|
|
57100
57205
|
}));
|
|
57101
|
-
|
|
57102
|
-
var
|
|
57206
|
+
RB.displayName = "DialogClose";
|
|
57207
|
+
var zB = y.forwardRef(({ className: e, children: t, ...n }, r) => {
|
|
57103
57208
|
let { resolvedTheme: i, theme: a } = Vm();
|
|
57104
|
-
return /* @__PURE__ */ H(
|
|
57209
|
+
return /* @__PURE__ */ H(FB, { children: [/* @__PURE__ */ V(IB, {}), /* @__PURE__ */ H(Gp, {
|
|
57105
57210
|
ref: r,
|
|
57106
57211
|
className: U("agents-sdk fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 opacity-0 shadow-lg transition-opacity duration-200 data-open:opacity-100 data-closed:opacity-0 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 sm:rounded-lg", e),
|
|
57107
57212
|
"data-agents-sdk-resolved-theme": i,
|
|
@@ -57116,48 +57221,48 @@ var MB = y.forwardRef(({ className: e, children: t, ...n }, r) => {
|
|
|
57116
57221
|
})]
|
|
57117
57222
|
})] });
|
|
57118
57223
|
});
|
|
57119
|
-
|
|
57120
|
-
var
|
|
57224
|
+
zB.displayName = "DialogContent";
|
|
57225
|
+
var BB = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
|
|
57121
57226
|
className: U("flex flex-col space-y-1.5 text-center sm:text-left", e),
|
|
57122
57227
|
...t
|
|
57123
57228
|
});
|
|
57124
|
-
|
|
57125
|
-
var
|
|
57229
|
+
BB.displayName = "DialogHeader";
|
|
57230
|
+
var VB = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
|
|
57126
57231
|
className: U("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
|
|
57127
57232
|
...t
|
|
57128
57233
|
});
|
|
57129
|
-
|
|
57130
|
-
var
|
|
57234
|
+
VB.displayName = "DialogFooter";
|
|
57235
|
+
var HB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Yp, {
|
|
57131
57236
|
ref: n,
|
|
57132
57237
|
className: U("text-lg font-semibold leading-none tracking-tight", e),
|
|
57133
57238
|
...t
|
|
57134
57239
|
}));
|
|
57135
|
-
|
|
57136
|
-
var
|
|
57240
|
+
HB.displayName = "DialogTitle";
|
|
57241
|
+
var UB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Ap, {
|
|
57137
57242
|
ref: n,
|
|
57138
57243
|
className: U("text-sm text-muted-foreground", e),
|
|
57139
57244
|
...t
|
|
57140
57245
|
}));
|
|
57141
|
-
|
|
57246
|
+
UB.displayName = "DialogDescription";
|
|
57142
57247
|
//#endregion
|
|
57143
57248
|
//#region src/components/ui/command.tsx
|
|
57144
|
-
var
|
|
57249
|
+
var WB = y.createContext(null), GB = (e) => e.trim().toLocaleLowerCase(), KB = (e) => {
|
|
57145
57250
|
if (typeof e == "string" || typeof e == "number") return String(e);
|
|
57146
|
-
if (Array.isArray(e)) return e.map(
|
|
57251
|
+
if (Array.isArray(e)) return e.map(KB).join(" ");
|
|
57147
57252
|
if (y.isValidElement(e)) {
|
|
57148
57253
|
let t = e.props;
|
|
57149
|
-
return `${typeof t.alt == "string" ? t.alt : ""} ${
|
|
57254
|
+
return `${typeof t.alt == "string" ? t.alt : ""} ${KB(t.children)}`.trim();
|
|
57150
57255
|
}
|
|
57151
57256
|
return "";
|
|
57152
|
-
},
|
|
57153
|
-
let n =
|
|
57154
|
-
return n ?
|
|
57155
|
-
},
|
|
57156
|
-
let e = y.useContext(
|
|
57257
|
+
}, qB = (e, t) => {
|
|
57258
|
+
let n = GB(e);
|
|
57259
|
+
return n ? GB(`${t.value} ${t.searchValue}`).includes(n) : !0;
|
|
57260
|
+
}, JB = () => {
|
|
57261
|
+
let e = y.useContext(WB);
|
|
57157
57262
|
if (!e) throw Error("Command components must be rendered inside <Command>.");
|
|
57158
57263
|
return e;
|
|
57159
|
-
},
|
|
57160
|
-
let [c, l] = y.useState(""), [u, d] = y.useState(() => /* @__PURE__ */ new Map()), [f, p] = y.useState(null), m = y.useRef(!1), h = y.useMemo(() => Array.from(u.values()).filter((e) =>
|
|
57264
|
+
}, YB = y.forwardRef(({ className: e, defaultValue: t, loop: n = !0, onKeyDown: r, onValueChange: i, value: a, ...o }, s) => {
|
|
57265
|
+
let [c, l] = y.useState(""), [u, d] = y.useState(() => /* @__PURE__ */ new Map()), [f, p] = y.useState(null), m = y.useRef(!1), h = y.useMemo(() => Array.from(u.values()).filter((e) => qB(c, e)), [u, c]);
|
|
57161
57266
|
y.useEffect(() => {
|
|
57162
57267
|
if (a) {
|
|
57163
57268
|
let e = Array.from(u.values()).find((e) => e.value === a);
|
|
@@ -57168,7 +57273,7 @@ var LB = y.createContext(null), RB = (e) => e.trim().toLocaleLowerCase(), zB = (
|
|
|
57168
57273
|
}
|
|
57169
57274
|
if (!m.current && t) {
|
|
57170
57275
|
let e = Array.from(u.values()).find((e) => e.value === t);
|
|
57171
|
-
if (e &&
|
|
57276
|
+
if (e && qB(c, e)) {
|
|
57172
57277
|
m.current = !0, e.id !== f && p(e.id);
|
|
57173
57278
|
return;
|
|
57174
57279
|
}
|
|
@@ -57201,7 +57306,7 @@ var LB = y.createContext(null), RB = (e) => e.trim().toLocaleLowerCase(), zB = (
|
|
|
57201
57306
|
});
|
|
57202
57307
|
}, []), v = y.useCallback((e) => {
|
|
57203
57308
|
let t = u.get(e);
|
|
57204
|
-
!t || t.disabled || !
|
|
57309
|
+
!t || t.disabled || !qB(c, t) || (i?.(t.value), t.select());
|
|
57205
57310
|
}, [
|
|
57206
57311
|
u,
|
|
57207
57312
|
i,
|
|
@@ -57246,7 +57351,7 @@ var LB = y.createContext(null), RB = (e) => e.trim().toLocaleLowerCase(), zB = (
|
|
|
57246
57351
|
e.key === "Enter" && (e.preventDefault(), x());
|
|
57247
57352
|
}
|
|
57248
57353
|
};
|
|
57249
|
-
return /* @__PURE__ */ V(
|
|
57354
|
+
return /* @__PURE__ */ V(WB.Provider, {
|
|
57250
57355
|
value: {
|
|
57251
57356
|
activeId: f,
|
|
57252
57357
|
registerItem: g,
|
|
@@ -57268,9 +57373,9 @@ var LB = y.createContext(null), RB = (e) => e.trim().toLocaleLowerCase(), zB = (
|
|
|
57268
57373
|
})
|
|
57269
57374
|
});
|
|
57270
57375
|
});
|
|
57271
|
-
|
|
57272
|
-
var
|
|
57273
|
-
let a =
|
|
57376
|
+
YB.displayName = "Command";
|
|
57377
|
+
var XB = y.forwardRef(({ className: e, onChange: t, value: n, ...r }, i) => {
|
|
57378
|
+
let a = JB();
|
|
57274
57379
|
return /* @__PURE__ */ H("div", {
|
|
57275
57380
|
className: "flex items-center border-b px-3",
|
|
57276
57381
|
"data-slot": "command-input-wrapper",
|
|
@@ -57286,17 +57391,17 @@ var UB = y.forwardRef(({ className: e, onChange: t, value: n, ...r }, i) => {
|
|
|
57286
57391
|
})]
|
|
57287
57392
|
});
|
|
57288
57393
|
});
|
|
57289
|
-
|
|
57290
|
-
var
|
|
57394
|
+
XB.displayName = "CommandInput";
|
|
57395
|
+
var ZB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("div", {
|
|
57291
57396
|
ref: n,
|
|
57292
57397
|
className: U("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
|
|
57293
57398
|
"data-command-list": "",
|
|
57294
57399
|
role: "listbox",
|
|
57295
57400
|
...t
|
|
57296
57401
|
}));
|
|
57297
|
-
|
|
57298
|
-
var
|
|
57299
|
-
let r =
|
|
57402
|
+
ZB.displayName = "CommandList";
|
|
57403
|
+
var QB = y.forwardRef(({ className: e, ...t }, n) => {
|
|
57404
|
+
let r = JB();
|
|
57300
57405
|
return !r.search.trim() || r.visibleCount > 0 ? null : /* @__PURE__ */ V("div", {
|
|
57301
57406
|
ref: n,
|
|
57302
57407
|
className: U("py-6 text-center text-sm", e),
|
|
@@ -57304,8 +57409,8 @@ var GB = y.forwardRef(({ className: e, ...t }, n) => {
|
|
|
57304
57409
|
...t
|
|
57305
57410
|
});
|
|
57306
57411
|
});
|
|
57307
|
-
|
|
57308
|
-
var
|
|
57412
|
+
QB.displayName = "CommandEmpty";
|
|
57413
|
+
var $B = y.forwardRef(({ className: e, heading: t, children: n, ...r }, i) => /* @__PURE__ */ H("div", {
|
|
57309
57414
|
ref: i,
|
|
57310
57415
|
"aria-label": typeof t == "string" ? t : void 0,
|
|
57311
57416
|
className: U("overflow-hidden p-1 text-foreground [&_[data-command-group-heading]]:px-2 [&_[data-command-group-heading]]:py-1.5 [&_[data-command-group-heading]]:text-xs [&_[data-command-group-heading]]:font-medium [&_[data-command-group-heading]]:text-muted-foreground", e),
|
|
@@ -57317,17 +57422,17 @@ var KB = y.forwardRef(({ className: e, heading: t, children: n, ...r }, i) => /*
|
|
|
57317
57422
|
children: t
|
|
57318
57423
|
}), n]
|
|
57319
57424
|
}));
|
|
57320
|
-
|
|
57321
|
-
var
|
|
57425
|
+
$B.displayName = "CommandGroup";
|
|
57426
|
+
var eV = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("div", {
|
|
57322
57427
|
ref: n,
|
|
57323
57428
|
className: U("-mx-1 h-px bg-border", e),
|
|
57324
57429
|
"data-command-separator": "",
|
|
57325
57430
|
role: "separator",
|
|
57326
57431
|
...t
|
|
57327
57432
|
}));
|
|
57328
|
-
|
|
57329
|
-
var
|
|
57330
|
-
let { activeId: u, registerItem: d, search: f, selectItem: p, setActiveId: m, unregisterItem: h } =
|
|
57433
|
+
eV.displayName = "CommandSeparator";
|
|
57434
|
+
var tV = y.forwardRef(({ children: e, className: t, disabled: n = !1, keywords: r = [], onClick: i, onMouseMove: a, onSelect: o, value: s, ...c }, l) => {
|
|
57435
|
+
let { activeId: u, registerItem: d, search: f, selectItem: p, setActiveId: m, unregisterItem: h } = JB(), g = y.useId(), _ = KB(e), v = s ?? _, b = `${_} ${r.join(" ")}`.trim(), x = y.useRef(() => {});
|
|
57331
57436
|
x.current = () => o?.(v);
|
|
57332
57437
|
let S = y.useCallback(() => {
|
|
57333
57438
|
x.current();
|
|
@@ -57337,7 +57442,7 @@ var JB = y.forwardRef(({ children: e, className: t, disabled: n = !1, keywords:
|
|
|
57337
57442
|
searchValue: b,
|
|
57338
57443
|
select: S,
|
|
57339
57444
|
value: v
|
|
57340
|
-
}, w =
|
|
57445
|
+
}, w = qB(f, C), T = u === g;
|
|
57341
57446
|
return y.useEffect(() => (d(C), () => h(g)), [
|
|
57342
57447
|
n,
|
|
57343
57448
|
g,
|
|
@@ -57367,109 +57472,109 @@ var JB = y.forwardRef(({ children: e, className: t, disabled: n = !1, keywords:
|
|
|
57367
57472
|
children: e
|
|
57368
57473
|
});
|
|
57369
57474
|
});
|
|
57370
|
-
|
|
57371
|
-
var
|
|
57475
|
+
tV.displayName = "CommandItem";
|
|
57476
|
+
var nV = ({ className: e, ...t }) => /* @__PURE__ */ V("span", {
|
|
57372
57477
|
className: U("ml-auto text-xs tracking-widest text-muted-foreground", e),
|
|
57373
57478
|
...t
|
|
57374
57479
|
});
|
|
57375
|
-
|
|
57480
|
+
nV.displayName = "CommandShortcut";
|
|
57376
57481
|
//#endregion
|
|
57377
57482
|
//#region src/components/ai-elements/model-selector.tsx
|
|
57378
|
-
var
|
|
57483
|
+
var rV = (e) => /* @__PURE__ */ V(PB, { ...e }), iV = (e) => /* @__PURE__ */ V(LB, { ...e }), aV = ({ className: e, commandDefaultValue: t, children: n, title: r = "Model Selector", ...i }) => /* @__PURE__ */ H(zB, {
|
|
57379
57484
|
className: U("p-0", e),
|
|
57380
57485
|
...i,
|
|
57381
|
-
children: [/* @__PURE__ */ V(
|
|
57486
|
+
children: [/* @__PURE__ */ V(HB, {
|
|
57382
57487
|
className: "sr-only",
|
|
57383
57488
|
children: r
|
|
57384
|
-
}), /* @__PURE__ */ V(
|
|
57489
|
+
}), /* @__PURE__ */ V(YB, {
|
|
57385
57490
|
className: "**:data-[slot=command-input-wrapper]:h-auto",
|
|
57386
57491
|
defaultValue: t,
|
|
57387
57492
|
children: n
|
|
57388
57493
|
})]
|
|
57389
|
-
}),
|
|
57494
|
+
}), oV = ({ className: e, ...t }) => /* @__PURE__ */ V(XB, {
|
|
57390
57495
|
className: U("h-auto py-3.5", e),
|
|
57391
57496
|
...t
|
|
57392
|
-
}),
|
|
57497
|
+
}), sV = (e) => /* @__PURE__ */ V(ZB, { ...e }), cV = (e) => /* @__PURE__ */ V($B, { ...e }), lV = (e) => /* @__PURE__ */ V(tV, { ...e }), uV = ({ provider: e, className: t }) => /* @__PURE__ */ V("img", {
|
|
57393
57498
|
alt: `${e} logo`,
|
|
57394
57499
|
className: U("size-3 dark:invert", t),
|
|
57395
57500
|
height: 12,
|
|
57396
57501
|
src: `https://models.dev/logos/${e}.svg`,
|
|
57397
57502
|
width: 12
|
|
57398
|
-
}),
|
|
57503
|
+
}), dV = ({ className: e, ...t }) => /* @__PURE__ */ V("span", {
|
|
57399
57504
|
className: U("flex-1 truncate text-left", e),
|
|
57400
57505
|
...t
|
|
57401
|
-
}),
|
|
57402
|
-
process.env.NODE_ENV !== "production" && (
|
|
57403
|
-
function
|
|
57404
|
-
let e = y.useContext(
|
|
57506
|
+
}), fV = /* @__PURE__ */ y.createContext(void 0);
|
|
57507
|
+
process.env.NODE_ENV !== "production" && (fV.displayName = "ScrollAreaRootContext");
|
|
57508
|
+
function pV() {
|
|
57509
|
+
let e = y.useContext(fV);
|
|
57405
57510
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? fc(53) : "Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.");
|
|
57406
57511
|
return e;
|
|
57407
57512
|
}
|
|
57408
57513
|
//#endregion
|
|
57409
57514
|
//#region ../../node_modules/@base-ui/react/scroll-area/root/ScrollAreaRootCssVars.mjs
|
|
57410
|
-
var
|
|
57515
|
+
var mV = /* @__PURE__ */ function(e) {
|
|
57411
57516
|
return e.scrollAreaCornerHeight = "--scroll-area-corner-height", e.scrollAreaCornerWidth = "--scroll-area-corner-width", e;
|
|
57412
57517
|
}({});
|
|
57413
57518
|
//#endregion
|
|
57414
57519
|
//#region ../../node_modules/@base-ui/react/scroll-area/utils/getOffset.mjs
|
|
57415
|
-
function
|
|
57520
|
+
function hV(e, t, n) {
|
|
57416
57521
|
if (!e) return 0;
|
|
57417
57522
|
let r = getComputedStyle(e), i = n === "x" ? "Inline" : "Block";
|
|
57418
57523
|
return n === "x" && t === "margin" ? parseFloat(r[`${t}InlineStart`]) * 2 : parseFloat(r[`${t}${i}Start`]) + parseFloat(r[`${t}${i}End`]);
|
|
57419
57524
|
}
|
|
57420
57525
|
//#endregion
|
|
57421
57526
|
//#region ../../node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.mjs
|
|
57422
|
-
var
|
|
57527
|
+
var gV = /* @__PURE__ */ function(e) {
|
|
57423
57528
|
return e.orientation = "data-orientation", e.hovering = "data-hovering", e.scrolling = "data-scrolling", e.hasOverflowX = "data-has-overflow-x", e.hasOverflowY = "data-has-overflow-y", e.overflowXStart = "data-overflow-x-start", e.overflowXEnd = "data-overflow-x-end", e.overflowYStart = "data-overflow-y-start", e.overflowYEnd = "data-overflow-y-end", e;
|
|
57424
|
-
}({}),
|
|
57425
|
-
className:
|
|
57529
|
+
}({}), _V = "base-ui-disable-scrollbar", vV = {
|
|
57530
|
+
className: _V,
|
|
57426
57531
|
getElement(e) {
|
|
57427
57532
|
return /* @__PURE__ */ V("style", {
|
|
57428
57533
|
nonce: e,
|
|
57429
|
-
href:
|
|
57534
|
+
href: _V,
|
|
57430
57535
|
precedence: "base-ui:low",
|
|
57431
|
-
children: `.${
|
|
57536
|
+
children: `.${_V}{scrollbar-width:none}.${_V}::-webkit-scrollbar{display:none}`
|
|
57432
57537
|
});
|
|
57433
57538
|
}
|
|
57434
57539
|
};
|
|
57435
|
-
process.env.NODE_ENV !== "production" && (
|
|
57540
|
+
process.env.NODE_ENV !== "production" && (vV.getElement.displayName = "styleDisableScrollbar.getElement");
|
|
57436
57541
|
//#endregion
|
|
57437
57542
|
//#region ../../node_modules/@base-ui/react/scroll-area/root/ScrollAreaRootDataAttributes.mjs
|
|
57438
|
-
var
|
|
57543
|
+
var yV = /* @__PURE__ */ function(e) {
|
|
57439
57544
|
return e.scrolling = "data-scrolling", e.hasOverflowX = "data-has-overflow-x", e.hasOverflowY = "data-has-overflow-y", e.overflowXStart = "data-overflow-x-start", e.overflowXEnd = "data-overflow-x-end", e.overflowYStart = "data-overflow-y-start", e.overflowYEnd = "data-overflow-y-end", e;
|
|
57440
|
-
}({}),
|
|
57441
|
-
hasOverflowX: (e) => e ? { [
|
|
57442
|
-
hasOverflowY: (e) => e ? { [
|
|
57443
|
-
overflowXStart: (e) => e ? { [
|
|
57444
|
-
overflowXEnd: (e) => e ? { [
|
|
57445
|
-
overflowYStart: (e) => e ? { [
|
|
57446
|
-
overflowYEnd: (e) => e ? { [
|
|
57545
|
+
}({}), bV = {
|
|
57546
|
+
hasOverflowX: (e) => e ? { [yV.hasOverflowX]: "" } : null,
|
|
57547
|
+
hasOverflowY: (e) => e ? { [yV.hasOverflowY]: "" } : null,
|
|
57548
|
+
overflowXStart: (e) => e ? { [yV.overflowXStart]: "" } : null,
|
|
57549
|
+
overflowXEnd: (e) => e ? { [yV.overflowXEnd]: "" } : null,
|
|
57550
|
+
overflowYStart: (e) => e ? { [yV.overflowYStart]: "" } : null,
|
|
57551
|
+
overflowYEnd: (e) => e ? { [yV.overflowYEnd]: "" } : null,
|
|
57447
57552
|
cornerHidden: () => null
|
|
57448
|
-
},
|
|
57449
|
-
process.env.NODE_ENV !== "production" && (
|
|
57450
|
-
var
|
|
57451
|
-
function
|
|
57452
|
-
return y.useContext(
|
|
57553
|
+
}, xV = /* @__PURE__ */ y.createContext(void 0);
|
|
57554
|
+
process.env.NODE_ENV !== "production" && (xV.displayName = "CSPContext");
|
|
57555
|
+
var SV = { disableStyleElements: !1 };
|
|
57556
|
+
function CV() {
|
|
57557
|
+
return y.useContext(xV) ?? SV;
|
|
57453
57558
|
}
|
|
57454
57559
|
//#endregion
|
|
57455
57560
|
//#region ../../node_modules/@base-ui/react/scroll-area/root/ScrollAreaRoot.mjs
|
|
57456
|
-
var
|
|
57561
|
+
var wV = {
|
|
57457
57562
|
x: 0,
|
|
57458
57563
|
y: 0
|
|
57459
|
-
},
|
|
57564
|
+
}, TV = {
|
|
57460
57565
|
width: 0,
|
|
57461
57566
|
height: 0
|
|
57462
|
-
},
|
|
57567
|
+
}, EV = {
|
|
57463
57568
|
xStart: !1,
|
|
57464
57569
|
xEnd: !1,
|
|
57465
57570
|
yStart: !1,
|
|
57466
57571
|
yEnd: !1
|
|
57467
|
-
},
|
|
57572
|
+
}, DV = {
|
|
57468
57573
|
x: !0,
|
|
57469
57574
|
y: !0,
|
|
57470
57575
|
corner: !0
|
|
57471
|
-
},
|
|
57472
|
-
let { render: n, className: r, overflowEdgeThreshold: i, style: a, ...o } = e, { xStart: s, xEnd: c, yStart: l, yEnd: u } =
|
|
57576
|
+
}, OV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
57577
|
+
let { render: n, className: r, overflowEdgeThreshold: i, style: a, ...o } = e, { xStart: s, xEnd: c, yStart: l, yEnd: u } = kV(i), d = kp(), f = ca(), p = ca(), { nonce: m, disableStyleElements: h } = CV(), [g, _] = y.useState(!1), [v, b] = y.useState(!1), [x, S] = y.useState(!1), [C, w] = y.useState(!1), [T, E] = y.useState(!1), [D, O] = y.useState(TV), [k, A] = y.useState(TV), [j, M] = y.useState(EV), [N, P] = y.useState(DV), F = y.useRef(null), I = y.useRef(null), L = y.useRef(null), R = y.useRef(null), z = y.useRef(null), ee = y.useRef(null), te = y.useRef(null), ne = y.useRef(!1), re = y.useRef(0), ie = y.useRef(0), B = y.useRef(0), ae = y.useRef(0), oe = y.useRef("vertical"), se = y.useRef(wV), ce = J((e) => {
|
|
57473
57578
|
let t = e.x - se.current.x, n = e.y - se.current.y;
|
|
57474
57579
|
se.current = e, n !== 0 && (S(!0), f.start(500, () => {
|
|
57475
57580
|
S(!1);
|
|
@@ -57477,20 +57582,20 @@ var _V = {
|
|
|
57477
57582
|
b(!1);
|
|
57478
57583
|
}));
|
|
57479
57584
|
}), V = J((e) => {
|
|
57480
|
-
e.button === 0 && (ne.current = !0, re.current = e.clientY, ie.current = e.clientX, oe.current = e.currentTarget.getAttribute(
|
|
57585
|
+
e.button === 0 && (ne.current = !0, re.current = e.clientY, ie.current = e.clientX, oe.current = e.currentTarget.getAttribute(gV.orientation), I.current && (B.current = I.current.scrollTop, ae.current = I.current.scrollLeft), z.current && oe.current === "vertical" && z.current.setPointerCapture(e.pointerId), ee.current && oe.current === "horizontal" && ee.current.setPointerCapture(e.pointerId));
|
|
57481
57586
|
}), le = J((e) => {
|
|
57482
57587
|
if (!ne.current) return;
|
|
57483
57588
|
let t = e.clientY - re.current, n = e.clientX - ie.current;
|
|
57484
57589
|
if (I.current) {
|
|
57485
57590
|
let r = I.current.scrollHeight, i = I.current.clientHeight, a = I.current.scrollWidth, o = I.current.clientWidth;
|
|
57486
57591
|
if (z.current && L.current && oe.current === "vertical") {
|
|
57487
|
-
let n =
|
|
57592
|
+
let n = hV(L.current, "padding", "y"), a = hV(z.current, "margin", "y"), o = z.current.offsetHeight, s = t / (L.current.offsetHeight - o - n - a);
|
|
57488
57593
|
I.current.scrollTop = B.current + s * (r - i), e.preventDefault(), S(!0), f.start(500, () => {
|
|
57489
57594
|
S(!1);
|
|
57490
57595
|
});
|
|
57491
57596
|
}
|
|
57492
57597
|
if (ee.current && R.current && oe.current === "horizontal") {
|
|
57493
|
-
let t =
|
|
57598
|
+
let t = hV(R.current, "padding", "x"), r = hV(ee.current, "margin", "x"), i = ee.current.offsetWidth, s = n / (R.current.offsetWidth - i - t - r);
|
|
57494
57599
|
I.current.scrollLeft = ae.current + s * (a - o), e.preventDefault(), b(!0), p.start(500, () => {
|
|
57495
57600
|
b(!1);
|
|
57496
57601
|
});
|
|
@@ -57531,14 +57636,14 @@ var _V = {
|
|
|
57531
57636
|
},
|
|
57532
57637
|
style: {
|
|
57533
57638
|
position: "relative",
|
|
57534
|
-
[
|
|
57535
|
-
[
|
|
57639
|
+
[mV.scrollAreaCornerHeight]: `${D.height}px`,
|
|
57640
|
+
[mV.scrollAreaCornerWidth]: `${D.width}px`
|
|
57536
57641
|
}
|
|
57537
57642
|
}, me = Lc("div", e, {
|
|
57538
57643
|
state: fe,
|
|
57539
57644
|
ref: [t, F],
|
|
57540
57645
|
props: [pe, o],
|
|
57541
|
-
stateAttributesMapping:
|
|
57646
|
+
stateAttributesMapping: bV
|
|
57542
57647
|
}), he = y.useMemo(() => ({
|
|
57543
57648
|
handlePointerDown: V,
|
|
57544
57649
|
handlePointerMove: le,
|
|
@@ -57600,13 +57705,13 @@ var _V = {
|
|
|
57600
57705
|
l,
|
|
57601
57706
|
u
|
|
57602
57707
|
]);
|
|
57603
|
-
return /* @__PURE__ */ H(
|
|
57708
|
+
return /* @__PURE__ */ H(fV.Provider, {
|
|
57604
57709
|
value: he,
|
|
57605
|
-
children: [!h &&
|
|
57710
|
+
children: [!h && vV.getElement(m), me]
|
|
57606
57711
|
});
|
|
57607
57712
|
});
|
|
57608
|
-
process.env.NODE_ENV !== "production" && (
|
|
57609
|
-
function
|
|
57713
|
+
process.env.NODE_ENV !== "production" && (OV.displayName = "ScrollAreaRoot");
|
|
57714
|
+
function kV(e) {
|
|
57610
57715
|
if (typeof e == "number") {
|
|
57611
57716
|
let t = Math.max(0, e);
|
|
57612
57717
|
return {
|
|
@@ -57625,40 +57730,40 @@ function SV(e) {
|
|
|
57625
57730
|
}
|
|
57626
57731
|
//#endregion
|
|
57627
57732
|
//#region ../../node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewportContext.mjs
|
|
57628
|
-
var
|
|
57629
|
-
process.env.NODE_ENV !== "production" && (
|
|
57630
|
-
function
|
|
57631
|
-
let e = y.useContext(
|
|
57733
|
+
var AV = /* @__PURE__ */ y.createContext(void 0);
|
|
57734
|
+
process.env.NODE_ENV !== "production" && (AV.displayName = "ScrollAreaViewportContext");
|
|
57735
|
+
function jV() {
|
|
57736
|
+
let e = y.useContext(AV);
|
|
57632
57737
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? fc(55) : "Base UI: ScrollAreaViewportContext missing. ScrollAreaViewport parts must be placed within <ScrollArea.Viewport>.");
|
|
57633
57738
|
return e;
|
|
57634
57739
|
}
|
|
57635
57740
|
//#endregion
|
|
57636
57741
|
//#region ../../node_modules/@base-ui/react/internals/clamp.mjs
|
|
57637
|
-
function
|
|
57742
|
+
function MV(e, t = -(2 ** 53 - 1), n = 2 ** 53 - 1) {
|
|
57638
57743
|
return Math.max(t, Math.min(e, n));
|
|
57639
57744
|
}
|
|
57640
57745
|
//#endregion
|
|
57641
57746
|
//#region ../../node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewportCssVars.mjs
|
|
57642
|
-
var
|
|
57747
|
+
var NV = /* @__PURE__ */ function(e) {
|
|
57643
57748
|
return e.scrollAreaOverflowXStart = "--scroll-area-overflow-x-start", e.scrollAreaOverflowXEnd = "--scroll-area-overflow-x-end", e.scrollAreaOverflowYStart = "--scroll-area-overflow-y-start", e.scrollAreaOverflowYEnd = "--scroll-area-overflow-y-end", e;
|
|
57644
57749
|
}({});
|
|
57645
|
-
function
|
|
57750
|
+
function PV(e, t) {
|
|
57646
57751
|
return Math.max(0, e - t);
|
|
57647
57752
|
}
|
|
57648
|
-
function
|
|
57753
|
+
function FV(e, t) {
|
|
57649
57754
|
if (t <= 0) return 0;
|
|
57650
|
-
let n =
|
|
57755
|
+
let n = MV(e, 0, t), r = n, i = t - n, a = r <= 1, o = i <= 1;
|
|
57651
57756
|
return a && o ? r <= i ? 0 : t : a ? 0 : o ? t : n;
|
|
57652
57757
|
}
|
|
57653
57758
|
//#endregion
|
|
57654
57759
|
//#region ../../node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewport.mjs
|
|
57655
|
-
var
|
|
57656
|
-
function
|
|
57657
|
-
|
|
57658
|
-
|
|
57659
|
-
|
|
57660
|
-
|
|
57661
|
-
|
|
57760
|
+
var IV = !1;
|
|
57761
|
+
function LV() {
|
|
57762
|
+
IV || Qi || (typeof CSS < "u" && "registerProperty" in CSS && [
|
|
57763
|
+
NV.scrollAreaOverflowXStart,
|
|
57764
|
+
NV.scrollAreaOverflowXEnd,
|
|
57765
|
+
NV.scrollAreaOverflowYStart,
|
|
57766
|
+
NV.scrollAreaOverflowYEnd
|
|
57662
57767
|
].forEach((e) => {
|
|
57663
57768
|
try {
|
|
57664
57769
|
CSS.registerProperty({
|
|
@@ -57668,10 +57773,10 @@ function AV() {
|
|
|
57668
57773
|
initialValue: "0px"
|
|
57669
57774
|
});
|
|
57670
57775
|
} catch {}
|
|
57671
|
-
}),
|
|
57776
|
+
}), IV = !0);
|
|
57672
57777
|
}
|
|
57673
|
-
var
|
|
57674
|
-
let { render: n, className: r, style: i, ...a } = e, { viewportRef: o, scrollbarYRef: s, scrollbarXRef: c, thumbYRef: l, thumbXRef: u, cornerRef: d, cornerSize: f, setCornerSize: p, setThumbSize: m, rootId: h, setHiddenState: g, hiddenState: _, setHasMeasuredScrollbar: v, handleScroll: b, setHovering: x, setOverflowEdges: S, overflowEdges: C, overflowEdgeThreshold: w, scrollingX: T, scrollingY: E } =
|
|
57778
|
+
var RV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
57779
|
+
let { render: n, className: r, style: i, ...a } = e, { viewportRef: o, scrollbarYRef: s, scrollbarXRef: c, thumbYRef: l, thumbXRef: u, cornerRef: d, cornerSize: f, setCornerSize: p, setThumbSize: m, rootId: h, setHiddenState: g, hiddenState: _, setHasMeasuredScrollbar: v, handleScroll: b, setHovering: x, setOverflowEdges: S, overflowEdges: C, overflowEdgeThreshold: w, scrollingX: T, scrollingY: E } = pV(), D = ug(), O = y.useRef(!0), k = y.useRef([
|
|
57675
57780
|
NaN,
|
|
57676
57781
|
NaN,
|
|
57677
57782
|
NaN,
|
|
@@ -57681,14 +57786,14 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57681
57786
|
if (!e) return;
|
|
57682
57787
|
let h = e.scrollHeight, _ = e.scrollWidth, y = e.clientHeight, b = e.clientWidth, x = e.scrollTop, C = e.scrollLeft, T = k.current, E = Number.isNaN(T[0]);
|
|
57683
57788
|
if (T[0] = y, T[1] = h, T[2] = b, T[3] = _, E && v(!0), h === 0 || _ === 0) return;
|
|
57684
|
-
let O =
|
|
57789
|
+
let O = zV(e), A = O.y, j = O.x, M = b / _, N = y / h, P = Math.max(0, _ - b), F = Math.max(0, h - y), I = 0, L = 0;
|
|
57685
57790
|
if (!j) {
|
|
57686
57791
|
let e = 0;
|
|
57687
|
-
e =
|
|
57792
|
+
e = MV(D === "rtl" ? -C : C, 0, P), I = FV(e, P), L = P - I;
|
|
57688
57793
|
}
|
|
57689
|
-
let R = A ? 0 :
|
|
57794
|
+
let R = A ? 0 : MV(x, 0, F), z = A ? 0 : FV(R, F), ee = A ? 0 : F - z, te = j ? 0 : b, ne = A ? 0 : y, re = 0, ie = 0;
|
|
57690
57795
|
!j && !A && (re = t?.offsetWidth || 0, ie = n?.offsetHeight || 0);
|
|
57691
|
-
let B = f.width === 0 && f.height === 0, ae = B ? re : 0, oe = B ? ie : 0, se =
|
|
57796
|
+
let B = f.width === 0 && f.height === 0, ae = B ? re : 0, oe = B ? ie : 0, se = hV(n, "padding", "x"), ce = hV(t, "padding", "y"), V = hV(i, "margin", "x"), H = hV(r, "margin", "y"), le = te - se - V, ue = ne - ce - H, de = n ? Math.min(n.offsetWidth - ae, le) : le, U = t ? Math.min(t.offsetHeight - oe, ue) : ue, fe = Math.max(16, de * M), pe = Math.max(16, U * N);
|
|
57692
57797
|
if (m((e) => e.height === pe && e.width === fe ? e : {
|
|
57693
57798
|
width: fe,
|
|
57694
57799
|
height: pe
|
|
@@ -57697,14 +57802,14 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57697
57802
|
r.style.transform = `translate3d(0,${a}px,0)`;
|
|
57698
57803
|
}
|
|
57699
57804
|
if (n && i) {
|
|
57700
|
-
let e = n.offsetWidth - fe - se - V, t = _ - b, r = t === 0 ? 0 : C / t, a = D === "rtl" ?
|
|
57805
|
+
let e = n.offsetWidth - fe - se - V, t = _ - b, r = t === 0 ? 0 : C / t, a = D === "rtl" ? MV(r * e, -e, 0) : MV(r * e, 0, e);
|
|
57701
57806
|
i.style.transform = `translate3d(${a}px,0,0)`;
|
|
57702
57807
|
}
|
|
57703
57808
|
let me = [
|
|
57704
|
-
[
|
|
57705
|
-
[
|
|
57706
|
-
[
|
|
57707
|
-
[
|
|
57809
|
+
[NV.scrollAreaOverflowXStart, I],
|
|
57810
|
+
[NV.scrollAreaOverflowXEnd, L],
|
|
57811
|
+
[NV.scrollAreaOverflowYStart, z],
|
|
57812
|
+
[NV.scrollAreaOverflowYEnd, ee]
|
|
57708
57813
|
];
|
|
57709
57814
|
for (let [t, n] of me) e.style.setProperty(t, `${n}px`);
|
|
57710
57815
|
a && (j || A ? p({
|
|
@@ -57713,7 +57818,7 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57713
57818
|
}) : !j && !A && p({
|
|
57714
57819
|
width: re,
|
|
57715
57820
|
height: ie
|
|
57716
|
-
})), g((e) =>
|
|
57821
|
+
})), g((e) => BV(e, O));
|
|
57717
57822
|
let he = {
|
|
57718
57823
|
xStart: !j && I > w.xStart,
|
|
57719
57824
|
xEnd: !j && L > w.xEnd,
|
|
@@ -57723,7 +57828,7 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57723
57828
|
S((e) => e.xStart === he.xStart && e.xEnd === he.xEnd && e.yStart === he.yStart && e.yEnd === he.yEnd ? e : he);
|
|
57724
57829
|
});
|
|
57725
57830
|
K(() => {
|
|
57726
|
-
o.current &&
|
|
57831
|
+
o.current && LV();
|
|
57727
57832
|
}, [o]), K(() => {
|
|
57728
57833
|
queueMicrotask(M);
|
|
57729
57834
|
}, [
|
|
@@ -57765,7 +57870,7 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57765
57870
|
role: "presentation",
|
|
57766
57871
|
...h && { "data-id": `${h}-viewport` },
|
|
57767
57872
|
tabIndex: _.x && _.y ? -1 : 0,
|
|
57768
|
-
className:
|
|
57873
|
+
className: vV.className,
|
|
57769
57874
|
style: { overflow: "scroll" },
|
|
57770
57875
|
onScroll() {
|
|
57771
57876
|
o.current && (M(), O.current || b({
|
|
@@ -57800,15 +57905,15 @@ var jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57800
57905
|
ref: [t, o],
|
|
57801
57906
|
state: F,
|
|
57802
57907
|
props: [P, a],
|
|
57803
|
-
stateAttributesMapping:
|
|
57908
|
+
stateAttributesMapping: bV
|
|
57804
57909
|
}), L = y.useMemo(() => ({ computeThumbPosition: M }), [M]);
|
|
57805
|
-
return /* @__PURE__ */ V(
|
|
57910
|
+
return /* @__PURE__ */ V(AV.Provider, {
|
|
57806
57911
|
value: L,
|
|
57807
57912
|
children: I
|
|
57808
57913
|
});
|
|
57809
57914
|
});
|
|
57810
|
-
process.env.NODE_ENV !== "production" && (
|
|
57811
|
-
function
|
|
57915
|
+
process.env.NODE_ENV !== "production" && (RV.displayName = "ScrollAreaViewport");
|
|
57916
|
+
function zV(e) {
|
|
57812
57917
|
let t = e.clientHeight >= e.scrollHeight, n = e.clientWidth >= e.scrollWidth;
|
|
57813
57918
|
return {
|
|
57814
57919
|
y: t,
|
|
@@ -57816,24 +57921,24 @@ function MV(e) {
|
|
|
57816
57921
|
corner: t || n
|
|
57817
57922
|
};
|
|
57818
57923
|
}
|
|
57819
|
-
function
|
|
57924
|
+
function BV(e, t) {
|
|
57820
57925
|
return e.y === t.y && e.x === t.x && e.corner === t.corner ? e : t;
|
|
57821
57926
|
}
|
|
57822
57927
|
//#endregion
|
|
57823
57928
|
//#region ../../node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarContext.mjs
|
|
57824
|
-
var
|
|
57825
|
-
process.env.NODE_ENV !== "production" && (
|
|
57826
|
-
function
|
|
57827
|
-
let e = y.useContext(
|
|
57929
|
+
var VV = /* @__PURE__ */ y.createContext(void 0);
|
|
57930
|
+
process.env.NODE_ENV !== "production" && (VV.displayName = "ScrollAreaScrollbarContext");
|
|
57931
|
+
function HV() {
|
|
57932
|
+
let e = y.useContext(VV);
|
|
57828
57933
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? fc(54) : "Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.");
|
|
57829
57934
|
return e;
|
|
57830
57935
|
}
|
|
57831
57936
|
//#endregion
|
|
57832
57937
|
//#region ../../node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarCssVars.mjs
|
|
57833
|
-
var
|
|
57938
|
+
var UV = /* @__PURE__ */ function(e) {
|
|
57834
57939
|
return e.scrollAreaThumbHeight = "--scroll-area-thumb-height", e.scrollAreaThumbWidth = "--scroll-area-thumb-width", e;
|
|
57835
|
-
}({}),
|
|
57836
|
-
let { render: n, className: r, orientation: i = "vertical", keepMounted: a = !1, style: o, ...s } = e, { hovering: c, scrollingX: l, scrollingY: u, hiddenState: d, overflowEdges: f, scrollbarYRef: p, scrollbarXRef: m, viewportRef: h, thumbYRef: g, thumbXRef: _, handlePointerDown: v, handlePointerUp: b, handleScroll: x, rootId: S, thumbSize: C, hasMeasuredScrollbar: w } =
|
|
57940
|
+
}({}), WV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
57941
|
+
let { render: n, className: r, orientation: i = "vertical", keepMounted: a = !1, style: o, ...s } = e, { hovering: c, scrollingX: l, scrollingY: u, hiddenState: d, overflowEdges: f, scrollbarYRef: p, scrollbarXRef: m, viewportRef: h, thumbYRef: g, thumbXRef: _, handlePointerDown: v, handlePointerUp: b, handleScroll: x, rootId: S, thumbSize: C, hasMeasuredScrollbar: w } = pV(), T = {
|
|
57837
57942
|
hovering: c,
|
|
57838
57943
|
scrolling: {
|
|
57839
57944
|
horizontal: l,
|
|
@@ -57879,11 +57984,11 @@ var IV = /* @__PURE__ */ function(e) {
|
|
|
57879
57984
|
let t = za(e.nativeEvent), n = i === "vertical" ? g.current : _.current;
|
|
57880
57985
|
if (!(n && q(n, t)) && h.current) {
|
|
57881
57986
|
if (g.current && p.current && i === "vertical") {
|
|
57882
|
-
let t =
|
|
57987
|
+
let t = hV(g.current, "margin", "y"), n = hV(p.current, "padding", "y"), r = g.current.offsetHeight, i = p.current.getBoundingClientRect(), a = e.clientY - i.top - r / 2 - n + t / 2, o = h.current.scrollHeight, s = h.current.clientHeight, c = a / (p.current.offsetHeight - r - n - t) * (o - s);
|
|
57883
57988
|
h.current.scrollTop = c;
|
|
57884
57989
|
}
|
|
57885
57990
|
if (_.current && m.current && i === "horizontal") {
|
|
57886
|
-
let t =
|
|
57991
|
+
let t = hV(_.current, "margin", "x"), n = hV(m.current, "padding", "x"), r = _.current.offsetWidth, i = m.current.getBoundingClientRect(), a = e.clientX - i.left - r / 2 - n + t / 2, o = h.current.scrollWidth, s = h.current.clientWidth, c = a / (m.current.offsetWidth - r - n - t), l;
|
|
57887
57992
|
E === "rtl" ? (l = (1 - c) * (o - s), h.current.scrollLeft <= 0 && (l = -l)) : l = c * (o - s), h.current.scrollLeft = l;
|
|
57888
57993
|
}
|
|
57889
57994
|
x({
|
|
@@ -57902,33 +58007,33 @@ var IV = /* @__PURE__ */ function(e) {
|
|
|
57902
58007
|
visibility: D ? "hidden" : void 0,
|
|
57903
58008
|
...i === "vertical" && {
|
|
57904
58009
|
top: 0,
|
|
57905
|
-
bottom: `var(${
|
|
58010
|
+
bottom: `var(${mV.scrollAreaCornerHeight})`,
|
|
57906
58011
|
insetInlineEnd: 0,
|
|
57907
|
-
[
|
|
58012
|
+
[UV.scrollAreaThumbHeight]: `${C.height}px`
|
|
57908
58013
|
},
|
|
57909
58014
|
...i === "horizontal" && {
|
|
57910
58015
|
insetInlineStart: 0,
|
|
57911
|
-
insetInlineEnd: `var(${
|
|
58016
|
+
insetInlineEnd: `var(${mV.scrollAreaCornerWidth})`,
|
|
57912
58017
|
bottom: 0,
|
|
57913
|
-
[
|
|
58018
|
+
[UV.scrollAreaThumbWidth]: `${C.width}px`
|
|
57914
58019
|
}
|
|
57915
58020
|
}
|
|
57916
58021
|
}, j = Lc("div", e, {
|
|
57917
58022
|
ref: [t, i === "vertical" ? p : m],
|
|
57918
58023
|
state: T,
|
|
57919
58024
|
props: [A, s],
|
|
57920
|
-
stateAttributesMapping:
|
|
58025
|
+
stateAttributesMapping: bV
|
|
57921
58026
|
}), M = y.useMemo(() => ({ orientation: i }), [i]);
|
|
57922
|
-
return k ? /* @__PURE__ */ V(
|
|
58027
|
+
return k ? /* @__PURE__ */ V(VV.Provider, {
|
|
57923
58028
|
value: M,
|
|
57924
58029
|
children: j
|
|
57925
58030
|
}) : null;
|
|
57926
58031
|
});
|
|
57927
|
-
process.env.NODE_ENV !== "production" && (
|
|
58032
|
+
process.env.NODE_ENV !== "production" && (WV.displayName = "ScrollAreaScrollbar");
|
|
57928
58033
|
//#endregion
|
|
57929
58034
|
//#region ../../node_modules/@base-ui/react/scroll-area/content/ScrollAreaContent.mjs
|
|
57930
|
-
var
|
|
57931
|
-
let { render: n, className: r, style: i, ...a } = e, { computeThumbPosition: o } =
|
|
58035
|
+
var GV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58036
|
+
let { render: n, className: r, style: i, ...a } = e, { computeThumbPosition: o } = jV(), { hasMeasuredScrollbar: s, viewportState: c } = pV(), l = y.useRef(null), u = y.useRef(s);
|
|
57932
58037
|
return K(() => {
|
|
57933
58038
|
if (typeof ResizeObserver > "u") return;
|
|
57934
58039
|
let e = !1, t = new ResizeObserver(() => {
|
|
@@ -57940,18 +58045,18 @@ var RV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57940
58045
|
}, [o]), Lc("div", e, {
|
|
57941
58046
|
ref: [t, l],
|
|
57942
58047
|
state: c,
|
|
57943
|
-
stateAttributesMapping:
|
|
58048
|
+
stateAttributesMapping: bV,
|
|
57944
58049
|
props: [{
|
|
57945
58050
|
role: "presentation",
|
|
57946
58051
|
style: { minWidth: "fit-content" }
|
|
57947
58052
|
}, a]
|
|
57948
58053
|
});
|
|
57949
58054
|
});
|
|
57950
|
-
process.env.NODE_ENV !== "production" && (
|
|
58055
|
+
process.env.NODE_ENV !== "production" && (GV.displayName = "ScrollAreaContent");
|
|
57951
58056
|
//#endregion
|
|
57952
58057
|
//#region ../../node_modules/@base-ui/react/scroll-area/thumb/ScrollAreaThumb.mjs
|
|
57953
|
-
var
|
|
57954
|
-
let { render: n, className: r, style: i, ...a } = e, { thumbYRef: o, thumbXRef: s, handlePointerDown: c, handlePointerMove: l, handlePointerUp: u, setScrollingX: d, setScrollingY: f, scrollingX: p, scrollingY: m, hasMeasuredScrollbar: h } =
|
|
58058
|
+
var KV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58059
|
+
let { render: n, className: r, style: i, ...a } = e, { thumbYRef: o, thumbXRef: s, handlePointerDown: c, handlePointerMove: l, handlePointerUp: u, setScrollingX: d, setScrollingY: f, scrollingX: p, scrollingY: m, hasMeasuredScrollbar: h } = pV(), { orientation: g } = HV(), _ = {
|
|
57955
58060
|
scrolling: g === "horizontal" ? p : m,
|
|
57956
58061
|
orientation: g
|
|
57957
58062
|
};
|
|
@@ -57968,17 +58073,17 @@ var zV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57968
58073
|
onPointerCancel: v,
|
|
57969
58074
|
style: {
|
|
57970
58075
|
visibility: h ? void 0 : "hidden",
|
|
57971
|
-
...g === "vertical" && { height: `var(${
|
|
57972
|
-
...g === "horizontal" && { width: `var(${
|
|
58076
|
+
...g === "vertical" && { height: `var(${UV.scrollAreaThumbHeight})` },
|
|
58077
|
+
...g === "horizontal" && { width: `var(${UV.scrollAreaThumbWidth})` }
|
|
57973
58078
|
}
|
|
57974
58079
|
}, a]
|
|
57975
58080
|
});
|
|
57976
58081
|
});
|
|
57977
|
-
process.env.NODE_ENV !== "production" && (
|
|
58082
|
+
process.env.NODE_ENV !== "production" && (KV.displayName = "ScrollAreaThumb");
|
|
57978
58083
|
//#endregion
|
|
57979
58084
|
//#region ../../node_modules/@base-ui/react/scroll-area/corner/ScrollAreaCorner.mjs
|
|
57980
|
-
var
|
|
57981
|
-
let { render: n, className: r, style: i, ...a } = e, { cornerRef: o, cornerSize: s, hiddenState: c } =
|
|
58085
|
+
var qV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58086
|
+
let { render: n, className: r, style: i, ...a } = e, { cornerRef: o, cornerSize: s, hiddenState: c } = pV(), l = Lc("div", e, {
|
|
57982
58087
|
ref: [t, o],
|
|
57983
58088
|
props: [{ style: {
|
|
57984
58089
|
position: "absolute",
|
|
@@ -57990,52 +58095,52 @@ var BV = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
57990
58095
|
});
|
|
57991
58096
|
return c.corner ? null : l;
|
|
57992
58097
|
});
|
|
57993
|
-
process.env.NODE_ENV !== "production" && (
|
|
58098
|
+
process.env.NODE_ENV !== "production" && (qV.displayName = "ScrollAreaCorner");
|
|
57994
58099
|
//#endregion
|
|
57995
58100
|
//#region src/components/ui/scroll-area.tsx
|
|
57996
|
-
var
|
|
58101
|
+
var JV = y.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ H(OV, {
|
|
57997
58102
|
ref: r,
|
|
57998
58103
|
className: U("relative overflow-hidden", e),
|
|
57999
58104
|
...n,
|
|
58000
58105
|
children: [
|
|
58001
|
-
/* @__PURE__ */ V(
|
|
58106
|
+
/* @__PURE__ */ V(RV, {
|
|
58002
58107
|
className: "h-full w-full rounded-[inherit]",
|
|
58003
58108
|
children: t
|
|
58004
58109
|
}),
|
|
58005
|
-
/* @__PURE__ */ V(
|
|
58006
|
-
/* @__PURE__ */ V(
|
|
58110
|
+
/* @__PURE__ */ V(YV, {}),
|
|
58111
|
+
/* @__PURE__ */ V(qV, {})
|
|
58007
58112
|
]
|
|
58008
58113
|
}));
|
|
58009
|
-
|
|
58010
|
-
var
|
|
58114
|
+
JV.displayName = "ScrollArea";
|
|
58115
|
+
var YV = y.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r) => /* @__PURE__ */ V(WV, {
|
|
58011
58116
|
ref: r,
|
|
58012
58117
|
orientation: t,
|
|
58013
58118
|
className: U("flex touch-none select-none transition-colors", t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]", e),
|
|
58014
58119
|
...n,
|
|
58015
|
-
children: /* @__PURE__ */ V(
|
|
58120
|
+
children: /* @__PURE__ */ V(KV, { className: "relative flex-1 rounded-full bg-border" })
|
|
58016
58121
|
}));
|
|
58017
|
-
|
|
58122
|
+
YV.displayName = "ScrollBar";
|
|
58018
58123
|
//#endregion
|
|
58019
58124
|
//#region ../../node_modules/@base-ui/react/select/root/SelectRootContext.mjs
|
|
58020
|
-
var
|
|
58021
|
-
process.env.NODE_ENV !== "production" && (
|
|
58022
|
-
var
|
|
58023
|
-
process.env.NODE_ENV !== "production" && (
|
|
58024
|
-
function
|
|
58025
|
-
let e = y.useContext(
|
|
58125
|
+
var XV = /* @__PURE__ */ y.createContext(null);
|
|
58126
|
+
process.env.NODE_ENV !== "production" && (XV.displayName = "SelectRootContext");
|
|
58127
|
+
var ZV = /* @__PURE__ */ y.createContext(null);
|
|
58128
|
+
process.env.NODE_ENV !== "production" && (ZV.displayName = "SelectFloatingContext");
|
|
58129
|
+
function QV() {
|
|
58130
|
+
let e = y.useContext(XV);
|
|
58026
58131
|
if (e === null) throw Error(process.env.NODE_ENV === "production" ? fc(60) : "Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.");
|
|
58027
58132
|
return e;
|
|
58028
58133
|
}
|
|
58029
|
-
function
|
|
58030
|
-
let e = y.useContext(
|
|
58134
|
+
function $V() {
|
|
58135
|
+
let e = y.useContext(ZV);
|
|
58031
58136
|
if (e === null) throw Error(process.env.NODE_ENV === "production" ? fc(61) : "Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.");
|
|
58032
58137
|
return e;
|
|
58033
58138
|
}
|
|
58034
58139
|
//#endregion
|
|
58035
58140
|
//#region ../../node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs
|
|
58036
|
-
var
|
|
58141
|
+
var eH = /* @__PURE__ */ function(e) {
|
|
58037
58142
|
return e.disabled = "data-disabled", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.filled = "data-filled", e.focused = "data-focused", e;
|
|
58038
|
-
}({}),
|
|
58143
|
+
}({}), tH = {
|
|
58039
58144
|
badInput: !1,
|
|
58040
58145
|
customError: !1,
|
|
58041
58146
|
patternMismatch: !1,
|
|
@@ -58047,22 +58152,22 @@ var qV = /* @__PURE__ */ function(e) {
|
|
|
58047
58152
|
typeMismatch: !1,
|
|
58048
58153
|
valid: null,
|
|
58049
58154
|
valueMissing: !1
|
|
58050
|
-
},
|
|
58155
|
+
}, nH = {
|
|
58051
58156
|
valid: null,
|
|
58052
58157
|
touched: !1,
|
|
58053
58158
|
dirty: !1,
|
|
58054
58159
|
filled: !1,
|
|
58055
58160
|
focused: !1
|
|
58056
|
-
},
|
|
58161
|
+
}, rH = {
|
|
58057
58162
|
disabled: !1,
|
|
58058
|
-
...
|
|
58059
|
-
},
|
|
58060
|
-
return e === null ? null : e ? { [
|
|
58061
|
-
} },
|
|
58163
|
+
...nH
|
|
58164
|
+
}, iH = { valid(e) {
|
|
58165
|
+
return e === null ? null : e ? { [eH.valid]: "" } : { [eH.invalid]: "" };
|
|
58166
|
+
} }, aH = {
|
|
58062
58167
|
invalid: void 0,
|
|
58063
58168
|
name: void 0,
|
|
58064
58169
|
validityData: {
|
|
58065
|
-
state:
|
|
58170
|
+
state: tH,
|
|
58066
58171
|
errors: [],
|
|
58067
58172
|
error: "",
|
|
58068
58173
|
value: "",
|
|
@@ -58070,19 +58175,19 @@ var qV = /* @__PURE__ */ function(e) {
|
|
|
58070
58175
|
},
|
|
58071
58176
|
setValidityData: ma,
|
|
58072
58177
|
disabled: void 0,
|
|
58073
|
-
touched:
|
|
58178
|
+
touched: nH.touched,
|
|
58074
58179
|
setTouched: ma,
|
|
58075
|
-
dirty:
|
|
58180
|
+
dirty: nH.dirty,
|
|
58076
58181
|
setDirty: ma,
|
|
58077
|
-
filled:
|
|
58182
|
+
filled: nH.filled,
|
|
58078
58183
|
setFilled: ma,
|
|
58079
|
-
focused:
|
|
58184
|
+
focused: nH.focused,
|
|
58080
58185
|
setFocused: ma,
|
|
58081
58186
|
validate: () => null,
|
|
58082
58187
|
validationMode: "onSubmit",
|
|
58083
58188
|
validationDebounceTime: 0,
|
|
58084
58189
|
shouldValidateOnChange: () => !1,
|
|
58085
|
-
state:
|
|
58190
|
+
state: rH,
|
|
58086
58191
|
markedDirtyRef: { current: !1 },
|
|
58087
58192
|
registerFieldControl: ma,
|
|
58088
58193
|
validation: {
|
|
@@ -58092,17 +58197,17 @@ var qV = /* @__PURE__ */ function(e) {
|
|
|
58092
58197
|
commit: async () => {},
|
|
58093
58198
|
change: ma
|
|
58094
58199
|
}
|
|
58095
|
-
},
|
|
58096
|
-
process.env.NODE_ENV !== "production" && (
|
|
58097
|
-
function
|
|
58098
|
-
let t = y.useContext(
|
|
58200
|
+
}, oH = /* @__PURE__ */ y.createContext(aH);
|
|
58201
|
+
process.env.NODE_ENV !== "production" && (oH.displayName = "FieldRootContext");
|
|
58202
|
+
function sH(e = !0) {
|
|
58203
|
+
let t = y.useContext(oH);
|
|
58099
58204
|
if (t.setValidityData === ma && !e) throw Error(process.env.NODE_ENV === "production" ? fc(28) : "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.");
|
|
58100
58205
|
return t;
|
|
58101
58206
|
}
|
|
58102
58207
|
//#endregion
|
|
58103
58208
|
//#region ../../node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs
|
|
58104
|
-
function
|
|
58105
|
-
let { registerFieldControl: o } =
|
|
58209
|
+
function cH(e, t, n, r, i = !0, a) {
|
|
58210
|
+
let { registerFieldControl: o } = sH(), s = y.useRef(null);
|
|
58106
58211
|
s.current ||= Symbol(), K(() => {
|
|
58107
58212
|
let c = s.current;
|
|
58108
58213
|
return !c || !i ? void 0 : (o(c, {
|
|
@@ -58126,7 +58231,7 @@ function tH(e, t, n, r, i = !0, a) {
|
|
|
58126
58231
|
}
|
|
58127
58232
|
//#endregion
|
|
58128
58233
|
//#region ../../node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
|
|
58129
|
-
var
|
|
58234
|
+
var lH = /* @__PURE__ */ y.createContext({
|
|
58130
58235
|
controlId: void 0,
|
|
58131
58236
|
registerControlId: ma,
|
|
58132
58237
|
labelId: void 0,
|
|
@@ -58135,14 +58240,14 @@ var nH = /* @__PURE__ */ y.createContext({
|
|
|
58135
58240
|
setMessageIds: ma,
|
|
58136
58241
|
getDescriptionProps: (e) => e
|
|
58137
58242
|
});
|
|
58138
|
-
process.env.NODE_ENV !== "production" && (
|
|
58139
|
-
function
|
|
58140
|
-
return y.useContext(
|
|
58243
|
+
process.env.NODE_ENV !== "production" && (lH.displayName = "LabelableContext");
|
|
58244
|
+
function uH() {
|
|
58245
|
+
return y.useContext(lH);
|
|
58141
58246
|
}
|
|
58142
58247
|
//#endregion
|
|
58143
58248
|
//#region ../../node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
|
|
58144
|
-
function
|
|
58145
|
-
let { id: t, implicit: n = !1, controlRef: r } = e, { controlId: i, registerControlId: a } =
|
|
58249
|
+
function dH(e = {}) {
|
|
58250
|
+
let { id: t, implicit: n = !1, controlRef: r } = e, { controlId: i, registerControlId: a } = uH(), o = kp(t), s = n ? i : void 0, c = ra(() => Symbol("labelable-control")), l = y.useRef(!1), u = y.useRef(t != null), d = J(() => {
|
|
58146
58251
|
!l.current || a === ma || (l.current = !1, a(c.current, void 0));
|
|
58147
58252
|
});
|
|
58148
58253
|
return K(() => {
|
|
@@ -58175,22 +58280,22 @@ function iH(e = {}) {
|
|
|
58175
58280
|
}
|
|
58176
58281
|
//#endregion
|
|
58177
58282
|
//#region ../../node_modules/@base-ui/react/internals/itemEquality.mjs
|
|
58178
|
-
var
|
|
58179
|
-
function
|
|
58283
|
+
var fH = (e, t) => Object.is(e, t);
|
|
58284
|
+
function pH(e, t, n) {
|
|
58180
58285
|
return e == null || t == null ? Object.is(e, t) : n(e, t);
|
|
58181
58286
|
}
|
|
58182
|
-
function
|
|
58183
|
-
return !e || e.length === 0 ? !1 : e.some((e) => e === void 0 ? !1 :
|
|
58287
|
+
function mH(e, t, n) {
|
|
58288
|
+
return !e || e.length === 0 ? !1 : e.some((e) => e === void 0 ? !1 : pH(t, e, n));
|
|
58184
58289
|
}
|
|
58185
|
-
function
|
|
58186
|
-
return !e || e.length === 0 ? -1 : e.findIndex((e) => e === void 0 ? !1 :
|
|
58290
|
+
function hH(e, t, n) {
|
|
58291
|
+
return !e || e.length === 0 ? -1 : e.findIndex((e) => e === void 0 ? !1 : pH(e, t, n));
|
|
58187
58292
|
}
|
|
58188
|
-
function
|
|
58189
|
-
return e.filter((e) => !
|
|
58293
|
+
function gH(e, t, n) {
|
|
58294
|
+
return e.filter((e) => !pH(t, e, n));
|
|
58190
58295
|
}
|
|
58191
58296
|
//#endregion
|
|
58192
58297
|
//#region ../../node_modules/@base-ui/react/internals/serializeValue.mjs
|
|
58193
|
-
function
|
|
58298
|
+
function _H(e) {
|
|
58194
58299
|
if (e == null) return "";
|
|
58195
58300
|
if (typeof e == "string") return e;
|
|
58196
58301
|
try {
|
|
@@ -58201,39 +58306,39 @@ function uH(e) {
|
|
|
58201
58306
|
}
|
|
58202
58307
|
//#endregion
|
|
58203
58308
|
//#region ../../node_modules/@base-ui/react/internals/resolveValueLabel.mjs
|
|
58204
|
-
function
|
|
58309
|
+
function vH(e) {
|
|
58205
58310
|
return e != null && e.length > 0 && typeof e[0] == "object" && e[0] != null && "items" in e[0];
|
|
58206
58311
|
}
|
|
58207
|
-
function
|
|
58312
|
+
function yH(e) {
|
|
58208
58313
|
if (!Array.isArray(e)) return e != null && "null" in e;
|
|
58209
58314
|
let t = e;
|
|
58210
|
-
if (
|
|
58315
|
+
if (vH(t)) {
|
|
58211
58316
|
for (let e of t) for (let t of e.items) if (t && t.value == null && t.label != null) return !0;
|
|
58212
58317
|
return !1;
|
|
58213
58318
|
}
|
|
58214
58319
|
for (let e of t) if (e && e.value == null && e.label != null) return !0;
|
|
58215
58320
|
return !1;
|
|
58216
58321
|
}
|
|
58217
|
-
function
|
|
58322
|
+
function bH(e, t) {
|
|
58218
58323
|
if (t && e != null) return t(e) ?? "";
|
|
58219
58324
|
if (e && typeof e == "object") {
|
|
58220
58325
|
if ("label" in e && e.label != null) return String(e.label);
|
|
58221
58326
|
if ("value" in e) return String(e.value);
|
|
58222
58327
|
}
|
|
58223
|
-
return
|
|
58328
|
+
return _H(e);
|
|
58224
58329
|
}
|
|
58225
|
-
function
|
|
58226
|
-
return t && e != null ? t(e) ?? "" : e && typeof e == "object" && "value" in e && "label" in e ?
|
|
58330
|
+
function xH(e, t) {
|
|
58331
|
+
return t && e != null ? t(e) ?? "" : e && typeof e == "object" && "value" in e && "label" in e ? _H(e.value) : _H(e);
|
|
58227
58332
|
}
|
|
58228
|
-
function
|
|
58333
|
+
function SH(e, t, n) {
|
|
58229
58334
|
function r() {
|
|
58230
|
-
return
|
|
58335
|
+
return bH(e, n);
|
|
58231
58336
|
}
|
|
58232
58337
|
if (n && e != null) return n(e);
|
|
58233
58338
|
if (e && typeof e == "object" && "label" in e && e.label != null) return e.label;
|
|
58234
58339
|
if (t && !Array.isArray(t)) return t[e] ?? r();
|
|
58235
58340
|
if (Array.isArray(t)) {
|
|
58236
|
-
let n = t, i =
|
|
58341
|
+
let n = t, i = vH(n) ? n.flatMap((e) => e.items) : n;
|
|
58237
58342
|
if (typeof e != "object" || !e) {
|
|
58238
58343
|
let t = i.find((t) => t.value === e);
|
|
58239
58344
|
return t && t.label != null ? t.label : r();
|
|
@@ -58245,8 +58350,8 @@ function hH(e, t, n) {
|
|
|
58245
58350
|
}
|
|
58246
58351
|
return r();
|
|
58247
58352
|
}
|
|
58248
|
-
function
|
|
58249
|
-
return e.reduce((e, r, i) => (i > 0 && e.push(", "), e.push(/* @__PURE__ */ V(y.Fragment, { children:
|
|
58353
|
+
function CH(e, t, n) {
|
|
58354
|
+
return e.reduce((e, r, i) => (i > 0 && e.push(", "), e.push(/* @__PURE__ */ V(y.Fragment, { children: SH(r, t, n) }, i)), e), []);
|
|
58250
58355
|
}
|
|
58251
58356
|
//#endregion
|
|
58252
58357
|
//#region ../../node_modules/@base-ui/react/select/store.mjs
|
|
@@ -58262,9 +58367,9 @@ var $ = {
|
|
|
58262
58367
|
value: Y((e) => e.value),
|
|
58263
58368
|
hasSelectedValue: Y((e) => {
|
|
58264
58369
|
let { value: t, multiple: n, itemToStringValue: r } = e;
|
|
58265
|
-
return t == null ? !1 : n && Array.isArray(t) ? t.length > 0 :
|
|
58370
|
+
return t == null ? !1 : n && Array.isArray(t) ? t.length > 0 : xH(t, r) !== "";
|
|
58266
58371
|
}),
|
|
58267
|
-
hasNullItemLabel: Y((e, t) => t ?
|
|
58372
|
+
hasNullItemLabel: Y((e, t) => t ? yH(e.items) : !1),
|
|
58268
58373
|
open: Y((e) => e.open),
|
|
58269
58374
|
mounted: Y((e) => e.mounted),
|
|
58270
58375
|
forceMount: Y((e) => e.forceMount),
|
|
@@ -58275,7 +58380,7 @@ var $ = {
|
|
|
58275
58380
|
isActive: Y((e, t) => e.activeIndex === t),
|
|
58276
58381
|
isSelected: Y((e, t) => {
|
|
58277
58382
|
let n = e.isItemEqualToValue, r = e.value;
|
|
58278
|
-
return e.multiple ? Array.isArray(r) && r.some((e) =>
|
|
58383
|
+
return e.multiple ? Array.isArray(r) && r.some((e) => pH(t, e, n)) : pH(t, r, n);
|
|
58279
58384
|
}),
|
|
58280
58385
|
isSelectedByFocus: Y((e, t) => e.selectedIndex === t),
|
|
58281
58386
|
popupProps: Y((e) => e.popupProps),
|
|
@@ -58287,26 +58392,26 @@ var $ = {
|
|
|
58287
58392
|
scrollUpArrowVisible: Y((e) => e.scrollUpArrowVisible),
|
|
58288
58393
|
scrollDownArrowVisible: Y((e) => e.scrollDownArrowVisible),
|
|
58289
58394
|
hasScrollArrows: Y((e) => e.hasScrollArrows)
|
|
58290
|
-
},
|
|
58395
|
+
}, wH = /* @__PURE__ */ y.createContext({
|
|
58291
58396
|
formRef: { current: { fields: /* @__PURE__ */ new Map() } },
|
|
58292
58397
|
errors: {},
|
|
58293
58398
|
clearErrors: ma,
|
|
58294
58399
|
validationMode: "onSubmit",
|
|
58295
58400
|
submitAttemptedRef: { current: !1 }
|
|
58296
58401
|
});
|
|
58297
|
-
process.env.NODE_ENV !== "production" && (
|
|
58298
|
-
function
|
|
58299
|
-
return y.useContext(
|
|
58402
|
+
process.env.NODE_ENV !== "production" && (wH.displayName = "FormContext");
|
|
58403
|
+
function TH() {
|
|
58404
|
+
return y.useContext(wH);
|
|
58300
58405
|
}
|
|
58301
58406
|
//#endregion
|
|
58302
58407
|
//#region ../../node_modules/@base-ui/react/internals/areArraysEqual.mjs
|
|
58303
|
-
function
|
|
58408
|
+
function EH(e, t, n = (e, t) => e === t) {
|
|
58304
58409
|
return e.length === t.length && e.every((e, r) => n(e, t[r]));
|
|
58305
58410
|
}
|
|
58306
58411
|
//#endregion
|
|
58307
58412
|
//#region ../../node_modules/@base-ui/react/select/root/SelectRoot.mjs
|
|
58308
|
-
function
|
|
58309
|
-
let { id: t, value: n, defaultValue: r = null, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, name: c, form: l, autoComplete: u, disabled: d = !1, readOnly: f = !1, required: p = !1, modal: m = !0, actionsRef: h, inputRef: g, onOpenChangeComplete: _, items: v, multiple: b = !1, itemToStringLabel: x, itemToStringValue: S, isItemEqualToValue: C =
|
|
58413
|
+
function DH(e) {
|
|
58414
|
+
let { id: t, value: n, defaultValue: r = null, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, name: c, form: l, autoComplete: u, disabled: d = !1, readOnly: f = !1, required: p = !1, modal: m = !0, actionsRef: h, inputRef: g, onOpenChangeComplete: _, items: v, multiple: b = !1, itemToStringLabel: x, itemToStringValue: S, isItemEqualToValue: C = fH, highlightItemOnHover: w = !0, children: T } = e, { clearErrors: E } = TH(), { setDirty: D, setTouched: O, setFocused: k, validityData: A, setFilled: j, name: M, disabled: N, validation: P, validationMode: F } = sH(), I = dH({ id: t }), L = N || d, R = M ?? c, [z, ee] = L_({
|
|
58310
58415
|
controlled: n,
|
|
58311
58416
|
default: b ? r ?? ha : r,
|
|
58312
58417
|
name: "Select",
|
|
@@ -58346,17 +58451,17 @@ function bH(e) {
|
|
|
58346
58451
|
scrollUpArrowVisible: !1,
|
|
58347
58452
|
scrollDownArrowVisible: !1,
|
|
58348
58453
|
hasScrollArrows: !1
|
|
58349
|
-
})).current, ve = X(_e, $.activeIndex), ye = X(_e, $.selectedIndex), be = X(_e, $.triggerElement), xe = X(_e, $.positionerElement), Se = kg(W), Ce = W ?? Se ?? null, we = y.useMemo(() => b ? "" :
|
|
58454
|
+
})).current, ve = X(_e, $.activeIndex), ye = X(_e, $.selectedIndex), be = X(_e, $.triggerElement), xe = X(_e, $.positionerElement), Se = kg(W), Ce = W ?? Se ?? null, we = y.useMemo(() => b ? "" : xH(z, S), [
|
|
58350
58455
|
b,
|
|
58351
58456
|
z,
|
|
58352
58457
|
S
|
|
58353
|
-
]), Te = y.useMemo(() => b && Array.isArray(z) ? z.map((e) =>
|
|
58458
|
+
]), Te = y.useMemo(() => b && Array.isArray(z) ? z.map((e) => xH(e, S)) : xH(z, S), [
|
|
58354
58459
|
b,
|
|
58355
58460
|
z,
|
|
58356
58461
|
S
|
|
58357
58462
|
]);
|
|
58358
|
-
|
|
58359
|
-
let Ee = y.useRef(z), De = b ? Array.isArray(z) && z.length > 0 : z != null &&
|
|
58463
|
+
cH(Do(_e.state.triggerElement), I, z, J(() => Te), !L, c);
|
|
58464
|
+
let Ee = y.useRef(z), De = b ? Array.isArray(z) && z.length > 0 : z != null && xH(z, S) !== "";
|
|
58360
58465
|
K(() => {
|
|
58361
58466
|
z !== Ee.current && _e.set("forceMount", !0);
|
|
58362
58467
|
}, [_e, z]), K(() => {
|
|
@@ -58367,11 +58472,11 @@ function bH(e) {
|
|
|
58367
58472
|
let n = Array.isArray(z) ? z : [];
|
|
58368
58473
|
if (n.length === 0) t = null;
|
|
58369
58474
|
else {
|
|
58370
|
-
let r = n[n.length - 1], i =
|
|
58475
|
+
let r = n[n.length - 1], i = hH(e, r, C);
|
|
58371
58476
|
t = i === -1 ? null : i;
|
|
58372
58477
|
}
|
|
58373
58478
|
} else {
|
|
58374
|
-
let n =
|
|
58479
|
+
let n = hH(e, z, C);
|
|
58375
58480
|
t = n === -1 ? null : n;
|
|
58376
58481
|
}
|
|
58377
58482
|
t === null && (de.current = null), !te && _e.set("selectedIndex", t);
|
|
@@ -58387,7 +58492,7 @@ function bH(e) {
|
|
|
58387
58492
|
]);
|
|
58388
58493
|
function Oe(e) {
|
|
58389
58494
|
let t = A.initialValue;
|
|
58390
|
-
return Array.isArray(e) && Array.isArray(t) ? !
|
|
58495
|
+
return Array.isArray(e) && Array.isArray(t) ? !EH(e, t, (e, t) => pH(e, t, C)) : e !== t;
|
|
58391
58496
|
}
|
|
58392
58497
|
Zp(z, () => {
|
|
58393
58498
|
E(R), D(Oe(z)), P.change(z);
|
|
@@ -58413,7 +58518,7 @@ function bH(e) {
|
|
|
58413
58518
|
}), Me = J(() => {
|
|
58414
58519
|
let e = _e.state.listElement || B.current;
|
|
58415
58520
|
if (!e) return;
|
|
58416
|
-
let t =
|
|
58521
|
+
let t = PV(e.scrollHeight, e.clientHeight), n = FV(e.scrollTop, t), r = n > 0, i = n < t;
|
|
58417
58522
|
_e.state.scrollUpArrowVisible !== r && _e.set("scrollUpArrowVisible", r), _e.state.scrollDownArrowVisible !== i && _e.set("scrollDownArrowVisible", i);
|
|
58418
58523
|
}), Ne = wf({
|
|
58419
58524
|
open: te,
|
|
@@ -58543,7 +58648,7 @@ function bH(e) {
|
|
|
58543
58648
|
_,
|
|
58544
58649
|
Me
|
|
58545
58650
|
]), He = xo(g, P.inputRef), Ue = b && Array.isArray(z) && z.length > 0, We = b ? void 0 : R, Ge = y.useMemo(() => !b || !Array.isArray(z) || !R ? null : z.map((e) => {
|
|
58546
|
-
let t =
|
|
58651
|
+
let t = xH(e, S);
|
|
58547
58652
|
return /* @__PURE__ */ V("input", {
|
|
58548
58653
|
type: "hidden",
|
|
58549
58654
|
form: l,
|
|
@@ -58559,9 +58664,9 @@ function bH(e) {
|
|
|
58559
58664
|
S,
|
|
58560
58665
|
L
|
|
58561
58666
|
]);
|
|
58562
|
-
return /* @__PURE__ */ V(
|
|
58667
|
+
return /* @__PURE__ */ V(XV.Provider, {
|
|
58563
58668
|
value: Ve,
|
|
58564
|
-
children: /* @__PURE__ */ H(
|
|
58669
|
+
children: /* @__PURE__ */ H(ZV.Provider, {
|
|
58565
58670
|
value: Ne,
|
|
58566
58671
|
children: [
|
|
58567
58672
|
T,
|
|
@@ -58575,7 +58680,7 @@ function bH(e) {
|
|
|
58575
58680
|
let t = e.currentTarget.value, n = ho($a, e.nativeEvent);
|
|
58576
58681
|
function r() {
|
|
58577
58682
|
if (b) return;
|
|
58578
|
-
let e = t.toLowerCase(), r = ce.current.findIndex((t) =>
|
|
58683
|
+
let e = t.toLowerCase(), r = ce.current.findIndex((t) => xH(t, S).toLowerCase() === e || bH(t, x).toLowerCase() === e);
|
|
58579
58684
|
r === -1 && (r = ce.current.findIndex((t, n) => {
|
|
58580
58685
|
let r = ie.current[n];
|
|
58581
58686
|
return r != null && r.toLowerCase() === e;
|
|
@@ -58607,7 +58712,7 @@ function bH(e) {
|
|
|
58607
58712
|
}
|
|
58608
58713
|
//#endregion
|
|
58609
58714
|
//#region ../../node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs
|
|
58610
|
-
function
|
|
58715
|
+
function OH(e, t) {
|
|
58611
58716
|
let n = kp(e);
|
|
58612
58717
|
return K(() => (t(n), () => {
|
|
58613
58718
|
t(void 0);
|
|
@@ -58615,8 +58720,8 @@ function xH(e, t) {
|
|
|
58615
58720
|
}
|
|
58616
58721
|
//#endregion
|
|
58617
58722
|
//#region ../../node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs
|
|
58618
|
-
function
|
|
58619
|
-
let { id: t, fallbackControlId: n, native: r = !1, setLabelId: i, focusControl: a } = e, { controlId: o, setLabelId: s } =
|
|
58723
|
+
function kH(e = {}) {
|
|
58724
|
+
let { id: t, fallbackControlId: n, native: r = !1, setLabelId: i, focusControl: a } = e, { controlId: o, setLabelId: s } = uH(), c = OH(t, J((e) => {
|
|
58620
58725
|
s(e), i?.(e);
|
|
58621
58726
|
})), l = o ?? n;
|
|
58622
58727
|
function u(e) {
|
|
@@ -58626,7 +58731,7 @@ function SH(e = {}) {
|
|
|
58626
58731
|
}
|
|
58627
58732
|
if (!l) return;
|
|
58628
58733
|
let t = ta(e.currentTarget).getElementById(l);
|
|
58629
|
-
xi(t) &&
|
|
58734
|
+
xi(t) && AH(t);
|
|
58630
58735
|
}
|
|
58631
58736
|
function d(e) {
|
|
58632
58737
|
za(e.nativeEvent)?.closest("button,input,select,textarea") || (!e.defaultPrevented && e.detail > 1 && e.preventDefault(), !r && u(e));
|
|
@@ -58643,24 +58748,24 @@ function SH(e = {}) {
|
|
|
58643
58748
|
}
|
|
58644
58749
|
};
|
|
58645
58750
|
}
|
|
58646
|
-
function
|
|
58751
|
+
function AH(e) {
|
|
58647
58752
|
e.focus({ focusVisible: !0 });
|
|
58648
58753
|
}
|
|
58649
58754
|
//#endregion
|
|
58650
58755
|
//#region ../../node_modules/@base-ui/react/utils/resolveAriaLabelledBy.mjs
|
|
58651
|
-
function
|
|
58756
|
+
function jH(e) {
|
|
58652
58757
|
return e == null ? void 0 : `${e}-label`;
|
|
58653
58758
|
}
|
|
58654
|
-
function
|
|
58759
|
+
function MH(e, t) {
|
|
58655
58760
|
return e ?? t;
|
|
58656
58761
|
}
|
|
58657
58762
|
//#endregion
|
|
58658
58763
|
//#region ../../node_modules/@base-ui/react/select/label/SelectLabel.mjs
|
|
58659
|
-
var
|
|
58764
|
+
var NH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58660
58765
|
let { render: n, className: r, style: i, ...a } = e, o = a;
|
|
58661
58766
|
delete o.id;
|
|
58662
|
-
let s =
|
|
58663
|
-
id:
|
|
58767
|
+
let s = sH(), { store: c } = QV(), l = X(c, $.triggerElement), u = X(c, $.id), d = kH({
|
|
58768
|
+
id: jH(u),
|
|
58664
58769
|
fallbackControlId: l?.id ?? u,
|
|
58665
58770
|
setLabelId(e) {
|
|
58666
58771
|
c.set("labelId", e);
|
|
@@ -58670,20 +58775,20 @@ var EH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
58670
58775
|
ref: t,
|
|
58671
58776
|
state: s.state,
|
|
58672
58777
|
props: [d, a],
|
|
58673
|
-
stateAttributesMapping:
|
|
58778
|
+
stateAttributesMapping: iH
|
|
58674
58779
|
});
|
|
58675
58780
|
});
|
|
58676
|
-
process.env.NODE_ENV !== "production" && (
|
|
58781
|
+
process.env.NODE_ENV !== "production" && (NH.displayName = "SelectLabel");
|
|
58677
58782
|
//#endregion
|
|
58678
58783
|
//#region ../../node_modules/@base-ui/react/select/trigger/SelectTrigger.mjs
|
|
58679
|
-
var
|
|
58784
|
+
var PH = 2, FH = 400, IH = {
|
|
58680
58785
|
...gp,
|
|
58681
|
-
...
|
|
58786
|
+
...iH,
|
|
58682
58787
|
popupSide: (e) => e ? { "data-popup-side": e } : null,
|
|
58683
58788
|
value: () => null
|
|
58684
|
-
},
|
|
58685
|
-
let { render: n, className: r, id: i, disabled: a = !1, nativeButton: o = !0, style: s, ...c } = e, { setTouched: l, setFocused: u, validationMode: d, state: f, disabled: p } =
|
|
58686
|
-
|
|
58789
|
+
}, LH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58790
|
+
let { render: n, className: r, id: i, disabled: a = !1, nativeButton: o = !0, style: s, ...c } = e, { setTouched: l, setFocused: u, validationMode: d, state: f, disabled: p } = sH(), { labelId: m } = uH(), { store: h, setOpen: g, selectionRef: _, validation: v, readOnly: b, required: x, alignItemWithTriggerActiveRef: S, disabled: C } = QV(), w = p || C || a, T = X(h, $.open), E = X(h, $.mounted), D = X(h, $.value), O = X(h, $.triggerProps), k = X(h, $.positionerElement), A = X(h, $.listElement), j = X(h, $.popupSide), M = X(h, $.id), N = X(h, $.labelId), P = X(h, $.hasSelectedValue), F = E && k ? j : null, I = i ?? M, L = MH(m, N);
|
|
58791
|
+
dH({ id: I });
|
|
58687
58792
|
let R = Do(k), z = y.useRef(null), { getButtonProps: ee, buttonRef: te } = Tp({
|
|
58688
58793
|
disabled: w,
|
|
58689
58794
|
native: o
|
|
@@ -58691,7 +58796,7 @@ var DH = 2, OH = 400, kH = {
|
|
|
58691
58796
|
h.set("triggerElement", e);
|
|
58692
58797
|
}), re = ca(), ie = ca(), B = ca();
|
|
58693
58798
|
y.useEffect(() => {
|
|
58694
|
-
if (T) return B.start(
|
|
58799
|
+
if (T) return B.start(FH, () => {
|
|
58695
58800
|
_.current.allowUnselectedMouseUp = !0, _.current.allowSelectedMouseUp = !0;
|
|
58696
58801
|
}), () => {
|
|
58697
58802
|
B.clear();
|
|
@@ -58733,7 +58838,7 @@ var DH = 2, OH = 400, kH = {
|
|
|
58733
58838
|
let t = e.target;
|
|
58734
58839
|
if (q(z.current, t) || q(R.current, t)) return;
|
|
58735
58840
|
let n = Nv(z.current);
|
|
58736
|
-
e.clientX >= n.left -
|
|
58841
|
+
e.clientX >= n.left - PH && e.clientX <= n.right + PH && e.clientY >= n.top - PH && e.clientY <= n.bottom + PH || g(!1, ho(lo, e));
|
|
58737
58842
|
}
|
|
58738
58843
|
ie.start(0, () => {
|
|
58739
58844
|
t.addEventListener("mouseup", n, { once: !0 });
|
|
@@ -58758,30 +58863,30 @@ var DH = 2, OH = 400, kH = {
|
|
|
58758
58863
|
ne
|
|
58759
58864
|
],
|
|
58760
58865
|
state: se,
|
|
58761
|
-
stateAttributesMapping:
|
|
58866
|
+
stateAttributesMapping: IH,
|
|
58762
58867
|
props: oe
|
|
58763
58868
|
});
|
|
58764
58869
|
});
|
|
58765
|
-
process.env.NODE_ENV !== "production" && (
|
|
58870
|
+
process.env.NODE_ENV !== "production" && (LH.displayName = "SelectTrigger");
|
|
58766
58871
|
//#endregion
|
|
58767
58872
|
//#region ../../node_modules/@base-ui/react/select/value/SelectValue.mjs
|
|
58768
|
-
var
|
|
58769
|
-
let { className: n, render: r, children: i, placeholder: a, style: o, ...s } = e, { store: c, valueRef: l } =
|
|
58873
|
+
var RH = { value: () => null }, zH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58874
|
+
let { className: n, render: r, children: i, placeholder: a, style: o, ...s } = e, { store: c, valueRef: l } = QV(), u = X(c, $.value), d = X(c, $.items), f = X(c, $.itemToStringLabel), p = X(c, $.hasSelectedValue), m = !p && a != null && i == null, h = X(c, $.hasNullItemLabel, m), g = {
|
|
58770
58875
|
value: u,
|
|
58771
58876
|
placeholder: !p
|
|
58772
58877
|
}, _ = null;
|
|
58773
|
-
return _ = typeof i == "function" ? i(u) : i ?? (!p && a != null && !h ? a : Array.isArray(u) ?
|
|
58878
|
+
return _ = typeof i == "function" ? i(u) : i ?? (!p && a != null && !h ? a : Array.isArray(u) ? CH(u, d, f) : SH(u, d, f)), Lc("span", e, {
|
|
58774
58879
|
state: g,
|
|
58775
58880
|
ref: [t, l],
|
|
58776
58881
|
props: [{ children: _ }, s],
|
|
58777
|
-
stateAttributesMapping:
|
|
58882
|
+
stateAttributesMapping: RH
|
|
58778
58883
|
});
|
|
58779
58884
|
});
|
|
58780
|
-
process.env.NODE_ENV !== "production" && (
|
|
58885
|
+
process.env.NODE_ENV !== "production" && (zH.displayName = "SelectValue");
|
|
58781
58886
|
//#endregion
|
|
58782
58887
|
//#region ../../node_modules/@base-ui/react/select/icon/SelectIcon.mjs
|
|
58783
|
-
var
|
|
58784
|
-
let { render: n, className: r, style: i, ...a } = e, { store: o } =
|
|
58888
|
+
var BH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58889
|
+
let { render: n, className: r, style: i, ...a } = e, { store: o } = QV();
|
|
58785
58890
|
return Lc("span", e, {
|
|
58786
58891
|
state: { open: X(o, $.open) },
|
|
58787
58892
|
ref: t,
|
|
@@ -58792,16 +58897,16 @@ var NH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
58792
58897
|
stateAttributesMapping: hp
|
|
58793
58898
|
});
|
|
58794
58899
|
});
|
|
58795
|
-
process.env.NODE_ENV !== "production" && (
|
|
58900
|
+
process.env.NODE_ENV !== "production" && (BH.displayName = "SelectIcon");
|
|
58796
58901
|
//#endregion
|
|
58797
58902
|
//#region ../../node_modules/@base-ui/react/select/portal/SelectPortalContext.mjs
|
|
58798
|
-
var
|
|
58799
|
-
process.env.NODE_ENV !== "production" && (
|
|
58903
|
+
var VH = /* @__PURE__ */ y.createContext(void 0);
|
|
58904
|
+
process.env.NODE_ENV !== "production" && (VH.displayName = "SelectPortalContext");
|
|
58800
58905
|
//#endregion
|
|
58801
58906
|
//#region ../../node_modules/@base-ui/react/select/portal/SelectPortal.mjs
|
|
58802
|
-
var
|
|
58803
|
-
let { store: n } =
|
|
58804
|
-
return r || i ? /* @__PURE__ */ V(
|
|
58907
|
+
var HH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58908
|
+
let { store: n } = QV(), r = X(n, $.mounted), i = X(n, $.forceMount);
|
|
58909
|
+
return r || i ? /* @__PURE__ */ V(VH.Provider, {
|
|
58805
58910
|
value: !0,
|
|
58806
58911
|
children: /* @__PURE__ */ V(tl, {
|
|
58807
58912
|
ref: t,
|
|
@@ -58809,14 +58914,14 @@ var FH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
58809
58914
|
})
|
|
58810
58915
|
}) : null;
|
|
58811
58916
|
});
|
|
58812
|
-
process.env.NODE_ENV !== "production" && (
|
|
58917
|
+
process.env.NODE_ENV !== "production" && (HH.displayName = "SelectPortal");
|
|
58813
58918
|
//#endregion
|
|
58814
58919
|
//#region ../../node_modules/@base-ui/react/select/backdrop/SelectBackdrop.mjs
|
|
58815
|
-
var
|
|
58920
|
+
var UH = {
|
|
58816
58921
|
..._p,
|
|
58817
58922
|
...Zd
|
|
58818
|
-
},
|
|
58819
|
-
let { render: n, className: r, style: i, ...a } = e, { store: o } =
|
|
58923
|
+
}, WH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58924
|
+
let { render: n, className: r, style: i, ...a } = e, { store: o } = QV(), s = X(o, $.open), c = X(o, $.mounted);
|
|
58820
58925
|
return Lc("div", e, {
|
|
58821
58926
|
state: {
|
|
58822
58927
|
open: s,
|
|
@@ -58831,31 +58936,31 @@ var IH = {
|
|
|
58831
58936
|
WebkitUserSelect: "none"
|
|
58832
58937
|
}
|
|
58833
58938
|
}, a],
|
|
58834
|
-
stateAttributesMapping:
|
|
58939
|
+
stateAttributesMapping: UH
|
|
58835
58940
|
});
|
|
58836
58941
|
});
|
|
58837
|
-
process.env.NODE_ENV !== "production" && (
|
|
58942
|
+
process.env.NODE_ENV !== "production" && (WH.displayName = "SelectBackdrop");
|
|
58838
58943
|
//#endregion
|
|
58839
58944
|
//#region ../../node_modules/@base-ui/react/select/positioner/SelectPositionerContext.mjs
|
|
58840
|
-
var
|
|
58841
|
-
process.env.NODE_ENV !== "production" && (
|
|
58842
|
-
function
|
|
58843
|
-
let e = y.useContext(
|
|
58945
|
+
var GH = /* @__PURE__ */ y.createContext(void 0);
|
|
58946
|
+
process.env.NODE_ENV !== "production" && (GH.displayName = "SelectPositionerContext");
|
|
58947
|
+
function KH() {
|
|
58948
|
+
let e = y.useContext(GH);
|
|
58844
58949
|
if (!e) throw Error(process.env.NODE_ENV === "production" ? fc(59) : "Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.");
|
|
58845
58950
|
return e;
|
|
58846
58951
|
}
|
|
58847
58952
|
//#endregion
|
|
58848
58953
|
//#region ../../node_modules/@base-ui/react/select/popup/utils.mjs
|
|
58849
|
-
function
|
|
58954
|
+
function qH(e, t) {
|
|
58850
58955
|
e && Object.assign(e.style, t);
|
|
58851
58956
|
}
|
|
58852
|
-
var
|
|
58957
|
+
var JH = {
|
|
58853
58958
|
position: "relative",
|
|
58854
58959
|
maxHeight: "100%",
|
|
58855
58960
|
overflowX: "hidden",
|
|
58856
58961
|
overflowY: "auto"
|
|
58857
|
-
},
|
|
58858
|
-
let { anchor: n, positionMethod: r = "absolute", className: i, render: a, side: o = "bottom", align: s = "center", sideOffset: c = 0, alignOffset: l = 0, collisionBoundary: u = "clipping-ancestors", collisionPadding: d, arrowPadding: f = 5, sticky: p = !1, disableAnchorTracking: m, alignItemWithTrigger: h = !0, collisionAvoidance: g = Jc, style: _, ...v } = e, { store: b, listRef: x, labelsRef: S, alignItemWithTriggerActiveRef: C, selectedItemTextRef: w, valuesRef: T, initialValueRef: E, popupRef: D, setValue: O } =
|
|
58962
|
+
}, YH = { position: "fixed" }, XH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
58963
|
+
let { anchor: n, positionMethod: r = "absolute", className: i, render: a, side: o = "bottom", align: s = "center", sideOffset: c = 0, alignOffset: l = 0, collisionBoundary: u = "clipping-ancestors", collisionPadding: d, arrowPadding: f = 5, sticky: p = !1, disableAnchorTracking: m, alignItemWithTrigger: h = !0, collisionAvoidance: g = Jc, style: _, ...v } = e, { store: b, listRef: x, labelsRef: S, alignItemWithTriggerActiveRef: C, selectedItemTextRef: w, valuesRef: T, initialValueRef: E, popupRef: D, setValue: O } = QV(), k = $V(), A = X(b, $.open), j = X(b, $.mounted), M = X(b, $.modal), N = X(b, $.value), P = X(b, $.openMethod), F = X(b, $.positionerElement), I = X(b, $.triggerElement), L = X(b, $.isItemEqualToValue), R = X(b, $.transitionStatus), z = y.useRef(null), ee = y.useRef(null), [te, ne] = y.useState(h), re = j && te && P !== "touch";
|
|
58859
58964
|
!j && te !== h && ne(h), K(() => {
|
|
58860
58965
|
j || ($.scrollUpArrowVisible(b.state) && b.set("scrollUpArrowVisible", !1), $.scrollDownArrowVisible(b.state) && b.set("scrollDownArrowVisible", !1));
|
|
58861
58966
|
}, [b, j]), y.useImperativeHandle(C, () => re), gv((re || M) && A, P === "touch", F, I);
|
|
@@ -58875,7 +58980,7 @@ var VH = {
|
|
|
58875
58980
|
disableAnchorTracking: m ?? re,
|
|
58876
58981
|
collisionAvoidance: g,
|
|
58877
58982
|
keepMounted: !0
|
|
58878
|
-
}), B = re ? "none" : ie.side, ae = re ?
|
|
58983
|
+
}), B = re ? "none" : ie.side, ae = re ? YH : ie.positionerStyles, oe = {
|
|
58879
58984
|
open: A,
|
|
58880
58985
|
side: B,
|
|
58881
58986
|
align: ie.align,
|
|
@@ -58898,13 +59003,13 @@ var VH = {
|
|
|
58898
59003
|
let t = ce.current;
|
|
58899
59004
|
if (ce.current = e.size, e.size === t) return;
|
|
58900
59005
|
let n = ho($a);
|
|
58901
|
-
if (t !== 0 && !b.state.multiple && N !== null &&
|
|
58902
|
-
let e = E.current, t = e != null &&
|
|
59006
|
+
if (t !== 0 && !b.state.multiple && N !== null && hH(T.current, N, L) === -1) {
|
|
59007
|
+
let e = E.current, t = e != null && hH(T.current, e, L) !== -1 ? e : null;
|
|
58903
59008
|
O(t, n), t === null && (b.set("selectedIndex", null), w.current = null);
|
|
58904
59009
|
}
|
|
58905
59010
|
if (t !== 0 && b.state.multiple && Array.isArray(N)) {
|
|
58906
|
-
let e = (e) =>
|
|
58907
|
-
(t.length !== N.length || t.some((e) => !
|
|
59011
|
+
let e = (e) => hH(T.current, e, L) !== -1, t = N.filter((t) => e(t));
|
|
59012
|
+
(t.length !== N.length || t.some((e) => !mH(N, e, L))) && (O(t, n), t.length === 0 && (b.set("selectedIndex", null), w.current = null));
|
|
58908
59013
|
}
|
|
58909
59014
|
if (A && re) {
|
|
58910
59015
|
b.update({
|
|
@@ -58912,7 +59017,7 @@ var VH = {
|
|
|
58912
59017
|
scrollDownArrowVisible: !1
|
|
58913
59018
|
});
|
|
58914
59019
|
let e = { height: "" };
|
|
58915
|
-
|
|
59020
|
+
qH(F, e), qH(D.current, e);
|
|
58916
59021
|
}
|
|
58917
59022
|
}), ue = y.useMemo(() => ({
|
|
58918
59023
|
...ie,
|
|
@@ -58931,7 +59036,7 @@ var VH = {
|
|
|
58931
59036
|
elementsRef: x,
|
|
58932
59037
|
labelsRef: S,
|
|
58933
59038
|
onMapChange: le,
|
|
58934
|
-
children: /* @__PURE__ */ H(
|
|
59039
|
+
children: /* @__PURE__ */ H(GH.Provider, {
|
|
58935
59040
|
value: ue,
|
|
58936
59041
|
children: [j && M && /* @__PURE__ */ V(qp, {
|
|
58937
59042
|
inert: Kp(!A),
|
|
@@ -58940,14 +59045,14 @@ var VH = {
|
|
|
58940
59045
|
})
|
|
58941
59046
|
});
|
|
58942
59047
|
});
|
|
58943
|
-
process.env.NODE_ENV !== "production" && (
|
|
59048
|
+
process.env.NODE_ENV !== "production" && (XH.displayName = "SelectPositioner");
|
|
58944
59049
|
//#endregion
|
|
58945
59050
|
//#region ../../node_modules/@base-ui/react/select/popup/SelectPopup.mjs
|
|
58946
|
-
var
|
|
59051
|
+
var ZH = {
|
|
58947
59052
|
..._p,
|
|
58948
59053
|
...Zd
|
|
58949
|
-
},
|
|
58950
|
-
let { render: n, className: r, style: i, finalFocus: a, ...o } = e, { store: s, popupRef: c, onOpenChangeComplete: l, setOpen: u, valueRef: d, firstItemTextRef: f, selectedItemTextRef: p, multiple: m, handleScrollArrowVisibility: h, scrollHandlerRef: g, listRef: _, highlightItemOnHover: v } =
|
|
59054
|
+
}, QH = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59055
|
+
let { render: n, className: r, style: i, finalFocus: a, ...o } = e, { store: s, popupRef: c, onOpenChangeComplete: l, setOpen: u, valueRef: d, firstItemTextRef: f, selectedItemTextRef: p, multiple: m, handleScrollArrowVisibility: h, scrollHandlerRef: g, listRef: _, highlightItemOnHover: v } = QV(), { side: b, align: x, alignItemWithTriggerActive: S, isPositioned: C, setControlledAlignItemWithTrigger: w } = KH(), T = av(!0) != null, E = $V(), D = ug(), { nonce: O, disableStyleElements: k } = CV(), A = X(s, $.id), j = X(s, $.open), M = X(s, $.openMethod), N = X(s, $.mounted), P = X(s, $.popupProps), F = X(s, $.transitionStatus), I = X(s, $.triggerElement), L = X(s, $.positionerElement), R = X(s, $.listElement), z = y.useRef(!1), ee = y.useRef(!1), te = y.useRef({}), ne = pa(), re = J((e) => {
|
|
58951
59056
|
if (!L || !c.current || !ee.current) return;
|
|
58952
59057
|
if (z.current || !S) {
|
|
58953
59058
|
h();
|
|
@@ -58958,10 +59063,10 @@ var WH = {
|
|
|
58958
59063
|
h();
|
|
58959
59064
|
return;
|
|
58960
59065
|
}
|
|
58961
|
-
let r =
|
|
59066
|
+
let r = tU(L), i = nU(L.getBoundingClientRect().height, "y", r), a = ta(L), o = _i(L), s = o.getComputedStyle(L), l = parseFloat(s.marginTop), u = parseFloat(s.marginBottom), d = $H(o.getComputedStyle(c.current)), f = Math.min(a.documentElement.clientHeight - l - u, d), p = e.scrollTop, m = eU(e), g = 0, _ = null, v = !1, y = !1, b = (e) => {
|
|
58962
59067
|
L.style.height = `${e}px`;
|
|
58963
59068
|
}, x = (t, n) => {
|
|
58964
|
-
let r =
|
|
59069
|
+
let r = MV(t, 0, f - i);
|
|
58965
59070
|
r > 0 && b(i + r), e.scrollTop = n, f - (i + r) <= 1 && (z.current = !0), h();
|
|
58966
59071
|
}, C = t ? m - p : p, w = Math.min(i + C, f);
|
|
58967
59072
|
if (g = w, C <= 1) {
|
|
@@ -58969,7 +59074,7 @@ var WH = {
|
|
|
58969
59074
|
return;
|
|
58970
59075
|
}
|
|
58971
59076
|
if (f - w > 1 ? t ? y = !0 : _ = 0 : (v = !0, n && p < m && (_ = p - (C - (i + C - f)))), g = Math.ceil(g), g !== 0 && b(g), y || _ != null) {
|
|
58972
|
-
let t =
|
|
59077
|
+
let t = eU(e), n = y ? t : MV(_, 0, t);
|
|
58973
59078
|
Math.abs(e.scrollTop - n) > 1 && (e.scrollTop = n);
|
|
58974
59079
|
}
|
|
58975
59080
|
(v || g >= f - 1) && (z.current = !0), h();
|
|
@@ -59000,7 +59105,7 @@ var WH = {
|
|
|
59000
59105
|
marginBottom: L.style.marginBottom
|
|
59001
59106
|
});
|
|
59002
59107
|
}, [c, L]), K(() => {
|
|
59003
|
-
j || S || (ee.current = !1, z.current = !1,
|
|
59108
|
+
j || S || (ee.current = !1, z.current = !1, qH(L, te.current));
|
|
59004
59109
|
}, [
|
|
59005
59110
|
j,
|
|
59006
59111
|
S,
|
|
@@ -59013,34 +59118,34 @@ var WH = {
|
|
|
59013
59118
|
ee.current = !0, ne.request(h), e.style.removeProperty("--transform-origin");
|
|
59014
59119
|
return;
|
|
59015
59120
|
}
|
|
59016
|
-
let t =
|
|
59121
|
+
let t = aU(e);
|
|
59017
59122
|
e.style.removeProperty("--transform-origin");
|
|
59018
59123
|
try {
|
|
59019
59124
|
let t = p.current;
|
|
59020
59125
|
t?.isConnected || (t = !$.hasSelectedValue(s.state) && f.current?.isConnected ? f.current : null);
|
|
59021
|
-
let n = d.current, r = _i(L), i = r.getComputedStyle(L), a = r.getComputedStyle(e), o = ta(I), c =
|
|
59126
|
+
let n = d.current, r = _i(L), i = r.getComputedStyle(L), a = r.getComputedStyle(e), o = ta(I), c = tU(I), l = rU(I.getBoundingClientRect(), c), u = rU(L.getBoundingClientRect(), c), m = l.height, g = R || e, y = g.scrollHeight, b = parseFloat(a.borderBottomWidth), x = parseFloat(i.marginTop) || 10, S = parseFloat(i.marginBottom) || 10, C = parseFloat(i.minHeight) || 100, T = $H(a), E = o.documentElement.clientHeight - x - S, O = o.documentElement.clientWidth, k = E - l.bottom + m, A, j = D === "rtl" ? l.right - u.width : l.left, M = 0;
|
|
59022
59127
|
if (t && n) {
|
|
59023
|
-
let e =
|
|
59024
|
-
A =
|
|
59128
|
+
let e = rU(n.getBoundingClientRect(), c);
|
|
59129
|
+
A = rU(t.getBoundingClientRect(), c), j = u.left + (D === "rtl" ? e.right - A.right : e.left - A.left);
|
|
59025
59130
|
let r = e.top - l.top + e.height / 2;
|
|
59026
59131
|
M = A.top - u.top + A.height / 2 - r;
|
|
59027
59132
|
}
|
|
59028
59133
|
let N = k + M + S + b, P = Math.min(E, N), F = E - x - S, ne = N - P, re = O - 5;
|
|
59029
|
-
L.style.left = `${
|
|
59030
|
-
let ie =
|
|
59134
|
+
L.style.left = `${MV(j, 5, re - u.width)}px`, L.style.height = `${P}px`, L.style.maxHeight = "none", L.style.marginTop = `${x}px`, L.style.marginBottom = `${S}px`, e.style.height = "100%";
|
|
59135
|
+
let ie = eU(g), B = ne >= ie - 1;
|
|
59031
59136
|
B && (P = Math.min(E, u.height) - (ne - ie));
|
|
59032
59137
|
let ae = l.top < 20 || l.bottom > E - 20 || Math.ceil(P) + 1 < Math.min(y, C), oe = (r.visualViewport?.scale ?? 1) !== 1 && Qi;
|
|
59033
59138
|
if (ae || oe) {
|
|
59034
|
-
ee.current = !0,
|
|
59139
|
+
ee.current = !0, qH(L, te.current), w(!1);
|
|
59035
59140
|
return;
|
|
59036
59141
|
}
|
|
59037
59142
|
let se = Math.max(C, P);
|
|
59038
59143
|
if (B) {
|
|
59039
59144
|
let e = Math.max(0, E - N);
|
|
59040
|
-
L.style.top = u.height >= F ? "0" : `${e}px`, L.style.height = `${P}px`, g.scrollTop =
|
|
59145
|
+
L.style.top = u.height >= F ? "0" : `${e}px`, L.style.height = `${P}px`, g.scrollTop = eU(g);
|
|
59041
59146
|
} else L.style.bottom = "0", g.scrollTop = ne;
|
|
59042
59147
|
if (A) {
|
|
59043
|
-
let t = u.top, n = u.height, r = A.top + A.height / 2, i =
|
|
59148
|
+
let t = u.top, n = u.height, r = A.top + A.height / 2, i = MV(n > 0 ? (r - t) / n * 100 : 50, 0, 100);
|
|
59044
59149
|
e.style.setProperty("--transform-origin", `50% ${i}%`);
|
|
59045
59150
|
}
|
|
59046
59151
|
(se === E || P >= T) && (z.current = !0), h(), v && s.state.selectedIndex === null && s.state.activeIndex === null && _.current[0] != null && s.set("activeIndex", 0), ee.current = !0;
|
|
@@ -59093,20 +59198,20 @@ var WH = {
|
|
|
59093
59198
|
onScroll(e) {
|
|
59094
59199
|
R || re(e.currentTarget);
|
|
59095
59200
|
},
|
|
59096
|
-
...S && { style: R ? { height: "100%" } :
|
|
59201
|
+
...S && { style: R ? { height: "100%" } : JH }
|
|
59097
59202
|
}, ae = Lc("div", e, {
|
|
59098
59203
|
ref: [t, c],
|
|
59099
59204
|
state: ie,
|
|
59100
|
-
stateAttributesMapping:
|
|
59205
|
+
stateAttributesMapping: ZH,
|
|
59101
59206
|
props: [
|
|
59102
59207
|
P,
|
|
59103
59208
|
B,
|
|
59104
59209
|
xg(F),
|
|
59105
|
-
{ className: !R && S ?
|
|
59210
|
+
{ className: !R && S ? vV.className : void 0 },
|
|
59106
59211
|
o
|
|
59107
59212
|
]
|
|
59108
59213
|
});
|
|
59109
|
-
return /* @__PURE__ */ H(y.Fragment, { children: [!k &&
|
|
59214
|
+
return /* @__PURE__ */ H(y.Fragment, { children: [!k && vV.getElement(O), /* @__PURE__ */ V(bl, {
|
|
59110
59215
|
context: E,
|
|
59111
59216
|
modal: !1,
|
|
59112
59217
|
disabled: !N,
|
|
@@ -59116,38 +59221,38 @@ var WH = {
|
|
|
59116
59221
|
children: ae
|
|
59117
59222
|
})] });
|
|
59118
59223
|
});
|
|
59119
|
-
process.env.NODE_ENV !== "production" && (
|
|
59120
|
-
function
|
|
59224
|
+
process.env.NODE_ENV !== "production" && (QH.displayName = "SelectPopup");
|
|
59225
|
+
function $H(e) {
|
|
59121
59226
|
let t = e.maxHeight || "";
|
|
59122
59227
|
return t.endsWith("px") && parseFloat(t) || Infinity;
|
|
59123
59228
|
}
|
|
59124
|
-
function
|
|
59125
|
-
return
|
|
59229
|
+
function eU(e) {
|
|
59230
|
+
return PV(e.scrollHeight, e.clientHeight);
|
|
59126
59231
|
}
|
|
59127
|
-
function
|
|
59232
|
+
function tU(e) {
|
|
59128
59233
|
return mu.getScale(e);
|
|
59129
59234
|
}
|
|
59130
|
-
function
|
|
59235
|
+
function nU(e, t, n) {
|
|
59131
59236
|
return e / n[t];
|
|
59132
59237
|
}
|
|
59133
|
-
function
|
|
59238
|
+
function rU(e, t) {
|
|
59134
59239
|
return ds({
|
|
59135
|
-
x:
|
|
59136
|
-
y:
|
|
59137
|
-
width:
|
|
59138
|
-
height:
|
|
59240
|
+
x: nU(e.x, "x", t),
|
|
59241
|
+
y: nU(e.y, "y", t),
|
|
59242
|
+
width: nU(e.width, "x", t),
|
|
59243
|
+
height: nU(e.height, "y", t)
|
|
59139
59244
|
});
|
|
59140
59245
|
}
|
|
59141
|
-
var
|
|
59246
|
+
var iU = [
|
|
59142
59247
|
["transform", "none"],
|
|
59143
59248
|
["scale", "1"],
|
|
59144
59249
|
["translate", "0 0"]
|
|
59145
59250
|
];
|
|
59146
|
-
function
|
|
59251
|
+
function aU(e) {
|
|
59147
59252
|
let { style: t } = e, n = {};
|
|
59148
|
-
for (let [e, r] of
|
|
59253
|
+
for (let [e, r] of iU) n[e] = t.getPropertyValue(e), t.setProperty(e, r, "important");
|
|
59149
59254
|
return () => {
|
|
59150
|
-
for (let [e] of
|
|
59255
|
+
for (let [e] of iU) {
|
|
59151
59256
|
let r = n[e];
|
|
59152
59257
|
r ? t.setProperty(e, r) : t.removeProperty(e);
|
|
59153
59258
|
}
|
|
@@ -59155,16 +59260,16 @@ function QH(e) {
|
|
|
59155
59260
|
}
|
|
59156
59261
|
//#endregion
|
|
59157
59262
|
//#region ../../node_modules/@base-ui/react/select/list/SelectList.mjs
|
|
59158
|
-
var
|
|
59159
|
-
let { render: n, className: r, style: i, ...a } = e, { store: o, scrollHandlerRef: s } =
|
|
59263
|
+
var oU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59264
|
+
let { render: n, className: r, style: i, ...a } = e, { store: o, scrollHandlerRef: s } = QV(), { alignItemWithTriggerActive: c } = KH(), l = X(o, $.hasScrollArrows), u = X(o, $.openMethod), d = X(o, $.multiple), f = {
|
|
59160
59265
|
id: `${X(o, $.id)}-list`,
|
|
59161
59266
|
role: "listbox",
|
|
59162
59267
|
"aria-multiselectable": d || void 0,
|
|
59163
59268
|
onScroll(e) {
|
|
59164
59269
|
s.current?.(e.currentTarget);
|
|
59165
59270
|
},
|
|
59166
|
-
...c && { style:
|
|
59167
|
-
className: l && u !== "touch" ?
|
|
59271
|
+
...c && { style: JH },
|
|
59272
|
+
className: l && u !== "touch" ? vV.className : void 0
|
|
59168
59273
|
};
|
|
59169
59274
|
return Lc("div", e, {
|
|
59170
59275
|
ref: [t, J((e) => {
|
|
@@ -59173,24 +59278,24 @@ var $H = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59173
59278
|
props: [f, a]
|
|
59174
59279
|
});
|
|
59175
59280
|
});
|
|
59176
|
-
process.env.NODE_ENV !== "production" && (
|
|
59281
|
+
process.env.NODE_ENV !== "production" && (oU.displayName = "SelectList");
|
|
59177
59282
|
//#endregion
|
|
59178
59283
|
//#region ../../node_modules/@base-ui/react/select/item/SelectItemContext.mjs
|
|
59179
|
-
var
|
|
59180
|
-
process.env.NODE_ENV !== "production" && (
|
|
59181
|
-
function
|
|
59182
|
-
let e = y.useContext(
|
|
59284
|
+
var sU = /* @__PURE__ */ y.createContext(void 0);
|
|
59285
|
+
process.env.NODE_ENV !== "production" && (sU.displayName = "SelectItemContext");
|
|
59286
|
+
function cU() {
|
|
59287
|
+
let e = y.useContext(sU);
|
|
59183
59288
|
if (!e) throw Error(process.env.NODE_ENV === "production" ? fc(57) : "Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.");
|
|
59184
59289
|
return e;
|
|
59185
59290
|
}
|
|
59186
59291
|
//#endregion
|
|
59187
59292
|
//#region ../../node_modules/@base-ui/react/select/item/SelectItem.mjs
|
|
59188
|
-
var
|
|
59293
|
+
var lU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59189
59294
|
let { render: n, className: r, style: i, value: a = null, label: o, disabled: s = !1, nativeButton: c = !1, ...l } = e, u = y.useRef(null), d = q_({
|
|
59190
59295
|
label: o,
|
|
59191
59296
|
textRef: u,
|
|
59192
59297
|
indexGuessBehavior: K_.GuessFromOrder
|
|
59193
|
-
}), { store: f, itemProps: p, setOpen: m, setValue: h, selectionRef: g, typingRef: _, valuesRef: v, multiple: b, selectedItemTextRef: x, disabled: S, readOnly: C } =
|
|
59298
|
+
}), { store: f, itemProps: p, setOpen: m, setValue: h, selectionRef: g, typingRef: _, valuesRef: v, multiple: b, selectedItemTextRef: x, disabled: S, readOnly: C } = QV(), w = X(f, $.isActive, d.index), T = X(f, $.open), E = X(f, $.isSelected, a), D = X(f, $.isSelectedByFocus, d.index), O = X(f, $.isItemEqualToValue), k = d.index, A = k !== -1, j = y.useRef(null);
|
|
59194
59299
|
K(() => {
|
|
59195
59300
|
if (!A) return;
|
|
59196
59301
|
let e = v.current;
|
|
@@ -59205,7 +59310,7 @@ var nU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59205
59310
|
]), K(() => {
|
|
59206
59311
|
if (!A) return;
|
|
59207
59312
|
let e = f.state.value, t = e;
|
|
59208
|
-
b && Array.isArray(e) && (t = e.length > 0 ? e[e.length - 1] : void 0), t !== void 0 &&
|
|
59313
|
+
b && Array.isArray(e) && (t = e.length > 0 ? e[e.length - 1] : void 0), t !== void 0 && pH(a, t, O) && (f.set("selectedIndex", k), u.current && (x.current = u.current));
|
|
59209
59314
|
}, [
|
|
59210
59315
|
A,
|
|
59211
59316
|
k,
|
|
@@ -59230,7 +59335,7 @@ var nU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59230
59335
|
let t = f.state.value;
|
|
59231
59336
|
if (b) {
|
|
59232
59337
|
let n = Array.isArray(t) ? t : [];
|
|
59233
|
-
h(E ?
|
|
59338
|
+
h(E ? gH(n, a, O) : [...n, a], ho(io, e));
|
|
59234
59339
|
} else h(a, ho(io, e)), m(!1, ho(io, e));
|
|
59235
59340
|
}
|
|
59236
59341
|
function z() {
|
|
@@ -59291,24 +59396,24 @@ var nU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59291
59396
|
D,
|
|
59292
59397
|
A
|
|
59293
59398
|
]);
|
|
59294
|
-
return /* @__PURE__ */ V(
|
|
59399
|
+
return /* @__PURE__ */ V(sU.Provider, {
|
|
59295
59400
|
value: ne,
|
|
59296
59401
|
children: te
|
|
59297
59402
|
});
|
|
59298
59403
|
}));
|
|
59299
|
-
process.env.NODE_ENV !== "production" && (
|
|
59404
|
+
process.env.NODE_ENV !== "production" && (lU.displayName = "SelectItem");
|
|
59300
59405
|
//#endregion
|
|
59301
59406
|
//#region ../../node_modules/@base-ui/react/select/item-indicator/SelectItemIndicator.mjs
|
|
59302
|
-
var
|
|
59303
|
-
let n = e.keepMounted ?? !1, { selected: r } =
|
|
59304
|
-
return n || r ? /* @__PURE__ */ V(
|
|
59407
|
+
var uU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59408
|
+
let n = e.keepMounted ?? !1, { selected: r } = cU();
|
|
59409
|
+
return n || r ? /* @__PURE__ */ V(dU, {
|
|
59305
59410
|
...e,
|
|
59306
59411
|
ref: t
|
|
59307
59412
|
}) : null;
|
|
59308
59413
|
});
|
|
59309
|
-
process.env.NODE_ENV !== "production" && (
|
|
59310
|
-
var
|
|
59311
|
-
let { render: n, className: r, style: i, keepMounted: a, ...o } = e, { selected: s } =
|
|
59414
|
+
process.env.NODE_ENV !== "production" && (uU.displayName = "SelectItemIndicator");
|
|
59415
|
+
var dU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef((e, t) => {
|
|
59416
|
+
let { render: n, className: r, style: i, keepMounted: a, ...o } = e, { selected: s } = cU(), c = y.useRef(null), { transitionStatus: l, setMounted: u } = qd(s), d = Lc("span", e, {
|
|
59312
59417
|
ref: [t, c],
|
|
59313
59418
|
state: {
|
|
59314
59419
|
selected: s,
|
|
@@ -59328,11 +59433,11 @@ var iU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef((e, t) => {
|
|
|
59328
59433
|
}
|
|
59329
59434
|
}), d;
|
|
59330
59435
|
}));
|
|
59331
|
-
process.env.NODE_ENV !== "production" && (
|
|
59436
|
+
process.env.NODE_ENV !== "production" && (dU.displayName = "Inner");
|
|
59332
59437
|
//#endregion
|
|
59333
59438
|
//#region ../../node_modules/@base-ui/react/select/item-text/SelectItemText.mjs
|
|
59334
|
-
var
|
|
59335
|
-
let { index: n, textRef: r, selectedByFocus: i, hasRegistered: a } =
|
|
59439
|
+
var fU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59440
|
+
let { index: n, textRef: r, selectedByFocus: i, hasRegistered: a } = cU(), { firstItemTextRef: o, selectedItemTextRef: s } = QV(), { render: c, className: l, style: u, ...d } = e;
|
|
59336
59441
|
return Lc("div", e, {
|
|
59337
59442
|
ref: [
|
|
59338
59443
|
y.useCallback((e) => {
|
|
@@ -59350,14 +59455,14 @@ var aU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59350
59455
|
props: d
|
|
59351
59456
|
});
|
|
59352
59457
|
}));
|
|
59353
|
-
process.env.NODE_ENV !== "production" && (
|
|
59458
|
+
process.env.NODE_ENV !== "production" && (fU.displayName = "SelectItemText");
|
|
59354
59459
|
//#endregion
|
|
59355
59460
|
//#region ../../node_modules/@base-ui/react/select/arrow/SelectArrow.mjs
|
|
59356
|
-
var
|
|
59461
|
+
var pU = {
|
|
59357
59462
|
..._p,
|
|
59358
59463
|
...Zd
|
|
59359
|
-
},
|
|
59360
|
-
let { render: n, className: r, style: i, ...a } = e, { store: o } =
|
|
59464
|
+
}, mU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59465
|
+
let { render: n, className: r, style: i, ...a } = e, { store: o } = QV(), { side: s, align: c, arrowRef: l, arrowStyles: u, arrowUncentered: d, alignItemWithTriggerActive: f } = KH(), p = Lc("div", e, {
|
|
59361
59466
|
state: {
|
|
59362
59467
|
open: X(o, $.open),
|
|
59363
59468
|
side: s,
|
|
@@ -59369,15 +59474,15 @@ var oU = {
|
|
|
59369
59474
|
style: u,
|
|
59370
59475
|
"aria-hidden": !0
|
|
59371
59476
|
}, a],
|
|
59372
|
-
stateAttributesMapping:
|
|
59477
|
+
stateAttributesMapping: pU
|
|
59373
59478
|
});
|
|
59374
59479
|
return f ? null : p;
|
|
59375
59480
|
});
|
|
59376
|
-
process.env.NODE_ENV !== "production" && (
|
|
59481
|
+
process.env.NODE_ENV !== "production" && (mU.displayName = "SelectArrow");
|
|
59377
59482
|
//#endregion
|
|
59378
59483
|
//#region ../../node_modules/@base-ui/react/select/scroll-arrow/SelectScrollArrow.mjs
|
|
59379
|
-
var
|
|
59380
|
-
let { render: n, className: r, style: i, direction: a, keepMounted: o = !1, ...s } = e, c = a === "up", { store: l, popupRef: u, listRef: d, handleScrollArrowVisibility: f, scrollArrowsMountedCountRef: p } =
|
|
59484
|
+
var hU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59485
|
+
let { render: n, className: r, style: i, direction: a, keepMounted: o = !1, ...s } = e, c = a === "up", { store: l, popupRef: u, listRef: d, handleScrollArrowVisibility: f, scrollArrowsMountedCountRef: p } = QV(), { side: m, scrollDownArrowRef: h, scrollUpArrowRef: g } = KH(), _ = X(l, c ? $.scrollUpArrowVisible : $.scrollDownArrowVisible), v = X(l, $.openMethod), y = _ && v !== "touch", b = ca(), x = c ? g : h, { mounted: S, transitionStatus: C, setMounted: w } = qd(y);
|
|
59381
59486
|
K(() => (p.current += 1, l.state.hasScrollArrows || l.set("hasScrollArrows", !0), () => {
|
|
59382
59487
|
p.current = Math.max(0, p.current - 1), p.current === 0 && l.state.hasScrollArrows && l.set("hasScrollArrows", !1);
|
|
59383
59488
|
}), [l, p]), $d({
|
|
@@ -59406,14 +59511,14 @@ var cU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59406
59511
|
let e = l.state.listElement ?? u.current;
|
|
59407
59512
|
if (!e) return;
|
|
59408
59513
|
l.set("activeIndex", null), f();
|
|
59409
|
-
let n =
|
|
59514
|
+
let n = PV(e.scrollHeight, e.clientHeight), r = FV(e.scrollTop, n), i = r === (c ? 0 : n), a = d.current;
|
|
59410
59515
|
if (r !== e.scrollTop && (e.scrollTop = r), a.length === 0 && l.set(c ? "scrollUpArrowVisible" : "scrollDownArrowVisible", !i), i) {
|
|
59411
59516
|
b.clear();
|
|
59412
59517
|
return;
|
|
59413
59518
|
}
|
|
59414
59519
|
if (a.length > 0) {
|
|
59415
59520
|
let t = x.current?.offsetHeight || 0;
|
|
59416
|
-
e.scrollTop =
|
|
59521
|
+
e.scrollTop = gU(a, c, r, e.clientHeight, t, n);
|
|
59417
59522
|
}
|
|
59418
59523
|
b.start(40, t);
|
|
59419
59524
|
}
|
|
@@ -59427,8 +59532,8 @@ var cU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59427
59532
|
});
|
|
59428
59533
|
return S || o ? T : null;
|
|
59429
59534
|
});
|
|
59430
|
-
process.env.NODE_ENV !== "production" && (
|
|
59431
|
-
function
|
|
59535
|
+
process.env.NODE_ENV !== "production" && (hU.displayName = "SelectScrollArrow");
|
|
59536
|
+
function gU(e, t, n, r, i, a) {
|
|
59432
59537
|
if (t) {
|
|
59433
59538
|
let t = 0, r = n + i - 1;
|
|
59434
59539
|
for (let n = 0; n < e.length; n += 1) {
|
|
@@ -59439,7 +59544,7 @@ function lU(e, t, n, r, i, a) {
|
|
|
59439
59544
|
}
|
|
59440
59545
|
}
|
|
59441
59546
|
let o = Math.max(0, t - 1), s = e[o];
|
|
59442
|
-
return o < t && s ?
|
|
59547
|
+
return o < t && s ? FV(s.offsetTop - i, a) : 0;
|
|
59443
59548
|
}
|
|
59444
59549
|
let o = e.length - 1, s = n + r - i + 1;
|
|
59445
59550
|
for (let t = 0; t < e.length; t += 1) {
|
|
@@ -59450,40 +59555,40 @@ function lU(e, t, n, r, i, a) {
|
|
|
59450
59555
|
}
|
|
59451
59556
|
}
|
|
59452
59557
|
let c = Math.min(e.length - 1, o + 1), l = e[c];
|
|
59453
|
-
return c > o && l ?
|
|
59558
|
+
return c > o && l ? FV(l.offsetTop + l.offsetHeight - r + i, a) : a;
|
|
59454
59559
|
}
|
|
59455
59560
|
//#endregion
|
|
59456
59561
|
//#region ../../node_modules/@base-ui/react/select/scroll-down-arrow/SelectScrollDownArrow.mjs
|
|
59457
|
-
var
|
|
59458
|
-
return /* @__PURE__ */ V(
|
|
59562
|
+
var _U = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59563
|
+
return /* @__PURE__ */ V(hU, {
|
|
59459
59564
|
...e,
|
|
59460
59565
|
ref: t,
|
|
59461
59566
|
direction: "down"
|
|
59462
59567
|
});
|
|
59463
59568
|
});
|
|
59464
|
-
process.env.NODE_ENV !== "production" && (
|
|
59569
|
+
process.env.NODE_ENV !== "production" && (_U.displayName = "SelectScrollDownArrow");
|
|
59465
59570
|
//#endregion
|
|
59466
59571
|
//#region ../../node_modules/@base-ui/react/select/scroll-up-arrow/SelectScrollUpArrow.mjs
|
|
59467
|
-
var
|
|
59468
|
-
return /* @__PURE__ */ V(
|
|
59572
|
+
var vU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59573
|
+
return /* @__PURE__ */ V(hU, {
|
|
59469
59574
|
...e,
|
|
59470
59575
|
ref: t,
|
|
59471
59576
|
direction: "up"
|
|
59472
59577
|
});
|
|
59473
59578
|
});
|
|
59474
|
-
process.env.NODE_ENV !== "production" && (
|
|
59579
|
+
process.env.NODE_ENV !== "production" && (vU.displayName = "SelectScrollUpArrow");
|
|
59475
59580
|
//#endregion
|
|
59476
59581
|
//#region ../../node_modules/@base-ui/react/select/group/SelectGroupContext.mjs
|
|
59477
|
-
var
|
|
59478
|
-
process.env.NODE_ENV !== "production" && (
|
|
59479
|
-
function
|
|
59480
|
-
let e = y.useContext(
|
|
59582
|
+
var yU = /* @__PURE__ */ y.createContext(void 0);
|
|
59583
|
+
process.env.NODE_ENV !== "production" && (yU.displayName = "SelectGroupContext");
|
|
59584
|
+
function bU() {
|
|
59585
|
+
let e = y.useContext(yU);
|
|
59481
59586
|
if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? fc(56) : "Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.");
|
|
59482
59587
|
return e;
|
|
59483
59588
|
}
|
|
59484
59589
|
//#endregion
|
|
59485
59590
|
//#region ../../node_modules/@base-ui/react/select/group/SelectGroup.mjs
|
|
59486
|
-
var
|
|
59591
|
+
var xU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59487
59592
|
let { render: n, className: r, style: i, ...a } = e, [o, s] = y.useState(), c = y.useMemo(() => ({
|
|
59488
59593
|
labelId: o,
|
|
59489
59594
|
setLabelId: s
|
|
@@ -59494,16 +59599,16 @@ var mU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59494
59599
|
"aria-labelledby": o
|
|
59495
59600
|
}, a]
|
|
59496
59601
|
});
|
|
59497
|
-
return /* @__PURE__ */ V(
|
|
59602
|
+
return /* @__PURE__ */ V(yU.Provider, {
|
|
59498
59603
|
value: c,
|
|
59499
59604
|
children: l
|
|
59500
59605
|
});
|
|
59501
59606
|
});
|
|
59502
|
-
process.env.NODE_ENV !== "production" && (
|
|
59607
|
+
process.env.NODE_ENV !== "production" && (xU.displayName = "SelectGroup");
|
|
59503
59608
|
//#endregion
|
|
59504
59609
|
//#region ../../node_modules/@base-ui/react/select/group-label/SelectGroupLabel.mjs
|
|
59505
|
-
var
|
|
59506
|
-
let { render: n, className: r, style: i, id: a, ...o } = e, { setLabelId: s } =
|
|
59610
|
+
var SU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
59611
|
+
let { render: n, className: r, style: i, id: a, ...o } = e, { setLabelId: s } = bU(), c = kp(a);
|
|
59507
59612
|
return K(() => {
|
|
59508
59613
|
s(c);
|
|
59509
59614
|
}, [c, s]), Lc("div", e, {
|
|
@@ -59511,12 +59616,12 @@ var hU = /* @__PURE__ */ y.forwardRef(function(e, t) {
|
|
|
59511
59616
|
props: [{ id: c }, o]
|
|
59512
59617
|
});
|
|
59513
59618
|
});
|
|
59514
|
-
process.env.NODE_ENV !== "production" && (
|
|
59619
|
+
process.env.NODE_ENV !== "production" && (SU.displayName = "SelectGroupLabel");
|
|
59515
59620
|
//#endregion
|
|
59516
59621
|
//#region src/components/ui/select.tsx
|
|
59517
|
-
function
|
|
59518
|
-
return /* @__PURE__ */ V(
|
|
59519
|
-
items: t ??
|
|
59622
|
+
function CU({ children: e, items: t, onValueChange: n, ...r }) {
|
|
59623
|
+
return /* @__PURE__ */ V(DH, {
|
|
59624
|
+
items: t ?? jU(e),
|
|
59520
59625
|
onValueChange: (e) => {
|
|
59521
59626
|
e !== null && n?.(e);
|
|
59522
59627
|
},
|
|
@@ -59524,86 +59629,86 @@ function gU({ children: e, items: t, onValueChange: n, ...r }) {
|
|
|
59524
59629
|
children: e
|
|
59525
59630
|
});
|
|
59526
59631
|
}
|
|
59527
|
-
var
|
|
59632
|
+
var wU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(zH, {
|
|
59528
59633
|
ref: n,
|
|
59529
59634
|
className: U("flex flex-1 text-left", e),
|
|
59530
59635
|
...t
|
|
59531
59636
|
}));
|
|
59532
|
-
|
|
59533
|
-
var
|
|
59637
|
+
wU.displayName = "SelectValue";
|
|
59638
|
+
var TU = y.forwardRef(({ className: e, children: t, asChild: n = !1, ...r }, i) => /* @__PURE__ */ H(LH, {
|
|
59534
59639
|
ref: i,
|
|
59535
59640
|
render: lm(n, t),
|
|
59536
59641
|
className: U("flex cursor-pointer h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-disabled:cursor-not-allowed data-disabled:opacity-50 [&>span]:line-clamp-1", e),
|
|
59537
59642
|
...r,
|
|
59538
|
-
children: [t, /* @__PURE__ */ V(
|
|
59643
|
+
children: [t, /* @__PURE__ */ V(BH, { render: /* @__PURE__ */ V(dh, { className: "h-4 w-4 text-muted-foreground" }) })]
|
|
59539
59644
|
}));
|
|
59540
|
-
|
|
59541
|
-
var
|
|
59645
|
+
TU.displayName = "SelectTrigger";
|
|
59646
|
+
var EU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(vU, {
|
|
59542
59647
|
ref: n,
|
|
59543
59648
|
className: U("flex cursor-pointer items-center justify-center py-1", e),
|
|
59544
59649
|
...t,
|
|
59545
59650
|
children: /* @__PURE__ */ V(ph, { className: "h-4 w-4" })
|
|
59546
59651
|
}));
|
|
59547
|
-
|
|
59548
|
-
var
|
|
59652
|
+
EU.displayName = "SelectScrollUpButton";
|
|
59653
|
+
var DU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(_U, {
|
|
59549
59654
|
ref: n,
|
|
59550
59655
|
className: U("flex cursor-pointer items-center justify-center py-1", e),
|
|
59551
59656
|
...t,
|
|
59552
59657
|
children: /* @__PURE__ */ V(dh, { className: "h-4 w-4" })
|
|
59553
59658
|
}));
|
|
59554
|
-
|
|
59555
|
-
var
|
|
59659
|
+
DU.displayName = "SelectScrollDownButton";
|
|
59660
|
+
var OU = y.forwardRef(({ className: e, children: t, position: n = "popper", side: r = "bottom", sideOffset: i = 4, align: a = "center", alignOffset: o = 0, alignItemWithTrigger: s = n === "popper", ...c }, l) => {
|
|
59556
59661
|
let { resolvedTheme: u, theme: d } = Vm();
|
|
59557
|
-
return /* @__PURE__ */ V(
|
|
59662
|
+
return /* @__PURE__ */ V(HH, { children: /* @__PURE__ */ V(XH, {
|
|
59558
59663
|
align: a,
|
|
59559
59664
|
alignOffset: o,
|
|
59560
59665
|
alignItemWithTrigger: s,
|
|
59561
59666
|
className: "z-50",
|
|
59562
59667
|
side: r,
|
|
59563
59668
|
sideOffset: i,
|
|
59564
|
-
children: /* @__PURE__ */ H(
|
|
59669
|
+
children: /* @__PURE__ */ H(QH, {
|
|
59565
59670
|
ref: l,
|
|
59566
59671
|
className: U("agents-sdk relative z-50 max-h-[var(--available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[var(--transform-origin)]", n === "popper" && "w-full min-w-[var(--anchor-width)] data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", e),
|
|
59567
59672
|
"data-agents-sdk-resolved-theme": u,
|
|
59568
59673
|
"data-agents-sdk-theme": d,
|
|
59569
59674
|
...c,
|
|
59570
59675
|
children: [
|
|
59571
|
-
/* @__PURE__ */ V(
|
|
59572
|
-
/* @__PURE__ */ V(
|
|
59676
|
+
/* @__PURE__ */ V(EU, {}),
|
|
59677
|
+
/* @__PURE__ */ V(oU, {
|
|
59573
59678
|
className: "p-1",
|
|
59574
59679
|
children: t
|
|
59575
59680
|
}),
|
|
59576
|
-
/* @__PURE__ */ V(
|
|
59681
|
+
/* @__PURE__ */ V(DU, {})
|
|
59577
59682
|
]
|
|
59578
59683
|
})
|
|
59579
59684
|
}) });
|
|
59580
59685
|
});
|
|
59581
|
-
|
|
59582
|
-
var
|
|
59686
|
+
OU.displayName = "SelectContent";
|
|
59687
|
+
var kU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(SU, {
|
|
59583
59688
|
ref: n,
|
|
59584
59689
|
className: U("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
|
|
59585
59690
|
...t
|
|
59586
59691
|
}));
|
|
59587
|
-
|
|
59588
|
-
var
|
|
59692
|
+
kU.displayName = "SelectLabel";
|
|
59693
|
+
var AU = y.forwardRef(({ className: e, children: t, asChild: n = !1, ...r }, i) => /* @__PURE__ */ H(lU, {
|
|
59589
59694
|
ref: i,
|
|
59590
59695
|
render: lm(n, t),
|
|
59591
59696
|
className: U("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", e),
|
|
59592
59697
|
...r,
|
|
59593
59698
|
children: [/* @__PURE__ */ V("span", {
|
|
59594
59699
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
59595
|
-
children: /* @__PURE__ */ V(
|
|
59596
|
-
}), /* @__PURE__ */ V(
|
|
59700
|
+
children: /* @__PURE__ */ V(uU, { children: /* @__PURE__ */ V(uh, { className: "h-4 w-4" }) })
|
|
59701
|
+
}), /* @__PURE__ */ V(fU, { children: t })]
|
|
59597
59702
|
}));
|
|
59598
|
-
|
|
59599
|
-
function
|
|
59703
|
+
AU.displayName = "SelectItem";
|
|
59704
|
+
function jU(e) {
|
|
59600
59705
|
let t = [];
|
|
59601
|
-
return
|
|
59706
|
+
return MU(e, t), t.length > 0 ? t : void 0;
|
|
59602
59707
|
}
|
|
59603
|
-
function
|
|
59708
|
+
function MU(e, t) {
|
|
59604
59709
|
y.Children.forEach(e, (e) => {
|
|
59605
59710
|
if (y.isValidElement(e)) {
|
|
59606
|
-
if (e.type ===
|
|
59711
|
+
if (e.type === AU) {
|
|
59607
59712
|
let n = e.props.value;
|
|
59608
59713
|
typeof n == "string" && t.push({
|
|
59609
59714
|
value: n,
|
|
@@ -59611,34 +59716,34 @@ function TU(e, t) {
|
|
|
59611
59716
|
});
|
|
59612
59717
|
return;
|
|
59613
59718
|
}
|
|
59614
|
-
|
|
59719
|
+
MU(e.props.children, t);
|
|
59615
59720
|
}
|
|
59616
59721
|
});
|
|
59617
59722
|
}
|
|
59618
|
-
var
|
|
59723
|
+
var NU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Oh, {
|
|
59619
59724
|
ref: n,
|
|
59620
59725
|
className: U("-mx-1 my-1 h-px bg-muted", e),
|
|
59621
59726
|
...t
|
|
59622
59727
|
}));
|
|
59623
|
-
|
|
59728
|
+
NU.displayName = "SelectSeparator";
|
|
59624
59729
|
//#endregion
|
|
59625
59730
|
//#region src/components/elements/prompt-input.tsx
|
|
59626
|
-
var
|
|
59627
|
-
function
|
|
59731
|
+
var PU = 9;
|
|
59732
|
+
function FU(e) {
|
|
59628
59733
|
let t = e?.firstElementChild;
|
|
59629
59734
|
return t instanceof HTMLElement ? t : null;
|
|
59630
59735
|
}
|
|
59631
|
-
function
|
|
59736
|
+
function IU(e) {
|
|
59632
59737
|
let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight), r = Number.parseFloat(t.paddingTop), i = Number.parseFloat(t.paddingBottom), a = Number.isFinite(n) ? n : 24, o = Number.isFinite(r) ? r : 0, s = Number.isFinite(i) ? i : 0;
|
|
59633
59738
|
return {
|
|
59634
59739
|
minHeight: a + o + s,
|
|
59635
|
-
maxHeight: a *
|
|
59740
|
+
maxHeight: a * PU + o + s
|
|
59636
59741
|
};
|
|
59637
59742
|
}
|
|
59638
|
-
function
|
|
59743
|
+
function LU(e, t, n) {
|
|
59639
59744
|
if (!e) return;
|
|
59640
59745
|
e.style.height = "auto";
|
|
59641
|
-
let { minHeight: r, maxHeight: i } =
|
|
59746
|
+
let { minHeight: r, maxHeight: i } = IU(e), a = Math.max(e.scrollHeight, r), o = Math.min(a, i), s = FU(t);
|
|
59642
59747
|
if (e.style.height = `${a}px`, e.style.overflowY = "hidden", n((e) => e === o ? e : o), s) {
|
|
59643
59748
|
if (a <= i) {
|
|
59644
59749
|
s.scrollTop = 0;
|
|
@@ -59649,30 +59754,30 @@ function AU(e, t, n) {
|
|
|
59649
59754
|
});
|
|
59650
59755
|
}
|
|
59651
59756
|
}
|
|
59652
|
-
function
|
|
59757
|
+
function RU(e, t) {
|
|
59653
59758
|
if (typeof e == "function") {
|
|
59654
59759
|
e(t);
|
|
59655
59760
|
return;
|
|
59656
59761
|
}
|
|
59657
59762
|
e && (e.current = t);
|
|
59658
59763
|
}
|
|
59659
|
-
var
|
|
59764
|
+
var zU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
|
|
59660
59765
|
className: U("w-full overflow-hidden rounded-xl border bg-background shadow-xs", e),
|
|
59661
59766
|
...t
|
|
59662
|
-
}),
|
|
59767
|
+
}), BU = ({ onChange: e, className: t, placeholder: n = "What would you like to know?", ref: r, disableAutoResize: i = !1, resizeOnNewLinesOnly: a = !1, ...o }) => {
|
|
59663
59768
|
let s = R(null), c = R(null), [l, u] = z(), d = !i && !a;
|
|
59664
59769
|
j(() => {
|
|
59665
|
-
d &&
|
|
59770
|
+
d && LU(s.current, c.current, u);
|
|
59666
59771
|
}, [
|
|
59667
59772
|
o.value,
|
|
59668
59773
|
o.defaultValue,
|
|
59669
59774
|
d
|
|
59670
59775
|
]);
|
|
59671
|
-
let f = /* @__PURE__ */ V(
|
|
59776
|
+
let f = /* @__PURE__ */ V(eB, {
|
|
59672
59777
|
className: U("w-full resize-none rounded-none border-none p-3 shadow-none outline-hidden ring-0", i || a ? "field-sizing-fixed" : "field-sizing-fixed min-h-[calc(1lh+1.5rem)] overflow-y-hidden", "bg-transparent dark:bg-transparent", "focus-visible:ring-0", t),
|
|
59673
59778
|
name: "message",
|
|
59674
59779
|
onChange: (t) => {
|
|
59675
|
-
d &&
|
|
59780
|
+
d && LU(t.currentTarget, c.current, u), e?.(t);
|
|
59676
59781
|
},
|
|
59677
59782
|
onKeyDown: (e) => {
|
|
59678
59783
|
if (e.key === "Enter") {
|
|
@@ -59684,23 +59789,23 @@ var MU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
|
|
|
59684
59789
|
},
|
|
59685
59790
|
placeholder: n,
|
|
59686
59791
|
ref: (e) => {
|
|
59687
|
-
s.current = e,
|
|
59792
|
+
s.current = e, RU(r, e);
|
|
59688
59793
|
},
|
|
59689
59794
|
...o
|
|
59690
59795
|
});
|
|
59691
|
-
return d ? /* @__PURE__ */ V(
|
|
59796
|
+
return d ? /* @__PURE__ */ V(JV, {
|
|
59692
59797
|
className: "w-full",
|
|
59693
59798
|
ref: c,
|
|
59694
59799
|
style: { height: l },
|
|
59695
59800
|
children: f
|
|
59696
59801
|
}) : f;
|
|
59697
|
-
},
|
|
59802
|
+
}, VU = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
|
|
59698
59803
|
className: U("flex items-center justify-between p-1", e),
|
|
59699
59804
|
...t
|
|
59700
|
-
}),
|
|
59805
|
+
}), HU = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
|
|
59701
59806
|
className: U("flex items-center gap-1", "[&_button:first-child]:rounded-bl-xl", e),
|
|
59702
59807
|
...t
|
|
59703
|
-
}),
|
|
59808
|
+
}), UU = ({ className: e, variant: t = "default", size: n = "icon", status: r, children: i, ...a }) => {
|
|
59704
59809
|
let o = /* @__PURE__ */ V(Ch, { className: "size-4" });
|
|
59705
59810
|
return r === "submitted" ? o = /* @__PURE__ */ V(yh, { className: "size-4 animate-spin" }) : r === "streaming" ? o = /* @__PURE__ */ V(wh, { className: "size-4" }) : r === "error" && (o = /* @__PURE__ */ V(Eh, { className: "size-4" })), /* @__PURE__ */ V(Fm, {
|
|
59706
59811
|
className: U("gap-1.5 rounded-lg", e),
|
|
@@ -59710,7 +59815,7 @@ var MU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
|
|
|
59710
59815
|
...a,
|
|
59711
59816
|
children: i ?? o
|
|
59712
59817
|
});
|
|
59713
|
-
},
|
|
59818
|
+
}, WU = ({ suggestion: e, onClick: t, className: n, variant: r = "outline", size: i = "sm", children: a, ...o }) => /* @__PURE__ */ V(Fm, {
|
|
59714
59819
|
className: U("cursor-pointer rounded-full px-4", n),
|
|
59715
59820
|
onClick: () => {
|
|
59716
59821
|
t?.(e);
|
|
@@ -59723,7 +59828,7 @@ var MU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
|
|
|
59723
59828
|
});
|
|
59724
59829
|
//#endregion
|
|
59725
59830
|
//#region src/components/suggested-actions.tsx
|
|
59726
|
-
function
|
|
59831
|
+
function GU({ chatId: e, sendMessage: t, suggestedActions: n }) {
|
|
59727
59832
|
let { getChatPath: r } = Ze(), i = n.map((e) => e.trim()).filter(Boolean);
|
|
59728
59833
|
return i.length === 0 ? null : /* @__PURE__ */ V("div", {
|
|
59729
59834
|
className: "grid w-full gap-2 sm:grid-cols-2",
|
|
@@ -59742,7 +59847,7 @@ function RU({ chatId: e, sendMessage: t, suggestedActions: n }) {
|
|
|
59742
59847
|
y: 20
|
|
59743
59848
|
},
|
|
59744
59849
|
transition: { delay: .05 * i },
|
|
59745
|
-
children: /* @__PURE__ */ V(
|
|
59850
|
+
children: /* @__PURE__ */ V(WU, {
|
|
59746
59851
|
className: "h-auto w-full whitespace-normal p-3 text-left",
|
|
59747
59852
|
onClick: (n) => {
|
|
59748
59853
|
window.history.pushState({}, "", r(e)), t({
|
|
@@ -59759,28 +59864,28 @@ function RU({ chatId: e, sendMessage: t, suggestedActions: n }) {
|
|
|
59759
59864
|
}, `${i}-${n}`))
|
|
59760
59865
|
});
|
|
59761
59866
|
}
|
|
59762
|
-
var
|
|
59867
|
+
var KU = O(GU, (e, t) => !(e.chatId !== t.chatId || !ve(e.suggestedActions, t.suggestedActions)));
|
|
59763
59868
|
//#endregion
|
|
59764
59869
|
//#region src/components/multimodal-input.tsx
|
|
59765
|
-
function
|
|
59870
|
+
function qU(e, t) {
|
|
59766
59871
|
document.cookie = `${e}=${encodeURIComponent(t)}; path=/; max-age=31536000`;
|
|
59767
59872
|
}
|
|
59768
|
-
var
|
|
59769
|
-
function
|
|
59873
|
+
var JU = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_") || "default", YU = 40, XU = 9;
|
|
59874
|
+
function ZU(e) {
|
|
59770
59875
|
let t = e?.firstElementChild;
|
|
59771
59876
|
return t instanceof HTMLElement ? t : null;
|
|
59772
59877
|
}
|
|
59773
|
-
function
|
|
59878
|
+
function QU(e) {
|
|
59774
59879
|
let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight), r = Number.parseFloat(t.paddingTop), i = Number.parseFloat(t.paddingBottom), a = Number.isFinite(n) ? n : 24, o = Number.isFinite(r) ? r : 0, s = Number.isFinite(i) ? i : 0;
|
|
59775
59880
|
return {
|
|
59776
|
-
minHeight: Math.max(a + o + s,
|
|
59777
|
-
maxHeight: a *
|
|
59881
|
+
minHeight: Math.max(a + o + s, YU),
|
|
59882
|
+
maxHeight: a * XU + o + s
|
|
59778
59883
|
};
|
|
59779
59884
|
}
|
|
59780
|
-
function
|
|
59885
|
+
function $U(e, t) {
|
|
59781
59886
|
if (!e) return;
|
|
59782
59887
|
e.style.height = "auto";
|
|
59783
|
-
let { minHeight: n, maxHeight: r } =
|
|
59888
|
+
let { minHeight: n, maxHeight: r } = QU(e), i = e.scrollHeight, a = Math.max(i, n), o = Math.min(a, r), s = ZU(t.scrollArea);
|
|
59784
59889
|
if (e.style.height = `${a}px`, e.style.overflowY = "hidden", t.setScrollAreaHeight((e) => e === o ? e : o), s) {
|
|
59785
59890
|
if (a <= r) {
|
|
59786
59891
|
s.scrollTop = 0;
|
|
@@ -59791,17 +59896,17 @@ function KU(e, t) {
|
|
|
59791
59896
|
});
|
|
59792
59897
|
}
|
|
59793
59898
|
}
|
|
59794
|
-
function
|
|
59899
|
+
function eW(e, t) {
|
|
59795
59900
|
if (!e) return;
|
|
59796
|
-
let { minHeight: n } =
|
|
59901
|
+
let { minHeight: n } = QU(e);
|
|
59797
59902
|
e.style.height = `${n}px`, e.style.overflowY = "hidden", t.setScrollAreaHeight(n);
|
|
59798
|
-
let r =
|
|
59903
|
+
let r = ZU(t.scrollArea);
|
|
59799
59904
|
r && (r.scrollTop = 0);
|
|
59800
59905
|
}
|
|
59801
|
-
function
|
|
59802
|
-
let y = R(null), b = R(null), [x, S] = z(
|
|
59906
|
+
function tW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments: a, setAttachments: o, messages: s, setMessages: c, sendMessage: l, className: u, chatModels: d, defaultChatModel: f, selectedModelId: p, onModelChange: m, openaiReasoningEffort: h = v, onOpenAIReasoningEffortChange: g, suggestedActions: _ }) {
|
|
59907
|
+
let y = R(null), b = R(null), [x, S] = z(YU), { width: C } = $P(), { getChatPath: w } = Ze(), T = r === "ready" || r === "error";
|
|
59803
59908
|
j(() => {
|
|
59804
|
-
|
|
59909
|
+
$U(y.current, {
|
|
59805
59910
|
scrollArea: b.current,
|
|
59806
59911
|
setScrollAreaHeight: S
|
|
59807
59912
|
});
|
|
@@ -59822,7 +59927,7 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59822
59927
|
O(t);
|
|
59823
59928
|
}, [t, O]);
|
|
59824
59929
|
let A = (e) => {
|
|
59825
|
-
n(e.target.value),
|
|
59930
|
+
n(e.target.value), $U(e.currentTarget, {
|
|
59826
59931
|
scrollArea: b.current,
|
|
59827
59932
|
setScrollAreaHeight: S
|
|
59828
59933
|
});
|
|
@@ -59839,7 +59944,7 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59839
59944
|
type: "text",
|
|
59840
59945
|
text: t
|
|
59841
59946
|
}]
|
|
59842
|
-
}), o([]), O(""), n(""),
|
|
59947
|
+
}), o([]), O(""), n(""), eW(y.current, {
|
|
59843
59948
|
scrollArea: b.current,
|
|
59844
59949
|
setScrollAreaHeight: S
|
|
59845
59950
|
}), C && C > 768 && y.current?.focus();
|
|
@@ -59947,7 +60052,7 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59947
60052
|
}, [ee]), /* @__PURE__ */ H("div", {
|
|
59948
60053
|
className: U("relative flex w-full flex-col gap-4", u),
|
|
59949
60054
|
children: [
|
|
59950
|
-
s.length === 0 && a.length === 0 && N.length === 0 && _ && _.length > 0 && /* @__PURE__ */ V(
|
|
60055
|
+
s.length === 0 && a.length === 0 && N.length === 0 && _ && _.length > 0 && /* @__PURE__ */ V(KU, {
|
|
59951
60056
|
chatId: e,
|
|
59952
60057
|
sendMessage: l,
|
|
59953
60058
|
suggestedActions: _
|
|
@@ -59960,7 +60065,7 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59960
60065
|
tabIndex: -1,
|
|
59961
60066
|
type: "file"
|
|
59962
60067
|
}),
|
|
59963
|
-
/* @__PURE__ */ H(
|
|
60068
|
+
/* @__PURE__ */ H(zU, {
|
|
59964
60069
|
className: "rounded-xl border border-border bg-background p-3 shadow-xs transition-all duration-200 focus-within:border-border hover:border-muted-foreground/50",
|
|
59965
60070
|
onSubmit: (e) => {
|
|
59966
60071
|
if (e.preventDefault(), !(!t.trim() && a.length === 0)) {
|
|
@@ -59975,12 +60080,12 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59975
60080
|
(a.length > 0 || N.length > 0) && /* @__PURE__ */ H("div", {
|
|
59976
60081
|
className: "flex flex-row items-end gap-2 overflow-x-scroll",
|
|
59977
60082
|
"data-testid": "attachments-preview",
|
|
59978
|
-
children: [a.map((e) => /* @__PURE__ */ V(
|
|
60083
|
+
children: [a.map((e) => /* @__PURE__ */ V(dB, {
|
|
59979
60084
|
attachment: e,
|
|
59980
60085
|
onRemove: () => {
|
|
59981
60086
|
o((t) => t.filter((t) => t.url !== e.url)), M.current && (M.current.value = "");
|
|
59982
60087
|
}
|
|
59983
|
-
}, e.url)), N.map((e) => /* @__PURE__ */ V(
|
|
60088
|
+
}, e.url)), N.map((e) => /* @__PURE__ */ V(dB, {
|
|
59984
60089
|
attachment: {
|
|
59985
60090
|
url: "",
|
|
59986
60091
|
name: e,
|
|
@@ -59991,11 +60096,11 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
59991
60096
|
}),
|
|
59992
60097
|
/* @__PURE__ */ V("div", {
|
|
59993
60098
|
className: "flex flex-row items-start gap-1 sm:gap-2",
|
|
59994
|
-
children: /* @__PURE__ */ V(
|
|
60099
|
+
children: /* @__PURE__ */ V(JV, {
|
|
59995
60100
|
className: "grow rounded-md",
|
|
59996
60101
|
ref: b,
|
|
59997
60102
|
style: { height: x },
|
|
59998
|
-
children: /* @__PURE__ */ V(
|
|
60103
|
+
children: /* @__PURE__ */ V(BU, {
|
|
59999
60104
|
className: "min-h-10 w-full resize-none overflow-y-hidden border-0! border-none! bg-transparent p-2 text-base outline-none ring-0 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
60000
60105
|
"data-testid": "multimodal-input",
|
|
60001
60106
|
disableAutoResize: !0,
|
|
@@ -60007,17 +60112,17 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
60007
60112
|
})
|
|
60008
60113
|
})
|
|
60009
60114
|
}),
|
|
60010
|
-
/* @__PURE__ */ H(
|
|
60115
|
+
/* @__PURE__ */ H(VU, {
|
|
60011
60116
|
className: "border-top-0! border-t-0! p-0 shadow-none dark:border-0 dark:border-transparent!",
|
|
60012
|
-
children: [/* @__PURE__ */ H(
|
|
60117
|
+
children: [/* @__PURE__ */ H(HU, {
|
|
60013
60118
|
className: "gap-0 sm:gap-0.5",
|
|
60014
60119
|
children: [
|
|
60015
|
-
/* @__PURE__ */ V(
|
|
60120
|
+
/* @__PURE__ */ V(iW, {
|
|
60016
60121
|
fileInputRef: M,
|
|
60017
60122
|
selectedModelId: p,
|
|
60018
60123
|
status: r
|
|
60019
60124
|
}),
|
|
60020
|
-
/* @__PURE__ */ V(
|
|
60125
|
+
/* @__PURE__ */ V(oW, {
|
|
60021
60126
|
focusTargetRef: y,
|
|
60022
60127
|
chatModels: d,
|
|
60023
60128
|
defaultChatModel: f,
|
|
@@ -60025,7 +60130,7 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
60025
60130
|
onModelChange: m,
|
|
60026
60131
|
selectedModelId: p
|
|
60027
60132
|
}),
|
|
60028
|
-
/* @__PURE__ */ V(
|
|
60133
|
+
/* @__PURE__ */ V(lW, {
|
|
60029
60134
|
disabled: r !== "ready",
|
|
60030
60135
|
idScope: e,
|
|
60031
60136
|
onChange: g,
|
|
@@ -60033,10 +60138,10 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
60033
60138
|
value: h
|
|
60034
60139
|
})
|
|
60035
60140
|
]
|
|
60036
|
-
}), r === "submitted" || r === "streaming" ? /* @__PURE__ */ V(
|
|
60141
|
+
}), r === "submitted" || r === "streaming" ? /* @__PURE__ */ V(dW, {
|
|
60037
60142
|
setMessages: c,
|
|
60038
60143
|
stop: i
|
|
60039
|
-
}) : /* @__PURE__ */ V(
|
|
60144
|
+
}) : /* @__PURE__ */ V(UU, {
|
|
60040
60145
|
className: "size-8 rounded-full bg-primary text-primary-foreground transition-colors duration-200 hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground",
|
|
60041
60146
|
"data-testid": "send-button",
|
|
60042
60147
|
disabled: !t.trim() || N.length > 0,
|
|
@@ -60049,8 +60154,8 @@ function JU({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
|
|
|
60049
60154
|
]
|
|
60050
60155
|
});
|
|
60051
60156
|
}
|
|
60052
|
-
var
|
|
60053
|
-
function
|
|
60157
|
+
var nW = O(tW, (e, t) => !(e.input !== t.input || e.status !== t.status || !ve(e.attachments, t.attachments) || e.selectedModelId !== t.selectedModelId || e.openaiReasoningEffort !== t.openaiReasoningEffort || !ve(e.suggestedActions, t.suggestedActions) || !ve(e.chatModels, t.chatModels) || e.defaultChatModel !== t.defaultChatModel));
|
|
60158
|
+
function rW({ fileInputRef: e, status: t, selectedModelId: n }) {
|
|
60054
60159
|
let r = n.includes("reasoning") || n.includes("think");
|
|
60055
60160
|
return /* @__PURE__ */ V(Fm, {
|
|
60056
60161
|
className: "aspect-square h-8 rounded-lg p-1 transition-colors hover:bg-accent",
|
|
@@ -60069,44 +60174,44 @@ function XU({ fileInputRef: e, status: t, selectedModelId: n }) {
|
|
|
60069
60174
|
})
|
|
60070
60175
|
});
|
|
60071
60176
|
}
|
|
60072
|
-
var
|
|
60073
|
-
function
|
|
60074
|
-
let [o, s] = z(!1), c = R(!1), l =
|
|
60177
|
+
var iW = O(rW);
|
|
60178
|
+
function aW({ focusTargetRef: e, chatModels: t, defaultChatModel: n, idScope: r, selectedModelId: i, onModelChange: a }) {
|
|
60179
|
+
let [o, s] = z(!1), c = R(!1), l = JU(r), d = t && t.length > 0 ? t : f, p = u(d), m = d.find((e) => e.id === i) ?? d.find((e) => e.id === n) ?? d[0] ?? f[0], [h] = m.id.split("/"), g = {
|
|
60075
60180
|
anthropic: "Anthropic",
|
|
60076
60181
|
openai: "OpenAI",
|
|
60077
60182
|
google: "Google",
|
|
60078
60183
|
xai: "xAI",
|
|
60079
60184
|
reasoning: "Reasoning"
|
|
60080
60185
|
};
|
|
60081
|
-
return /* @__PURE__ */ H(
|
|
60186
|
+
return /* @__PURE__ */ H(rV, {
|
|
60082
60187
|
onOpenChange: s,
|
|
60083
60188
|
open: o,
|
|
60084
|
-
children: [/* @__PURE__ */ V(
|
|
60189
|
+
children: [/* @__PURE__ */ V(iV, {
|
|
60085
60190
|
asChild: !0,
|
|
60086
60191
|
children: /* @__PURE__ */ H(Fm, {
|
|
60087
60192
|
className: "agents-chat-model-selector-trigger h-8 w-auto max-w-[18rem] justify-start gap-2 px-2",
|
|
60088
60193
|
id: `agents-sdk-model-selector-${l}`,
|
|
60089
60194
|
variant: "ghost",
|
|
60090
|
-
children: [h && /* @__PURE__ */ V(
|
|
60195
|
+
children: [h && /* @__PURE__ */ V(uV, { provider: h }), /* @__PURE__ */ V(dV, {
|
|
60091
60196
|
className: "min-w-0 max-w-[14rem] flex-initial",
|
|
60092
60197
|
children: m.name
|
|
60093
60198
|
})]
|
|
60094
60199
|
})
|
|
60095
|
-
}), /* @__PURE__ */ H(
|
|
60200
|
+
}), /* @__PURE__ */ H(aV, {
|
|
60096
60201
|
commandDefaultValue: m.id,
|
|
60097
60202
|
finalFocus: () => c.current ? (c.current = !1, e.current) : !0,
|
|
60098
|
-
children: [/* @__PURE__ */ V(
|
|
60203
|
+
children: [/* @__PURE__ */ V(oV, { placeholder: "Search models..." }), /* @__PURE__ */ V(sV, { children: Object.entries(p).map(([e, t]) => /* @__PURE__ */ V(cV, {
|
|
60099
60204
|
heading: g[e] ?? e,
|
|
60100
60205
|
children: t.map((e) => {
|
|
60101
60206
|
let t = e.id.split("/")[0];
|
|
60102
|
-
return /* @__PURE__ */ H(
|
|
60207
|
+
return /* @__PURE__ */ H(lV, {
|
|
60103
60208
|
onSelect: () => {
|
|
60104
|
-
c.current = !0, a?.(e.id),
|
|
60209
|
+
c.current = !0, a?.(e.id), qU("chat-model", e.id), s(!1);
|
|
60105
60210
|
},
|
|
60106
60211
|
value: e.id,
|
|
60107
60212
|
children: [
|
|
60108
|
-
/* @__PURE__ */ V(
|
|
60109
|
-
/* @__PURE__ */ V(
|
|
60213
|
+
/* @__PURE__ */ V(uV, { provider: t }),
|
|
60214
|
+
/* @__PURE__ */ V(dV, { children: e.name }),
|
|
60110
60215
|
e.id === m.id && /* @__PURE__ */ V(uh, { className: "ml-auto size-4" })
|
|
60111
60216
|
]
|
|
60112
60217
|
}, e.id);
|
|
@@ -60115,40 +60220,40 @@ function QU({ focusTargetRef: e, chatModels: t, defaultChatModel: n, idScope: r,
|
|
|
60115
60220
|
})]
|
|
60116
60221
|
});
|
|
60117
60222
|
}
|
|
60118
|
-
var
|
|
60119
|
-
function
|
|
60120
|
-
let a = m(t), o = h(t), s = _(t), c = s &&
|
|
60223
|
+
var oW = O(aW), sW = (e, t) => t.includes(e), cW = (e) => e.charAt(0).toUpperCase() + e.slice(1);
|
|
60224
|
+
function lW({ idScope: e, selectedModelId: t, value: n, onChange: r, disabled: i }) {
|
|
60225
|
+
let a = m(t), o = h(t), s = _(t), c = s && sW(s, o) ? s : o[0], l = sW(n, o) ? n : c ?? "default";
|
|
60121
60226
|
return j(() => {
|
|
60122
|
-
!a || !r ||
|
|
60227
|
+
!a || !r || sW(n, o) || r(c ?? "default");
|
|
60123
60228
|
}, [
|
|
60124
60229
|
o,
|
|
60125
60230
|
c,
|
|
60126
60231
|
r,
|
|
60127
60232
|
a,
|
|
60128
60233
|
n
|
|
60129
|
-
]), !a || !r || l === "default" ? null : /* @__PURE__ */ H(
|
|
60234
|
+
]), !a || !r || l === "default" ? null : /* @__PURE__ */ H(CU, {
|
|
60130
60235
|
disabled: i,
|
|
60131
60236
|
onValueChange: (e) => {
|
|
60132
|
-
|
|
60237
|
+
qU(g, e), r(e);
|
|
60133
60238
|
},
|
|
60134
60239
|
value: l,
|
|
60135
|
-
children: [/* @__PURE__ */ V(
|
|
60240
|
+
children: [/* @__PURE__ */ V(TU, {
|
|
60136
60241
|
className: "h-8 w-[112px] gap-1 border-0 bg-transparent px-2 text-sm hover:bg-accent focus:ring-0 focus:ring-offset-0",
|
|
60137
|
-
id: `agents-sdk-reasoning-effort-${
|
|
60242
|
+
id: `agents-sdk-reasoning-effort-${JU(e)}`,
|
|
60138
60243
|
children: /* @__PURE__ */ H("div", {
|
|
60139
60244
|
className: "flex min-w-0 items-center gap-1.5",
|
|
60140
60245
|
children: [/* @__PURE__ */ V(lh, { className: "size-3.5 shrink-0 text-muted-foreground" }), /* @__PURE__ */ V("span", {
|
|
60141
60246
|
className: "min-w-0 truncate",
|
|
60142
|
-
children: /* @__PURE__ */ V(
|
|
60247
|
+
children: /* @__PURE__ */ V(wU, {})
|
|
60143
60248
|
})]
|
|
60144
60249
|
})
|
|
60145
|
-
}), /* @__PURE__ */ V(
|
|
60250
|
+
}), /* @__PURE__ */ V(OU, { children: o.map((e) => /* @__PURE__ */ V(AU, {
|
|
60146
60251
|
value: e,
|
|
60147
|
-
children: /* @__PURE__ */ V("span", { children:
|
|
60252
|
+
children: /* @__PURE__ */ V("span", { children: cW(e) })
|
|
60148
60253
|
}, e)) })]
|
|
60149
60254
|
});
|
|
60150
60255
|
}
|
|
60151
|
-
function
|
|
60256
|
+
function uW({ stop: e, setMessages: t }) {
|
|
60152
60257
|
return /* @__PURE__ */ V(Fm, {
|
|
60153
60258
|
className: "size-8 rounded-full bg-primary p-1 text-primary-foreground transition-colors duration-200 hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground",
|
|
60154
60259
|
"data-testid": "stop-button",
|
|
@@ -60158,7 +60263,7 @@ function rW({ stop: e, setMessages: t }) {
|
|
|
60158
60263
|
children: /* @__PURE__ */ V(G, { size: 14 })
|
|
60159
60264
|
});
|
|
60160
60265
|
}
|
|
60161
|
-
var
|
|
60266
|
+
var dW = O(uW), fW = ({ description: e, icon: t, selectedTool: n, setSelectedTool: r, isToolbarVisible: i, setIsToolbarVisible: a, isAnimating: o, sendMessage: s, onClick: c }) => {
|
|
60162
60267
|
let [l, u] = z(!1);
|
|
60163
60268
|
j(() => {
|
|
60164
60269
|
n !== e && u(!1);
|
|
@@ -60216,14 +60321,14 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60216
60321
|
children: e
|
|
60217
60322
|
})]
|
|
60218
60323
|
});
|
|
60219
|
-
},
|
|
60324
|
+
}, pW = [...[
|
|
60220
60325
|
,
|
|
60221
60326
|
,
|
|
60222
60327
|
,
|
|
60223
60328
|
,
|
|
60224
60329
|
,
|
|
60225
60330
|
,
|
|
60226
|
-
]].map((e) => Je(5)),
|
|
60331
|
+
]].map((e) => Je(5)), mW = ({ setSelectedTool: e, sendMessage: t, isAnimating: n }) => {
|
|
60227
60332
|
let r = [
|
|
60228
60333
|
"Elementary",
|
|
60229
60334
|
"Middle School",
|
|
@@ -60239,7 +60344,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60239
60344
|
return () => e();
|
|
60240
60345
|
}, [a]), /* @__PURE__ */ H("div", {
|
|
60241
60346
|
className: "relative flex flex-col items-center justify-end",
|
|
60242
|
-
children: [
|
|
60347
|
+
children: [pW.map((e) => /* @__PURE__ */ V(cP.div, {
|
|
60243
60348
|
animate: { opacity: 1 },
|
|
60244
60349
|
className: "flex size-[40px] flex-row items-center justify-center",
|
|
60245
60350
|
exit: { opacity: 0 },
|
|
@@ -60291,7 +60396,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60291
60396
|
})]
|
|
60292
60397
|
}) })]
|
|
60293
60398
|
});
|
|
60294
|
-
},
|
|
60399
|
+
}, hW = ({ isToolbarVisible: e, selectedTool: t, setSelectedTool: n, sendMessage: r, isAnimating: i, setIsToolbarVisible: a, tools: o }) => {
|
|
60295
60400
|
let [s, ...c] = o;
|
|
60296
60401
|
return /* @__PURE__ */ H(cP.div, {
|
|
60297
60402
|
animate: {
|
|
@@ -60307,7 +60412,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60307
60412
|
opacity: 0,
|
|
60308
60413
|
scale: .95
|
|
60309
60414
|
},
|
|
60310
|
-
children: [/* @__PURE__ */ V(hM, { children: e && c.map((e) => /* @__PURE__ */ V(
|
|
60415
|
+
children: [/* @__PURE__ */ V(hM, { children: e && c.map((e) => /* @__PURE__ */ V(fW, {
|
|
60311
60416
|
description: e.description,
|
|
60312
60417
|
icon: e.icon,
|
|
60313
60418
|
isAnimating: i,
|
|
@@ -60315,7 +60420,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60315
60420
|
selectedTool: t,
|
|
60316
60421
|
sendMessage: r,
|
|
60317
60422
|
setSelectedTool: n
|
|
60318
|
-
}, e.description)) }), /* @__PURE__ */ V(
|
|
60423
|
+
}, e.description)) }), /* @__PURE__ */ V(fW, {
|
|
60319
60424
|
description: s.description,
|
|
60320
60425
|
icon: s.icon,
|
|
60321
60426
|
isAnimating: i,
|
|
@@ -60327,7 +60432,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60327
60432
|
setSelectedTool: n
|
|
60328
60433
|
})]
|
|
60329
60434
|
});
|
|
60330
|
-
},
|
|
60435
|
+
}, gW = O(({ isToolbarVisible: e, setIsToolbarVisible: t, sendMessage: n, status: r, stop: i, setMessages: a, artifactKind: o }) => {
|
|
60331
60436
|
let s = R(null), c = R(null), [l, u] = z(null), [d, f] = z(!1);
|
|
60332
60437
|
ZP(s, () => {
|
|
60333
60438
|
t(!1), u(null);
|
|
@@ -60344,7 +60449,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60344
60449
|
}, []), j(() => {
|
|
60345
60450
|
r === "streaming" && t(!1);
|
|
60346
60451
|
}, [r, t]);
|
|
60347
|
-
let h =
|
|
60452
|
+
let h = vW.find((e) => e.kind === o);
|
|
60348
60453
|
if (!h) throw Error("Artifact definition not found!");
|
|
60349
60454
|
let g = h.toolbar;
|
|
60350
60455
|
return g.length === 0 ? null : /* @__PURE__ */ V(Wg, {
|
|
@@ -60406,11 +60511,11 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60406
60511
|
i(), a((e) => e);
|
|
60407
60512
|
},
|
|
60408
60513
|
children: /* @__PURE__ */ V(G, {})
|
|
60409
|
-
}, "stop-icon") : l === "adjust-reading-level" ? /* @__PURE__ */ V(
|
|
60514
|
+
}, "stop-icon") : l === "adjust-reading-level" ? /* @__PURE__ */ V(mW, {
|
|
60410
60515
|
isAnimating: d,
|
|
60411
60516
|
sendMessage: n,
|
|
60412
60517
|
setSelectedTool: u
|
|
60413
|
-
}, "reading-level-selector") : /* @__PURE__ */ V(
|
|
60518
|
+
}, "reading-level-selector") : /* @__PURE__ */ V(hW, {
|
|
60414
60519
|
isAnimating: d,
|
|
60415
60520
|
isToolbarVisible: e,
|
|
60416
60521
|
selectedTool: l,
|
|
@@ -60421,7 +60526,7 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60421
60526
|
}, "tools")
|
|
60422
60527
|
})
|
|
60423
60528
|
});
|
|
60424
|
-
}, (e, t) => !(e.status !== t.status || e.isToolbarVisible !== t.isToolbarVisible || e.artifactKind !== t.artifactKind)),
|
|
60529
|
+
}, (e, t) => !(e.status !== t.status || e.isToolbarVisible !== t.isToolbarVisible || e.artifactKind !== t.artifactKind)), _W = ({ handleVersionChange: e, documents: t, currentVersionIndex: n }) => {
|
|
60425
60530
|
let { artifact: r } = ES(), { width: i } = $P(), a = i < 768, [o, s] = z(!1);
|
|
60426
60531
|
if (t) return /* @__PURE__ */ H(cP.div, {
|
|
60427
60532
|
animate: { y: 0 },
|
|
@@ -60461,13 +60566,13 @@ var iW = O(rW), aW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
|
|
|
60461
60566
|
})]
|
|
60462
60567
|
})]
|
|
60463
60568
|
});
|
|
60464
|
-
},
|
|
60569
|
+
}, vW = [
|
|
60465
60570
|
ER,
|
|
60466
60571
|
lF,
|
|
60467
60572
|
dF,
|
|
60468
60573
|
jL
|
|
60469
60574
|
];
|
|
60470
|
-
function
|
|
60575
|
+
function yW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, status: i, stop: a, attachments: o, setAttachments: s, chatModels: c, defaultChatModel: l, sendMessage: u, messages: d, setMessages: f, regenerate: p, renderMessagePart: m, votes: h, isReadonly: g, selectedModelId: _, suggestedActions: v }) {
|
|
60471
60576
|
let { artifact: y, setArtifact: b, metadata: x, setMetadata: S } = ES(), { data: C, isLoading: w } = NR(y.documentId, y.documentId !== "init" && y.status !== "streaming"), [T, E] = z([]), D = L(() => T.length > 0 ? MR(C, T) : C, [C, T]), [O, A] = z("edit"), [M, N] = z(null), [P, F] = z(-1);
|
|
60472
60577
|
j(() => {
|
|
60473
60578
|
E([]);
|
|
@@ -60525,7 +60630,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60525
60630
|
}
|
|
60526
60631
|
let ie = (e) => {
|
|
60527
60632
|
D && (e === "latest" && (F(D.length - 1), A("edit")), e === "toggle" && A((e) => e === "edit" ? "diff" : "edit"), e === "prev" ? P > 0 && F((e) => e - 1) : e === "next" && P < D.length - 1 && F((e) => e + 1));
|
|
60528
|
-
}, [B, ae] = z(!1), oe = D && D.length > 0 ? P === D.length - 1 : !0, se = Yg(), ce =
|
|
60633
|
+
}, [B, ae] = z(!1), oe = D && D.length > 0 ? P === D.length - 1 : !0, se = Yg(), ce = vW.find((e) => e.kind === y.kind);
|
|
60529
60634
|
if (!ce) throw Error("Artifact definition not found!");
|
|
60530
60635
|
return j(() => {
|
|
60531
60636
|
y.documentId !== "init" && ce.initialize && ce.initialize({
|
|
@@ -60576,7 +60681,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60576
60681
|
initial: { opacity: 0 }
|
|
60577
60682
|
}) }), /* @__PURE__ */ H("div", {
|
|
60578
60683
|
className: "flex h-full flex-col items-center justify-between",
|
|
60579
|
-
children: [/* @__PURE__ */ V(
|
|
60684
|
+
children: [/* @__PURE__ */ V(NB, {
|
|
60580
60685
|
addToolApprovalResponse: e,
|
|
60581
60686
|
artifactStatus: y.status,
|
|
60582
60687
|
chatId: t,
|
|
@@ -60589,7 +60694,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60589
60694
|
votes: h
|
|
60590
60695
|
}), /* @__PURE__ */ V("div", {
|
|
60591
60696
|
className: "relative flex w-full flex-row items-end gap-2 px-4 pb-4",
|
|
60592
|
-
children: /* @__PURE__ */ V(
|
|
60697
|
+
children: /* @__PURE__ */ V(nW, {
|
|
60593
60698
|
attachments: o,
|
|
60594
60699
|
chatModels: c,
|
|
60595
60700
|
defaultChatModel: l,
|
|
@@ -60688,7 +60793,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60688
60793
|
status: y.status,
|
|
60689
60794
|
suggestions: [],
|
|
60690
60795
|
title: y.title
|
|
60691
|
-
}), /* @__PURE__ */ V(hM, { children: oe && /* @__PURE__ */ V(
|
|
60796
|
+
}), /* @__PURE__ */ V(hM, { children: oe && /* @__PURE__ */ V(gW, {
|
|
60692
60797
|
artifactKind: y.kind,
|
|
60693
60798
|
isToolbarVisible: B,
|
|
60694
60799
|
sendMessage: u,
|
|
@@ -60698,7 +60803,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60698
60803
|
stop: a
|
|
60699
60804
|
}) })]
|
|
60700
60805
|
}),
|
|
60701
|
-
/* @__PURE__ */ V(hM, { children: !oe && /* @__PURE__ */ V(
|
|
60806
|
+
/* @__PURE__ */ V(hM, { children: !oe && /* @__PURE__ */ V(_W, {
|
|
60702
60807
|
currentVersionIndex: P,
|
|
60703
60808
|
documents: D,
|
|
60704
60809
|
handleVersionChange: ie
|
|
@@ -60707,7 +60812,7 @@ function fW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
|
|
|
60707
60812
|
})]
|
|
60708
60813
|
}) });
|
|
60709
60814
|
}
|
|
60710
|
-
var
|
|
60815
|
+
var bW = O(yW, (e, t) => !(e.status !== t.status || !ve(e.votes, t.votes) || e.input !== t.input || !ve(e.messages, t.messages.length) || e.renderMessagePart !== t.renderMessagePart || !ve(e.suggestedActions, t.suggestedActions) || !ve(e.chatModels, t.chatModels) || e.defaultChatModel !== t.defaultChatModel)), xW = ({ title1: e, title2: t }) => {
|
|
60711
60816
|
let n = e?.trim(), r = t?.trim();
|
|
60712
60817
|
return !n && !r ? null : /* @__PURE__ */ H("div", {
|
|
60713
60818
|
className: "mx-auto mt-4 flex size-full max-w-3xl flex-col justify-center px-4 md:mt-16 md:px-8",
|
|
@@ -60745,9 +60850,9 @@ var pW = O(fW, (e, t) => !(e.status !== t.status || !ve(e.votes, t.votes) || e.i
|
|
|
60745
60850
|
children: r
|
|
60746
60851
|
})]
|
|
60747
60852
|
}, "overview");
|
|
60748
|
-
},
|
|
60749
|
-
function
|
|
60750
|
-
let r = t.message.trim(), i = r !== "" && !
|
|
60853
|
+
}, SW = (e) => e.trim().toLowerCase().replace(/\.+$/, "") === "an error occurred";
|
|
60854
|
+
function CW({ disabled: e, error: t, onRetry: n }) {
|
|
60855
|
+
let r = t.message.trim(), i = r !== "" && !SW(r);
|
|
60751
60856
|
return /* @__PURE__ */ V("div", {
|
|
60752
60857
|
className: "group/message fade-in w-full animate-in duration-200",
|
|
60753
60858
|
"data-testid": "message-error",
|
|
@@ -60781,7 +60886,7 @@ function gW({ disabled: e, error: t, onRetry: n }) {
|
|
|
60781
60886
|
})
|
|
60782
60887
|
});
|
|
60783
60888
|
}
|
|
60784
|
-
function
|
|
60889
|
+
function wW({ addToolApprovalResponse: e, chatId: t, conversationError: n, status: r, votes: i, messages: a, renderMessagePart: o, setMessages: c, regenerate: u, onRetryConversationError: d, isReadonly: f, selectedModelId: p, title1: m, title2: h }) {
|
|
60785
60890
|
let g = a.at(-1), _ = g ? l(g) : !1, v = r === "submitted" || r === "streaming" && g?.role === "assistant" && !_, { containerRef: y, endRef: b, isAtBottom: x, scrollToBottom: S, hasSentMessage: C } = zR({ status: r });
|
|
60786
60891
|
return ot(), /* @__PURE__ */ H("div", {
|
|
60787
60892
|
className: "relative flex-1",
|
|
@@ -60791,11 +60896,11 @@ function _W({ addToolApprovalResponse: e, chatId: t, conversationError: n, statu
|
|
|
60791
60896
|
children: /* @__PURE__ */ H("div", {
|
|
60792
60897
|
className: "mx-auto flex min-w-0 max-w-4xl flex-col gap-4 px-2 pt-[60px] pb-4 md:gap-6 md:px-4",
|
|
60793
60898
|
children: [
|
|
60794
|
-
a.length === 0 && /* @__PURE__ */ V(
|
|
60899
|
+
a.length === 0 && /* @__PURE__ */ V(xW, {
|
|
60795
60900
|
title1: m,
|
|
60796
60901
|
title2: h
|
|
60797
60902
|
}),
|
|
60798
|
-
a.map((n, l) => s(n) ? null : /* @__PURE__ */ V(
|
|
60903
|
+
a.map((n, l) => s(n) ? null : /* @__PURE__ */ V(OB, {
|
|
60799
60904
|
addToolApprovalResponse: e,
|
|
60800
60905
|
chatId: t,
|
|
60801
60906
|
isLoading: r === "streaming" && a.length - 1 === l,
|
|
@@ -60807,8 +60912,8 @@ function _W({ addToolApprovalResponse: e, chatId: t, conversationError: n, statu
|
|
|
60807
60912
|
setMessages: c,
|
|
60808
60913
|
vote: i ? i.find((e) => e.messageId === n.id) : void 0
|
|
60809
60914
|
}, n.id)),
|
|
60810
|
-
v && /* @__PURE__ */ V(
|
|
60811
|
-
n && /* @__PURE__ */ V(
|
|
60915
|
+
v && /* @__PURE__ */ V(AB, {}),
|
|
60916
|
+
n && /* @__PURE__ */ V(CW, {
|
|
60812
60917
|
disabled: r !== "ready" && r !== "error",
|
|
60813
60918
|
error: n,
|
|
60814
60919
|
onRetry: d
|
|
@@ -60828,10 +60933,10 @@ function _W({ addToolApprovalResponse: e, chatId: t, conversationError: n, statu
|
|
|
60828
60933
|
})]
|
|
60829
60934
|
});
|
|
60830
60935
|
}
|
|
60831
|
-
var
|
|
60936
|
+
var TW = wW, EW = (e) => e?.parts?.some((e) => {
|
|
60832
60937
|
let t = e.state;
|
|
60833
60938
|
return t === "approval-responded" || t === "output-denied";
|
|
60834
|
-
}) ?? !1,
|
|
60939
|
+
}) ?? !1, DW = (e) => `agents-sdk:chat:${e}:stream`, OW = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), kW = (e) => _(e) ?? "default", AW = (e) => {
|
|
60835
60940
|
if (typeof document > "u") return null;
|
|
60836
60941
|
let t = document.cookie.split(";");
|
|
60837
60942
|
for (let n of t) {
|
|
@@ -60846,10 +60951,10 @@ var vW = _W, yW = (e) => e?.parts?.some((e) => {
|
|
|
60846
60951
|
}
|
|
60847
60952
|
}
|
|
60848
60953
|
return null;
|
|
60849
|
-
},
|
|
60954
|
+
}, jW = (e) => AW("chat-reasoning-effort") ?? e, MW = (e, t) => {
|
|
60850
60955
|
let n = h(e);
|
|
60851
|
-
return t && n.some((e) => e === t) ? t :
|
|
60852
|
-
},
|
|
60956
|
+
return t && n.some((e) => e === t) ? t : kW(e);
|
|
60957
|
+
}, NW = (e, t) => MW(e, jW(t)), PW = (e) => e instanceof pm || e instanceof Error && e.message ? e.message : "Something went wrong. Please try again.", FW = (e) => {
|
|
60853
60958
|
for (let t = e.length - 1; t >= 0; --t) {
|
|
60854
60959
|
let n = e[t];
|
|
60855
60960
|
if (!s(n)) {
|
|
@@ -60858,23 +60963,23 @@ var vW = _W, yW = (e) => e?.parts?.some((e) => {
|
|
|
60858
60963
|
}
|
|
60859
60964
|
}
|
|
60860
60965
|
return null;
|
|
60861
|
-
},
|
|
60966
|
+
}, IW = (e) => {
|
|
60862
60967
|
for (let t = e.length - 1; t >= 0; --t) {
|
|
60863
60968
|
let n = e[t];
|
|
60864
60969
|
if (n.role === "assistant" && l(n)) return n;
|
|
60865
60970
|
}
|
|
60866
60971
|
return null;
|
|
60867
|
-
},
|
|
60972
|
+
}, LW = (e) => {
|
|
60868
60973
|
let t = e.length;
|
|
60869
60974
|
for (; t > 0 && s(e[t - 1]);) --t;
|
|
60870
60975
|
return t === e.length ? e : e.slice(0, t);
|
|
60871
|
-
},
|
|
60976
|
+
}, RW = (e) => {
|
|
60872
60977
|
if (e?.role !== "assistant") return null;
|
|
60873
60978
|
for (let t of e.parts) {
|
|
60874
|
-
if (!
|
|
60979
|
+
if (!OW(t)) continue;
|
|
60875
60980
|
let e = t;
|
|
60876
60981
|
if (e.state !== "approval-responded") continue;
|
|
60877
|
-
let n =
|
|
60982
|
+
let n = OW(e.approval) ? e.approval : null;
|
|
60878
60983
|
if (!(n?.approved !== !0 || typeof n.id != "string")) return {
|
|
60879
60984
|
id: n.id,
|
|
60880
60985
|
reason: typeof n.reason == "string" ? n.reason : void 0
|
|
@@ -60882,15 +60987,15 @@ var vW = _W, yW = (e) => e?.parts?.some((e) => {
|
|
|
60882
60987
|
}
|
|
60883
60988
|
return null;
|
|
60884
60989
|
};
|
|
60885
|
-
function
|
|
60990
|
+
function zW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReasoningEffort: r, isReadonly: i, autoResume: a, chatModels: o, defaultChatModel: s, renderMessagePart: c, suggestedActions: l, title1: u, title2: h }) {
|
|
60886
60991
|
let { setDataStream: g, setWaitingStatus: _ } = ot(), { getChatPath: v } = Ze(), y = o && o.length > 0 ? o : f, b = p({
|
|
60887
60992
|
defaultChatModel: s,
|
|
60888
60993
|
models: y
|
|
60889
|
-
}), x = d(y).has(n) ? n : b, S =
|
|
60994
|
+
}), x = d(y).has(n) ? n : b, S = NW(x, r), [C, w] = z(""), [T, E] = z(x), D = R(T), [O, k] = z(S), A = R(O), [M, N] = z(null);
|
|
60890
60995
|
j(() => {
|
|
60891
60996
|
D.current = T;
|
|
60892
60997
|
}, [T]), j(() => {
|
|
60893
|
-
E(x), k(
|
|
60998
|
+
E(x), k(NW(x, r)), N(null), _(void 0);
|
|
60894
60999
|
}, [
|
|
60895
61000
|
e,
|
|
60896
61001
|
x,
|
|
@@ -60909,7 +61014,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60909
61014
|
api: "/api/rb/agents/chat",
|
|
60910
61015
|
fetch: Om,
|
|
60911
61016
|
prepareSendMessagesRequest(e) {
|
|
60912
|
-
let t = D.current, n = A.current, r = e.messages.at(-1), i = e.messages.at(-2), a = Cm(e.headers, xm()), o = r?.role !== "user" || r?.role === "user" &&
|
|
61017
|
+
let t = D.current, n = A.current, r = e.messages.at(-1), i = e.messages.at(-2), a = Cm(e.headers, xm()), o = r?.role !== "user" || r?.role === "user" && EW(i);
|
|
60913
61018
|
return {
|
|
60914
61019
|
...a ? { headers: a } : {},
|
|
60915
61020
|
body: {
|
|
@@ -60937,7 +61042,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60937
61042
|
g((t) => t ? [...t, e] : []);
|
|
60938
61043
|
},
|
|
60939
61044
|
onError: (e) => {
|
|
60940
|
-
let t =
|
|
61045
|
+
let t = PW(e);
|
|
60941
61046
|
N({ message: t }), le.error(t);
|
|
60942
61047
|
}
|
|
60943
61048
|
});
|
|
@@ -60945,7 +61050,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60945
61050
|
(L === "submitted" || L === "ready" || L === "error") && _(void 0);
|
|
60946
61051
|
}, [L, _]);
|
|
60947
61052
|
let B = (...e) => (N(null), re(), I(...e)), ae = (...e) => (N(null), re(), te(...e)), oe = () => {
|
|
60948
|
-
let e =
|
|
61053
|
+
let e = FW(P);
|
|
60949
61054
|
if (e) {
|
|
60950
61055
|
B({
|
|
60951
61056
|
messageId: e.id,
|
|
@@ -60955,11 +61060,11 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60955
61060
|
});
|
|
60956
61061
|
return;
|
|
60957
61062
|
}
|
|
60958
|
-
let t =
|
|
61063
|
+
let t = IW(P);
|
|
60959
61064
|
if (t) {
|
|
60960
|
-
let e =
|
|
61065
|
+
let e = RW(t);
|
|
60961
61066
|
if (e) {
|
|
60962
|
-
N(null), re(), F(
|
|
61067
|
+
N(null), re(), F(LW), ie({
|
|
60963
61068
|
id: e.id,
|
|
60964
61069
|
approved: !0,
|
|
60965
61070
|
reason: e.reason
|
|
@@ -60971,17 +61076,17 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60971
61076
|
}
|
|
60972
61077
|
ae();
|
|
60973
61078
|
}, ce = R(null), de = R("");
|
|
60974
|
-
j(() => ue(
|
|
60975
|
-
if (!
|
|
61079
|
+
j(() => ue(DW(e), (t) => {
|
|
61080
|
+
if (!OW(t) || t.chatId !== e) return;
|
|
60976
61081
|
let n = t.message;
|
|
60977
|
-
if (
|
|
61082
|
+
if (OW(n)) {
|
|
60978
61083
|
let e = typeof n.id == "string" ? n.id : null, t = typeof n.role == "string" ? n.role : null, r = Array.isArray(n.parts) ? n.parts : null;
|
|
60979
61084
|
if (e && t && r) {
|
|
60980
61085
|
let i = {
|
|
60981
61086
|
id: e,
|
|
60982
61087
|
role: t,
|
|
60983
61088
|
parts: r,
|
|
60984
|
-
metadata:
|
|
61089
|
+
metadata: OW(n.metadata) ? n.metadata : { createdAt: (/* @__PURE__ */ new Date()).toISOString() }
|
|
60985
61090
|
};
|
|
60986
61091
|
F((t) => {
|
|
60987
61092
|
let n = t.findIndex((t) => t.id === e);
|
|
@@ -60994,7 +61099,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
60994
61099
|
return;
|
|
60995
61100
|
}
|
|
60996
61101
|
let r = t.part;
|
|
60997
|
-
if (!
|
|
61102
|
+
if (!OW(r)) return;
|
|
60998
61103
|
if (r.type === "start" && typeof r.messageId == "string") {
|
|
60999
61104
|
ce.current = r.messageId, de.current = "";
|
|
61000
61105
|
return;
|
|
@@ -61053,7 +61158,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
61053
61158
|
className: "relative flex h-full min-h-0 min-w-0 overflow-hidden bg-background",
|
|
61054
61159
|
children: [/* @__PURE__ */ H("div", {
|
|
61055
61160
|
className: "overscroll-behavior-contain flex h-full min-h-0 min-w-0 flex-1 touch-pan-y flex-col bg-background",
|
|
61056
|
-
children: [/* @__PURE__ */ V(
|
|
61161
|
+
children: [/* @__PURE__ */ V(TW, {
|
|
61057
61162
|
addToolApprovalResponse: ie,
|
|
61058
61163
|
chatId: e,
|
|
61059
61164
|
conversationError: M,
|
|
@@ -61071,7 +61176,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
61071
61176
|
votes: he
|
|
61072
61177
|
}), /* @__PURE__ */ V("div", {
|
|
61073
61178
|
className: "sticky bottom-0 z-1 mx-auto flex w-full max-w-4xl gap-2 border-t-0 bg-background px-2 pb-3 md:px-4 md:pb-4",
|
|
61074
|
-
children: !i && /* @__PURE__ */ V(
|
|
61179
|
+
children: !i && /* @__PURE__ */ V(nW, {
|
|
61075
61180
|
attachments: W,
|
|
61076
61181
|
chatModels: y,
|
|
61077
61182
|
defaultChatModel: b,
|
|
@@ -61079,7 +61184,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
61079
61184
|
input: C,
|
|
61080
61185
|
messages: P,
|
|
61081
61186
|
onModelChange: (e) => {
|
|
61082
|
-
E(e), k(
|
|
61187
|
+
E(e), k(NW(e, r));
|
|
61083
61188
|
},
|
|
61084
61189
|
onOpenAIReasoningEffortChange: k,
|
|
61085
61190
|
openaiReasoningEffort: O,
|
|
@@ -61093,7 +61198,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
61093
61198
|
suggestedActions: l
|
|
61094
61199
|
})
|
|
61095
61200
|
})]
|
|
61096
|
-
}), /* @__PURE__ */ V(
|
|
61201
|
+
}), /* @__PURE__ */ V(bW, {
|
|
61097
61202
|
addToolApprovalResponse: ie,
|
|
61098
61203
|
attachments: W,
|
|
61099
61204
|
chatModels: y,
|
|
@@ -61118,7 +61223,7 @@ function MW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
|
|
|
61118
61223
|
}
|
|
61119
61224
|
//#endregion
|
|
61120
61225
|
//#region src/components/data-stream-handler.tsx
|
|
61121
|
-
function
|
|
61226
|
+
function BW() {
|
|
61122
61227
|
let { dataStream: e, setDataStream: t } = ot(), { artifact: n, setArtifact: r, setMetadata: i } = ES();
|
|
61123
61228
|
return j(() => {
|
|
61124
61229
|
if (!e?.length) return;
|
|
@@ -61126,7 +61231,7 @@ function NW() {
|
|
|
61126
61231
|
t([]);
|
|
61127
61232
|
for (let e of a) {
|
|
61128
61233
|
if (e.type === "data-chat-title") continue;
|
|
61129
|
-
let t =
|
|
61234
|
+
let t = vW.find((e) => e.kind === n.kind);
|
|
61130
61235
|
t?.onStreamPart && t.onStreamPart({
|
|
61131
61236
|
streamPart: e,
|
|
61132
61237
|
setArtifact: r,
|
|
@@ -61174,4 +61279,4 @@ function NW() {
|
|
|
61174
61279
|
]), null;
|
|
61175
61280
|
}
|
|
61176
61281
|
//#endregion
|
|
61177
|
-
export { gy as a, Sm as c, Xe as d, $e as f, Ze as h, Cy as i, bm as l, et as m,
|
|
61282
|
+
export { gy as a, Sm as c, Xe as d, $e as f, Ze as h, Cy as i, bm as l, et as m, zW as n, Mm as o, Qe as p, by as r, xm as s, BW as t, at as u };
|