@flamingo-stack/openframe-frontend-core 0.0.552 → 0.0.553-1815.4814.1
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/{chunk-KSGQG6WU.js → chunk-27WZGFQZ.js} +2 -2
- package/dist/{chunk-WXDDPK7T.js → chunk-2JYC2GZV.js} +4 -4
- package/dist/{chunk-7TRIUG7Q.js → chunk-3RBHFJ3L.js} +5 -5
- package/dist/{chunk-TI75367M.js → chunk-3RPRI46G.js} +651 -548
- package/dist/chunk-3RPRI46G.js.map +1 -0
- package/dist/{chunk-4DD3223G.js → chunk-4NICA4QT.js} +6 -6
- package/dist/{chunk-Y64725GI.cjs → chunk-5AB6GPNZ.cjs} +61 -61
- package/dist/{chunk-Y64725GI.cjs.map → chunk-5AB6GPNZ.cjs.map} +1 -1
- package/dist/{chunk-SIXNMDYY.js → chunk-77BW6SN6.js} +2 -2
- package/dist/{chunk-Y6PD76R6.js → chunk-7VIJUKWE.js} +2 -2
- package/dist/{chunk-HK5YRHEN.cjs → chunk-CWQKH7BW.cjs} +9 -9
- package/dist/{chunk-HK5YRHEN.cjs.map → chunk-CWQKH7BW.cjs.map} +1 -1
- package/dist/{chunk-PVPXI5V6.cjs → chunk-HDUBS5Y5.cjs} +31 -31
- package/dist/{chunk-PVPXI5V6.cjs.map → chunk-HDUBS5Y5.cjs.map} +1 -1
- package/dist/{chunk-X4RCWYYF.cjs → chunk-I2WN5X6Q.cjs} +798 -695
- package/dist/chunk-I2WN5X6Q.cjs.map +1 -0
- package/dist/{chunk-RMTTW7LG.cjs → chunk-IBDY7C65.cjs} +27 -27
- package/dist/{chunk-RMTTW7LG.cjs.map → chunk-IBDY7C65.cjs.map} +1 -1
- package/dist/{chunk-MVE2YQVG.cjs → chunk-IBEZSTFR.cjs} +20 -20
- package/dist/{chunk-MVE2YQVG.cjs.map → chunk-IBEZSTFR.cjs.map} +1 -1
- package/dist/{chunk-Z5UK7SKC.js → chunk-KJSLAD6K.js} +4 -4
- package/dist/{chunk-6MHMEF5W.cjs → chunk-MOL2OYPN.cjs} +39 -39
- package/dist/{chunk-6MHMEF5W.cjs.map → chunk-MOL2OYPN.cjs.map} +1 -1
- package/dist/{chunk-7MPOW46J.js → chunk-ND53XFLK.js} +2 -2
- package/dist/{chunk-4XG7TG7B.cjs → chunk-NLGMSRVW.cjs} +7 -7
- package/dist/{chunk-4XG7TG7B.cjs.map → chunk-NLGMSRVW.cjs.map} +1 -1
- package/dist/{chunk-SXXIV7IL.cjs → chunk-NTOO6MFG.cjs} +86 -86
- package/dist/{chunk-SXXIV7IL.cjs.map → chunk-NTOO6MFG.cjs.map} +1 -1
- package/dist/{chunk-6J6Q5QEM.cjs → chunk-RWFUYIOD.cjs} +4 -4
- package/dist/{chunk-6J6Q5QEM.cjs.map → chunk-RWFUYIOD.cjs.map} +1 -1
- package/dist/{chunk-XEOZB5DX.cjs → chunk-SS4ZY4RI.cjs} +3 -3
- package/dist/{chunk-XEOZB5DX.cjs.map → chunk-SS4ZY4RI.cjs.map} +1 -1
- package/dist/{chunk-RJEP74Z4.js → chunk-T3FQIBZB.js} +2 -2
- package/dist/{chunk-BFOXIIM4.js → chunk-TOLUP7IV.js} +2 -2
- package/dist/{chunk-OVQ3O66O.cjs → chunk-TPTBRKY6.cjs} +5 -5
- package/dist/{chunk-OVQ3O66O.cjs.map → chunk-TPTBRKY6.cjs.map} +1 -1
- package/dist/{chunk-RJSDYOFD.js → chunk-TUOUCWOB.js} +2 -2
- package/dist/{chunk-CMDPARDV.js → chunk-VL3LF754.js} +2 -2
- package/dist/{chunk-DOPZ5LCH.cjs → chunk-X5ANHCAH.cjs} +14 -14
- package/dist/{chunk-DOPZ5LCH.cjs.map → chunk-X5ANHCAH.cjs.map} +1 -1
- package/dist/{chunk-6XOJTTWY.js → chunk-XEQMFPML.js} +2 -2
- package/dist/{chunk-RMWLUKTC.cjs → chunk-Y4WUGTXF.cjs} +11 -11
- package/dist/{chunk-RMWLUKTC.cjs.map → chunk-Y4WUGTXF.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/board/board-column.d.ts +6 -3
- package/dist/components/features/board/board-column.d.ts.map +1 -1
- package/dist/components/features/board/board.d.ts +3 -3
- package/dist/components/features/board/board.d.ts.map +1 -1
- package/dist/components/features/board/drop-target.d.ts +64 -0
- package/dist/components/features/board/drop-target.d.ts.map +1 -0
- package/dist/components/features/board/ticket-card.d.ts +11 -6
- package/dist/components/features/board/ticket-card.d.ts.map +1 -1
- package/dist/components/features/board/use-lane-scroll-anchor.d.ts +24 -0
- package/dist/components/features/board/use-lane-scroll-anchor.d.ts.map +1 -0
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +131 -131
- package/dist/components/index.js +11 -11
- package/dist/components/meeting-scheduler/index.cjs +28 -28
- package/dist/components/meeting-scheduler/index.js +3 -3
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/__tests__/board-drop-target.test.ts +218 -0
- package/src/components/features/board/board-column.tsx +50 -40
- package/src/components/features/board/board.tsx +42 -40
- package/src/components/features/board/drop-target.ts +164 -0
- package/src/components/features/board/ticket-card.tsx +36 -16
- package/src/components/features/board/use-lane-scroll-anchor.ts +75 -0
- package/src/stories/Board.stories.tsx +16 -7
- package/dist/chunk-TI75367M.js.map +0 -1
- package/dist/chunk-X4RCWYYF.cjs.map +0 -1
- /package/dist/{chunk-KSGQG6WU.js.map → chunk-27WZGFQZ.js.map} +0 -0
- /package/dist/{chunk-WXDDPK7T.js.map → chunk-2JYC2GZV.js.map} +0 -0
- /package/dist/{chunk-7TRIUG7Q.js.map → chunk-3RBHFJ3L.js.map} +0 -0
- /package/dist/{chunk-4DD3223G.js.map → chunk-4NICA4QT.js.map} +0 -0
- /package/dist/{chunk-SIXNMDYY.js.map → chunk-77BW6SN6.js.map} +0 -0
- /package/dist/{chunk-Y6PD76R6.js.map → chunk-7VIJUKWE.js.map} +0 -0
- /package/dist/{chunk-Z5UK7SKC.js.map → chunk-KJSLAD6K.js.map} +0 -0
- /package/dist/{chunk-7MPOW46J.js.map → chunk-ND53XFLK.js.map} +0 -0
- /package/dist/{chunk-RJEP74Z4.js.map → chunk-T3FQIBZB.js.map} +0 -0
- /package/dist/{chunk-BFOXIIM4.js.map → chunk-TOLUP7IV.js.map} +0 -0
- /package/dist/{chunk-RJSDYOFD.js.map → chunk-TUOUCWOB.js.map} +0 -0
- /package/dist/{chunk-CMDPARDV.js.map → chunk-VL3LF754.js.map} +0 -0
- /package/dist/{chunk-6XOJTTWY.js.map → chunk-XEQMFPML.js.map} +0 -0
|
@@ -292,7 +292,7 @@ import {
|
|
|
292
292
|
|
|
293
293
|
// src/components/pagination.tsx
|
|
294
294
|
import { ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight6, MoreHorizontal as MoreHorizontal2 } from "lucide-react";
|
|
295
|
-
import * as
|
|
295
|
+
import * as React126 from "react";
|
|
296
296
|
import { jsx as jsx339, jsxs as jsxs265 } from "react/jsx-runtime";
|
|
297
297
|
var Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationEllipsis, PaginationPrevious, PaginationNext;
|
|
298
298
|
var init_pagination = __esm({
|
|
@@ -384,19 +384,19 @@ var init_pagination = __esm({
|
|
|
384
384
|
) })
|
|
385
385
|
] }) });
|
|
386
386
|
};
|
|
387
|
-
PaginationContent =
|
|
387
|
+
PaginationContent = React126.forwardRef(
|
|
388
388
|
({ className, ...props }, ref) => {
|
|
389
389
|
return /* @__PURE__ */ jsx339("ul", { ref, className: cn("flex items-center justify-center", className), ...props });
|
|
390
390
|
}
|
|
391
391
|
);
|
|
392
392
|
PaginationContent.displayName = "PaginationContent";
|
|
393
|
-
PaginationItem =
|
|
393
|
+
PaginationItem = React126.forwardRef(
|
|
394
394
|
({ className, ...props }, ref) => {
|
|
395
395
|
return /* @__PURE__ */ jsx339("li", { ref, className: cn("", className), ...props });
|
|
396
396
|
}
|
|
397
397
|
);
|
|
398
398
|
PaginationItem.displayName = "PaginationItem";
|
|
399
|
-
PaginationLink =
|
|
399
|
+
PaginationLink = React126.forwardRef(
|
|
400
400
|
({ className, ...props }, ref) => {
|
|
401
401
|
return /* @__PURE__ */ jsx339(
|
|
402
402
|
"button",
|
|
@@ -412,7 +412,7 @@ var init_pagination = __esm({
|
|
|
412
412
|
}
|
|
413
413
|
);
|
|
414
414
|
PaginationLink.displayName = "PaginationLink";
|
|
415
|
-
PaginationEllipsis =
|
|
415
|
+
PaginationEllipsis = React126.forwardRef(
|
|
416
416
|
({ className, ...props }, ref) => {
|
|
417
417
|
return /* @__PURE__ */ jsxs265(
|
|
418
418
|
"span",
|
|
@@ -429,7 +429,7 @@ var init_pagination = __esm({
|
|
|
429
429
|
}
|
|
430
430
|
);
|
|
431
431
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
432
|
-
PaginationPrevious =
|
|
432
|
+
PaginationPrevious = React126.forwardRef(
|
|
433
433
|
({ className, ...props }, ref) => {
|
|
434
434
|
return /* @__PURE__ */ jsxs265(Button, { ref, variant: "outline", size: "icon", className: cn("h-10 w-10", className), ...props, children: [
|
|
435
435
|
/* @__PURE__ */ jsx339(ChevronLeft2, { className: "h-4 w-4" }),
|
|
@@ -438,7 +438,7 @@ var init_pagination = __esm({
|
|
|
438
438
|
}
|
|
439
439
|
);
|
|
440
440
|
PaginationPrevious.displayName = "PaginationPrevious";
|
|
441
|
-
PaginationNext =
|
|
441
|
+
PaginationNext = React126.forwardRef(
|
|
442
442
|
({ className, ...props }, ref) => {
|
|
443
443
|
return /* @__PURE__ */ jsxs265(Button, { ref, variant: "outline", size: "icon", className: cn("h-10 w-10", className), ...props, children: [
|
|
444
444
|
/* @__PURE__ */ jsx339(ChevronRight6, { className: "h-4 w-4" }),
|
|
@@ -30246,7 +30246,7 @@ function OrganizationCard({
|
|
|
30246
30246
|
|
|
30247
30247
|
// src/components/ui/service-card.tsx
|
|
30248
30248
|
init_cn();
|
|
30249
|
-
import { useMemo as
|
|
30249
|
+
import { useMemo as useMemo45, useState as useState98 } from "react";
|
|
30250
30250
|
import { ExternalLink as ExternalLink8 } from "lucide-react";
|
|
30251
30251
|
|
|
30252
30252
|
// src/components/providers/dynamic-theme-provider.tsx
|
|
@@ -39526,15 +39526,12 @@ function TimeTrackerHeaderButton({ className, disabled }) {
|
|
|
39526
39526
|
}
|
|
39527
39527
|
|
|
39528
39528
|
// src/components/features/board/board.tsx
|
|
39529
|
-
import
|
|
39529
|
+
import { Fragment as Fragment56, useCallback as useCallback35, useEffect as useEffect69, useMemo as useMemo41, useRef as useRef50, useState as useState90 } from "react";
|
|
39530
39530
|
import {
|
|
39531
39531
|
DndContext,
|
|
39532
39532
|
DragOverlay,
|
|
39533
39533
|
KeyboardSensor,
|
|
39534
39534
|
PointerSensor,
|
|
39535
|
-
closestCorners,
|
|
39536
|
-
pointerWithin,
|
|
39537
|
-
rectIntersection,
|
|
39538
39535
|
useSensor,
|
|
39539
39536
|
useSensors
|
|
39540
39537
|
} from "@dnd-kit/core";
|
|
@@ -39544,7 +39541,7 @@ init_cn();
|
|
|
39544
39541
|
// src/components/features/board/board-column.tsx
|
|
39545
39542
|
import { useDroppable } from "@dnd-kit/core";
|
|
39546
39543
|
import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
39547
|
-
import
|
|
39544
|
+
import { memo as memo8, useEffect as useEffect68, useMemo as useMemo40, useRef as useRef49 } from "react";
|
|
39548
39545
|
init_cn();
|
|
39549
39546
|
|
|
39550
39547
|
// src/components/features/board/board-column-header.tsx
|
|
@@ -39657,7 +39654,7 @@ function tintOnDark(hex) {
|
|
|
39657
39654
|
init_next_link();
|
|
39658
39655
|
import { useSortable } from "@dnd-kit/sortable";
|
|
39659
39656
|
import { CSS } from "@dnd-kit/utilities";
|
|
39660
|
-
import
|
|
39657
|
+
import { memo as memo7, useMemo as useMemo39 } from "react";
|
|
39661
39658
|
init_cn();
|
|
39662
39659
|
|
|
39663
39660
|
// src/components/features/board/board-ticket-approval.tsx
|
|
@@ -39712,6 +39709,35 @@ function BoardTicketApproval({ pendingApproval, onApprove, onReject }) {
|
|
|
39712
39709
|
] });
|
|
39713
39710
|
}
|
|
39714
39711
|
|
|
39712
|
+
// src/components/features/board/use-lane-scroll-anchor.ts
|
|
39713
|
+
import { useRef as useRef48 } from "react";
|
|
39714
|
+
var TICKET_ID_ATTRIBUTE = "data-ticket-id";
|
|
39715
|
+
function cardPositions(root) {
|
|
39716
|
+
return Array.from(root.querySelectorAll(`[${TICKET_ID_ATTRIBUTE}]`)).map((element) => ({
|
|
39717
|
+
id: element.getAttribute(TICKET_ID_ATTRIBUTE) ?? "",
|
|
39718
|
+
offsetTop: element.offsetTop
|
|
39719
|
+
}));
|
|
39720
|
+
}
|
|
39721
|
+
function useLaneScrollAnchor(scrollRef, tickets) {
|
|
39722
|
+
const positionsRef = useRef48([]);
|
|
39723
|
+
useIsomorphicLayoutEffect(() => {
|
|
39724
|
+
const root = scrollRef.current;
|
|
39725
|
+
if (!root) return;
|
|
39726
|
+
const previous = positionsRef.current;
|
|
39727
|
+
const scrollTop = root.scrollTop;
|
|
39728
|
+
const current = cardPositions(root);
|
|
39729
|
+
if (previous.length > 0 && scrollTop > 0) {
|
|
39730
|
+
const anchor = previous.find((card) => card.offsetTop >= scrollTop) ?? previous[previous.length - 1];
|
|
39731
|
+
const moved = current.find((card) => card.id === anchor.id);
|
|
39732
|
+
if (moved) {
|
|
39733
|
+
const drift = moved.offsetTop - anchor.offsetTop;
|
|
39734
|
+
if (Math.abs(drift) >= 1) root.scrollTop = scrollTop + drift;
|
|
39735
|
+
}
|
|
39736
|
+
}
|
|
39737
|
+
positionsRef.current = current;
|
|
39738
|
+
}, [tickets]);
|
|
39739
|
+
}
|
|
39740
|
+
|
|
39715
39741
|
// src/components/features/board/ticket-card.tsx
|
|
39716
39742
|
import { Fragment as Fragment54, jsx as jsx297, jsxs as jsxs228 } from "react/jsx-runtime";
|
|
39717
39743
|
var PRIORITY_COLOR_CLASS = {
|
|
@@ -39822,7 +39848,7 @@ function TicketCardView({ className, ...bodyProps }) {
|
|
|
39822
39848
|
}
|
|
39823
39849
|
);
|
|
39824
39850
|
}
|
|
39825
|
-
|
|
39851
|
+
var TicketCard = memo7(function TicketCard2({
|
|
39826
39852
|
ticket,
|
|
39827
39853
|
columnId,
|
|
39828
39854
|
columnColor,
|
|
@@ -39833,7 +39859,7 @@ function TicketCard({
|
|
|
39833
39859
|
onApprove,
|
|
39834
39860
|
onReject
|
|
39835
39861
|
}) {
|
|
39836
|
-
const sortableData =
|
|
39862
|
+
const sortableData = useMemo39(() => ({ columnId, type: "ticket" }), [columnId]);
|
|
39837
39863
|
const sortable = useSortable({ id: ticket.id, data: sortableData, disabled: dragDisabled });
|
|
39838
39864
|
const showNewMessage = !!ticket.hasNewMessage && !!columnColor;
|
|
39839
39865
|
const style = isOverlay ? {} : {
|
|
@@ -39844,15 +39870,18 @@ function TicketCard({
|
|
|
39844
39870
|
const handleClick = (e) => {
|
|
39845
39871
|
if (sortable.isDragging) e.preventDefault();
|
|
39846
39872
|
};
|
|
39847
|
-
const body =
|
|
39848
|
-
|
|
39849
|
-
|
|
39850
|
-
|
|
39851
|
-
|
|
39852
|
-
|
|
39853
|
-
|
|
39854
|
-
|
|
39855
|
-
|
|
39873
|
+
const body = useMemo39(
|
|
39874
|
+
() => /* @__PURE__ */ jsx297(
|
|
39875
|
+
TicketCardBody,
|
|
39876
|
+
{
|
|
39877
|
+
ticket,
|
|
39878
|
+
columnColor,
|
|
39879
|
+
renderAssignSlot,
|
|
39880
|
+
onApprove: onApprove ? (requestId) => onApprove(ticket.id, requestId) : void 0,
|
|
39881
|
+
onReject: onReject ? (requestId) => onReject(ticket.id, requestId) : void 0
|
|
39882
|
+
}
|
|
39883
|
+
),
|
|
39884
|
+
[ticket, columnColor, renderAssignSlot, onApprove, onReject]
|
|
39856
39885
|
);
|
|
39857
39886
|
const cardClasses = cn(
|
|
39858
39887
|
TICKET_CARD_SHELL,
|
|
@@ -39864,6 +39893,9 @@ function TicketCard({
|
|
|
39864
39893
|
ref: isOverlay ? void 0 : sortable.setNodeRef,
|
|
39865
39894
|
style,
|
|
39866
39895
|
className: cardClasses,
|
|
39896
|
+
// Read by the lane's scroll anchor to keep the list still when tickets are
|
|
39897
|
+
// inserted above the viewport — see `use-lane-scroll-anchor.ts`.
|
|
39898
|
+
...isOverlay ? {} : { [TICKET_ID_ATTRIBUTE]: ticket.id },
|
|
39867
39899
|
...isOverlay ? {} : sortable.attributes,
|
|
39868
39900
|
...isOverlay ? {} : sortable.listeners
|
|
39869
39901
|
};
|
|
@@ -39899,7 +39931,7 @@ function TicketCard({
|
|
|
39899
39931
|
),
|
|
39900
39932
|
/* @__PURE__ */ jsx297("div", { className: cn("pointer-events-none", innerWrapperClass), children: body })
|
|
39901
39933
|
] });
|
|
39902
|
-
}
|
|
39934
|
+
});
|
|
39903
39935
|
function TicketTagRow({ tags }) {
|
|
39904
39936
|
const visible = tags.slice(0, MAX_VISIBLE_TAGS);
|
|
39905
39937
|
const hidden = tags.length - visible.length;
|
|
@@ -39910,10 +39942,10 @@ function TicketTagRow({ tags }) {
|
|
|
39910
39942
|
}
|
|
39911
39943
|
|
|
39912
39944
|
// src/components/features/board/ticket-card-skeleton.tsx
|
|
39913
|
-
import * as
|
|
39945
|
+
import * as React110 from "react";
|
|
39914
39946
|
init_cn();
|
|
39915
39947
|
import { jsx as jsx298, jsxs as jsxs229 } from "react/jsx-runtime";
|
|
39916
|
-
var TicketCardSkeleton =
|
|
39948
|
+
var TicketCardSkeleton = React110.forwardRef(
|
|
39917
39949
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxs229(
|
|
39918
39950
|
"div",
|
|
39919
39951
|
{
|
|
@@ -39949,7 +39981,7 @@ TicketCardSkeleton.displayName = "TicketCardSkeleton";
|
|
|
39949
39981
|
|
|
39950
39982
|
// src/components/features/board/board-column.tsx
|
|
39951
39983
|
import { Fragment as Fragment55, jsx as jsx299, jsxs as jsxs230 } from "react/jsx-runtime";
|
|
39952
|
-
|
|
39984
|
+
var BoardColumn = memo8(function BoardColumn2({
|
|
39953
39985
|
column,
|
|
39954
39986
|
collapsed = false,
|
|
39955
39987
|
onToggleCollapse,
|
|
@@ -39964,16 +39996,24 @@ function BoardColumn({
|
|
|
39964
39996
|
joinLeft = false,
|
|
39965
39997
|
joinRight = false
|
|
39966
39998
|
}) {
|
|
39999
|
+
const droppableData = useMemo40(() => ({ columnId: column.id, type: "column" }), [column.id]);
|
|
40000
|
+
const { setNodeRef: setLaneRef, isOver } = useDroppable({
|
|
40001
|
+
id: `column:${column.id}`,
|
|
40002
|
+
data: droppableData,
|
|
40003
|
+
disabled: column.dropDisabled || collapsed
|
|
40004
|
+
});
|
|
39967
40005
|
return /* @__PURE__ */ jsxs230(
|
|
39968
40006
|
"div",
|
|
39969
40007
|
{
|
|
40008
|
+
ref: setLaneRef,
|
|
39970
40009
|
className: cn(
|
|
39971
40010
|
"flex h-full shrink-0 flex-col gap-[var(--spacing-system-sf)] overflow-hidden rounded-md border border-ods-border p-[var(--spacing-system-sf)]",
|
|
39972
40011
|
"transition-[width] duration-300 ease-out",
|
|
39973
40012
|
collapsed ? "w-14" : "w-[400px]",
|
|
39974
40013
|
column.system && "bg-ods-card",
|
|
39975
40014
|
joinLeft && "rounded-l-none border-l-0",
|
|
39976
|
-
joinRight && "rounded-r-none"
|
|
40015
|
+
joinRight && "rounded-r-none",
|
|
40016
|
+
isOver && "outline outline-2 -outline-offset-2 outline-ods-focus"
|
|
39977
40017
|
),
|
|
39978
40018
|
style: column.system ? void 0 : { backgroundColor: tintOnDark(column.color) },
|
|
39979
40019
|
children: [
|
|
@@ -40005,25 +40045,25 @@ function BoardColumn({
|
|
|
40005
40045
|
]
|
|
40006
40046
|
}
|
|
40007
40047
|
);
|
|
40008
|
-
}
|
|
40009
|
-
function ColumnBody({
|
|
40010
|
-
|
|
40011
|
-
|
|
40012
|
-
|
|
40013
|
-
|
|
40014
|
-
|
|
40015
|
-
|
|
40016
|
-
|
|
40017
|
-
|
|
40018
|
-
|
|
40019
|
-
|
|
40020
|
-
const
|
|
40021
|
-
|
|
40022
|
-
const loadMoreRef =
|
|
40048
|
+
});
|
|
40049
|
+
function ColumnBody({
|
|
40050
|
+
column,
|
|
40051
|
+
getTicketHref,
|
|
40052
|
+
renderAssignSlot,
|
|
40053
|
+
onApprove,
|
|
40054
|
+
onReject,
|
|
40055
|
+
onLoadMore,
|
|
40056
|
+
loadMoreRootMargin
|
|
40057
|
+
}) {
|
|
40058
|
+
const ticketIds = useMemo40(() => column.tickets.map((t) => t.id), [column.tickets]);
|
|
40059
|
+
const scrollRef = useRef49(null);
|
|
40060
|
+
const sentinelRef = useRef49(null);
|
|
40061
|
+
useLaneScrollAnchor(scrollRef, column.tickets);
|
|
40062
|
+
const loadMoreRef = useRef49(onLoadMore);
|
|
40023
40063
|
loadMoreRef.current = onLoadMore;
|
|
40024
|
-
const columnIdRef =
|
|
40064
|
+
const columnIdRef = useRef49(column.id);
|
|
40025
40065
|
columnIdRef.current = column.id;
|
|
40026
|
-
|
|
40066
|
+
useEffect68(() => {
|
|
40027
40067
|
if (!column.hasMore || column.isLoadingMore) return;
|
|
40028
40068
|
const sentinel = sentinelRef.current;
|
|
40029
40069
|
const root = scrollRef.current;
|
|
@@ -40039,48 +40079,40 @@ function ColumnBody({ column, getTicketHref, renderAssignSlot, onApprove, onReje
|
|
|
40039
40079
|
observer.observe(sentinel);
|
|
40040
40080
|
return () => observer.disconnect();
|
|
40041
40081
|
}, [column.hasMore, column.isLoadingMore, loadMoreRootMargin]);
|
|
40042
|
-
|
|
40043
|
-
|
|
40044
|
-
|
|
40045
|
-
|
|
40046
|
-
|
|
40047
|
-
|
|
40048
|
-
|
|
40049
|
-
|
|
40050
|
-
|
|
40051
|
-
|
|
40052
|
-
|
|
40053
|
-
|
|
40054
|
-
|
|
40055
|
-
|
|
40056
|
-
|
|
40057
|
-
|
|
40058
|
-
|
|
40059
|
-
|
|
40060
|
-
|
|
40061
|
-
|
|
40062
|
-
|
|
40063
|
-
|
|
40064
|
-
|
|
40065
|
-
|
|
40066
|
-
|
|
40067
|
-
|
|
40068
|
-
|
|
40069
|
-
|
|
40070
|
-
|
|
40071
|
-
|
|
40072
|
-
column.isLoadingMore && !column.isLoading && /* @__PURE__ */ jsx299(TicketCardSkeleton, {}),
|
|
40073
|
-
column.hasMore && /* @__PURE__ */ jsx299("div", { ref: sentinelRef, "aria-hidden": true, className: "h-1 shrink-0" })
|
|
40074
|
-
]
|
|
40075
|
-
}
|
|
40082
|
+
return (
|
|
40083
|
+
// `overflow-anchor:none` hands scroll anchoring to `useLaneScrollAnchor`
|
|
40084
|
+
// wholesale. The browser's own anchoring is unusable here — it silently
|
|
40085
|
+
// skips transformed elements, so it works between drags and does nothing
|
|
40086
|
+
// during one — and leaving both on double-corrects every insertion.
|
|
40087
|
+
/* @__PURE__ */ jsxs230(
|
|
40088
|
+
"div",
|
|
40089
|
+
{
|
|
40090
|
+
ref: scrollRef,
|
|
40091
|
+
className: "flex min-h-0 flex-1 flex-col gap-[var(--spacing-system-xs)] overflow-y-auto [overflow-anchor:none]",
|
|
40092
|
+
children: [
|
|
40093
|
+
/* @__PURE__ */ jsx299(SortableContext, { items: ticketIds, strategy: verticalListSortingStrategy, children: column.isLoading ? /* @__PURE__ */ jsx299(SkeletonStack, {}) : column.tickets.length === 0 ? /* @__PURE__ */ jsx299(EmptyState2, {}) : column.tickets.map((t) => /* @__PURE__ */ jsx299(
|
|
40094
|
+
TicketCard,
|
|
40095
|
+
{
|
|
40096
|
+
ticket: t,
|
|
40097
|
+
columnId: column.id,
|
|
40098
|
+
columnColor: column.color,
|
|
40099
|
+
href: getTicketHref?.(t.id),
|
|
40100
|
+
renderAssignSlot,
|
|
40101
|
+
onApprove,
|
|
40102
|
+
onReject,
|
|
40103
|
+
dragDisabled: column.dragDisabled
|
|
40104
|
+
},
|
|
40105
|
+
t.id
|
|
40106
|
+
)) }),
|
|
40107
|
+
column.isLoadingMore && !column.isLoading && /* @__PURE__ */ jsx299(TicketCardSkeleton, {}),
|
|
40108
|
+
column.hasMore && /* @__PURE__ */ jsx299("div", { ref: sentinelRef, "aria-hidden": true, className: "h-1 shrink-0" })
|
|
40109
|
+
]
|
|
40110
|
+
}
|
|
40111
|
+
)
|
|
40076
40112
|
);
|
|
40077
40113
|
}
|
|
40078
40114
|
function SkeletonStack({ count = 4 }) {
|
|
40079
|
-
|
|
40080
|
-
() => Array.from({ length: count }, () => Math.random().toString(36).slice(2)),
|
|
40081
|
-
[count]
|
|
40082
|
-
);
|
|
40083
|
-
return /* @__PURE__ */ jsx299(Fragment55, { children: keys.map((k) => /* @__PURE__ */ jsx299(TicketCardSkeleton, {}, k)) });
|
|
40115
|
+
return /* @__PURE__ */ jsx299(Fragment55, { children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx299(TicketCardSkeleton, {}, `skeleton-${i}`)) });
|
|
40084
40116
|
}
|
|
40085
40117
|
function EmptyState2() {
|
|
40086
40118
|
return /* @__PURE__ */ jsxs230("div", { className: "flex flex-1 flex-col items-center justify-center gap-[var(--spacing-system-lf)] p-[var(--spacing-system-lf)] text-center text-ods-text-secondary", children: [
|
|
@@ -40092,8 +40124,86 @@ function EmptyState2() {
|
|
|
40092
40124
|
] });
|
|
40093
40125
|
}
|
|
40094
40126
|
|
|
40127
|
+
// src/components/features/board/drop-target.ts
|
|
40128
|
+
import {
|
|
40129
|
+
closestCorners,
|
|
40130
|
+
pointerWithin,
|
|
40131
|
+
rectIntersection
|
|
40132
|
+
} from "@dnd-kit/core";
|
|
40133
|
+
function droppableDataOf(collision) {
|
|
40134
|
+
return collision.data?.droppableContainer?.data?.current;
|
|
40135
|
+
}
|
|
40136
|
+
function detectCollisions(args, pointerHits) {
|
|
40137
|
+
const intersections = pointerHits.length > 0 ? pointerHits : rectIntersection(args);
|
|
40138
|
+
const ticketHit = intersections.find((c) => droppableDataOf(c)?.type === "ticket");
|
|
40139
|
+
if (ticketHit) return [ticketHit];
|
|
40140
|
+
const columnHit = intersections.find((c) => droppableDataOf(c)?.type === "column");
|
|
40141
|
+
if (columnHit) {
|
|
40142
|
+
const { columnId } = droppableDataOf(columnHit) ?? {};
|
|
40143
|
+
const ticketsInColumn = args.droppableContainers.filter((container) => {
|
|
40144
|
+
if (container.id === args.active.id) return false;
|
|
40145
|
+
const data = container.data.current;
|
|
40146
|
+
return data?.type === "ticket" && data.columnId === columnId;
|
|
40147
|
+
});
|
|
40148
|
+
if (ticketsInColumn.length > 0) {
|
|
40149
|
+
const closest = closestCorners({ ...args, droppableContainers: ticketsInColumn });
|
|
40150
|
+
if (closest.length > 0) return closest;
|
|
40151
|
+
}
|
|
40152
|
+
return [columnHit];
|
|
40153
|
+
}
|
|
40154
|
+
return closestCorners(args);
|
|
40155
|
+
}
|
|
40156
|
+
var animationFrameScheduler = (callback) => {
|
|
40157
|
+
const id = requestAnimationFrame(callback);
|
|
40158
|
+
return () => cancelAnimationFrame(id);
|
|
40159
|
+
};
|
|
40160
|
+
function createDropTargetResolver(scheduleFrame = animationFrameScheduler) {
|
|
40161
|
+
let settling = false;
|
|
40162
|
+
let cancelFrame = null;
|
|
40163
|
+
let lastOverId = null;
|
|
40164
|
+
const clearFrame = () => {
|
|
40165
|
+
cancelFrame?.();
|
|
40166
|
+
cancelFrame = null;
|
|
40167
|
+
};
|
|
40168
|
+
const keepLastTarget = (args) => {
|
|
40169
|
+
if (lastOverId === null) return null;
|
|
40170
|
+
const last = args.droppableContainers.find((c) => c.id === lastOverId);
|
|
40171
|
+
return last ? [{ id: last.id, data: { droppableContainer: last, value: 0 } }] : null;
|
|
40172
|
+
};
|
|
40173
|
+
return {
|
|
40174
|
+
detect: (args) => {
|
|
40175
|
+
if (settling) {
|
|
40176
|
+
const frozen = keepLastTarget(args);
|
|
40177
|
+
if (frozen) return frozen;
|
|
40178
|
+
}
|
|
40179
|
+
const pointerHits = args.pointerCoordinates ? pointerWithin(args) : [];
|
|
40180
|
+
if (args.pointerCoordinates && pointerHits.length === 0) {
|
|
40181
|
+
const held = keepLastTarget(args);
|
|
40182
|
+
if (held) return held;
|
|
40183
|
+
}
|
|
40184
|
+
const collisions = detectCollisions(args, pointerHits);
|
|
40185
|
+
if (collisions.length > 0) lastOverId = collisions[0].id;
|
|
40186
|
+
return collisions;
|
|
40187
|
+
},
|
|
40188
|
+
freeze: () => {
|
|
40189
|
+
settling = true;
|
|
40190
|
+
clearFrame();
|
|
40191
|
+
cancelFrame = scheduleFrame(() => {
|
|
40192
|
+
cancelFrame = null;
|
|
40193
|
+
settling = false;
|
|
40194
|
+
});
|
|
40195
|
+
},
|
|
40196
|
+
release: () => {
|
|
40197
|
+
clearFrame();
|
|
40198
|
+
settling = false;
|
|
40199
|
+
lastOverId = null;
|
|
40200
|
+
},
|
|
40201
|
+
dispose: clearFrame
|
|
40202
|
+
};
|
|
40203
|
+
}
|
|
40204
|
+
|
|
40095
40205
|
// src/components/features/board/use-board-collapse.ts
|
|
40096
|
-
import { useCallback as
|
|
40206
|
+
import { useCallback as useCallback34, useState as useState89 } from "react";
|
|
40097
40207
|
function useBoardCollapse(storageKey) {
|
|
40098
40208
|
const [persisted, setPersisted] = useLocalStorage(
|
|
40099
40209
|
storageKey ?? "__board_collapse_unused__",
|
|
@@ -40102,13 +40212,13 @@ function useBoardCollapse(storageKey) {
|
|
|
40102
40212
|
const [memory, setMemory] = useState89({});
|
|
40103
40213
|
const collapsed = storageKey ? persisted : memory;
|
|
40104
40214
|
const setMap = storageKey ? setPersisted : setMemory;
|
|
40105
|
-
const toggle =
|
|
40215
|
+
const toggle = useCallback34(
|
|
40106
40216
|
(columnId) => {
|
|
40107
40217
|
setMap((prev) => ({ ...prev, [columnId]: !prev[columnId] }));
|
|
40108
40218
|
},
|
|
40109
40219
|
[setMap]
|
|
40110
40220
|
);
|
|
40111
|
-
const setCollapsed =
|
|
40221
|
+
const setCollapsed = useCallback34(
|
|
40112
40222
|
(columnId, value) => {
|
|
40113
40223
|
setMap((prev) => ({ ...prev, [columnId]: value }));
|
|
40114
40224
|
},
|
|
@@ -40146,45 +40256,35 @@ function Board({
|
|
|
40146
40256
|
onThumbPointerMove,
|
|
40147
40257
|
onThumbPointerUp
|
|
40148
40258
|
} = useHorizontalScrollbar();
|
|
40149
|
-
const [items, setItems] =
|
|
40150
|
-
const isDraggingRef =
|
|
40151
|
-
|
|
40259
|
+
const [items, setItems] = useState90(columns);
|
|
40260
|
+
const isDraggingRef = useRef50(false);
|
|
40261
|
+
useEffect69(() => {
|
|
40152
40262
|
if (!isDraggingRef.current) setItems(columns);
|
|
40153
40263
|
}, [columns]);
|
|
40154
|
-
const dragOriginRef =
|
|
40155
|
-
const [activeTicket, setActiveTicket] =
|
|
40264
|
+
const dragOriginRef = useRef50(null);
|
|
40265
|
+
const [activeTicket, setActiveTicket] = useState90(null);
|
|
40156
40266
|
const sensors = useSensors(
|
|
40157
40267
|
useSensor(PointerSensor, { activationConstraint: { distance: 6 } }),
|
|
40158
40268
|
useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates })
|
|
40159
40269
|
);
|
|
40160
|
-
const
|
|
40161
|
-
|
|
40162
|
-
|
|
40163
|
-
|
|
40164
|
-
|
|
40165
|
-
|
|
40166
|
-
|
|
40167
|
-
|
|
40168
|
-
(
|
|
40169
|
-
|
|
40170
|
-
|
|
40171
|
-
|
|
40172
|
-
const ticketsInColumn = args.droppableContainers.filter((c) => {
|
|
40173
|
-
const d = c.data.current;
|
|
40174
|
-
return d?.type === "ticket" && d.columnId === columnId;
|
|
40175
|
-
});
|
|
40176
|
-
if (ticketsInColumn.length > 0) {
|
|
40177
|
-
const closest = closestCorners({ ...args, droppableContainers: ticketsInColumn });
|
|
40178
|
-
if (closest.length > 0) return closest;
|
|
40179
|
-
}
|
|
40180
|
-
return [columnHit];
|
|
40181
|
-
}
|
|
40182
|
-
return closestCorners(args);
|
|
40270
|
+
const dropTarget = useMemo41(() => createDropTargetResolver(), []);
|
|
40271
|
+
useEffect69(() => dropTarget.dispose, [dropTarget]);
|
|
40272
|
+
const toggleRef = useRef50(toggle);
|
|
40273
|
+
toggleRef.current = toggle;
|
|
40274
|
+
const collapseHandlers = useRef50(/* @__PURE__ */ new Map());
|
|
40275
|
+
const collapseHandlerFor = useCallback35((columnId) => {
|
|
40276
|
+
let handler = collapseHandlers.current.get(columnId);
|
|
40277
|
+
if (!handler) {
|
|
40278
|
+
handler = () => toggleRef.current(columnId);
|
|
40279
|
+
collapseHandlers.current.set(columnId, handler);
|
|
40280
|
+
}
|
|
40281
|
+
return handler;
|
|
40183
40282
|
}, []);
|
|
40184
40283
|
const handleDragStart = (e) => {
|
|
40185
40284
|
const id = String(e.active.id);
|
|
40186
40285
|
const located = locate(items, id);
|
|
40187
40286
|
if (!located) return;
|
|
40287
|
+
dropTarget.release();
|
|
40188
40288
|
isDraggingRef.current = true;
|
|
40189
40289
|
dragOriginRef.current = { ticketId: id, fromColumnId: located.columnId };
|
|
40190
40290
|
setActiveTicket({ ticket: located.ticket, columnId: located.columnId });
|
|
@@ -40204,6 +40304,7 @@ function Board({
|
|
|
40204
40304
|
const targetCol = items.find((c) => c.id === toColumnId);
|
|
40205
40305
|
const blockedBySource = !isReturnToOrigin && !!targetCol?.allowedFromColumns && !!origin && !targetCol.allowedFromColumns.includes(origin.fromColumnId);
|
|
40206
40306
|
if (targetCol?.dropDisabled && !isReturnToOrigin || blockedBySource) return;
|
|
40307
|
+
dropTarget.freeze();
|
|
40207
40308
|
setItems((prev) => {
|
|
40208
40309
|
const fromIndex = findIndexInColumn(prev, fromColumnId, activeId);
|
|
40209
40310
|
const toCol = prev.find((c) => c.id === toColumnId);
|
|
@@ -40238,6 +40339,7 @@ function Board({
|
|
|
40238
40339
|
dragOriginRef.current = null;
|
|
40239
40340
|
setActiveTicket(null);
|
|
40240
40341
|
isDraggingRef.current = false;
|
|
40342
|
+
dropTarget.release();
|
|
40241
40343
|
const { over } = e;
|
|
40242
40344
|
if (!over || !origin) {
|
|
40243
40345
|
setItems(columns);
|
|
@@ -40286,13 +40388,14 @@ function Board({
|
|
|
40286
40388
|
dragOriginRef.current = null;
|
|
40287
40389
|
setActiveTicket(null);
|
|
40288
40390
|
isDraggingRef.current = false;
|
|
40391
|
+
dropTarget.release();
|
|
40289
40392
|
setItems(columns);
|
|
40290
40393
|
};
|
|
40291
40394
|
return /* @__PURE__ */ jsxs231(
|
|
40292
40395
|
DndContext,
|
|
40293
40396
|
{
|
|
40294
40397
|
sensors,
|
|
40295
|
-
collisionDetection,
|
|
40398
|
+
collisionDetection: dropTarget.detect,
|
|
40296
40399
|
onDragStart: handleDragStart,
|
|
40297
40400
|
onDragOver: handleDragOver,
|
|
40298
40401
|
onDragEnd: handleDragEnd,
|
|
@@ -40311,14 +40414,14 @@ function Board({
|
|
|
40311
40414
|
const joinLeft = !!(column.system && prev?.system);
|
|
40312
40415
|
const joinRight = !!(column.system && next?.system);
|
|
40313
40416
|
const showGap = i > 0 && !joinLeft;
|
|
40314
|
-
return /* @__PURE__ */ jsxs231(
|
|
40417
|
+
return /* @__PURE__ */ jsxs231(Fragment56, { children: [
|
|
40315
40418
|
showGap && /* @__PURE__ */ jsx300("div", { "aria-hidden": true, className: "w-[var(--spacing-system-mf)] shrink-0" }),
|
|
40316
40419
|
/* @__PURE__ */ jsx300(
|
|
40317
40420
|
BoardColumn,
|
|
40318
40421
|
{
|
|
40319
40422
|
column,
|
|
40320
40423
|
collapsed: !!collapsed[column.id],
|
|
40321
|
-
onToggleCollapse: (
|
|
40424
|
+
onToggleCollapse: collapseHandlerFor(column.id),
|
|
40322
40425
|
onAddTicket,
|
|
40323
40426
|
onArchive: onArchiveColumn,
|
|
40324
40427
|
getTicketHref,
|
|
@@ -40449,7 +40552,7 @@ import {
|
|
|
40449
40552
|
verticalListSortingStrategy as verticalListSortingStrategy2
|
|
40450
40553
|
} from "@dnd-kit/sortable";
|
|
40451
40554
|
import { CSS as CSS2 } from "@dnd-kit/utilities";
|
|
40452
|
-
import * as
|
|
40555
|
+
import * as React111 from "react";
|
|
40453
40556
|
import { jsx as jsx301 } from "react/jsx-runtime";
|
|
40454
40557
|
function TicketStatusConfigList({
|
|
40455
40558
|
items,
|
|
@@ -40469,7 +40572,7 @@ function TicketStatusConfigList({
|
|
|
40469
40572
|
if (oldIndex === -1 || newIndex === -1) return;
|
|
40470
40573
|
onReorder(oldIndex, newIndex);
|
|
40471
40574
|
};
|
|
40472
|
-
const sortableIds =
|
|
40575
|
+
const sortableIds = React111.useMemo(() => items.map((i) => i.id), [items]);
|
|
40473
40576
|
return /* @__PURE__ */ jsx301(DndContext2, { sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, children: /* @__PURE__ */ jsx301(SortableContext2, { items: sortableIds, strategy: verticalListSortingStrategy2, children: /* @__PURE__ */ jsx301("div", { className: cn("flex w-full flex-col gap-[var(--spacing-system-xs)]", className), children: items.map((item) => /* @__PURE__ */ jsx301(SortableRow, { id: item.id, children: (args) => renderRow(item, args) }, item.id)) }) }) });
|
|
40474
40577
|
}
|
|
40475
40578
|
function SortableRow({
|
|
@@ -40494,7 +40597,7 @@ function SortableRow({
|
|
|
40494
40597
|
|
|
40495
40598
|
// src/components/navigation/header.tsx
|
|
40496
40599
|
init_next_link();
|
|
40497
|
-
import
|
|
40600
|
+
import React114, { useEffect as useEffect71, useRef as useRef52, useState as useState92 } from "react";
|
|
40498
40601
|
init_button2();
|
|
40499
40602
|
|
|
40500
40603
|
// src/components/navigation/mingo-ai-button.tsx
|
|
@@ -40548,14 +40651,14 @@ function MingoAiButton({ source, icon, label = "Mingo AI", className, onClick, .
|
|
|
40548
40651
|
}
|
|
40549
40652
|
|
|
40550
40653
|
// src/components/navigation/mobile-nav-panel.tsx
|
|
40551
|
-
import { useRef as
|
|
40654
|
+
import { useRef as useRef51 } from "react";
|
|
40552
40655
|
import { usePreventScroll as usePreventScroll2 } from "@react-aria/overlays";
|
|
40553
40656
|
init_button2();
|
|
40554
40657
|
import { X as X10 } from "lucide-react";
|
|
40555
40658
|
import { Fragment as Fragment57, jsx as jsx303, jsxs as jsxs233 } from "react/jsx-runtime";
|
|
40556
40659
|
var MOBILE_NAV_PANEL_ID = "mobile-nav-panel";
|
|
40557
40660
|
function MobileNavPanel({ isOpen, config }) {
|
|
40558
|
-
const panelRef =
|
|
40661
|
+
const panelRef = useRef51(null);
|
|
40559
40662
|
usePreventScroll2({ isDisabled: !isOpen });
|
|
40560
40663
|
useFocusTrap(panelRef, isOpen, { onEscape: config.onClose });
|
|
40561
40664
|
const headerHeight = useHeaderHeight(64, { enabled: isOpen });
|
|
@@ -40671,7 +40774,7 @@ function MobileNavPanel({ isOpen, config }) {
|
|
|
40671
40774
|
init_cn();
|
|
40672
40775
|
|
|
40673
40776
|
// src/components/tickets/ticket-live-provider.tsx
|
|
40674
|
-
import
|
|
40777
|
+
import React113 from "react";
|
|
40675
40778
|
import { useQueryClient } from "@tanstack/react-query";
|
|
40676
40779
|
|
|
40677
40780
|
// src/components/chat/hooks/use-chat-identity.ts
|
|
@@ -40740,12 +40843,12 @@ var stampMs = (stamp) => {
|
|
|
40740
40843
|
return Number.isNaN(ms) ? 0 : ms;
|
|
40741
40844
|
};
|
|
40742
40845
|
var INVALIDATE_DEBOUNCE_MS = 1500;
|
|
40743
|
-
var TicketLiveContext =
|
|
40846
|
+
var TicketLiveContext = React113.createContext(null);
|
|
40744
40847
|
function useOptionalTicketLive() {
|
|
40745
|
-
return
|
|
40848
|
+
return React113.useContext(TicketLiveContext);
|
|
40746
40849
|
}
|
|
40747
40850
|
function useTicketLive() {
|
|
40748
|
-
const ctx =
|
|
40851
|
+
const ctx = React113.useContext(TicketLiveContext);
|
|
40749
40852
|
if (!ctx) {
|
|
40750
40853
|
throw new Error("useTicketLive must be used within <TicketLiveProvider>");
|
|
40751
40854
|
}
|
|
@@ -40764,13 +40867,13 @@ function TicketLiveProvider({ children }) {
|
|
|
40764
40867
|
const streamUrl = runtime?.endpoints.ticketStreamUrl ?? TICKET_STREAM_ENDPOINT;
|
|
40765
40868
|
const readUrl = runtime?.endpoints.ticketReadUrl ?? TICKET_READ_ENDPOINT;
|
|
40766
40869
|
const authed = identity.authTier !== "anon" && !!identity.user?.email;
|
|
40767
|
-
const [connected, setConnected] =
|
|
40768
|
-
const [summary, setSummary] =
|
|
40769
|
-
const [openTicketIdState, setOpenTicketIdState] =
|
|
40770
|
-
const openTicketIdRef =
|
|
40771
|
-
const pendingTicketIdsRef =
|
|
40772
|
-
const invalidateTimerRef =
|
|
40773
|
-
const flushInvalidations =
|
|
40870
|
+
const [connected, setConnected] = React113.useState(false);
|
|
40871
|
+
const [summary, setSummary] = React113.useState(EMPTY_SUMMARY);
|
|
40872
|
+
const [openTicketIdState, setOpenTicketIdState] = React113.useState(null);
|
|
40873
|
+
const openTicketIdRef = React113.useRef(null);
|
|
40874
|
+
const pendingTicketIdsRef = React113.useRef(/* @__PURE__ */ new Set());
|
|
40875
|
+
const invalidateTimerRef = React113.useRef(null);
|
|
40876
|
+
const flushInvalidations = React113.useCallback(() => {
|
|
40774
40877
|
invalidateTimerRef.current = null;
|
|
40775
40878
|
const ids = Array.from(pendingTicketIdsRef.current);
|
|
40776
40879
|
pendingTicketIdsRef.current.clear();
|
|
@@ -40779,7 +40882,7 @@ function TicketLiveProvider({ children }) {
|
|
|
40779
40882
|
void queryClient.invalidateQueries({ queryKey: ["ticket-engagements", id] });
|
|
40780
40883
|
}
|
|
40781
40884
|
}, [queryClient]);
|
|
40782
|
-
const scheduleInvalidation =
|
|
40885
|
+
const scheduleInvalidation = React113.useCallback(
|
|
40783
40886
|
(ticketId) => {
|
|
40784
40887
|
if (ticketId) pendingTicketIdsRef.current.add(ticketId);
|
|
40785
40888
|
if (invalidateTimerRef.current) return;
|
|
@@ -40787,7 +40890,7 @@ function TicketLiveProvider({ children }) {
|
|
|
40787
40890
|
},
|
|
40788
40891
|
[flushInvalidations]
|
|
40789
40892
|
);
|
|
40790
|
-
const bumpUnread =
|
|
40893
|
+
const bumpUnread = React113.useCallback((ticketId, createdAt) => {
|
|
40791
40894
|
setSummary((prev) => {
|
|
40792
40895
|
const stamp = createdAt ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
40793
40896
|
const existing = prev.latestUnreadAt[ticketId];
|
|
@@ -40801,7 +40904,7 @@ function TicketLiveProvider({ children }) {
|
|
|
40801
40904
|
};
|
|
40802
40905
|
});
|
|
40803
40906
|
}, []);
|
|
40804
|
-
const zeroUnread =
|
|
40907
|
+
const zeroUnread = React113.useCallback((ticketId) => {
|
|
40805
40908
|
setSummary((prev) => {
|
|
40806
40909
|
const current = prev.tickets[ticketId] ?? 0;
|
|
40807
40910
|
if (current === 0) return prev;
|
|
@@ -40812,9 +40915,9 @@ function TicketLiveProvider({ children }) {
|
|
|
40812
40915
|
return { totalUnread: Math.max(0, prev.totalUnread - current), tickets, latestUnreadAt };
|
|
40813
40916
|
});
|
|
40814
40917
|
}, []);
|
|
40815
|
-
const subscriptionRef =
|
|
40816
|
-
const noStreamRef =
|
|
40817
|
-
const handlersRef =
|
|
40918
|
+
const subscriptionRef = React113.useRef(null);
|
|
40919
|
+
const noStreamRef = React113.useRef(false);
|
|
40920
|
+
const handlersRef = React113.useRef({ onEvent: () => {
|
|
40818
40921
|
}, onStatus: () => {
|
|
40819
40922
|
}, onConnected: () => {
|
|
40820
40923
|
} });
|
|
@@ -40867,7 +40970,7 @@ function TicketLiveProvider({ children }) {
|
|
|
40867
40970
|
if (status === "no-stream") noStreamRef.current = true;
|
|
40868
40971
|
};
|
|
40869
40972
|
const streamEnabled = authed && !!streamUrl;
|
|
40870
|
-
|
|
40973
|
+
React113.useEffect(() => {
|
|
40871
40974
|
if (!streamEnabled) return;
|
|
40872
40975
|
if (typeof window === "undefined") return;
|
|
40873
40976
|
subscriptionRef.current = createSseSubscription({
|
|
@@ -40898,7 +41001,7 @@ function TicketLiveProvider({ children }) {
|
|
|
40898
41001
|
setSummary(EMPTY_SUMMARY);
|
|
40899
41002
|
};
|
|
40900
41003
|
}, [streamEnabled, streamUrl]);
|
|
40901
|
-
const markRead =
|
|
41004
|
+
const markRead = React113.useCallback(
|
|
40902
41005
|
async (ticketExternalId) => {
|
|
40903
41006
|
try {
|
|
40904
41007
|
const response = await embedAuthedFetch(readUrl, {
|
|
@@ -40920,15 +41023,15 @@ function TicketLiveProvider({ children }) {
|
|
|
40920
41023
|
},
|
|
40921
41024
|
[readUrl, zeroUnread]
|
|
40922
41025
|
);
|
|
40923
|
-
const setOpenTicketId =
|
|
41026
|
+
const setOpenTicketId = React113.useCallback((ticketExternalId) => {
|
|
40924
41027
|
openTicketIdRef.current = ticketExternalId;
|
|
40925
41028
|
setOpenTicketIdState(ticketExternalId);
|
|
40926
41029
|
}, []);
|
|
40927
|
-
const notifyTicketCreated =
|
|
41030
|
+
const notifyTicketCreated = React113.useCallback(() => {
|
|
40928
41031
|
noStreamRef.current = false;
|
|
40929
41032
|
subscriptionRef.current?.reconnectNow();
|
|
40930
41033
|
}, []);
|
|
40931
|
-
const value =
|
|
41034
|
+
const value = React113.useMemo(() => {
|
|
40932
41035
|
let unreadByTicket = summary.tickets;
|
|
40933
41036
|
let unreadTotal = summary.totalUnread;
|
|
40934
41037
|
if (openTicketIdState && unreadByTicket[openTicketIdState]) {
|
|
@@ -41101,8 +41204,8 @@ function Header2({ config, platform }) {
|
|
|
41101
41204
|
const [show, setShow] = useState92(true);
|
|
41102
41205
|
const [lastScrollY, setLastScrollY] = useState92(0);
|
|
41103
41206
|
const [openDropdowns, setOpenDropdowns] = useState92({});
|
|
41104
|
-
const dropdownRefs =
|
|
41105
|
-
const triggerRefs =
|
|
41207
|
+
const dropdownRefs = useRef52({});
|
|
41208
|
+
const triggerRefs = useRef52({});
|
|
41106
41209
|
useEffect71(() => {
|
|
41107
41210
|
const handleClickOutside = (event) => {
|
|
41108
41211
|
const target = event.target;
|
|
@@ -41164,7 +41267,7 @@ function Header2({ config, platform }) {
|
|
|
41164
41267
|
}, [config.autoHide]);
|
|
41165
41268
|
const renderNavigationItem = (item) => {
|
|
41166
41269
|
if (item.element) {
|
|
41167
|
-
return /* @__PURE__ */ jsx307(
|
|
41270
|
+
return /* @__PURE__ */ jsx307(React114.Fragment, { children: item.element }, item.id);
|
|
41168
41271
|
}
|
|
41169
41272
|
if (item.children && item.children.length > 0) {
|
|
41170
41273
|
const isOpen = openDropdowns[item.id] || false;
|
|
@@ -41443,7 +41546,7 @@ function ClientOnlyHeader({ config, skeleton }) {
|
|
|
41443
41546
|
}
|
|
41444
41547
|
|
|
41445
41548
|
// src/components/navigation/sliding-sidebar.tsx
|
|
41446
|
-
import { useState as useState94, useEffect as useEffect73, useRef as
|
|
41549
|
+
import { useState as useState94, useEffect as useEffect73, useRef as useRef53 } from "react";
|
|
41447
41550
|
import { motion as motion2, AnimatePresence, useReducedMotion } from "framer-motion";
|
|
41448
41551
|
import { usePreventScroll as usePreventScroll3 } from "@react-aria/overlays";
|
|
41449
41552
|
init_button2();
|
|
@@ -41452,7 +41555,7 @@ function SlidingSidebar({ config }) {
|
|
|
41452
41555
|
const [expandedItems, setExpandedItems] = useState94(/* @__PURE__ */ new Set());
|
|
41453
41556
|
const [mounted, setMounted] = useState94(false);
|
|
41454
41557
|
const headerHeight = useHeaderHeight();
|
|
41455
|
-
const asideRef =
|
|
41558
|
+
const asideRef = useRef53(null);
|
|
41456
41559
|
const prefersReducedMotion2 = useReducedMotion();
|
|
41457
41560
|
usePreventScroll3({ isDisabled: !config.isOpen });
|
|
41458
41561
|
useFocusTrap(asideRef, config.isOpen, { onEscape: config.onClose, contain: false });
|
|
@@ -41624,7 +41727,7 @@ function SlidingSidebar({ config }) {
|
|
|
41624
41727
|
}
|
|
41625
41728
|
|
|
41626
41729
|
// src/components/navigation/sticky-section-nav.tsx
|
|
41627
|
-
import { useEffect as useEffect74, useState as useState95, useCallback as
|
|
41730
|
+
import { useEffect as useEffect74, useState as useState95, useCallback as useCallback36, useRef as useRef54 } from "react";
|
|
41628
41731
|
import { jsx as jsx311, jsxs as jsxs239 } from "react/jsx-runtime";
|
|
41629
41732
|
function StickySectionNav({
|
|
41630
41733
|
sections,
|
|
@@ -41686,9 +41789,9 @@ function StickySectionNav({
|
|
|
41686
41789
|
}
|
|
41687
41790
|
function useSectionNavigation(sections, options) {
|
|
41688
41791
|
const [activeSection, setActiveSection] = useState95(sections[0]?.id || "");
|
|
41689
|
-
const isScrollingFromClick =
|
|
41792
|
+
const isScrollingFromClick = useRef54(false);
|
|
41690
41793
|
const { offset: offset2 = 100 } = options || {};
|
|
41691
|
-
const handleSectionClick =
|
|
41794
|
+
const handleSectionClick = useCallback36((sectionId) => {
|
|
41692
41795
|
const targetElement = document.getElementById(sectionId);
|
|
41693
41796
|
if (!targetElement) return;
|
|
41694
41797
|
isScrollingFromClick.current = true;
|
|
@@ -41738,7 +41841,7 @@ function useSectionNavigation(sections, options) {
|
|
|
41738
41841
|
}
|
|
41739
41842
|
|
|
41740
41843
|
// src/components/navigation/navigation-sidebar.tsx
|
|
41741
|
-
import { useCallback as
|
|
41844
|
+
import { useCallback as useCallback37, useEffect as useEffect75, useMemo as useMemo43, useState as useState96 } from "react";
|
|
41742
41845
|
|
|
41743
41846
|
// src/components/navigation/navigation-sidebar-header.tsx
|
|
41744
41847
|
import { jsx as jsx312, jsxs as jsxs240 } from "react/jsx-runtime";
|
|
@@ -41768,9 +41871,9 @@ function NavigationSidebarHeader({ minimized }) {
|
|
|
41768
41871
|
|
|
41769
41872
|
// src/components/navigation/navigation-sidebar-item.tsx
|
|
41770
41873
|
init_next_link();
|
|
41771
|
-
import { cloneElement, memo as
|
|
41874
|
+
import { cloneElement, memo as memo9 } from "react";
|
|
41772
41875
|
import { Fragment as Fragment61, jsx as jsx313, jsxs as jsxs241 } from "react/jsx-runtime";
|
|
41773
|
-
var NavigationSidebarItemButton =
|
|
41876
|
+
var NavigationSidebarItemButton = memo9(function NavigationSidebarItemButton2({
|
|
41774
41877
|
item,
|
|
41775
41878
|
isActive,
|
|
41776
41879
|
isPending,
|
|
@@ -41919,7 +42022,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
41919
42022
|
const [transitionsEnabled, setTransitionsEnabled] = useState96(false);
|
|
41920
42023
|
const isOverlayOpen = isTablet && !minimized;
|
|
41921
42024
|
const showLabel = !minimized;
|
|
41922
|
-
const handleToggle =
|
|
42025
|
+
const handleToggle = useCallback37(() => {
|
|
41923
42026
|
if (isTablet) {
|
|
41924
42027
|
setTabletMinimized((prev) => !prev);
|
|
41925
42028
|
} else {
|
|
@@ -41927,7 +42030,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
41927
42030
|
}
|
|
41928
42031
|
config.onToggleMinimized?.();
|
|
41929
42032
|
}, [isTablet, setDesktopMinimized, config]);
|
|
41930
|
-
const closeOverlay =
|
|
42033
|
+
const closeOverlay = useCallback37(() => {
|
|
41931
42034
|
setTabletMinimized(true);
|
|
41932
42035
|
}, []);
|
|
41933
42036
|
useEffect75(() => {
|
|
@@ -41939,14 +42042,14 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
41939
42042
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
41940
42043
|
}, [isOverlayOpen, closeOverlay]);
|
|
41941
42044
|
const [pendingItemId, setPendingItemId] = useState96(null);
|
|
41942
|
-
const committedActiveId =
|
|
42045
|
+
const committedActiveId = useMemo43(
|
|
41943
42046
|
() => config.items.find((item) => item.isActive)?.id ?? null,
|
|
41944
42047
|
[config.items]
|
|
41945
42048
|
);
|
|
41946
42049
|
useEffect75(() => {
|
|
41947
42050
|
setPendingItemId(null);
|
|
41948
42051
|
}, [committedActiveId]);
|
|
41949
|
-
const handleItemClick =
|
|
42052
|
+
const handleItemClick = useCallback37((item, event) => {
|
|
41950
42053
|
event?.stopPropagation();
|
|
41951
42054
|
if (item.onClick) {
|
|
41952
42055
|
item.onClick();
|
|
@@ -41962,11 +42065,11 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
41962
42065
|
}
|
|
41963
42066
|
if (isTablet) setTabletMinimized(true);
|
|
41964
42067
|
}, [config, isTablet, committedActiveId]);
|
|
41965
|
-
const { primaryItems, secondaryItems } =
|
|
42068
|
+
const { primaryItems, secondaryItems } = useMemo43(() => ({
|
|
41966
42069
|
primaryItems: config.items.filter((item) => item.section !== "secondary"),
|
|
41967
42070
|
secondaryItems: config.items.filter((item) => item.section === "secondary")
|
|
41968
42071
|
}), [config.items]);
|
|
41969
|
-
const loadingRows =
|
|
42072
|
+
const loadingRows = useMemo43(() => {
|
|
41970
42073
|
if (!config.loading) return null;
|
|
41971
42074
|
const primary = config.loadingRows?.primary ?? 7;
|
|
41972
42075
|
const secondary = config.loadingRows?.secondary ?? 2;
|
|
@@ -41975,7 +42078,7 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
41975
42078
|
secondary: Array.from({ length: Math.max(0, secondary) }, (_, i) => `secondary-${i}`)
|
|
41976
42079
|
};
|
|
41977
42080
|
}, [config.loading, config.loadingRows?.primary, config.loadingRows?.secondary]);
|
|
41978
|
-
const sidebarWidth =
|
|
42081
|
+
const sidebarWidth = useMemo43(
|
|
41979
42082
|
() => minimized ? `${MINIMIZED_WIDTH}px` : `${EXPANDED_WIDTH}px`,
|
|
41980
42083
|
[minimized]
|
|
41981
42084
|
);
|
|
@@ -42067,12 +42170,12 @@ function NavigationSidebar({ config, disabled = false }) {
|
|
|
42067
42170
|
}
|
|
42068
42171
|
|
|
42069
42172
|
// src/components/navigation/app-header.tsx
|
|
42070
|
-
import
|
|
42173
|
+
import React118 from "react";
|
|
42071
42174
|
init_cn();
|
|
42072
42175
|
|
|
42073
42176
|
// src/components/navigation/header-global-search.tsx
|
|
42074
42177
|
init_cn();
|
|
42075
|
-
import
|
|
42178
|
+
import React117 from "react";
|
|
42076
42179
|
import { jsx as jsx316, jsxs as jsxs244 } from "react/jsx-runtime";
|
|
42077
42180
|
function HeaderGlobalSearch({
|
|
42078
42181
|
value = "",
|
|
@@ -42081,7 +42184,7 @@ function HeaderGlobalSearch({
|
|
|
42081
42184
|
placeholder = "Global Search",
|
|
42082
42185
|
className
|
|
42083
42186
|
}) {
|
|
42084
|
-
const [internalValue, setInternalValue] =
|
|
42187
|
+
const [internalValue, setInternalValue] = React117.useState(value);
|
|
42085
42188
|
const currentValue = onChange ? value : internalValue;
|
|
42086
42189
|
const handleChange = (e) => {
|
|
42087
42190
|
const newValue = e.target.value;
|
|
@@ -42242,7 +42345,7 @@ function HeaderOrganizationFilter({
|
|
|
42242
42345
|
|
|
42243
42346
|
// src/components/navigation/app-header.tsx
|
|
42244
42347
|
import { Fragment as Fragment63, jsx as jsx319, jsxs as jsxs247 } from "react/jsx-runtime";
|
|
42245
|
-
var AppHeader =
|
|
42348
|
+
var AppHeader = React118.memo(function AppHeader2({
|
|
42246
42349
|
showSearch,
|
|
42247
42350
|
onSearch,
|
|
42248
42351
|
showOrganizations,
|
|
@@ -42524,14 +42627,14 @@ function AppHeaderSkeleton({
|
|
|
42524
42627
|
}
|
|
42525
42628
|
|
|
42526
42629
|
// src/components/navigation/app-layout.tsx
|
|
42527
|
-
import { useCallback as
|
|
42630
|
+
import { useCallback as useCallback39, useMemo as useMemo44, useRef as useRef56, useState as useState97 } from "react";
|
|
42528
42631
|
|
|
42529
42632
|
// src/components/navigation/mobile-burger-menu.tsx
|
|
42530
|
-
import
|
|
42633
|
+
import React119, { useCallback as useCallback38, useRef as useRef55 } from "react";
|
|
42531
42634
|
import { usePreventScroll as usePreventScroll4 } from "@react-aria/overlays";
|
|
42532
42635
|
import { Fragment as Fragment64, jsx as jsx320, jsxs as jsxs248 } from "react/jsx-runtime";
|
|
42533
42636
|
var HEADER_HEIGHT = 56;
|
|
42534
|
-
var MobileBurgerMenu =
|
|
42637
|
+
var MobileBurgerMenu = React119.memo(function MobileBurgerMenu2({
|
|
42535
42638
|
isOpen,
|
|
42536
42639
|
onClose,
|
|
42537
42640
|
config,
|
|
@@ -42541,10 +42644,10 @@ var MobileBurgerMenu = React122.memo(function MobileBurgerMenu2({
|
|
|
42541
42644
|
onLogout,
|
|
42542
42645
|
disabled = false
|
|
42543
42646
|
}) {
|
|
42544
|
-
const panelRef =
|
|
42647
|
+
const panelRef = useRef55(null);
|
|
42545
42648
|
usePreventScroll4({ isDisabled: !isOpen });
|
|
42546
42649
|
useFocusTrap(panelRef, isOpen, { onEscape: onClose });
|
|
42547
|
-
const handleItemClick =
|
|
42650
|
+
const handleItemClick = useCallback38((item) => {
|
|
42548
42651
|
if (item.onClick) {
|
|
42549
42652
|
item.onClick();
|
|
42550
42653
|
} else if (item.path) {
|
|
@@ -42575,7 +42678,7 @@ var MobileBurgerMenu = React122.memo(function MobileBurgerMenu2({
|
|
|
42575
42678
|
),
|
|
42576
42679
|
"aria-current": isActive ? "page" : void 0,
|
|
42577
42680
|
children: [
|
|
42578
|
-
item.icon && /* @__PURE__ */ jsx320("div", { className: "flex-shrink-0 size-4 flex items-center justify-center", children:
|
|
42681
|
+
item.icon && /* @__PURE__ */ jsx320("div", { className: "flex-shrink-0 size-4 flex items-center justify-center", children: React119.cloneElement(item.icon, {
|
|
42579
42682
|
size: 16,
|
|
42580
42683
|
color: isActive && !disabled ? "var(--color-accent-primary)" : "var(--color-text-secondary)"
|
|
42581
42684
|
}) }),
|
|
@@ -42588,7 +42691,7 @@ var MobileBurgerMenu = React122.memo(function MobileBurgerMenu2({
|
|
|
42588
42691
|
item.id
|
|
42589
42692
|
);
|
|
42590
42693
|
};
|
|
42591
|
-
const renderNavigationGrid = (items) => /* @__PURE__ */ jsx320("div", { className: "grid grid-cols-2 gap-3", children: items.map((item) => /* @__PURE__ */ jsx320(
|
|
42694
|
+
const renderNavigationGrid = (items) => /* @__PURE__ */ jsx320("div", { className: "grid grid-cols-2 gap-3", children: items.map((item) => /* @__PURE__ */ jsx320(React119.Fragment, { children: renderNavigationItem(item, true) }, item.id)) });
|
|
42592
42695
|
return /* @__PURE__ */ jsxs248(Fragment64, { children: [
|
|
42593
42696
|
/* @__PURE__ */ jsx320(
|
|
42594
42697
|
"div",
|
|
@@ -42680,7 +42783,7 @@ var MobileBurgerMenu = React122.memo(function MobileBurgerMenu2({
|
|
|
42680
42783
|
),
|
|
42681
42784
|
config.topSlot?.({ minimized: false }),
|
|
42682
42785
|
/* @__PURE__ */ jsx320("nav", { "aria-label": "Primary navigation", children: renderNavigationGrid(primaryItems) }),
|
|
42683
|
-
secondaryItems.length > 0 && /* @__PURE__ */ jsx320("nav", { "aria-label": "Secondary navigation", className: "flex flex-col gap-3", children: secondaryItems.map((item) => /* @__PURE__ */ jsx320(
|
|
42786
|
+
secondaryItems.length > 0 && /* @__PURE__ */ jsx320("nav", { "aria-label": "Secondary navigation", className: "flex flex-col gap-3", children: secondaryItems.map((item) => /* @__PURE__ */ jsx320(React119.Fragment, { children: renderNavigationItem(item, false) }, item.id)) }),
|
|
42684
42787
|
onLogout && /* @__PURE__ */ jsxs248(
|
|
42685
42788
|
"button",
|
|
42686
42789
|
{
|
|
@@ -42718,20 +42821,20 @@ function AppLayout({
|
|
|
42718
42821
|
}) {
|
|
42719
42822
|
const [mobileMenuOpen, setMobileMenuOpen] = useState97(false);
|
|
42720
42823
|
const [drawerContainer, setDrawerContainer] = useState97(null);
|
|
42721
|
-
const mobileMenuOpenRef =
|
|
42824
|
+
const mobileMenuOpenRef = useRef56(mobileMenuOpen);
|
|
42722
42825
|
mobileMenuOpenRef.current = mobileMenuOpen;
|
|
42723
|
-
const drawerHandlesRef =
|
|
42724
|
-
const handleToggleMobileMenu =
|
|
42826
|
+
const drawerHandlesRef = useRef56(/* @__PURE__ */ new Set());
|
|
42827
|
+
const handleToggleMobileMenu = useCallback39(() => {
|
|
42725
42828
|
const opening = !mobileMenuOpenRef.current;
|
|
42726
42829
|
if (opening) {
|
|
42727
42830
|
for (const handle of drawerHandlesRef.current) handle.close();
|
|
42728
42831
|
}
|
|
42729
42832
|
setMobileMenuOpen(opening);
|
|
42730
42833
|
}, []);
|
|
42731
|
-
const handleCloseMobileMenu =
|
|
42834
|
+
const handleCloseMobileMenu = useCallback39(() => {
|
|
42732
42835
|
setMobileMenuOpen(false);
|
|
42733
42836
|
}, []);
|
|
42734
|
-
const drawerCoordination =
|
|
42837
|
+
const drawerCoordination = useMemo44(() => ({
|
|
42735
42838
|
notifyDrawerDidOpen: (self) => {
|
|
42736
42839
|
setMobileMenuOpen(false);
|
|
42737
42840
|
for (const handle of drawerHandlesRef.current) {
|
|
@@ -43347,10 +43450,10 @@ ScriptArguments.displayName = "ScriptArguments";
|
|
|
43347
43450
|
|
|
43348
43451
|
// src/components/shared/onboarding/onboarding-walkthrough.tsx
|
|
43349
43452
|
init_button2();
|
|
43350
|
-
import
|
|
43453
|
+
import React121, { useRef as useRef57, useCallback as useCallback40 } from "react";
|
|
43351
43454
|
|
|
43352
43455
|
// src/components/shared/onboarding/onboarding-step-card.tsx
|
|
43353
|
-
import
|
|
43456
|
+
import React120 from "react";
|
|
43354
43457
|
init_button2();
|
|
43355
43458
|
init_cn();
|
|
43356
43459
|
import { Fragment as Fragment65, jsx as jsx330, jsxs as jsxs258 } from "react/jsx-runtime";
|
|
@@ -43363,7 +43466,7 @@ function OnboardingStepCard({
|
|
|
43363
43466
|
onSkip,
|
|
43364
43467
|
className
|
|
43365
43468
|
}) {
|
|
43366
|
-
const [isProcessing, setIsProcessing] =
|
|
43469
|
+
const [isProcessing, setIsProcessing] = React120.useState(false);
|
|
43367
43470
|
const handleAction = async (e) => {
|
|
43368
43471
|
e.stopPropagation();
|
|
43369
43472
|
setIsProcessing(true);
|
|
@@ -43471,11 +43574,11 @@ function OnboardingWalkthrough({
|
|
|
43471
43574
|
allStepsComplete,
|
|
43472
43575
|
markMultipleComplete
|
|
43473
43576
|
} = useOnboardingState(storageKey);
|
|
43474
|
-
const hasAutoMarkedRef =
|
|
43475
|
-
const autoMarkingInProgressRef =
|
|
43476
|
-
const lastCompletionStatusRef =
|
|
43477
|
-
const actionInProgressRef =
|
|
43478
|
-
|
|
43577
|
+
const hasAutoMarkedRef = useRef57(false);
|
|
43578
|
+
const autoMarkingInProgressRef = useRef57(false);
|
|
43579
|
+
const lastCompletionStatusRef = useRef57(null);
|
|
43580
|
+
const actionInProgressRef = useRef57(/* @__PURE__ */ new Set());
|
|
43581
|
+
React121.useEffect(() => {
|
|
43479
43582
|
if (isLoadingCompletion) {
|
|
43480
43583
|
hasAutoMarkedRef.current = false;
|
|
43481
43584
|
return;
|
|
@@ -43500,7 +43603,7 @@ function OnboardingWalkthrough({
|
|
|
43500
43603
|
lastCompletionStatusRef.current = statusKey;
|
|
43501
43604
|
}
|
|
43502
43605
|
}, [completionStatus, isLoadingCompletion, state.completedSteps, markMultipleComplete]);
|
|
43503
|
-
const handleStepAction =
|
|
43606
|
+
const handleStepAction = useCallback40(async (step) => {
|
|
43504
43607
|
if (actionInProgressRef.current.has(step.id)) {
|
|
43505
43608
|
console.log(`\u23F3 Action already in progress for "${step.id}", skipping`);
|
|
43506
43609
|
return;
|
|
@@ -43582,11 +43685,11 @@ function OnboardingWalkthrough({
|
|
|
43582
43685
|
|
|
43583
43686
|
// src/components/logs-list.tsx
|
|
43584
43687
|
init_cn();
|
|
43585
|
-
import * as
|
|
43688
|
+
import * as React123 from "react";
|
|
43586
43689
|
|
|
43587
43690
|
// src/components/log-severity-dot.tsx
|
|
43588
43691
|
init_cn();
|
|
43589
|
-
import * as
|
|
43692
|
+
import * as React122 from "react";
|
|
43590
43693
|
|
|
43591
43694
|
// src/types/logs.types.ts
|
|
43592
43695
|
var LOG_SEVERITY_COLORS = {
|
|
@@ -43606,7 +43709,7 @@ var LOG_SEVERITY_LABELS = {
|
|
|
43606
43709
|
|
|
43607
43710
|
// src/components/log-severity-dot.tsx
|
|
43608
43711
|
import { jsx as jsx332 } from "react/jsx-runtime";
|
|
43609
|
-
var LogSeverityDot =
|
|
43712
|
+
var LogSeverityDot = React122.forwardRef(({ severity, size: size2 = "md", className }, ref) => {
|
|
43610
43713
|
const sizeClasses2 = {
|
|
43611
43714
|
sm: "w-4 h-4",
|
|
43612
43715
|
md: "w-6 h-6",
|
|
@@ -43696,7 +43799,7 @@ var LogCard = ({ log, isLast, showConnector, onClick }) => {
|
|
|
43696
43799
|
)
|
|
43697
43800
|
] });
|
|
43698
43801
|
};
|
|
43699
|
-
var LogsList =
|
|
43802
|
+
var LogsList = React123.forwardRef(({
|
|
43700
43803
|
logs,
|
|
43701
43804
|
maxHeight = "400px",
|
|
43702
43805
|
showConnector = true,
|
|
@@ -43705,7 +43808,7 @@ var LogsList = React126.forwardRef(({
|
|
|
43705
43808
|
emptyMessage = "No logs to display",
|
|
43706
43809
|
className
|
|
43707
43810
|
}, ref) => {
|
|
43708
|
-
const containerRef =
|
|
43811
|
+
const containerRef = React123.useRef(null);
|
|
43709
43812
|
const isFullHeight = maxHeight === "100%";
|
|
43710
43813
|
const getContainerStyles = () => {
|
|
43711
43814
|
if (isFullHeight) return void 0;
|
|
@@ -43816,7 +43919,7 @@ function ServiceCardRowItem({ row }) {
|
|
|
43816
43919
|
const [revealed, setRevealed] = useState98(false);
|
|
43817
43920
|
const { copy, copied } = useCopyToClipboard();
|
|
43818
43921
|
const { ref: valueRef, isTruncated: valueTruncated } = useIsTruncated(row.value);
|
|
43819
|
-
const actions =
|
|
43922
|
+
const actions = useMemo45(() => ({ copy: true, open: !!row.href, reveal: !!row.isSecret, ...row.actions }), [row]);
|
|
43820
43923
|
const displayValue = row.isSecret ? /* @__PURE__ */ jsx334(MaskedValue, { value: row.value, isRevealed: revealed }) : /* @__PURE__ */ jsx334("span", { children: row.value });
|
|
43821
43924
|
const handleCopy = () => copy(row.copyValue ?? row.value);
|
|
43822
43925
|
const openInNewTab = () => {
|
|
@@ -43875,9 +43978,9 @@ function ServiceCardRowItem({ row }) {
|
|
|
43875
43978
|
|
|
43876
43979
|
// src/components/ui/slider.tsx
|
|
43877
43980
|
init_cn();
|
|
43878
|
-
import * as
|
|
43981
|
+
import * as React125 from "react";
|
|
43879
43982
|
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
43880
|
-
var Slider =
|
|
43983
|
+
var Slider = React125.forwardRef(
|
|
43881
43984
|
({ className, value = [0], onValueChange, min = 0, max = 100, step = 1, ...props }, ref) => {
|
|
43882
43985
|
const handleChange = (e) => {
|
|
43883
43986
|
const newValue = [Number(e.target.value)];
|
|
@@ -44126,7 +44229,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx338(ContentLoader, { ...props, va
|
|
|
44126
44229
|
|
|
44127
44230
|
// src/components/ui/table/table.tsx
|
|
44128
44231
|
init_cn();
|
|
44129
|
-
import { useEffect as useEffect77, useRef as
|
|
44232
|
+
import { useEffect as useEffect77, useRef as useRef59 } from "react";
|
|
44130
44233
|
init_pagination();
|
|
44131
44234
|
init_button2();
|
|
44132
44235
|
|
|
@@ -44886,8 +44989,8 @@ function Table({
|
|
|
44886
44989
|
};
|
|
44887
44990
|
const allSelected = selectedRows.length > 0 && selectedRows.length === data.length;
|
|
44888
44991
|
const someSelected = selectedRows.length > 0 && selectedRows.length < data.length;
|
|
44889
|
-
const sentinelRef =
|
|
44890
|
-
const onLoadMoreRef =
|
|
44992
|
+
const sentinelRef = useRef59(null);
|
|
44993
|
+
const onLoadMoreRef = useRef59(infiniteScroll?.onLoadMore);
|
|
44891
44994
|
onLoadMoreRef.current = infiniteScroll?.onLoadMore;
|
|
44892
44995
|
useEffect77(() => {
|
|
44893
44996
|
if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
|
|
@@ -45103,11 +45206,11 @@ function TableTimestampCell({
|
|
|
45103
45206
|
// src/components/ui/query-report-table/query-report-table.tsx
|
|
45104
45207
|
init_cn();
|
|
45105
45208
|
init_button2();
|
|
45106
|
-
import { useMemo as
|
|
45209
|
+
import { useMemo as useMemo46 } from "react";
|
|
45107
45210
|
|
|
45108
45211
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
45109
45212
|
init_cn();
|
|
45110
|
-
import { useRef as
|
|
45213
|
+
import { useRef as useRef60, useState as useState100, useCallback as useCallback41 } from "react";
|
|
45111
45214
|
import { jsx as jsx350, jsxs as jsxs273 } from "react/jsx-runtime";
|
|
45112
45215
|
function QueryReportTableHeader({
|
|
45113
45216
|
columns,
|
|
@@ -45136,9 +45239,9 @@ function QueryReportTableHeader({
|
|
|
45136
45239
|
);
|
|
45137
45240
|
}
|
|
45138
45241
|
function TruncatedHeaderCell({ value, width }) {
|
|
45139
|
-
const textRef =
|
|
45242
|
+
const textRef = useRef60(null);
|
|
45140
45243
|
const [isTruncated, setIsTruncated] = useState100(false);
|
|
45141
|
-
const checkTruncation =
|
|
45244
|
+
const checkTruncation = useCallback41(() => {
|
|
45142
45245
|
const el = textRef.current;
|
|
45143
45246
|
if (el) {
|
|
45144
45247
|
setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
@@ -45166,7 +45269,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
45166
45269
|
|
|
45167
45270
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
45168
45271
|
init_cn();
|
|
45169
|
-
import { useRef as
|
|
45272
|
+
import { useRef as useRef61, useState as useState101, useCallback as useCallback42 } from "react";
|
|
45170
45273
|
import { jsx as jsx351, jsxs as jsxs274 } from "react/jsx-runtime";
|
|
45171
45274
|
function QueryReportTableRow({
|
|
45172
45275
|
row,
|
|
@@ -45212,9 +45315,9 @@ function QueryReportTableRow({
|
|
|
45212
45315
|
);
|
|
45213
45316
|
}
|
|
45214
45317
|
function TruncatedCell({ value, className }) {
|
|
45215
|
-
const textRef =
|
|
45318
|
+
const textRef = useRef61(null);
|
|
45216
45319
|
const [isTruncated, setIsTruncated] = useState101(false);
|
|
45217
|
-
const checkTruncation =
|
|
45320
|
+
const checkTruncation = useCallback42(() => {
|
|
45218
45321
|
const el = textRef.current;
|
|
45219
45322
|
if (el) {
|
|
45220
45323
|
setIsTruncated(el.scrollWidth > el.clientWidth);
|
|
@@ -45341,7 +45444,7 @@ function QueryReportTable({
|
|
|
45341
45444
|
tableClassName
|
|
45342
45445
|
}) {
|
|
45343
45446
|
const isCompact = variant === "compact";
|
|
45344
|
-
const columns =
|
|
45447
|
+
const columns = useMemo46(
|
|
45345
45448
|
() => deriveColumns(data, columnOrder),
|
|
45346
45449
|
[data, columnOrder]
|
|
45347
45450
|
);
|
|
@@ -45476,7 +45579,7 @@ import { flexRender } from "@tanstack/react-table";
|
|
|
45476
45579
|
|
|
45477
45580
|
// src/components/ui/data-table/data-table-column-filter.tsx
|
|
45478
45581
|
init_cn();
|
|
45479
|
-
import { useCallback as
|
|
45582
|
+
import { useCallback as useCallback43, useMemo as useMemo47 } from "react";
|
|
45480
45583
|
|
|
45481
45584
|
// src/components/ui/data-table/utils.ts
|
|
45482
45585
|
var BREAKPOINT_ORDER = ["md", "lg", "xl", "2xl"];
|
|
@@ -45540,7 +45643,7 @@ function DataTableColumnFilter({
|
|
|
45540
45643
|
}) {
|
|
45541
45644
|
const currentValue = column.getFilterValue();
|
|
45542
45645
|
const activeCount = currentValue?.length ?? 0;
|
|
45543
|
-
const sections =
|
|
45646
|
+
const sections = useMemo47(
|
|
45544
45647
|
() => [
|
|
45545
45648
|
{
|
|
45546
45649
|
id: column.id,
|
|
@@ -45552,18 +45655,18 @@ function DataTableColumnFilter({
|
|
|
45552
45655
|
],
|
|
45553
45656
|
[column.id, label, options]
|
|
45554
45657
|
);
|
|
45555
|
-
const currentFilters =
|
|
45658
|
+
const currentFilters = useMemo47(
|
|
45556
45659
|
() => ({ [column.id]: currentValue ?? EMPTY_ARRAY }),
|
|
45557
45660
|
[column.id, currentValue]
|
|
45558
45661
|
);
|
|
45559
|
-
const handleApply =
|
|
45662
|
+
const handleApply = useCallback43(
|
|
45560
45663
|
(applied) => {
|
|
45561
45664
|
const next = applied[column.id] ?? [];
|
|
45562
45665
|
column.setFilterValue(next.length > 0 ? next : void 0);
|
|
45563
45666
|
},
|
|
45564
45667
|
[column]
|
|
45565
45668
|
);
|
|
45566
|
-
const handleReset =
|
|
45669
|
+
const handleReset = useCallback43(() => {
|
|
45567
45670
|
column.setFilterValue(void 0);
|
|
45568
45671
|
}, [column]);
|
|
45569
45672
|
const isEmpty = options.length === 0;
|
|
@@ -45818,7 +45921,7 @@ function DataTableEmpty({ className, ...props }) {
|
|
|
45818
45921
|
// src/components/ui/data-table/data-table-row.tsx
|
|
45819
45922
|
init_next_link();
|
|
45820
45923
|
init_cn();
|
|
45821
|
-
import { memo as
|
|
45924
|
+
import { memo as memo10, useCallback as useCallback44, useRef as useRef62 } from "react";
|
|
45822
45925
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
45823
45926
|
|
|
45824
45927
|
// src/components/ui/data-table/data-table-skeleton.tsx
|
|
@@ -45912,8 +46015,8 @@ function DataTableRowImpl({
|
|
|
45912
46015
|
const hasSubRow = subRow != null && subRow !== false;
|
|
45913
46016
|
const isLinkMode = Boolean(href) && !onClick;
|
|
45914
46017
|
const isWholeCardLink = isLinkMode && !hasSubRow;
|
|
45915
|
-
const containerRef =
|
|
45916
|
-
const handleClick =
|
|
46018
|
+
const containerRef = useRef62(null);
|
|
46019
|
+
const handleClick = useCallback44(
|
|
45917
46020
|
(e) => {
|
|
45918
46021
|
const target = e.target;
|
|
45919
46022
|
if (!containerRef.current?.contains(target)) {
|
|
@@ -45997,7 +46100,7 @@ function DataTableRowImpl({
|
|
|
45997
46100
|
}
|
|
45998
46101
|
);
|
|
45999
46102
|
}
|
|
46000
|
-
var DataTableRow =
|
|
46103
|
+
var DataTableRow = memo10(DataTableRowImpl);
|
|
46001
46104
|
function CellContent({ children }) {
|
|
46002
46105
|
if (typeof children === "string" || typeof children === "number") {
|
|
46003
46106
|
return /* @__PURE__ */ jsx359("span", { className: "text-h4 text-ods-text-primary truncate", title: String(children), children });
|
|
@@ -46083,7 +46186,7 @@ function DataTableBody({
|
|
|
46083
46186
|
}
|
|
46084
46187
|
|
|
46085
46188
|
// src/components/ui/data-table/data-table-infinite-footer.tsx
|
|
46086
|
-
import { useEffect as useEffect78, useRef as
|
|
46189
|
+
import { useEffect as useEffect78, useRef as useRef63 } from "react";
|
|
46087
46190
|
import { Fragment as Fragment72, jsx as jsx361, jsxs as jsxs282 } from "react/jsx-runtime";
|
|
46088
46191
|
function DataTableInfiniteFooter({
|
|
46089
46192
|
hasNextPage,
|
|
@@ -46092,8 +46195,8 @@ function DataTableInfiniteFooter({
|
|
|
46092
46195
|
skeletonRows = 3,
|
|
46093
46196
|
rootMargin = "200px"
|
|
46094
46197
|
}) {
|
|
46095
|
-
const sentinelRef =
|
|
46096
|
-
const onLoadMoreRef =
|
|
46198
|
+
const sentinelRef = useRef63(null);
|
|
46199
|
+
const onLoadMoreRef = useRef63(onLoadMore);
|
|
46097
46200
|
onLoadMoreRef.current = onLoadMore;
|
|
46098
46201
|
useEffect78(() => {
|
|
46099
46202
|
if (!hasNextPage || isFetchingNextPage) return;
|
|
@@ -46223,7 +46326,7 @@ var DataTable = Object.assign(DataTableRoot, {
|
|
|
46223
46326
|
init_cn();
|
|
46224
46327
|
import * as PopoverPrimitive6 from "@radix-ui/react-popover";
|
|
46225
46328
|
import * as ScrollAreaPrimitive3 from "@radix-ui/react-scroll-area";
|
|
46226
|
-
import * as
|
|
46329
|
+
import * as React128 from "react";
|
|
46227
46330
|
import { jsx as jsx363, jsxs as jsxs284 } from "react/jsx-runtime";
|
|
46228
46331
|
var containerStyles = cn(
|
|
46229
46332
|
// Layout & spacing — matches lib Input component
|
|
@@ -46280,13 +46383,13 @@ function SearchInput({
|
|
|
46280
46383
|
limitTags = "auto",
|
|
46281
46384
|
getLimitTagsText = (more) => `+${more}`
|
|
46282
46385
|
}) {
|
|
46283
|
-
const [internalValue, setInternalValue] =
|
|
46386
|
+
const [internalValue, setInternalValue] = React128.useState(defaultValue);
|
|
46284
46387
|
const currentValue = onChange ? value ?? "" : internalValue;
|
|
46285
46388
|
const debouncedValue = useDebounce(currentValue, debounceMs);
|
|
46286
|
-
const [isOpen, setIsOpen] =
|
|
46287
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
46389
|
+
const [isOpen, setIsOpen] = React128.useState(false);
|
|
46390
|
+
const [highlightedIndex, setHighlightedIndex] = React128.useState(-1);
|
|
46288
46391
|
const keyboardPadding = useKeyboardCollisionPadding();
|
|
46289
|
-
const containerRef =
|
|
46392
|
+
const containerRef = React128.useRef(null);
|
|
46290
46393
|
const currentPlaceholder = filterChips.length > 0 ? "Add filter..." : placeholder;
|
|
46291
46394
|
const {
|
|
46292
46395
|
visibleCount: rawVisibleCount,
|
|
@@ -46303,10 +46406,10 @@ function SearchInput({
|
|
|
46303
46406
|
placeholder: filterChips.length > 0 ? "" : placeholder
|
|
46304
46407
|
});
|
|
46305
46408
|
const visibleCount = filterChips.length > 0 ? Math.max(1, rawVisibleCount) : rawVisibleCount;
|
|
46306
|
-
const hiddenTagsRef =
|
|
46307
|
-
const hiddenTagsPopupRef =
|
|
46308
|
-
const [showHiddenTags, setShowHiddenTags] =
|
|
46309
|
-
|
|
46409
|
+
const hiddenTagsRef = React128.useRef(null);
|
|
46410
|
+
const hiddenTagsPopupRef = React128.useRef(null);
|
|
46411
|
+
const [showHiddenTags, setShowHiddenTags] = React128.useState(false);
|
|
46412
|
+
React128.useEffect(() => {
|
|
46310
46413
|
if (!showHiddenTags) return;
|
|
46311
46414
|
const handleClick = (e) => {
|
|
46312
46415
|
const target = e.target;
|
|
@@ -46320,7 +46423,7 @@ function SearchInput({
|
|
|
46320
46423
|
const hiddenCount = filterChips.length - visibleCount;
|
|
46321
46424
|
const visibleChips = filterChips.slice(0, visibleCount);
|
|
46322
46425
|
const hiddenChips = filterChips.slice(visibleCount);
|
|
46323
|
-
const { flatResults, groups } =
|
|
46426
|
+
const { flatResults, groups } = React128.useMemo(() => {
|
|
46324
46427
|
if (!groupBy) return { flatResults: results, groups: null };
|
|
46325
46428
|
const grouped = /* @__PURE__ */ new Map();
|
|
46326
46429
|
for (const r of results) {
|
|
@@ -46337,7 +46440,7 @@ function SearchInput({
|
|
|
46337
46440
|
const meetsMinQuery = debouncedValue.length >= minQueryLength;
|
|
46338
46441
|
const autoShow = meetsMinQuery;
|
|
46339
46442
|
const dropdownVisible = showDropdownProp ?? (isOpen && autoShow);
|
|
46340
|
-
|
|
46443
|
+
React128.useEffect(() => {
|
|
46341
46444
|
setHighlightedIndex(-1);
|
|
46342
46445
|
}, [flatResults.length]);
|
|
46343
46446
|
const handleChange = (e) => {
|
|
@@ -46618,7 +46721,7 @@ function SearchInput({
|
|
|
46618
46721
|
|
|
46619
46722
|
// src/components/ui/filter-list.tsx
|
|
46620
46723
|
init_cn();
|
|
46621
|
-
import * as
|
|
46724
|
+
import * as React129 from "react";
|
|
46622
46725
|
import * as CheckboxPrimitive4 from "@radix-ui/react-checkbox";
|
|
46623
46726
|
import { jsx as jsx364, jsxs as jsxs285 } from "react/jsx-runtime";
|
|
46624
46727
|
function FilterListItem({
|
|
@@ -46667,7 +46770,7 @@ function FilterListItem({
|
|
|
46667
46770
|
"flex items-start gap-[var(--spacing-system-xxs)] text-h6",
|
|
46668
46771
|
selected ? "text-ods-accent" : "text-ods-text-secondary"
|
|
46669
46772
|
),
|
|
46670
|
-
children: meta.map((item, index) => /* @__PURE__ */ jsxs285(
|
|
46773
|
+
children: meta.map((item, index) => /* @__PURE__ */ jsxs285(React129.Fragment, { children: [
|
|
46671
46774
|
index > 0 && /* @__PURE__ */ jsx364("span", { "aria-hidden": "true", children: "\u2022" }),
|
|
46672
46775
|
/* @__PURE__ */ jsx364("span", { children: item })
|
|
46673
46776
|
] }, index))
|
|
@@ -46734,7 +46837,7 @@ function FilterList({
|
|
|
46734
46837
|
// src/components/ui/tag-search-input.tsx
|
|
46735
46838
|
import {
|
|
46736
46839
|
useEffect as useEffect80,
|
|
46737
|
-
useRef as
|
|
46840
|
+
useRef as useRef65,
|
|
46738
46841
|
useState as useState103
|
|
46739
46842
|
} from "react";
|
|
46740
46843
|
init_cn();
|
|
@@ -46769,9 +46872,9 @@ function TagSearchInput({
|
|
|
46769
46872
|
limitTags,
|
|
46770
46873
|
placeholder: currentPlaceholder
|
|
46771
46874
|
});
|
|
46772
|
-
const wrapperRef =
|
|
46773
|
-
const hiddenTagsRef =
|
|
46774
|
-
const hiddenTagsPopupRef =
|
|
46875
|
+
const wrapperRef = useRef65(null);
|
|
46876
|
+
const hiddenTagsRef = useRef65(null);
|
|
46877
|
+
const hiddenTagsPopupRef = useRef65(null);
|
|
46775
46878
|
const [showHiddenTags, setShowHiddenTags] = useState103(false);
|
|
46776
46879
|
useEffect80(() => {
|
|
46777
46880
|
if (!showHiddenTags) return;
|
|
@@ -46935,7 +47038,7 @@ function TagSearchInput({
|
|
|
46935
47038
|
}
|
|
46936
47039
|
|
|
46937
47040
|
// src/components/ui/markdown-editor.tsx
|
|
46938
|
-
import { useRef as
|
|
47041
|
+
import { useRef as useRef66, useCallback as useCallback45, useState as useState104, useEffect as useEffect81 } from "react";
|
|
46939
47042
|
init_cn();
|
|
46940
47043
|
import { Loader2 as Loader28, Upload as Upload8 } from "lucide-react";
|
|
46941
47044
|
import { jsx as jsx366, jsxs as jsxs287 } from "react/jsx-runtime";
|
|
@@ -46990,7 +47093,7 @@ function MarkdownEditor({
|
|
|
46990
47093
|
onFileUploaded,
|
|
46991
47094
|
renderPreview
|
|
46992
47095
|
}) {
|
|
46993
|
-
const fileInputRef =
|
|
47096
|
+
const fileInputRef = useRef66(null);
|
|
46994
47097
|
const [isUploading, setIsUploading] = useState104(false);
|
|
46995
47098
|
const [uploadProgress, setUploadProgress] = useState104("");
|
|
46996
47099
|
const [defaultExtraCommands, setDefaultExtraCommands] = useState104([]);
|
|
@@ -47004,7 +47107,7 @@ function MarkdownEditor({
|
|
|
47004
47107
|
const handleChange = (val) => {
|
|
47005
47108
|
onChange(val || "");
|
|
47006
47109
|
};
|
|
47007
|
-
const insertTextAtCursor =
|
|
47110
|
+
const insertTextAtCursor = useCallback45(
|
|
47008
47111
|
(text) => {
|
|
47009
47112
|
const textarea = document.querySelector(
|
|
47010
47113
|
".w-md-editor-text-textarea"
|
|
@@ -47020,7 +47123,7 @@ function MarkdownEditor({
|
|
|
47020
47123
|
},
|
|
47021
47124
|
[value, onChange]
|
|
47022
47125
|
);
|
|
47023
|
-
const handleFileUpload =
|
|
47126
|
+
const handleFileUpload = useCallback45(
|
|
47024
47127
|
async (file) => {
|
|
47025
47128
|
if (!onUploadFile) return;
|
|
47026
47129
|
setIsUploading(true);
|
|
@@ -47041,7 +47144,7 @@ function MarkdownEditor({
|
|
|
47041
47144
|
},
|
|
47042
47145
|
[onUploadFile, insertTextAtCursor, onFileUploaded]
|
|
47043
47146
|
);
|
|
47044
|
-
const handleFileInputChange =
|
|
47147
|
+
const handleFileInputChange = useCallback45(
|
|
47045
47148
|
(e) => {
|
|
47046
47149
|
const file = e.target.files?.[0];
|
|
47047
47150
|
if (file) {
|
|
@@ -47051,7 +47154,7 @@ function MarkdownEditor({
|
|
|
47051
47154
|
},
|
|
47052
47155
|
[handleFileUpload]
|
|
47053
47156
|
);
|
|
47054
|
-
const handlePaste =
|
|
47157
|
+
const handlePaste = useCallback45(
|
|
47055
47158
|
(e) => {
|
|
47056
47159
|
if (!onUploadFile) return;
|
|
47057
47160
|
const items = e.clipboardData?.items;
|
|
@@ -47083,14 +47186,14 @@ function MarkdownEditor({
|
|
|
47083
47186
|
}
|
|
47084
47187
|
} : null;
|
|
47085
47188
|
const extraCommands = uploadCommand ? [...defaultExtraCommands, uploadCommand] : defaultExtraCommands;
|
|
47086
|
-
const wrapperRef =
|
|
47087
|
-
const isDraggingRef =
|
|
47088
|
-
const mouseYRef =
|
|
47089
|
-
const rafRef =
|
|
47090
|
-
const scrollParentRef =
|
|
47189
|
+
const wrapperRef = useRef66(null);
|
|
47190
|
+
const isDraggingRef = useRef66(false);
|
|
47191
|
+
const mouseYRef = useRef66(0);
|
|
47192
|
+
const rafRef = useRef66(0);
|
|
47193
|
+
const scrollParentRef = useRef66(window);
|
|
47091
47194
|
const EDGE_ZONE = 60;
|
|
47092
47195
|
const MAX_SCROLL_SPEED = 15;
|
|
47093
|
-
const findScrollParent =
|
|
47196
|
+
const findScrollParent = useCallback45((el) => {
|
|
47094
47197
|
let node = el?.parentElement;
|
|
47095
47198
|
while (node && node !== document.documentElement) {
|
|
47096
47199
|
const { overflowY } = window.getComputedStyle(node);
|
|
@@ -47101,7 +47204,7 @@ function MarkdownEditor({
|
|
|
47101
47204
|
}
|
|
47102
47205
|
return window;
|
|
47103
47206
|
}, []);
|
|
47104
|
-
const scrollLoop =
|
|
47207
|
+
const scrollLoop = useCallback45(() => {
|
|
47105
47208
|
if (!isDraggingRef.current) return;
|
|
47106
47209
|
const parent = scrollParentRef.current;
|
|
47107
47210
|
const isWindow = parent === window;
|
|
@@ -47210,7 +47313,7 @@ function MarkdownEditor({
|
|
|
47210
47313
|
}
|
|
47211
47314
|
|
|
47212
47315
|
// src/components/ui/file-upload.tsx
|
|
47213
|
-
import * as
|
|
47316
|
+
import * as React131 from "react";
|
|
47214
47317
|
import { Loader2 as Loader29 } from "lucide-react";
|
|
47215
47318
|
init_cn();
|
|
47216
47319
|
import { jsx as jsx367, jsxs as jsxs288 } from "react/jsx-runtime";
|
|
@@ -47262,11 +47365,11 @@ function FileUpload({
|
|
|
47262
47365
|
acceptWindowDrops = false,
|
|
47263
47366
|
pickFiles
|
|
47264
47367
|
}) {
|
|
47265
|
-
const [dragActive, setDragActive] =
|
|
47266
|
-
const [validationError, setValidationError] =
|
|
47267
|
-
const fileInputRef =
|
|
47368
|
+
const [dragActive, setDragActive] = React131.useState(false);
|
|
47369
|
+
const [validationError, setValidationError] = React131.useState(null);
|
|
47370
|
+
const fileInputRef = React131.useRef(null);
|
|
47268
47371
|
const isManaged = managedFiles !== void 0;
|
|
47269
|
-
const files =
|
|
47372
|
+
const files = React131.useMemo(() => {
|
|
47270
47373
|
if (!value) return [];
|
|
47271
47374
|
return Array.isArray(value) ? value : [value];
|
|
47272
47375
|
}, [value]);
|
|
@@ -47314,7 +47417,7 @@ function FileUpload({
|
|
|
47314
47417
|
fileInputRef.current.value = "";
|
|
47315
47418
|
}
|
|
47316
47419
|
};
|
|
47317
|
-
const handleFilesRef =
|
|
47420
|
+
const handleFilesRef = React131.useRef(handleFiles);
|
|
47318
47421
|
handleFilesRef.current = handleFiles;
|
|
47319
47422
|
const handleDrag = (e) => {
|
|
47320
47423
|
e.preventDefault();
|
|
@@ -47335,7 +47438,7 @@ function FileUpload({
|
|
|
47335
47438
|
handleFiles(e.dataTransfer.files);
|
|
47336
47439
|
}
|
|
47337
47440
|
};
|
|
47338
|
-
|
|
47441
|
+
React131.useEffect(() => {
|
|
47339
47442
|
if (!acceptWindowDrops || disabled) return;
|
|
47340
47443
|
let dragCounter = 0;
|
|
47341
47444
|
const onWindowDragEnter = (e) => {
|
|
@@ -47536,7 +47639,7 @@ function FileUpload({
|
|
|
47536
47639
|
}
|
|
47537
47640
|
|
|
47538
47641
|
// src/components/ui/image-uploader.tsx
|
|
47539
|
-
import * as
|
|
47642
|
+
import * as React132 from "react";
|
|
47540
47643
|
import { Loader2 as Loader210 } from "lucide-react";
|
|
47541
47644
|
init_cn();
|
|
47542
47645
|
import { Fragment as Fragment74, jsx as jsx368, jsxs as jsxs289 } from "react/jsx-runtime";
|
|
@@ -47578,10 +47681,10 @@ function ImageUploader({
|
|
|
47578
47681
|
className,
|
|
47579
47682
|
dropzoneClassName
|
|
47580
47683
|
}) {
|
|
47581
|
-
const inputRef =
|
|
47582
|
-
const [dragActive, setDragActive] =
|
|
47583
|
-
const [pressed, setPressed] =
|
|
47584
|
-
const [validationError, setValidationError] =
|
|
47684
|
+
const inputRef = React132.useRef(null);
|
|
47685
|
+
const [dragActive, setDragActive] = React132.useState(false);
|
|
47686
|
+
const [pressed, setPressed] = React132.useState(false);
|
|
47687
|
+
const [validationError, setValidationError] = React132.useState(null);
|
|
47585
47688
|
const interactive = !disabled && !loading;
|
|
47586
47689
|
const resolvedValue = useAuthedImageSrc(value);
|
|
47587
47690
|
const hasImage = Boolean(value);
|
|
@@ -47744,21 +47847,21 @@ function ActionIconButton({ onClick, disabled, ariaLabel, children }) {
|
|
|
47744
47847
|
|
|
47745
47848
|
// src/components/ui/ticket-status-config-row.tsx
|
|
47746
47849
|
init_cn();
|
|
47747
|
-
import * as
|
|
47850
|
+
import * as React135 from "react";
|
|
47748
47851
|
init_button2();
|
|
47749
47852
|
|
|
47750
47853
|
// src/components/ui/color-preset-select.tsx
|
|
47751
|
-
import * as
|
|
47854
|
+
import * as React134 from "react";
|
|
47752
47855
|
import { HexColorPicker } from "react-colorful";
|
|
47753
47856
|
|
|
47754
47857
|
// src/components/popover.tsx
|
|
47755
47858
|
init_cn();
|
|
47756
|
-
import * as
|
|
47859
|
+
import * as React133 from "react";
|
|
47757
47860
|
import * as PopoverPrimitive7 from "@radix-ui/react-popover";
|
|
47758
47861
|
import { jsx as jsx369 } from "react/jsx-runtime";
|
|
47759
47862
|
var Popover2 = PopoverPrimitive7.Root;
|
|
47760
47863
|
var PopoverTrigger = PopoverPrimitive7.Trigger;
|
|
47761
|
-
var PopoverContent =
|
|
47864
|
+
var PopoverContent = React133.forwardRef(({ className, align = "center", sideOffset = 4, collisionPadding, ...props }, ref) => {
|
|
47762
47865
|
const keyboardPadding = useKeyboardCollisionPadding();
|
|
47763
47866
|
return /* @__PURE__ */ jsx369(PopoverPrimitive7.Portal, { children: /* @__PURE__ */ jsx369(
|
|
47764
47867
|
PopoverPrimitive7.Content,
|
|
@@ -47859,8 +47962,8 @@ var FORMATS = ["HEX", "RGB", "HSL"];
|
|
|
47859
47962
|
var channelInputClass = "flex-1 min-w-0 [&_input]:text-center [&_input]:tabular-nums";
|
|
47860
47963
|
var hexInputClass = "flex-1 min-w-0 [&_input]:uppercase";
|
|
47861
47964
|
function HexInputs({ value, onChange }) {
|
|
47862
|
-
const [draft, setDraft] =
|
|
47863
|
-
|
|
47965
|
+
const [draft, setDraft] = React134.useState(value);
|
|
47966
|
+
React134.useEffect(() => setDraft(value), [value]);
|
|
47864
47967
|
const commit = () => {
|
|
47865
47968
|
const candidate = (draft.startsWith("#") ? draft : `#${draft}`).toLowerCase();
|
|
47866
47969
|
if (HEX_PATTERN.test(candidate)) onChange(candidate);
|
|
@@ -47892,8 +47995,8 @@ function ChannelInput({
|
|
|
47892
47995
|
ariaLabel,
|
|
47893
47996
|
onCommit
|
|
47894
47997
|
}) {
|
|
47895
|
-
const [draft, setDraft] =
|
|
47896
|
-
|
|
47998
|
+
const [draft, setDraft] = React134.useState(String(value));
|
|
47999
|
+
React134.useEffect(() => setDraft(String(value)), [value]);
|
|
47897
48000
|
const commit = () => {
|
|
47898
48001
|
const parsed = Number.parseInt(draft, 10);
|
|
47899
48002
|
if (!Number.isFinite(parsed)) {
|
|
@@ -47953,8 +48056,8 @@ function HslInputs({ value, onChange }) {
|
|
|
47953
48056
|
] });
|
|
47954
48057
|
}
|
|
47955
48058
|
function ColorPickerInput({ value, onChange, disabled, className }) {
|
|
47956
|
-
const [open, setOpen] =
|
|
47957
|
-
const [format3, setFormat] =
|
|
48059
|
+
const [open, setOpen] = React134.useState(false);
|
|
48060
|
+
const [format3, setFormat] = React134.useState("HEX");
|
|
47958
48061
|
const formatGroups = [
|
|
47959
48062
|
{
|
|
47960
48063
|
items: FORMATS.map((f) => ({
|
|
@@ -48019,9 +48122,9 @@ function ColorPickerInput({ value, onChange, disabled, className }) {
|
|
|
48019
48122
|
import { jsx as jsx371, jsxs as jsxs291 } from "react/jsx-runtime";
|
|
48020
48123
|
var dismissOpenTooltip = null;
|
|
48021
48124
|
function WithLeftTooltip({ content, children }) {
|
|
48022
|
-
const [open, setOpen] =
|
|
48023
|
-
const isTouchRef =
|
|
48024
|
-
const close =
|
|
48125
|
+
const [open, setOpen] = React135.useState(false);
|
|
48126
|
+
const isTouchRef = React135.useRef(false);
|
|
48127
|
+
const close = React135.useCallback(() => setOpen(false), []);
|
|
48025
48128
|
if (!content) return children;
|
|
48026
48129
|
const toggleFromTouch = () => {
|
|
48027
48130
|
setOpen((prev) => {
|
|
@@ -48154,7 +48257,7 @@ function TicketStatusConfigRow({
|
|
|
48154
48257
|
}
|
|
48155
48258
|
|
|
48156
48259
|
// src/components/ui/test-run.tsx
|
|
48157
|
-
import * as
|
|
48260
|
+
import * as React136 from "react";
|
|
48158
48261
|
init_cn();
|
|
48159
48262
|
import { jsx as jsx372, jsxs as jsxs292 } from "react/jsx-runtime";
|
|
48160
48263
|
function formatTestRunDuration(ms) {
|
|
@@ -48173,8 +48276,8 @@ function TestResultsSkeleton() {
|
|
|
48173
48276
|
] }) });
|
|
48174
48277
|
}
|
|
48175
48278
|
function TestResultsTable({ rows, loading }) {
|
|
48176
|
-
const columnKeys =
|
|
48177
|
-
const columns =
|
|
48279
|
+
const columnKeys = React136.useMemo(() => rows.length > 0 ? Object.keys(rows[0]) : [], [rows]);
|
|
48280
|
+
const columns = React136.useMemo(() => {
|
|
48178
48281
|
return columnKeys.map((key) => ({
|
|
48179
48282
|
id: key,
|
|
48180
48283
|
accessorFn: (row) => row[key],
|
|
@@ -48267,10 +48370,10 @@ function TestRunStatusStat({ status, className }) {
|
|
|
48267
48370
|
] });
|
|
48268
48371
|
}
|
|
48269
48372
|
function useTestRunState(campaign) {
|
|
48270
|
-
const [hasRun, setHasRun] =
|
|
48271
|
-
const [isStarting, setIsStarting] =
|
|
48272
|
-
const [durationMs, setDurationMs] =
|
|
48273
|
-
|
|
48373
|
+
const [hasRun, setHasRun] = React136.useState(false);
|
|
48374
|
+
const [isStarting, setIsStarting] = React136.useState(false);
|
|
48375
|
+
const [durationMs, setDurationMs] = React136.useState(0);
|
|
48376
|
+
React136.useEffect(() => {
|
|
48274
48377
|
if (!campaign.startedAt || !campaign.isRunning) {
|
|
48275
48378
|
if (campaign.startedAt && !campaign.isRunning) {
|
|
48276
48379
|
setDurationMs(Date.now() - campaign.startedAt.getTime());
|
|
@@ -48283,7 +48386,7 @@ function useTestRunState(campaign) {
|
|
|
48283
48386
|
}, 1e3);
|
|
48284
48387
|
return () => clearInterval(interval);
|
|
48285
48388
|
}, [campaign.startedAt, campaign.isRunning]);
|
|
48286
|
-
const run =
|
|
48389
|
+
const run = React136.useCallback(async (start) => {
|
|
48287
48390
|
setHasRun(true);
|
|
48288
48391
|
setDurationMs(0);
|
|
48289
48392
|
setIsStarting(true);
|
|
@@ -48293,11 +48396,11 @@ function useTestRunState(campaign) {
|
|
|
48293
48396
|
setIsStarting(false);
|
|
48294
48397
|
}
|
|
48295
48398
|
}, []);
|
|
48296
|
-
const stop =
|
|
48399
|
+
const stop = React136.useCallback(() => {
|
|
48297
48400
|
setIsStarting(false);
|
|
48298
48401
|
campaign.stopCampaign();
|
|
48299
48402
|
}, [campaign.stopCampaign]);
|
|
48300
|
-
const reset =
|
|
48403
|
+
const reset = React136.useCallback(() => {
|
|
48301
48404
|
setIsStarting(false);
|
|
48302
48405
|
campaign.stopCampaign();
|
|
48303
48406
|
setDurationMs(0);
|
|
@@ -48311,7 +48414,7 @@ function useTestRunState(campaign) {
|
|
|
48311
48414
|
const showTiming = hasRun && campaign.startedAt !== null && (campaign.isRunning || isFinished);
|
|
48312
48415
|
const startedLabel = showTiming && campaign.startedAt ? formatTime(campaign.startedAt) : "00:00 PM";
|
|
48313
48416
|
const durationLabel = showTiming ? formatTestRunDuration(durationMs) : "00:00:00";
|
|
48314
|
-
const displayRows =
|
|
48417
|
+
const displayRows = React136.useMemo(
|
|
48315
48418
|
() => campaign.results.map(
|
|
48316
48419
|
(row) => Object.fromEntries(Object.entries(row).map(([key, value]) => [key.replace(/_/g, " "), value]))
|
|
48317
48420
|
),
|
|
@@ -48417,16 +48520,16 @@ function TicketAttachmentsList({ attachments, className, size: size2 = "default"
|
|
|
48417
48520
|
}
|
|
48418
48521
|
|
|
48419
48522
|
// src/components/ui/ticket-notes-section.tsx
|
|
48420
|
-
import * as
|
|
48523
|
+
import * as React138 from "react";
|
|
48421
48524
|
init_cn();
|
|
48422
48525
|
|
|
48423
48526
|
// src/components/ui/ticket-note-card.tsx
|
|
48424
|
-
import * as
|
|
48527
|
+
import * as React137 from "react";
|
|
48425
48528
|
init_cn();
|
|
48426
48529
|
import { Fragment as Fragment76, jsx as jsx375, jsxs as jsxs295 } from "react/jsx-runtime";
|
|
48427
48530
|
function TicketNoteCard({ note, onEdit, onDelete, className }) {
|
|
48428
|
-
const [isEditing, setIsEditing] =
|
|
48429
|
-
const [editText, setEditText] =
|
|
48531
|
+
const [isEditing, setIsEditing] = React137.useState(false);
|
|
48532
|
+
const [editText, setEditText] = React137.useState(note.text);
|
|
48430
48533
|
const handleSave = () => {
|
|
48431
48534
|
const trimmed = editText.trim();
|
|
48432
48535
|
if (!trimmed || !onEdit) return;
|
|
@@ -48549,7 +48652,7 @@ function TicketNotesSection({
|
|
|
48549
48652
|
isAddingNote,
|
|
48550
48653
|
className
|
|
48551
48654
|
}) {
|
|
48552
|
-
const [noteText, setNoteText] =
|
|
48655
|
+
const [noteText, setNoteText] = React138.useState("");
|
|
48553
48656
|
const handleSend = () => {
|
|
48554
48657
|
const trimmed = noteText.trim();
|
|
48555
48658
|
if (!trimmed || !onAddNote || isAddingNote) return;
|
|
@@ -48753,7 +48856,7 @@ function TicketInfoSection({
|
|
|
48753
48856
|
}
|
|
48754
48857
|
|
|
48755
48858
|
// src/components/ui/take-over-ticket-modal.tsx
|
|
48756
|
-
import * as
|
|
48859
|
+
import * as React139 from "react";
|
|
48757
48860
|
init_button2();
|
|
48758
48861
|
import { jsx as jsx378, jsxs as jsxs298 } from "react/jsx-runtime";
|
|
48759
48862
|
function renderTicketStatusOption(option, isSelected) {
|
|
@@ -48788,9 +48891,9 @@ function TakeOverTicketModal({
|
|
|
48788
48891
|
isPending = false,
|
|
48789
48892
|
onConfirm
|
|
48790
48893
|
}) {
|
|
48791
|
-
const [statusId, setStatusId] =
|
|
48792
|
-
const [assigneeId, setAssigneeId] =
|
|
48793
|
-
|
|
48894
|
+
const [statusId, setStatusId] = React139.useState(null);
|
|
48895
|
+
const [assigneeId, setAssigneeId] = React139.useState(null);
|
|
48896
|
+
React139.useEffect(() => {
|
|
48794
48897
|
if (!isOpen) return;
|
|
48795
48898
|
setStatusId(initialStatusId ?? null);
|
|
48796
48899
|
setAssigneeId(initialAssigneeId ?? null);
|
|
@@ -48866,7 +48969,7 @@ function TakeOverTicketModal({
|
|
|
48866
48969
|
}
|
|
48867
48970
|
|
|
48868
48971
|
// src/components/ui/reopen-ticket-modal.tsx
|
|
48869
|
-
import * as
|
|
48972
|
+
import * as React140 from "react";
|
|
48870
48973
|
init_button2();
|
|
48871
48974
|
import { jsx as jsx379, jsxs as jsxs299 } from "react/jsx-runtime";
|
|
48872
48975
|
var REASON_MAX_LENGTH = 1e3;
|
|
@@ -48882,10 +48985,10 @@ function ReopenTicketModal({
|
|
|
48882
48985
|
isPending = false,
|
|
48883
48986
|
onConfirm
|
|
48884
48987
|
}) {
|
|
48885
|
-
const [statusId, setStatusId] =
|
|
48886
|
-
const [assigneeId, setAssigneeId] =
|
|
48887
|
-
const [reason, setReason] =
|
|
48888
|
-
|
|
48988
|
+
const [statusId, setStatusId] = React140.useState(null);
|
|
48989
|
+
const [assigneeId, setAssigneeId] = React140.useState(null);
|
|
48990
|
+
const [reason, setReason] = React140.useState("");
|
|
48991
|
+
React140.useEffect(() => {
|
|
48889
48992
|
if (!isOpen) return;
|
|
48890
48993
|
setStatusId(initialStatusId ?? null);
|
|
48891
48994
|
setAssigneeId(initialAssigneeId ?? null);
|
|
@@ -48979,7 +49082,7 @@ function ReopenTicketModal({
|
|
|
48979
49082
|
|
|
48980
49083
|
// src/components/ui/reopen-ticket-request-modal.tsx
|
|
48981
49084
|
init_button2();
|
|
48982
|
-
import * as
|
|
49085
|
+
import * as React141 from "react";
|
|
48983
49086
|
import { jsx as jsx380, jsxs as jsxs300 } from "react/jsx-runtime";
|
|
48984
49087
|
var REASON_MAX_LENGTH2 = 1e3;
|
|
48985
49088
|
function ReopenTicketRequestModal({
|
|
@@ -48989,9 +49092,9 @@ function ReopenTicketRequestModal({
|
|
|
48989
49092
|
isPending = false,
|
|
48990
49093
|
onConfirm
|
|
48991
49094
|
}) {
|
|
48992
|
-
const [reason, setReason] =
|
|
48993
|
-
const [handoff, setHandoff] =
|
|
48994
|
-
|
|
49095
|
+
const [reason, setReason] = React141.useState("");
|
|
49096
|
+
const [handoff, setHandoff] = React141.useState(false);
|
|
49097
|
+
React141.useEffect(() => {
|
|
48995
49098
|
if (!isOpen) return;
|
|
48996
49099
|
setReason("");
|
|
48997
49100
|
setHandoff(false);
|
|
@@ -49511,7 +49614,7 @@ function RoadmapCard({
|
|
|
49511
49614
|
}
|
|
49512
49615
|
|
|
49513
49616
|
// src/components/chat/entity-cards/github-activity-card.tsx
|
|
49514
|
-
import
|
|
49617
|
+
import React143 from "react";
|
|
49515
49618
|
import { GitPullRequest, Eye as Eye4, ExternalLink as ExternalLink9 } from "lucide-react";
|
|
49516
49619
|
import { Fragment as Fragment80, jsx as jsx385, jsxs as jsxs304 } from "react/jsx-runtime";
|
|
49517
49620
|
function parseRepoFromUrl(url) {
|
|
@@ -49652,7 +49755,7 @@ function GitHubActivityCard({ item, variant = "compact", className, anchorProps
|
|
|
49652
49755
|
reviewState ? /* @__PURE__ */ jsx385(ReviewStateBadge, { state: reviewState }) : null,
|
|
49653
49756
|
/* @__PURE__ */ jsx385("span", { className: COMPACT_CARD_TITLE, children: primaryText })
|
|
49654
49757
|
] }),
|
|
49655
|
-
/* @__PURE__ */ jsx385("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx385("span", { className: COMPACT_CARD_META_ROW, children: metaParts.map((part, i) => /* @__PURE__ */ jsxs304(
|
|
49758
|
+
/* @__PURE__ */ jsx385("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx385("span", { className: COMPACT_CARD_META_ROW, children: metaParts.map((part, i) => /* @__PURE__ */ jsxs304(React143.Fragment, { children: [
|
|
49656
49759
|
i > 0 ? /* @__PURE__ */ jsx385("span", { className: "text-ods-text-secondary/40 shrink-0", children: "\xB7" }) : null,
|
|
49657
49760
|
/* @__PURE__ */ jsx385("span", { className: "min-w-0 truncate", children: part })
|
|
49658
49761
|
] }, i)) }) }),
|
|
@@ -49698,7 +49801,7 @@ function GitHubActivityCardSkeleton({ variant = "compact", className }) {
|
|
|
49698
49801
|
}
|
|
49699
49802
|
|
|
49700
49803
|
// src/components/chat/entity-cards/slack-message-card.tsx
|
|
49701
|
-
import
|
|
49804
|
+
import React144 from "react";
|
|
49702
49805
|
import { ExternalLink as ExternalLink10, Hash } from "lucide-react";
|
|
49703
49806
|
import { Fragment as Fragment81, jsx as jsx386, jsxs as jsxs305 } from "react/jsx-runtime";
|
|
49704
49807
|
function parseChannelFromUrl(url) {
|
|
@@ -49744,7 +49847,7 @@ function SlackMessageCard({ item, variant = "compact", className, anchorProps })
|
|
|
49744
49847
|
/* @__PURE__ */ jsxs305("span", { className: COMPACT_CARD_TEXT_COL, children: [
|
|
49745
49848
|
/* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_TITLE_ROW, children: /* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_TITLE, children: item.title }) }),
|
|
49746
49849
|
/* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_SUMMARY, children: item.preview || COMPACT_CARD_ROW_FILLER }) }),
|
|
49747
|
-
/* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_META_ROW, children: metaParts.length > 0 ? metaParts.map((part, i) => /* @__PURE__ */ jsxs305(
|
|
49850
|
+
/* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_META_ROW, children: metaParts.length > 0 ? metaParts.map((part, i) => /* @__PURE__ */ jsxs305(React144.Fragment, { children: [
|
|
49748
49851
|
i > 0 ? /* @__PURE__ */ jsx386("span", { className: "text-ods-text-secondary/40 shrink-0", children: "\xB7" }) : null,
|
|
49749
49852
|
/* @__PURE__ */ jsx386("span", { className: "min-w-0 truncate", children: part })
|
|
49750
49853
|
] }, i)) : /* @__PURE__ */ jsx386("span", { className: COMPACT_CARD_SUMMARY, children: COMPACT_CARD_ROW_FILLER }) }) })
|
|
@@ -49787,7 +49890,7 @@ function SlackMessageCardSkeleton({ variant = "compact", className }) {
|
|
|
49787
49890
|
}
|
|
49788
49891
|
|
|
49789
49892
|
// src/components/chat/entity-cards/hubspot-ticket-card.tsx
|
|
49790
|
-
import
|
|
49893
|
+
import React145 from "react";
|
|
49791
49894
|
import { ExternalLink as ExternalLink11 } from "lucide-react";
|
|
49792
49895
|
import { Fragment as Fragment82, jsx as jsx387, jsxs as jsxs306 } from "react/jsx-runtime";
|
|
49793
49896
|
function formatToken(token) {
|
|
@@ -49856,7 +49959,7 @@ function HubspotTicketCard({ item, variant = "compact", className, anchorProps }
|
|
|
49856
49959
|
/* @__PURE__ */ jsx387("span", { className: "min-w-0 truncate", children: item.customerEmail })
|
|
49857
49960
|
] }) : null,
|
|
49858
49961
|
/* @__PURE__ */ jsx387("span", { className: "flex min-w-0", children: /* @__PURE__ */ jsx387("span", { className: "line-clamp-4 whitespace-pre-wrap break-words text-h6 text-ods-text-secondary", children: item.preview || /* @__PURE__ */ jsx387("span", { className: "italic text-ods-text-secondary/60", children: "No description provided." }) }) }),
|
|
49859
|
-
metaParts.length > 0 ? /* @__PURE__ */ jsx387("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx387("span", { className: COMPACT_CARD_META_ROW, children: metaParts.map((part, i) => /* @__PURE__ */ jsxs306(
|
|
49962
|
+
metaParts.length > 0 ? /* @__PURE__ */ jsx387("span", { className: COMPACT_CARD_META_ROW_BOX, children: /* @__PURE__ */ jsx387("span", { className: COMPACT_CARD_META_ROW, children: metaParts.map((part, i) => /* @__PURE__ */ jsxs306(React145.Fragment, { children: [
|
|
49860
49963
|
i > 0 ? /* @__PURE__ */ jsx387("span", { className: "text-ods-text-secondary/40 shrink-0", children: "\xB7" }) : null,
|
|
49861
49964
|
/* @__PURE__ */ jsx387("span", { className: "min-w-0 truncate", children: part })
|
|
49862
49965
|
] }, i)) }) }) : null
|
|
@@ -51950,7 +52053,7 @@ function GenericEntityCardSkeleton({ className }) {
|
|
|
51950
52053
|
}
|
|
51951
52054
|
|
|
51952
52055
|
// src/components/chat/entity-cards/dispatch.tsx
|
|
51953
|
-
import
|
|
52056
|
+
import React147 from "react";
|
|
51954
52057
|
init_next_navigation();
|
|
51955
52058
|
|
|
51956
52059
|
// src/components/chat/hooks/use-chat-card-item.ts
|
|
@@ -53257,7 +53360,7 @@ function ChatCardLoader({
|
|
|
53257
53360
|
extras
|
|
53258
53361
|
}) {
|
|
53259
53362
|
const runtime = useRequiredChatRuntime();
|
|
53260
|
-
const resolvedChatRef =
|
|
53363
|
+
const resolvedChatRef = React147.useMemo(() => {
|
|
53261
53364
|
const cta = resolveSourceRowCTA(
|
|
53262
53365
|
{
|
|
53263
53366
|
sourceRepo: chatRef.sourceRepo,
|
|
@@ -53405,7 +53508,7 @@ function renderChatInlineEntityCard(chatRef, options = {}) {
|
|
|
53405
53508
|
}
|
|
53406
53509
|
|
|
53407
53510
|
// src/components/chat/hooks/use-chunk-catchup.ts
|
|
53408
|
-
import { useCallback as
|
|
53511
|
+
import { useCallback as useCallback48, useRef as useRef70 } from "react";
|
|
53409
53512
|
function makeSeqKey(messageType, chunkType, sequenceId) {
|
|
53410
53513
|
return `${messageType}:${chunkType}:${sequenceId}`;
|
|
53411
53514
|
}
|
|
@@ -53427,24 +53530,24 @@ function useChunkCatchup({
|
|
|
53427
53530
|
chatTypes = [CHAT_TYPE.CLIENT],
|
|
53428
53531
|
fetchChunks
|
|
53429
53532
|
}) {
|
|
53430
|
-
const processedSequenceKeys =
|
|
53431
|
-
const lastSequenceId =
|
|
53432
|
-
const lastSequenceIdByType =
|
|
53433
|
-
const fetchingInProgress =
|
|
53434
|
-
const lastFetchParams =
|
|
53435
|
-
const pendingCatchupRef =
|
|
53436
|
-
const chunkBuffer =
|
|
53437
|
-
const bufferUntilInitialCatchupComplete =
|
|
53438
|
-
const hasCompletedInitialCatchup =
|
|
53439
|
-
const dialogIdRef =
|
|
53533
|
+
const processedSequenceKeys = useRef70(/* @__PURE__ */ new Set());
|
|
53534
|
+
const lastSequenceId = useRef70(null);
|
|
53535
|
+
const lastSequenceIdByType = useRef70(/* @__PURE__ */ new Map());
|
|
53536
|
+
const fetchingInProgress = useRef70(false);
|
|
53537
|
+
const lastFetchParams = useRef70(null);
|
|
53538
|
+
const pendingCatchupRef = useRef70(null);
|
|
53539
|
+
const chunkBuffer = useRef70([]);
|
|
53540
|
+
const bufferUntilInitialCatchupComplete = useRef70(false);
|
|
53541
|
+
const hasCompletedInitialCatchup = useRef70(false);
|
|
53542
|
+
const dialogIdRef = useRef70(dialogId);
|
|
53440
53543
|
dialogIdRef.current = dialogId;
|
|
53441
|
-
const chatTypesRef =
|
|
53544
|
+
const chatTypesRef = useRef70(chatTypes);
|
|
53442
53545
|
chatTypesRef.current = chatTypes;
|
|
53443
|
-
const fetchChunksRef =
|
|
53546
|
+
const fetchChunksRef = useRef70(fetchChunks);
|
|
53444
53547
|
fetchChunksRef.current = fetchChunks;
|
|
53445
|
-
const onChunkReceivedRef =
|
|
53548
|
+
const onChunkReceivedRef = useRef70(onChunkReceived);
|
|
53446
53549
|
onChunkReceivedRef.current = onChunkReceived;
|
|
53447
|
-
const processChunk =
|
|
53550
|
+
const processChunk = useCallback48((chunk, messageType, forceProcess = false) => {
|
|
53448
53551
|
if (bufferUntilInitialCatchupComplete.current && !forceProcess) {
|
|
53449
53552
|
chunkBuffer.current.push({ chunk, messageType });
|
|
53450
53553
|
return true;
|
|
@@ -53463,7 +53566,7 @@ function useChunkCatchup({
|
|
|
53463
53566
|
onChunkReceivedRef.current(chunk, messageType);
|
|
53464
53567
|
return true;
|
|
53465
53568
|
}, []);
|
|
53466
|
-
const flushBufferedRealtimeChunks =
|
|
53569
|
+
const flushBufferedRealtimeChunks = useCallback48(() => {
|
|
53467
53570
|
if (chunkBuffer.current.length === 0) return;
|
|
53468
53571
|
const buffered = [...chunkBuffer.current];
|
|
53469
53572
|
chunkBuffer.current = [];
|
|
@@ -53476,7 +53579,7 @@ function useChunkCatchup({
|
|
|
53476
53579
|
processChunk(chunk, messageType, true);
|
|
53477
53580
|
});
|
|
53478
53581
|
}, [processChunk]);
|
|
53479
|
-
const catchUpChunks =
|
|
53582
|
+
const catchUpChunks = useCallback48(async (fromSequenceId) => {
|
|
53480
53583
|
const dialogId2 = dialogIdRef.current;
|
|
53481
53584
|
const chatTypes2 = chatTypesRef.current;
|
|
53482
53585
|
const fetchChunks2 = fetchChunksRef.current;
|
|
@@ -53640,9 +53743,9 @@ function useChunkCatchup({
|
|
|
53640
53743
|
}
|
|
53641
53744
|
}
|
|
53642
53745
|
}, [flushBufferedRealtimeChunks]);
|
|
53643
|
-
const catchUpChunksRef =
|
|
53746
|
+
const catchUpChunksRef = useRef70(null);
|
|
53644
53747
|
catchUpChunksRef.current = catchUpChunks;
|
|
53645
|
-
const resetChunkTracking =
|
|
53748
|
+
const resetChunkTracking = useCallback48(() => {
|
|
53646
53749
|
processedSequenceKeys.current.clear();
|
|
53647
53750
|
lastSequenceId.current = null;
|
|
53648
53751
|
lastSequenceIdByType.current.clear();
|
|
@@ -53653,15 +53756,15 @@ function useChunkCatchup({
|
|
|
53653
53756
|
bufferUntilInitialCatchupComplete.current = false;
|
|
53654
53757
|
hasCompletedInitialCatchup.current = false;
|
|
53655
53758
|
}, []);
|
|
53656
|
-
const startInitialBuffering =
|
|
53759
|
+
const startInitialBuffering = useCallback48(() => {
|
|
53657
53760
|
if (!bufferUntilInitialCatchupComplete.current) {
|
|
53658
53761
|
chunkBuffer.current = [];
|
|
53659
53762
|
bufferUntilInitialCatchupComplete.current = true;
|
|
53660
53763
|
}
|
|
53661
53764
|
hasCompletedInitialCatchup.current = false;
|
|
53662
53765
|
}, []);
|
|
53663
|
-
const isBufferingActive =
|
|
53664
|
-
const resetAndCatchUp =
|
|
53766
|
+
const isBufferingActive = useCallback48(() => bufferUntilInitialCatchupComplete.current, []);
|
|
53767
|
+
const resetAndCatchUp = useCallback48(async () => {
|
|
53665
53768
|
if (!dialogIdRef.current) return;
|
|
53666
53769
|
const fromSeq = lastSequenceId.current;
|
|
53667
53770
|
hasCompletedInitialCatchup.current = false;
|
|
@@ -53719,7 +53822,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
53719
53822
|
}
|
|
53720
53823
|
|
|
53721
53824
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
53722
|
-
import { useCallback as
|
|
53825
|
+
import { useCallback as useCallback49, useEffect as useEffect90, useRef as useRef71, useState as useState119 } from "react";
|
|
53723
53826
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
53724
53827
|
var RESYNC_AFTER_HIDDEN_MS = 1e4;
|
|
53725
53828
|
var RESYNC_COALESCE_MS = 1e3;
|
|
@@ -53746,54 +53849,54 @@ function useJetStreamDialogSubscription({
|
|
|
53746
53849
|
const [reconnectionCount, setReconnectionCount] = useState119(0);
|
|
53747
53850
|
const [recoveryCount, setRecoveryCount] = useState119(0);
|
|
53748
53851
|
const [currentStreamSeq, setCurrentStreamSeq] = useState119(null);
|
|
53749
|
-
const lastRecoveryReportRef =
|
|
53750
|
-
const resyncTimerRef =
|
|
53751
|
-
const lastResyncSignalRef =
|
|
53752
|
-
const clientRef =
|
|
53753
|
-
const subscriptionRef =
|
|
53754
|
-
const highestStreamSeqRef =
|
|
53755
|
-
const onEventRef =
|
|
53852
|
+
const lastRecoveryReportRef = useRef71(0);
|
|
53853
|
+
const resyncTimerRef = useRef71(null);
|
|
53854
|
+
const lastResyncSignalRef = useRef71(resyncSignal);
|
|
53855
|
+
const clientRef = useRef71(null);
|
|
53856
|
+
const subscriptionRef = useRef71(null);
|
|
53857
|
+
const highestStreamSeqRef = useRef71(null);
|
|
53858
|
+
const onEventRef = useRef71(onEvent);
|
|
53756
53859
|
useEffect90(() => {
|
|
53757
53860
|
onEventRef.current = onEvent;
|
|
53758
53861
|
}, [onEvent]);
|
|
53759
|
-
const onConnectRef =
|
|
53862
|
+
const onConnectRef = useRef71(onConnect);
|
|
53760
53863
|
useEffect90(() => {
|
|
53761
53864
|
onConnectRef.current = onConnect;
|
|
53762
53865
|
}, [onConnect]);
|
|
53763
|
-
const onDisconnectRef =
|
|
53866
|
+
const onDisconnectRef = useRef71(onDisconnect);
|
|
53764
53867
|
useEffect90(() => {
|
|
53765
53868
|
onDisconnectRef.current = onDisconnect;
|
|
53766
53869
|
}, [onDisconnect]);
|
|
53767
|
-
const onSubscribedRef =
|
|
53870
|
+
const onSubscribedRef = useRef71(onSubscribed);
|
|
53768
53871
|
useEffect90(() => {
|
|
53769
53872
|
onSubscribedRef.current = onSubscribed;
|
|
53770
53873
|
}, [onSubscribed]);
|
|
53771
|
-
const onBeforeReconnectRef =
|
|
53874
|
+
const onBeforeReconnectRef = useRef71(onBeforeReconnect);
|
|
53772
53875
|
useEffect90(() => {
|
|
53773
53876
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
53774
53877
|
}, [onBeforeReconnect]);
|
|
53775
|
-
const getNatsWsUrlRef =
|
|
53878
|
+
const getNatsWsUrlRef = useRef71(getNatsWsUrl);
|
|
53776
53879
|
useEffect90(() => {
|
|
53777
53880
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
53778
53881
|
}, [getNatsWsUrl]);
|
|
53779
|
-
const reconnectionBackoffRef =
|
|
53882
|
+
const reconnectionBackoffRef = useRef71(reconnectionBackoff);
|
|
53780
53883
|
useEffect90(() => {
|
|
53781
53884
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
53782
53885
|
}, [reconnectionBackoff]);
|
|
53783
|
-
const optStartSeqRef =
|
|
53886
|
+
const optStartSeqRef = useRef71(optStartSeq);
|
|
53784
53887
|
useEffect90(() => {
|
|
53785
53888
|
optStartSeqRef.current = optStartSeq;
|
|
53786
53889
|
}, [optStartSeq]);
|
|
53787
|
-
const inactiveThresholdRef =
|
|
53890
|
+
const inactiveThresholdRef = useRef71(inactiveThresholdMs);
|
|
53788
53891
|
useEffect90(() => {
|
|
53789
53892
|
inactiveThresholdRef.current = inactiveThresholdMs;
|
|
53790
53893
|
}, [inactiveThresholdMs]);
|
|
53791
|
-
const hadConnectionBeforeRef =
|
|
53792
|
-
const clientConfigRef =
|
|
53894
|
+
const hadConnectionBeforeRef = useRef71(false);
|
|
53895
|
+
const clientConfigRef = useRef71(clientConfig);
|
|
53793
53896
|
useEffect90(() => {
|
|
53794
53897
|
clientConfigRef.current = clientConfig;
|
|
53795
53898
|
}, [clientConfig]);
|
|
53796
|
-
const currentWsUrlRef =
|
|
53899
|
+
const currentWsUrlRef = useRef71("");
|
|
53797
53900
|
const wsUrl = getNatsWsUrl();
|
|
53798
53901
|
useEffect90(() => {
|
|
53799
53902
|
if (!enabled || !wsUrl) {
|
|
@@ -53887,7 +53990,7 @@ function useJetStreamDialogSubscription({
|
|
|
53887
53990
|
}
|
|
53888
53991
|
};
|
|
53889
53992
|
}, [dialogId]);
|
|
53890
|
-
const requestResync =
|
|
53993
|
+
const requestResync = useCallback49(() => {
|
|
53891
53994
|
if (resyncTimerRef.current !== null) clearTimeout(resyncTimerRef.current);
|
|
53892
53995
|
resyncTimerRef.current = setTimeout(() => {
|
|
53893
53996
|
resyncTimerRef.current = null;
|
|
@@ -54018,7 +54121,7 @@ function useJetStreamDialogSubscription({
|
|
|
54018
54121
|
}
|
|
54019
54122
|
|
|
54020
54123
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
54021
|
-
import { useEffect as useEffect91, useRef as
|
|
54124
|
+
import { useEffect as useEffect91, useRef as useRef72, useState as useState120 } from "react";
|
|
54022
54125
|
function useNatsDialogSubscription({
|
|
54023
54126
|
enabled,
|
|
54024
54127
|
dialogId,
|
|
@@ -54035,42 +54138,42 @@ function useNatsDialogSubscription({
|
|
|
54035
54138
|
const [isConnected, setIsConnected] = useState120(false);
|
|
54036
54139
|
const [isSubscribed, setIsSubscribed] = useState120(false);
|
|
54037
54140
|
const [reconnectionCount, setReconnectionCount] = useState120(0);
|
|
54038
|
-
const clientRef =
|
|
54039
|
-
const subscriptionRefs =
|
|
54040
|
-
const onEventRef =
|
|
54141
|
+
const clientRef = useRef72(null);
|
|
54142
|
+
const subscriptionRefs = useRef72(/* @__PURE__ */ new Map());
|
|
54143
|
+
const onEventRef = useRef72(onEvent);
|
|
54041
54144
|
useEffect91(() => {
|
|
54042
54145
|
onEventRef.current = onEvent;
|
|
54043
54146
|
}, [onEvent]);
|
|
54044
|
-
const onConnectRef =
|
|
54147
|
+
const onConnectRef = useRef72(onConnect);
|
|
54045
54148
|
useEffect91(() => {
|
|
54046
54149
|
onConnectRef.current = onConnect;
|
|
54047
54150
|
}, [onConnect]);
|
|
54048
|
-
const onDisconnectRef =
|
|
54151
|
+
const onDisconnectRef = useRef72(onDisconnect);
|
|
54049
54152
|
useEffect91(() => {
|
|
54050
54153
|
onDisconnectRef.current = onDisconnect;
|
|
54051
54154
|
}, [onDisconnect]);
|
|
54052
|
-
const onSubscribedRef =
|
|
54155
|
+
const onSubscribedRef = useRef72(onSubscribed);
|
|
54053
54156
|
useEffect91(() => {
|
|
54054
54157
|
onSubscribedRef.current = onSubscribed;
|
|
54055
54158
|
}, [onSubscribed]);
|
|
54056
|
-
const onBeforeReconnectRef =
|
|
54159
|
+
const onBeforeReconnectRef = useRef72(onBeforeReconnect);
|
|
54057
54160
|
useEffect91(() => {
|
|
54058
54161
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
54059
54162
|
}, [onBeforeReconnect]);
|
|
54060
|
-
const hadConnectionBeforeRef =
|
|
54061
|
-
const getNatsWsUrlRef =
|
|
54163
|
+
const hadConnectionBeforeRef = useRef72(false);
|
|
54164
|
+
const getNatsWsUrlRef = useRef72(getNatsWsUrl);
|
|
54062
54165
|
useEffect91(() => {
|
|
54063
54166
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
54064
54167
|
}, [getNatsWsUrl]);
|
|
54065
|
-
const reconnectionBackoffRef =
|
|
54168
|
+
const reconnectionBackoffRef = useRef72(reconnectionBackoff);
|
|
54066
54169
|
useEffect91(() => {
|
|
54067
54170
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
54068
54171
|
}, [reconnectionBackoff]);
|
|
54069
|
-
const clientConfigRef =
|
|
54172
|
+
const clientConfigRef = useRef72(clientConfig);
|
|
54070
54173
|
useEffect91(() => {
|
|
54071
54174
|
clientConfigRef.current = clientConfig;
|
|
54072
54175
|
}, [clientConfig]);
|
|
54073
|
-
const currentWsUrlRef =
|
|
54176
|
+
const currentWsUrlRef = useRef72("");
|
|
54074
54177
|
const wsUrl = getNatsWsUrl();
|
|
54075
54178
|
useEffect91(() => {
|
|
54076
54179
|
if (!enabled || !wsUrl) {
|
|
@@ -54154,15 +54257,15 @@ function useNatsDialogSubscription({
|
|
|
54154
54257
|
};
|
|
54155
54258
|
}, [enabled, wsUrl]);
|
|
54156
54259
|
const topicsKey = topics.join(",");
|
|
54157
|
-
const topicsRef =
|
|
54260
|
+
const topicsRef = useRef72(topics);
|
|
54158
54261
|
topicsRef.current = topics;
|
|
54159
|
-
const lastSubscribedDialogIdRef =
|
|
54160
|
-
const isConnectedRef =
|
|
54262
|
+
const lastSubscribedDialogIdRef = useRef72(null);
|
|
54263
|
+
const isConnectedRef = useRef72(isConnected);
|
|
54161
54264
|
useEffect91(() => {
|
|
54162
54265
|
isConnectedRef.current = isConnected;
|
|
54163
54266
|
}, [isConnected]);
|
|
54164
|
-
const currentDialogIdRef =
|
|
54165
|
-
const abortControllerRef =
|
|
54267
|
+
const currentDialogIdRef = useRef72(null);
|
|
54268
|
+
const abortControllerRef = useRef72(null);
|
|
54166
54269
|
useEffect91(() => {
|
|
54167
54270
|
currentDialogIdRef.current = dialogId;
|
|
54168
54271
|
if (!enabled || !dialogId) {
|
|
@@ -54419,7 +54522,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
54419
54522
|
}
|
|
54420
54523
|
|
|
54421
54524
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
54422
|
-
import { useCallback as
|
|
54525
|
+
import { useCallback as useCallback50, useMemo as useMemo51, useRef as useRef73, useState as useState122 } from "react";
|
|
54423
54526
|
import { fileTypeFromBlob } from "file-type";
|
|
54424
54527
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
54425
54528
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -54496,11 +54599,11 @@ function useChatAttachments() {
|
|
|
54496
54599
|
const runtime = useRequiredChatRuntime();
|
|
54497
54600
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
54498
54601
|
const [attachments, setAttachments] = useState122([]);
|
|
54499
|
-
const controllersRef =
|
|
54500
|
-
const updateOne =
|
|
54602
|
+
const controllersRef = useRef73(/* @__PURE__ */ new Map());
|
|
54603
|
+
const updateOne = useCallback50((id, patch) => {
|
|
54501
54604
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
54502
54605
|
}, []);
|
|
54503
|
-
const removeAttachment =
|
|
54606
|
+
const removeAttachment = useCallback50((id) => {
|
|
54504
54607
|
const ctrl = controllersRef.current.get(id);
|
|
54505
54608
|
if (ctrl) {
|
|
54506
54609
|
ctrl.abort();
|
|
@@ -54508,12 +54611,12 @@ function useChatAttachments() {
|
|
|
54508
54611
|
}
|
|
54509
54612
|
setAttachments((prev) => prev.filter((a) => a.id !== id));
|
|
54510
54613
|
}, []);
|
|
54511
|
-
const clear =
|
|
54614
|
+
const clear = useCallback50(() => {
|
|
54512
54615
|
for (const ctrl of controllersRef.current.values()) ctrl.abort();
|
|
54513
54616
|
controllersRef.current.clear();
|
|
54514
54617
|
setAttachments([]);
|
|
54515
54618
|
}, []);
|
|
54516
|
-
const uploadOne =
|
|
54619
|
+
const uploadOne = useCallback50(
|
|
54517
54620
|
async (att) => {
|
|
54518
54621
|
const ctrl = controllersRef.current.get(att.id);
|
|
54519
54622
|
try {
|
|
@@ -54585,9 +54688,9 @@ function useChatAttachments() {
|
|
|
54585
54688
|
},
|
|
54586
54689
|
[uploadUrlEndpoint, updateOne]
|
|
54587
54690
|
);
|
|
54588
|
-
const attachmentsRef =
|
|
54691
|
+
const attachmentsRef = useRef73([]);
|
|
54589
54692
|
attachmentsRef.current = attachments;
|
|
54590
|
-
const addFiles =
|
|
54693
|
+
const addFiles = useCallback50(
|
|
54591
54694
|
(files) => {
|
|
54592
54695
|
const arr = Array.from(files);
|
|
54593
54696
|
if (arr.length === 0) return;
|
|
@@ -54636,7 +54739,7 @@ function useChatAttachments() {
|
|
|
54636
54739
|
},
|
|
54637
54740
|
[uploadOne]
|
|
54638
54741
|
);
|
|
54639
|
-
const readyAttachments =
|
|
54742
|
+
const readyAttachments = useMemo51(
|
|
54640
54743
|
() => attachments.filter(
|
|
54641
54744
|
(a) => a.status === "ready" && !!a.storagePath && !!a.viewToken
|
|
54642
54745
|
).map((a) => ({
|
|
@@ -54662,15 +54765,15 @@ function useChatAttachments() {
|
|
|
54662
54765
|
}
|
|
54663
54766
|
|
|
54664
54767
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
54665
|
-
import { useCallback as
|
|
54768
|
+
import { useCallback as useCallback51, useEffect as useEffect93, useRef as useRef74, useState as useState123 } from "react";
|
|
54666
54769
|
import { jsx as jsx395 } from "react/jsx-runtime";
|
|
54667
54770
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
54668
54771
|
function useChatAttachmentImageGallery() {
|
|
54669
54772
|
const runtime = useRequiredChatRuntime();
|
|
54670
54773
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
54671
|
-
const panelRef =
|
|
54774
|
+
const panelRef = useRef74(null);
|
|
54672
54775
|
const [state, setState] = useState123(CLOSED);
|
|
54673
|
-
const handleClose =
|
|
54776
|
+
const handleClose = useCallback51(() => setState(CLOSED), []);
|
|
54674
54777
|
useEffect93(() => {
|
|
54675
54778
|
const root = panelRef.current;
|
|
54676
54779
|
if (!root) return;
|
|
@@ -54717,10 +54820,10 @@ function absolutize(prefix) {
|
|
|
54717
54820
|
}
|
|
54718
54821
|
|
|
54719
54822
|
// src/components/chat/hooks/use-close-on-navigation.ts
|
|
54720
|
-
import { useEffect as useEffect94, useRef as
|
|
54823
|
+
import { useEffect as useEffect94, useRef as useRef75 } from "react";
|
|
54721
54824
|
function useCloseOnNavigation(close, pathname) {
|
|
54722
|
-
const prevPathnameRef =
|
|
54723
|
-
const initializedRef =
|
|
54825
|
+
const prevPathnameRef = useRef75(null);
|
|
54826
|
+
const initializedRef = useRef75(false);
|
|
54724
54827
|
useEffect94(() => {
|
|
54725
54828
|
if (!initializedRef.current) {
|
|
54726
54829
|
initializedRef.current = true;
|
|
@@ -54735,20 +54838,20 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
54735
54838
|
}
|
|
54736
54839
|
|
|
54737
54840
|
// src/components/chat/hooks/use-chat.ts
|
|
54738
|
-
import { useState as useState125, useCallback as
|
|
54841
|
+
import { useState as useState125, useCallback as useCallback53, useEffect as useEffect95, useRef as useRef77 } from "react";
|
|
54739
54842
|
|
|
54740
54843
|
// src/components/chat/hooks/use-sse.ts
|
|
54741
|
-
import { useState as useState124, useCallback as
|
|
54844
|
+
import { useState as useState124, useCallback as useCallback52, useRef as useRef76 } from "react";
|
|
54742
54845
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
54743
54846
|
const [isStreaming, setIsStreaming] = useState124(false);
|
|
54744
54847
|
const [error, setError] = useState124(null);
|
|
54745
|
-
const abortControllerRef =
|
|
54746
|
-
const fallbackStream =
|
|
54848
|
+
const abortControllerRef = useRef76(null);
|
|
54849
|
+
const fallbackStream = useCallback52(async function* () {
|
|
54747
54850
|
throw new Error(
|
|
54748
54851
|
"[useSSE] No streamFn provided and `useMock: true` is no longer wired into the lib. Supply a `streamFn` (see `createDocStreamFn` in use-embedded-chat) or migrate the mock to your host code."
|
|
54749
54852
|
);
|
|
54750
54853
|
}, []);
|
|
54751
|
-
const streamMessage =
|
|
54854
|
+
const streamMessage = useCallback52(
|
|
54752
54855
|
async function* (message2, extra) {
|
|
54753
54856
|
setIsStreaming(true);
|
|
54754
54857
|
setError(null);
|
|
@@ -54778,13 +54881,13 @@ function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
|
54778
54881
|
},
|
|
54779
54882
|
[streamFn, fallbackStream]
|
|
54780
54883
|
);
|
|
54781
|
-
const abort =
|
|
54884
|
+
const abort = useCallback52(() => {
|
|
54782
54885
|
if (abortControllerRef.current) {
|
|
54783
54886
|
abortControllerRef.current.abort();
|
|
54784
54887
|
}
|
|
54785
54888
|
setIsStreaming(false);
|
|
54786
54889
|
}, []);
|
|
54787
|
-
const reset =
|
|
54890
|
+
const reset = useCallback52(() => {
|
|
54788
54891
|
}, []);
|
|
54789
54892
|
return {
|
|
54790
54893
|
streamMessage,
|
|
@@ -54810,8 +54913,8 @@ function useChat({
|
|
|
54810
54913
|
} = {}) {
|
|
54811
54914
|
const [messages, setMessages] = useState125(() => initialMessages ?? []);
|
|
54812
54915
|
const [isTyping, setIsTyping] = useState125(false);
|
|
54813
|
-
const currentAssistantSegmentsRef =
|
|
54814
|
-
const onMessagesChangeRef =
|
|
54916
|
+
const currentAssistantSegmentsRef = useRef77([]);
|
|
54917
|
+
const onMessagesChangeRef = useRef77(onMessagesChange);
|
|
54815
54918
|
onMessagesChangeRef.current = onMessagesChange;
|
|
54816
54919
|
useEffect95(() => {
|
|
54817
54920
|
onMessagesChangeRef.current?.(messages);
|
|
@@ -54827,10 +54930,10 @@ function useChat({
|
|
|
54827
54930
|
debugMode,
|
|
54828
54931
|
streamFn
|
|
54829
54932
|
});
|
|
54830
|
-
const addMessage =
|
|
54933
|
+
const addMessage = useCallback53((message2) => {
|
|
54831
54934
|
setMessages((prev) => [...prev, message2]);
|
|
54832
54935
|
}, []);
|
|
54833
|
-
const updateLastAssistantMessage =
|
|
54936
|
+
const updateLastAssistantMessage = useCallback53((segments) => {
|
|
54834
54937
|
setMessages((prev) => {
|
|
54835
54938
|
const newMessages = [...prev];
|
|
54836
54939
|
const lastMessage = newMessages[newMessages.length - 1];
|
|
@@ -54843,7 +54946,7 @@ function useChat({
|
|
|
54843
54946
|
return newMessages;
|
|
54844
54947
|
});
|
|
54845
54948
|
}, []);
|
|
54846
|
-
const sendMessage =
|
|
54949
|
+
const sendMessage = useCallback53(
|
|
54847
54950
|
async (text, extra, options) => {
|
|
54848
54951
|
const userMessage = {
|
|
54849
54952
|
id: `user-${Date.now()}`,
|
|
@@ -55050,21 +55153,21 @@ function useChat({
|
|
|
55050
55153
|
},
|
|
55051
55154
|
[streamMessage, addMessage, updateLastAssistantMessage, assistantName, assistantAvatar]
|
|
55052
55155
|
);
|
|
55053
|
-
const handleQuickAction =
|
|
55156
|
+
const handleQuickAction = useCallback53(
|
|
55054
55157
|
(actionText) => {
|
|
55055
55158
|
sendMessage(actionText);
|
|
55056
55159
|
},
|
|
55057
55160
|
[sendMessage]
|
|
55058
55161
|
);
|
|
55059
|
-
const clearMessages =
|
|
55162
|
+
const clearMessages = useCallback53(() => {
|
|
55060
55163
|
setMessages([]);
|
|
55061
55164
|
setIsTyping(false);
|
|
55062
55165
|
reset();
|
|
55063
55166
|
}, [reset]);
|
|
55064
|
-
const hydrateMessages =
|
|
55167
|
+
const hydrateMessages = useCallback53((history) => {
|
|
55065
55168
|
setMessages((prev) => prev.length === 0 ? history : [...history, ...prev]);
|
|
55066
55169
|
}, []);
|
|
55067
|
-
const stopMessage =
|
|
55170
|
+
const stopMessage = useCallback53(() => {
|
|
55068
55171
|
abort();
|
|
55069
55172
|
setIsTyping(false);
|
|
55070
55173
|
}, [abort]);
|
|
@@ -55083,7 +55186,7 @@ function useChat({
|
|
|
55083
55186
|
}
|
|
55084
55187
|
|
|
55085
55188
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
55086
|
-
import { useCallback as
|
|
55189
|
+
import { useCallback as useCallback55, useMemo as useMemo53, useRef as useRef80 } from "react";
|
|
55087
55190
|
|
|
55088
55191
|
// src/chat-protocol/confirm-tool.ts
|
|
55089
55192
|
function buildConfirmToolBody(request) {
|
|
@@ -55350,7 +55453,7 @@ function pruneStaleChatConversationStorage(source) {
|
|
|
55350
55453
|
}
|
|
55351
55454
|
|
|
55352
55455
|
// src/components/chat/hooks/use-chat-history-hydration.ts
|
|
55353
|
-
import { useEffect as useEffect96, useRef as
|
|
55456
|
+
import { useEffect as useEffect96, useRef as useRef78, useState as useState126 } from "react";
|
|
55354
55457
|
function useChatHistoryHydration({
|
|
55355
55458
|
active,
|
|
55356
55459
|
source,
|
|
@@ -55361,7 +55464,7 @@ function useChatHistoryHydration({
|
|
|
55361
55464
|
bumpMetaTick
|
|
55362
55465
|
}) {
|
|
55363
55466
|
const [isHydratingHistory, setIsHydratingHistory] = useState126(false);
|
|
55364
|
-
const hydratedKeyRef =
|
|
55467
|
+
const hydratedKeyRef = useRef78(null);
|
|
55365
55468
|
useEffect96(() => {
|
|
55366
55469
|
if (!active) return;
|
|
55367
55470
|
const conversationId = conversationIdRef.current;
|
|
@@ -57548,7 +57651,7 @@ function createChatDialogStore(options = {}) {
|
|
|
57548
57651
|
}
|
|
57549
57652
|
|
|
57550
57653
|
// src/components/chat/stream/use-chat-stream-reducer.ts
|
|
57551
|
-
import { useCallback as
|
|
57654
|
+
import { useCallback as useCallback54, useEffect as useEffect97, useMemo as useMemo52, useRef as useRef79, useSyncExternalStore } from "react";
|
|
57552
57655
|
|
|
57553
57656
|
// src/components/chat/stream/delta-batcher.ts
|
|
57554
57657
|
var DELTA_FLUSH_FALLBACK_MS = 50;
|
|
@@ -57637,21 +57740,21 @@ function useChatStreamReducer({
|
|
|
57637
57740
|
side = DEFAULT_DIALOG_SIDE,
|
|
57638
57741
|
createReducerOptions
|
|
57639
57742
|
}) {
|
|
57640
|
-
const optionsRef =
|
|
57743
|
+
const optionsRef = useRef79(createReducerOptions);
|
|
57641
57744
|
optionsRef.current = createReducerOptions;
|
|
57642
57745
|
const reducer2 = store.getReducer(dialogId, side, () => optionsRef.current?.() ?? {});
|
|
57643
|
-
const getSnapshot =
|
|
57644
|
-
const getServerSnapshot =
|
|
57645
|
-
const subscribe =
|
|
57746
|
+
const getSnapshot = useCallback54(() => store.getSnapshot(dialogId, side), [store, dialogId, side]);
|
|
57747
|
+
const getServerSnapshot = useCallback54(() => store.getServerSnapshot(), [store]);
|
|
57748
|
+
const subscribe = useCallback54((listener) => store.subscribe(listener), [store]);
|
|
57646
57749
|
const state = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
57647
57750
|
useEffect97(() => store.retain(dialogId, side), [store, dialogId, side]);
|
|
57648
|
-
const keyRef =
|
|
57751
|
+
const keyRef = useRef79({ dialogId, side });
|
|
57649
57752
|
if (keyRef.current.dialogId !== dialogId || keyRef.current.side !== side) {
|
|
57650
57753
|
keyRef.current = { dialogId, side };
|
|
57651
57754
|
}
|
|
57652
|
-
const storeRef =
|
|
57755
|
+
const storeRef = useRef79(store);
|
|
57653
57756
|
storeRef.current = store;
|
|
57654
|
-
const batcherRef =
|
|
57757
|
+
const batcherRef = useRef79(null);
|
|
57655
57758
|
if (batcherRef.current === null) {
|
|
57656
57759
|
batcherRef.current = createDeltaBatcher({
|
|
57657
57760
|
applyOne: (event, key) => {
|
|
@@ -57660,8 +57763,8 @@ function useChatStreamReducer({
|
|
|
57660
57763
|
});
|
|
57661
57764
|
}
|
|
57662
57765
|
const batcher = batcherRef.current;
|
|
57663
|
-
const flushDeltas =
|
|
57664
|
-
const applyEvent =
|
|
57766
|
+
const flushDeltas = useCallback54(() => batcher.flush(), [batcher]);
|
|
57767
|
+
const applyEvent = useCallback54(
|
|
57665
57768
|
(event) => {
|
|
57666
57769
|
if (batcher.push(event, keyRef.current)) return;
|
|
57667
57770
|
batcher.flush();
|
|
@@ -57670,11 +57773,11 @@ function useChatStreamReducer({
|
|
|
57670
57773
|
[batcher, store, dialogId, side]
|
|
57671
57774
|
);
|
|
57672
57775
|
useEffect97(() => () => batcher.dispose(), [batcher]);
|
|
57673
|
-
const mutate =
|
|
57776
|
+
const mutate = useCallback54(
|
|
57674
57777
|
(fn) => store.mutate(dialogId, side, fn),
|
|
57675
57778
|
[store, dialogId, side]
|
|
57676
57779
|
);
|
|
57677
|
-
return
|
|
57780
|
+
return useMemo52(
|
|
57678
57781
|
() => ({ state, applyEvent, flushDeltas, mutate, reducer: reducer2 }),
|
|
57679
57782
|
[state, applyEvent, flushDeltas, mutate, reducer2]
|
|
57680
57783
|
);
|
|
@@ -57700,8 +57803,8 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57700
57803
|
const runtime = useRequiredChatRuntime();
|
|
57701
57804
|
const source = runtime.source || DEFAULT_CHAT_SOURCE;
|
|
57702
57805
|
const tableIdForDocumentType = options?.tableIdForDocumentType ?? defaultTableIdForDocumentType;
|
|
57703
|
-
const sendMessageRef =
|
|
57704
|
-
const cardResolve =
|
|
57806
|
+
const sendMessageRef = useRef80(async () => true);
|
|
57807
|
+
const cardResolve = useCallback55(
|
|
57705
57808
|
(action) => (reqId) => {
|
|
57706
57809
|
if (!reqId) return;
|
|
57707
57810
|
return sendMessageRef.current("", {
|
|
@@ -57711,26 +57814,26 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57711
57814
|
},
|
|
57712
57815
|
[]
|
|
57713
57816
|
);
|
|
57714
|
-
const cardApprove =
|
|
57715
|
-
const cardReject =
|
|
57716
|
-
const createReducerOptions =
|
|
57817
|
+
const cardApprove = useMemo53(() => cardResolve("approve"), [cardResolve]);
|
|
57818
|
+
const cardReject = useMemo53(() => cardResolve("reject"), [cardResolve]);
|
|
57819
|
+
const createReducerOptions = useCallback55(
|
|
57717
57820
|
() => ({
|
|
57718
57821
|
transport: "sse",
|
|
57719
57822
|
callbacks: { onApprove: cardApprove, onReject: cardReject }
|
|
57720
57823
|
}),
|
|
57721
57824
|
[cardApprove, cardReject]
|
|
57722
57825
|
);
|
|
57723
|
-
const storeRef =
|
|
57826
|
+
const storeRef = useRef80(null);
|
|
57724
57827
|
if (storeRef.current === null) storeRef.current = createChatDialogStore();
|
|
57725
57828
|
const { state, applyEvent, flushDeltas, mutate, reducer: reducer2 } = useChatStreamReducer({
|
|
57726
57829
|
store: storeRef.current,
|
|
57727
57830
|
dialogId: source,
|
|
57728
57831
|
createReducerOptions
|
|
57729
57832
|
});
|
|
57730
|
-
const abortControllerRef =
|
|
57731
|
-
const conversationStorage =
|
|
57732
|
-
const conversationIdRef =
|
|
57733
|
-
const restoredConversationRef =
|
|
57833
|
+
const abortControllerRef = useRef80(null);
|
|
57834
|
+
const conversationStorage = useMemo53(() => createChatConversationStorage(source), [source]);
|
|
57835
|
+
const conversationIdRef = useRef80(null);
|
|
57836
|
+
const restoredConversationRef = useRef80(false);
|
|
57734
57837
|
if (!restoredConversationRef.current) {
|
|
57735
57838
|
restoredConversationRef.current = true;
|
|
57736
57839
|
pruneStaleChatConversationStorage(source);
|
|
@@ -57740,7 +57843,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57740
57843
|
const { commands: slashCommands } = useSlashCommandRegistry(commandsUrl, {
|
|
57741
57844
|
enabled: active
|
|
57742
57845
|
});
|
|
57743
|
-
const cmdIdByTableId =
|
|
57846
|
+
const cmdIdByTableId = useMemo53(() => {
|
|
57744
57847
|
const buckets = /* @__PURE__ */ new Map();
|
|
57745
57848
|
for (const cmd of slashCommands) {
|
|
57746
57849
|
if (!cmd.primarySourceId) continue;
|
|
@@ -57761,8 +57864,8 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57761
57864
|
return map;
|
|
57762
57865
|
}, [slashCommands]);
|
|
57763
57866
|
const historyUrl = runtime.endpoints.chatHistoryUrl ?? `${runtime.endpoints.chatStreamUrl.replace(/\/+$/, "")}/history`;
|
|
57764
|
-
const hydrationSendCountRef =
|
|
57765
|
-
const hydrateMessages =
|
|
57867
|
+
const hydrationSendCountRef = useRef80(0);
|
|
57868
|
+
const hydrateMessages = useCallback55(
|
|
57766
57869
|
(history, sourcesSeed) => {
|
|
57767
57870
|
mutate((r) => {
|
|
57768
57871
|
const mapped = history.map(historyMessageToReducerMessage);
|
|
@@ -57794,9 +57897,9 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57794
57897
|
// `hydrateMessages` above) already invalidates the snapshot.
|
|
57795
57898
|
bumpMetaTick: noopBumpMetaTick
|
|
57796
57899
|
});
|
|
57797
|
-
const endpointsRef =
|
|
57900
|
+
const endpointsRef = useRef80(runtime.endpoints);
|
|
57798
57901
|
endpointsRef.current = runtime.endpoints;
|
|
57799
|
-
const captureConversationId =
|
|
57902
|
+
const captureConversationId = useCallback55(
|
|
57800
57903
|
(event) => {
|
|
57801
57904
|
if (event.type !== "metadata") return;
|
|
57802
57905
|
const id = event.conversationId;
|
|
@@ -57807,7 +57910,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57807
57910
|
},
|
|
57808
57911
|
[conversationStorage]
|
|
57809
57912
|
);
|
|
57810
|
-
const sendMessage =
|
|
57913
|
+
const sendMessage = useCallback55(
|
|
57811
57914
|
// Resolves `true` on a clean turn, `false` when the request failed
|
|
57812
57915
|
// (surfaced to batch approve-all loops via the card callbacks).
|
|
57813
57916
|
async (text, sendOptions) => {
|
|
@@ -57885,19 +57988,19 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57885
57988
|
[mutate, applyEvent, flushDeltas, captureConversationId]
|
|
57886
57989
|
);
|
|
57887
57990
|
sendMessageRef.current = sendMessage;
|
|
57888
|
-
const stopMessage =
|
|
57991
|
+
const stopMessage = useCallback55(() => {
|
|
57889
57992
|
abortControllerRef.current?.abort();
|
|
57890
57993
|
flushDeltas();
|
|
57891
57994
|
mutate((r) => r.setPhase("idle"));
|
|
57892
57995
|
}, [mutate, flushDeltas]);
|
|
57893
|
-
const clearMessages =
|
|
57996
|
+
const clearMessages = useCallback55(() => {
|
|
57894
57997
|
mutate((r) => r.reset());
|
|
57895
57998
|
conversationIdRef.current = null;
|
|
57896
57999
|
conversationStorage.clear();
|
|
57897
58000
|
hydrationSendCountRef.current = 0;
|
|
57898
58001
|
hydratedKeyRef.current = null;
|
|
57899
58002
|
}, [mutate, conversationStorage, hydratedKeyRef]);
|
|
57900
|
-
const docMessages =
|
|
58003
|
+
const docMessages = useMemo53(() => {
|
|
57901
58004
|
const { meta, sources: sourcesMap } = state.turnMeta;
|
|
57902
58005
|
let sendIdx = -1;
|
|
57903
58006
|
return state.messages.map((m) => {
|
|
@@ -57924,7 +58027,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57924
58027
|
};
|
|
57925
58028
|
});
|
|
57926
58029
|
}, [state.messages, state.turnMeta]);
|
|
57927
|
-
const displayRef =
|
|
58030
|
+
const displayRef = useCallback55(
|
|
57928
58031
|
(reference) => {
|
|
57929
58032
|
const tableId = tableIdForDocumentType(reference.type);
|
|
57930
58033
|
if (!tableId) {
|
|
@@ -57948,7 +58051,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57948
58051
|
},
|
|
57949
58052
|
[sendMessage, source, cmdIdByTableId, tableIdForDocumentType]
|
|
57950
58053
|
);
|
|
57951
|
-
const discussRef =
|
|
58054
|
+
const discussRef = useCallback55(
|
|
57952
58055
|
(reference) => {
|
|
57953
58056
|
const tableId = tableIdForDocumentType(reference.type);
|
|
57954
58057
|
if (!tableId) {
|
|
@@ -57971,7 +58074,7 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
57971
58074
|
},
|
|
57972
58075
|
[sendMessage, tableIdForDocumentType]
|
|
57973
58076
|
);
|
|
57974
|
-
const latestMeta =
|
|
58077
|
+
const latestMeta = useMemo53(() => {
|
|
57975
58078
|
const { meta, sendCount } = state.turnMeta;
|
|
57976
58079
|
return meta.get(sendCount - 1) ?? meta.get(sendCount - 2) ?? null;
|
|
57977
58080
|
}, [state]);
|
|
@@ -58050,7 +58153,7 @@ var noopBumpMetaTick = () => {
|
|
|
58050
58153
|
};
|
|
58051
58154
|
|
|
58052
58155
|
// src/components/chat/hooks/use-nats-chat-adapter.ts
|
|
58053
|
-
import { useCallback as
|
|
58156
|
+
import { useCallback as useCallback56, useEffect as useEffect98, useMemo as useMemo54, useRef as useRef81, useState as useState127 } from "react";
|
|
58054
58157
|
|
|
58055
58158
|
// src/chat-protocol/nats-decoder.ts
|
|
58056
58159
|
function normalizeToolCalls(raw) {
|
|
@@ -59077,24 +59180,24 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59077
59180
|
const isManagedMode = fetchDialogs !== void 0;
|
|
59078
59181
|
const [internalDialogId, setInternalDialogId] = useState127(null);
|
|
59079
59182
|
const dialogId = isManagedMode ? internalDialogId : controlledDialogId !== void 0 ? controlledDialogId : null;
|
|
59080
|
-
const currentDialogIdRef =
|
|
59183
|
+
const currentDialogIdRef = useRef81(dialogId);
|
|
59081
59184
|
currentDialogIdRef.current = dialogId;
|
|
59082
|
-
const handleApproveRef =
|
|
59185
|
+
const handleApproveRef = useRef81(async () => {
|
|
59083
59186
|
});
|
|
59084
|
-
const handleRejectRef =
|
|
59187
|
+
const handleRejectRef = useRef81(
|
|
59085
59188
|
async () => {
|
|
59086
59189
|
}
|
|
59087
59190
|
);
|
|
59088
|
-
const accumApprove =
|
|
59191
|
+
const accumApprove = useCallback56((requestId) => {
|
|
59089
59192
|
if (!requestId) return;
|
|
59090
59193
|
return handleApproveRef.current(requestId);
|
|
59091
59194
|
}, []);
|
|
59092
|
-
const accumReject =
|
|
59195
|
+
const accumReject = useCallback56((requestId) => {
|
|
59093
59196
|
if (!requestId) return;
|
|
59094
59197
|
return handleRejectRef.current(requestId);
|
|
59095
59198
|
}, []);
|
|
59096
|
-
const storeRef =
|
|
59097
|
-
const globalApprovalStatusesRef =
|
|
59199
|
+
const storeRef = useRef81(createChatDialogStore());
|
|
59200
|
+
const globalApprovalStatusesRef = useRef81({});
|
|
59098
59201
|
const dialogKey = dialogId ?? DRAFT_DIALOG_KEY;
|
|
59099
59202
|
const { state, applyEvent, mutate } = useChatStreamReducer({
|
|
59100
59203
|
store: storeRef.current,
|
|
@@ -59143,7 +59246,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59143
59246
|
console.error("[useNatsChatAdapter] rejectRequest failed:", err);
|
|
59144
59247
|
}
|
|
59145
59248
|
};
|
|
59146
|
-
const processChunk =
|
|
59249
|
+
const processChunk = useCallback56(
|
|
59147
59250
|
(chunk) => {
|
|
59148
59251
|
const event = decodeNatsChunk(chunk);
|
|
59149
59252
|
if (event) applyEvent(event);
|
|
@@ -59158,7 +59261,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59158
59261
|
const [messagesNextCursor, setMessagesNextCursor] = useState127(null);
|
|
59159
59262
|
const [isMessagesLoading, setIsMessagesLoading] = useState127(false);
|
|
59160
59263
|
const [connectionState, setConnectionState] = useState127("connecting");
|
|
59161
|
-
const hasConnectedOnceRef =
|
|
59264
|
+
const hasConnectedOnceRef = useRef81(false);
|
|
59162
59265
|
const {
|
|
59163
59266
|
processChunk: catchupProcessChunk,
|
|
59164
59267
|
catchUpChunks,
|
|
@@ -59171,8 +59274,8 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59171
59274
|
onChunkReceived: (chunk) => processChunk(chunk),
|
|
59172
59275
|
fetchChunks
|
|
59173
59276
|
});
|
|
59174
|
-
const historyLoadSeqRef =
|
|
59175
|
-
const loadDialogHistory =
|
|
59277
|
+
const historyLoadSeqRef = useRef81(0);
|
|
59278
|
+
const loadDialogHistory = useCallback56(
|
|
59176
59279
|
async (id, cursor) => {
|
|
59177
59280
|
if (!fetchDialogMessages) return;
|
|
59178
59281
|
historyLoadSeqRef.current += 1;
|
|
@@ -59234,7 +59337,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59234
59337
|
isBufferingActive
|
|
59235
59338
|
]
|
|
59236
59339
|
);
|
|
59237
|
-
const prevDialogIdRef =
|
|
59340
|
+
const prevDialogIdRef = useRef81(void 0);
|
|
59238
59341
|
useEffect98(() => {
|
|
59239
59342
|
if (prevDialogIdRef.current === dialogId) return;
|
|
59240
59343
|
prevDialogIdRef.current = dialogId;
|
|
@@ -59318,8 +59421,8 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59318
59421
|
}
|
|
59319
59422
|
setConnectionState("connecting");
|
|
59320
59423
|
}, [active, dialogId]);
|
|
59321
|
-
const initialDialogsLoadedRef =
|
|
59322
|
-
const loadDialogsPage =
|
|
59424
|
+
const initialDialogsLoadedRef = useRef81(false);
|
|
59425
|
+
const loadDialogsPage = useCallback56(
|
|
59323
59426
|
async (cursor) => {
|
|
59324
59427
|
if (!fetchDialogs) return;
|
|
59325
59428
|
setIsDialogsLoading(true);
|
|
@@ -59347,7 +59450,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59347
59450
|
},
|
|
59348
59451
|
[fetchDialogs, dialogsPageSize]
|
|
59349
59452
|
);
|
|
59350
|
-
const reloadDialogs =
|
|
59453
|
+
const reloadDialogs = useCallback56(() => {
|
|
59351
59454
|
void loadDialogsPage();
|
|
59352
59455
|
}, [loadDialogsPage]);
|
|
59353
59456
|
useEffect98(() => {
|
|
@@ -59357,7 +59460,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59357
59460
|
initialDialogsLoadedRef.current = true;
|
|
59358
59461
|
void loadDialogsPage();
|
|
59359
59462
|
}, [active, fetchDialogs, loadDialogsPage]);
|
|
59360
|
-
const sendMessage =
|
|
59463
|
+
const sendMessage = useCallback56(
|
|
59361
59464
|
async (text, sendOptions) => {
|
|
59362
59465
|
const hidden = sendOptions?.hidden ?? false;
|
|
59363
59466
|
mutate((r) => r.pushOptimisticSend(text, hidden));
|
|
@@ -59365,7 +59468,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59365
59468
|
},
|
|
59366
59469
|
[mutate, publishUserMessage, dialogId]
|
|
59367
59470
|
);
|
|
59368
|
-
const stopMessage =
|
|
59471
|
+
const stopMessage = useCallback56(() => {
|
|
59369
59472
|
mutate((r) => r.setPhase("idle"));
|
|
59370
59473
|
if (stopGenerationCallback && dialogId) {
|
|
59371
59474
|
void stopGenerationCallback(dialogId).catch((err) => {
|
|
@@ -59373,10 +59476,10 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59373
59476
|
});
|
|
59374
59477
|
}
|
|
59375
59478
|
}, [mutate, stopGenerationCallback, dialogId]);
|
|
59376
|
-
const clearMessages =
|
|
59479
|
+
const clearMessages = useCallback56(() => {
|
|
59377
59480
|
mutate((r) => r.clearThread());
|
|
59378
59481
|
}, [mutate]);
|
|
59379
|
-
const selectDialog =
|
|
59482
|
+
const selectDialog = useCallback56(
|
|
59380
59483
|
(id) => {
|
|
59381
59484
|
if (!isManagedMode) {
|
|
59382
59485
|
return;
|
|
@@ -59385,7 +59488,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59385
59488
|
},
|
|
59386
59489
|
[isManagedMode]
|
|
59387
59490
|
);
|
|
59388
|
-
const startNewDialog =
|
|
59491
|
+
const startNewDialog = useCallback56(async () => {
|
|
59389
59492
|
if (!createDialogCallback) return null;
|
|
59390
59493
|
if (isCreatingDialog) return null;
|
|
59391
59494
|
try {
|
|
@@ -59410,7 +59513,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59410
59513
|
setIsCreatingDialog(false);
|
|
59411
59514
|
}
|
|
59412
59515
|
}, [createDialogCallback, isCreatingDialog, isManagedMode]);
|
|
59413
|
-
const deleteDialog =
|
|
59516
|
+
const deleteDialog = useCallback56(
|
|
59414
59517
|
async (id) => {
|
|
59415
59518
|
if (!deleteDialogCallback) return;
|
|
59416
59519
|
try {
|
|
@@ -59426,7 +59529,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59426
59529
|
},
|
|
59427
59530
|
[deleteDialogCallback, internalDialogId, isManagedMode]
|
|
59428
59531
|
);
|
|
59429
|
-
const renameDialog =
|
|
59532
|
+
const renameDialog = useCallback56(
|
|
59430
59533
|
async (id, title) => {
|
|
59431
59534
|
if (!renameDialogCallback) return;
|
|
59432
59535
|
let previous;
|
|
@@ -59450,7 +59553,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59450
59553
|
},
|
|
59451
59554
|
[renameDialogCallback]
|
|
59452
59555
|
);
|
|
59453
|
-
const archiveDialog =
|
|
59556
|
+
const archiveDialog = useCallback56(
|
|
59454
59557
|
async (id) => {
|
|
59455
59558
|
if (!archiveDialogCallback) return;
|
|
59456
59559
|
try {
|
|
@@ -59465,27 +59568,27 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59465
59568
|
},
|
|
59466
59569
|
[archiveDialogCallback, internalDialogId, isManagedMode]
|
|
59467
59570
|
);
|
|
59468
|
-
const loadMoreDialogs =
|
|
59571
|
+
const loadMoreDialogs = useCallback56(async () => {
|
|
59469
59572
|
if (!dialogsNextCursor) return;
|
|
59470
59573
|
await loadDialogsPage(dialogsNextCursor);
|
|
59471
59574
|
}, [dialogsNextCursor, loadDialogsPage]);
|
|
59472
|
-
const loadMoreMessages =
|
|
59575
|
+
const loadMoreMessages = useCallback56(async () => {
|
|
59473
59576
|
if (!dialogId || !messagesNextCursor) return;
|
|
59474
59577
|
await loadDialogHistory(dialogId, messagesNextCursor);
|
|
59475
59578
|
}, [dialogId, messagesNextCursor, loadDialogHistory]);
|
|
59476
|
-
const approveRequest =
|
|
59579
|
+
const approveRequest = useCallback56(
|
|
59477
59580
|
async (requestId) => {
|
|
59478
59581
|
await handleApproveRef.current(requestId);
|
|
59479
59582
|
},
|
|
59480
59583
|
[]
|
|
59481
59584
|
);
|
|
59482
|
-
const rejectRequest =
|
|
59585
|
+
const rejectRequest = useCallback56(
|
|
59483
59586
|
async (requestId, reason) => {
|
|
59484
59587
|
await handleRejectRef.current(requestId, reason);
|
|
59485
59588
|
},
|
|
59486
59589
|
[]
|
|
59487
59590
|
);
|
|
59488
|
-
const discussRef =
|
|
59591
|
+
const discussRef = useCallback56(
|
|
59489
59592
|
(reference) => {
|
|
59490
59593
|
const prompt = buildDiscussPrompt(reference, { includeReference: true });
|
|
59491
59594
|
void sendMessage(prompt).catch((err) => {
|
|
@@ -59494,13 +59597,13 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59494
59597
|
},
|
|
59495
59598
|
[sendMessage]
|
|
59496
59599
|
);
|
|
59497
|
-
const displayRef =
|
|
59600
|
+
const displayRef = useCallback56((_ref) => {
|
|
59498
59601
|
}, []);
|
|
59499
59602
|
const { messages, streamingPhase, dialogTokenUsage = null, liveModel = null } = state;
|
|
59500
59603
|
const isLoading = streamingPhase !== "idle";
|
|
59501
59604
|
const hasMoreDialogs = dialogsNextCursor != null;
|
|
59502
59605
|
const hasMoreMessages = messagesNextCursor != null;
|
|
59503
|
-
return
|
|
59606
|
+
return useMemo54(
|
|
59504
59607
|
() => ({
|
|
59505
59608
|
messages,
|
|
59506
59609
|
isLoading,
|
|
@@ -59583,7 +59686,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
59583
59686
|
}
|
|
59584
59687
|
|
|
59585
59688
|
// src/components/chat/hooks/use-unified-chat.ts
|
|
59586
|
-
import { useCallback as
|
|
59689
|
+
import { useCallback as useCallback57, useMemo as useMemo55, useRef as useRef82 } from "react";
|
|
59587
59690
|
var EMPTY_SSE_OPTIONS = {};
|
|
59588
59691
|
function createDisabledNatsConfig() {
|
|
59589
59692
|
return {
|
|
@@ -59598,7 +59701,7 @@ function createDisabledNatsConfig() {
|
|
|
59598
59701
|
}
|
|
59599
59702
|
function useUnifiedChat(options) {
|
|
59600
59703
|
const { modes, activeMode, mingoStateOverride } = options;
|
|
59601
|
-
const disabledNatsRef =
|
|
59704
|
+
const disabledNatsRef = useRef82(null);
|
|
59602
59705
|
if (disabledNatsRef.current === null) {
|
|
59603
59706
|
disabledNatsRef.current = createDisabledNatsConfig();
|
|
59604
59707
|
}
|
|
@@ -59612,70 +59715,70 @@ function useUnifiedChat(options) {
|
|
|
59612
59715
|
{ active: natsActive }
|
|
59613
59716
|
);
|
|
59614
59717
|
const activeState = activeMode === "guide" ? sseState : mingoStateOverride ?? natsState;
|
|
59615
|
-
const activeStateRef =
|
|
59718
|
+
const activeStateRef = useRef82(activeState);
|
|
59616
59719
|
activeStateRef.current = activeState;
|
|
59617
|
-
const stopMessage =
|
|
59618
|
-
const clearMessages =
|
|
59720
|
+
const stopMessage = useCallback57(() => activeStateRef.current.stopMessage(), []);
|
|
59721
|
+
const clearMessages = useCallback57(
|
|
59619
59722
|
() => activeStateRef.current.clearMessages(),
|
|
59620
59723
|
[]
|
|
59621
59724
|
);
|
|
59622
|
-
const sendMessage =
|
|
59725
|
+
const sendMessage = useCallback57(
|
|
59623
59726
|
(text, opts) => activeStateRef.current.sendMessage(text, opts),
|
|
59624
59727
|
[]
|
|
59625
59728
|
);
|
|
59626
|
-
const discussRef =
|
|
59729
|
+
const discussRef = useCallback57(
|
|
59627
59730
|
(ref) => activeStateRef.current.discussRef(ref),
|
|
59628
59731
|
[]
|
|
59629
59732
|
);
|
|
59630
|
-
const displayRef =
|
|
59733
|
+
const displayRef = useCallback57(
|
|
59631
59734
|
(ref) => activeStateRef.current.displayRef(ref),
|
|
59632
59735
|
[]
|
|
59633
59736
|
);
|
|
59634
|
-
const selectDialog =
|
|
59737
|
+
const selectDialog = useCallback57(
|
|
59635
59738
|
(id) => activeStateRef.current.selectDialog(id),
|
|
59636
59739
|
[]
|
|
59637
59740
|
);
|
|
59638
|
-
const startNewDialog =
|
|
59741
|
+
const startNewDialog = useCallback57(
|
|
59639
59742
|
() => activeStateRef.current.startNewDialog(),
|
|
59640
59743
|
[]
|
|
59641
59744
|
);
|
|
59642
|
-
const deleteDialog =
|
|
59745
|
+
const deleteDialog = useCallback57(
|
|
59643
59746
|
(id) => activeStateRef.current.deleteDialog(id),
|
|
59644
59747
|
[]
|
|
59645
59748
|
);
|
|
59646
|
-
const renameDialog =
|
|
59749
|
+
const renameDialog = useCallback57(
|
|
59647
59750
|
(id, title) => activeStateRef.current.renameDialog(id, title),
|
|
59648
59751
|
[]
|
|
59649
59752
|
);
|
|
59650
|
-
const archiveDialog =
|
|
59753
|
+
const archiveDialog = useCallback57(
|
|
59651
59754
|
(id) => activeStateRef.current.archiveDialog(id),
|
|
59652
59755
|
[]
|
|
59653
59756
|
);
|
|
59654
|
-
const loadMoreDialogs =
|
|
59757
|
+
const loadMoreDialogs = useCallback57(
|
|
59655
59758
|
() => activeStateRef.current.loadMoreDialogs(),
|
|
59656
59759
|
[]
|
|
59657
59760
|
);
|
|
59658
|
-
const setDialogScope =
|
|
59761
|
+
const setDialogScope = useCallback57(
|
|
59659
59762
|
(scope) => activeStateRef.current.setDialogScope?.(scope),
|
|
59660
59763
|
[]
|
|
59661
59764
|
);
|
|
59662
|
-
const reloadDialogs =
|
|
59765
|
+
const reloadDialogs = useCallback57(
|
|
59663
59766
|
() => activeStateRef.current.reloadDialogs(),
|
|
59664
59767
|
[]
|
|
59665
59768
|
);
|
|
59666
|
-
const loadMoreMessages =
|
|
59769
|
+
const loadMoreMessages = useCallback57(
|
|
59667
59770
|
() => activeStateRef.current.loadMoreMessages(),
|
|
59668
59771
|
[]
|
|
59669
59772
|
);
|
|
59670
|
-
const approveRequest =
|
|
59773
|
+
const approveRequest = useCallback57(
|
|
59671
59774
|
(requestId) => activeStateRef.current.approveRequest(requestId),
|
|
59672
59775
|
[]
|
|
59673
59776
|
);
|
|
59674
|
-
const rejectRequest =
|
|
59777
|
+
const rejectRequest = useCallback57(
|
|
59675
59778
|
(requestId, reason) => activeStateRef.current.rejectRequest(requestId, reason),
|
|
59676
59779
|
[]
|
|
59677
59780
|
);
|
|
59678
|
-
return
|
|
59781
|
+
return useMemo55(
|
|
59679
59782
|
() => ({
|
|
59680
59783
|
messages: activeState.messages,
|
|
59681
59784
|
isLoading: activeState.isLoading,
|
|
@@ -60014,16 +60117,16 @@ function buildStreamFrames(messages) {
|
|
|
60014
60117
|
|
|
60015
60118
|
// src/components/chat/embeddable-chat.tsx
|
|
60016
60119
|
init_cn();
|
|
60017
|
-
import { useCallback as
|
|
60120
|
+
import { useCallback as useCallback59, useEffect as useEffect99, useMemo as useMemo57, useRef as useRef84, useState as useState129 } from "react";
|
|
60018
60121
|
import * as DialogPrimitive5 from "@radix-ui/react-dialog";
|
|
60019
60122
|
import { usePreventScroll as usePreventScroll5 } from "@react-aria/overlays";
|
|
60020
60123
|
import { isIOS } from "@react-aria/utils";
|
|
60021
60124
|
|
|
60022
60125
|
// node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
60023
|
-
import * as
|
|
60126
|
+
import * as React149 from "react";
|
|
60024
60127
|
|
|
60025
60128
|
// node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
60026
|
-
import * as
|
|
60129
|
+
import * as React148 from "react";
|
|
60027
60130
|
import * as ReactDOM2 from "react-dom";
|
|
60028
60131
|
import { createSlot } from "@radix-ui/react-slot";
|
|
60029
60132
|
import { jsx as jsx396 } from "react/jsx-runtime";
|
|
@@ -60050,7 +60153,7 @@ var NODES = [
|
|
|
60050
60153
|
];
|
|
60051
60154
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
60052
60155
|
const Slot2 = createSlot(`Primitive.${node}`);
|
|
60053
|
-
const Node2 =
|
|
60156
|
+
const Node2 = React148.forwardRef((props, forwardedRef) => {
|
|
60054
60157
|
const { asChild, ...primitiveProps } = props;
|
|
60055
60158
|
const Comp = asChild ? Slot2 : node;
|
|
60056
60159
|
if (typeof window !== "undefined") {
|
|
@@ -60083,7 +60186,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
60083
60186
|
whiteSpace: "nowrap",
|
|
60084
60187
|
wordWrap: "normal"
|
|
60085
60188
|
});
|
|
60086
|
-
var VisuallyHidden = /* @__PURE__ */
|
|
60189
|
+
var VisuallyHidden = /* @__PURE__ */ React149.forwardRef(
|
|
60087
60190
|
/* @__PURE__ */ __name4(function VisuallyHidden2(props, forwardedRef) {
|
|
60088
60191
|
return /* @__PURE__ */ jsx397(
|
|
60089
60192
|
Primitive.span,
|
|
@@ -60101,7 +60204,7 @@ init_button2();
|
|
|
60101
60204
|
import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
|
|
60102
60205
|
|
|
60103
60206
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
60104
|
-
import { useCallback as
|
|
60207
|
+
import { useCallback as useCallback58, useMemo as useMemo56, useRef as useRef83, useState as useState128 } from "react";
|
|
60105
60208
|
function useChatDialogManager({
|
|
60106
60209
|
dialogs,
|
|
60107
60210
|
activeDialogId,
|
|
@@ -60114,14 +60217,14 @@ function useChatDialogManager({
|
|
|
60114
60217
|
}) {
|
|
60115
60218
|
const [renameTarget, setRenameTarget] = useState128(null);
|
|
60116
60219
|
const [archiveTarget, setArchiveTarget] = useState128(null);
|
|
60117
|
-
const handleConfirmRename =
|
|
60220
|
+
const handleConfirmRename = useCallback58(
|
|
60118
60221
|
(name) => {
|
|
60119
60222
|
if (renameTarget) void renameDialog(renameTarget.id, name);
|
|
60120
60223
|
setRenameTarget(null);
|
|
60121
60224
|
},
|
|
60122
60225
|
[renameTarget, renameDialog]
|
|
60123
60226
|
);
|
|
60124
|
-
const handleConfirmArchive =
|
|
60227
|
+
const handleConfirmArchive = useCallback58(async () => {
|
|
60125
60228
|
if (archiveTarget) {
|
|
60126
60229
|
try {
|
|
60127
60230
|
await archiveDialog(archiveTarget.id);
|
|
@@ -60141,8 +60244,8 @@ function useChatDialogManager({
|
|
|
60141
60244
|
const [archivedCursor, setArchivedCursor] = useState128(null);
|
|
60142
60245
|
const [archivedLoading, setArchivedLoading] = useState128(false);
|
|
60143
60246
|
const [archivedPending, setArchivedPending] = useState128(false);
|
|
60144
|
-
const archivedRequestIdRef =
|
|
60145
|
-
const loadArchivedPage =
|
|
60247
|
+
const archivedRequestIdRef = useRef83(0);
|
|
60248
|
+
const loadArchivedPage = useCallback58(
|
|
60146
60249
|
async (cursor) => {
|
|
60147
60250
|
if (!fetchArchivedDialogs) return;
|
|
60148
60251
|
const requestId = ++archivedRequestIdRef.current;
|
|
@@ -60177,16 +60280,16 @@ function useChatDialogManager({
|
|
|
60177
60280
|
},
|
|
60178
60281
|
[fetchArchivedDialogs]
|
|
60179
60282
|
);
|
|
60180
|
-
const openArchive =
|
|
60283
|
+
const openArchive = useCallback58(() => {
|
|
60181
60284
|
setArchiveOpen(true);
|
|
60182
60285
|
void loadArchivedPage();
|
|
60183
60286
|
}, [loadArchivedPage]);
|
|
60184
|
-
const closeArchive =
|
|
60287
|
+
const closeArchive = useCallback58(() => setArchiveOpen(false), []);
|
|
60185
60288
|
const [viewingArchivedId, setViewingArchivedId] = useState128(
|
|
60186
60289
|
null
|
|
60187
60290
|
);
|
|
60188
60291
|
const [openingDialogId, setOpeningDialogId] = useState128(null);
|
|
60189
|
-
const handleSelectDialog =
|
|
60292
|
+
const handleSelectDialog = useCallback58(
|
|
60190
60293
|
(id) => {
|
|
60191
60294
|
setViewingArchivedId(null);
|
|
60192
60295
|
setOpeningDialogId(id);
|
|
@@ -60195,7 +60298,7 @@ function useChatDialogManager({
|
|
|
60195
60298
|
[selectDialog]
|
|
60196
60299
|
);
|
|
60197
60300
|
const isOpeningDialog = openingDialogId != null && openingDialogId === activeDialogId;
|
|
60198
|
-
const handleArchivedSelect =
|
|
60301
|
+
const handleArchivedSelect = useCallback58(
|
|
60199
60302
|
(id) => {
|
|
60200
60303
|
setArchiveOpen(false);
|
|
60201
60304
|
setOpeningDialogId(null);
|
|
@@ -60205,7 +60308,7 @@ function useChatDialogManager({
|
|
|
60205
60308
|
[selectDialog]
|
|
60206
60309
|
);
|
|
60207
60310
|
const [restoreTarget, setRestoreTarget] = useState128(null);
|
|
60208
|
-
const handleConfirmRestore =
|
|
60311
|
+
const handleConfirmRestore = useCallback58(async () => {
|
|
60209
60312
|
if (restoreTarget) {
|
|
60210
60313
|
try {
|
|
60211
60314
|
await unarchiveDialog?.(restoreTarget.id);
|
|
@@ -60219,7 +60322,7 @@ function useChatDialogManager({
|
|
|
60219
60322
|
setRestoreTarget(null);
|
|
60220
60323
|
}, [restoreTarget, unarchiveDialog]);
|
|
60221
60324
|
const isViewingArchived = viewingArchivedId != null && viewingArchivedId === activeDialogId;
|
|
60222
|
-
const handleBack =
|
|
60325
|
+
const handleBack = useCallback58(() => {
|
|
60223
60326
|
const wasArchived = isViewingArchived;
|
|
60224
60327
|
setViewingArchivedId(null);
|
|
60225
60328
|
setOpeningDialogId(null);
|
|
@@ -60227,14 +60330,14 @@ function useChatDialogManager({
|
|
|
60227
60330
|
clearMessages();
|
|
60228
60331
|
if (wasArchived) setArchiveOpen(true);
|
|
60229
60332
|
}, [isViewingArchived, selectDialog, clearMessages]);
|
|
60230
|
-
const resetToNewChat =
|
|
60333
|
+
const resetToNewChat = useCallback58(() => {
|
|
60231
60334
|
setViewingArchivedId(null);
|
|
60232
60335
|
setOpeningDialogId(null);
|
|
60233
60336
|
selectDialog(null);
|
|
60234
60337
|
clearMessages();
|
|
60235
60338
|
setArchiveOpen(false);
|
|
60236
60339
|
}, [selectDialog, clearMessages]);
|
|
60237
|
-
const activeDialog =
|
|
60340
|
+
const activeDialog = useMemo56(
|
|
60238
60341
|
() => dialogs.find((d) => d.id === activeDialogId) ?? archivedDialogs.find((d) => d.id === activeDialogId),
|
|
60239
60342
|
[dialogs, archivedDialogs, activeDialogId]
|
|
60240
60343
|
);
|
|
@@ -60647,7 +60750,7 @@ function EmbeddableChatInner({
|
|
|
60647
60750
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
60648
60751
|
});
|
|
60649
60752
|
usePreventScroll5({ isDisabled: !isOpen || shellLess });
|
|
60650
|
-
const navigatingAwayRef =
|
|
60753
|
+
const navigatingAwayRef = useRef84(false);
|
|
60651
60754
|
useEffect99(() => {
|
|
60652
60755
|
if (!isOpen) return;
|
|
60653
60756
|
if (shellLess) return;
|
|
@@ -60674,9 +60777,9 @@ function EmbeddableChatInner({
|
|
|
60674
60777
|
window.scrollTo(0, scrollY);
|
|
60675
60778
|
};
|
|
60676
60779
|
}, [isOpen, shellLess]);
|
|
60677
|
-
const chatInputRef =
|
|
60780
|
+
const chatInputRef = useRef84(null);
|
|
60678
60781
|
const [quickActionPreview, setQuickActionPreview] = useState129(null);
|
|
60679
|
-
const slashCommandsProp =
|
|
60782
|
+
const slashCommandsProp = useMemo57(
|
|
60680
60783
|
() => ({
|
|
60681
60784
|
fetchCommands: (prefix, signal) => fetchSlashCommands(prefix, signal, commandsUrl),
|
|
60682
60785
|
resolveSourceIcon: (sourceId) => {
|
|
@@ -60691,12 +60794,12 @@ function EmbeddableChatInner({
|
|
|
60691
60794
|
[commandsUrl]
|
|
60692
60795
|
);
|
|
60693
60796
|
const headerUserName = identityUser?.name?.trim() || [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || userDisplayName?.trim() || void 0;
|
|
60694
|
-
const effectiveModes =
|
|
60797
|
+
const effectiveModes = useMemo57(() => {
|
|
60695
60798
|
if (modes) return modes;
|
|
60696
60799
|
const guideOptions = tableIdForDocumentType ? { tableIdForDocumentType } : {};
|
|
60697
60800
|
return { guide: guideOptions };
|
|
60698
60801
|
}, [modes, tableIdForDocumentType]);
|
|
60699
|
-
const mingoCaps =
|
|
60802
|
+
const mingoCaps = useMemo57(() => {
|
|
60700
60803
|
if (mingoState) {
|
|
60701
60804
|
return {
|
|
60702
60805
|
canRename: mingoDialogCapabilities?.canRename ?? false,
|
|
@@ -60720,7 +60823,7 @@ function EmbeddableChatInner({
|
|
|
60720
60823
|
const initialActiveMode = controlledActiveMode ?? defaultActiveMode ?? (effectiveModes.guide ? "guide" : "mingo");
|
|
60721
60824
|
const [uncontrolledActiveMode, setUncontrolledActiveMode] = useState129(initialActiveMode);
|
|
60722
60825
|
const activeMode = controlledActiveMode ?? uncontrolledActiveMode;
|
|
60723
|
-
const handleActiveModeChange =
|
|
60826
|
+
const handleActiveModeChange = useCallback59(
|
|
60724
60827
|
(next) => {
|
|
60725
60828
|
if (controlledActiveMode === void 0) {
|
|
60726
60829
|
setUncontrolledActiveMode(next);
|
|
@@ -60730,7 +60833,7 @@ function EmbeddableChatInner({
|
|
|
60730
60833
|
[controlledActiveMode, onActiveModeChange]
|
|
60731
60834
|
);
|
|
60732
60835
|
const { commands: commandsList, loaded: commandsLoaded } = useSlashCommandRegistry(commandsUrl, { enabled: activeMode === "guide" });
|
|
60733
|
-
const commandsById =
|
|
60836
|
+
const commandsById = useMemo57(() => {
|
|
60734
60837
|
const map = /* @__PURE__ */ new Map();
|
|
60735
60838
|
for (const cmd of commandsList) map.set(cmd.id, cmd);
|
|
60736
60839
|
return map;
|
|
@@ -60780,7 +60883,7 @@ function EmbeddableChatInner({
|
|
|
60780
60883
|
hasMoreMessages,
|
|
60781
60884
|
loadMoreMessages
|
|
60782
60885
|
} = useUnifiedChat({ modes: effectiveModes, activeMode, mingoStateOverride: mingoState });
|
|
60783
|
-
const guidePromptSentRef =
|
|
60886
|
+
const guidePromptSentRef = useRef84(false);
|
|
60784
60887
|
useEffect99(() => {
|
|
60785
60888
|
if (!guidePendingPrompt) {
|
|
60786
60889
|
guidePromptSentRef.current = false;
|
|
@@ -60805,28 +60908,28 @@ function EmbeddableChatInner({
|
|
|
60805
60908
|
const [contextItems, setContextItems] = useState129([]);
|
|
60806
60909
|
const [contextPickerOpen, setContextPickerOpen] = useState129(false);
|
|
60807
60910
|
const [mentionQuery, setMentionQuery] = useState129(null);
|
|
60808
|
-
const mentionActiveRef =
|
|
60911
|
+
const mentionActiveRef = useRef84(false);
|
|
60809
60912
|
useEffect99(() => {
|
|
60810
60913
|
mentionActiveRef.current = mentionQuery !== null;
|
|
60811
60914
|
}, [mentionQuery]);
|
|
60812
|
-
const mentionKeysRef =
|
|
60915
|
+
const mentionKeysRef = useRef84(/* @__PURE__ */ new Set());
|
|
60813
60916
|
useEffect99(() => {
|
|
60814
60917
|
setContextItems([]);
|
|
60815
60918
|
setMentionQuery(null);
|
|
60816
60919
|
mentionKeysRef.current.clear();
|
|
60817
60920
|
}, [activeDialogId, activeMode]);
|
|
60818
|
-
const mentionMarkerByType =
|
|
60921
|
+
const mentionMarkerByType = useMemo57(() => {
|
|
60819
60922
|
const m = /* @__PURE__ */ new Map();
|
|
60820
60923
|
for (const t of contextPicker?.entityTypes ?? []) if (t.marker) m.set(t.type, t.marker);
|
|
60821
60924
|
return m;
|
|
60822
60925
|
}, [contextPicker?.entityTypes]);
|
|
60823
60926
|
const contextEntityTypes = contextPicker?.entityTypes;
|
|
60824
|
-
const resolveContextIcon =
|
|
60927
|
+
const resolveContextIcon = useMemo57(() => {
|
|
60825
60928
|
const byType = /* @__PURE__ */ new Map();
|
|
60826
60929
|
for (const t of contextEntityTypes ?? []) byType.set(t.type, t.icon);
|
|
60827
60930
|
return (item) => byType.get(item.type);
|
|
60828
60931
|
}, [contextEntityTypes]);
|
|
60829
|
-
const toggleContextItem =
|
|
60932
|
+
const toggleContextItem = useCallback59(
|
|
60830
60933
|
(item) => {
|
|
60831
60934
|
const key = `${item.type}:${item.id}`;
|
|
60832
60935
|
if (mentionActiveRef.current) {
|
|
@@ -60849,7 +60952,7 @@ function EmbeddableChatInner({
|
|
|
60849
60952
|
},
|
|
60850
60953
|
[contextMaxItems, contextItems, mentionMarkerByType, resolveContextIcon]
|
|
60851
60954
|
);
|
|
60852
|
-
const removeContextItem =
|
|
60955
|
+
const removeContextItem = useCallback59((item) => {
|
|
60853
60956
|
const key = `${item.type}:${item.id}`;
|
|
60854
60957
|
setContextItems((prev) => prev.filter((p) => `${p.type}:${p.id}` !== key));
|
|
60855
60958
|
if (mentionKeysRef.current.has(key)) {
|
|
@@ -60859,7 +60962,7 @@ function EmbeddableChatInner({
|
|
|
60859
60962
|
chatInputRef.current?.setValue(next);
|
|
60860
60963
|
}
|
|
60861
60964
|
}, [mentionMarkerByType]);
|
|
60862
|
-
const handleContextValueChange =
|
|
60965
|
+
const handleContextValueChange = useCallback59((value) => {
|
|
60863
60966
|
for (const key of Array.from(mentionKeysRef.current)) {
|
|
60864
60967
|
if (!value.includes(`@${mentionTokenOf(key, mentionMarkerByType)}`)) {
|
|
60865
60968
|
mentionKeysRef.current.delete(key);
|
|
@@ -60867,32 +60970,32 @@ function EmbeddableChatInner({
|
|
|
60867
60970
|
}
|
|
60868
60971
|
}
|
|
60869
60972
|
}, [mentionMarkerByType]);
|
|
60870
|
-
const openContextPicker =
|
|
60973
|
+
const openContextPicker = useCallback59(() => {
|
|
60871
60974
|
setMentionQuery(null);
|
|
60872
60975
|
setContextPickerOpen(true);
|
|
60873
60976
|
}, []);
|
|
60874
|
-
const closeContextPicker =
|
|
60977
|
+
const closeContextPicker = useCallback59(() => {
|
|
60875
60978
|
if (mentionActiveRef.current) {
|
|
60876
60979
|
chatInputRef.current?.removeMentionTrigger();
|
|
60877
60980
|
}
|
|
60878
60981
|
setContextPickerOpen(false);
|
|
60879
60982
|
setMentionQuery(null);
|
|
60880
60983
|
}, []);
|
|
60881
|
-
const handleMentionQueryChange =
|
|
60984
|
+
const handleMentionQueryChange = useCallback59((query) => {
|
|
60882
60985
|
setMentionQuery(query);
|
|
60883
60986
|
setContextPickerOpen(query !== null);
|
|
60884
60987
|
}, []);
|
|
60885
60988
|
const resolvedBaseRoute = baseRoute || (source === "flamingo" ? "/knowledge-base" : "/data-room");
|
|
60886
|
-
const handleClose =
|
|
60887
|
-
const handleNavigationClose =
|
|
60989
|
+
const handleClose = useCallback59(() => setIsOpen(false), [setIsOpen]);
|
|
60990
|
+
const handleNavigationClose = useCallback59(() => {
|
|
60888
60991
|
navigatingAwayRef.current = true;
|
|
60889
60992
|
setIsOpen(false);
|
|
60890
60993
|
}, [setIsOpen]);
|
|
60891
|
-
const chatPanelHandle =
|
|
60994
|
+
const chatPanelHandle = useMemo57(
|
|
60892
60995
|
() => ({ closeChat: handleNavigationClose }),
|
|
60893
60996
|
[handleNavigationClose]
|
|
60894
60997
|
);
|
|
60895
|
-
const renderEntityCard =
|
|
60998
|
+
const renderEntityCard = useCallback59(
|
|
60896
60999
|
(reference) => renderChatInlineEntityCard(reference, {
|
|
60897
61000
|
onDiscuss: discussRef,
|
|
60898
61001
|
onDisplay: displayRef,
|
|
@@ -60902,14 +61005,14 @@ function EmbeddableChatInner({
|
|
|
60902
61005
|
}),
|
|
60903
61006
|
[discussRef, displayRef, resolvedBaseRoute, chipBasePlatform, extras]
|
|
60904
61007
|
);
|
|
60905
|
-
const mingoAssistantIcon =
|
|
61008
|
+
const mingoAssistantIcon = useMemo57(
|
|
60906
61009
|
() => effectiveAssistantIcon ? /* @__PURE__ */ jsx398(EntityIcon, { icon: effectiveAssistantIcon, size: 24 }) : /* @__PURE__ */ jsx398(MingoIcon, { className: "h-6 w-6", cornerColor: "var(--ods-flamingo-cyan-base)" }),
|
|
60907
61010
|
[effectiveAssistantIcon]
|
|
60908
61011
|
);
|
|
60909
|
-
const timestampCacheRef =
|
|
61012
|
+
const timestampCacheRef = useRef84(/* @__PURE__ */ new Map());
|
|
60910
61013
|
const guideUserName = activeMode === "guide" ? [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || identityUser?.name?.trim() || void 0 : void 0;
|
|
60911
61014
|
const guideUserAvatar = activeMode === "guide" ? identityUser?.avatarUrl?.trim() || void 0 : void 0;
|
|
60912
|
-
const messages =
|
|
61015
|
+
const messages = useMemo57(() => {
|
|
60913
61016
|
const cache = timestampCacheRef.current;
|
|
60914
61017
|
const seenIds = /* @__PURE__ */ new Set();
|
|
60915
61018
|
const mapped = rawMessages.map((m) => {
|
|
@@ -60954,7 +61057,7 @@ function EmbeddableChatInner({
|
|
|
60954
61057
|
}
|
|
60955
61058
|
return mapped;
|
|
60956
61059
|
}, [rawMessages, guideUserName, guideUserAvatar]);
|
|
60957
|
-
const handleSend =
|
|
61060
|
+
const handleSend = useCallback59(
|
|
60958
61061
|
(text) => {
|
|
60959
61062
|
let augmentedText = text;
|
|
60960
61063
|
if (readyAttachments.length > 0) {
|
|
@@ -60974,13 +61077,13 @@ function EmbeddableChatInner({
|
|
|
60974
61077
|
},
|
|
60975
61078
|
[sendMessage, readyAttachments, viewUrlPrefix, clearAttachments, contextItems]
|
|
60976
61079
|
);
|
|
60977
|
-
const handleAskSelect =
|
|
61080
|
+
const handleAskSelect = useCallback59(
|
|
60978
61081
|
(label) => {
|
|
60979
61082
|
sendMessage(label);
|
|
60980
61083
|
},
|
|
60981
61084
|
[sendMessage]
|
|
60982
61085
|
);
|
|
60983
|
-
const guideSuggestedActions =
|
|
61086
|
+
const guideSuggestedActions = useMemo57(
|
|
60984
61087
|
() => {
|
|
60985
61088
|
if (effectiveQuickActions.length > 0) {
|
|
60986
61089
|
return effectiveQuickActions.map((qa) => ({
|
|
@@ -61042,7 +61145,7 @@ function EmbeddableChatInner({
|
|
|
61042
61145
|
fetchArchivedDialogs: mingoCaps.fetchArchivedDialogs,
|
|
61043
61146
|
unarchiveDialog: mingoCaps.unarchiveDialog
|
|
61044
61147
|
});
|
|
61045
|
-
const handleOpen =
|
|
61148
|
+
const handleOpen = useCallback59(() => setIsOpen(true), [setIsOpen]);
|
|
61046
61149
|
useCloseOnNavigation(handleNavigationClose, null);
|
|
61047
61150
|
useEffect99(() => {
|
|
61048
61151
|
const handler = (e) => {
|
|
@@ -61076,11 +61179,11 @@ function EmbeddableChatInner({
|
|
|
61076
61179
|
}, [isQuickActionEmpty]);
|
|
61077
61180
|
const guideCanReturnToMingo = isGuideEmpty && hasMingoMode;
|
|
61078
61181
|
const sourceLabel = source === "flamingo" ? "Knowledge Base" : "Data Room";
|
|
61079
|
-
const enabledSet =
|
|
61182
|
+
const enabledSet = useMemo57(
|
|
61080
61183
|
() => effectiveEnabledRagTableIds ? new Set(effectiveEnabledRagTableIds) : null,
|
|
61081
61184
|
[effectiveEnabledRagTableIds]
|
|
61082
61185
|
);
|
|
61083
|
-
const chipCommands =
|
|
61186
|
+
const chipCommands = useMemo57(() => {
|
|
61084
61187
|
const out = [];
|
|
61085
61188
|
for (const cmd of commandsById.values()) {
|
|
61086
61189
|
if (cmd.displayOrder === void 0) continue;
|
|
@@ -61097,7 +61200,7 @@ function EmbeddableChatInner({
|
|
|
61097
61200
|
return out;
|
|
61098
61201
|
}, [commandsById, enabledSet]);
|
|
61099
61202
|
const lastAssistantMsg = [...rawMessages].reverse().find((m) => m.role === "assistant");
|
|
61100
|
-
const lastSources =
|
|
61203
|
+
const lastSources = useMemo57(() => {
|
|
61101
61204
|
if (chatLoading) return void 0;
|
|
61102
61205
|
const sources = lastAssistantMsg?.sources;
|
|
61103
61206
|
if (!sources || sources.length === 0) return void 0;
|
|
@@ -61116,7 +61219,7 @@ function EmbeddableChatInner({
|
|
|
61116
61219
|
const [portalHost, setPortalHost] = useState129(null);
|
|
61117
61220
|
const [panelBoundary, setPanelBoundary] = useState129(null);
|
|
61118
61221
|
const [panelWidth, setPanelWidth] = useState129(0);
|
|
61119
|
-
const panelMeasureRef =
|
|
61222
|
+
const panelMeasureRef = useRef84(null);
|
|
61120
61223
|
useEffect99(() => {
|
|
61121
61224
|
const el = panelMeasureRef.current;
|
|
61122
61225
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -61128,7 +61231,7 @@ function EmbeddableChatInner({
|
|
|
61128
61231
|
setPanelWidth(el.clientWidth);
|
|
61129
61232
|
return () => ro.disconnect();
|
|
61130
61233
|
}, []);
|
|
61131
|
-
const setPanelNode =
|
|
61234
|
+
const setPanelNode = useCallback59((node) => {
|
|
61132
61235
|
panelMeasureRef.current = node;
|
|
61133
61236
|
setPanelBoundary(node);
|
|
61134
61237
|
}, []);
|
|
@@ -61140,7 +61243,7 @@ function EmbeddableChatInner({
|
|
|
61140
61243
|
} catch {
|
|
61141
61244
|
}
|
|
61142
61245
|
}, []);
|
|
61143
|
-
const toggleRailCollapsed =
|
|
61246
|
+
const toggleRailCollapsed = useCallback59(() => {
|
|
61144
61247
|
setRailCollapsed((prev) => {
|
|
61145
61248
|
const next = !prev;
|
|
61146
61249
|
try {
|
|
@@ -61175,7 +61278,7 @@ function EmbeddableChatInner({
|
|
|
61175
61278
|
const headerPersonName = headerOwner?.name?.trim() || headerUserName;
|
|
61176
61279
|
const headerPersonAvatarUrl = headerOwner ? headerOwner.avatarUrl?.trim() || void 0 : identityUser?.avatarUrl?.trim() || userAvatarUrl?.trim() || void 0;
|
|
61177
61280
|
const headerAvatar = headerPersonName || headerPersonAvatarUrl ? { name: headerPersonName, avatarUrl: headerPersonAvatarUrl } : void 0;
|
|
61178
|
-
const handleNewChat =
|
|
61281
|
+
const handleNewChat = useCallback59(() => {
|
|
61179
61282
|
resetToNewChat();
|
|
61180
61283
|
}, [resetToNewChat]);
|
|
61181
61284
|
const splitHeaderMenuItems = [
|
|
@@ -62822,4 +62925,4 @@ export {
|
|
|
62822
62925
|
LogsList,
|
|
62823
62926
|
assets
|
|
62824
62927
|
};
|
|
62825
|
-
//# sourceMappingURL=chunk-
|
|
62928
|
+
//# sourceMappingURL=chunk-3RPRI46G.js.map
|