@flamingo-stack/openframe-frontend-core 0.0.445 → 0.0.446
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-MPSA6YAM.cjs → chunk-3AFV2YIC.cjs} +37 -37
- package/dist/{chunk-MPSA6YAM.cjs.map → chunk-3AFV2YIC.cjs.map} +1 -1
- package/dist/{chunk-RXLMN6B5.cjs → chunk-5WX2V6CY.cjs} +9 -9
- package/dist/{chunk-RXLMN6B5.cjs.map → chunk-5WX2V6CY.cjs.map} +1 -1
- package/dist/{chunk-H352AZJN.js → chunk-5YQSRQHP.js} +4 -4
- package/dist/{chunk-5FUQTSTT.cjs → chunk-6XZNIPXP.cjs} +11 -11
- package/dist/{chunk-5FUQTSTT.cjs.map → chunk-6XZNIPXP.cjs.map} +1 -1
- package/dist/{chunk-R6WGCJBB.cjs → chunk-7IC2QCOL.cjs} +59 -59
- package/dist/{chunk-R6WGCJBB.cjs.map → chunk-7IC2QCOL.cjs.map} +1 -1
- package/dist/{chunk-QL2EI56X.cjs → chunk-BAUWT7PV.cjs} +486 -505
- package/dist/chunk-BAUWT7PV.cjs.map +1 -0
- package/dist/{chunk-XPZLIONZ.js → chunk-BNYI2FVM.js} +2 -2
- package/dist/{chunk-DTLNCOSG.cjs → chunk-DH3DUY6Q.cjs} +26 -26
- package/dist/{chunk-DTLNCOSG.cjs.map → chunk-DH3DUY6Q.cjs.map} +1 -1
- package/dist/{chunk-3DQ5BFPM.js → chunk-GTHA2SYB.js} +4 -4
- package/dist/{chunk-7R256DKK.js → chunk-I7IOEXRJ.js} +2 -2
- package/dist/{chunk-H2DYCT6M.js → chunk-K6JIBV3X.js} +2 -2
- package/dist/{chunk-5DWPXK37.cjs → chunk-L276GOMD.cjs} +31 -31
- package/dist/{chunk-5DWPXK37.cjs.map → chunk-L276GOMD.cjs.map} +1 -1
- package/dist/{chunk-3BHV2QAH.js → chunk-MAB4TQCO.js} +187 -206
- package/dist/{chunk-3BHV2QAH.js.map → chunk-MAB4TQCO.js.map} +1 -1
- package/dist/{chunk-MQUS6BFR.js → chunk-MR7BMJHI.js} +4 -4
- package/dist/{chunk-YCLSV2H6.cjs → chunk-MS5CEBBQ.cjs} +5 -5
- package/dist/{chunk-YCLSV2H6.cjs.map → chunk-MS5CEBBQ.cjs.map} +1 -1
- package/dist/{chunk-3HYSD7NR.cjs → chunk-N3Y6JYH5.cjs} +15 -15
- package/dist/{chunk-3HYSD7NR.cjs.map → chunk-N3Y6JYH5.cjs.map} +1 -1
- package/dist/{chunk-K4RASNQM.js → chunk-N4CCB33C.js} +2 -2
- package/dist/{chunk-KISQUH33.cjs → chunk-NQLY27GH.cjs} +62 -62
- package/dist/{chunk-KISQUH33.cjs.map → chunk-NQLY27GH.cjs.map} +1 -1
- package/dist/{chunk-N64VTHZ5.cjs → chunk-SA7AHDS6.cjs} +7 -7
- package/dist/{chunk-N64VTHZ5.cjs.map → chunk-SA7AHDS6.cjs.map} +1 -1
- package/dist/{chunk-TCEBFMLQ.js → chunk-SAV4U37G.js} +2 -2
- package/dist/{chunk-FIAXFNAA.js → chunk-SCKAD2MY.js} +4 -4
- package/dist/{chunk-Z4N7XLFG.js → chunk-XB6D7B3I.js} +2 -2
- package/dist/{chunk-22NSWMI6.js → chunk-YLMD4UFA.js} +2 -2
- package/dist/{chunk-P3FN4NAE.cjs → chunk-ZKYEMGMD.cjs} +26 -26
- package/dist/{chunk-P3FN4NAE.cjs.map → chunk-ZKYEMGMD.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/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/features/policy-configuration-panel.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +20 -20
- package/dist/components/help-center-pages/index.js +11 -11
- package/dist/components/index.cjs +129 -129
- package/dist/components/index.js +9 -9
- 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 +5 -5
- package/dist/components/tickets/index.js +4 -4
- 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/components/features/policy-configuration-panel.tsx +34 -49
- package/src/stories/PolicyConfigurationPanel.stories.tsx +8 -6
- package/dist/chunk-QL2EI56X.cjs.map +0 -1
- /package/dist/{chunk-H352AZJN.js.map → chunk-5YQSRQHP.js.map} +0 -0
- /package/dist/{chunk-XPZLIONZ.js.map → chunk-BNYI2FVM.js.map} +0 -0
- /package/dist/{chunk-3DQ5BFPM.js.map → chunk-GTHA2SYB.js.map} +0 -0
- /package/dist/{chunk-7R256DKK.js.map → chunk-I7IOEXRJ.js.map} +0 -0
- /package/dist/{chunk-H2DYCT6M.js.map → chunk-K6JIBV3X.js.map} +0 -0
- /package/dist/{chunk-MQUS6BFR.js.map → chunk-MR7BMJHI.js.map} +0 -0
- /package/dist/{chunk-K4RASNQM.js.map → chunk-N4CCB33C.js.map} +0 -0
- /package/dist/{chunk-TCEBFMLQ.js.map → chunk-SAV4U37G.js.map} +0 -0
- /package/dist/{chunk-FIAXFNAA.js.map → chunk-SCKAD2MY.js.map} +0 -0
- /package/dist/{chunk-Z4N7XLFG.js.map → chunk-XB6D7B3I.js.map} +0 -0
- /package/dist/{chunk-22NSWMI6.js.map → chunk-YLMD4UFA.js.map} +0 -0
|
@@ -31939,23 +31939,22 @@ function ViewToggle({
|
|
|
31939
31939
|
|
|
31940
31940
|
// src/components/features/policy-configuration-panel.tsx
|
|
31941
31941
|
init_cn();
|
|
31942
|
-
import {
|
|
31942
|
+
import { useEffect as useEffect52, useState as useState71 } from "react";
|
|
31943
31943
|
import { ChevronDown as ChevronDown8, Shield as Shield2 } from "lucide-react";
|
|
31944
31944
|
init_button2();
|
|
31945
31945
|
import { Fragment as Fragment43, jsx as jsx253, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
31946
|
-
var
|
|
31947
|
-
|
|
31948
|
-
|
|
31949
|
-
|
|
31950
|
-
|
|
31951
|
-
];
|
|
31952
|
-
var getApprovalLevelLabel = (level, editMode = false) => {
|
|
31953
|
-
if (!level) {
|
|
31954
|
-
return editMode ? "Set Global Permission" : "";
|
|
31955
|
-
}
|
|
31956
|
-
const option = approvalLevelOptions.find((opt) => opt.value === level);
|
|
31957
|
-
return option?.label || level;
|
|
31946
|
+
var approvalLevelLabels = {
|
|
31947
|
+
ALLOW: "Allow",
|
|
31948
|
+
ASK_USER: "Ask User",
|
|
31949
|
+
ASK_TECHNICIAN: "Ask Technician",
|
|
31950
|
+
DENY: "Restrict"
|
|
31958
31951
|
};
|
|
31952
|
+
var approvalLevelOptions = Object.keys(approvalLevelLabels).map(
|
|
31953
|
+
(value) => ({ value, label: approvalLevelLabels[value] })
|
|
31954
|
+
);
|
|
31955
|
+
var POLICY_LEVEL_WIDTH = "w-[180px]";
|
|
31956
|
+
var CATEGORY_LEVEL_WIDTH = "w-[256px]";
|
|
31957
|
+
var getApprovalLevelLabel = (level) => approvalLevelLabels[level] ?? level;
|
|
31959
31958
|
var ApprovalLevelDropdown = ({ value, onChange, allowClear = false, triggerClassName, contentClassName }) => /* @__PURE__ */ jsxs197(DropdownMenu, { children: [
|
|
31960
31959
|
/* @__PURE__ */ jsx253(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx253(
|
|
31961
31960
|
Button,
|
|
@@ -31967,7 +31966,7 @@ var ApprovalLevelDropdown = ({ value, onChange, allowClear = false, triggerClass
|
|
|
31967
31966
|
value ? "text-ods-text-primary" : "text-ods-text-secondary",
|
|
31968
31967
|
triggerClassName
|
|
31969
31968
|
),
|
|
31970
|
-
children: getApprovalLevelLabel(value
|
|
31969
|
+
children: value ? getApprovalLevelLabel(value) : "Set Global Permission"
|
|
31971
31970
|
}
|
|
31972
31971
|
) }),
|
|
31973
31972
|
/* @__PURE__ */ jsxs197(DropdownMenuContent, { align: "end", className: contentClassName, children: [
|
|
@@ -31998,7 +31997,7 @@ var PolicyRow = ({ policy, categoryId, editMode, onPermissionChange }) => {
|
|
|
31998
31997
|
value: policy.approvalLevel,
|
|
31999
31998
|
onChange: handleChange,
|
|
32000
31999
|
triggerClassName: "w-full",
|
|
32001
|
-
contentClassName:
|
|
32000
|
+
contentClassName: POLICY_LEVEL_WIDTH
|
|
32002
32001
|
}
|
|
32003
32002
|
) }) : policy.approvalLevel ? /* @__PURE__ */ jsx253("span", { className: "md:hidden text-h4 text-ods-text-primary", children: getApprovalLevelLabel(policy.approvalLevel) }) : null
|
|
32004
32003
|
] }),
|
|
@@ -32007,23 +32006,12 @@ var PolicyRow = ({ policy, categoryId, editMode, onPermissionChange }) => {
|
|
|
32007
32006
|
{
|
|
32008
32007
|
value: policy.approvalLevel,
|
|
32009
32008
|
onChange: handleChange,
|
|
32010
|
-
triggerClassName:
|
|
32011
|
-
contentClassName:
|
|
32009
|
+
triggerClassName: POLICY_LEVEL_WIDTH,
|
|
32010
|
+
contentClassName: POLICY_LEVEL_WIDTH
|
|
32012
32011
|
}
|
|
32013
|
-
) : /* @__PURE__ */ jsx253("div", { className: "px-[var(--spacing-system-sf)] py-[var(--spacing-system-xsf)]
|
|
32012
|
+
) : /* @__PURE__ */ jsx253("div", { className: cn("px-[var(--spacing-system-sf)] py-[var(--spacing-system-xsf)]", POLICY_LEVEL_WIDTH), children: policy.approvalLevel && /* @__PURE__ */ jsx253("span", { className: "text-h4 text-ods-text-primary", children: getApprovalLevelLabel(policy.approvalLevel) }) }) })
|
|
32014
32013
|
] });
|
|
32015
32014
|
};
|
|
32016
|
-
var useAnimatedHeight = (isExpanded) => {
|
|
32017
|
-
const [height, setHeight] = useState71(0);
|
|
32018
|
-
const contentRef = useRef37(null);
|
|
32019
|
-
useEffect52(() => {
|
|
32020
|
-
if (contentRef.current) {
|
|
32021
|
-
const contentHeight = contentRef.current.scrollHeight;
|
|
32022
|
-
setHeight(isExpanded ? contentHeight : 0);
|
|
32023
|
-
}
|
|
32024
|
-
}, [isExpanded]);
|
|
32025
|
-
return { contentRef, height };
|
|
32026
|
-
};
|
|
32027
32015
|
var CategorySection = ({
|
|
32028
32016
|
category,
|
|
32029
32017
|
editMode,
|
|
@@ -32033,7 +32021,7 @@ var CategorySection = ({
|
|
|
32033
32021
|
onBulkLevelChange,
|
|
32034
32022
|
onPolicyPermissionChange
|
|
32035
32023
|
}) => {
|
|
32036
|
-
const {
|
|
32024
|
+
const { innerRef, containerStyle } = useCollapsible({ expanded: isExpanded, durationMs: 300 });
|
|
32037
32025
|
const handleBulkChange = (level) => onBulkLevelChange(category.id, level);
|
|
32038
32026
|
return /* @__PURE__ */ jsxs197(Fragment43, { children: [
|
|
32039
32027
|
/* @__PURE__ */ jsxs197(
|
|
@@ -32056,7 +32044,7 @@ var CategorySection = ({
|
|
|
32056
32044
|
onChange: handleBulkChange,
|
|
32057
32045
|
allowClear: true,
|
|
32058
32046
|
triggerClassName: "w-full",
|
|
32059
|
-
contentClassName:
|
|
32047
|
+
contentClassName: CATEGORY_LEVEL_WIDTH
|
|
32060
32048
|
}
|
|
32061
32049
|
) })
|
|
32062
32050
|
] }),
|
|
@@ -32066,16 +32054,10 @@ var CategorySection = ({
|
|
|
32066
32054
|
value: bulkLevel,
|
|
32067
32055
|
onChange: handleBulkChange,
|
|
32068
32056
|
allowClear: true,
|
|
32069
|
-
triggerClassName:
|
|
32070
|
-
contentClassName:
|
|
32057
|
+
triggerClassName: CATEGORY_LEVEL_WIDTH,
|
|
32058
|
+
contentClassName: CATEGORY_LEVEL_WIDTH
|
|
32071
32059
|
}
|
|
32072
|
-
) }) : /* @__PURE__ */ jsx253(
|
|
32073
|
-
"div",
|
|
32074
|
-
{
|
|
32075
|
-
className: "hidden md:block px-[var(--spacing-system-sf)] py-[var(--spacing-system-xsf)] w-[256px] shrink-0",
|
|
32076
|
-
onClick: (e) => e.stopPropagation()
|
|
32077
|
-
}
|
|
32078
|
-
),
|
|
32060
|
+
) }) : /* @__PURE__ */ jsx253("div", { className: cn("hidden md:block px-[var(--spacing-system-sf)] py-[var(--spacing-system-xsf)] shrink-0", CATEGORY_LEVEL_WIDTH) }),
|
|
32079
32061
|
/* @__PURE__ */ jsx253(
|
|
32080
32062
|
Button,
|
|
32081
32063
|
{
|
|
@@ -32104,16 +32086,15 @@ var CategorySection = ({
|
|
|
32104
32086
|
/* @__PURE__ */ jsx253(
|
|
32105
32087
|
"div",
|
|
32106
32088
|
{
|
|
32107
|
-
ref: contentRef,
|
|
32108
32089
|
style: {
|
|
32109
|
-
|
|
32110
|
-
transition:
|
|
32090
|
+
...containerStyle,
|
|
32091
|
+
transition: `${containerStyle.transition}, opacity 300ms ease-in-out, visibility 300ms`,
|
|
32092
|
+
// visibility drops collapsed content from the tab order and a11y
|
|
32093
|
+
// tree; its discrete transition delays hiding until the fade ends.
|
|
32094
|
+
visibility: isExpanded ? "visible" : "hidden"
|
|
32111
32095
|
},
|
|
32112
|
-
className:
|
|
32113
|
-
|
|
32114
|
-
isExpanded ? "opacity-100" : "opacity-0"
|
|
32115
|
-
),
|
|
32116
|
-
children: /* @__PURE__ */ jsx253("div", { className: "px-[var(--spacing-system-mf)] pb-[var(--spacing-system-mf)] pt-0", children: /* @__PURE__ */ jsx253("div", { className: "border border-ods-border rounded-md overflow-hidden", children: category.policies.map((policy) => /* @__PURE__ */ jsx253(
|
|
32096
|
+
className: isExpanded ? "opacity-100" : "opacity-0",
|
|
32097
|
+
children: /* @__PURE__ */ jsx253("div", { ref: innerRef, className: "px-[var(--spacing-system-mf)] pb-[var(--spacing-system-mf)] pt-0", children: /* @__PURE__ */ jsx253("div", { className: "border border-ods-border rounded-md overflow-hidden", children: category.policies.map((policy) => /* @__PURE__ */ jsx253(
|
|
32117
32098
|
PolicyRow,
|
|
32118
32099
|
{
|
|
32119
32100
|
policy,
|
|
@@ -32176,7 +32157,7 @@ PolicyConfigurationPanel.displayName = "PolicyConfigurationPanel";
|
|
|
32176
32157
|
init_button2();
|
|
32177
32158
|
|
|
32178
32159
|
// src/components/ui/phone-input.tsx
|
|
32179
|
-
import { useCallback as useCallback28, useEffect as useEffect53, useMemo as useMemo27, useRef as
|
|
32160
|
+
import { useCallback as useCallback28, useEffect as useEffect53, useMemo as useMemo27, useRef as useRef37, useState as useState72 } from "react";
|
|
32180
32161
|
import { jsx as jsx254, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
32181
32162
|
function PhoneInput({
|
|
32182
32163
|
value,
|
|
@@ -32194,7 +32175,7 @@ function PhoneInput({
|
|
|
32194
32175
|
[countryCode, priority, others]
|
|
32195
32176
|
);
|
|
32196
32177
|
const [isInvalid, setIsInvalid] = useState72(false);
|
|
32197
|
-
const debounceRef =
|
|
32178
|
+
const debounceRef = useRef37(null);
|
|
32198
32179
|
const digitCount = useCallback28((val) => val.replace(/[^0-9]/g, "").length, []);
|
|
32199
32180
|
const runValidation = useCallback28((phone) => {
|
|
32200
32181
|
if (!phone || digitCount(phone) === 0) {
|
|
@@ -32700,7 +32681,7 @@ function useOptionalNotifications() {
|
|
|
32700
32681
|
}
|
|
32701
32682
|
|
|
32702
32683
|
// src/components/features/notifications/notification-drawer.tsx
|
|
32703
|
-
import { useEffect as useEffect58, useRef as
|
|
32684
|
+
import { useEffect as useEffect58, useRef as useRef40 } from "react";
|
|
32704
32685
|
|
|
32705
32686
|
// src/components/navigation/app-layout-context.ts
|
|
32706
32687
|
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
@@ -33468,9 +33449,9 @@ function DrawerScrollList({
|
|
|
33468
33449
|
loadMoreRootMargin,
|
|
33469
33450
|
renderTile
|
|
33470
33451
|
}) {
|
|
33471
|
-
const scrollRef =
|
|
33472
|
-
const sentinelRef =
|
|
33473
|
-
const loadMoreRef =
|
|
33452
|
+
const scrollRef = useRef40(null);
|
|
33453
|
+
const sentinelRef = useRef40(null);
|
|
33454
|
+
const loadMoreRef = useRef40(loadMore);
|
|
33474
33455
|
loadMoreRef.current = loadMore;
|
|
33475
33456
|
useEffect58(() => {
|
|
33476
33457
|
if (!loadMore || !hasMore || isLoadingMore) return;
|
|
@@ -34339,7 +34320,7 @@ function LastEntryRow({ entry, onClick }) {
|
|
|
34339
34320
|
// src/components/features/time-tracker/time-tracker-header-button.tsx
|
|
34340
34321
|
init_cn();
|
|
34341
34322
|
import * as PopoverPrimitive5 from "@radix-ui/react-popover";
|
|
34342
|
-
import { useEffect as useEffect61, useRef as
|
|
34323
|
+
import { useEffect as useEffect61, useRef as useRef41 } from "react";
|
|
34343
34324
|
|
|
34344
34325
|
// src/components/navigation/header-button.tsx
|
|
34345
34326
|
init_cn();
|
|
@@ -34378,11 +34359,11 @@ function TimeTrackerHeaderButton({ className, disabled }) {
|
|
|
34378
34359
|
const layoutContainer = useAppLayoutDrawerContainer();
|
|
34379
34360
|
const coordination = useAppLayoutDrawerCoordination();
|
|
34380
34361
|
const isOpen = ctx?.isOpen ?? false;
|
|
34381
|
-
const isOpenRef =
|
|
34362
|
+
const isOpenRef = useRef41(isOpen);
|
|
34382
34363
|
isOpenRef.current = isOpen;
|
|
34383
|
-
const closeRef =
|
|
34364
|
+
const closeRef = useRef41(ctx?.close);
|
|
34384
34365
|
closeRef.current = ctx?.close;
|
|
34385
|
-
const selfHandleRef =
|
|
34366
|
+
const selfHandleRef = useRef41(null);
|
|
34386
34367
|
if (!selfHandleRef.current) {
|
|
34387
34368
|
selfHandleRef.current = {
|
|
34388
34369
|
close: () => {
|
|
@@ -35407,18 +35388,18 @@ function SortableRow({
|
|
|
35407
35388
|
|
|
35408
35389
|
// src/components/navigation/header.tsx
|
|
35409
35390
|
init_next_link();
|
|
35410
|
-
import React108, { useEffect as useEffect64, useRef as
|
|
35391
|
+
import React108, { useEffect as useEffect64, useRef as useRef45, useState as useState84 } from "react";
|
|
35411
35392
|
init_button2();
|
|
35412
35393
|
|
|
35413
35394
|
// src/components/navigation/mobile-nav-panel.tsx
|
|
35414
|
-
import { useRef as
|
|
35395
|
+
import { useRef as useRef44 } from "react";
|
|
35415
35396
|
import { usePreventScroll as usePreventScroll3 } from "@react-aria/overlays";
|
|
35416
35397
|
init_button2();
|
|
35417
35398
|
import { X as X10 } from "lucide-react";
|
|
35418
35399
|
import { Fragment as Fragment51, jsx as jsx273, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
35419
35400
|
var MOBILE_NAV_PANEL_ID = "mobile-nav-panel";
|
|
35420
35401
|
function MobileNavPanel({ isOpen, config }) {
|
|
35421
|
-
const panelRef =
|
|
35402
|
+
const panelRef = useRef44(null);
|
|
35422
35403
|
usePreventScroll3({ isDisabled: !isOpen });
|
|
35423
35404
|
useFocusTrap(panelRef, isOpen, { onEscape: config.onClose });
|
|
35424
35405
|
const headerHeight = useHeaderHeight(64, { enabled: isOpen });
|
|
@@ -35579,8 +35560,8 @@ function Header2({ config, platform }) {
|
|
|
35579
35560
|
const [show, setShow] = useState84(true);
|
|
35580
35561
|
const [lastScrollY, setLastScrollY] = useState84(0);
|
|
35581
35562
|
const [openDropdowns, setOpenDropdowns] = useState84({});
|
|
35582
|
-
const dropdownRefs =
|
|
35583
|
-
const triggerRefs =
|
|
35563
|
+
const dropdownRefs = useRef45({});
|
|
35564
|
+
const triggerRefs = useRef45({});
|
|
35584
35565
|
useEffect64(() => {
|
|
35585
35566
|
const handleClickOutside = (event) => {
|
|
35586
35567
|
const target = event.target;
|
|
@@ -35906,7 +35887,7 @@ function ClientOnlyHeader({ config, skeleton }) {
|
|
|
35906
35887
|
}
|
|
35907
35888
|
|
|
35908
35889
|
// src/components/navigation/sliding-sidebar.tsx
|
|
35909
|
-
import { useState as useState86, useEffect as useEffect66, useRef as
|
|
35890
|
+
import { useState as useState86, useEffect as useEffect66, useRef as useRef46 } from "react";
|
|
35910
35891
|
import { motion as motion2, AnimatePresence, useReducedMotion } from "framer-motion";
|
|
35911
35892
|
import { usePreventScroll as usePreventScroll4 } from "@react-aria/overlays";
|
|
35912
35893
|
init_button2();
|
|
@@ -35915,7 +35896,7 @@ function SlidingSidebar({ config }) {
|
|
|
35915
35896
|
const [expandedItems, setExpandedItems] = useState86(/* @__PURE__ */ new Set());
|
|
35916
35897
|
const [mounted, setMounted] = useState86(false);
|
|
35917
35898
|
const headerHeight = useHeaderHeight();
|
|
35918
|
-
const asideRef =
|
|
35899
|
+
const asideRef = useRef46(null);
|
|
35919
35900
|
const prefersReducedMotion2 = useReducedMotion();
|
|
35920
35901
|
usePreventScroll4({ isDisabled: !config.isOpen });
|
|
35921
35902
|
useFocusTrap(asideRef, config.isOpen, { onEscape: config.onClose, contain: false });
|
|
@@ -36087,7 +36068,7 @@ function SlidingSidebar({ config }) {
|
|
|
36087
36068
|
}
|
|
36088
36069
|
|
|
36089
36070
|
// src/components/navigation/sticky-section-nav.tsx
|
|
36090
|
-
import { useEffect as useEffect67, useState as useState87, useCallback as useCallback35, useRef as
|
|
36071
|
+
import { useEffect as useEffect67, useState as useState87, useCallback as useCallback35, useRef as useRef47 } from "react";
|
|
36091
36072
|
import { jsx as jsx279, jsxs as jsxs217 } from "react/jsx-runtime";
|
|
36092
36073
|
function StickySectionNav({
|
|
36093
36074
|
sections,
|
|
@@ -36149,7 +36130,7 @@ function StickySectionNav({
|
|
|
36149
36130
|
}
|
|
36150
36131
|
function useSectionNavigation(sections, options) {
|
|
36151
36132
|
const [activeSection, setActiveSection] = useState87(sections[0]?.id || "");
|
|
36152
|
-
const isScrollingFromClick =
|
|
36133
|
+
const isScrollingFromClick = useRef47(false);
|
|
36153
36134
|
const { offset: offset2 = 100 } = options || {};
|
|
36154
36135
|
const handleSectionClick = useCallback35((sectionId) => {
|
|
36155
36136
|
const targetElement = document.getElementById(sectionId);
|
|
@@ -36849,10 +36830,10 @@ function NotificationsHeaderButton({
|
|
|
36849
36830
|
}
|
|
36850
36831
|
|
|
36851
36832
|
// src/components/navigation/app-layout.tsx
|
|
36852
|
-
import { Suspense as Suspense2, useCallback as useCallback38, useMemo as useMemo35, useRef as
|
|
36833
|
+
import { Suspense as Suspense2, useCallback as useCallback38, useMemo as useMemo35, useRef as useRef49, useState as useState89 } from "react";
|
|
36853
36834
|
|
|
36854
36835
|
// src/components/navigation/mobile-burger-menu.tsx
|
|
36855
|
-
import React113, { useCallback as useCallback37, useRef as
|
|
36836
|
+
import React113, { useCallback as useCallback37, useRef as useRef48 } from "react";
|
|
36856
36837
|
import { usePreventScroll as usePreventScroll5 } from "@react-aria/overlays";
|
|
36857
36838
|
import { Fragment as Fragment55, jsx as jsx288, jsxs as jsxs226 } from "react/jsx-runtime";
|
|
36858
36839
|
var HEADER_HEIGHT = 48;
|
|
@@ -36866,7 +36847,7 @@ var MobileBurgerMenu = React113.memo(function MobileBurgerMenu2({
|
|
|
36866
36847
|
onLogout,
|
|
36867
36848
|
disabled = false
|
|
36868
36849
|
}) {
|
|
36869
|
-
const panelRef =
|
|
36850
|
+
const panelRef = useRef48(null);
|
|
36870
36851
|
usePreventScroll5({ isDisabled: !isOpen });
|
|
36871
36852
|
useFocusTrap(panelRef, isOpen, { onEscape: onClose });
|
|
36872
36853
|
const handleItemClick = useCallback37((item) => {
|
|
@@ -37051,9 +37032,9 @@ function AppLayout({
|
|
|
37051
37032
|
}) {
|
|
37052
37033
|
const [mobileMenuOpen, setMobileMenuOpen] = useState89(false);
|
|
37053
37034
|
const [drawerContainer, setDrawerContainer] = useState89(null);
|
|
37054
|
-
const mobileMenuOpenRef =
|
|
37035
|
+
const mobileMenuOpenRef = useRef49(mobileMenuOpen);
|
|
37055
37036
|
mobileMenuOpenRef.current = mobileMenuOpen;
|
|
37056
|
-
const drawerHandlesRef =
|
|
37037
|
+
const drawerHandlesRef = useRef49(/* @__PURE__ */ new Set());
|
|
37057
37038
|
const handleToggleMobileMenu = useCallback38(() => {
|
|
37058
37039
|
const opening = !mobileMenuOpenRef.current;
|
|
37059
37040
|
if (opening) {
|
|
@@ -37680,7 +37661,7 @@ ScriptArguments.displayName = "ScriptArguments";
|
|
|
37680
37661
|
|
|
37681
37662
|
// src/components/shared/onboarding/onboarding-walkthrough.tsx
|
|
37682
37663
|
init_button2();
|
|
37683
|
-
import React115, { useRef as
|
|
37664
|
+
import React115, { useRef as useRef50, useCallback as useCallback39 } from "react";
|
|
37684
37665
|
|
|
37685
37666
|
// src/components/shared/onboarding/onboarding-step-card.tsx
|
|
37686
37667
|
import React114 from "react";
|
|
@@ -37804,10 +37785,10 @@ function OnboardingWalkthrough({
|
|
|
37804
37785
|
allStepsComplete,
|
|
37805
37786
|
markMultipleComplete
|
|
37806
37787
|
} = useOnboardingState(storageKey);
|
|
37807
|
-
const hasAutoMarkedRef =
|
|
37808
|
-
const autoMarkingInProgressRef =
|
|
37809
|
-
const lastCompletionStatusRef =
|
|
37810
|
-
const actionInProgressRef =
|
|
37788
|
+
const hasAutoMarkedRef = useRef50(false);
|
|
37789
|
+
const autoMarkingInProgressRef = useRef50(false);
|
|
37790
|
+
const lastCompletionStatusRef = useRef50(null);
|
|
37791
|
+
const actionInProgressRef = useRef50(/* @__PURE__ */ new Set());
|
|
37811
37792
|
React115.useEffect(() => {
|
|
37812
37793
|
if (isLoadingCompletion) {
|
|
37813
37794
|
hasAutoMarkedRef.current = false;
|
|
@@ -38495,7 +38476,7 @@ var ListLoader = (props) => /* @__PURE__ */ jsx307(ContentLoader, { ...props, va
|
|
|
38495
38476
|
|
|
38496
38477
|
// src/components/ui/table/table.tsx
|
|
38497
38478
|
init_cn();
|
|
38498
|
-
import { useEffect as useEffect70, useRef as
|
|
38479
|
+
import { useEffect as useEffect70, useRef as useRef52 } from "react";
|
|
38499
38480
|
init_pagination();
|
|
38500
38481
|
init_button2();
|
|
38501
38482
|
|
|
@@ -39255,8 +39236,8 @@ function Table({
|
|
|
39255
39236
|
};
|
|
39256
39237
|
const allSelected = selectedRows.length > 0 && selectedRows.length === data.length;
|
|
39257
39238
|
const someSelected = selectedRows.length > 0 && selectedRows.length < data.length;
|
|
39258
|
-
const sentinelRef =
|
|
39259
|
-
const onLoadMoreRef =
|
|
39239
|
+
const sentinelRef = useRef52(null);
|
|
39240
|
+
const onLoadMoreRef = useRef52(infiniteScroll?.onLoadMore);
|
|
39260
39241
|
onLoadMoreRef.current = infiniteScroll?.onLoadMore;
|
|
39261
39242
|
useEffect70(() => {
|
|
39262
39243
|
if (!infiniteScroll?.hasNextPage || infiniteScroll.isFetchingNextPage) return;
|
|
@@ -39476,7 +39457,7 @@ import { useMemo as useMemo37 } from "react";
|
|
|
39476
39457
|
|
|
39477
39458
|
// src/components/ui/query-report-table/query-report-table-header.tsx
|
|
39478
39459
|
init_cn();
|
|
39479
|
-
import { useRef as
|
|
39460
|
+
import { useRef as useRef53, useState as useState92, useCallback as useCallback40 } from "react";
|
|
39480
39461
|
import { jsx as jsx319, jsxs as jsxs252 } from "react/jsx-runtime";
|
|
39481
39462
|
function QueryReportTableHeader({
|
|
39482
39463
|
columns,
|
|
@@ -39505,7 +39486,7 @@ function QueryReportTableHeader({
|
|
|
39505
39486
|
);
|
|
39506
39487
|
}
|
|
39507
39488
|
function TruncatedHeaderCell({ value, width }) {
|
|
39508
|
-
const textRef =
|
|
39489
|
+
const textRef = useRef53(null);
|
|
39509
39490
|
const [isTruncated, setIsTruncated] = useState92(false);
|
|
39510
39491
|
const checkTruncation = useCallback40(() => {
|
|
39511
39492
|
const el = textRef.current;
|
|
@@ -39535,7 +39516,7 @@ function TruncatedHeaderCell({ value, width }) {
|
|
|
39535
39516
|
|
|
39536
39517
|
// src/components/ui/query-report-table/query-report-table-row.tsx
|
|
39537
39518
|
init_cn();
|
|
39538
|
-
import { useRef as
|
|
39519
|
+
import { useRef as useRef54, useState as useState93, useCallback as useCallback41 } from "react";
|
|
39539
39520
|
import { jsx as jsx320, jsxs as jsxs253 } from "react/jsx-runtime";
|
|
39540
39521
|
function QueryReportTableRow({
|
|
39541
39522
|
row,
|
|
@@ -39581,7 +39562,7 @@ function QueryReportTableRow({
|
|
|
39581
39562
|
);
|
|
39582
39563
|
}
|
|
39583
39564
|
function TruncatedCell({ value, className }) {
|
|
39584
|
-
const textRef =
|
|
39565
|
+
const textRef = useRef54(null);
|
|
39585
39566
|
const [isTruncated, setIsTruncated] = useState93(false);
|
|
39586
39567
|
const checkTruncation = useCallback41(() => {
|
|
39587
39568
|
const el = textRef.current;
|
|
@@ -40083,7 +40064,7 @@ function DataTableEmpty({ className, ...props }) {
|
|
|
40083
40064
|
// src/components/ui/data-table/data-table-row.tsx
|
|
40084
40065
|
init_next_link();
|
|
40085
40066
|
init_cn();
|
|
40086
|
-
import { memo as memo5, useCallback as useCallback43, useRef as
|
|
40067
|
+
import { memo as memo5, useCallback as useCallback43, useRef as useRef55 } from "react";
|
|
40087
40068
|
import { flexRender as flexRender2 } from "@tanstack/react-table";
|
|
40088
40069
|
|
|
40089
40070
|
// src/components/ui/data-table/data-table-skeleton.tsx
|
|
@@ -40168,7 +40149,7 @@ function DataTableRowImpl({
|
|
|
40168
40149
|
const hasSubRow = subRow != null && subRow !== false;
|
|
40169
40150
|
const isLinkMode = Boolean(href) && !onClick;
|
|
40170
40151
|
const isWholeCardLink = isLinkMode && !hasSubRow;
|
|
40171
|
-
const containerRef =
|
|
40152
|
+
const containerRef = useRef55(null);
|
|
40172
40153
|
const handleClick = useCallback43(
|
|
40173
40154
|
(e) => {
|
|
40174
40155
|
const target = e.target;
|
|
@@ -40336,7 +40317,7 @@ function DataTableBody({
|
|
|
40336
40317
|
}
|
|
40337
40318
|
|
|
40338
40319
|
// src/components/ui/data-table/data-table-infinite-footer.tsx
|
|
40339
|
-
import { useEffect as useEffect71, useRef as
|
|
40320
|
+
import { useEffect as useEffect71, useRef as useRef56 } from "react";
|
|
40340
40321
|
import { Fragment as Fragment63, jsx as jsx330, jsxs as jsxs261 } from "react/jsx-runtime";
|
|
40341
40322
|
function DataTableInfiniteFooter({
|
|
40342
40323
|
hasNextPage,
|
|
@@ -40345,8 +40326,8 @@ function DataTableInfiniteFooter({
|
|
|
40345
40326
|
skeletonRows = 3,
|
|
40346
40327
|
rootMargin = "200px"
|
|
40347
40328
|
}) {
|
|
40348
|
-
const sentinelRef =
|
|
40349
|
-
const onLoadMoreRef =
|
|
40329
|
+
const sentinelRef = useRef56(null);
|
|
40330
|
+
const onLoadMoreRef = useRef56(onLoadMore);
|
|
40350
40331
|
onLoadMoreRef.current = onLoadMore;
|
|
40351
40332
|
useEffect71(() => {
|
|
40352
40333
|
if (!hasNextPage || isFetchingNextPage) return;
|
|
@@ -40983,7 +40964,7 @@ function FilterList({
|
|
|
40983
40964
|
// src/components/ui/tag-search-input.tsx
|
|
40984
40965
|
import {
|
|
40985
40966
|
useEffect as useEffect73,
|
|
40986
|
-
useRef as
|
|
40967
|
+
useRef as useRef58,
|
|
40987
40968
|
useState as useState95
|
|
40988
40969
|
} from "react";
|
|
40989
40970
|
init_cn();
|
|
@@ -41018,9 +40999,9 @@ function TagSearchInput({
|
|
|
41018
40999
|
limitTags,
|
|
41019
41000
|
placeholder: currentPlaceholder
|
|
41020
41001
|
});
|
|
41021
|
-
const wrapperRef =
|
|
41022
|
-
const hiddenTagsRef =
|
|
41023
|
-
const hiddenTagsPopupRef =
|
|
41002
|
+
const wrapperRef = useRef58(null);
|
|
41003
|
+
const hiddenTagsRef = useRef58(null);
|
|
41004
|
+
const hiddenTagsPopupRef = useRef58(null);
|
|
41024
41005
|
const [showHiddenTags, setShowHiddenTags] = useState95(false);
|
|
41025
41006
|
useEffect73(() => {
|
|
41026
41007
|
if (!showHiddenTags) return;
|
|
@@ -41177,7 +41158,7 @@ function TagSearchInput({
|
|
|
41177
41158
|
}
|
|
41178
41159
|
|
|
41179
41160
|
// src/components/ui/markdown-editor.tsx
|
|
41180
|
-
import { useRef as
|
|
41161
|
+
import { useRef as useRef59, useCallback as useCallback44, useState as useState96, useEffect as useEffect74 } from "react";
|
|
41181
41162
|
init_cn();
|
|
41182
41163
|
import { Loader2 as Loader29, Upload as Upload8 } from "lucide-react";
|
|
41183
41164
|
import { jsx as jsx335, jsxs as jsxs266 } from "react/jsx-runtime";
|
|
@@ -41232,7 +41213,7 @@ function MarkdownEditor({
|
|
|
41232
41213
|
onFileUploaded,
|
|
41233
41214
|
renderPreview
|
|
41234
41215
|
}) {
|
|
41235
|
-
const fileInputRef =
|
|
41216
|
+
const fileInputRef = useRef59(null);
|
|
41236
41217
|
const [isUploading, setIsUploading] = useState96(false);
|
|
41237
41218
|
const [uploadProgress, setUploadProgress] = useState96("");
|
|
41238
41219
|
const [defaultExtraCommands, setDefaultExtraCommands] = useState96([]);
|
|
@@ -41325,11 +41306,11 @@ function MarkdownEditor({
|
|
|
41325
41306
|
}
|
|
41326
41307
|
} : null;
|
|
41327
41308
|
const extraCommands = uploadCommand ? [...defaultExtraCommands, uploadCommand] : defaultExtraCommands;
|
|
41328
|
-
const wrapperRef =
|
|
41329
|
-
const isDraggingRef =
|
|
41330
|
-
const mouseYRef =
|
|
41331
|
-
const rafRef =
|
|
41332
|
-
const scrollParentRef =
|
|
41309
|
+
const wrapperRef = useRef59(null);
|
|
41310
|
+
const isDraggingRef = useRef59(false);
|
|
41311
|
+
const mouseYRef = useRef59(0);
|
|
41312
|
+
const rafRef = useRef59(0);
|
|
41313
|
+
const scrollParentRef = useRef59(window);
|
|
41333
41314
|
const EDGE_ZONE = 60;
|
|
41334
41315
|
const MAX_SCROLL_SPEED = 15;
|
|
41335
41316
|
const findScrollParent = useCallback44((el) => {
|
|
@@ -46932,7 +46913,7 @@ function renderChatInlineEntityCard(chatRef, options = {}) {
|
|
|
46932
46913
|
}
|
|
46933
46914
|
|
|
46934
46915
|
// src/components/chat/hooks/use-chunk-catchup.ts
|
|
46935
|
-
import { useCallback as useCallback46, useRef as
|
|
46916
|
+
import { useCallback as useCallback46, useRef as useRef63 } from "react";
|
|
46936
46917
|
function makeSeqKey(messageType, chunkType, sequenceId) {
|
|
46937
46918
|
return `${messageType}:${chunkType}:${sequenceId}`;
|
|
46938
46919
|
}
|
|
@@ -46954,22 +46935,22 @@ function useChunkCatchup({
|
|
|
46954
46935
|
chatTypes = [CHAT_TYPE.CLIENT],
|
|
46955
46936
|
fetchChunks
|
|
46956
46937
|
}) {
|
|
46957
|
-
const processedSequenceKeys =
|
|
46958
|
-
const lastSequenceId =
|
|
46959
|
-
const lastSequenceIdByType =
|
|
46960
|
-
const fetchingInProgress =
|
|
46961
|
-
const lastFetchParams =
|
|
46962
|
-
const pendingCatchupRef =
|
|
46963
|
-
const chunkBuffer =
|
|
46964
|
-
const bufferUntilInitialCatchupComplete =
|
|
46965
|
-
const hasCompletedInitialCatchup =
|
|
46966
|
-
const dialogIdRef =
|
|
46938
|
+
const processedSequenceKeys = useRef63(/* @__PURE__ */ new Set());
|
|
46939
|
+
const lastSequenceId = useRef63(null);
|
|
46940
|
+
const lastSequenceIdByType = useRef63(/* @__PURE__ */ new Map());
|
|
46941
|
+
const fetchingInProgress = useRef63(false);
|
|
46942
|
+
const lastFetchParams = useRef63(null);
|
|
46943
|
+
const pendingCatchupRef = useRef63(null);
|
|
46944
|
+
const chunkBuffer = useRef63([]);
|
|
46945
|
+
const bufferUntilInitialCatchupComplete = useRef63(false);
|
|
46946
|
+
const hasCompletedInitialCatchup = useRef63(false);
|
|
46947
|
+
const dialogIdRef = useRef63(dialogId);
|
|
46967
46948
|
dialogIdRef.current = dialogId;
|
|
46968
|
-
const chatTypesRef =
|
|
46949
|
+
const chatTypesRef = useRef63(chatTypes);
|
|
46969
46950
|
chatTypesRef.current = chatTypes;
|
|
46970
|
-
const fetchChunksRef =
|
|
46951
|
+
const fetchChunksRef = useRef63(fetchChunks);
|
|
46971
46952
|
fetchChunksRef.current = fetchChunks;
|
|
46972
|
-
const onChunkReceivedRef =
|
|
46953
|
+
const onChunkReceivedRef = useRef63(onChunkReceived);
|
|
46973
46954
|
onChunkReceivedRef.current = onChunkReceived;
|
|
46974
46955
|
const processChunk = useCallback46((chunk, messageType, forceProcess = false) => {
|
|
46975
46956
|
if (bufferUntilInitialCatchupComplete.current && !forceProcess) {
|
|
@@ -47166,7 +47147,7 @@ function useChunkCatchup({
|
|
|
47166
47147
|
}
|
|
47167
47148
|
}
|
|
47168
47149
|
}, [flushBufferedRealtimeChunks]);
|
|
47169
|
-
const catchUpChunksRef =
|
|
47150
|
+
const catchUpChunksRef = useRef63(null);
|
|
47170
47151
|
catchUpChunksRef.current = catchUpChunks;
|
|
47171
47152
|
const resetChunkTracking = useCallback46(() => {
|
|
47172
47153
|
processedSequenceKeys.current.clear();
|
|
@@ -47245,7 +47226,7 @@ function useScriptedStream(frames, resetKey, enabled = true) {
|
|
|
47245
47226
|
}
|
|
47246
47227
|
|
|
47247
47228
|
// src/components/chat/hooks/use-jetstream-dialog-subscription.ts
|
|
47248
|
-
import { useEffect as useEffect79, useRef as
|
|
47229
|
+
import { useEffect as useEffect79, useRef as useRef64, useState as useState107 } from "react";
|
|
47249
47230
|
var DEFAULT_INACTIVE_THRESHOLD_MS = 5 * 6e4;
|
|
47250
47231
|
var DEFAULT_STREAM_NAME = "CHAT_CHUNKS";
|
|
47251
47232
|
function useJetStreamDialogSubscription({
|
|
@@ -47268,51 +47249,51 @@ function useJetStreamDialogSubscription({
|
|
|
47268
47249
|
const [isSubscribed, setIsSubscribed] = useState107(false);
|
|
47269
47250
|
const [reconnectionCount, setReconnectionCount] = useState107(0);
|
|
47270
47251
|
const [currentStreamSeq, setCurrentStreamSeq] = useState107(null);
|
|
47271
|
-
const clientRef =
|
|
47272
|
-
const subscriptionRef =
|
|
47273
|
-
const highestStreamSeqRef =
|
|
47274
|
-
const onEventRef =
|
|
47252
|
+
const clientRef = useRef64(null);
|
|
47253
|
+
const subscriptionRef = useRef64(null);
|
|
47254
|
+
const highestStreamSeqRef = useRef64(null);
|
|
47255
|
+
const onEventRef = useRef64(onEvent);
|
|
47275
47256
|
useEffect79(() => {
|
|
47276
47257
|
onEventRef.current = onEvent;
|
|
47277
47258
|
}, [onEvent]);
|
|
47278
|
-
const onConnectRef =
|
|
47259
|
+
const onConnectRef = useRef64(onConnect);
|
|
47279
47260
|
useEffect79(() => {
|
|
47280
47261
|
onConnectRef.current = onConnect;
|
|
47281
47262
|
}, [onConnect]);
|
|
47282
|
-
const onDisconnectRef =
|
|
47263
|
+
const onDisconnectRef = useRef64(onDisconnect);
|
|
47283
47264
|
useEffect79(() => {
|
|
47284
47265
|
onDisconnectRef.current = onDisconnect;
|
|
47285
47266
|
}, [onDisconnect]);
|
|
47286
|
-
const onSubscribedRef =
|
|
47267
|
+
const onSubscribedRef = useRef64(onSubscribed);
|
|
47287
47268
|
useEffect79(() => {
|
|
47288
47269
|
onSubscribedRef.current = onSubscribed;
|
|
47289
47270
|
}, [onSubscribed]);
|
|
47290
|
-
const onBeforeReconnectRef =
|
|
47271
|
+
const onBeforeReconnectRef = useRef64(onBeforeReconnect);
|
|
47291
47272
|
useEffect79(() => {
|
|
47292
47273
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
47293
47274
|
}, [onBeforeReconnect]);
|
|
47294
|
-
const getNatsWsUrlRef =
|
|
47275
|
+
const getNatsWsUrlRef = useRef64(getNatsWsUrl);
|
|
47295
47276
|
useEffect79(() => {
|
|
47296
47277
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
47297
47278
|
}, [getNatsWsUrl]);
|
|
47298
|
-
const reconnectionBackoffRef =
|
|
47279
|
+
const reconnectionBackoffRef = useRef64(reconnectionBackoff);
|
|
47299
47280
|
useEffect79(() => {
|
|
47300
47281
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
47301
47282
|
}, [reconnectionBackoff]);
|
|
47302
|
-
const optStartSeqRef =
|
|
47283
|
+
const optStartSeqRef = useRef64(optStartSeq);
|
|
47303
47284
|
useEffect79(() => {
|
|
47304
47285
|
optStartSeqRef.current = optStartSeq;
|
|
47305
47286
|
}, [optStartSeq]);
|
|
47306
|
-
const inactiveThresholdRef =
|
|
47287
|
+
const inactiveThresholdRef = useRef64(inactiveThresholdMs);
|
|
47307
47288
|
useEffect79(() => {
|
|
47308
47289
|
inactiveThresholdRef.current = inactiveThresholdMs;
|
|
47309
47290
|
}, [inactiveThresholdMs]);
|
|
47310
|
-
const hadConnectionBeforeRef =
|
|
47311
|
-
const clientConfigRef =
|
|
47291
|
+
const hadConnectionBeforeRef = useRef64(false);
|
|
47292
|
+
const clientConfigRef = useRef64(clientConfig);
|
|
47312
47293
|
useEffect79(() => {
|
|
47313
47294
|
clientConfigRef.current = clientConfig;
|
|
47314
47295
|
}, [clientConfig]);
|
|
47315
|
-
const currentWsUrlRef =
|
|
47296
|
+
const currentWsUrlRef = useRef64("");
|
|
47316
47297
|
const wsUrl = getNatsWsUrl();
|
|
47317
47298
|
useEffect79(() => {
|
|
47318
47299
|
if (!enabled || !wsUrl) {
|
|
@@ -47486,7 +47467,7 @@ function useJetStreamDialogSubscription({
|
|
|
47486
47467
|
}
|
|
47487
47468
|
|
|
47488
47469
|
// src/components/chat/hooks/use-nats-dialog-subscription.ts
|
|
47489
|
-
import { useEffect as useEffect80, useRef as
|
|
47470
|
+
import { useEffect as useEffect80, useRef as useRef65, useState as useState108 } from "react";
|
|
47490
47471
|
function useNatsDialogSubscription({
|
|
47491
47472
|
enabled,
|
|
47492
47473
|
dialogId,
|
|
@@ -47503,42 +47484,42 @@ function useNatsDialogSubscription({
|
|
|
47503
47484
|
const [isConnected, setIsConnected] = useState108(false);
|
|
47504
47485
|
const [isSubscribed, setIsSubscribed] = useState108(false);
|
|
47505
47486
|
const [reconnectionCount, setReconnectionCount] = useState108(0);
|
|
47506
|
-
const clientRef =
|
|
47507
|
-
const subscriptionRefs =
|
|
47508
|
-
const onEventRef =
|
|
47487
|
+
const clientRef = useRef65(null);
|
|
47488
|
+
const subscriptionRefs = useRef65(/* @__PURE__ */ new Map());
|
|
47489
|
+
const onEventRef = useRef65(onEvent);
|
|
47509
47490
|
useEffect80(() => {
|
|
47510
47491
|
onEventRef.current = onEvent;
|
|
47511
47492
|
}, [onEvent]);
|
|
47512
|
-
const onConnectRef =
|
|
47493
|
+
const onConnectRef = useRef65(onConnect);
|
|
47513
47494
|
useEffect80(() => {
|
|
47514
47495
|
onConnectRef.current = onConnect;
|
|
47515
47496
|
}, [onConnect]);
|
|
47516
|
-
const onDisconnectRef =
|
|
47497
|
+
const onDisconnectRef = useRef65(onDisconnect);
|
|
47517
47498
|
useEffect80(() => {
|
|
47518
47499
|
onDisconnectRef.current = onDisconnect;
|
|
47519
47500
|
}, [onDisconnect]);
|
|
47520
|
-
const onSubscribedRef =
|
|
47501
|
+
const onSubscribedRef = useRef65(onSubscribed);
|
|
47521
47502
|
useEffect80(() => {
|
|
47522
47503
|
onSubscribedRef.current = onSubscribed;
|
|
47523
47504
|
}, [onSubscribed]);
|
|
47524
|
-
const onBeforeReconnectRef =
|
|
47505
|
+
const onBeforeReconnectRef = useRef65(onBeforeReconnect);
|
|
47525
47506
|
useEffect80(() => {
|
|
47526
47507
|
onBeforeReconnectRef.current = onBeforeReconnect;
|
|
47527
47508
|
}, [onBeforeReconnect]);
|
|
47528
|
-
const hadConnectionBeforeRef =
|
|
47529
|
-
const getNatsWsUrlRef =
|
|
47509
|
+
const hadConnectionBeforeRef = useRef65(false);
|
|
47510
|
+
const getNatsWsUrlRef = useRef65(getNatsWsUrl);
|
|
47530
47511
|
useEffect80(() => {
|
|
47531
47512
|
getNatsWsUrlRef.current = getNatsWsUrl;
|
|
47532
47513
|
}, [getNatsWsUrl]);
|
|
47533
|
-
const reconnectionBackoffRef =
|
|
47514
|
+
const reconnectionBackoffRef = useRef65(reconnectionBackoff);
|
|
47534
47515
|
useEffect80(() => {
|
|
47535
47516
|
reconnectionBackoffRef.current = reconnectionBackoff;
|
|
47536
47517
|
}, [reconnectionBackoff]);
|
|
47537
|
-
const clientConfigRef =
|
|
47518
|
+
const clientConfigRef = useRef65(clientConfig);
|
|
47538
47519
|
useEffect80(() => {
|
|
47539
47520
|
clientConfigRef.current = clientConfig;
|
|
47540
47521
|
}, [clientConfig]);
|
|
47541
|
-
const currentWsUrlRef =
|
|
47522
|
+
const currentWsUrlRef = useRef65("");
|
|
47542
47523
|
const wsUrl = getNatsWsUrl();
|
|
47543
47524
|
useEffect80(() => {
|
|
47544
47525
|
if (!enabled || !wsUrl) {
|
|
@@ -47622,15 +47603,15 @@ function useNatsDialogSubscription({
|
|
|
47622
47603
|
};
|
|
47623
47604
|
}, [enabled, wsUrl]);
|
|
47624
47605
|
const topicsKey = topics.join(",");
|
|
47625
|
-
const topicsRef =
|
|
47606
|
+
const topicsRef = useRef65(topics);
|
|
47626
47607
|
topicsRef.current = topics;
|
|
47627
|
-
const lastSubscribedDialogIdRef =
|
|
47628
|
-
const isConnectedRef =
|
|
47608
|
+
const lastSubscribedDialogIdRef = useRef65(null);
|
|
47609
|
+
const isConnectedRef = useRef65(isConnected);
|
|
47629
47610
|
useEffect80(() => {
|
|
47630
47611
|
isConnectedRef.current = isConnected;
|
|
47631
47612
|
}, [isConnected]);
|
|
47632
|
-
const currentDialogIdRef =
|
|
47633
|
-
const abortControllerRef =
|
|
47613
|
+
const currentDialogIdRef = useRef65(null);
|
|
47614
|
+
const abortControllerRef = useRef65(null);
|
|
47634
47615
|
useEffect80(() => {
|
|
47635
47616
|
currentDialogIdRef.current = dialogId;
|
|
47636
47617
|
if (!enabled || !dialogId) {
|
|
@@ -47762,7 +47743,7 @@ function buildNatsWsUrl(apiBaseUrl, options) {
|
|
|
47762
47743
|
}
|
|
47763
47744
|
|
|
47764
47745
|
// src/components/chat/hooks/use-realtime-chunk-processor.ts
|
|
47765
|
-
import { useCallback as useCallback47, useRef as
|
|
47746
|
+
import { useCallback as useCallback47, useRef as useRef66, useEffect as useEffect81 } from "react";
|
|
47766
47747
|
|
|
47767
47748
|
// src/components/chat/utils/chunk-parser.ts
|
|
47768
47749
|
function normalizeToolCalls(raw) {
|
|
@@ -48417,13 +48398,13 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48417
48398
|
batchApprovalsEnabled = true,
|
|
48418
48399
|
isDirectMode = false
|
|
48419
48400
|
} = options;
|
|
48420
|
-
const accumulatorRef =
|
|
48401
|
+
const accumulatorRef = useRef66(
|
|
48421
48402
|
createMessageSegmentAccumulator({
|
|
48422
48403
|
onApprove: callbacks.onApprove,
|
|
48423
48404
|
onReject: callbacks.onReject
|
|
48424
48405
|
})
|
|
48425
48406
|
);
|
|
48426
|
-
const hasInitializedWithData =
|
|
48407
|
+
const hasInitializedWithData = useRef66(false);
|
|
48427
48408
|
useEffect81(() => {
|
|
48428
48409
|
if (initialState && !hasInitializedWithData.current) {
|
|
48429
48410
|
accumulatorRef.current.initializeWithState(initialState);
|
|
@@ -48437,15 +48418,15 @@ function useRealtimeChunkProcessor(options) {
|
|
|
48437
48418
|
hasInitializedWithData.current = true;
|
|
48438
48419
|
}
|
|
48439
48420
|
}, [initialState, callbacks]);
|
|
48440
|
-
const isInStreamRef =
|
|
48441
|
-
const hasEverStreamedRef =
|
|
48442
|
-
const directModeFlagRef =
|
|
48443
|
-
const sawDirectMessageRef =
|
|
48444
|
-
const directTeardownFiredRef =
|
|
48421
|
+
const isInStreamRef = useRef66(false);
|
|
48422
|
+
const hasEverStreamedRef = useRef66(false);
|
|
48423
|
+
const directModeFlagRef = useRef66(isDirectMode);
|
|
48424
|
+
const sawDirectMessageRef = useRef66(false);
|
|
48425
|
+
const directTeardownFiredRef = useRef66(false);
|
|
48445
48426
|
useEffect81(() => {
|
|
48446
48427
|
directModeFlagRef.current = isDirectMode;
|
|
48447
48428
|
}, [isDirectMode]);
|
|
48448
|
-
const pendingEscalatedRef =
|
|
48429
|
+
const pendingEscalatedRef = useRef66(/* @__PURE__ */ new Map());
|
|
48449
48430
|
const processChunk = useCallback47(
|
|
48450
48431
|
(chunk) => {
|
|
48451
48432
|
const action = parseChunkToAction(chunk);
|
|
@@ -48846,7 +48827,7 @@ function useEmptyStateConfig(emptyStateUrl, options) {
|
|
|
48846
48827
|
}
|
|
48847
48828
|
|
|
48848
48829
|
// src/components/chat/hooks/use-chat-attachments.ts
|
|
48849
|
-
import { useCallback as useCallback48, useMemo as useMemo41, useRef as
|
|
48830
|
+
import { useCallback as useCallback48, useMemo as useMemo41, useRef as useRef67, useState as useState110 } from "react";
|
|
48850
48831
|
import { fileTypeFromBlob } from "file-type";
|
|
48851
48832
|
var CHAT_ATTACHMENTS_BUCKET = "chat-attachments";
|
|
48852
48833
|
var CHAT_ATTACHMENTS_FOLDER = "chat";
|
|
@@ -48923,7 +48904,7 @@ function useChatAttachments() {
|
|
|
48923
48904
|
const runtime = useRequiredChatRuntime();
|
|
48924
48905
|
const uploadUrlEndpoint = runtime.endpoints.attachmentUploadUrl;
|
|
48925
48906
|
const [attachments, setAttachments] = useState110([]);
|
|
48926
|
-
const controllersRef =
|
|
48907
|
+
const controllersRef = useRef67(/* @__PURE__ */ new Map());
|
|
48927
48908
|
const updateOne = useCallback48((id, patch) => {
|
|
48928
48909
|
setAttachments((prev) => prev.map((a) => a.id === id ? { ...a, ...patch } : a));
|
|
48929
48910
|
}, []);
|
|
@@ -49012,7 +48993,7 @@ function useChatAttachments() {
|
|
|
49012
48993
|
},
|
|
49013
48994
|
[uploadUrlEndpoint, updateOne]
|
|
49014
48995
|
);
|
|
49015
|
-
const attachmentsRef =
|
|
48996
|
+
const attachmentsRef = useRef67([]);
|
|
49016
48997
|
attachmentsRef.current = attachments;
|
|
49017
48998
|
const addFiles = useCallback48(
|
|
49018
48999
|
(files) => {
|
|
@@ -49089,13 +49070,13 @@ function useChatAttachments() {
|
|
|
49089
49070
|
}
|
|
49090
49071
|
|
|
49091
49072
|
// src/components/chat/hooks/use-chat-attachment-image-gallery.tsx
|
|
49092
|
-
import { useCallback as useCallback49, useEffect as useEffect83, useRef as
|
|
49073
|
+
import { useCallback as useCallback49, useEffect as useEffect83, useRef as useRef68, useState as useState111 } from "react";
|
|
49093
49074
|
import { jsx as jsx359 } from "react/jsx-runtime";
|
|
49094
49075
|
var CLOSED = { isOpen: false, images: [], initialIndex: 0 };
|
|
49095
49076
|
function useChatAttachmentImageGallery() {
|
|
49096
49077
|
const runtime = useRequiredChatRuntime();
|
|
49097
49078
|
const viewUrlPrefix = runtime.endpoints.attachmentViewUrlPrefix;
|
|
49098
|
-
const panelRef =
|
|
49079
|
+
const panelRef = useRef68(null);
|
|
49099
49080
|
const [state, setState] = useState111(CLOSED);
|
|
49100
49081
|
const handleClose = useCallback49(() => setState(CLOSED), []);
|
|
49101
49082
|
useEffect83(() => {
|
|
@@ -49199,10 +49180,10 @@ function useChatIdentity() {
|
|
|
49199
49180
|
}
|
|
49200
49181
|
|
|
49201
49182
|
// src/components/chat/hooks/use-close-on-navigation.ts
|
|
49202
|
-
import { useEffect as useEffect85, useRef as
|
|
49183
|
+
import { useEffect as useEffect85, useRef as useRef69 } from "react";
|
|
49203
49184
|
function useCloseOnNavigation(close, pathname) {
|
|
49204
|
-
const prevPathnameRef =
|
|
49205
|
-
const initializedRef =
|
|
49185
|
+
const prevPathnameRef = useRef69(null);
|
|
49186
|
+
const initializedRef = useRef69(false);
|
|
49206
49187
|
useEffect85(() => {
|
|
49207
49188
|
if (!initializedRef.current) {
|
|
49208
49189
|
initializedRef.current = true;
|
|
@@ -49217,14 +49198,14 @@ function useCloseOnNavigation(close, pathname) {
|
|
|
49217
49198
|
}
|
|
49218
49199
|
|
|
49219
49200
|
// src/components/chat/hooks/use-chat.ts
|
|
49220
|
-
import { useState as useState114, useCallback as useCallback51, useEffect as useEffect86, useRef as
|
|
49201
|
+
import { useState as useState114, useCallback as useCallback51, useEffect as useEffect86, useRef as useRef71 } from "react";
|
|
49221
49202
|
|
|
49222
49203
|
// src/components/chat/hooks/use-sse.ts
|
|
49223
|
-
import { useState as useState113, useCallback as useCallback50, useRef as
|
|
49204
|
+
import { useState as useState113, useCallback as useCallback50, useRef as useRef70 } from "react";
|
|
49224
49205
|
function useSSE({ useMock = true, debugMode = false, streamFn } = {}) {
|
|
49225
49206
|
const [isStreaming, setIsStreaming] = useState113(false);
|
|
49226
49207
|
const [error, setError] = useState113(null);
|
|
49227
|
-
const abortControllerRef =
|
|
49208
|
+
const abortControllerRef = useRef70(null);
|
|
49228
49209
|
const fallbackStream = useCallback50(async function* () {
|
|
49229
49210
|
throw new Error(
|
|
49230
49211
|
"[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."
|
|
@@ -49292,8 +49273,8 @@ function useChat({
|
|
|
49292
49273
|
} = {}) {
|
|
49293
49274
|
const [messages, setMessages] = useState114(() => initialMessages ?? []);
|
|
49294
49275
|
const [isTyping, setIsTyping] = useState114(false);
|
|
49295
|
-
const currentAssistantSegmentsRef =
|
|
49296
|
-
const onMessagesChangeRef =
|
|
49276
|
+
const currentAssistantSegmentsRef = useRef71([]);
|
|
49277
|
+
const onMessagesChangeRef = useRef71(onMessagesChange);
|
|
49297
49278
|
onMessagesChangeRef.current = onMessagesChange;
|
|
49298
49279
|
useEffect86(() => {
|
|
49299
49280
|
onMessagesChangeRef.current?.(messages);
|
|
@@ -49584,7 +49565,7 @@ function useChat({
|
|
|
49584
49565
|
}
|
|
49585
49566
|
|
|
49586
49567
|
// src/components/chat/hooks/use-sse-chat-adapter.ts
|
|
49587
|
-
import { useState as useState115, useEffect as useEffect87, useCallback as useCallback52, useMemo as useMemo42, useRef as
|
|
49568
|
+
import { useState as useState115, useEffect as useEffect87, useCallback as useCallback52, useMemo as useMemo42, useRef as useRef72 } from "react";
|
|
49588
49569
|
function createEmptyTurnMeta() {
|
|
49589
49570
|
return {
|
|
49590
49571
|
provider: null,
|
|
@@ -49905,20 +49886,20 @@ function useSseChatAdapter(options, runtimeOptions = {}) {
|
|
|
49905
49886
|
const runtime = useRequiredChatRuntime();
|
|
49906
49887
|
const source = runtime.source || DEFAULT_CHAT_SOURCE;
|
|
49907
49888
|
const tableIdForDocumentType = options?.tableIdForDocumentType ?? defaultTableIdForDocumentType;
|
|
49908
|
-
const persistedRef =
|
|
49889
|
+
const persistedRef = useRef72(null);
|
|
49909
49890
|
if (persistedRef.current === null) {
|
|
49910
49891
|
pruneStaleChatStorage(source);
|
|
49911
49892
|
persistedRef.current = loadPersistedChat(source) || { messages: [], sources: [], sendCount: 0 };
|
|
49912
49893
|
}
|
|
49913
|
-
const sourcesMapRef =
|
|
49894
|
+
const sourcesMapRef = useRef72(
|
|
49914
49895
|
new Map(persistedRef.current.sources)
|
|
49915
49896
|
);
|
|
49916
|
-
const refsMapRef =
|
|
49897
|
+
const refsMapRef = useRef72(
|
|
49917
49898
|
new Map(persistedRef.current.refs ?? [])
|
|
49918
49899
|
);
|
|
49919
|
-
const metaMapRef =
|
|
49920
|
-
const messagesRef =
|
|
49921
|
-
const sendCountRef =
|
|
49900
|
+
const metaMapRef = useRef72(/* @__PURE__ */ new Map());
|
|
49901
|
+
const messagesRef = useRef72(persistedRef.current.messages);
|
|
49902
|
+
const sendCountRef = useRef72(persistedRef.current.sendCount);
|
|
49922
49903
|
const [streamingPhase, setStreamingPhase] = useState115("idle");
|
|
49923
49904
|
const [metaTick, setMetaTick] = useState115(0);
|
|
49924
49905
|
const bumpMetaTick = useCallback52(() => setMetaTick((t) => t + 1), []);
|
|
@@ -50192,7 +50173,7 @@ import {
|
|
|
50192
50173
|
useCallback as useCallback53,
|
|
50193
50174
|
useEffect as useEffect88,
|
|
50194
50175
|
useMemo as useMemo43,
|
|
50195
|
-
useRef as
|
|
50176
|
+
useRef as useRef73,
|
|
50196
50177
|
useState as useState116
|
|
50197
50178
|
} from "react";
|
|
50198
50179
|
|
|
@@ -50877,17 +50858,17 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
50877
50858
|
const isManagedMode = fetchDialogs !== void 0;
|
|
50878
50859
|
const [internalDialogId, setInternalDialogId] = useState116(null);
|
|
50879
50860
|
const dialogId = isManagedMode ? internalDialogId : controlledDialogId !== void 0 ? controlledDialogId : null;
|
|
50880
|
-
const currentDialogIdRef =
|
|
50861
|
+
const currentDialogIdRef = useRef73(dialogId);
|
|
50881
50862
|
currentDialogIdRef.current = dialogId;
|
|
50882
50863
|
const [messages, setMessages] = useState116([]);
|
|
50883
50864
|
const [streamingPhase, setStreamingPhase] = useState116("idle");
|
|
50884
|
-
const streamingPhaseRef =
|
|
50865
|
+
const streamingPhaseRef = useRef73(streamingPhase);
|
|
50885
50866
|
streamingPhaseRef.current = streamingPhase;
|
|
50886
|
-
const suppressAgentBusyRef =
|
|
50887
|
-
const adoptTrailingAssistantRef =
|
|
50888
|
-
const hasConnectedOnceRef =
|
|
50889
|
-
const seenParticipantSeqsRef =
|
|
50890
|
-
const pendingEchoTextsRef =
|
|
50867
|
+
const suppressAgentBusyRef = useRef73(0);
|
|
50868
|
+
const adoptTrailingAssistantRef = useRef73(false);
|
|
50869
|
+
const hasConnectedOnceRef = useRef73(false);
|
|
50870
|
+
const seenParticipantSeqsRef = useRef73(/* @__PURE__ */ new Set());
|
|
50871
|
+
const pendingEchoTextsRef = useRef73([]);
|
|
50891
50872
|
const [approvalStatuses, setApprovalStatuses] = useState116({});
|
|
50892
50873
|
const [dialogs, setDialogs] = useState116([]);
|
|
50893
50874
|
const [dialogsNextCursor, setDialogsNextCursor] = useState116(null);
|
|
@@ -50940,9 +50921,9 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
50940
50921
|
},
|
|
50941
50922
|
[rejectRequestCallback]
|
|
50942
50923
|
);
|
|
50943
|
-
const handleApproveRef =
|
|
50924
|
+
const handleApproveRef = useRef73(handleApprove);
|
|
50944
50925
|
handleApproveRef.current = handleApprove;
|
|
50945
|
-
const handleRejectRef =
|
|
50926
|
+
const handleRejectRef = useRef73(handleReject);
|
|
50946
50927
|
handleRejectRef.current = handleReject;
|
|
50947
50928
|
const accumApprove = useCallback53((requestId) => {
|
|
50948
50929
|
if (!requestId) return;
|
|
@@ -50952,7 +50933,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
50952
50933
|
if (!requestId) return;
|
|
50953
50934
|
return handleRejectRef.current(requestId);
|
|
50954
50935
|
}, []);
|
|
50955
|
-
const callbacksRef =
|
|
50936
|
+
const callbacksRef = useRef73({
|
|
50956
50937
|
onSegmentsUpdate: (segments, meta) => {
|
|
50957
50938
|
if (meta?.append && meta.isCompacting) {
|
|
50958
50939
|
setMessages((prev) => upsertTrailingCompaction(prev, segments));
|
|
@@ -51170,7 +51151,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51170
51151
|
onChunkReceived: (chunk) => processChunk(chunk),
|
|
51171
51152
|
fetchChunks
|
|
51172
51153
|
});
|
|
51173
|
-
const historyLoadSeqRef =
|
|
51154
|
+
const historyLoadSeqRef = useRef73(0);
|
|
51174
51155
|
const loadDialogHistory = useCallback53(
|
|
51175
51156
|
async (id, cursor) => {
|
|
51176
51157
|
if (!fetchDialogMessages) return;
|
|
@@ -51229,7 +51210,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51229
51210
|
isBufferingActive
|
|
51230
51211
|
]
|
|
51231
51212
|
);
|
|
51232
|
-
const prevDialogIdRef =
|
|
51213
|
+
const prevDialogIdRef = useRef73(void 0);
|
|
51233
51214
|
useEffect88(() => {
|
|
51234
51215
|
if (prevDialogIdRef.current === dialogId) return;
|
|
51235
51216
|
prevDialogIdRef.current = dialogId;
|
|
@@ -51306,7 +51287,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51306
51287
|
}
|
|
51307
51288
|
setConnectionState("connecting");
|
|
51308
51289
|
}, [active, dialogId]);
|
|
51309
|
-
const initialDialogsLoadedRef =
|
|
51290
|
+
const initialDialogsLoadedRef = useRef73(false);
|
|
51310
51291
|
const loadDialogsPage = useCallback53(
|
|
51311
51292
|
async (cursor) => {
|
|
51312
51293
|
if (!fetchDialogs) return;
|
|
@@ -51581,7 +51562,7 @@ function useNatsChatAdapter(config, options = {}) {
|
|
|
51581
51562
|
}
|
|
51582
51563
|
|
|
51583
51564
|
// src/components/chat/hooks/use-unified-chat.ts
|
|
51584
|
-
import { useCallback as useCallback54, useMemo as useMemo44, useRef as
|
|
51565
|
+
import { useCallback as useCallback54, useMemo as useMemo44, useRef as useRef74 } from "react";
|
|
51585
51566
|
var EMPTY_SSE_OPTIONS = {};
|
|
51586
51567
|
function createDisabledNatsConfig() {
|
|
51587
51568
|
return {
|
|
@@ -51596,7 +51577,7 @@ function createDisabledNatsConfig() {
|
|
|
51596
51577
|
}
|
|
51597
51578
|
function useUnifiedChat(options) {
|
|
51598
51579
|
const { modes, activeMode, mingoStateOverride } = options;
|
|
51599
|
-
const disabledNatsRef =
|
|
51580
|
+
const disabledNatsRef = useRef74(null);
|
|
51600
51581
|
if (disabledNatsRef.current === null) {
|
|
51601
51582
|
disabledNatsRef.current = createDisabledNatsConfig();
|
|
51602
51583
|
}
|
|
@@ -51610,7 +51591,7 @@ function useUnifiedChat(options) {
|
|
|
51610
51591
|
{ active: natsActive }
|
|
51611
51592
|
);
|
|
51612
51593
|
const activeState = activeMode === "guide" ? sseState : mingoStateOverride ?? natsState;
|
|
51613
|
-
const activeStateRef =
|
|
51594
|
+
const activeStateRef = useRef74(activeState);
|
|
51614
51595
|
activeStateRef.current = activeState;
|
|
51615
51596
|
const stopMessage = useCallback54(() => activeStateRef.current.stopMessage(), []);
|
|
51616
51597
|
const clearMessages = useCallback54(
|
|
@@ -51920,7 +51901,7 @@ function buildStreamFrames(messages) {
|
|
|
51920
51901
|
|
|
51921
51902
|
// src/components/chat/embeddable-chat.tsx
|
|
51922
51903
|
init_cn();
|
|
51923
|
-
import { useCallback as useCallback56, useEffect as useEffect89, useMemo as useMemo46, useRef as
|
|
51904
|
+
import { useCallback as useCallback56, useEffect as useEffect89, useMemo as useMemo46, useRef as useRef76, useState as useState118 } from "react";
|
|
51924
51905
|
import * as DialogPrimitive4 from "@radix-ui/react-dialog";
|
|
51925
51906
|
import { usePreventScroll as usePreventScroll6 } from "@react-aria/overlays";
|
|
51926
51907
|
import { isIOS } from "@react-aria/utils";
|
|
@@ -52001,7 +51982,7 @@ init_button2();
|
|
|
52001
51982
|
import { FileText as FileText8, MessageSquare as MessageSquare3 } from "lucide-react";
|
|
52002
51983
|
|
|
52003
51984
|
// src/components/chat/hooks/use-chat-dialog-manager.ts
|
|
52004
|
-
import { useCallback as useCallback55, useMemo as useMemo45, useRef as
|
|
51985
|
+
import { useCallback as useCallback55, useMemo as useMemo45, useRef as useRef75, useState as useState117 } from "react";
|
|
52005
51986
|
function useChatDialogManager({
|
|
52006
51987
|
dialogs,
|
|
52007
51988
|
activeDialogId,
|
|
@@ -52041,7 +52022,7 @@ function useChatDialogManager({
|
|
|
52041
52022
|
const [archivedCursor, setArchivedCursor] = useState117(null);
|
|
52042
52023
|
const [archivedLoading, setArchivedLoading] = useState117(false);
|
|
52043
52024
|
const [archivedPending, setArchivedPending] = useState117(false);
|
|
52044
|
-
const archivedRequestIdRef =
|
|
52025
|
+
const archivedRequestIdRef = useRef75(0);
|
|
52045
52026
|
const loadArchivedPage = useCallback55(
|
|
52046
52027
|
async (cursor) => {
|
|
52047
52028
|
if (!fetchArchivedDialogs) return;
|
|
@@ -52538,7 +52519,7 @@ function EmbeddableChatInner({
|
|
|
52538
52519
|
return !window.matchMedia("(pointer: coarse)").matches;
|
|
52539
52520
|
});
|
|
52540
52521
|
usePreventScroll6({ isDisabled: !isOpen || shellLess });
|
|
52541
|
-
const navigatingAwayRef =
|
|
52522
|
+
const navigatingAwayRef = useRef76(false);
|
|
52542
52523
|
useEffect89(() => {
|
|
52543
52524
|
if (!isOpen) return;
|
|
52544
52525
|
if (shellLess) return;
|
|
@@ -52565,7 +52546,7 @@ function EmbeddableChatInner({
|
|
|
52565
52546
|
window.scrollTo(0, scrollY);
|
|
52566
52547
|
};
|
|
52567
52548
|
}, [isOpen, shellLess]);
|
|
52568
|
-
const chatInputRef =
|
|
52549
|
+
const chatInputRef = useRef76(null);
|
|
52569
52550
|
const [quickActionPreview, setQuickActionPreview] = useState118(null);
|
|
52570
52551
|
const slashCommandsProp = useMemo46(
|
|
52571
52552
|
() => ({
|
|
@@ -52669,7 +52650,7 @@ function EmbeddableChatInner({
|
|
|
52669
52650
|
hasMoreMessages,
|
|
52670
52651
|
loadMoreMessages
|
|
52671
52652
|
} = useUnifiedChat({ modes: effectiveModes, activeMode, mingoStateOverride: mingoState });
|
|
52672
|
-
const guidePromptSentRef =
|
|
52653
|
+
const guidePromptSentRef = useRef76(false);
|
|
52673
52654
|
useEffect89(() => {
|
|
52674
52655
|
if (!guidePendingPrompt) {
|
|
52675
52656
|
guidePromptSentRef.current = false;
|
|
@@ -52694,11 +52675,11 @@ function EmbeddableChatInner({
|
|
|
52694
52675
|
const [contextItems, setContextItems] = useState118([]);
|
|
52695
52676
|
const [contextPickerOpen, setContextPickerOpen] = useState118(false);
|
|
52696
52677
|
const [mentionQuery, setMentionQuery] = useState118(null);
|
|
52697
|
-
const mentionActiveRef =
|
|
52678
|
+
const mentionActiveRef = useRef76(false);
|
|
52698
52679
|
useEffect89(() => {
|
|
52699
52680
|
mentionActiveRef.current = mentionQuery !== null;
|
|
52700
52681
|
}, [mentionQuery]);
|
|
52701
|
-
const mentionKeysRef =
|
|
52682
|
+
const mentionKeysRef = useRef76(/* @__PURE__ */ new Set());
|
|
52702
52683
|
useEffect89(() => {
|
|
52703
52684
|
setContextItems([]);
|
|
52704
52685
|
setMentionQuery(null);
|
|
@@ -52795,7 +52776,7 @@ function EmbeddableChatInner({
|
|
|
52795
52776
|
() => effectiveAssistantIcon ? /* @__PURE__ */ jsx362(EntityIcon, { icon: effectiveAssistantIcon, size: 24 }) : /* @__PURE__ */ jsx362(MingoIcon, { className: "h-6 w-6", cornerColor: "var(--ods-flamingo-cyan-base)" }),
|
|
52796
52777
|
[effectiveAssistantIcon]
|
|
52797
52778
|
);
|
|
52798
|
-
const timestampCacheRef =
|
|
52779
|
+
const timestampCacheRef = useRef76(/* @__PURE__ */ new Map());
|
|
52799
52780
|
const guideUserName = activeMode === "guide" ? [identityUser?.firstName, identityUser?.lastName].filter(Boolean).join(" ").trim() || identityUser?.name?.trim() || void 0 : void 0;
|
|
52800
52781
|
const guideUserAvatar = activeMode === "guide" ? identityUser?.avatarUrl?.trim() || void 0 : void 0;
|
|
52801
52782
|
const messages = useMemo46(() => {
|
|
@@ -52993,7 +52974,7 @@ function EmbeddableChatInner({
|
|
|
52993
52974
|
}, [lastAssistantMsg, chatLoading]);
|
|
52994
52975
|
const [portalHost, setPortalHost] = useState118(null);
|
|
52995
52976
|
const [panelWidth, setPanelWidth] = useState118(0);
|
|
52996
|
-
const panelMeasureRef =
|
|
52977
|
+
const panelMeasureRef = useRef76(null);
|
|
52997
52978
|
useEffect89(() => {
|
|
52998
52979
|
const el = panelMeasureRef.current;
|
|
52999
52980
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -54538,4 +54519,4 @@ export {
|
|
|
54538
54519
|
LogsList,
|
|
54539
54520
|
assets
|
|
54540
54521
|
};
|
|
54541
|
-
//# sourceMappingURL=chunk-
|
|
54522
|
+
//# sourceMappingURL=chunk-MAB4TQCO.js.map
|