react-semaphor 0.1.564 → 0.1.565
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/DATA_APP_SDK.md +3 -3
- package/README.md +2 -2
- package/dist/analytics-protocol/index.js +8 -8
- package/dist/assistant-context/index.js +3 -2
- package/dist/brand-studio/index.js +28 -29
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{assistant-chat-D1BEEHUF.js → assistant-chat-DNfb5fbF.js} +204 -204
- package/dist/chunks/{bookmark-impact-XOsVUAqW.js → bookmark-impact-CHr7b1J2.js} +2 -2
- package/dist/chunks/bookmark-state-ByODVqee.js +1613 -0
- package/dist/chunks/card-filter-builder-CcEcfaYz.js +4100 -0
- package/dist/chunks/{switch-BW4yXSYs.js → code-editor-DJNOsgJH.js} +463 -442
- package/dist/chunks/{comparison-window-caption-D1EUXzaR.js → comparison-window-caption-CMLb3mut.js} +451 -419
- package/dist/chunks/{dashboard-DfYsASNd.js → dashboard-CtIfxycc.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-D3mc6peE.js +4910 -0
- package/dist/chunks/{dashboard-controls-CJ8Dz50D.js → dashboard-controls-BFv0zdws.js} +692 -682
- package/dist/chunks/{dashboard-json-D3uZxGO-.js → dashboard-json-CXn_3OYb.js} +4 -4
- package/dist/chunks/{dates-EvDtT25n.js → dates-DcRxw17S.js} +12 -12
- package/dist/chunks/{edit-dashboard-visual-CgHJXBQv.js → edit-dashboard-visual-Y6HatqBd.js} +7704 -10337
- package/dist/chunks/filter-reach-copy-DbggA5B7.js +4673 -0
- package/dist/chunks/{filter-value-text-CPwFkrMz.js → filter-value-text-7zhmth1S.js} +2 -2
- package/dist/chunks/{index-CAgf2x4E.js → index-DDa_rklN.js} +68 -63
- package/dist/chunks/{layout-grid-BM65viQh.js → layout-grid-0hIlqEtk.js} +1 -1
- package/dist/chunks/{list-filter-BoeLBfL3.js → list-filter-DkgoCeBm.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-hEucouWM.js → matrix-analytical-definition-C9xB_T84.js} +18 -18
- package/dist/chunks/{matrix-card-CCh9JjP1.js → matrix-card-BSUeSXpD.js} +2 -2
- package/dist/chunks/{matrix-member-presentation-DsAUbuoL.js → matrix-member-presentation-DZNgQpUq.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-DsLdFdSa.js → matrix-operation-contract-Eb6elidS.js} +1 -1
- package/dist/chunks/{metric-comparison-Bnso1cm1.js → metric-comparison-ChXUFaZu.js} +1 -1
- package/dist/chunks/{palette-p1XSJFgB.js → palette-4vf2BEEg.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-B53jqszr.js → pivot-result-contract-expectations-Ddh1rNz5.js} +4 -4
- package/dist/chunks/{pivot-result-identity-Dq5jm-EC.js → pivot-result-identity-BlbLrqaC.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-DMqxSU4X.js → report-preferences-dialog-Db-b04B4.js} +122 -131
- package/dist/chunks/{report-runtime-context-BITkNSDa.js → report-runtime-context-DnA_PiKo.js} +1 -1
- package/dist/chunks/resolve-dashboard-input-context-C18J-YZC.js +21394 -0
- package/dist/chunks/{save-CHV1B1fL.js → save-D6pHmSSP.js} +1 -1
- package/dist/chunks/saved-dashboard-context-DhC_EVus.js +629 -0
- package/dist/chunks/{selection-reducer-Bz5aywT4.js → selection-reducer-OaJ-N5uN.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-CFeCIuaw.js → semaphor-ready-indicator-T6TsiBMT.js} +80634 -80503
- package/dist/chunks/{shelf-drop-preview-context-cEyVkKTF.js → shelf-drop-preview-context-CNWL_b0S.js} +407 -407
- package/dist/chunks/{source-entity-resolution-DdDVXFB8.js → source-entity-resolution-DF6GulDn.js} +1 -1
- package/dist/chunks/stored-dashboard-IdmtrNkA.js +5026 -0
- package/dist/chunks/{table-export-sheet-bSXxGn-v.js → table-export-sheet--DUKWk6o.js} +1 -1
- package/dist/chunks/{temporal-input-presentation-sk9gqLi6.js → temporal-input-presentation--2r9BLr0.js} +392 -377
- package/dist/chunks/{token-types-BUK06hU2.js → token-types-C8JymO8s.js} +1 -1
- package/dist/chunks/{upload-BnmuyPqW.js → upload-Cf3wXZT8.js} +1 -1
- package/dist/chunks/{validators-BIM0FE31.js → validators-wtjw0aw6.js} +7 -7
- package/dist/chunks/variable-draft-3xseULxR.js +241 -0
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2206 -1705
- package/dist/data-app-sdk/index.js +4 -4
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.js +5 -5
- package/dist/format-utils/index.js +174 -167
- package/dist/index.js +189 -187
- package/dist/pdf-export-policy/index.js +80 -28
- package/dist/pdf-table-layout/index.js +65 -65
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/components/dashboard-variables/data-variables-menu.d.ts +8 -0
- package/dist/types/components/dashboard-variables/variable-editor-host.d.ts +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/build-normalized-dashboard-inputs.d.ts +62 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +33 -2
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +4 -2
- package/dist/types/lib/dashboard-variables/data-text.d.ts +33 -0
- package/dist/types/lib/dashboard-variables/types.d.ts +207 -0
- package/dist/types/lib/document/document-edits.d.ts +16 -1
- package/dist/types/lib/document/document-panel-target.d.ts +1 -1
- package/dist/types/lib/document/document-section-query-options.d.ts +29 -0
- package/dist/types/lib/document/document-table-data-policy.d.ts +0 -1
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +92 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +6 -0
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +1 -0
- package/dist/types/lib/query-context/use-semantic-execution-payload-for-cards.d.ts +24 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +36 -0
- package/dist/types/lib/text-variables/temporal-input-text.d.ts +28 -0
- package/dist/types/lib/text-variables/text-variable-types.d.ts +72 -0
- package/dist/types/lib/types/common-types.d.ts +155 -51
- package/dist/types/lib/utils/card-definition.d.ts +2 -2
- package/dist/types/shared/assistant-context/index.d.ts +1 -1
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +51 -1
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +1087 -430
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +40 -40
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/dashboard-filter-targets.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +7 -4
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +159 -0
- package/dist/types/shared/dashboard-authoring/dashboard-variable-changes.d.ts +61 -0
- package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +50 -3
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +48 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/text-card-words/blocks.d.ts +87 -13
- package/dist/types/shared/dashboard-authoring/text-card-words/chip-colors.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/text-card-words/index.d.ts +90 -8
- package/dist/types/shared/dashboard-authoring/text-card-words/rich-content.d.ts +31 -3
- package/dist/types/shared/dashboard-authoring/text-card-words/variable-words.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/variable-editability.d.ts +24 -0
- package/dist/types/shared/dashboard-authoring/variable-references.d.ts +39 -0
- package/dist/types/shared/format-utils/document-print.d.ts +4 -2
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/pdf-capacity-lines.d.ts +17 -0
- package/dist/types/shared/format-utils/pdf-delivery.d.ts +8 -1
- package/dist/types/shared/format-utils/pdf-export-policy.d.ts +74 -6
- package/dist/types/shared/format-utils/presentation-execution.d.ts +9 -0
- package/package.json +2 -2
- package/src/data-app-sdk/README.md +3 -3
- package/dist/chunks/bookmark-state-CWeoGbrx.js +0 -743
- package/dist/chunks/braces-DzgoQC64.js +0 -23
- package/dist/chunks/dashboard-briefing-launcher-lvYfJoUQ.js +0 -3878
- package/dist/chunks/filter-reach-copy-Cmb05jlE.js +0 -3965
- package/dist/chunks/global-date-filter-utils-ruJYwjgZ.js +0 -16733
- package/dist/chunks/resolve-dashboard-input-context-i_jCSYae.js +0 -8214
- package/dist/chunks/saved-dashboard-context-Dg3oDmH_.js +0 -564
- package/dist/chunks/use-create-flow-overlay-state-Dl6DCxh8.js +0 -1436
|
@@ -5,26 +5,26 @@ var Or = (e, t, r) => t.has(e) || $r("Cannot " + r);
|
|
|
5
5
|
var L = (e, t, r) => (Or(e, t, "read from private field"), r ? r.call(e) : t.get(e)), me = (e, t, r) => t.has(e) ? $r("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), ee = (e, t, r, n) => (Or(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
|
|
6
6
|
import { jsx as p, jsxs as k, Fragment as Le } from "react/jsx-runtime";
|
|
7
7
|
import { useCallback as te, useRef as ie, useMemo as it, useEffect as ke, useState as D, useLayoutEffect as Ue, useId as As } from "react";
|
|
8
|
-
import { u as X,
|
|
9
|
-
import { c as qe, B as
|
|
8
|
+
import { u as X, e6 as Cs, aW as $s, be as Os, Y as zs, e7 as Ms, e8 as Ps, Z as zr, aT as Rs, e9 as Zs, bT as js, b9 as Ds, ea as dr, dm as Fs, eb as Ls, ec as Mt, ed as Cn, ee as Us, bN as Pt, c9 as Mr, ef as $n, $ as Bs, c3 as On, bh as Vs, bY as qs, bM as zn, dQ as Mn, eg as Js, cw as Ws, bn as Ks, eh as Gs, ei as Ys, ej as Hs, c6 as Qs, c7 as Xs, dn as eo, c8 as to, ce as ro, ek as no, bV as Lt, cd as ao, ci as so, bX as Pn, aR as Rn, aU as oo, b8 as xt, aP as Zn, el as io, em as lo, en as co, eo as uo, a6 as jn, ep as po } from "./semaphor-ready-indicator-T6TsiBMT.js";
|
|
9
|
+
import { c as qe, B as Y, X as lt, k as Dn, l as fo, e as mt, L as Be, I as Fn, R as Ln, P as Un, a as Bn, d as Vn } from "./code-editor-DJNOsgJH.js";
|
|
10
10
|
import "./index-CuHybtft.js";
|
|
11
|
-
import "./validators-
|
|
12
|
-
import "./matrix-operation-contract-
|
|
11
|
+
import "./validators-wtjw0aw6.js";
|
|
12
|
+
import "./matrix-operation-contract-Eb6elidS.js";
|
|
13
13
|
import "./analytics-base-schemas-BaIQrEzX.js";
|
|
14
14
|
import "zod";
|
|
15
15
|
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as mo } from "../value-format-preferences/index.js";
|
|
16
16
|
import { g as ho, c as B } from "./_commonjsHelpers-DimLPMtv.js";
|
|
17
|
-
import {
|
|
17
|
+
import { ay as go } from "./bookmark-state-ByODVqee.js";
|
|
18
18
|
import { l as bo, m as ct, c as Xt, A as et, d as qn } from "./context-R31TSL5V.js";
|
|
19
|
-
import { p as Pr, a as vo, A as Jn } from "./saved-dashboard-context-
|
|
20
|
-
import {
|
|
21
|
-
import { o as
|
|
22
|
-
import {
|
|
23
|
-
import { w as Io, c as
|
|
19
|
+
import { p as Pr, a as vo, A as Jn } from "./saved-dashboard-context-DhC_EVus.js";
|
|
20
|
+
import { gp as yo, o as xo, g1 as Rr } from "./resolve-dashboard-input-context-C18J-YZC.js";
|
|
21
|
+
import { o as Wn, p as wo } from "./report-preferences-dialog-Db-b04B4.js";
|
|
22
|
+
import { m as _o } from "./stored-dashboard-IdmtrNkA.js";
|
|
23
|
+
import { w as Io, c as Kn } from "./visual-choice-JiJ-_3bi.js";
|
|
24
24
|
import { m as So, v as Gn, t as No, n as ko, k as ve, d as Eo, b as To, l as pr, w as Ao, h as Co, s as er, f as $o, a as Oo } from "./model-change-T1cRkh3m.js";
|
|
25
|
-
import {
|
|
26
|
-
import { L as Fo } from "./list-filter-
|
|
27
|
-
import { L as Ur } from "./layout-grid-
|
|
25
|
+
import { aL as zo, aM as Mo, aN as Po, aO as wt, aP as Ro, aQ as Zr, aR as jr, aS as Dr, aT as Fr, aU as Lr, aV as Zo, ad as jo, ab as Do } from "./temporal-input-presentation--2r9BLr0.js";
|
|
26
|
+
import { L as Fo } from "./list-filter-DkgoCeBm.js";
|
|
27
|
+
import { L as Ur } from "./layout-grid-0hIlqEtk.js";
|
|
28
28
|
function Lo(e, t, r) {
|
|
29
29
|
const n = zo(), a = (r == null ? void 0 : r.locale) ?? n.locale ?? Mo, s = Po(e, t);
|
|
30
30
|
if (isNaN(s))
|
|
@@ -112,7 +112,7 @@ const Jo = qe("ListTree", [
|
|
|
112
112
|
* This source code is licensed under the ISC license.
|
|
113
113
|
* See the LICENSE file in the root directory of this source tree.
|
|
114
114
|
*/
|
|
115
|
-
const
|
|
115
|
+
const Wo = qe("PanelLeft", [
|
|
116
116
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
117
117
|
["path", { d: "M9 3v18", key: "fh3hqa" }]
|
|
118
118
|
]);
|
|
@@ -122,7 +122,7 @@ const Ko = qe("PanelLeft", [
|
|
|
122
122
|
* This source code is licensed under the ISC license.
|
|
123
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
124
|
*/
|
|
125
|
-
const
|
|
125
|
+
const Yn = qe("PanelRight", [
|
|
126
126
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
127
127
|
["path", { d: "M15 3v18", key: "14nvp0" }]
|
|
128
128
|
]);
|
|
@@ -132,12 +132,12 @@ const Hn = qe("PanelRight", [
|
|
|
132
132
|
* This source code is licensed under the ISC license.
|
|
133
133
|
* See the LICENSE file in the root directory of this source tree.
|
|
134
134
|
*/
|
|
135
|
-
const
|
|
135
|
+
const Ko = qe("Route", [
|
|
136
136
|
["circle", { cx: "6", cy: "19", r: "3", key: "1kj8tv" }],
|
|
137
137
|
["path", { d: "M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15", key: "1d8sl" }],
|
|
138
138
|
["circle", { cx: "18", cy: "5", r: "3", key: "gq8acd" }]
|
|
139
139
|
]);
|
|
140
|
-
class
|
|
140
|
+
class Hn extends Error {
|
|
141
141
|
constructor() {
|
|
142
142
|
super("The dashboard is still loading."), this.name = "AssistantContextNotReadyError";
|
|
143
143
|
}
|
|
@@ -150,7 +150,7 @@ function Go(e = "dashboard") {
|
|
|
150
150
|
} : ({ focus: r, snapshot: n, editing: a }) => {
|
|
151
151
|
var I;
|
|
152
152
|
const s = X.getState(), o = (I = s.reportContext) == null ? void 0 : I.calendar;
|
|
153
|
-
if (!o) throw new
|
|
153
|
+
if (!o) throw new Hn();
|
|
154
154
|
const c = a ? a.card.id : r == null ? void 0 : r.cardId, f = c ? (n == null ? void 0 : n.cardId) === c && n.draft === !!a && (!a || n.card === a.card) ? n.snapshot : "pending" : void 0, i = {
|
|
155
155
|
surface: "dashboard",
|
|
156
156
|
dashboard: s.dashboard,
|
|
@@ -193,8 +193,8 @@ function Go(e = "dashboard") {
|
|
|
193
193
|
function Br(e, t) {
|
|
194
194
|
return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
const { canChange: t, canChangeNow: r } =
|
|
196
|
+
function Yo(e) {
|
|
197
|
+
const { canChange: t, canChangeNow: r } = Wn(e.surface === "dashboard"), n = X((i) => {
|
|
198
198
|
var u, m;
|
|
199
199
|
const g = (m = (u = i.dashboard) == null ? void 0 : u.sheets) == null ? void 0 : m.find((w) => w.id === i.selectedSheetId);
|
|
200
200
|
return !!g && !xo(g);
|
|
@@ -204,8 +204,8 @@ function Ho(e) {
|
|
|
204
204
|
var T, O;
|
|
205
205
|
const u = X.getState(), m = (T = u.dashboard) == null ? void 0 : T.id, w = u.selectedSheetId;
|
|
206
206
|
if (!m || !w) throw new at(Ut);
|
|
207
|
-
const I = { title: i.title, type: So[g], ...i.card }, E = !Qo({ ...I, id: "check" }, i, g), _ = { ...I, ...E ? { type: "table" } : {}, id: Rr() }, x = { id: Rr(), cards: [_], activeCardId: _.id }, y = await o(x, { reuseLoaded: !0 }).catch((
|
|
208
|
-
console.warn("Adding the result without refreshed semantic metadata:",
|
|
207
|
+
const I = { title: i.title, type: So[g], ...i.card }, E = !Qo({ ...I, id: "check" }, i, g), _ = { ...I, ...E ? { type: "table" } : {}, id: Rr() }, x = { id: Rr(), cards: [_], activeCardId: _.id }, y = await o(x, { reuseLoaded: !0 }).catch((W) => {
|
|
208
|
+
console.warn("Adding the result without refreshed semantic metadata:", W);
|
|
209
209
|
}), h = structuredClone(X.getState().semanticExecutionPayload);
|
|
210
210
|
zs(h, y);
|
|
211
211
|
const d = Io(
|
|
@@ -214,7 +214,7 @@ function Ho(e) {
|
|
|
214
214
|
), v = d === (_.config ?? {}) ? x : { ...x, cards: [{ ..._, config: d }] }, b = X.getState();
|
|
215
215
|
if (((O = b.dashboard) == null ? void 0 : O.id) !== m || b.selectedSheetId !== w || b.isVisualEditing)
|
|
216
216
|
throw new at(Ut);
|
|
217
|
-
if (!r()) throw new at(
|
|
217
|
+
if (!r()) throw new at(Ho);
|
|
218
218
|
const { actions: N } = b;
|
|
219
219
|
if (N.setIsDashboardEditing(!0), N.addFrame(w, v, { semanticExecutionPayload: y }), !Qn(X.getState().dashboard, v.id))
|
|
220
220
|
throw b.isDashboardEditing || N.setIsDashboardEditing(!1), new at(Ut);
|
|
@@ -223,10 +223,10 @@ function Ho(e) {
|
|
|
223
223
|
[r, o, s]
|
|
224
224
|
), available: t && n && !a };
|
|
225
225
|
}
|
|
226
|
-
const Ut = "The dashboard changed while this was being added. Try again.",
|
|
226
|
+
const Ut = "The dashboard changed while this was being added. Try again.", Ho = "Changes to this dashboard can't be saved here, so the card wasn't added.";
|
|
227
227
|
function Qo(e, t, r) {
|
|
228
228
|
if (r !== "line" && r !== "bar" && r !== "stackedBar") return !0;
|
|
229
|
-
const n =
|
|
229
|
+
const n = Kn(Gn(t), r);
|
|
230
230
|
if (!n.ok) return !1;
|
|
231
231
|
const { x: a, y: s = [], series: o } = n.visual.encodings, c = Ms({ card: e, cardType: e.type, records: t.records }), f = (i, g, u) => JSON.stringify([i, g ?? null, [...u].sort()]);
|
|
232
232
|
return f(c.axisKeys, c.seriesKey, c.valueKeys) === f(a ? [a] : [], o, s);
|
|
@@ -765,10 +765,10 @@ function Sa(e) {
|
|
|
765
765
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
766
766
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function Wi(e) {
|
|
769
769
|
return new RegExp(`^${Sa(e)}$`);
|
|
770
770
|
}
|
|
771
|
-
function
|
|
771
|
+
function Ki(e) {
|
|
772
772
|
const t = Sa({ precision: e.precision }), r = ["Z"];
|
|
773
773
|
e.local && r.push(""), e.offset && r.push("([+-]\\d{2}:\\d{2})");
|
|
774
774
|
const n = `${t}(?:${r.join("|")})`;
|
|
@@ -777,7 +777,7 @@ function Wi(e) {
|
|
|
777
777
|
const Gi = (e) => {
|
|
778
778
|
const t = e ? `[\\s\\S]{${(e == null ? void 0 : e.minimum) ?? 0},${(e == null ? void 0 : e.maximum) ?? ""}}` : "[\\s\\S]*";
|
|
779
779
|
return new RegExp(`^${t}$`);
|
|
780
|
-
},
|
|
780
|
+
}, Yi = /^\d+$/, Hi = /^-?\d+(?:\.\d+)?/i, Qi = /true|false/i, Xi = /null/i, el = /^[^A-Z]*$/, tl = /^[^a-z]*$/, le = /* @__PURE__ */ S("$ZodCheck", (e, t) => {
|
|
781
781
|
var r;
|
|
782
782
|
e._zod ?? (e._zod = {}), e._zod.def = t, (r = e._zod).onattach ?? (r.onattach = []);
|
|
783
783
|
}), Na = {
|
|
@@ -840,7 +840,7 @@ const Gi = (e) => {
|
|
|
840
840
|
const r = (o = t.format) == null ? void 0 : o.includes("int"), n = r ? "int" : "number", [a, s] = hi[t.format];
|
|
841
841
|
e._zod.onattach.push((c) => {
|
|
842
842
|
const f = c._zod.bag;
|
|
843
|
-
f.format = t.format, f.minimum = a, f.maximum = s, r && (f.pattern =
|
|
843
|
+
f.format = t.format, f.minimum = a, f.maximum = s, r && (f.pattern = Yi);
|
|
844
844
|
}), e._zod.check = (c) => {
|
|
845
845
|
const f = c.value;
|
|
846
846
|
if (r) {
|
|
@@ -1225,11 +1225,11 @@ const hl = {
|
|
|
1225
1225
|
}), kl = /* @__PURE__ */ S("$ZodKSUID", (e, t) => {
|
|
1226
1226
|
t.pattern ?? (t.pattern = Oi), V.init(e, t);
|
|
1227
1227
|
}), El = /* @__PURE__ */ S("$ZodISODateTime", (e, t) => {
|
|
1228
|
-
t.pattern ?? (t.pattern =
|
|
1228
|
+
t.pattern ?? (t.pattern = Ki(t)), V.init(e, t);
|
|
1229
1229
|
}), Tl = /* @__PURE__ */ S("$ZodISODate", (e, t) => {
|
|
1230
1230
|
t.pattern ?? (t.pattern = Ji), V.init(e, t);
|
|
1231
1231
|
}), Al = /* @__PURE__ */ S("$ZodISOTime", (e, t) => {
|
|
1232
|
-
t.pattern ?? (t.pattern =
|
|
1232
|
+
t.pattern ?? (t.pattern = Wi(t)), V.init(e, t);
|
|
1233
1233
|
}), Cl = /* @__PURE__ */ S("$ZodISODuration", (e, t) => {
|
|
1234
1234
|
t.pattern ?? (t.pattern = Mi), V.init(e, t);
|
|
1235
1235
|
}), $l = /* @__PURE__ */ S("$ZodIPv4", (e, t) => {
|
|
@@ -1349,7 +1349,7 @@ const Fl = /* @__PURE__ */ S("$ZodJWT", (e, t) => {
|
|
|
1349
1349
|
});
|
|
1350
1350
|
};
|
|
1351
1351
|
}), Aa = /* @__PURE__ */ S("$ZodNumber", (e, t) => {
|
|
1352
|
-
U.init(e, t), e._zod.pattern = e._zod.bag.pattern ??
|
|
1352
|
+
U.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? Hi, e._zod.parse = (r, n) => {
|
|
1353
1353
|
if (t.coerce)
|
|
1354
1354
|
try {
|
|
1355
1355
|
r.value = Number(r.value);
|
|
@@ -1404,7 +1404,7 @@ const Fl = /* @__PURE__ */ S("$ZodJWT", (e, t) => {
|
|
|
1404
1404
|
inst: e
|
|
1405
1405
|
}), r);
|
|
1406
1406
|
});
|
|
1407
|
-
function
|
|
1407
|
+
function Wr(e, t, r) {
|
|
1408
1408
|
e.issues.length && t.issues.push(...Re(r, e.issues)), t.value[r] = e.value;
|
|
1409
1409
|
}
|
|
1410
1410
|
const Jl = /* @__PURE__ */ S("$ZodArray", (e, t) => {
|
|
@@ -1424,7 +1424,7 @@ const Jl = /* @__PURE__ */ S("$ZodArray", (e, t) => {
|
|
|
1424
1424
|
value: c,
|
|
1425
1425
|
issues: []
|
|
1426
1426
|
}, n);
|
|
1427
|
-
f instanceof Promise ? s.push(f.then((i) =>
|
|
1427
|
+
f instanceof Promise ? s.push(f.then((i) => Wr(i, r, o))) : Wr(f, r, o);
|
|
1428
1428
|
}
|
|
1429
1429
|
return s.length ? Promise.all(s).then(() => r) : r;
|
|
1430
1430
|
};
|
|
@@ -1432,10 +1432,10 @@ const Jl = /* @__PURE__ */ S("$ZodArray", (e, t) => {
|
|
|
1432
1432
|
function It(e, t, r) {
|
|
1433
1433
|
e.issues.length && t.issues.push(...Re(r, e.issues)), t.value[r] = e.value;
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1435
|
+
function Kr(e, t, r, n) {
|
|
1436
1436
|
e.issues.length ? n[r] === void 0 ? r in n ? t.value[r] = void 0 : t.value[r] = e.value : t.issues.push(...Re(r, e.issues)) : e.value === void 0 ? r in n && (t.value[r] = void 0) : t.value[r] = e.value;
|
|
1437
1437
|
}
|
|
1438
|
-
const
|
|
1438
|
+
const Wl = /* @__PURE__ */ S("$ZodObject", (e, t) => {
|
|
1439
1439
|
U.init(e, t);
|
|
1440
1440
|
const r = fr(() => {
|
|
1441
1441
|
const u = Object.keys(t.shape);
|
|
@@ -1532,7 +1532,7 @@ const Kl = /* @__PURE__ */ S("$ZodObject", (e, t) => {
|
|
|
1532
1532
|
const h = g.shape;
|
|
1533
1533
|
for (const d of g.keys) {
|
|
1534
1534
|
const v = h[d], b = v._zod.run({ value: w[d], issues: [] }, m), N = v._zod.optin === "optional" && v._zod.optout === "optional";
|
|
1535
|
-
b instanceof Promise ? I.push(b.then((T) => N ?
|
|
1535
|
+
b instanceof Promise ? I.push(b.then((T) => N ? Kr(T, u, d, w) : It(T, u, d))) : N ? Kr(b, u, d, w) : It(b, u, d);
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
1538
|
if (!i)
|
|
@@ -1594,7 +1594,7 @@ const Ca = /* @__PURE__ */ S("$ZodUnion", (e, t) => {
|
|
|
1594
1594
|
}
|
|
1595
1595
|
return a ? Promise.all(s).then((o) => Gr(o, r, e, n)) : Gr(s, r, e, n);
|
|
1596
1596
|
};
|
|
1597
|
-
}),
|
|
1597
|
+
}), Kl = /* @__PURE__ */ S("$ZodDiscriminatedUnion", (e, t) => {
|
|
1598
1598
|
Ca.init(e, t);
|
|
1599
1599
|
const r = e._zod.parse;
|
|
1600
1600
|
j(e._zod, "propValues", () => {
|
|
@@ -1647,7 +1647,7 @@ const Ca = /* @__PURE__ */ S("$ZodUnion", (e, t) => {
|
|
|
1647
1647
|
}), Gl = /* @__PURE__ */ S("$ZodIntersection", (e, t) => {
|
|
1648
1648
|
U.init(e, t), e._zod.parse = (r, n) => {
|
|
1649
1649
|
const a = r.value, s = t.left._zod.run({ value: a, issues: [] }, n), o = t.right._zod.run({ value: a, issues: [] }, n);
|
|
1650
|
-
return s instanceof Promise || o instanceof Promise ? Promise.all([s, o]).then(([f, i]) =>
|
|
1650
|
+
return s instanceof Promise || o instanceof Promise ? Promise.all([s, o]).then(([f, i]) => Yr(r, f, i)) : Yr(r, s, o);
|
|
1651
1651
|
};
|
|
1652
1652
|
});
|
|
1653
1653
|
function rr(e, t) {
|
|
@@ -1685,7 +1685,7 @@ function rr(e, t) {
|
|
|
1685
1685
|
}
|
|
1686
1686
|
return { valid: !1, mergeErrorPath: [] };
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1688
|
+
function Yr(e, t, r) {
|
|
1689
1689
|
if (t.issues.length && e.issues.push(...t.issues), r.issues.length && e.issues.push(...r.issues), ot(e))
|
|
1690
1690
|
return e;
|
|
1691
1691
|
const n = rr(t.value, r.value);
|
|
@@ -1693,7 +1693,7 @@ function Hr(e, t, r) {
|
|
|
1693
1693
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);
|
|
1694
1694
|
return e.value = n.data, e;
|
|
1695
1695
|
}
|
|
1696
|
-
const
|
|
1696
|
+
const Yl = /* @__PURE__ */ S("$ZodRecord", (e, t) => {
|
|
1697
1697
|
U.init(e, t), e._zod.parse = (r, n) => {
|
|
1698
1698
|
const a = r.value;
|
|
1699
1699
|
if (!Ct(a))
|
|
@@ -1750,7 +1750,7 @@ const Hl = /* @__PURE__ */ S("$ZodRecord", (e, t) => {
|
|
|
1750
1750
|
}
|
|
1751
1751
|
return s.length ? Promise.all(s).then(() => r) : r;
|
|
1752
1752
|
};
|
|
1753
|
-
}),
|
|
1753
|
+
}), Hl = /* @__PURE__ */ S("$ZodEnum", (e, t) => {
|
|
1754
1754
|
U.init(e, t);
|
|
1755
1755
|
const r = ha(t.entries);
|
|
1756
1756
|
e._zod.values = new Set(r), e._zod.pattern = new RegExp(`^(${r.filter((n) => fi.has(typeof n)).map((n) => typeof n == "string" ? ht(n) : n.toString()).join("|")})$`), e._zod.parse = (n, a) => {
|
|
@@ -1796,10 +1796,10 @@ const Hl = /* @__PURE__ */ S("$ZodRecord", (e, t) => {
|
|
|
1796
1796
|
if (r.value === void 0)
|
|
1797
1797
|
return r.value = t.defaultValue, r;
|
|
1798
1798
|
const a = t.innerType._zod.run(r, n);
|
|
1799
|
-
return a instanceof Promise ? a.then((s) =>
|
|
1799
|
+
return a instanceof Promise ? a.then((s) => Hr(s, t)) : Hr(a, t);
|
|
1800
1800
|
};
|
|
1801
1801
|
});
|
|
1802
|
-
function
|
|
1802
|
+
function Hr(e, t) {
|
|
1803
1803
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1804
1804
|
}
|
|
1805
1805
|
const nc = /* @__PURE__ */ S("$ZodPrefault", (e, t) => {
|
|
@@ -2289,7 +2289,7 @@ function Jc(e, t) {
|
|
|
2289
2289
|
includes: e
|
|
2290
2290
|
});
|
|
2291
2291
|
}
|
|
2292
|
-
function
|
|
2292
|
+
function Wc(e, t) {
|
|
2293
2293
|
return new dl({
|
|
2294
2294
|
check: "string_format",
|
|
2295
2295
|
format: "starts_with",
|
|
@@ -2297,7 +2297,7 @@ function Kc(e, t) {
|
|
|
2297
2297
|
prefix: e
|
|
2298
2298
|
});
|
|
2299
2299
|
}
|
|
2300
|
-
function
|
|
2300
|
+
function Kc(e, t) {
|
|
2301
2301
|
return new pl({
|
|
2302
2302
|
check: "string_format",
|
|
2303
2303
|
format: "ends_with",
|
|
@@ -2314,10 +2314,10 @@ function gt(e) {
|
|
|
2314
2314
|
function Gc(e) {
|
|
2315
2315
|
return gt((t) => t.normalize(e));
|
|
2316
2316
|
}
|
|
2317
|
-
function
|
|
2317
|
+
function Yc() {
|
|
2318
2318
|
return gt((e) => e.trim());
|
|
2319
2319
|
}
|
|
2320
|
-
function
|
|
2320
|
+
function Hc() {
|
|
2321
2321
|
return gt((e) => e.toLowerCase());
|
|
2322
2322
|
}
|
|
2323
2323
|
function Qc() {
|
|
@@ -2921,7 +2921,7 @@ const du = (e, t) => {
|
|
|
2921
2921
|
]
|
|
2922
2922
|
}
|
|
2923
2923
|
// { parent: true }
|
|
2924
|
-
), e.clone = (r, n) => Je(e, r, n), e.brand = () => e, e.register = (r, n) => (r.add(e, n), e), e.parse = (r, n) => pu(e, r, n, { callee: e.parse }), e.safeParse = (r, n) => mu(e, r, n), e.parseAsync = async (r, n) => fu(e, r, n, { callee: e.parseAsync }), e.safeParseAsync = async (r, n) => Ma(e, r, n), e.spa = e.safeParseAsync, e.refine = (r, n) => e.check(gd(r, n)), e.superRefine = (r) => e.check(bd(r)), e.overwrite = (r) => e.check(gt(r)), e.optional = () => un(e), e.nullable = () => dn(e), e.nullish = () => un(dn(e)), e.nonoptional = (r) => od(e, r), e.array = () => ja(e), e.or = (r) => La([e, r]), e.and = (r) =>
|
|
2924
|
+
), e.clone = (r, n) => Je(e, r, n), e.brand = () => e, e.register = (r, n) => (r.add(e, n), e), e.parse = (r, n) => pu(e, r, n, { callee: e.parse }), e.safeParse = (r, n) => mu(e, r, n), e.parseAsync = async (r, n) => fu(e, r, n, { callee: e.parseAsync }), e.safeParseAsync = async (r, n) => Ma(e, r, n), e.spa = e.safeParseAsync, e.refine = (r, n) => e.check(gd(r, n)), e.superRefine = (r) => e.check(bd(r)), e.overwrite = (r) => e.check(gt(r)), e.optional = () => un(e), e.nullable = () => dn(e), e.nullish = () => un(dn(e)), e.nonoptional = (r) => od(e, r), e.array = () => ja(e), e.or = (r) => La([e, r]), e.and = (r) => Ku(e, r), e.transform = (r) => pn(e, ed(r)), e.default = (r) => nd(e, r), e.prefault = (r) => sd(e, r), e.catch = (r) => ld(e, r), e.pipe = (r) => pn(e, r), e.readonly = () => dd(e), e.describe = (r) => {
|
|
2925
2925
|
const n = e.clone();
|
|
2926
2926
|
return st.add(n, { description: r }), n;
|
|
2927
2927
|
}, Object.defineProperty(e, "description", {
|
|
@@ -2938,7 +2938,7 @@ const du = (e, t) => {
|
|
|
2938
2938
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Pa = /* @__PURE__ */ S("_ZodString", (e, t) => {
|
|
2939
2939
|
br.init(e, t), q.init(e, t);
|
|
2940
2940
|
const r = e._zod.bag;
|
|
2941
|
-
e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(Bc(...n)), e.includes = (...n) => e.check(Jc(...n)), e.startsWith = (...n) => e.check(
|
|
2941
|
+
e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(Bc(...n)), e.includes = (...n) => e.check(Jc(...n)), e.startsWith = (...n) => e.check(Wc(...n)), e.endsWith = (...n) => e.check(Kc(...n)), e.min = (...n) => e.check($t(...n)), e.max = (...n) => e.check(Oa(...n)), e.length = (...n) => e.check(za(...n)), e.nonempty = (...n) => e.check($t(1, ...n)), e.lowercase = (n) => e.check(Vc(n)), e.uppercase = (n) => e.check(qc(n)), e.trim = () => e.check(Yc()), e.normalize = (...n) => e.check(Gc(...n)), e.toLowerCase = () => e.check(Hc()), e.toUpperCase = () => e.check(Qc());
|
|
2942
2942
|
}), hu = /* @__PURE__ */ S("ZodString", (e, t) => {
|
|
2943
2943
|
br.init(e, t), Pa.init(e, t), e.email = (r) => e.check(pc(bu, r)), e.url = (r) => e.check(bc(vu, r)), e.jwt = (r) => e.check(Oc(zu, r)), e.emoji = (r) => e.check(vc(yu, r)), e.guid = (r) => e.check(rn(ln, r)), e.uuid = (r) => e.check(fc(St, r)), e.uuidv4 = (r) => e.check(mc(St, r)), e.uuidv6 = (r) => e.check(hc(St, r)), e.uuidv7 = (r) => e.check(gc(St, r)), e.nanoid = (r) => e.check(yc(xu, r)), e.guid = (r) => e.check(rn(ln, r)), e.cuid = (r) => e.check(xc(wu, r)), e.cuid2 = (r) => e.check(wc(_u, r)), e.ulid = (r) => e.check(_c(Iu, r)), e.base64 = (r) => e.check(Ac(Cu, r)), e.base64url = (r) => e.check(Cc($u, r)), e.xid = (r) => e.check(Ic(Su, r)), e.ksuid = (r) => e.check(Sc(Nu, r)), e.ipv4 = (r) => e.check(Nc(ku, r)), e.ipv6 = (r) => e.check(kc(Eu, r)), e.cidrv4 = (r) => e.check(Ec(Tu, r)), e.cidrv6 = (r) => e.check(Tc(Au, r)), e.e164 = (r) => e.check($c(Ou, r)), e.datetime = (r) => e.check(au(r)), e.date = (r) => e.check(ou(r)), e.time = (r) => e.check(lu(r)), e.duration = (r) => e.check(uu(r));
|
|
2944
2944
|
});
|
|
@@ -3030,7 +3030,7 @@ function ja(e, t) {
|
|
|
3030
3030
|
return Xc(Uu, e, t);
|
|
3031
3031
|
}
|
|
3032
3032
|
const Da = /* @__PURE__ */ S("ZodObject", (e, t) => {
|
|
3033
|
-
|
|
3033
|
+
Wl.init(e, t), q.init(e, t), j(e, "shape", () => t.shape), e.keyof = () => Ua(Object.keys(e._zod.def.shape)), e.catchall = (r) => e.clone({ ...e._zod.def, catchall: r }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Ot() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Ot() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Za() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (r) => vi(e, r), e.merge = (r) => yi(e, r), e.pick = (r) => gi(e, r), e.omit = (r) => bi(e, r), e.partial = (...r) => xi(Ba, e, r[0]), e.required = (...r) => wi(Va, e, r[0]);
|
|
3034
3034
|
});
|
|
3035
3035
|
function Bu(e, t) {
|
|
3036
3036
|
const r = {
|
|
@@ -3063,7 +3063,7 @@ function La(e, t) {
|
|
|
3063
3063
|
});
|
|
3064
3064
|
}
|
|
3065
3065
|
const qu = /* @__PURE__ */ S("ZodDiscriminatedUnion", (e, t) => {
|
|
3066
|
-
Fa.init(e, t),
|
|
3066
|
+
Fa.init(e, t), Kl.init(e, t);
|
|
3067
3067
|
});
|
|
3068
3068
|
function Ju(e, t, r) {
|
|
3069
3069
|
return new qu({
|
|
@@ -3073,20 +3073,20 @@ function Ju(e, t, r) {
|
|
|
3073
3073
|
...$(r)
|
|
3074
3074
|
});
|
|
3075
3075
|
}
|
|
3076
|
-
const
|
|
3076
|
+
const Wu = /* @__PURE__ */ S("ZodIntersection", (e, t) => {
|
|
3077
3077
|
Gl.init(e, t), q.init(e, t);
|
|
3078
3078
|
});
|
|
3079
|
-
function
|
|
3080
|
-
return new
|
|
3079
|
+
function Ku(e, t) {
|
|
3080
|
+
return new Wu({
|
|
3081
3081
|
type: "intersection",
|
|
3082
3082
|
left: e,
|
|
3083
3083
|
right: t
|
|
3084
3084
|
});
|
|
3085
3085
|
}
|
|
3086
3086
|
const Gu = /* @__PURE__ */ S("ZodRecord", (e, t) => {
|
|
3087
|
-
|
|
3087
|
+
Yl.init(e, t), q.init(e, t), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
3088
3088
|
});
|
|
3089
|
-
function
|
|
3089
|
+
function Yu(e, t, r) {
|
|
3090
3090
|
return new Gu({
|
|
3091
3091
|
type: "record",
|
|
3092
3092
|
keyType: e,
|
|
@@ -3095,7 +3095,7 @@ function Hu(e, t, r) {
|
|
|
3095
3095
|
});
|
|
3096
3096
|
}
|
|
3097
3097
|
const nr = /* @__PURE__ */ S("ZodEnum", (e, t) => {
|
|
3098
|
-
|
|
3098
|
+
Hl.init(e, t), q.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
3099
3099
|
const r = new Set(Object.keys(t.entries));
|
|
3100
3100
|
e.extract = (n, a) => {
|
|
3101
3101
|
const s = {};
|
|
@@ -3133,7 +3133,7 @@ function Ua(e, t) {
|
|
|
3133
3133
|
...$(t)
|
|
3134
3134
|
});
|
|
3135
3135
|
}
|
|
3136
|
-
const
|
|
3136
|
+
const Hu = /* @__PURE__ */ S("ZodLiteral", (e, t) => {
|
|
3137
3137
|
Ql.init(e, t), q.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", {
|
|
3138
3138
|
get() {
|
|
3139
3139
|
if (t.values.length > 1)
|
|
@@ -3143,7 +3143,7 @@ const Yu = /* @__PURE__ */ S("ZodLiteral", (e, t) => {
|
|
|
3143
3143
|
});
|
|
3144
3144
|
});
|
|
3145
3145
|
function Qu(e, t) {
|
|
3146
|
-
return new
|
|
3146
|
+
return new Hu({
|
|
3147
3147
|
type: "literal",
|
|
3148
3148
|
values: Array.isArray(e) ? e : [e],
|
|
3149
3149
|
...$(t)
|
|
@@ -3355,14 +3355,14 @@ function xd(e) {
|
|
|
3355
3355
|
}
|
|
3356
3356
|
const T = v.charCodeAt(b);
|
|
3357
3357
|
if (mn(v, b, T)) {
|
|
3358
|
-
const O = v.charCodeAt(b + 5) === ze ? b + 6 : b + 5,
|
|
3358
|
+
const O = v.charCodeAt(b + 5) === ze ? b + 6 : b + 5, W = v.slice(O, N);
|
|
3359
3359
|
if (u === 0 && v.charCodeAt(N + 1) === fn) {
|
|
3360
|
-
t({ id: i, event: m, data:
|
|
3360
|
+
t({ id: i, event: m, data: W }), i = void 0, g = "", m = void 0, b = N + 2, N = v.indexOf(`
|
|
3361
3361
|
`, b);
|
|
3362
3362
|
continue;
|
|
3363
3363
|
}
|
|
3364
|
-
g = u === 0 ?
|
|
3365
|
-
${
|
|
3364
|
+
g = u === 0 ? W : `${g}
|
|
3365
|
+
${W}`, u++;
|
|
3366
3366
|
} else hn(v, b, T) ? m = v.slice(
|
|
3367
3367
|
v.charCodeAt(b + 6) === ze ? b + 7 : b + 6,
|
|
3368
3368
|
N
|
|
@@ -3389,7 +3389,7 @@ ${K}`, u++;
|
|
|
3389
3389
|
}
|
|
3390
3390
|
const T = v.charCodeAt(b);
|
|
3391
3391
|
if (mn(v, b, T)) {
|
|
3392
|
-
const
|
|
3392
|
+
const K = v.charCodeAt(b + 5) === ze ? b + 6 : b + 5, ye = v.slice(K, N);
|
|
3393
3393
|
g = u === 0 ? ye : `${g}
|
|
3394
3394
|
${ye}`, u++;
|
|
3395
3395
|
return;
|
|
@@ -3399,24 +3399,24 @@ ${ye}`, u++;
|
|
|
3399
3399
|
return;
|
|
3400
3400
|
}
|
|
3401
3401
|
if (T === 105 && v.charCodeAt(b + 1) === 100 && v.charCodeAt(b + 2) === 58) {
|
|
3402
|
-
const
|
|
3403
|
-
|
|
3402
|
+
const K = v.slice(v.charCodeAt(b + 3) === ze ? b + 4 : b + 3, N);
|
|
3403
|
+
K.includes("\0") || (i = K);
|
|
3404
3404
|
return;
|
|
3405
3405
|
}
|
|
3406
3406
|
if (T === 58) {
|
|
3407
3407
|
if (a) {
|
|
3408
|
-
const
|
|
3409
|
-
a(
|
|
3408
|
+
const K = v.slice(b, N);
|
|
3409
|
+
a(K.slice(v.charCodeAt(b + 1) === ze ? 2 : 1));
|
|
3410
3410
|
}
|
|
3411
3411
|
return;
|
|
3412
3412
|
}
|
|
3413
|
-
const O = v.slice(b, N),
|
|
3414
|
-
if (
|
|
3413
|
+
const O = v.slice(b, N), W = O.indexOf(":");
|
|
3414
|
+
if (W === -1) {
|
|
3415
3415
|
y(O, "", O);
|
|
3416
3416
|
return;
|
|
3417
3417
|
}
|
|
3418
|
-
const
|
|
3419
|
-
y(
|
|
3418
|
+
const H = O.slice(0, W), We = O.charCodeAt(W + 1) === ze ? 2 : 1, Ke = O.slice(W + We);
|
|
3419
|
+
y(H, Ke, O);
|
|
3420
3420
|
}
|
|
3421
3421
|
function y(v, b, N) {
|
|
3422
3422
|
switch (v) {
|
|
@@ -3720,7 +3720,7 @@ function Fd(e) {
|
|
|
3720
3720
|
const: e.value
|
|
3721
3721
|
};
|
|
3722
3722
|
}
|
|
3723
|
-
let
|
|
3723
|
+
let Wt;
|
|
3724
3724
|
const he = {
|
|
3725
3725
|
/**
|
|
3726
3726
|
* `c` was changed to `[cC]` to replicate /i flag
|
|
@@ -3743,7 +3743,7 @@ const he = {
|
|
|
3743
3743
|
* Fix in Zod:
|
|
3744
3744
|
* https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
|
|
3745
3745
|
*/
|
|
3746
|
-
emoji: () => (
|
|
3746
|
+
emoji: () => (Wt === void 0 && (Wt = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), Wt),
|
|
3747
3747
|
/**
|
|
3748
3748
|
* Unused
|
|
3749
3749
|
*/
|
|
@@ -3763,7 +3763,7 @@ const he = {
|
|
|
3763
3763
|
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
3764
3764
|
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
3765
3765
|
};
|
|
3766
|
-
function
|
|
3766
|
+
function Wa(e, t) {
|
|
3767
3767
|
const r = { type: "string" };
|
|
3768
3768
|
if (e.checks) for (const n of e.checks) switch (n.kind) {
|
|
3769
3769
|
case "min":
|
|
@@ -3800,10 +3800,10 @@ function Ka(e, t) {
|
|
|
3800
3800
|
oe(r, he.cuid2, n.message, t);
|
|
3801
3801
|
break;
|
|
3802
3802
|
case "startsWith":
|
|
3803
|
-
oe(r, RegExp(`^${
|
|
3803
|
+
oe(r, RegExp(`^${Kt(n.value, t)}`), n.message, t);
|
|
3804
3804
|
break;
|
|
3805
3805
|
case "endsWith":
|
|
3806
|
-
oe(r, RegExp(`${
|
|
3806
|
+
oe(r, RegExp(`${Kt(n.value, t)}$`), n.message, t);
|
|
3807
3807
|
break;
|
|
3808
3808
|
case "datetime":
|
|
3809
3809
|
ge(r, "date-time", n.message, t);
|
|
@@ -3821,7 +3821,7 @@ function Ka(e, t) {
|
|
|
3821
3821
|
r.minLength = typeof r.minLength == "number" ? Math.max(r.minLength, n.value) : n.value, r.maxLength = typeof r.maxLength == "number" ? Math.min(r.maxLength, n.value) : n.value;
|
|
3822
3822
|
break;
|
|
3823
3823
|
case "includes":
|
|
3824
|
-
oe(r, RegExp(
|
|
3824
|
+
oe(r, RegExp(Kt(n.value, t)), n.message, t);
|
|
3825
3825
|
break;
|
|
3826
3826
|
case "ip":
|
|
3827
3827
|
n.version !== "v6" && ge(r, "ipv4", n.message, t), n.version !== "v4" && ge(r, "ipv6", n.message, t);
|
|
@@ -3858,7 +3858,7 @@ function Ka(e, t) {
|
|
|
3858
3858
|
}
|
|
3859
3859
|
return r;
|
|
3860
3860
|
}
|
|
3861
|
-
function
|
|
3861
|
+
function Kt(e, t) {
|
|
3862
3862
|
return t.patternStrategy === "escape" ? Ud(e) : e;
|
|
3863
3863
|
}
|
|
3864
3864
|
const Ld = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
@@ -3933,7 +3933,7 @@ function vn(e, t) {
|
|
|
3933
3933
|
}
|
|
3934
3934
|
return a;
|
|
3935
3935
|
}
|
|
3936
|
-
function
|
|
3936
|
+
function Ka(e, t) {
|
|
3937
3937
|
var n, a, s, o, c;
|
|
3938
3938
|
const r = {
|
|
3939
3939
|
type: "object",
|
|
@@ -3943,7 +3943,7 @@ function Wa(e, t) {
|
|
|
3943
3943
|
}) ?? t.allowedAdditionalProperties
|
|
3944
3944
|
};
|
|
3945
3945
|
if (((n = e.keyType) == null ? void 0 : n._def.typeName) === "ZodString" && ((a = e.keyType._def.checks) != null && a.length)) {
|
|
3946
|
-
const { type: f, ...i } =
|
|
3946
|
+
const { type: f, ...i } = Wa(e.keyType._def, t);
|
|
3947
3947
|
return {
|
|
3948
3948
|
...r,
|
|
3949
3949
|
propertyNames: i
|
|
@@ -3964,7 +3964,7 @@ function Wa(e, t) {
|
|
|
3964
3964
|
return r;
|
|
3965
3965
|
}
|
|
3966
3966
|
function Bd(e, t) {
|
|
3967
|
-
return t.mapStrategy === "record" ?
|
|
3967
|
+
return t.mapStrategy === "record" ? Ka(e, t) : {
|
|
3968
3968
|
type: "array",
|
|
3969
3969
|
maxItems: 125,
|
|
3970
3970
|
items: {
|
|
@@ -4011,7 +4011,7 @@ const ar = {
|
|
|
4011
4011
|
ZodBoolean: "boolean",
|
|
4012
4012
|
ZodNull: "null"
|
|
4013
4013
|
};
|
|
4014
|
-
function
|
|
4014
|
+
function Wd(e, t) {
|
|
4015
4015
|
const r = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
4016
4016
|
if (r.every((n) => n._def.typeName in ar && (!n._def.checks || !n._def.checks.length))) {
|
|
4017
4017
|
const n = r.reduce((a, s) => {
|
|
@@ -4046,9 +4046,9 @@ function Kd(e, t) {
|
|
|
4046
4046
|
type: "string",
|
|
4047
4047
|
enum: r.reduce((n, a) => [...n, ...a._def.values.filter((s) => !n.includes(s))], [])
|
|
4048
4048
|
};
|
|
4049
|
-
return
|
|
4049
|
+
return Kd(e, t);
|
|
4050
4050
|
}
|
|
4051
|
-
const
|
|
4051
|
+
const Kd = (e, t) => {
|
|
4052
4052
|
const r = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((n, a) => F(n._def, {
|
|
4053
4053
|
...t,
|
|
4054
4054
|
currentPath: [
|
|
@@ -4077,7 +4077,7 @@ function Gd(e, t) {
|
|
|
4077
4077
|
});
|
|
4078
4078
|
return r && { anyOf: [r, { type: "null" }] };
|
|
4079
4079
|
}
|
|
4080
|
-
function
|
|
4080
|
+
function Yd(e) {
|
|
4081
4081
|
const t = { type: "number" };
|
|
4082
4082
|
if (!e.checks) return t;
|
|
4083
4083
|
for (const r of e.checks) switch (r.kind) {
|
|
@@ -4095,7 +4095,7 @@ function Hd(e) {
|
|
|
4095
4095
|
}
|
|
4096
4096
|
return t;
|
|
4097
4097
|
}
|
|
4098
|
-
function
|
|
4098
|
+
function Hd(e, t) {
|
|
4099
4099
|
const r = {
|
|
4100
4100
|
type: "object",
|
|
4101
4101
|
properties: {}
|
|
@@ -4228,11 +4228,11 @@ function op() {
|
|
|
4228
4228
|
const ip = (e, t) => F(e.innerType._def, t), lp = (e, t, r) => {
|
|
4229
4229
|
switch (t) {
|
|
4230
4230
|
case "ZodString":
|
|
4231
|
-
return
|
|
4231
|
+
return Wa(e, r);
|
|
4232
4232
|
case "ZodNumber":
|
|
4233
|
-
return
|
|
4233
|
+
return Yd(e);
|
|
4234
4234
|
case "ZodObject":
|
|
4235
|
-
return
|
|
4235
|
+
return Hd(e, r);
|
|
4236
4236
|
case "ZodBigInt":
|
|
4237
4237
|
return $d(e);
|
|
4238
4238
|
case "ZodBoolean":
|
|
@@ -4247,13 +4247,13 @@ const ip = (e, t) => F(e.innerType._def, t), lp = (e, t, r) => {
|
|
|
4247
4247
|
return Cd(e, r);
|
|
4248
4248
|
case "ZodUnion":
|
|
4249
4249
|
case "ZodDiscriminatedUnion":
|
|
4250
|
-
return
|
|
4250
|
+
return Wd(e, r);
|
|
4251
4251
|
case "ZodIntersection":
|
|
4252
4252
|
return Dd(e, r);
|
|
4253
4253
|
case "ZodTuple":
|
|
4254
4254
|
return ap(e, r);
|
|
4255
4255
|
case "ZodRecord":
|
|
4256
|
-
return
|
|
4256
|
+
return Ka(e, r);
|
|
4257
4257
|
case "ZodLiteral":
|
|
4258
4258
|
return Fd(e);
|
|
4259
4259
|
case "ZodEnum":
|
|
@@ -4476,7 +4476,7 @@ function Ga(e, t) {
|
|
|
4476
4476
|
return wp(e) ? xp(e) : yp(e);
|
|
4477
4477
|
}
|
|
4478
4478
|
async function yn({ value: e, schema: t, context: r }) {
|
|
4479
|
-
const n = await
|
|
4479
|
+
const n = await Ya({
|
|
4480
4480
|
value: e,
|
|
4481
4481
|
schema: t,
|
|
4482
4482
|
context: r
|
|
@@ -4488,7 +4488,7 @@ async function yn({ value: e, schema: t, context: r }) {
|
|
|
4488
4488
|
});
|
|
4489
4489
|
return n.value;
|
|
4490
4490
|
}
|
|
4491
|
-
async function
|
|
4491
|
+
async function Ya({ value: e, schema: t, context: r }) {
|
|
4492
4492
|
const n = gp(t);
|
|
4493
4493
|
try {
|
|
4494
4494
|
if (n.validate == null) return {
|
|
@@ -4529,7 +4529,7 @@ async function or({ text: e, schema: t }) {
|
|
|
4529
4529
|
success: !0,
|
|
4530
4530
|
value: r,
|
|
4531
4531
|
rawValue: r
|
|
4532
|
-
} : await
|
|
4532
|
+
} : await Ya({
|
|
4533
4533
|
value: r,
|
|
4534
4534
|
schema: t
|
|
4535
4535
|
});
|
|
@@ -4552,15 +4552,15 @@ function _p({ stream: e, schema: t }) {
|
|
|
4552
4552
|
}));
|
|
4553
4553
|
} }));
|
|
4554
4554
|
}
|
|
4555
|
-
async function
|
|
4555
|
+
async function Ye(e) {
|
|
4556
4556
|
return typeof e == "function" && (e = e()), e;
|
|
4557
4557
|
}
|
|
4558
4558
|
new TextDecoder();
|
|
4559
|
-
const
|
|
4559
|
+
const Ha = "AI_InvalidArgumentError", Qa = `vercel.ai.error.${Ha}`, Ip = Symbol.for(Qa);
|
|
4560
4560
|
var Et = class extends re {
|
|
4561
4561
|
constructor({ parameter: e, value: t, message: r }) {
|
|
4562
4562
|
super({
|
|
4563
|
-
name:
|
|
4563
|
+
name: Ha,
|
|
4564
4564
|
message: `Invalid argument for parameter ${e}: ${r}`
|
|
4565
4565
|
}), this[Ip] = !0, this.parameter = e, this.value = t;
|
|
4566
4566
|
}
|
|
@@ -4608,7 +4608,7 @@ const l = {
|
|
|
4608
4608
|
null: Du,
|
|
4609
4609
|
number: Mu,
|
|
4610
4610
|
object: Bu,
|
|
4611
|
-
record:
|
|
4611
|
+
record: Yu,
|
|
4612
4612
|
string: gu,
|
|
4613
4613
|
union: La,
|
|
4614
4614
|
unknown: Ot
|
|
@@ -5271,7 +5271,7 @@ const nt = l.record(l.string(), Ve.optional()), Fp = mp(() => Ga(l.union([
|
|
|
5271
5271
|
function Lp(e) {
|
|
5272
5272
|
return e.type.startsWith("data-");
|
|
5273
5273
|
}
|
|
5274
|
-
function
|
|
5274
|
+
function He() {
|
|
5275
5275
|
return /* @__PURE__ */ Object.create(null);
|
|
5276
5276
|
}
|
|
5277
5277
|
function zt(e) {
|
|
@@ -5292,7 +5292,7 @@ function os({ lastMessage: e, messageId: t }) {
|
|
|
5292
5292
|
metadata: void 0,
|
|
5293
5293
|
role: "assistant",
|
|
5294
5294
|
parts: []
|
|
5295
|
-
}, n =
|
|
5295
|
+
}, n = He(), a = r.parts.findLastIndex((o) => o.type === "step-start");
|
|
5296
5296
|
let s = 0;
|
|
5297
5297
|
for (const o of r.parts.slice(a + 1)) {
|
|
5298
5298
|
if (!be(o)) continue;
|
|
@@ -5308,8 +5308,8 @@ function os({ lastMessage: e, messageId: t }) {
|
|
|
5308
5308
|
}
|
|
5309
5309
|
return {
|
|
5310
5310
|
message: r,
|
|
5311
|
-
activeTextParts:
|
|
5312
|
-
activeReasoningParts:
|
|
5311
|
+
activeTextParts: He(),
|
|
5312
|
+
activeReasoningParts: He(),
|
|
5313
5313
|
partialToolCalls: n
|
|
5314
5314
|
};
|
|
5315
5315
|
}
|
|
@@ -5363,8 +5363,8 @@ function Bp({ stream: e, messageMetadataSchema: t, dataPartSchemas: r, runUpdate
|
|
|
5363
5363
|
const O = N.providerMetadata;
|
|
5364
5364
|
if (O != null)
|
|
5365
5365
|
if (d.state === "output-available" || d.state === "output-error") {
|
|
5366
|
-
const
|
|
5367
|
-
|
|
5366
|
+
const W = b;
|
|
5367
|
+
W.resultProviderMetadata = O;
|
|
5368
5368
|
} else b.callProviderMetadata = O;
|
|
5369
5369
|
} else u.message.parts.push({
|
|
5370
5370
|
type: `tool-${d.toolName}`,
|
|
@@ -5389,8 +5389,8 @@ function Bp({ stream: e, messageMetadataSchema: t, dataPartSchemas: r, runUpdate
|
|
|
5389
5389
|
const O = N.providerMetadata;
|
|
5390
5390
|
if (O != null)
|
|
5391
5391
|
if (d.state === "output-available" || d.state === "output-error") {
|
|
5392
|
-
const
|
|
5393
|
-
|
|
5392
|
+
const W = b;
|
|
5393
|
+
W.resultProviderMetadata = O;
|
|
5394
5394
|
} else b.callProviderMetadata = O;
|
|
5395
5395
|
} else u.message.parts.push({
|
|
5396
5396
|
type: "dynamic-tool",
|
|
@@ -5709,7 +5709,7 @@ function Bp({ stream: e, messageMetadataSchema: t, dataPartSchemas: r, runUpdate
|
|
|
5709
5709
|
break;
|
|
5710
5710
|
case "reset-step": {
|
|
5711
5711
|
const d = w();
|
|
5712
|
-
u.activeTextParts =
|
|
5712
|
+
u.activeTextParts = He(), u.activeReasoningParts = He(), u.partialToolCalls = He(), d.length > 0 && (u.message.parts.splice(u.message.parts.length - d.length, d.length), m());
|
|
5713
5713
|
break;
|
|
5714
5714
|
}
|
|
5715
5715
|
case "start":
|
|
@@ -5897,7 +5897,7 @@ async function xn({ response: e, url: t, fallbackMessage: r }) {
|
|
|
5897
5897
|
responseBody: n
|
|
5898
5898
|
});
|
|
5899
5899
|
}
|
|
5900
|
-
async function
|
|
5900
|
+
async function Wp(e) {
|
|
5901
5901
|
if (e == null) return [];
|
|
5902
5902
|
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new ci({
|
|
5903
5903
|
functionality: "FileList",
|
|
@@ -5919,7 +5919,7 @@ async function Kp(e) {
|
|
|
5919
5919
|
};
|
|
5920
5920
|
}));
|
|
5921
5921
|
}
|
|
5922
|
-
function
|
|
5922
|
+
function Kp(e, t) {
|
|
5923
5923
|
const r = e.search(/[?#]/), n = r === -1 ? e : e.slice(0, r), a = r === -1 ? "" : e.slice(r);
|
|
5924
5924
|
return `${n.endsWith("/") && t.startsWith("/") ? n.slice(0, -1) : n}${t}${a}`;
|
|
5925
5925
|
}
|
|
@@ -5929,7 +5929,7 @@ var Gp = class {
|
|
|
5929
5929
|
}
|
|
5930
5930
|
async sendMessages({ abortSignal: e, ...t }) {
|
|
5931
5931
|
var m;
|
|
5932
|
-
const r = await
|
|
5932
|
+
const r = await Ye(this.body), n = await Ye(this.headers), a = await Ye(this.credentials), s = {
|
|
5933
5933
|
...Ge(n),
|
|
5934
5934
|
...Ge(t.headers)
|
|
5935
5935
|
}, o = await ((m = this.prepareSendMessagesRequest) == null ? void 0 : m.call(this, {
|
|
@@ -5972,7 +5972,7 @@ var Gp = class {
|
|
|
5972
5972
|
}
|
|
5973
5973
|
async reconnectToStream(e) {
|
|
5974
5974
|
var g;
|
|
5975
|
-
const t = await
|
|
5975
|
+
const t = await Ye(this.body), r = await Ye(this.headers), n = await Ye(this.credentials), a = {
|
|
5976
5976
|
...Ge(r),
|
|
5977
5977
|
...Ge(e.headers)
|
|
5978
5978
|
}, s = await ((g = this.prepareReconnectToStreamRequest) == null ? void 0 : g.call(this, {
|
|
@@ -5993,7 +5993,7 @@ var Gp = class {
|
|
|
5993
5993
|
value: e.chatId,
|
|
5994
5994
|
message: 'Chat IDs must not be "." or ".." when using the default reconnect URL.'
|
|
5995
5995
|
});
|
|
5996
|
-
o =
|
|
5996
|
+
o = Kp(this.api, `/${encodeURIComponent(e.chatId)}/stream`);
|
|
5997
5997
|
}
|
|
5998
5998
|
const c = (s == null ? void 0 : s.headers) !== void 0 ? Ge(s.headers) : a, f = (s == null ? void 0 : s.credentials) ?? n, i = await (this.fetch ?? globalThis.fetch)(o, {
|
|
5999
5999
|
method: "GET",
|
|
@@ -6023,7 +6023,7 @@ var Gp = class {
|
|
|
6023
6023
|
r.enqueue(t.value);
|
|
6024
6024
|
} }));
|
|
6025
6025
|
}
|
|
6026
|
-
},
|
|
6026
|
+
}, Yp = class {
|
|
6027
6027
|
constructor({ generateId: e = _d, id: t = e(), transport: r = new wr(), messageMetadataSchema: n, dataPartSchemas: a, state: s, onError: o, onToolCall: c, onFinish: f, onData: i, sendAutomaticallyWhen: g }) {
|
|
6028
6028
|
this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.resumableStreamState = void 0, this.jobExecutor = new Jp(), this.activeStopCount = 0, this.stopGeneration = 0, this.sendMessage = async (u, m) => {
|
|
6029
6029
|
var I;
|
|
@@ -6053,7 +6053,7 @@ var Gp = class {
|
|
|
6053
6053
|
this.pendingMessagePreparations.add(E);
|
|
6054
6054
|
let _;
|
|
6055
6055
|
try {
|
|
6056
|
-
_ = Array.isArray(u.files) ? u.files : await
|
|
6056
|
+
_ = Array.isArray(u.files) ? u.files : await Wp(u.files);
|
|
6057
6057
|
} finally {
|
|
6058
6058
|
this.pendingMessagePreparations.delete(E);
|
|
6059
6059
|
}
|
|
@@ -6324,9 +6324,9 @@ var Gp = class {
|
|
|
6324
6324
|
});
|
|
6325
6325
|
const T = (O) => this.jobExecutor.run(() => b.abortController.signal.aborted ? Promise.resolve() : O({
|
|
6326
6326
|
state: b.state,
|
|
6327
|
-
write: ({ updateStatus:
|
|
6328
|
-
var
|
|
6329
|
-
b.abortController.signal.aborted || (
|
|
6327
|
+
write: ({ updateStatus: W = !0 } = {}) => {
|
|
6328
|
+
var H;
|
|
6329
|
+
b.abortController.signal.aborted || (W && this.setStatus({ status: "streaming" }), E ? this.state.replaceMessage(m, b.state.message) : b.state.message.id === ((H = this.lastMessage) == null ? void 0 : H.id) ? this.state.replaceMessage(this.state.messages.length - 1, b.state.message) : this.state.pushMessage(b.state.message));
|
|
6330
6330
|
}
|
|
6331
6331
|
}));
|
|
6332
6332
|
if (await Vp({
|
|
@@ -6388,7 +6388,7 @@ var Gp = class {
|
|
|
6388
6388
|
});
|
|
6389
6389
|
}
|
|
6390
6390
|
};
|
|
6391
|
-
function
|
|
6391
|
+
function Hp(e, t) {
|
|
6392
6392
|
if (typeof e != "function")
|
|
6393
6393
|
throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);
|
|
6394
6394
|
let r, n = 0;
|
|
@@ -6400,7 +6400,7 @@ function Yp(e, t) {
|
|
|
6400
6400
|
}, f);
|
|
6401
6401
|
};
|
|
6402
6402
|
}
|
|
6403
|
-
var Qp =
|
|
6403
|
+
var Qp = Hp;
|
|
6404
6404
|
const Xp = /* @__PURE__ */ ho(Qp);
|
|
6405
6405
|
function ef(e, t) {
|
|
6406
6406
|
return t != null ? Xp(e, t) : e;
|
|
@@ -6471,7 +6471,7 @@ var ce, Qe, Xe, Ze, je, De, Ne, pt, ft, Tn, rf = (Tn = class {
|
|
|
6471
6471
|
set messages(e) {
|
|
6472
6472
|
ee(this, ce, [...e]), L(this, Ne).call(this);
|
|
6473
6473
|
}
|
|
6474
|
-
}, ce = new WeakMap(), Qe = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), je = new WeakMap(), De = new WeakMap(), Ne = new WeakMap(), pt = new WeakMap(), ft = new WeakMap(), Tn), Fe, An, is = (An = class extends
|
|
6474
|
+
}, ce = new WeakMap(), Qe = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), je = new WeakMap(), De = new WeakMap(), Ne = new WeakMap(), pt = new WeakMap(), ft = new WeakMap(), Tn), Fe, An, is = (An = class extends Yp {
|
|
6475
6475
|
constructor({ messages: t, ...r }) {
|
|
6476
6476
|
const n = new rf(t);
|
|
6477
6477
|
super({
|
|
@@ -6699,7 +6699,7 @@ function hf(e) {
|
|
|
6699
6699
|
}).finally(() => R(C, -1));
|
|
6700
6700
|
}
|
|
6701
6701
|
};
|
|
6702
|
-
}), [m, w] = D(() =>
|
|
6702
|
+
}), [m, w] = D(() => Yt(u));
|
|
6703
6703
|
Ue(() => (r.current = m, () => {
|
|
6704
6704
|
r.current === m && (r.current = void 0);
|
|
6705
6705
|
}), [m]);
|
|
@@ -6717,7 +6717,7 @@ function hf(e) {
|
|
|
6717
6717
|
(R, C = []) => {
|
|
6718
6718
|
var fe, ae, $e;
|
|
6719
6719
|
const M = R.trim();
|
|
6720
|
-
if (!M ||
|
|
6720
|
+
if (!M || Ht(m.chat.status) || m.pendingApplies > 0 || v.current) return "not_sent";
|
|
6721
6721
|
let Z;
|
|
6722
6722
|
try {
|
|
6723
6723
|
Z = t.current.readContext();
|
|
@@ -6745,20 +6745,20 @@ function hf(e) {
|
|
|
6745
6745
|
), "sent";
|
|
6746
6746
|
},
|
|
6747
6747
|
[m, h]
|
|
6748
|
-
),
|
|
6748
|
+
), W = te(
|
|
6749
6749
|
(R) => {
|
|
6750
6750
|
var M;
|
|
6751
6751
|
const C = m.chat.messages.find((Z) => Z.id === R && Z.role === "user");
|
|
6752
6752
|
return C ? O(cs(C), ((M = C.metadata) == null ? void 0 : M.taggedFields) ?? []) : "not_sent";
|
|
6753
6753
|
},
|
|
6754
6754
|
[m, O]
|
|
6755
|
-
),
|
|
6755
|
+
), H = te(
|
|
6756
6756
|
(R) => {
|
|
6757
6757
|
const C = X.getState().actions.undoProposal(R);
|
|
6758
6758
|
return C.ok && a((M) => Pe(M, m.chat.id, R, { status: "undone" })), C.ok;
|
|
6759
6759
|
},
|
|
6760
6760
|
[m]
|
|
6761
|
-
),
|
|
6761
|
+
), We = te(
|
|
6762
6762
|
async (R) => {
|
|
6763
6763
|
var pe;
|
|
6764
6764
|
const C = m.chat.id, M = (pe = s[C]) == null ? void 0 : pe[R];
|
|
@@ -6768,13 +6768,13 @@ function hf(e) {
|
|
|
6768
6768
|
o((Q) => Pe(Q, C, R, de));
|
|
6769
6769
|
},
|
|
6770
6770
|
[m, u, s]
|
|
6771
|
-
),
|
|
6771
|
+
), Ke = te(
|
|
6772
6772
|
(R) => {
|
|
6773
6773
|
o((C) => Pe(C, m.chat.id, R, { status: "dismissed" }));
|
|
6774
6774
|
},
|
|
6775
6775
|
[m]
|
|
6776
|
-
),
|
|
6777
|
-
T(), y(void 0), w(
|
|
6776
|
+
), K = te(() => void m.chat.stop(), [m]), ye = te(() => {
|
|
6777
|
+
T(), y(void 0), w(Yt(u)), d([]);
|
|
6778
6778
|
}, [T, u]), Ae = te(
|
|
6779
6779
|
(R, C) => {
|
|
6780
6780
|
C.beside && m.aboutCardId !== R && ye();
|
|
@@ -6789,14 +6789,14 @@ function hf(e) {
|
|
|
6789
6789
|
}, []), xe = te(
|
|
6790
6790
|
async (R) => {
|
|
6791
6791
|
var M;
|
|
6792
|
-
if (R === m.conversationId &&
|
|
6792
|
+
if (R === m.conversationId && Ht(m.chat.status))
|
|
6793
6793
|
return T(), "opened";
|
|
6794
6794
|
(M = v.current) == null || M.abort();
|
|
6795
6795
|
const C = new AbortController();
|
|
6796
6796
|
v.current = C, N(!0), y(void 0);
|
|
6797
6797
|
try {
|
|
6798
6798
|
const Z = await _n(u.connection(), R, C.signal);
|
|
6799
|
-
return C.signal.aborted ? "not_opened" : (w(
|
|
6799
|
+
return C.signal.aborted ? "not_opened" : (w(Yt(u, Z)), d(Z.addedSources), Z.allows && g(Z.allows), "opened");
|
|
6800
6800
|
} catch (Z) {
|
|
6801
6801
|
return C.signal.aborted || y(
|
|
6802
6802
|
Z instanceof tt && Z.code !== "model_unavailable" ? Z.message : ff
|
|
@@ -6814,14 +6814,14 @@ function hf(e) {
|
|
|
6814
6814
|
messages: I,
|
|
6815
6815
|
status: E,
|
|
6816
6816
|
/** Answering, or applying an answer's change to the dashboard. */
|
|
6817
|
-
busy:
|
|
6817
|
+
busy: Ht(E) || c.chatId === m.chat.id && c.count > 0,
|
|
6818
6818
|
/** Where this session's proposals stand on the dashboard; none for a reopened conversation. */
|
|
6819
6819
|
proposalStates: n[m.chat.id] ?? uf,
|
|
6820
|
-
undoProposal:
|
|
6820
|
+
undoProposal: H,
|
|
6821
6821
|
/** Where this session's proposed relationships stand; none for a reopened conversation. */
|
|
6822
6822
|
modelChangeStates: s[m.chat.id] ?? df,
|
|
6823
|
-
addModelChange:
|
|
6824
|
-
dismissModelChange:
|
|
6823
|
+
addModelChange: We,
|
|
6824
|
+
dismissModelChange: Ke,
|
|
6825
6825
|
/** A stored conversation is loading; sending waits. */
|
|
6826
6826
|
loading: b,
|
|
6827
6827
|
addedSources: h,
|
|
@@ -6836,8 +6836,8 @@ function hf(e) {
|
|
|
6836
6836
|
notice: x,
|
|
6837
6837
|
clearNotice: () => y(void 0),
|
|
6838
6838
|
send: O,
|
|
6839
|
-
askAgain:
|
|
6840
|
-
stop:
|
|
6839
|
+
askAgain: W,
|
|
6840
|
+
stop: K,
|
|
6841
6841
|
startNew: ye,
|
|
6842
6842
|
askedAbout: Ae,
|
|
6843
6843
|
open: xe
|
|
@@ -6850,7 +6850,7 @@ function gf(e, t) {
|
|
|
6850
6850
|
if (!(!(r != null && r.id) || r.id !== ((n = e.dashboard) == null ? void 0 : n.id)))
|
|
6851
6851
|
return Xt(r) <= et.openDashboardBytes ? r : void 0;
|
|
6852
6852
|
}
|
|
6853
|
-
function
|
|
6853
|
+
function Yt(e, t) {
|
|
6854
6854
|
const r = {
|
|
6855
6855
|
conversationId: t == null ? void 0 : t.conversationId,
|
|
6856
6856
|
proposals: /* @__PURE__ */ new Map(),
|
|
@@ -6904,7 +6904,7 @@ function bf(e) {
|
|
|
6904
6904
|
];
|
|
6905
6905
|
});
|
|
6906
6906
|
}
|
|
6907
|
-
function
|
|
6907
|
+
function Ht(e) {
|
|
6908
6908
|
return e === "submitted" || e === "streaming";
|
|
6909
6909
|
}
|
|
6910
6910
|
const vf = new Set(Object.values(ct));
|
|
@@ -6912,7 +6912,7 @@ function yf(e) {
|
|
|
6912
6912
|
return e instanceof tt || vf.has(e.message) ? e.message : ct.model_unavailable;
|
|
6913
6913
|
}
|
|
6914
6914
|
function xf(e) {
|
|
6915
|
-
return e instanceof qn ? e.message : e instanceof
|
|
6915
|
+
return e instanceof qn ? e.message : e instanceof Hn ? "The dashboard is still loading. Try again in a moment." : e instanceof Jn ? ct.context_invalid : ct.model_unavailable;
|
|
6916
6916
|
}
|
|
6917
6917
|
function cs(e) {
|
|
6918
6918
|
return ((e == null ? void 0 : e.parts) ?? []).map((t) => t.type === "text" ? t.text : "").join("").trim();
|
|
@@ -7134,7 +7134,7 @@ function $f({ artifact: e, onClose: t }) {
|
|
|
7134
7134
|
/* @__PURE__ */ k("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
7135
7135
|
/* @__PURE__ */ p(hs, { eligible: e.eligible, kind: r, onChange: n }),
|
|
7136
7136
|
/* @__PURE__ */ p(
|
|
7137
|
-
|
|
7137
|
+
Y,
|
|
7138
7138
|
{
|
|
7139
7139
|
variant: "ghost",
|
|
7140
7140
|
size: "xs",
|
|
@@ -7175,7 +7175,7 @@ function ms(e, t) {
|
|
|
7175
7175
|
}
|
|
7176
7176
|
function Of(e, t) {
|
|
7177
7177
|
if (t === e.visual.kind) return e.visual;
|
|
7178
|
-
const r =
|
|
7178
|
+
const r = Kn(Gn(e), t);
|
|
7179
7179
|
return r.ok ? r.visual : { kind: "table", encodings: {} };
|
|
7180
7180
|
}
|
|
7181
7181
|
const zf = {
|
|
@@ -7479,7 +7479,7 @@ function Lf({
|
|
|
7479
7479
|
/* @__PURE__ */ k("div", { className: "flex items-start justify-between gap-2", children: [
|
|
7480
7480
|
/* @__PURE__ */ p("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ p(xs, { onPick: n }) }),
|
|
7481
7481
|
/* @__PURE__ */ k(
|
|
7482
|
-
|
|
7482
|
+
Y,
|
|
7483
7483
|
{
|
|
7484
7484
|
size: "xs",
|
|
7485
7485
|
className: "mt-0.5 h-7 shrink-0 gap-1 px-2.5",
|
|
@@ -7548,7 +7548,7 @@ function xs({ onPick: e }) {
|
|
|
7548
7548
|
className: "h-7 min-w-0 flex-1 bg-transparent text-[13px] text-foreground outline-none placeholder:text-muted-foreground"
|
|
7549
7549
|
}
|
|
7550
7550
|
),
|
|
7551
|
-
/* @__PURE__ */ p(
|
|
7551
|
+
/* @__PURE__ */ p(Y, { type: "submit", size: "xs", className: "h-7 w-7 shrink-0 p-0", "aria-label": "Send answer", title: "Send", disabled: !t.trim(), children: /* @__PURE__ */ p(Mt, { className: "h-3.5 w-3.5" }) })
|
|
7552
7552
|
]
|
|
7553
7553
|
}
|
|
7554
7554
|
);
|
|
@@ -7612,7 +7612,7 @@ function qf({
|
|
|
7612
7612
|
onUndo: r,
|
|
7613
7613
|
onAskAgain: n
|
|
7614
7614
|
}) {
|
|
7615
|
-
const a = X((g) => Bs(g, e.proposalId)), s = X((g) => g.isVisualEditing), o =
|
|
7615
|
+
const a = X((g) => Bs(g, e.proposalId)), s = X((g) => g.isVisualEditing), o = Kf(t, a), c = o.kind === "undone" || o.kind === "refused", f = !c && o.kind !== "settled", i = o.kind === "changed_since" ? Vf : o.kind === "undone" ? "Undone." : o.kind === "refused" ? o.message : void 0;
|
|
7616
7616
|
return /* @__PURE__ */ k(
|
|
7617
7617
|
vt,
|
|
7618
7618
|
{
|
|
@@ -7621,7 +7621,7 @@ function qf({
|
|
|
7621
7621
|
testId: "assistant-proposal",
|
|
7622
7622
|
"data-proposal-state": o.kind,
|
|
7623
7623
|
action: o.kind === "undoable" ? /* @__PURE__ */ k(
|
|
7624
|
-
|
|
7624
|
+
Y,
|
|
7625
7625
|
{
|
|
7626
7626
|
variant: "outline",
|
|
7627
7627
|
size: "xs",
|
|
@@ -7644,7 +7644,7 @@ function qf({
|
|
|
7644
7644
|
] }) : null,
|
|
7645
7645
|
children: [
|
|
7646
7646
|
/* @__PURE__ */ p("ul", { className: "space-y-1", children: e.changes.filter((g) => g.sentence).map((g, u) => {
|
|
7647
|
-
const m =
|
|
7647
|
+
const m = Yf(g.op);
|
|
7648
7648
|
return /* @__PURE__ */ k("li", { className: "flex items-start gap-1.5", children: [
|
|
7649
7649
|
/* @__PURE__ */ p(m, { className: "mt-[3px] h-3 w-3 shrink-0 text-muted-foreground" }),
|
|
7650
7650
|
/* @__PURE__ */ p("span", { className: B("min-w-0 flex-1 text-[12px] leading-[1.55]", c ? "text-muted-foreground" : "text-foreground"), children: g.sentence })
|
|
@@ -7656,7 +7656,7 @@ function qf({
|
|
|
7656
7656
|
] }, u)) }) : null,
|
|
7657
7657
|
i ? /* @__PURE__ */ k("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-border pt-2", children: [
|
|
7658
7658
|
/* @__PURE__ */ p("span", { className: "text-[11.5px] leading-[1.5] text-muted-foreground", children: i }),
|
|
7659
|
-
o.kind === "refused" && n ? /* @__PURE__ */ k(
|
|
7659
|
+
o.kind === "refused" && n ? /* @__PURE__ */ k(Y, { variant: "outline", size: "xs", className: "h-[26px] gap-1 px-2 text-[11.5px]", onClick: n, children: [
|
|
7660
7660
|
/* @__PURE__ */ p(Ln, { className: "h-3 w-3" }),
|
|
7661
7661
|
"Ask again"
|
|
7662
7662
|
] }) : null
|
|
@@ -7671,7 +7671,7 @@ function Jf({ refusal: e }) {
|
|
|
7671
7671
|
/* @__PURE__ */ p("span", { className: "min-w-0", children: e.message })
|
|
7672
7672
|
] }) });
|
|
7673
7673
|
}
|
|
7674
|
-
function
|
|
7674
|
+
function Wf({
|
|
7675
7675
|
change: e,
|
|
7676
7676
|
state: t,
|
|
7677
7677
|
onAdd: r,
|
|
@@ -7719,7 +7719,7 @@ function Kf({
|
|
|
7719
7719
|
] }),
|
|
7720
7720
|
/* @__PURE__ */ k("div", { className: "flex gap-1.5", children: [
|
|
7721
7721
|
/* @__PURE__ */ p(
|
|
7722
|
-
|
|
7722
|
+
Y,
|
|
7723
7723
|
{
|
|
7724
7724
|
size: "xs",
|
|
7725
7725
|
className: "h-[26px] px-2 text-[11.5px]",
|
|
@@ -7729,7 +7729,7 @@ function Kf({
|
|
|
7729
7729
|
}
|
|
7730
7730
|
),
|
|
7731
7731
|
/* @__PURE__ */ p(
|
|
7732
|
-
|
|
7732
|
+
Y,
|
|
7733
7733
|
{
|
|
7734
7734
|
variant: "outline",
|
|
7735
7735
|
size: "xs",
|
|
@@ -7743,7 +7743,7 @@ function Kf({
|
|
|
7743
7743
|
] }) : null,
|
|
7744
7744
|
c ? /* @__PURE__ */ k("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-border pt-2", children: [
|
|
7745
7745
|
/* @__PURE__ */ p("span", { className: "text-[11.5px] leading-[1.5] text-muted-foreground", children: c }),
|
|
7746
|
-
(s === "added" || s === "refused") && a ? /* @__PURE__ */ k(
|
|
7746
|
+
(s === "added" || s === "refused") && a ? /* @__PURE__ */ k(Y, { variant: "outline", size: "xs", className: "h-[26px] gap-1 px-2 text-[11.5px]", onClick: a, children: [
|
|
7747
7747
|
/* @__PURE__ */ p(Ln, { className: "h-3 w-3" }),
|
|
7748
7748
|
"Ask again"
|
|
7749
7749
|
] }) : null
|
|
@@ -7752,7 +7752,7 @@ function Kf({
|
|
|
7752
7752
|
}
|
|
7753
7753
|
);
|
|
7754
7754
|
}
|
|
7755
|
-
function
|
|
7755
|
+
function Kf(e, t) {
|
|
7756
7756
|
if (!e) return { kind: "settled" };
|
|
7757
7757
|
switch (e.status) {
|
|
7758
7758
|
case "applying":
|
|
@@ -7768,11 +7768,11 @@ function Wf(e, t) {
|
|
|
7768
7768
|
function Gf(e) {
|
|
7769
7769
|
return e.reason === "refused" ? `Not applied: ${e.message}` : e.message;
|
|
7770
7770
|
}
|
|
7771
|
-
function
|
|
7771
|
+
function Yf(e) {
|
|
7772
7772
|
return e.startsWith("filter.") ? Fo : e === "card.add" ? Pt : e === "card.remove" ? zn : Mn;
|
|
7773
7773
|
}
|
|
7774
7774
|
const kn = 4;
|
|
7775
|
-
function
|
|
7775
|
+
function Hf({
|
|
7776
7776
|
messages: e,
|
|
7777
7777
|
status: t,
|
|
7778
7778
|
failure: r,
|
|
@@ -7863,7 +7863,7 @@ function rm({
|
|
|
7863
7863
|
},
|
|
7864
7864
|
h
|
|
7865
7865
|
) : y.type === "data-proposal_refused" ? /* @__PURE__ */ p(Jf, { refusal: y.data }, h) : y.type === "data-model_change" ? /* @__PURE__ */ p(
|
|
7866
|
-
|
|
7866
|
+
Wf,
|
|
7867
7867
|
{
|
|
7868
7868
|
change: y.data,
|
|
7869
7869
|
state: c[y.data.proposalId],
|
|
@@ -7977,19 +7977,19 @@ function dm(e) {
|
|
|
7977
7977
|
return t;
|
|
7978
7978
|
}
|
|
7979
7979
|
const Is = {
|
|
7980
|
-
find:
|
|
7981
|
-
read:
|
|
7980
|
+
find: Ks,
|
|
7981
|
+
read: Ws,
|
|
7982
7982
|
analyze: Dn,
|
|
7983
7983
|
sql: Js,
|
|
7984
7984
|
change: Mn,
|
|
7985
|
-
retry:
|
|
7985
|
+
retry: Ko
|
|
7986
7986
|
};
|
|
7987
7987
|
function pm({ stage: e }) {
|
|
7988
7988
|
if (e.activity) {
|
|
7989
7989
|
const t = Is[e.activity];
|
|
7990
7990
|
return /* @__PURE__ */ p(t, { className: "h-3 w-3", "aria-hidden": "true" });
|
|
7991
7991
|
}
|
|
7992
|
-
return e.state === "done" ? /* @__PURE__ */ p(mt, { className: "h-3 w-3" }) : e.state === "live" ? /* @__PURE__ */ p(Be, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ p(
|
|
7992
|
+
return e.state === "done" ? /* @__PURE__ */ p(mt, { className: "h-3 w-3" }) : e.state === "live" ? /* @__PURE__ */ p(Be, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ p(Hs, { className: "h-3 w-3" });
|
|
7993
7993
|
}
|
|
7994
7994
|
function Ss({ step: e }) {
|
|
7995
7995
|
const t = (e == null ? void 0 : e.label) ?? "Thinking", r = e != null && e.activity ? Is[e.activity] : void 0;
|
|
@@ -8003,7 +8003,7 @@ function mm({ text: e }) {
|
|
|
8003
8003
|
return /* @__PURE__ */ p("div", { className: "break-words text-[13px] leading-[1.6] text-foreground", children: /* @__PURE__ */ p(
|
|
8004
8004
|
Gs,
|
|
8005
8005
|
{
|
|
8006
|
-
remarkPlugins: [
|
|
8006
|
+
remarkPlugins: [Ys],
|
|
8007
8007
|
components: {
|
|
8008
8008
|
p: ({ children: t }) => /* @__PURE__ */ p("p", { className: "mb-2 last:mb-0", children: t }),
|
|
8009
8009
|
ul: ({ children: t }) => /* @__PURE__ */ p("ul", { className: "mb-2 list-disc space-y-1 pl-5 last:mb-0", children: t }),
|
|
@@ -8023,8 +8023,8 @@ function mm({ text: e }) {
|
|
|
8023
8023
|
) });
|
|
8024
8024
|
}
|
|
8025
8025
|
const hm = [
|
|
8026
|
-
{ layout: "docked-right", label: "Dock right", short: "Right", icon:
|
|
8027
|
-
{ layout: "docked-left", label: "Dock left", short: "Left", icon:
|
|
8026
|
+
{ layout: "docked-right", label: "Dock right", short: "Right", icon: Yn },
|
|
8027
|
+
{ layout: "docked-left", label: "Dock left", short: "Left", icon: Wo },
|
|
8028
8028
|
{ layout: "centered", label: "Centered", short: "Center", icon: Bo },
|
|
8029
8029
|
{ layout: "full-page", label: "Full page", short: "Full", icon: no }
|
|
8030
8030
|
];
|
|
@@ -8052,7 +8052,7 @@ function gm({
|
|
|
8052
8052
|
] }) : null,
|
|
8053
8053
|
/* @__PURE__ */ k(Qs, { children: [
|
|
8054
8054
|
/* @__PURE__ */ p(Xs, { asChild: !0, children: /* @__PURE__ */ p(
|
|
8055
|
-
|
|
8055
|
+
Y,
|
|
8056
8056
|
{
|
|
8057
8057
|
variant: "ghost",
|
|
8058
8058
|
size: "xs",
|
|
@@ -8227,7 +8227,7 @@ function xm({
|
|
|
8227
8227
|
/* @__PURE__ */ p("span", { className: B("truncate", f && "line-through"), children: c }),
|
|
8228
8228
|
f ? /* @__PURE__ */ p("span", { className: "sr-only", children: "no longer available" }) : null,
|
|
8229
8229
|
/* @__PURE__ */ p(
|
|
8230
|
-
|
|
8230
|
+
Y,
|
|
8231
8231
|
{
|
|
8232
8232
|
type: "button",
|
|
8233
8233
|
variant: "ghost",
|
|
@@ -8261,7 +8261,7 @@ function wm({
|
|
|
8261
8261
|
},
|
|
8262
8262
|
children: [
|
|
8263
8263
|
/* @__PURE__ */ p(Bn, { asChild: !0, children: /* @__PURE__ */ p(
|
|
8264
|
-
|
|
8264
|
+
Y,
|
|
8265
8265
|
{
|
|
8266
8266
|
type: "button",
|
|
8267
8267
|
variant: "ghost",
|
|
@@ -8380,7 +8380,7 @@ function sh({
|
|
|
8380
8380
|
apiServiceUrl: (A = a.tokenProps) == null ? void 0 : A.apiServiceUrl,
|
|
8381
8381
|
accessToken: (P = a.authToken) == null ? void 0 : P.accessToken
|
|
8382
8382
|
};
|
|
8383
|
-
}, v =
|
|
8383
|
+
}, v = Yo({ surface: t }), { canChangeNow: b } = Wn(t === "dashboard"), N = wo(b), T = hf({
|
|
8384
8384
|
canChangeOpenDashboard: b,
|
|
8385
8385
|
applyProposal: N,
|
|
8386
8386
|
readContext: () => E({ focus: e.store.getState().focus, snapshot: I.current, editing: $m(n) }),
|
|
@@ -8392,37 +8392,37 @@ function sh({
|
|
|
8392
8392
|
onFailed: (A) => {
|
|
8393
8393
|
A instanceof tt && A.code === "context_invalid" && cr(h, ls(e.id));
|
|
8394
8394
|
}
|
|
8395
|
-
}), [O,
|
|
8395
|
+
}), [O, W] = D(""), H = ie(null);
|
|
8396
8396
|
ke(() => {
|
|
8397
8397
|
var A;
|
|
8398
|
-
(o || n) && ((A =
|
|
8398
|
+
(o || n) && ((A = H.current) == null || A.focus());
|
|
8399
8399
|
}, [o, c, n]);
|
|
8400
|
-
const
|
|
8400
|
+
const We = ie(T.askedAbout);
|
|
8401
8401
|
Ue(() => {
|
|
8402
|
-
|
|
8402
|
+
We.current = T.askedAbout;
|
|
8403
8403
|
}), ke(() => {
|
|
8404
8404
|
const { focus: A, beside: P } = e.store.getState();
|
|
8405
|
-
A &&
|
|
8405
|
+
A && We.current(A.cardId, { beside: P });
|
|
8406
8406
|
}, [c, e]);
|
|
8407
|
-
const
|
|
8407
|
+
const Ke = (w == null ? void 0 : w.id) ?? (m == null ? void 0 : m.id), K = Im(Ke), ye = Ke ? _ : [], [Ae, Ce] = D(), _e = Ae ? K.available(ye).filter((A) => A.label.toLowerCase().includes(Ae.query.toLowerCase())) : [], xe = Ae && _e.length ? { ...Ae, active: Math.min(Ae.active, _e.length - 1) } : void 0, R = ie(void 0);
|
|
8408
8408
|
Ue(() => {
|
|
8409
8409
|
var A;
|
|
8410
|
-
R.current !== void 0 && ((A =
|
|
8410
|
+
R.current !== void 0 && ((A = H.current) == null || A.setSelectionRange(R.current, R.current), R.current = void 0);
|
|
8411
8411
|
}, [O]);
|
|
8412
8412
|
const C = (A) => {
|
|
8413
|
-
|
|
8414
|
-
const P =
|
|
8415
|
-
se.text !== O && (R.current = se.caret,
|
|
8413
|
+
K.add(A);
|
|
8414
|
+
const P = H.current, se = Sm(O, (P == null ? void 0 : P.selectionStart) ?? O.length);
|
|
8415
|
+
se.text !== O && (R.current = se.caret, W(se.text)), Ce(void 0), P == null || P.focus();
|
|
8416
8416
|
}, M = (A) => {
|
|
8417
|
-
A == null || A.preventDefault(), T.send(O,
|
|
8417
|
+
A == null || A.preventDefault(), T.send(O, K.shown) === "sent" && (W(""), K.clear());
|
|
8418
8418
|
}, Z = (A) => {
|
|
8419
8419
|
var se;
|
|
8420
8420
|
const P = T.send(A) === "sent";
|
|
8421
|
-
return P && ((se =
|
|
8421
|
+
return P && ((se = H.current) == null || se.focus()), P;
|
|
8422
8422
|
}, de = (A) => {
|
|
8423
8423
|
var se;
|
|
8424
8424
|
const P = T.askAgain(A) === "sent";
|
|
8425
|
-
return P && ((se =
|
|
8425
|
+
return P && ((se = H.current) == null || se.focus()), P;
|
|
8426
8426
|
}, pe = (A) => {
|
|
8427
8427
|
if (xe) {
|
|
8428
8428
|
if (A.key === "ArrowDown" || A.key === "ArrowUp") {
|
|
@@ -8440,15 +8440,15 @@ function sh({
|
|
|
8440
8440
|
A.preventDefault(), Ce(void 0);
|
|
8441
8441
|
return;
|
|
8442
8442
|
}
|
|
8443
|
-
if (A.key === "Backspace" && !O &&
|
|
8444
|
-
|
|
8443
|
+
if (A.key === "Backspace" && !O && K.shown.length) {
|
|
8444
|
+
K.remove(K.shown[K.shown.length - 1]);
|
|
8445
8445
|
return;
|
|
8446
8446
|
}
|
|
8447
8447
|
A.key === "Enter" && !A.shiftKey && !A.nativeEvent.isComposing && M(A);
|
|
8448
8448
|
}, Q = T.messages.length === 0, [fe, ae] = D(), $e = (fe == null ? void 0 : fe.sessionKey) === T.sessionKey ? Am(T.messages, fe.artifactId) : void 0, Ie = (A) => {
|
|
8449
8449
|
ae((P) => ({ sessionKey: T.sessionKey, artifactId: A, opened: ((P == null ? void 0 : P.opened) ?? 0) + 1 })), e.leaveBeside(), i !== "full-page" && e.setLayout("full-page");
|
|
8450
8450
|
}, Oe = g === "full-page", Er = /* @__PURE__ */ p(
|
|
8451
|
-
|
|
8451
|
+
Y,
|
|
8452
8452
|
{
|
|
8453
8453
|
variant: "ghost",
|
|
8454
8454
|
size: "xs",
|
|
@@ -8458,12 +8458,12 @@ function sh({
|
|
|
8458
8458
|
disabled: Q && !T.busy && !T.loading,
|
|
8459
8459
|
onClick: () => {
|
|
8460
8460
|
var A;
|
|
8461
|
-
T.startNew(), (A =
|
|
8461
|
+
T.startNew(), (A = H.current) == null || A.focus();
|
|
8462
8462
|
},
|
|
8463
8463
|
children: /* @__PURE__ */ p(uo, { className: "h-3.5 w-3.5" })
|
|
8464
8464
|
}
|
|
8465
8465
|
), Ft = n ? null : /* @__PURE__ */ p(
|
|
8466
|
-
|
|
8466
|
+
Y,
|
|
8467
8467
|
{
|
|
8468
8468
|
variant: "ghost",
|
|
8469
8469
|
size: "xs",
|
|
@@ -8497,7 +8497,7 @@ function sh({
|
|
|
8497
8497
|
}
|
|
8498
8498
|
),
|
|
8499
8499
|
/* @__PURE__ */ p(
|
|
8500
|
-
|
|
8500
|
+
Y,
|
|
8501
8501
|
{
|
|
8502
8502
|
variant: "ghost",
|
|
8503
8503
|
size: "xs",
|
|
@@ -8521,21 +8521,21 @@ function sh({
|
|
|
8521
8521
|
T.notice ? /* @__PURE__ */ p("p", { role: "alert", className: "text-[12px] leading-[1.5] text-destructive", children: T.notice }) : null,
|
|
8522
8522
|
/* @__PURE__ */ k("form", { onSubmit: M, className: "relative rounded-control border border-input bg-background focus-within:border-ring", children: [
|
|
8523
8523
|
xe ? /* @__PURE__ */ p(Bf, { fields: _e, active: xe.active, onPick: C }) : null,
|
|
8524
|
-
|
|
8524
|
+
K.shown.length ? (
|
|
8525
8525
|
// The tagged fields sit in the question itself, before its words.
|
|
8526
|
-
/* @__PURE__ */ p("div", { className: "flex flex-wrap gap-1 px-2.5 pt-2", "data-testid": "assistant-question-tags", children:
|
|
8526
|
+
/* @__PURE__ */ p("div", { className: "flex flex-wrap gap-1 px-2.5 pt-2", "data-testid": "assistant-question-tags", children: K.shown.map((A) => /* @__PURE__ */ p(ws, { field: A, onRemove: () => K.remove(A) }, `${A.role}:${A.name}:${A.aggregate ?? ""}:${A.granularity ?? ""}`)) })
|
|
8527
8527
|
) : null,
|
|
8528
8528
|
/* @__PURE__ */ p(
|
|
8529
8529
|
"textarea",
|
|
8530
8530
|
{
|
|
8531
|
-
ref:
|
|
8531
|
+
ref: H,
|
|
8532
8532
|
"aria-label": "Message",
|
|
8533
8533
|
placeholder: w ? "Ask about this visual" : m ? "Ask about this card" : n ? "Ask about your data" : "Ask about this dashboard",
|
|
8534
8534
|
value: O,
|
|
8535
8535
|
maxLength: et.messageChars,
|
|
8536
8536
|
rows: 2,
|
|
8537
8537
|
onChange: (A) => {
|
|
8538
|
-
|
|
8538
|
+
W(A.target.value), T.notice && T.clearNotice();
|
|
8539
8539
|
const P = ks(A.target.value, A.target.selectionStart ?? A.target.value.length);
|
|
8540
8540
|
Ce(P === void 0 ? void 0 : { query: P, active: 0 });
|
|
8541
8541
|
},
|
|
@@ -8557,25 +8557,25 @@ function sh({
|
|
|
8557
8557
|
}
|
|
8558
8558
|
),
|
|
8559
8559
|
ye.length ? /* @__PURE__ */ p(
|
|
8560
|
-
|
|
8560
|
+
Y,
|
|
8561
8561
|
{
|
|
8562
8562
|
type: "button",
|
|
8563
8563
|
variant: "ghost",
|
|
8564
8564
|
size: "xs",
|
|
8565
8565
|
className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
|
|
8566
8566
|
"aria-label": "Tag a field",
|
|
8567
|
-
title:
|
|
8568
|
-
disabled:
|
|
8567
|
+
title: K.full ? `Up to ${et.taggedFields} fields per question` : "Tag a field",
|
|
8568
|
+
disabled: K.full,
|
|
8569
8569
|
onClick: () => {
|
|
8570
8570
|
var A;
|
|
8571
|
-
Ce((P) => P ? void 0 : { query: "", active: 0 }), (A =
|
|
8571
|
+
Ce((P) => P ? void 0 : { query: "", active: 0 }), (A = H.current) == null || A.focus();
|
|
8572
8572
|
},
|
|
8573
8573
|
children: /* @__PURE__ */ p(io, { className: "h-4 w-4" })
|
|
8574
8574
|
}
|
|
8575
8575
|
) : null
|
|
8576
8576
|
] }),
|
|
8577
8577
|
T.busy ? /* @__PURE__ */ p(
|
|
8578
|
-
|
|
8578
|
+
Y,
|
|
8579
8579
|
{
|
|
8580
8580
|
type: "button",
|
|
8581
8581
|
size: "xs",
|
|
@@ -8587,7 +8587,7 @@ function sh({
|
|
|
8587
8587
|
children: /* @__PURE__ */ p(lo, { className: "h-3 w-3 fill-current" })
|
|
8588
8588
|
}
|
|
8589
8589
|
) : /* @__PURE__ */ p(
|
|
8590
|
-
|
|
8590
|
+
Y,
|
|
8591
8591
|
{
|
|
8592
8592
|
type: "submit",
|
|
8593
8593
|
size: "xs",
|
|
@@ -8613,11 +8613,11 @@ function sh({
|
|
|
8613
8613
|
onOpen: async (A) => {
|
|
8614
8614
|
var se;
|
|
8615
8615
|
const P = await T.open(A);
|
|
8616
|
-
return P === "opened" && ((se =
|
|
8616
|
+
return P === "opened" && ((se = H.current) == null || se.focus()), P;
|
|
8617
8617
|
},
|
|
8618
8618
|
onDeleted: (A) => {
|
|
8619
8619
|
var P;
|
|
8620
|
-
A === T.conversationId && (T.startNew(), (P =
|
|
8620
|
+
A === T.conversationId && (T.startNew(), (P = H.current) == null || P.focus());
|
|
8621
8621
|
},
|
|
8622
8622
|
answeringId: T.busy ? T.conversationId : void 0,
|
|
8623
8623
|
header: /* @__PURE__ */ k("div", { className: "flex h-11 shrink-0 items-center justify-between gap-2 px-3", children: [
|
|
@@ -8653,17 +8653,17 @@ function sh({
|
|
|
8653
8653
|
] }),
|
|
8654
8654
|
/* @__PURE__ */ k("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
8655
8655
|
/* @__PURE__ */ k(
|
|
8656
|
-
|
|
8656
|
+
Y,
|
|
8657
8657
|
{
|
|
8658
8658
|
variant: "ghost",
|
|
8659
8659
|
size: "xs",
|
|
8660
8660
|
className: "h-7 gap-1 px-1.5 text-[11.5px] text-muted-foreground hover:text-foreground",
|
|
8661
8661
|
onClick: () => {
|
|
8662
8662
|
var A;
|
|
8663
|
-
e.leaveBeside(), (A =
|
|
8663
|
+
e.leaveBeside(), (A = H.current) == null || A.focus();
|
|
8664
8664
|
},
|
|
8665
8665
|
children: [
|
|
8666
|
-
/* @__PURE__ */ p(
|
|
8666
|
+
/* @__PURE__ */ p(Yn, { className: "h-3.5 w-3.5" }),
|
|
8667
8667
|
"Open in assistant"
|
|
8668
8668
|
]
|
|
8669
8669
|
}
|
|
@@ -8810,7 +8810,7 @@ function Mm({
|
|
|
8810
8810
|
i(_.scrollHeight - _.scrollTop - _.clientHeight < 24), g.current = Om(_);
|
|
8811
8811
|
},
|
|
8812
8812
|
children: t ? null : /* @__PURE__ */ p(
|
|
8813
|
-
|
|
8813
|
+
Hf,
|
|
8814
8814
|
{
|
|
8815
8815
|
messages: e.messages,
|
|
8816
8816
|
status: e.status,
|
|
@@ -8829,7 +8829,7 @@ function Mm({
|
|
|
8829
8829
|
}
|
|
8830
8830
|
),
|
|
8831
8831
|
!t && !f ? /* @__PURE__ */ p(
|
|
8832
|
-
|
|
8832
|
+
Y,
|
|
8833
8833
|
{
|
|
8834
8834
|
variant: "outline",
|
|
8835
8835
|
size: "xs",
|