@paymanai/payman-ask-sdk 1.2.22 → 1.2.24

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/index.js CHANGED
@@ -371,7 +371,7 @@ function ImageLightbox({
371
371
  background: "rgba(2, 6, 23, 0.92)",
372
372
  isolation: "isolate"
373
373
  };
374
- const frameStyle = {
374
+ const frameStyle2 = {
375
375
  position: "relative",
376
376
  width: "min(92vw, 1280px)",
377
377
  height: "min(88vh, 920px)",
@@ -431,7 +431,7 @@ function ImageLightbox({
431
431
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
432
432
  }
433
433
  ),
434
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: frameStyle, onClick: (event) => event.stopPropagation(), children: [
434
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: frameStyle2, onClick: (event) => event.stopPropagation(), children: [
435
435
  !isImageLoaded ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-2", children: [
436
436
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-5 w-5 animate-spin text-white/80" }),
437
437
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-white/90", children: "Loading image" }),
@@ -1357,6 +1357,101 @@ function MessageList({
1357
1357
  }
1358
1358
  ) });
1359
1359
  }
1360
+ function ResetSessionConfirmModal({
1361
+ isOpen,
1362
+ onClose,
1363
+ onConfirm
1364
+ }) {
1365
+ const handleKeyDown = react.useCallback(
1366
+ (event) => {
1367
+ if (event.key === "Escape") {
1368
+ onClose();
1369
+ }
1370
+ },
1371
+ [onClose]
1372
+ );
1373
+ react.useEffect(() => {
1374
+ if (!isOpen || typeof document === "undefined") return;
1375
+ document.addEventListener("keydown", handleKeyDown);
1376
+ const previousOverflow = document.body.style.overflow;
1377
+ document.body.style.overflow = "hidden";
1378
+ return () => {
1379
+ document.removeEventListener("keydown", handleKeyDown);
1380
+ document.body.style.overflow = previousOverflow;
1381
+ };
1382
+ }, [handleKeyDown, isOpen]);
1383
+ return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: isOpen ? /* @__PURE__ */ jsxRuntime.jsxs(
1384
+ framerMotion.motion.div,
1385
+ {
1386
+ className: "payman-reset-session-modal-backdrop",
1387
+ initial: { opacity: 0 },
1388
+ animate: { opacity: 1 },
1389
+ exit: { opacity: 0 },
1390
+ transition: { duration: 0.18 },
1391
+ onClick: onClose,
1392
+ role: "presentation",
1393
+ children: [
1394
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-reset-session-modal-overlay" }),
1395
+ /* @__PURE__ */ jsxRuntime.jsxs(
1396
+ framerMotion.motion.div,
1397
+ {
1398
+ initial: { opacity: 0, y: 12, scale: 0.98 },
1399
+ animate: { opacity: 1, y: 0, scale: 1 },
1400
+ exit: { opacity: 0, y: 8, scale: 0.98 },
1401
+ transition: { duration: 0.2, ease: [0.16, 1, 0.3, 1] },
1402
+ className: "payman-reset-session-modal-dialog",
1403
+ onClick: (event) => event.stopPropagation(),
1404
+ role: "dialog",
1405
+ "aria-modal": "true",
1406
+ "aria-labelledby": "payman-reset-session-title",
1407
+ "aria-describedby": "payman-reset-session-description",
1408
+ children: [
1409
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-reset-session-modal-copy", children: [
1410
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-reset-session-modal-eyebrow", children: "New Session" }),
1411
+ /* @__PURE__ */ jsxRuntime.jsx(
1412
+ "h2",
1413
+ {
1414
+ id: "payman-reset-session-title",
1415
+ className: "payman-reset-session-modal-title",
1416
+ children: "Start a new session?"
1417
+ }
1418
+ ),
1419
+ /* @__PURE__ */ jsxRuntime.jsx(
1420
+ "p",
1421
+ {
1422
+ id: "payman-reset-session-description",
1423
+ className: "payman-reset-session-modal-description",
1424
+ children: "This will clear the current conversation and start fresh."
1425
+ }
1426
+ )
1427
+ ] }),
1428
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-reset-session-modal-actions", children: [
1429
+ /* @__PURE__ */ jsxRuntime.jsx(
1430
+ "button",
1431
+ {
1432
+ type: "button",
1433
+ onClick: onClose,
1434
+ className: "payman-reset-session-modal-btn payman-reset-session-modal-btn-secondary",
1435
+ children: "Cancel"
1436
+ }
1437
+ ),
1438
+ /* @__PURE__ */ jsxRuntime.jsx(
1439
+ "button",
1440
+ {
1441
+ type: "button",
1442
+ onClick: onConfirm,
1443
+ className: "payman-reset-session-modal-btn payman-reset-session-modal-btn-primary",
1444
+ children: "New Session"
1445
+ }
1446
+ )
1447
+ ] })
1448
+ ]
1449
+ }
1450
+ )
1451
+ ]
1452
+ }
1453
+ ) : null });
1454
+ }
1360
1455
 
1361
1456
  // src/assets/payman-mono-crop-blue.png
1362
1457
  var payman_mono_crop_blue_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAMMCAYAAADDyBY0AAAACXBIWXMAAG66AABuugHW3rEXAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAGA7SURBVHgB7d07kFt3luf5cy4eophUDOTVbFWJINXRUc6Mkp7EpEJgKFOhsZT0ui0mvVmLpLW9FpPW7Fgkre2xmPS6LKYidqfVYmoItki2xmKWVxNRTUFSGesV1MqkqARw//v/45FPPC6Ae4H7+H6i1UyRrCoVKwH87jn/c/4qAJAgpUql3NgrlOyXi76akud5Z8Vv2b/XsrF/dX6XKUv61FW0Zv+71Y2xX+e8mu/73+U9r2aMX8/nm7V6tVoTAAhABQBipFRZLTX2dsv2y0XjmbIac/Yg3KUy2IVMayqm5kKiePIH9e3fe6ZGQARwGAEQwMz1D3neoukEvJIgMraKuG2MqblwmFNvu1M9PLNdr27WBUBmEAABRKrbsq24oCe+vCeqi1TyYsm2mGVbPG/btZZzKtsEQyC9CIAAQrNwccWGO1mUnL4nvqlQ0Uu+XsXQqDwhFALpQQAEMJFeZY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vffjxasvoVTGyKsCEOAMIxAcVQAAj/fT1V5tH28NUBQEgyfICAAG59rD9Yc197aaHxTNXjZGKAAAShQoggIn0rpujKggAyUMFEMBUqAoCQPJQAQQQGqqCAJAMVAABhO5wVbA9Qex7qyLmqgAAYoEKIIBItSeIu/cPu72CqrItAIC5Yg8ggJk79f6nZS/XWrdffsQdxNnBHkAgPmgBA5i5wy3iM5eWK75R+7X5zP5tSQAAkSMAApgrdwex/cH9xY0jADAjnAEEEBu9G0eKhTNvt+8hVtkUAEDoOAMIINbcecGc16qwXzD5OAMIxAcBEEBiEAaTjQAIxAcBEEAilSqrpcbe7qrxzGfSCYMMkMQcARCIDwIggFQ4WDjNapm4IgAC8UEABJA6brWMEV21beLPCIPxQQAE4oMACCDV3LlBzTVXPZXPODc4XwRAID4IgAAyw50bbLV+qtAqng8CIBAfBEAAmbVwcWXRV1OhOjgbBEAgPgiAACCd6mCzubPozg7ayuBHNhAuCkJFAATigwAIAH30dg4abVcGaReHgAAIxAcBEAACcO1i+8NiZ++gLhIIx0cABOKDAAgAEyAQjo8ACMQHARAAQuBaxoVCY9FNGKua9zhDeBIBEIgPAiAARKA3VOKLVOwbbW+oJNPX1REAgfggAALAjPTaxuK5MJi9SWMCIBAfeQEAzMTu80fb9oftwz/nrq1r2SBow9FH9om8TOsYwCxQAQSAmOmFQk+1bCuF76VlSTUVQCA+qAACQMzsPN2q2h+qh3/OtY+9nF9uGV3U9l5CKVEtBDApKoAAkFC9QZNj1cLYDptQAQTigwAIACnTC4aqptRq7yiU9+JwvpAACMQHARAAMuRwK1k6wbA0q6ohARCIDwIgAGAm7WQCIBAfBEAAwEBhtpMJgEB8EAABABMZt51MAATigwAIAAhVqVIpN5v58vF2sg2A2wRAAACADHHtZAEAAAAAAAAAAAAAAECY/n+sv/W59por5gAAAABJRU5ErkJggg==";
@@ -2013,111 +2108,1996 @@ function UserActionModal({
2013
2108
  }
2014
2109
  );
2015
2110
  }
2016
- var DEFAULT_USER_ACTION_STATE = {
2017
- request: null,
2018
- clearOtpTrigger: 0
2111
+ function ActionTooltipV2({ label, children }) {
2112
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-tooltip", children: [
2113
+ children,
2114
+ /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": "true", className: "payman-v2-tooltip-content", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-tooltip-text", children: [
2115
+ label,
2116
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-tooltip-arrow" })
2117
+ ] }) })
2118
+ ] });
2119
+ }
2120
+ function formatMessageTime(timestamp) {
2121
+ const value = new Date(timestamp);
2122
+ if (Number.isNaN(value.getTime())) return "";
2123
+ return new Intl.DateTimeFormat(void 0, {
2124
+ hour: "numeric",
2125
+ minute: "2-digit"
2126
+ }).format(value);
2127
+ }
2128
+ function UserMessageV2({
2129
+ message,
2130
+ onEdit,
2131
+ onRetry,
2132
+ retryDisabled = false,
2133
+ actions
2134
+ }) {
2135
+ const [copied, setCopied] = react.useState(false);
2136
+ const [toast, setToast] = react.useState(null);
2137
+ const copyResetTimerRef = react.useRef(null);
2138
+ const toastTimerRef = react.useRef(null);
2139
+ const showCopyAction = actions?.copy ?? true;
2140
+ const showEditAction = actions?.edit ?? false;
2141
+ const showRetryAction = actions?.retry ?? false;
2142
+ react.useEffect(() => {
2143
+ return () => {
2144
+ if (copyResetTimerRef.current) clearTimeout(copyResetTimerRef.current);
2145
+ if (toastTimerRef.current) clearTimeout(toastTimerRef.current);
2146
+ };
2147
+ }, []);
2148
+ const showToast = (label, tone) => {
2149
+ if (toastTimerRef.current) clearTimeout(toastTimerRef.current);
2150
+ setToast({ label, tone });
2151
+ toastTimerRef.current = setTimeout(() => setToast(null), 1800);
2152
+ };
2153
+ const handleCopy = async () => {
2154
+ try {
2155
+ if (!navigator.clipboard?.writeText) {
2156
+ throw new Error("Clipboard unavailable");
2157
+ }
2158
+ await navigator.clipboard.writeText(message.content);
2159
+ if (copyResetTimerRef.current) clearTimeout(copyResetTimerRef.current);
2160
+ setCopied(true);
2161
+ copyResetTimerRef.current = setTimeout(() => setCopied(false), 1800);
2162
+ showToast("Copied to clipboard", "success");
2163
+ } catch {
2164
+ setCopied(false);
2165
+ showToast("Could not copy", "error");
2166
+ }
2167
+ };
2168
+ const timestamp = formatMessageTime(message.timestamp);
2169
+ const hasVisibleActions = showCopyAction || showEditAction && !!onEdit || showRetryAction && !!onRetry;
2170
+ const toastPortal = typeof document !== "undefined" ? reactDom.createPortal(
2171
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: toast && /* @__PURE__ */ jsxRuntime.jsx(
2172
+ framerMotion.motion.div,
2173
+ {
2174
+ initial: { opacity: 0, y: -18, scale: 0.96 },
2175
+ animate: { opacity: 1, y: 0, scale: 1 },
2176
+ exit: { opacity: 0, y: -12, scale: 0.96 },
2177
+ transition: {
2178
+ type: "spring",
2179
+ stiffness: 360,
2180
+ damping: 26,
2181
+ mass: 0.7
2182
+ },
2183
+ className: "payman-v2-toast",
2184
+ role: "status",
2185
+ "aria-live": "polite",
2186
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2187
+ "div",
2188
+ {
2189
+ className: cn(
2190
+ "payman-v2-toast-inner",
2191
+ toast.tone === "success" ? "payman-v2-toast-success" : "payman-v2-toast-error"
2192
+ ),
2193
+ children: [
2194
+ toast.tone === "success" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4", style: { color: "#059669" } }) : /* @__PURE__ */ jsxRuntime.jsx(
2195
+ lucideReact.AlertCircle,
2196
+ {
2197
+ className: "h-4 w-4",
2198
+ style: { color: "#ef4444" }
2199
+ }
2200
+ ),
2201
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: toast.label })
2202
+ ]
2203
+ }
2204
+ )
2205
+ }
2206
+ ) }),
2207
+ document.body
2208
+ ) : null;
2209
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2210
+ toastPortal,
2211
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-user-msg payman-v2-fade-in", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-user-msg-group", children: [
2212
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-user-msg-bubble", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-v2-user-msg-text", children: message.content }) }),
2213
+ message.isError && message.errorDetails && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-user-msg-error", children: [
2214
+ /* @__PURE__ */ jsxRuntime.jsx(
2215
+ lucideReact.AlertCircle,
2216
+ {
2217
+ className: "h-3.5 w-3.5 shrink-0",
2218
+ style: { color: "rgba(239, 68, 68, 0.7)", marginTop: "2px" }
2219
+ }
2220
+ ),
2221
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-v2-user-msg-error-text", children: message.errorDetails })
2222
+ ] }),
2223
+ (timestamp || hasVisibleActions) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-user-msg-actions", children: [
2224
+ timestamp ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "payman-v2-user-msg-timestamp", children: timestamp }) : null,
2225
+ showCopyAction && /* @__PURE__ */ jsxRuntime.jsx(ActionTooltipV2, { label: "Copy", children: /* @__PURE__ */ jsxRuntime.jsx(
2226
+ "button",
2227
+ {
2228
+ type: "button",
2229
+ onClick: () => void handleCopy(),
2230
+ className: "payman-v2-user-msg-action-btn",
2231
+ "aria-label": "Copy message",
2232
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(
2233
+ lucideReact.Check,
2234
+ {
2235
+ className: "h-3.5 w-3.5",
2236
+ style: { color: "#059669" }
2237
+ }
2238
+ ) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "h-3.5 w-3.5" })
2239
+ }
2240
+ ) }),
2241
+ showEditAction && onEdit && /* @__PURE__ */ jsxRuntime.jsx(ActionTooltipV2, { label: "Edit", children: /* @__PURE__ */ jsxRuntime.jsx(
2242
+ "button",
2243
+ {
2244
+ type: "button",
2245
+ onClick: () => onEdit(message.id),
2246
+ className: "payman-v2-user-msg-action-btn",
2247
+ "aria-label": "Edit message",
2248
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "h-3.5 w-3.5" })
2249
+ }
2250
+ ) }),
2251
+ showRetryAction && onRetry && /* @__PURE__ */ jsxRuntime.jsx(ActionTooltipV2, { label: "Retry", children: /* @__PURE__ */ jsxRuntime.jsx(
2252
+ "button",
2253
+ {
2254
+ type: "button",
2255
+ onClick: () => onRetry(message.id),
2256
+ disabled: retryDisabled,
2257
+ className: "payman-v2-user-msg-action-btn",
2258
+ "aria-label": "Retry message",
2259
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { className: "h-3.5 w-3.5" })
2260
+ }
2261
+ ) })
2262
+ ] })
2263
+ ] }) })
2264
+ ] });
2265
+ }
2266
+ var RAG_IMAGE_PATH_REGEX2 = /^(?:https?:\/\/[^/\s]+)?\/api\/rag\/chunks\/[^"'\s]+\/image(?:[?#][^"'\s]*)?$/;
2267
+ function isUnresolvedRagImageSource2(src) {
2268
+ return RAG_IMAGE_PATH_REGEX2.test(src);
2269
+ }
2270
+ var frameStyle = {
2271
+ width: "min(100%, 32rem)",
2272
+ maxWidth: "100%"
2019
2273
  };
2020
- var NOOP_ASYNC = async () => {
2274
+ var imgStyle = {
2275
+ display: "block",
2276
+ width: "100%",
2277
+ height: "auto",
2278
+ maxWidth: "100%",
2279
+ maxHeight: "22rem",
2280
+ objectFit: "contain"
2021
2281
  };
2022
- var PaymanChat = react.forwardRef(function PaymanChat2({
2023
- config,
2024
- callbacks = {},
2025
- className,
2026
- style,
2027
- children,
2028
- onLoadMoreMessages,
2029
- isLoadingMoreMessages = false,
2030
- hasMoreMessages = false
2031
- }, ref) {
2032
- const [inputValue, setInputValue] = react.useState("");
2033
- const prevInputValueRef = react.useRef(inputValue);
2034
- const [hasEverSentMessage, setHasEverSentMessage] = react.useState(false);
2282
+ function MarkdownImageV2({
2283
+ src,
2284
+ alt,
2285
+ isResolving = false,
2286
+ onImageClick
2287
+ }) {
2288
+ const [isVisible, setIsVisible] = react.useState(false);
2289
+ const [isLoaded, setIsLoaded] = react.useState(false);
2290
+ const [hasError, setHasError] = react.useState(false);
2291
+ const [retryCount, setRetryCount] = react.useState(0);
2292
+ const sentinelRef = react.useRef(null);
2293
+ const isUnresolvedRag = react.useMemo(
2294
+ () => src ? isUnresolvedRagImageSource2(src) : false,
2295
+ [src]
2296
+ );
2297
+ const isResolvingRag = Boolean(isResolving && isUnresolvedRag);
2035
2298
  react.useEffect(() => {
2036
- if (config.sentryDsn) {
2037
- initSentryIfNeeded(config.sentryDsn);
2038
- }
2039
- }, [config.sentryDsn]);
2040
- const chat = paymanTypescriptAskSdk.useChat(config, callbacks);
2041
- const {
2042
- messages,
2043
- sendMessage,
2044
- isWaitingForResponse,
2045
- resetSession,
2046
- clearMessages,
2047
- prependMessages,
2048
- cancelStream,
2049
- getSessionId,
2050
- getMessages
2051
- } = chat;
2299
+ setIsLoaded(false);
2300
+ setHasError(false);
2301
+ setRetryCount(0);
2302
+ setIsVisible(false);
2303
+ }, [src]);
2052
2304
  react.useEffect(() => {
2053
- if (messages.length > 0 && !hasEverSentMessage) {
2054
- setHasEverSentMessage(true);
2055
- }
2056
- }, [messages.length, hasEverSentMessage]);
2057
- const userActionState = chat.userActionState ?? DEFAULT_USER_ACTION_STATE;
2058
- const approveUserAction = chat.approveUserAction ?? NOOP_ASYNC;
2059
- const rejectUserAction = chat.rejectUserAction ?? NOOP_ASYNC;
2060
- const resendOtp = chat.resendOtp ?? NOOP_ASYNC;
2061
- const isUserActionSupported = typeof chat.approveUserAction === "function" && typeof chat.rejectUserAction === "function" && typeof chat.resendOtp === "function";
2062
- const {
2063
- isAvailable: voiceAvailable,
2064
- isRecording,
2065
- startRecording,
2066
- stopRecording,
2067
- clearTranscript
2068
- } = paymanTypescriptAskSdk.useVoice(
2069
- {
2070
- lang: config.voiceLang || "en-US",
2071
- interimResults: config.voiceInterimResults !== false,
2072
- continuous: config.voiceContinuous !== false
2073
- },
2305
+ const el = sentinelRef.current;
2306
+ if (!el || !src) return;
2307
+ const observer = new IntersectionObserver(
2308
+ ([entry]) => {
2309
+ if (entry.isIntersecting) {
2310
+ setIsVisible(true);
2311
+ observer.disconnect();
2312
+ }
2313
+ },
2314
+ { rootMargin: "200px" }
2315
+ );
2316
+ observer.observe(el);
2317
+ return () => observer.disconnect();
2318
+ }, [src]);
2319
+ if (!src) return null;
2320
+ if (isResolvingRag) {
2321
+ return /* @__PURE__ */ jsxRuntime.jsx(
2322
+ "span",
2323
+ {
2324
+ className: cn("payman-v2-md-image", "payman-v2-md-image-resolving"),
2325
+ children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "payman-v2-md-image-resolving-inner", children: [
2326
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "payman-v2-md-image-loading", "aria-hidden": true }),
2327
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Loading image" }),
2328
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Reference image" })
2329
+ ] })
2330
+ }
2331
+ );
2332
+ }
2333
+ if (hasError) {
2334
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("payman-v2-md-image", "payman-v2-md-image-error"), children: [
2335
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ImageOff, { "aria-hidden": true }),
2336
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Unable to load image" }),
2337
+ alt ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: alt }) : null,
2338
+ retryCount < 3 ? /* @__PURE__ */ jsxRuntime.jsx(
2339
+ "button",
2340
+ {
2341
+ type: "button",
2342
+ className: "payman-v2-md-image-error-retry",
2343
+ onClick: () => {
2344
+ setHasError(false);
2345
+ setRetryCount((c) => c + 1);
2346
+ },
2347
+ children: "Retry"
2348
+ }
2349
+ ) : null
2350
+ ] });
2351
+ }
2352
+ const imgSrc = retryCount > 0 ? `${src}${src.includes("?") ? "&" : "?"}_r=${retryCount}` : src;
2353
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { ref: sentinelRef, className: "payman-v2-md-image", children: isVisible ? /* @__PURE__ */ jsxRuntime.jsxs(
2354
+ "button",
2074
2355
  {
2075
- onResult: (text) => {
2076
- setInputValue(text);
2356
+ type: "button",
2357
+ className: "payman-v2-md-image-button",
2358
+ onClick: () => {
2359
+ if (isLoaded && src) onImageClick?.(src, alt || "Image");
2077
2360
  },
2078
- onEnd: () => {
2361
+ disabled: !isLoaded,
2362
+ "aria-busy": !isLoaded,
2363
+ style: {
2364
+ ...frameStyle,
2365
+ ...!isLoaded ? { minHeight: "10rem" } : {}
2079
2366
  },
2080
- onError: (error) => {
2081
- console.error("Voice error:", error);
2082
- }
2367
+ children: [
2368
+ !isLoaded && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "payman-v2-md-image-placeholder", children: [
2369
+ /* @__PURE__ */ jsxRuntime.jsx(
2370
+ lucideReact.Loader2,
2371
+ {
2372
+ className: "payman-v2-md-image-loading",
2373
+ "aria-hidden": true
2374
+ }
2375
+ ),
2376
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Loading image\u2026" })
2377
+ ] }),
2378
+ /* @__PURE__ */ jsxRuntime.jsx(
2379
+ "img",
2380
+ {
2381
+ src: imgSrc,
2382
+ alt: alt || "",
2383
+ className: "payman-v2-md-image-img",
2384
+ style: {
2385
+ ...imgStyle,
2386
+ opacity: isLoaded ? 1 : 0
2387
+ },
2388
+ onLoad: () => {
2389
+ setHasError(false);
2390
+ setIsLoaded(true);
2391
+ },
2392
+ onError: () => {
2393
+ setIsLoaded(false);
2394
+ setHasError(true);
2395
+ }
2396
+ }
2397
+ ),
2398
+ isLoaded ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "payman-v2-md-image-overlay", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "payman-v2-md-image-overlay-icon", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, {}) }) }) : null
2399
+ ]
2400
+ }
2401
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
2402
+ "span",
2403
+ {
2404
+ className: "payman-v2-md-image-placeholder",
2405
+ style: { ...frameStyle, minHeight: "10rem" },
2406
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Image" })
2083
2407
  }
2408
+ ) });
2409
+ }
2410
+ function buildComponents(onImageClick, isResolvingImages) {
2411
+ return {
2412
+ p: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("p", { children }),
2413
+ code: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("code", { children }),
2414
+ pre: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-markdown-pre", children: /* @__PURE__ */ jsxRuntime.jsx("pre", { children }) }),
2415
+ ul: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("ul", { children }),
2416
+ ol: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("ol", { children }),
2417
+ li: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("li", { children }),
2418
+ h1: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("h1", { children }),
2419
+ h2: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("h2", { children }),
2420
+ h3: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("h3", { children }),
2421
+ strong: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("strong", { children }),
2422
+ em: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("em", { children }),
2423
+ blockquote: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("blockquote", { children }),
2424
+ hr: () => /* @__PURE__ */ jsxRuntime.jsx("hr", {}),
2425
+ a: ({ href, children }) => /* @__PURE__ */ jsxRuntime.jsx("a", { href, target: "_blank", rel: "noopener noreferrer", children }),
2426
+ img: ({ src, alt }) => /* @__PURE__ */ jsxRuntime.jsx(
2427
+ MarkdownImageV2,
2428
+ {
2429
+ src: typeof src === "string" ? src : void 0,
2430
+ alt: typeof alt === "string" ? alt : void 0,
2431
+ isResolving: isResolvingImages,
2432
+ onImageClick
2433
+ }
2434
+ ),
2435
+ table: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-markdown-table-wrapper", children: /* @__PURE__ */ jsxRuntime.jsx("table", { className: "payman-v2-markdown-table", children }) }),
2436
+ thead: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("thead", { className: "payman-v2-markdown-thead", children }),
2437
+ tbody: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "payman-v2-markdown-tbody", children }),
2438
+ th: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("th", { className: "payman-v2-markdown-th", children }),
2439
+ td: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("td", { className: "payman-v2-markdown-td", children })
2440
+ };
2441
+ }
2442
+ function MarkdownRendererV2({
2443
+ content,
2444
+ isStreaming,
2445
+ isResolvingImages,
2446
+ onImageClick
2447
+ }) {
2448
+ const components = react.useMemo(
2449
+ () => buildComponents(onImageClick, isResolvingImages),
2450
+ [onImageClick, isResolvingImages]
2084
2451
  );
2085
- const contextValue = react.useMemo(
2086
- () => ({
2087
- resetSession,
2088
- clearMessages,
2089
- prependMessages,
2090
- cancelStream,
2091
- getSessionId,
2092
- getMessages,
2093
- isWaitingForResponse
2094
- }),
2095
- [
2096
- resetSession,
2097
- clearMessages,
2098
- prependMessages,
2099
- cancelStream,
2100
- getSessionId,
2101
- getMessages,
2102
- isWaitingForResponse
2103
- ]
2452
+ return /* @__PURE__ */ jsxRuntime.jsx(
2453
+ "div",
2454
+ {
2455
+ className: cn(
2456
+ "payman-v2-markdown",
2457
+ isStreaming && "payman-v2-streaming-cursor"
2458
+ ),
2459
+ children: /* @__PURE__ */ jsxRuntime.jsx(ReactMarkdown__default.default, { remarkPlugins: [remarkGfm__default.default], components, children: content })
2460
+ }
2104
2461
  );
2105
- const { onExecutionTraceClick, onResetSession } = callbacks;
2106
- react.useImperativeHandle(ref, () => ({
2107
- resetSession: () => {
2108
- resetSession();
2109
- onResetSession?.();
2110
- },
2111
- clearMessages,
2112
- cancelStream,
2113
- getSessionId,
2114
- getMessages
2115
- }), [resetSession, clearMessages, cancelStream, getSessionId, getMessages, onResetSession]);
2116
- const {
2117
- placeholder = "Type your message...",
2118
- emptyStateText = "What can I help with?",
2119
- sessionParams,
2120
- disableInput = false,
2462
+ }
2463
+ var CURSOR_MESSAGES = [
2464
+ "Analyzing",
2465
+ "Processing",
2466
+ "Calculating",
2467
+ "Reviewing",
2468
+ "Verifying",
2469
+ "Assessing",
2470
+ "Evaluating",
2471
+ "Checking",
2472
+ "Planning",
2473
+ "Updating",
2474
+ "Validating",
2475
+ "Monitoring",
2476
+ "Optimizing",
2477
+ "Reconciling",
2478
+ "Forecasting",
2479
+ "Inspecting",
2480
+ "Organizing",
2481
+ "Sorting",
2482
+ "Scanning",
2483
+ "Balancing",
2484
+ "Summarizing",
2485
+ "Predicting",
2486
+ "Comparing",
2487
+ "Tracking",
2488
+ "Adjusting",
2489
+ "Examining",
2490
+ "Mapping",
2491
+ "Modeling",
2492
+ "Reporting",
2493
+ "Confirming"
2494
+ ];
2495
+ var FINAL_CURSOR_MESSAGE = "Finishing up";
2496
+ function parseThinkingContent(content) {
2497
+ const lines = content.split("\n");
2498
+ const out = [];
2499
+ for (const raw of lines) {
2500
+ const line = raw.trim();
2501
+ if (!line) continue;
2502
+ const stmt = line.match(/^\*\*(.+)\*\*$/);
2503
+ if (stmt) {
2504
+ out.push({ type: "statement", text: stmt[1].trim() });
2505
+ continue;
2506
+ }
2507
+ if (line.startsWith("\u2713 ")) {
2508
+ out.push({
2509
+ type: "status",
2510
+ variant: "success",
2511
+ text: line.slice(2).trim()
2512
+ });
2513
+ continue;
2514
+ }
2515
+ if (line.startsWith("\u2717 ")) {
2516
+ out.push({
2517
+ type: "status",
2518
+ variant: "error",
2519
+ text: line.slice(2).trim()
2520
+ });
2521
+ continue;
2522
+ }
2523
+ out.push({ type: "detail", text: line });
2524
+ }
2525
+ return out;
2526
+ }
2527
+ function ThinkingBlockV2({
2528
+ content,
2529
+ isStreaming,
2530
+ durationSec
2531
+ }) {
2532
+ const [open, setOpen] = react.useState(true);
2533
+ const [cursorIdx, setCursorIdx] = react.useState(0);
2534
+ const prevStreaming = react.useRef(isStreaming);
2535
+ const parsed = react.useMemo(() => parseThinkingContent(content), [content]);
2536
+ const isFinalizingPhase = react.useMemo(() => {
2537
+ const statements = parsed.filter(
2538
+ (l) => l.type === "statement"
2539
+ );
2540
+ return statements.length > 0 && statements[statements.length - 1].text === "Finalizing";
2541
+ }, [parsed]);
2542
+ react.useEffect(() => {
2543
+ if (prevStreaming.current && !isStreaming) {
2544
+ setOpen(false);
2545
+ }
2546
+ prevStreaming.current = isStreaming;
2547
+ }, [isStreaming]);
2548
+ react.useEffect(() => {
2549
+ if (!isStreaming || isFinalizingPhase) return;
2550
+ const id = window.setInterval(() => {
2551
+ setCursorIdx((i) => (i + 1) % CURSOR_MESSAGES.length);
2552
+ }, 4e3);
2553
+ return () => window.clearInterval(id);
2554
+ }, [isStreaming, isFinalizingPhase]);
2555
+ const headerLabel = isStreaming ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "payman-v2-thinking-shimmer", children: "Working on it\u2026" }) : durationSec !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2556
+ "Thought for ",
2557
+ durationSec,
2558
+ "s"
2559
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Thought" });
2560
+ const cursorKey = isFinalizingPhase ? "finalizing" : String(cursorIdx);
2561
+ const cursorText = isFinalizingPhase ? FINAL_CURSOR_MESSAGE : CURSOR_MESSAGES[cursorIdx];
2562
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-thinking", children: [
2563
+ /* @__PURE__ */ jsxRuntime.jsxs(
2564
+ "button",
2565
+ {
2566
+ type: "button",
2567
+ className: "payman-v2-thinking-toggle",
2568
+ onClick: () => setOpen((o) => !o),
2569
+ "aria-expanded": open,
2570
+ children: [
2571
+ /* @__PURE__ */ jsxRuntime.jsx(
2572
+ lucideReact.ChevronRight,
2573
+ {
2574
+ className: cn(
2575
+ "payman-v2-thinking-chevron",
2576
+ open && "payman-v2-thinking-chevron-open"
2577
+ ),
2578
+ "aria-hidden": true
2579
+ }
2580
+ ),
2581
+ headerLabel
2582
+ ]
2583
+ }
2584
+ ),
2585
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-thinking-border", children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: false, children: open && /* @__PURE__ */ jsxRuntime.jsx(
2586
+ framerMotion.motion.div,
2587
+ {
2588
+ className: "payman-v2-thinking-content",
2589
+ initial: { height: 0, opacity: 0 },
2590
+ animate: { height: "auto", opacity: 1 },
2591
+ exit: { height: 0, opacity: 0 },
2592
+ transition: { duration: 0.2, ease: "easeInOut" },
2593
+ style: { overflow: "hidden" },
2594
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2595
+ parsed.map((item, i) => {
2596
+ if (item.type === "statement") {
2597
+ return /* @__PURE__ */ jsxRuntime.jsx(
2598
+ "div",
2599
+ {
2600
+ className: "payman-v2-thinking-statement",
2601
+ children: item.text
2602
+ },
2603
+ i
2604
+ );
2605
+ }
2606
+ if (item.type === "detail") {
2607
+ return /* @__PURE__ */ jsxRuntime.jsx(
2608
+ "div",
2609
+ {
2610
+ className: "payman-v2-thinking-detail",
2611
+ children: item.text
2612
+ },
2613
+ i
2614
+ );
2615
+ }
2616
+ return /* @__PURE__ */ jsxRuntime.jsx(
2617
+ "span",
2618
+ {
2619
+ className: cn(
2620
+ "payman-v2-thinking-status",
2621
+ item.variant === "success" ? "payman-v2-thinking-status-success" : "payman-v2-thinking-status-error"
2622
+ ),
2623
+ children: item.text
2624
+ },
2625
+ i
2626
+ );
2627
+ }),
2628
+ isStreaming && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-thinking-cursor", children: [
2629
+ /* @__PURE__ */ jsxRuntime.jsx(
2630
+ "span",
2631
+ {
2632
+ className: "payman-v2-thinking-cursor-bar",
2633
+ "aria-hidden": true
2634
+ }
2635
+ ),
2636
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsxRuntime.jsx(
2637
+ framerMotion.motion.span,
2638
+ {
2639
+ className: "payman-v2-thinking-cursor-label",
2640
+ initial: { opacity: 0, y: 4 },
2641
+ animate: { opacity: 1, y: 0 },
2642
+ exit: { opacity: 0, y: -4 },
2643
+ transition: { duration: 0.2 },
2644
+ children: cursorText
2645
+ },
2646
+ cursorKey
2647
+ ) })
2648
+ ] })
2649
+ ] })
2650
+ },
2651
+ "thinking-content"
2652
+ ) }) })
2653
+ ] });
2654
+ }
2655
+ var THINKING_SPEED = {
2656
+ normal: [6, 8],
2657
+ fast: 1,
2658
+ punctuation: [20, 30],
2659
+ newline: [12, 18],
2660
+ idle: 30
2661
+ };
2662
+ var RESPONSE_SPEED = {
2663
+ normal: [4, 8],
2664
+ fast: 1,
2665
+ punctuation: [20, 30],
2666
+ newline: [10, 15],
2667
+ idle: 30
2668
+ };
2669
+ function charDelay(char, speed) {
2670
+ if (char === "*") return speed.fast;
2671
+ if (char === "\n") return speed.newline[0] + Math.random() * speed.newline[1];
2672
+ if (".!?,;:".includes(char))
2673
+ return speed.punctuation[0] + Math.random() * speed.punctuation[1];
2674
+ return speed.normal[0] + Math.random() * speed.normal[1];
2675
+ }
2676
+ function useTypingEffect(targetText, enabled, speed = RESPONSE_SPEED, initialDisplayedText) {
2677
+ const [displayedText, setDisplayedText] = react.useState("");
2678
+ const displayedRef = react.useRef("");
2679
+ const targetRef = react.useRef(targetText);
2680
+ const enabledRef = react.useRef(enabled);
2681
+ const initialDisplayedRef = react.useRef(initialDisplayedText);
2682
+ const timerRef = react.useRef(null);
2683
+ const runningRef = react.useRef(false);
2684
+ targetRef.current = targetText;
2685
+ enabledRef.current = enabled;
2686
+ initialDisplayedRef.current = initialDisplayedText;
2687
+ react.useEffect(() => {
2688
+ if (!enabled) {
2689
+ if (timerRef.current) {
2690
+ clearTimeout(timerRef.current);
2691
+ timerRef.current = null;
2692
+ }
2693
+ runningRef.current = false;
2694
+ displayedRef.current = targetText;
2695
+ setDisplayedText(targetText);
2696
+ return;
2697
+ }
2698
+ if (displayedRef.current.length === 0 && initialDisplayedRef.current && targetRef.current.startsWith(initialDisplayedRef.current)) {
2699
+ displayedRef.current = initialDisplayedRef.current;
2700
+ setDisplayedText(initialDisplayedRef.current);
2701
+ }
2702
+ if (runningRef.current) return;
2703
+ runningRef.current = true;
2704
+ const tick = () => {
2705
+ if (!enabledRef.current) {
2706
+ runningRef.current = false;
2707
+ return;
2708
+ }
2709
+ if (displayedRef.current.length < targetRef.current.length) {
2710
+ const nextChar = targetRef.current[displayedRef.current.length];
2711
+ displayedRef.current += nextChar;
2712
+ setDisplayedText(displayedRef.current);
2713
+ const delay = charDelay(nextChar, speed);
2714
+ timerRef.current = setTimeout(tick, delay);
2715
+ } else {
2716
+ timerRef.current = setTimeout(tick, speed.idle);
2717
+ }
2718
+ };
2719
+ tick();
2720
+ return () => {
2721
+ if (timerRef.current) {
2722
+ clearTimeout(timerRef.current);
2723
+ timerRef.current = null;
2724
+ }
2725
+ runningRef.current = false;
2726
+ };
2727
+ }, [enabled]);
2728
+ const isTyping = enabled && displayedRef.current.length < targetRef.current.length;
2729
+ return {
2730
+ displayedText: enabled ? displayedText : targetText,
2731
+ isTyping
2732
+ };
2733
+ }
2734
+ var INITIAL_THINKING_PLACEHOLDER = [
2735
+ "**Getting things ready**",
2736
+ "Putting things together"
2737
+ ].join("\n");
2738
+ function getFormattedThinking(message, includeInitialPlaceholder = false) {
2739
+ const plainThinkingText = message.allThinkingText || message.activeThinkingText || "";
2740
+ const baseText = message.formattedThinkingText || paymanTypescriptAskSdk.buildFormattedThinking(message.steps, plainThinkingText);
2741
+ if (includeInitialPlaceholder && baseText) {
2742
+ return INITIAL_THINKING_PLACEHOLDER + "\n" + baseText;
2743
+ }
2744
+ if (includeInitialPlaceholder) {
2745
+ return INITIAL_THINKING_PLACEHOLDER;
2746
+ }
2747
+ return baseText;
2748
+ }
2749
+ function AssistantMessageV2({
2750
+ message,
2751
+ onImageClick,
2752
+ onExecutionTraceClick,
2753
+ actions
2754
+ }) {
2755
+ const [copied, setCopied] = react.useState(false);
2756
+ const [toast, setToast] = react.useState(null);
2757
+ const copyResetTimerRef = react.useRef(null);
2758
+ const toastTimerRef = react.useRef(null);
2759
+ const showCopyAction = actions?.copy ?? true;
2760
+ const showTraceAction = (actions?.trace ?? true) && !!onExecutionTraceClick;
2761
+ const hasEverStreamed = react.useRef(!!message.isStreaming);
2762
+ const hasShownInitialThinking = react.useRef(
2763
+ message.streamProgress === "processing"
2764
+ );
2765
+ if (message.isStreaming) hasEverStreamed.current = true;
2766
+ react.useEffect(() => {
2767
+ return () => {
2768
+ if (copyResetTimerRef.current) clearTimeout(copyResetTimerRef.current);
2769
+ if (toastTimerRef.current) clearTimeout(toastTimerRef.current);
2770
+ };
2771
+ }, []);
2772
+ const rawResponseContent = (() => {
2773
+ const raw = message.isStreaming ? message.streamingContent || message.content : message.content;
2774
+ if (!raw) return "";
2775
+ return raw.replace(/\\n/g, "\n");
2776
+ })();
2777
+ const hasReadyStreamPhase = message.streamProgress === "processing" || Boolean(message.steps?.length) || Boolean(message.allThinkingText) || Boolean(message.activeThinkingText) || Boolean(rawResponseContent);
2778
+ if (hasReadyStreamPhase && !message.isError) {
2779
+ hasShownInitialThinking.current = true;
2780
+ }
2781
+ const includeInitialPlaceholder = hasShownInitialThinking.current && !message.isError;
2782
+ const rawThinkingContent = react.useMemo(
2783
+ () => getFormattedThinking(message, includeInitialPlaceholder),
2784
+ [message, includeInitialPlaceholder]
2785
+ );
2786
+ const isThinkingStreaming = !!message.isStreaming && !rawResponseContent && !message.isError;
2787
+ const { displayedText: thinkingContent } = useTypingEffect(
2788
+ rawThinkingContent,
2789
+ hasEverStreamed.current && isThinkingStreaming,
2790
+ THINKING_SPEED,
2791
+ includeInitialPlaceholder ? INITIAL_THINKING_PLACEHOLDER : void 0
2792
+ );
2793
+ const hasThinkingContent = Boolean(thinkingContent);
2794
+ const showThinkingBlock = hasThinkingContent || isThinkingStreaming;
2795
+ const showLegacyThinkingPhase = !!message.isStreaming && !message.isError && !rawResponseContent && message.streamProgress === "started";
2796
+ const responseTypingEnabled = hasEverStreamed.current && Boolean(rawResponseContent) && !message.isError;
2797
+ const { displayedText: displayContent, isTyping: isResponseTyping } = useTypingEffect(rawResponseContent, responseTypingEnabled, RESPONSE_SPEED);
2798
+ const thinkingDuration = (() => {
2799
+ if (!message.steps || message.steps.length === 0) return void 0;
2800
+ const first = message.steps[0];
2801
+ const last = message.steps[message.steps.length - 1];
2802
+ if (first.timestamp && last.timestamp) {
2803
+ return Math.round((last.timestamp - first.timestamp) / 1e3);
2804
+ }
2805
+ const total = message.steps.reduce((sum, s) => sum + (s.elapsedMs || 0), 0);
2806
+ return total > 0 ? Math.round(total / 1e3) : void 0;
2807
+ })();
2808
+ if (message.isError && !displayContent && !hasThinkingContent) {
2809
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-assistant-msg payman-v2-fade-in", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-assistant-msg-error", children: [
2810
+ /* @__PURE__ */ jsxRuntime.jsx(
2811
+ lucideReact.AlertCircle,
2812
+ {
2813
+ className: "payman-v2-assistant-msg-error-icon",
2814
+ style: { width: 16, height: 16 }
2815
+ }
2816
+ ),
2817
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-v2-assistant-msg-error-text", children: message.errorDetails || "Something went wrong. Please try again." }) })
2818
+ ] }) });
2819
+ }
2820
+ if (showLegacyThinkingPhase) {
2821
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-assistant-msg payman-v2-fade-in", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-v2-assistant-msg-thinking-only payman-v2-thinking-shimmer", children: "Working on it\u2026" }) });
2822
+ }
2823
+ const showToast = (label, tone) => {
2824
+ if (toastTimerRef.current) clearTimeout(toastTimerRef.current);
2825
+ setToast({ label, tone });
2826
+ toastTimerRef.current = setTimeout(() => setToast(null), 1800);
2827
+ };
2828
+ const handleCopy = async () => {
2829
+ try {
2830
+ if (!navigator.clipboard?.writeText) {
2831
+ throw new Error("Clipboard unavailable");
2832
+ }
2833
+ await navigator.clipboard.writeText(displayContent);
2834
+ if (copyResetTimerRef.current) clearTimeout(copyResetTimerRef.current);
2835
+ setCopied(true);
2836
+ copyResetTimerRef.current = setTimeout(() => setCopied(false), 1800);
2837
+ showToast("Copied to clipboard", "success");
2838
+ } catch {
2839
+ setCopied(false);
2840
+ showToast("Could not copy", "error");
2841
+ }
2842
+ };
2843
+ const handleTrace = () => {
2844
+ onExecutionTraceClick?.({
2845
+ message,
2846
+ tracingData: message.tracingData,
2847
+ executionId: message.executionId
2848
+ });
2849
+ };
2850
+ const hasPartialError = message.isError && displayContent;
2851
+ const isDone = !message.isStreaming && displayContent && !hasPartialError && !isResponseTyping;
2852
+ const hasVisibleDoneActions = showCopyAction || showTraceAction;
2853
+ const isCancelled = message.isCancelled;
2854
+ const toastPortal = typeof document !== "undefined" ? reactDom.createPortal(
2855
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: toast && /* @__PURE__ */ jsxRuntime.jsx(
2856
+ framerMotion.motion.div,
2857
+ {
2858
+ initial: { opacity: 0, y: -18, scale: 0.96 },
2859
+ animate: { opacity: 1, y: 0, scale: 1 },
2860
+ exit: { opacity: 0, y: -12, scale: 0.96 },
2861
+ transition: {
2862
+ type: "spring",
2863
+ stiffness: 360,
2864
+ damping: 26,
2865
+ mass: 0.7
2866
+ },
2867
+ className: "payman-v2-toast",
2868
+ role: "status",
2869
+ "aria-live": "polite",
2870
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
2871
+ "div",
2872
+ {
2873
+ className: cn(
2874
+ "payman-v2-toast-inner",
2875
+ toast.tone === "success" ? "payman-v2-toast-success" : "payman-v2-toast-error"
2876
+ ),
2877
+ children: [
2878
+ toast.tone === "success" ? /* @__PURE__ */ jsxRuntime.jsx(
2879
+ lucideReact.Check,
2880
+ {
2881
+ className: "h-4 w-4",
2882
+ style: { color: "#059669" }
2883
+ }
2884
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
2885
+ lucideReact.AlertCircle,
2886
+ {
2887
+ className: "h-4 w-4",
2888
+ style: { color: "#ef4444" }
2889
+ }
2890
+ ),
2891
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: toast.label })
2892
+ ]
2893
+ }
2894
+ )
2895
+ }
2896
+ ) }),
2897
+ document.body
2898
+ ) : null;
2899
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2900
+ toastPortal,
2901
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-assistant-msg payman-v2-fade-in", children: [
2902
+ showThinkingBlock && /* @__PURE__ */ jsxRuntime.jsx(
2903
+ ThinkingBlockV2,
2904
+ {
2905
+ content: thinkingContent,
2906
+ isStreaming: isThinkingStreaming,
2907
+ durationSec: thinkingDuration
2908
+ }
2909
+ ),
2910
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-assistant-msg-content-area", children: displayContent ? /* @__PURE__ */ jsxRuntime.jsx(
2911
+ MarkdownRendererV2,
2912
+ {
2913
+ content: displayContent,
2914
+ isStreaming: message.isStreaming && !isCancelled || isResponseTyping,
2915
+ isResolvingImages: message.isResolvingImages,
2916
+ onImageClick
2917
+ }
2918
+ ) : !isThinkingStreaming && !hasThinkingContent ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "payman-v2-assistant-msg-placeholder", children: "..." }) : null }),
2919
+ isCancelled && message.isStreaming && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-assistant-msg-paused", children: [
2920
+ /* @__PURE__ */ jsxRuntime.jsx(
2921
+ lucideReact.WifiOff,
2922
+ {
2923
+ style: { width: 14, height: 14, color: "rgba(217, 119, 6, 0.7)", flexShrink: 0 }
2924
+ }
2925
+ ),
2926
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-v2-assistant-msg-paused-text", children: "Connection slow - resuming\u2026" })
2927
+ ] }),
2928
+ hasPartialError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-assistant-msg-partial-error", children: [
2929
+ /* @__PURE__ */ jsxRuntime.jsx(
2930
+ lucideReact.AlertCircle,
2931
+ {
2932
+ className: "payman-v2-assistant-msg-error-icon",
2933
+ style: { width: 16, height: 16 }
2934
+ }
2935
+ ),
2936
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-v2-assistant-msg-error-text", children: message.errorDetails || "The response was interrupted." }) })
2937
+ ] }),
2938
+ isDone && hasVisibleDoneActions && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-assistant-msg-actions", children: [
2939
+ showCopyAction && /* @__PURE__ */ jsxRuntime.jsx(ActionTooltipV2, { label: "Copy", children: /* @__PURE__ */ jsxRuntime.jsx(
2940
+ "button",
2941
+ {
2942
+ onClick: () => void handleCopy(),
2943
+ className: cn(
2944
+ "payman-v2-assistant-msg-action-btn",
2945
+ copied && "payman-v2-assistant-msg-action-btn-active"
2946
+ ),
2947
+ "aria-label": "Copy",
2948
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { style: { width: 16, height: 16 } }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { style: { width: 16, height: 16 } })
2949
+ }
2950
+ ) }),
2951
+ showTraceAction && /* @__PURE__ */ jsxRuntime.jsx(ActionTooltipV2, { label: "Trace", children: /* @__PURE__ */ jsxRuntime.jsx(
2952
+ "button",
2953
+ {
2954
+ onClick: handleTrace,
2955
+ className: "payman-v2-assistant-msg-action-btn",
2956
+ "aria-label": "Trace response",
2957
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchCode, { style: { width: 16, height: 16 } })
2958
+ }
2959
+ ) })
2960
+ ] })
2961
+ ] })
2962
+ ] });
2963
+ }
2964
+ var DEFAULT_MAX_LENGTH2 = 6;
2965
+ var MAX_SUPPORTED_LENGTH2 = 12;
2966
+ var AUTO_FOCUS_DELAY_MS2 = 250;
2967
+ function OtpInputV2({
2968
+ value,
2969
+ onChange,
2970
+ maxLength,
2971
+ disabled = false,
2972
+ error = false
2973
+ }) {
2974
+ const inputRefs = react.useRef([]);
2975
+ const safeMaxLength = Number.isInteger(maxLength) && maxLength > 0 ? Math.min(maxLength, MAX_SUPPORTED_LENGTH2) : DEFAULT_MAX_LENGTH2;
2976
+ const digits = value.split("").concat(Array(safeMaxLength).fill("")).slice(0, safeMaxLength);
2977
+ react.useEffect(() => {
2978
+ if (disabled) return;
2979
+ const timer = window.setTimeout(() => {
2980
+ inputRefs.current[0]?.focus();
2981
+ }, AUTO_FOCUS_DELAY_MS2);
2982
+ return () => window.clearTimeout(timer);
2983
+ }, [disabled]);
2984
+ const focusInput = (index) => {
2985
+ if (index >= 0 && index < safeMaxLength) {
2986
+ inputRefs.current[index]?.focus();
2987
+ }
2988
+ };
2989
+ const updateValue = (newDigits) => {
2990
+ onChange(newDigits.join("").slice(0, safeMaxLength));
2991
+ };
2992
+ const handleChange = (index, char) => {
2993
+ if (char && !/^\d$/.test(char)) return;
2994
+ const newDigits = [...digits];
2995
+ newDigits[index] = char;
2996
+ updateValue(newDigits);
2997
+ if (char && index < safeMaxLength - 1) focusInput(index + 1);
2998
+ };
2999
+ const handleKeyDown = (index, e) => {
3000
+ if (e.key === "Enter") {
3001
+ e.preventDefault();
3002
+ return;
3003
+ }
3004
+ if (e.key === "Backspace") {
3005
+ e.preventDefault();
3006
+ if (digits[index]) {
3007
+ const newDigits = [...digits];
3008
+ newDigits[index] = "";
3009
+ updateValue(newDigits);
3010
+ } else if (index > 0) {
3011
+ const newDigits = [...digits];
3012
+ newDigits[index - 1] = "";
3013
+ updateValue(newDigits);
3014
+ focusInput(index - 1);
3015
+ }
3016
+ return;
3017
+ }
3018
+ if (e.key === "ArrowLeft") {
3019
+ e.preventDefault();
3020
+ focusInput(index - 1);
3021
+ } else if (e.key === "ArrowRight") {
3022
+ e.preventDefault();
3023
+ focusInput(index + 1);
3024
+ }
3025
+ };
3026
+ const handlePaste = (e) => {
3027
+ e.preventDefault();
3028
+ const pasted = e.clipboardData.getData("text").replace(/\D/g, "").slice(0, safeMaxLength);
3029
+ if (!pasted) return;
3030
+ const newDigits = pasted.split("").concat(Array(safeMaxLength).fill("")).slice(0, safeMaxLength);
3031
+ updateValue(newDigits);
3032
+ focusInput(Math.min(pasted.length, safeMaxLength - 1));
3033
+ };
3034
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("payman-v2-otp", error && "payman-v2-shake"), children: digits.map((digit, i) => /* @__PURE__ */ jsxRuntime.jsx(
3035
+ "input",
3036
+ {
3037
+ ref: (el) => {
3038
+ inputRefs.current[i] = el;
3039
+ },
3040
+ type: "text",
3041
+ inputMode: "numeric",
3042
+ maxLength: 1,
3043
+ value: digit,
3044
+ disabled,
3045
+ onChange: (e) => handleChange(i, e.target.value.slice(-1)),
3046
+ onKeyDown: (e) => handleKeyDown(i, e),
3047
+ onPaste: handlePaste,
3048
+ onFocus: (e) => e.target.select(),
3049
+ "aria-label": `Digit ${i + 1}`,
3050
+ className: cn(
3051
+ "payman-v2-otp-digit",
3052
+ digit && "payman-v2-otp-digit-filled",
3053
+ error && "payman-v2-otp-digit-error"
3054
+ )
3055
+ },
3056
+ i
3057
+ )) });
3058
+ }
3059
+ var RESEND_COOLDOWN_S = 30;
3060
+ var OTP_LEN = 6;
3061
+ function VerificationCardV2({
3062
+ messageId,
3063
+ action,
3064
+ status,
3065
+ onApprove,
3066
+ onReject,
3067
+ onResend
3068
+ }) {
3069
+ const [otp, setOtp] = react.useState("");
3070
+ const [otpErrored, setOtpErrored] = react.useState(false);
3071
+ const [resendSec, setResendSec] = react.useState(0);
3072
+ const lastSubmittedRef = react.useRef(null);
3073
+ const resendTimerRef = react.useRef(void 0);
3074
+ react.useEffect(() => {
3075
+ if (status !== "error") {
3076
+ setOtpErrored(false);
3077
+ return;
3078
+ }
3079
+ setOtpErrored(true);
3080
+ const t = window.setTimeout(() => {
3081
+ setOtp("");
3082
+ setOtpErrored(false);
3083
+ lastSubmittedRef.current = null;
3084
+ }, 600);
3085
+ return () => window.clearTimeout(t);
3086
+ }, [status]);
3087
+ react.useEffect(() => {
3088
+ if (otp.length < OTP_LEN) {
3089
+ lastSubmittedRef.current = null;
3090
+ }
3091
+ }, [otp]);
3092
+ react.useEffect(() => {
3093
+ if (otp.length !== OTP_LEN || !/^\d+$/.test(otp) || status !== "pending") {
3094
+ return;
3095
+ }
3096
+ if (lastSubmittedRef.current === otp) return;
3097
+ lastSubmittedRef.current = otp;
3098
+ void onApprove(messageId, otp);
3099
+ }, [messageId, onApprove, otp, status]);
3100
+ react.useEffect(() => {
3101
+ return () => {
3102
+ if (typeof resendTimerRef.current === "number") {
3103
+ window.clearInterval(resendTimerRef.current);
3104
+ }
3105
+ };
3106
+ }, []);
3107
+ const startResendCooldown = react.useCallback(() => {
3108
+ setResendSec(RESEND_COOLDOWN_S);
3109
+ if (typeof resendTimerRef.current === "number") {
3110
+ window.clearInterval(resendTimerRef.current);
3111
+ }
3112
+ resendTimerRef.current = window.setInterval(() => {
3113
+ setResendSec((s) => {
3114
+ if (s <= 1) {
3115
+ if (typeof resendTimerRef.current === "number") {
3116
+ window.clearInterval(resendTimerRef.current);
3117
+ resendTimerRef.current = void 0;
3118
+ }
3119
+ return 0;
3120
+ }
3121
+ return s - 1;
3122
+ });
3123
+ }, 1e3);
3124
+ }, []);
3125
+ const handleResend = react.useCallback(async () => {
3126
+ if (resendSec > 0 || status === "verifying") return;
3127
+ await onResend(messageId);
3128
+ startResendCooldown();
3129
+ }, [messageId, onResend, resendSec, startResendCooldown, status]);
3130
+ const handleCancel = react.useCallback(async () => {
3131
+ await onReject(messageId);
3132
+ }, [messageId, onReject]);
3133
+ const busy = status === "verifying";
3134
+ if (status === "approved" || status === "rejected") {
3135
+ return null;
3136
+ }
3137
+ return /* @__PURE__ */ jsxRuntime.jsx(
3138
+ framerMotion.motion.div,
3139
+ {
3140
+ className: "payman-v2-verification",
3141
+ initial: { opacity: 0, y: 10 },
3142
+ animate: { opacity: 1, y: 0 },
3143
+ transition: { type: "spring", stiffness: 320, damping: 28 },
3144
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-verification-card", children: [
3145
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-verification-header", children: [
3146
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-verification-header-row", children: [
3147
+ /* @__PURE__ */ jsxRuntime.jsx(
3148
+ lucideReact.ShieldCheck,
3149
+ {
3150
+ className: "payman-v2-verification-icon",
3151
+ size: 18,
3152
+ strokeWidth: 1.75,
3153
+ "aria-hidden": true
3154
+ }
3155
+ ),
3156
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-v2-verification-title", children: "Verify" }),
3157
+ action.amount != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "payman-v2-verification-amount", children: action.amount }) : action.payeeName ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "payman-v2-verification-payee", children: action.payeeName }) : null
3158
+ ] }),
3159
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-v2-verification-description", children: "Enter the 6-digit code sent to your phone" }),
3160
+ /* @__PURE__ */ jsxRuntime.jsx(
3161
+ OtpInputV2,
3162
+ {
3163
+ value: otp,
3164
+ onChange: setOtp,
3165
+ maxLength: OTP_LEN,
3166
+ disabled: busy,
3167
+ error: otpErrored
3168
+ }
3169
+ ),
3170
+ busy ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-verification-submitting", children: [
3171
+ /* @__PURE__ */ jsxRuntime.jsx(
3172
+ framerMotion.motion.span,
3173
+ {
3174
+ "aria-hidden": true,
3175
+ style: { display: "inline-flex" },
3176
+ animate: { rotate: 360 },
3177
+ transition: {
3178
+ repeat: Infinity,
3179
+ duration: 0.7,
3180
+ ease: "linear"
3181
+ },
3182
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { size: 14, strokeWidth: 2 })
3183
+ }
3184
+ ),
3185
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "payman-v2-verification-submitting-text", children: "Verifying..." })
3186
+ ] }) : null
3187
+ ] }),
3188
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-verification-actions", children: [
3189
+ /* @__PURE__ */ jsxRuntime.jsxs(
3190
+ "button",
3191
+ {
3192
+ type: "button",
3193
+ className: "payman-v2-verification-resend-btn",
3194
+ disabled: busy || resendSec > 0,
3195
+ onClick: () => void handleResend(),
3196
+ children: [
3197
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { size: 12, strokeWidth: 2, "aria-hidden": true }),
3198
+ resendSec > 0 ? `Resend (${resendSec}s)` : "Resend"
3199
+ ]
3200
+ }
3201
+ ),
3202
+ /* @__PURE__ */ jsxRuntime.jsx(
3203
+ "button",
3204
+ {
3205
+ type: "button",
3206
+ className: "payman-v2-verification-cancel-btn",
3207
+ disabled: busy,
3208
+ onClick: () => void handleCancel(),
3209
+ children: "Cancel"
3210
+ }
3211
+ )
3212
+ ] })
3213
+ ] })
3214
+ }
3215
+ );
3216
+ }
3217
+ var SCROLL_THRESHOLD2 = 100;
3218
+ var MessageListV2 = react.forwardRef(
3219
+ function MessageListV22({
3220
+ messages,
3221
+ isStreaming: _isStreaming = false,
3222
+ onEditUserMessage,
3223
+ onRetryUserMessage,
3224
+ onImageClick,
3225
+ onExecutionTraceClick,
3226
+ messageActions,
3227
+ retryDisabled = false,
3228
+ userAction,
3229
+ onApproveAction,
3230
+ onRejectAction,
3231
+ onResendAction
3232
+ }, ref) {
3233
+ const scrollRef = react.useRef(null);
3234
+ const scrollInnerRef = react.useRef(null);
3235
+ const isNearBottomRef = react.useRef(true);
3236
+ const [showScrollBtn, setShowScrollBtn] = react.useState(false);
3237
+ const prevCountRef = react.useRef(messages.length);
3238
+ const pauseStickUntilUserMessageRef = react.useRef(false);
3239
+ const followingBottomRef = react.useRef(true);
3240
+ const isProgrammaticScrollRef = react.useRef(false);
3241
+ const getDistanceFromBottom = react.useCallback(() => {
3242
+ const el = scrollRef.current;
3243
+ if (!el) return 0;
3244
+ return el.scrollHeight - el.scrollTop - el.clientHeight;
3245
+ }, []);
3246
+ const scrollToBottom = react.useCallback(
3247
+ (behavior = "smooth") => {
3248
+ const el = scrollRef.current;
3249
+ if (!el) return;
3250
+ isProgrammaticScrollRef.current = true;
3251
+ pauseStickUntilUserMessageRef.current = false;
3252
+ followingBottomRef.current = true;
3253
+ el.scrollTo({ top: el.scrollHeight, behavior });
3254
+ const clear = () => {
3255
+ isProgrammaticScrollRef.current = false;
3256
+ };
3257
+ if (behavior === "instant") {
3258
+ requestAnimationFrame(clear);
3259
+ } else {
3260
+ setTimeout(clear, 400);
3261
+ }
3262
+ },
3263
+ []
3264
+ );
3265
+ react.useImperativeHandle(
3266
+ ref,
3267
+ () => ({
3268
+ scrollToBottom: (behavior = "smooth") => {
3269
+ isNearBottomRef.current = true;
3270
+ pauseStickUntilUserMessageRef.current = false;
3271
+ followingBottomRef.current = true;
3272
+ setShowScrollBtn(false);
3273
+ scrollToBottom(behavior);
3274
+ }
3275
+ }),
3276
+ [scrollToBottom]
3277
+ );
3278
+ const handleScroll = react.useCallback(() => {
3279
+ const distance = getDistanceFromBottom();
3280
+ const nearBottom = distance <= SCROLL_THRESHOLD2;
3281
+ isNearBottomRef.current = nearBottom;
3282
+ setShowScrollBtn(!nearBottom);
3283
+ if (isProgrammaticScrollRef.current) return;
3284
+ if (!nearBottom) {
3285
+ followingBottomRef.current = false;
3286
+ pauseStickUntilUserMessageRef.current = true;
3287
+ }
3288
+ }, [getDistanceFromBottom]);
3289
+ react.useEffect(() => {
3290
+ const prevCount = prevCountRef.current;
3291
+ prevCountRef.current = messages.length;
3292
+ if (messages.length > prevCount) {
3293
+ const last = messages[messages.length - 1];
3294
+ if (last?.role === "user") {
3295
+ pauseStickUntilUserMessageRef.current = false;
3296
+ followingBottomRef.current = true;
3297
+ requestAnimationFrame(() => scrollToBottom());
3298
+ } else if (!pauseStickUntilUserMessageRef.current && followingBottomRef.current) {
3299
+ requestAnimationFrame(() => scrollToBottom("instant"));
3300
+ }
3301
+ }
3302
+ }, [messages.length, scrollToBottom]);
3303
+ react.useEffect(() => {
3304
+ const lastMsg = messages[messages.length - 1];
3305
+ if (!lastMsg?.isStreaming) return;
3306
+ if (pauseStickUntilUserMessageRef.current) return;
3307
+ if (!followingBottomRef.current) return;
3308
+ const el = scrollRef.current;
3309
+ if (!el) return;
3310
+ isProgrammaticScrollRef.current = true;
3311
+ el.scrollTop = el.scrollHeight;
3312
+ requestAnimationFrame(() => {
3313
+ isProgrammaticScrollRef.current = false;
3314
+ });
3315
+ });
3316
+ react.useEffect(() => {
3317
+ const inner = scrollInnerRef.current;
3318
+ if (!inner) return;
3319
+ const pinIfFollowing = () => {
3320
+ if (pauseStickUntilUserMessageRef.current) return;
3321
+ if (!followingBottomRef.current) return;
3322
+ const el = scrollRef.current;
3323
+ if (!el) return;
3324
+ isProgrammaticScrollRef.current = true;
3325
+ el.scrollTop = el.scrollHeight;
3326
+ requestAnimationFrame(() => {
3327
+ isProgrammaticScrollRef.current = false;
3328
+ });
3329
+ };
3330
+ const ro = new ResizeObserver(() => {
3331
+ pinIfFollowing();
3332
+ });
3333
+ ro.observe(inner);
3334
+ return () => ro.disconnect();
3335
+ }, []);
3336
+ react.useEffect(() => {
3337
+ if (messages.length > 0) {
3338
+ setTimeout(() => scrollToBottom("instant"), 50);
3339
+ }
3340
+ }, []);
3341
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-message-list", children: [
3342
+ /* @__PURE__ */ jsxRuntime.jsx(
3343
+ "div",
3344
+ {
3345
+ ref: scrollRef,
3346
+ onScroll: handleScroll,
3347
+ className: "payman-v2-message-scroll payman-v2-scrollbar",
3348
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
3349
+ "div",
3350
+ {
3351
+ ref: scrollInnerRef,
3352
+ className: "payman-v2-message-scroll-inner",
3353
+ children: [
3354
+ messages.map((message) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: message.role === "user" ? /* @__PURE__ */ jsxRuntime.jsx(
3355
+ UserMessageV2,
3356
+ {
3357
+ message,
3358
+ onEdit: onEditUserMessage,
3359
+ onRetry: onRetryUserMessage,
3360
+ retryDisabled,
3361
+ actions: messageActions?.userMessageActions
3362
+ }
3363
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
3364
+ AssistantMessageV2,
3365
+ {
3366
+ message,
3367
+ onImageClick,
3368
+ onExecutionTraceClick,
3369
+ actions: messageActions?.assistantMessageActions
3370
+ }
3371
+ ) }, message.id)),
3372
+ userAction && userAction.status !== "approved" && userAction.status !== "rejected" && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
3373
+ VerificationCardV2,
3374
+ {
3375
+ messageId: userAction.messageId,
3376
+ action: userAction.action,
3377
+ status: userAction.status,
3378
+ onApprove: onApproveAction ?? (async () => {
3379
+ }),
3380
+ onReject: onRejectAction ?? (async () => {
3381
+ }),
3382
+ onResend: onResendAction ?? (async () => {
3383
+ })
3384
+ }
3385
+ ) })
3386
+ ]
3387
+ }
3388
+ )
3389
+ }
3390
+ ),
3391
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showScrollBtn && /* @__PURE__ */ jsxRuntime.jsx(
3392
+ framerMotion.motion.div,
3393
+ {
3394
+ initial: { opacity: 0, y: 6 },
3395
+ animate: { opacity: 1, y: 0 },
3396
+ exit: { opacity: 0, y: 6 },
3397
+ transition: { duration: 0.12 },
3398
+ className: "payman-v2-scroll-to-bottom",
3399
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3400
+ "button",
3401
+ {
3402
+ onClick: () => {
3403
+ scrollToBottom();
3404
+ },
3405
+ className: "payman-v2-scroll-to-bottom-btn",
3406
+ "aria-label": "Scroll to bottom",
3407
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, { style: { width: 16, height: 16 } })
3408
+ }
3409
+ )
3410
+ }
3411
+ ) })
3412
+ ] });
3413
+ }
3414
+ );
3415
+ var ChatInputV2 = react.forwardRef(
3416
+ function ChatInputV22({
3417
+ onSend,
3418
+ onCancel,
3419
+ disabled = false,
3420
+ isStreaming = false,
3421
+ placeholder = "Reply...",
3422
+ enableVoice = false,
3423
+ voiceAvailable = false,
3424
+ isRecording = false,
3425
+ onVoicePress,
3426
+ transcribedText = "",
3427
+ showResetSession = false,
3428
+ onResetSession,
3429
+ showAttachmentButton = true,
3430
+ showUploadImageButton = true,
3431
+ showAttachFileButton = true,
3432
+ onUploadImageClick,
3433
+ onAttachFileClick,
3434
+ editingMessageId = null,
3435
+ onClearEditing
3436
+ }, ref) {
3437
+ const [value, setValue] = react.useState("");
3438
+ const [isFocused, setIsFocused] = react.useState(false);
3439
+ const [showActions, setShowActions] = react.useState(false);
3440
+ const [showVoiceTooltip, setShowVoiceTooltip] = react.useState(false);
3441
+ const textareaRef = react.useRef(null);
3442
+ const actionsRef = react.useRef(null);
3443
+ const preRecordTextRef = react.useRef("");
3444
+ const voiceTooltipTimerRef = react.useRef(
3445
+ null
3446
+ );
3447
+ const voiceDraftSyncActiveRef = react.useRef(false);
3448
+ const isInputLocked = disabled || isRecording;
3449
+ const hasAttachmentOptions = showUploadImageButton || showAttachFileButton;
3450
+ const showAttachmentMenuButton = showAttachmentButton && hasAttachmentOptions;
3451
+ const showVoiceButton = enableVoice && onVoicePress != null;
3452
+ const isVoiceButtonDisabled = disabled || !voiceAvailable;
3453
+ react.useEffect(() => {
3454
+ if (textareaRef.current) {
3455
+ textareaRef.current.style.height = "auto";
3456
+ const scrollHeight = textareaRef.current.scrollHeight;
3457
+ textareaRef.current.style.height = `${Math.min(scrollHeight, 200)}px`;
3458
+ }
3459
+ }, [value]);
3460
+ react.useEffect(() => {
3461
+ if (disabled) {
3462
+ setIsFocused(false);
3463
+ setShowActions(false);
3464
+ textareaRef.current?.blur();
3465
+ return;
3466
+ }
3467
+ const frameId = requestAnimationFrame(() => textareaRef.current?.focus());
3468
+ return () => cancelAnimationFrame(frameId);
3469
+ }, [disabled]);
3470
+ react.useImperativeHandle(
3471
+ ref,
3472
+ () => ({
3473
+ setDraft: (message) => {
3474
+ setShowActions(false);
3475
+ setValue(message);
3476
+ requestAnimationFrame(() => {
3477
+ const textarea = textareaRef.current;
3478
+ if (!textarea || disabled) return;
3479
+ textarea.focus();
3480
+ const end = message.length;
3481
+ textarea.setSelectionRange(end, end);
3482
+ });
3483
+ }
3484
+ }),
3485
+ [disabled]
3486
+ );
3487
+ react.useEffect(() => {
3488
+ if (!showActions) return;
3489
+ const handleClickOutside = (e) => {
3490
+ if (actionsRef.current && !actionsRef.current.contains(e.target)) {
3491
+ setShowActions(false);
3492
+ }
3493
+ };
3494
+ document.addEventListener("mousedown", handleClickOutside);
3495
+ return () => document.removeEventListener("mousedown", handleClickOutside);
3496
+ }, [showActions]);
3497
+ react.useEffect(() => {
3498
+ if (!showAttachmentMenuButton) {
3499
+ setShowActions(false);
3500
+ }
3501
+ }, [showAttachmentMenuButton]);
3502
+ react.useEffect(() => {
3503
+ return () => {
3504
+ if (voiceTooltipTimerRef.current) {
3505
+ clearTimeout(voiceTooltipTimerRef.current);
3506
+ }
3507
+ };
3508
+ }, []);
3509
+ react.useEffect(() => {
3510
+ if (!voiceDraftSyncActiveRef.current) return;
3511
+ const base = preRecordTextRef.current;
3512
+ const separator = base && !base.endsWith(" ") && transcribedText ? " " : "";
3513
+ setValue(`${base}${separator}${transcribedText}`);
3514
+ }, [isRecording, transcribedText]);
3515
+ const handleSend = react.useCallback(() => {
3516
+ if (!value.trim() || disabled) return;
3517
+ voiceDraftSyncActiveRef.current = false;
3518
+ preRecordTextRef.current = "";
3519
+ onClearEditing?.();
3520
+ onSend(value.trim());
3521
+ setValue("");
3522
+ requestAnimationFrame(() => {
3523
+ if (textareaRef.current) {
3524
+ textareaRef.current.style.height = "auto";
3525
+ textareaRef.current.focus();
3526
+ }
3527
+ });
3528
+ }, [value, disabled, onClearEditing, onSend]);
3529
+ const handleKeyDown = (e) => {
3530
+ if (e.key === "Enter" && !e.shiftKey) {
3531
+ e.preventDefault();
3532
+ if (isStreaming) return;
3533
+ handleSend();
3534
+ }
3535
+ };
3536
+ const handleUploadImageClick = () => {
3537
+ onUploadImageClick?.();
3538
+ setShowActions(false);
3539
+ };
3540
+ const handleAttachFileClick = () => {
3541
+ onAttachFileClick?.();
3542
+ setShowActions(false);
3543
+ };
3544
+ const hideVoiceTooltip = react.useCallback(() => {
3545
+ if (voiceTooltipTimerRef.current) {
3546
+ clearTimeout(voiceTooltipTimerRef.current);
3547
+ voiceTooltipTimerRef.current = null;
3548
+ }
3549
+ setShowVoiceTooltip(false);
3550
+ }, []);
3551
+ const startVoiceTooltipTimer = react.useCallback(() => {
3552
+ if (isVoiceButtonDisabled || isRecording) return;
3553
+ if (voiceTooltipTimerRef.current) {
3554
+ clearTimeout(voiceTooltipTimerRef.current);
3555
+ }
3556
+ voiceTooltipTimerRef.current = setTimeout(() => {
3557
+ setShowVoiceTooltip(true);
3558
+ voiceTooltipTimerRef.current = null;
3559
+ }, 2e3);
3560
+ }, [isRecording, isVoiceButtonDisabled]);
3561
+ const handleVoiceToggle = () => {
3562
+ hideVoiceTooltip();
3563
+ setShowActions(false);
3564
+ if (!onVoicePress || isVoiceButtonDisabled) return;
3565
+ if (!isRecording) {
3566
+ preRecordTextRef.current = value;
3567
+ voiceDraftSyncActiveRef.current = true;
3568
+ }
3569
+ onVoicePress();
3570
+ };
3571
+ const canSend = value.trim().length > 0 && !disabled;
3572
+ const sendDisabled = !canSend || isStreaming;
3573
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-input-container", children: [
3574
+ /* @__PURE__ */ jsxRuntime.jsxs(
3575
+ "div",
3576
+ {
3577
+ className: cn(
3578
+ "payman-v2-input-wrapper",
3579
+ (isFocused || isRecording) && "payman-v2-input-wrapper-focused"
3580
+ ),
3581
+ children: [
3582
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-input-body", children: [
3583
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: false, children: editingMessageId && /* @__PURE__ */ jsxRuntime.jsxs(
3584
+ framerMotion.motion.div,
3585
+ {
3586
+ initial: { opacity: 0, y: -4 },
3587
+ animate: { opacity: 1, y: 0 },
3588
+ exit: { opacity: 0, y: -4 },
3589
+ transition: { duration: 0.14, ease: "easeOut" },
3590
+ className: "payman-v2-input-editing-banner",
3591
+ children: [
3592
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-input-editing-banner-info", children: [
3593
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "payman-v2-input-editing-icon-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { style: { width: 12, height: 12 } }) }),
3594
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-v2-input-editing-label", children: "Editing message" })
3595
+ ] }),
3596
+ onClearEditing && /* @__PURE__ */ jsxRuntime.jsx(
3597
+ "button",
3598
+ {
3599
+ type: "button",
3600
+ onClick: onClearEditing,
3601
+ className: "payman-v2-input-editing-close",
3602
+ "aria-label": "Stop editing message",
3603
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { style: { width: 14, height: 14 } })
3604
+ }
3605
+ )
3606
+ ]
3607
+ }
3608
+ ) }),
3609
+ /* @__PURE__ */ jsxRuntime.jsx(
3610
+ "textarea",
3611
+ {
3612
+ ref: textareaRef,
3613
+ value,
3614
+ onChange: (e) => {
3615
+ if (isRecording) return;
3616
+ const nextValue = e.target.value;
3617
+ voiceDraftSyncActiveRef.current = false;
3618
+ setValue(nextValue);
3619
+ if (editingMessageId && nextValue.length === 0) {
3620
+ onClearEditing?.();
3621
+ }
3622
+ },
3623
+ onKeyDown: handleKeyDown,
3624
+ onFocus: () => {
3625
+ if (!disabled) setIsFocused(true);
3626
+ },
3627
+ onBlur: () => setIsFocused(false),
3628
+ onMouseDown: (e) => {
3629
+ if (disabled) e.preventDefault();
3630
+ },
3631
+ "aria-disabled": disabled,
3632
+ readOnly: isInputLocked,
3633
+ tabIndex: disabled ? -1 : 0,
3634
+ placeholder: isRecording ? "Listening\u2026" : placeholder,
3635
+ className: "payman-v2-input-textarea",
3636
+ "data-disabled": disabled ? "true" : "false",
3637
+ rows: 1
3638
+ }
3639
+ )
3640
+ ] }),
3641
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-input-controls", children: [
3642
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-input-controls-left", children: [
3643
+ showResetSession && onResetSession && /* @__PURE__ */ jsxRuntime.jsxs(
3644
+ "button",
3645
+ {
3646
+ type: "button",
3647
+ onClick: onResetSession,
3648
+ disabled: isStreaming || isRecording,
3649
+ className: "payman-v2-input-new-session-btn",
3650
+ "aria-label": "New Session",
3651
+ title: "New Session",
3652
+ children: [
3653
+ /* @__PURE__ */ jsxRuntime.jsx(
3654
+ lucideReact.RotateCcw,
3655
+ {
3656
+ style: { width: 16, height: 16, strokeWidth: 2.25 }
3657
+ }
3658
+ ),
3659
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "payman-v2-input-new-session-tooltip", children: "New Session" })
3660
+ ]
3661
+ }
3662
+ ),
3663
+ showAttachmentMenuButton && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative" }, ref: actionsRef, children: [
3664
+ /* @__PURE__ */ jsxRuntime.jsx(
3665
+ "button",
3666
+ {
3667
+ type: "button",
3668
+ onClick: () => setShowActions((current) => !current),
3669
+ disabled: disabled || isRecording,
3670
+ className: cn(
3671
+ "payman-v2-input-attach-btn",
3672
+ showActions && "payman-v2-input-attach-btn-active"
3673
+ ),
3674
+ "aria-label": "Attach",
3675
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3676
+ lucideReact.Plus,
3677
+ {
3678
+ style: { width: 20, height: 20, strokeWidth: 2 }
3679
+ }
3680
+ )
3681
+ }
3682
+ ),
3683
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showActions && /* @__PURE__ */ jsxRuntime.jsxs(
3684
+ framerMotion.motion.div,
3685
+ {
3686
+ initial: { opacity: 0, y: 4, scale: 0.95 },
3687
+ animate: { opacity: 1, y: 0, scale: 1 },
3688
+ exit: { opacity: 0, y: 4, scale: 0.95 },
3689
+ transition: { duration: 0.12 },
3690
+ className: "payman-v2-input-attach-menu",
3691
+ children: [
3692
+ showUploadImageButton && /* @__PURE__ */ jsxRuntime.jsxs(
3693
+ "button",
3694
+ {
3695
+ type: "button",
3696
+ className: "payman-v2-input-attach-option",
3697
+ onClick: handleUploadImageClick,
3698
+ children: [
3699
+ /* @__PURE__ */ jsxRuntime.jsx(
3700
+ lucideReact.ImagePlus,
3701
+ {
3702
+ style: { width: 16, height: 16 },
3703
+ className: "payman-v2-input-attach-option-icon"
3704
+ }
3705
+ ),
3706
+ "Upload image"
3707
+ ]
3708
+ }
3709
+ ),
3710
+ showAttachFileButton && /* @__PURE__ */ jsxRuntime.jsxs(
3711
+ "button",
3712
+ {
3713
+ type: "button",
3714
+ className: "payman-v2-input-attach-option",
3715
+ onClick: handleAttachFileClick,
3716
+ children: [
3717
+ /* @__PURE__ */ jsxRuntime.jsx(
3718
+ lucideReact.Paperclip,
3719
+ {
3720
+ style: { width: 16, height: 16 },
3721
+ className: "payman-v2-input-attach-option-icon"
3722
+ }
3723
+ ),
3724
+ "Attach file"
3725
+ ]
3726
+ }
3727
+ )
3728
+ ]
3729
+ }
3730
+ ) })
3731
+ ] }),
3732
+ showVoiceButton && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative" }, children: [
3733
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: false, children: showVoiceTooltip && /* @__PURE__ */ jsxRuntime.jsx(
3734
+ framerMotion.motion.div,
3735
+ {
3736
+ initial: { opacity: 0, y: 4, scale: 0.98 },
3737
+ animate: { opacity: 1, y: 0, scale: 1 },
3738
+ exit: { opacity: 0, y: 4, scale: 0.98 },
3739
+ transition: { duration: 0.14, ease: "easeOut" },
3740
+ className: "payman-v2-input-voice-tooltip",
3741
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-input-voice-tooltip-content", children: [
3742
+ "Chat with your voice",
3743
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-input-voice-tooltip-arrow" })
3744
+ ] })
3745
+ }
3746
+ ) }),
3747
+ /* @__PURE__ */ jsxRuntime.jsxs(
3748
+ "button",
3749
+ {
3750
+ type: "button",
3751
+ onClick: handleVoiceToggle,
3752
+ onMouseEnter: startVoiceTooltipTimer,
3753
+ onMouseLeave: hideVoiceTooltip,
3754
+ onFocus: startVoiceTooltipTimer,
3755
+ onBlur: hideVoiceTooltip,
3756
+ disabled: isVoiceButtonDisabled,
3757
+ className: cn(
3758
+ "payman-v2-input-mic-btn",
3759
+ isRecording && "payman-v2-input-mic-recording"
3760
+ ),
3761
+ "aria-label": isRecording ? "Stop recording" : "Voice input",
3762
+ children: [
3763
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mic, { style: { width: 18, height: 18 } }),
3764
+ isRecording && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "payman-v2-input-mic-indicator" })
3765
+ ]
3766
+ }
3767
+ )
3768
+ ] })
3769
+ ] }),
3770
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-input-controls-right", children: /* @__PURE__ */ jsxRuntime.jsx(
3771
+ "button",
3772
+ {
3773
+ type: "button",
3774
+ onClick: handleSend,
3775
+ disabled: sendDisabled,
3776
+ className: cn(
3777
+ "payman-v2-input-send-btn",
3778
+ sendDisabled && "payman-v2-input-send-btn-disabled"
3779
+ ),
3780
+ "aria-label": "Send message",
3781
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3782
+ lucideReact.ArrowUp,
3783
+ {
3784
+ style: { width: 16, height: 16, strokeWidth: 2.5 },
3785
+ className: "payman-v2-input-send-icon"
3786
+ }
3787
+ )
3788
+ }
3789
+ ) })
3790
+ ] })
3791
+ ]
3792
+ }
3793
+ ),
3794
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-v2-input-disclaimer", children: "AI can make mistakes. Please double-check responses." })
3795
+ ] });
3796
+ }
3797
+ );
3798
+ function ImageLightboxV2({ src, alt, onClose }) {
3799
+ const [isMounted, setIsMounted] = react.useState(false);
3800
+ const [isImageLoaded, setIsImageLoaded] = react.useState(false);
3801
+ react.useEffect(() => {
3802
+ setIsMounted(true);
3803
+ return () => setIsMounted(false);
3804
+ }, []);
3805
+ react.useEffect(() => {
3806
+ setIsImageLoaded(false);
3807
+ }, [src]);
3808
+ const handleKeyDown = react.useCallback(
3809
+ (e) => {
3810
+ if (e.key === "Escape") onClose();
3811
+ },
3812
+ [onClose]
3813
+ );
3814
+ react.useEffect(() => {
3815
+ if (!src || typeof document === "undefined") return;
3816
+ document.addEventListener("keydown", handleKeyDown);
3817
+ const previousOverflow = document.body.style.overflow;
3818
+ document.body.style.overflow = "hidden";
3819
+ return () => {
3820
+ document.removeEventListener("keydown", handleKeyDown);
3821
+ document.body.style.overflow = previousOverflow;
3822
+ };
3823
+ }, [src, handleKeyDown]);
3824
+ const handleDownload = () => {
3825
+ if (!src || typeof document === "undefined") return;
3826
+ const a = document.createElement("a");
3827
+ a.href = src;
3828
+ a.download = alt.trim() ? alt : "image";
3829
+ document.body.appendChild(a);
3830
+ a.click();
3831
+ a.remove();
3832
+ };
3833
+ if (!isMounted || typeof document === "undefined") {
3834
+ return null;
3835
+ }
3836
+ return reactDom.createPortal(
3837
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: src ? /* @__PURE__ */ jsxRuntime.jsxs(
3838
+ framerMotion.motion.div,
3839
+ {
3840
+ className: "payman-v2-lightbox",
3841
+ initial: { opacity: 0 },
3842
+ animate: { opacity: 1 },
3843
+ exit: { opacity: 0 },
3844
+ transition: { duration: 0.18 },
3845
+ onClick: onClose,
3846
+ role: "presentation",
3847
+ children: [
3848
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-lightbox-controls", children: [
3849
+ /* @__PURE__ */ jsxRuntime.jsx(
3850
+ "button",
3851
+ {
3852
+ type: "button",
3853
+ className: "payman-v2-lightbox-btn",
3854
+ "aria-label": "Download",
3855
+ onClick: (e) => {
3856
+ e.stopPropagation();
3857
+ handleDownload();
3858
+ },
3859
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { size: 20, strokeWidth: 2 })
3860
+ }
3861
+ ),
3862
+ /* @__PURE__ */ jsxRuntime.jsx(
3863
+ "button",
3864
+ {
3865
+ type: "button",
3866
+ className: "payman-v2-lightbox-btn",
3867
+ "aria-label": "Close",
3868
+ onClick: (e) => {
3869
+ e.stopPropagation();
3870
+ onClose();
3871
+ },
3872
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 20, strokeWidth: 2 })
3873
+ }
3874
+ )
3875
+ ] }),
3876
+ /* @__PURE__ */ jsxRuntime.jsxs(
3877
+ "div",
3878
+ {
3879
+ className: "payman-v2-lightbox-content",
3880
+ onClick: (e) => e.stopPropagation(),
3881
+ role: "dialog",
3882
+ "aria-modal": "true",
3883
+ "aria-label": alt || "Image preview",
3884
+ children: [
3885
+ !isImageLoaded ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-v2-lightbox-loading", children: [
3886
+ /* @__PURE__ */ jsxRuntime.jsx(
3887
+ lucideReact.Loader2,
3888
+ {
3889
+ size: 24,
3890
+ strokeWidth: 2,
3891
+ "aria-hidden": true,
3892
+ style: {
3893
+ color: "rgba(255, 255, 255, 0.8)",
3894
+ animation: "payman-v2-spin 0.6s linear infinite"
3895
+ }
3896
+ }
3897
+ ),
3898
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "payman-v2-lightbox-loading-text", children: "Loading image" })
3899
+ ] }) : null,
3900
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "payman-v2-lightbox-img-wrapper", children: /* @__PURE__ */ jsxRuntime.jsx(
3901
+ framerMotion.motion.div,
3902
+ {
3903
+ initial: { scale: 0.92, opacity: 0 },
3904
+ animate: {
3905
+ scale: isImageLoaded ? 1 : 0.92,
3906
+ opacity: isImageLoaded ? 1 : 0
3907
+ },
3908
+ exit: { scale: 0.92, opacity: 0 },
3909
+ transition: { duration: 0.2 },
3910
+ style: {
3911
+ display: "flex",
3912
+ height: "100%",
3913
+ width: "100%",
3914
+ alignItems: "center",
3915
+ justifyContent: "center"
3916
+ },
3917
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3918
+ "img",
3919
+ {
3920
+ className: "payman-v2-lightbox-img",
3921
+ src,
3922
+ alt,
3923
+ draggable: false,
3924
+ onLoad: () => setIsImageLoaded(true)
3925
+ }
3926
+ )
3927
+ }
3928
+ ) })
3929
+ ]
3930
+ }
3931
+ )
3932
+ ]
3933
+ },
3934
+ src
3935
+ ) : null }),
3936
+ document.body
3937
+ );
3938
+ }
3939
+ var DEFAULT_USER_ACTION_STATE = {
3940
+ request: null,
3941
+ result: null,
3942
+ clearOtpTrigger: 0
3943
+ };
3944
+ var NOOP_ASYNC = async () => {
3945
+ };
3946
+ var PaymanChatInner = react.forwardRef(function PaymanChatInner2({
3947
+ config,
3948
+ callbacks = {},
3949
+ className,
3950
+ style,
3951
+ children,
3952
+ onLoadMoreMessages,
3953
+ isLoadingMoreMessages = false,
3954
+ hasMoreMessages = false,
3955
+ chat
3956
+ }, ref) {
3957
+ const [inputValue, setInputValue] = react.useState("");
3958
+ const prevInputValueRef = react.useRef(inputValue);
3959
+ const [hasEverSentMessage, setHasEverSentMessage] = react.useState(false);
3960
+ const [lightboxSrc, setLightboxSrc] = react.useState(null);
3961
+ const [lightboxAlt, setLightboxAlt] = react.useState("");
3962
+ const [editingMessageId, setEditingMessageId] = react.useState(null);
3963
+ const [isResetSessionConfirmOpen, setIsResetSessionConfirmOpen] = react.useState(false);
3964
+ const chatInputV2Ref = react.useRef(null);
3965
+ const messageListV2Ref = react.useRef(null);
3966
+ const resetToEmptyStateRef = react.useRef(false);
3967
+ const isV2 = config.uiVersion !== 1;
3968
+ react.useEffect(() => {
3969
+ if (config.sentryDsn) {
3970
+ initSentryIfNeeded(config.sentryDsn);
3971
+ }
3972
+ }, [config.sentryDsn]);
3973
+ const {
3974
+ messages,
3975
+ sendMessage,
3976
+ isWaitingForResponse,
3977
+ resetSession,
3978
+ clearMessages,
3979
+ prependMessages,
3980
+ cancelStream,
3981
+ getSessionId,
3982
+ getMessages
3983
+ } = chat;
3984
+ react.useEffect(() => {
3985
+ if (resetToEmptyStateRef.current) {
3986
+ if (messages.length === 0) {
3987
+ setHasEverSentMessage(false);
3988
+ resetToEmptyStateRef.current = false;
3989
+ }
3990
+ return;
3991
+ }
3992
+ if (messages.length > 0 && !hasEverSentMessage) {
3993
+ setHasEverSentMessage(true);
3994
+ }
3995
+ }, [messages.length, hasEverSentMessage]);
3996
+ react.useEffect(() => {
3997
+ if (!editingMessageId) return;
3998
+ const editingMessageStillExists = messages.some(
3999
+ (message) => message.id === editingMessageId && message.role === "user"
4000
+ );
4001
+ if (!editingMessageStillExists) {
4002
+ setEditingMessageId(null);
4003
+ }
4004
+ }, [editingMessageId, messages]);
4005
+ const userActionState = chat.userActionState ?? DEFAULT_USER_ACTION_STATE;
4006
+ const approveUserAction = chat.approveUserAction ?? NOOP_ASYNC;
4007
+ const rejectUserAction = chat.rejectUserAction ?? NOOP_ASYNC;
4008
+ const resendOtp = chat.resendOtp ?? NOOP_ASYNC;
4009
+ const isUserActionSupported = typeof chat.approveUserAction === "function" && typeof chat.rejectUserAction === "function" && typeof chat.resendOtp === "function";
4010
+ const {
4011
+ transcribedText,
4012
+ isAvailable: voiceAvailable,
4013
+ isRecording,
4014
+ startRecording,
4015
+ stopRecording,
4016
+ clearTranscript
4017
+ } = paymanTypescriptAskSdk.useVoice(
4018
+ {
4019
+ lang: config.voiceLang || "en-US",
4020
+ interimResults: config.voiceInterimResults !== false,
4021
+ continuous: config.voiceContinuous !== false
4022
+ },
4023
+ {
4024
+ onResult: (text) => {
4025
+ if (!isV2) {
4026
+ setInputValue(text);
4027
+ }
4028
+ },
4029
+ onEnd: () => {
4030
+ },
4031
+ onError: (error) => {
4032
+ console.error("Voice error:", error);
4033
+ }
4034
+ }
4035
+ );
4036
+ const contextValue = react.useMemo(
4037
+ () => ({
4038
+ resetSession,
4039
+ clearMessages,
4040
+ prependMessages,
4041
+ cancelStream,
4042
+ getSessionId,
4043
+ getMessages,
4044
+ isWaitingForResponse
4045
+ }),
4046
+ [
4047
+ resetSession,
4048
+ clearMessages,
4049
+ prependMessages,
4050
+ cancelStream,
4051
+ getSessionId,
4052
+ getMessages,
4053
+ isWaitingForResponse
4054
+ ]
4055
+ );
4056
+ const {
4057
+ onExecutionTraceClick,
4058
+ onResetSession,
4059
+ onUploadImageClick,
4060
+ onAttachFileClick
4061
+ } = callbacks;
4062
+ const performResetSession = react.useCallback(() => {
4063
+ resetToEmptyStateRef.current = true;
4064
+ setEditingMessageId(null);
4065
+ setIsResetSessionConfirmOpen(false);
4066
+ setInputValue("");
4067
+ setLightboxSrc(null);
4068
+ setLightboxAlt("");
4069
+ chatInputV2Ref.current?.setDraft("");
4070
+ clearTranscript();
4071
+ if (isRecording) {
4072
+ stopRecording();
4073
+ }
4074
+ resetSession();
4075
+ onResetSession?.();
4076
+ }, [
4077
+ clearTranscript,
4078
+ isRecording,
4079
+ onResetSession,
4080
+ resetSession,
4081
+ stopRecording
4082
+ ]);
4083
+ const requestResetSession = react.useCallback(() => {
4084
+ setIsResetSessionConfirmOpen(true);
4085
+ }, []);
4086
+ const closeResetSessionConfirm = react.useCallback(() => {
4087
+ setIsResetSessionConfirmOpen(false);
4088
+ }, []);
4089
+ react.useImperativeHandle(ref, () => ({
4090
+ resetSession: performResetSession,
4091
+ clearMessages,
4092
+ cancelStream,
4093
+ getSessionId,
4094
+ getMessages
4095
+ }), [performResetSession, clearMessages, cancelStream, getSessionId, getMessages]);
4096
+ const {
4097
+ placeholder = "Type your message...",
4098
+ emptyStateText = "What can I help with?",
4099
+ sessionParams,
4100
+ disableInput = false,
2121
4101
  hasAskPermission = true,
2122
4102
  streamingStepsText,
2123
4103
  completedStepsText,
@@ -2136,8 +4116,26 @@ var PaymanChat = react.forwardRef(function PaymanChat2({
2136
4116
  disabledComponent,
2137
4117
  showEmptyStateIcon = true,
2138
4118
  emptyStateComponent,
2139
- showResetSession = false
4119
+ showResetSession = false,
4120
+ showAttachmentButton = true,
4121
+ showUploadImageButton = true,
4122
+ showAttachFileButton = true,
4123
+ messageActions: messageActionsConfig
2140
4124
  } = config;
4125
+ const messageActions = react.useMemo(
4126
+ () => ({
4127
+ userMessageActions: {
4128
+ copy: messageActionsConfig?.userMessageActions?.copy ?? true,
4129
+ edit: messageActionsConfig?.userMessageActions?.edit ?? false,
4130
+ retry: messageActionsConfig?.userMessageActions?.retry ?? false
4131
+ },
4132
+ assistantMessageActions: {
4133
+ copy: messageActionsConfig?.assistantMessageActions?.copy ?? true,
4134
+ trace: messageActionsConfig?.assistantMessageActions?.trace ?? true
4135
+ }
4136
+ }),
4137
+ [messageActionsConfig]
4138
+ );
2141
4139
  const isSessionParamsConfigured = react.useMemo(() => {
2142
4140
  if (!sessionParams) return false;
2143
4141
  return !!(sessionParams.id?.trim() && sessionParams.name?.trim());
@@ -2158,7 +4156,7 @@ var PaymanChat = react.forwardRef(function PaymanChat2({
2158
4156
  stopRecording();
2159
4157
  }
2160
4158
  if (inputValue.trim() && !disableInput && isSessionParamsConfigured) {
2161
- sendMessage(inputValue.trim());
4159
+ void sendMessage(inputValue.trim());
2162
4160
  setInputValue("");
2163
4161
  }
2164
4162
  };
@@ -2171,6 +4169,7 @@ var PaymanChat = react.forwardRef(function PaymanChat2({
2171
4169
  stopRecording();
2172
4170
  };
2173
4171
  const isInputDisabled = isWaitingForResponse || !isSessionParamsConfigured || disableInput;
4172
+ const isV2InputDisabled = !isSessionParamsConfigured || disableInput;
2174
4173
  const isEmpty = messages.length === 0;
2175
4174
  if (isChatDisabled) {
2176
4175
  if (disabledComponent) {
@@ -2204,54 +4203,87 @@ var PaymanChat = react.forwardRef(function PaymanChat2({
2204
4203
  }
2205
4204
  ) });
2206
4205
  }
2207
- const inputElement = hasAskPermission && /* @__PURE__ */ jsxRuntime.jsx(
2208
- ChatInput,
2209
- {
2210
- value: inputValue,
2211
- onChange: setInputValue,
2212
- onSend: handleSend,
2213
- onPause: cancelStream,
2214
- disabled: isInputDisabled,
2215
- placeholder: isRecording ? "Listening..." : placeholder,
2216
- isWaitingForResponse,
2217
- hasSelectedSession: true,
2218
- isSessionParamsConfigured,
2219
- enableVoice: config.enableVoice === true,
2220
- onVoicePress: isRecording ? stopRecording : startRecording,
2221
- voiceAvailable: config.enableVoice === true && voiceAvailable,
2222
- isRecording,
2223
- transcribedText: inputValue,
2224
- onCancelRecording: handleCancelRecording,
2225
- onConfirmRecording: handleConfirmRecording,
2226
- inputStyle,
2227
- layout,
2228
- showResetSession,
2229
- onResetSession: () => {
2230
- resetSession();
2231
- onResetSession?.();
2232
- }
4206
+ const handleImageClick = (src, alt) => {
4207
+ setLightboxSrc(src);
4208
+ setLightboxAlt(alt);
4209
+ };
4210
+ const v2UserAction = react.useMemo(() => {
4211
+ if (!isUserActionSupported || !userActionState.request) return null;
4212
+ const req = userActionState.request;
4213
+ let status = "pending";
4214
+ if (userActionState.result === "approved") status = "approved";
4215
+ else if (userActionState.result === "rejected") status = "rejected";
4216
+ return {
4217
+ messageId: `ua-${req.userActionId || Date.now()}`,
4218
+ action: {
4219
+ type: req.userActionType || "generic",
4220
+ message: req.message || "Verify this action",
4221
+ amount: req.metadata?.amount,
4222
+ payeeName: req.metadata?.payeeName
4223
+ },
4224
+ status
4225
+ };
4226
+ }, [isUserActionSupported, userActionState.request, userActionState.result]);
4227
+ const handleV2Send = (text) => {
4228
+ if (isRecording) stopRecording();
4229
+ if (text.trim() && !disableInput && isSessionParamsConfigured) {
4230
+ setEditingMessageId(null);
4231
+ void sendMessage(text.trim());
2233
4232
  }
2234
- );
2235
- return /* @__PURE__ */ jsxRuntime.jsx(PaymanChatContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
2236
- "div",
2237
- {
2238
- className: cn(
2239
- "bg-background overflow-hidden flex flex-col flex-[4]",
2240
- className
2241
- ),
2242
- style,
2243
- children: [
2244
- children,
2245
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isEmpty && !hasEverSentMessage ? (
2246
- /* ---- Centered empty state with input ---- */
2247
- /* @__PURE__ */ jsxRuntime.jsx(
4233
+ };
4234
+ const handleVoicePress = react.useCallback(async () => {
4235
+ if (!voiceAvailable) return;
4236
+ if (isRecording) {
4237
+ stopRecording();
4238
+ return;
4239
+ }
4240
+ clearTranscript();
4241
+ await startRecording();
4242
+ }, [clearTranscript, isRecording, startRecording, stopRecording, voiceAvailable]);
4243
+ const handleEditMessageDraft = react.useCallback((messageId) => {
4244
+ const targetMessage = messages.find((message) => message.id === messageId);
4245
+ if (!targetMessage?.content.trim()) return;
4246
+ setEditingMessageId(messageId);
4247
+ chatInputV2Ref.current?.setDraft(targetMessage.content);
4248
+ requestAnimationFrame(() => {
4249
+ messageListV2Ref.current?.scrollToBottom("smooth");
4250
+ });
4251
+ }, [messages]);
4252
+ const handleRetryUserMessage = react.useCallback((messageId) => {
4253
+ if (isWaitingForResponse) return;
4254
+ const targetMessage = messages.find(
4255
+ (message) => message.id === messageId && message.role === "user"
4256
+ );
4257
+ if (!targetMessage?.content.trim()) return;
4258
+ void sendMessage(targetMessage.content.trim());
4259
+ const bump = () => messageListV2Ref.current?.scrollToBottom("instant");
4260
+ requestAnimationFrame(() => {
4261
+ bump();
4262
+ queueMicrotask(() => {
4263
+ window.setTimeout(bump, 120);
4264
+ });
4265
+ });
4266
+ }, [isWaitingForResponse, messages, sendMessage]);
4267
+ const handleClearEditing = react.useCallback(() => {
4268
+ setEditingMessageId(null);
4269
+ }, []);
4270
+ if (isV2) {
4271
+ return /* @__PURE__ */ jsxRuntime.jsx(PaymanChatContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
4272
+ "div",
4273
+ {
4274
+ className: cn("payman-v2-root", className),
4275
+ style,
4276
+ children: [
4277
+ children,
4278
+ isChatDisabled ? disabledComponent || /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, display: "flex", alignItems: "center", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center", color: "var(--payman-v2-text-3)", fontSize: "0.875rem" }, children: "Chat is currently disabled" }) }) : /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isEmpty && !hasEverSentMessage ? /* @__PURE__ */ jsxRuntime.jsx(
2248
4279
  framerMotion.motion.div,
2249
4280
  {
2250
4281
  initial: { opacity: 1 },
2251
4282
  exit: { opacity: 0 },
2252
4283
  transition: { duration: 0.3 },
2253
- className: "payman-empty-centered-layout",
2254
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-empty-centered-inner", children: [
4284
+ className: "payman-v2-chat-layout",
4285
+ style: { justifyContent: "center", alignItems: "center" },
4286
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", flex: 1, width: "100%" }, children: [
2255
4287
  /* @__PURE__ */ jsxRuntime.jsx(
2256
4288
  MessageList,
2257
4289
  {
@@ -2285,56 +4317,244 @@ var PaymanChat = react.forwardRef(function PaymanChat2({
2285
4317
  initial: { opacity: 0, y: 12 },
2286
4318
  animate: { opacity: 1, y: 0 },
2287
4319
  transition: { delay: 0.2, duration: 0.4, ease: [0.25, 0.46, 0.45, 0.94] },
2288
- className: "payman-empty-centered-input",
2289
- children: inputElement
4320
+ style: { width: "100%" },
4321
+ children: hasAskPermission && /* @__PURE__ */ jsxRuntime.jsx(
4322
+ ChatInputV2,
4323
+ {
4324
+ ref: chatInputV2Ref,
4325
+ onSend: handleV2Send,
4326
+ onCancel: cancelStream,
4327
+ disabled: isV2InputDisabled,
4328
+ isStreaming: isWaitingForResponse,
4329
+ placeholder: isRecording ? "Listening..." : placeholder,
4330
+ enableVoice: config.enableVoice === true,
4331
+ transcribedText: config.enableVoice === true ? transcribedText : "",
4332
+ voiceAvailable: config.enableVoice === true && voiceAvailable,
4333
+ isRecording,
4334
+ onVoicePress: config.enableVoice === true ? handleVoicePress : void 0,
4335
+ onCancelRecording: handleCancelRecording,
4336
+ onConfirmRecording: handleConfirmRecording,
4337
+ showResetSession,
4338
+ onResetSession: requestResetSession,
4339
+ showAttachmentButton,
4340
+ showUploadImageButton,
4341
+ showAttachFileButton,
4342
+ onUploadImageClick,
4343
+ onAttachFileClick,
4344
+ editingMessageId,
4345
+ onClearEditing: handleClearEditing
4346
+ }
4347
+ )
2290
4348
  }
2291
4349
  )
2292
4350
  ] })
2293
4351
  },
2294
- "empty-centered"
2295
- )
2296
- ) : (
2297
- /* ---- Normal chat layout ---- */
2298
- /* @__PURE__ */ jsxRuntime.jsxs(
4352
+ "v2-empty"
4353
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(
2299
4354
  framerMotion.motion.div,
2300
4355
  {
2301
4356
  initial: hasEverSentMessage ? { opacity: 0 } : false,
2302
4357
  animate: { opacity: 1 },
2303
4358
  transition: { duration: 0.3 },
2304
- className: "flex flex-col flex-1 min-h-0",
4359
+ className: "payman-v2-chat-layout",
2305
4360
  children: [
2306
4361
  /* @__PURE__ */ jsxRuntime.jsx(
2307
- MessageList,
4362
+ MessageListV2,
2308
4363
  {
4364
+ ref: messageListV2Ref,
2309
4365
  messages,
2310
- isLoading: false,
2311
- emptyStateText,
2312
- showEmptyStateIcon,
2313
- emptyStateComponent,
2314
- layout,
2315
- showTimestamps,
2316
- stage: config.stage || "DEV",
2317
- animated,
2318
- showAgentName,
2319
- agentName,
2320
- showAvatars,
2321
- showUserAvatar,
2322
- showAssistantAvatar,
2323
- showExecutionSteps,
2324
- showStreamingDot,
2325
- streamingStepsText,
2326
- completedStepsText,
4366
+ isStreaming: isWaitingForResponse,
4367
+ onEditUserMessage: handleEditMessageDraft,
4368
+ onRetryUserMessage: handleRetryUserMessage,
4369
+ onImageClick: handleImageClick,
2327
4370
  onExecutionTraceClick,
2328
- onLoadMoreMessages,
2329
- isLoadingMoreMessages,
2330
- hasMoreMessages
4371
+ messageActions,
4372
+ retryDisabled: isWaitingForResponse,
4373
+ userAction: v2UserAction,
4374
+ onApproveAction: isUserActionSupported ? async (_msgId, otp) => {
4375
+ await approveUserAction(otp);
4376
+ } : void 0,
4377
+ onRejectAction: isUserActionSupported ? async () => {
4378
+ await rejectUserAction();
4379
+ } : void 0,
4380
+ onResendAction: isUserActionSupported ? async () => {
4381
+ await resendOtp();
4382
+ } : void 0
2331
4383
  }
2332
4384
  ),
2333
- inputElement
4385
+ hasAskPermission && /* @__PURE__ */ jsxRuntime.jsx(
4386
+ ChatInputV2,
4387
+ {
4388
+ ref: chatInputV2Ref,
4389
+ onSend: handleV2Send,
4390
+ onCancel: cancelStream,
4391
+ disabled: isV2InputDisabled,
4392
+ isStreaming: isWaitingForResponse,
4393
+ placeholder: isRecording ? "Listening..." : placeholder,
4394
+ enableVoice: config.enableVoice === true,
4395
+ transcribedText: config.enableVoice === true ? transcribedText : "",
4396
+ voiceAvailable: config.enableVoice === true && voiceAvailable,
4397
+ isRecording,
4398
+ onVoicePress: config.enableVoice === true ? handleVoicePress : void 0,
4399
+ onCancelRecording: handleCancelRecording,
4400
+ onConfirmRecording: handleConfirmRecording,
4401
+ showResetSession,
4402
+ onResetSession: requestResetSession,
4403
+ showAttachmentButton,
4404
+ showUploadImageButton,
4405
+ showAttachFileButton,
4406
+ onUploadImageClick,
4407
+ onAttachFileClick,
4408
+ editingMessageId,
4409
+ onClearEditing: handleClearEditing
4410
+ }
4411
+ )
2334
4412
  ]
2335
4413
  },
2336
- "chat-layout"
4414
+ "v2-chat"
4415
+ ) }),
4416
+ /* @__PURE__ */ jsxRuntime.jsx(
4417
+ ImageLightboxV2,
4418
+ {
4419
+ src: lightboxSrc,
4420
+ alt: lightboxAlt,
4421
+ onClose: () => setLightboxSrc(null)
4422
+ }
4423
+ ),
4424
+ /* @__PURE__ */ jsxRuntime.jsx(
4425
+ ResetSessionConfirmModal,
4426
+ {
4427
+ isOpen: isResetSessionConfirmOpen,
4428
+ onClose: closeResetSessionConfirm,
4429
+ onConfirm: performResetSession
4430
+ }
2337
4431
  )
4432
+ ]
4433
+ }
4434
+ ) });
4435
+ }
4436
+ const inputElement = hasAskPermission && /* @__PURE__ */ jsxRuntime.jsx(
4437
+ ChatInput,
4438
+ {
4439
+ value: inputValue,
4440
+ onChange: setInputValue,
4441
+ onSend: handleSend,
4442
+ onPause: cancelStream,
4443
+ disabled: isInputDisabled,
4444
+ placeholder: isRecording ? "Listening..." : placeholder,
4445
+ isWaitingForResponse,
4446
+ hasSelectedSession: true,
4447
+ isSessionParamsConfigured,
4448
+ enableVoice: config.enableVoice === true,
4449
+ onVoicePress: config.enableVoice === true ? handleVoicePress : void 0,
4450
+ voiceAvailable: config.enableVoice === true && voiceAvailable,
4451
+ isRecording,
4452
+ transcribedText: inputValue,
4453
+ onCancelRecording: handleCancelRecording,
4454
+ onConfirmRecording: handleConfirmRecording,
4455
+ inputStyle,
4456
+ layout,
4457
+ showResetSession,
4458
+ onResetSession: requestResetSession
4459
+ }
4460
+ );
4461
+ return /* @__PURE__ */ jsxRuntime.jsx(PaymanChatContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
4462
+ "div",
4463
+ {
4464
+ className: cn(
4465
+ "bg-background overflow-hidden flex flex-col flex-[4]",
4466
+ className
4467
+ ),
4468
+ style,
4469
+ children: [
4470
+ children,
4471
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { mode: "wait", children: isEmpty && !hasEverSentMessage ? /* @__PURE__ */ jsxRuntime.jsx(
4472
+ framerMotion.motion.div,
4473
+ {
4474
+ initial: { opacity: 1 },
4475
+ exit: { opacity: 0 },
4476
+ transition: { duration: 0.3 },
4477
+ className: "payman-empty-centered-layout",
4478
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "payman-empty-centered-inner", children: [
4479
+ /* @__PURE__ */ jsxRuntime.jsx(
4480
+ MessageList,
4481
+ {
4482
+ messages,
4483
+ isLoading: false,
4484
+ emptyStateText,
4485
+ showEmptyStateIcon,
4486
+ emptyStateComponent,
4487
+ layout,
4488
+ showTimestamps,
4489
+ stage: config.stage || "DEV",
4490
+ animated,
4491
+ showAgentName,
4492
+ agentName,
4493
+ showAvatars,
4494
+ showUserAvatar,
4495
+ showAssistantAvatar,
4496
+ showExecutionSteps,
4497
+ showStreamingDot,
4498
+ streamingStepsText,
4499
+ completedStepsText,
4500
+ onExecutionTraceClick,
4501
+ onLoadMoreMessages,
4502
+ isLoadingMoreMessages,
4503
+ hasMoreMessages
4504
+ }
4505
+ ),
4506
+ /* @__PURE__ */ jsxRuntime.jsx(
4507
+ framerMotion.motion.div,
4508
+ {
4509
+ initial: { opacity: 0, y: 12 },
4510
+ animate: { opacity: 1, y: 0 },
4511
+ transition: { delay: 0.2, duration: 0.4, ease: [0.25, 0.46, 0.45, 0.94] },
4512
+ className: "payman-empty-centered-input",
4513
+ children: inputElement
4514
+ }
4515
+ )
4516
+ ] })
4517
+ },
4518
+ "empty-centered"
4519
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(
4520
+ framerMotion.motion.div,
4521
+ {
4522
+ initial: hasEverSentMessage ? { opacity: 0 } : false,
4523
+ animate: { opacity: 1 },
4524
+ transition: { duration: 0.3 },
4525
+ className: "flex flex-col flex-1 min-h-0",
4526
+ children: [
4527
+ /* @__PURE__ */ jsxRuntime.jsx(
4528
+ MessageList,
4529
+ {
4530
+ messages,
4531
+ isLoading: false,
4532
+ emptyStateText,
4533
+ showEmptyStateIcon,
4534
+ emptyStateComponent,
4535
+ layout,
4536
+ showTimestamps,
4537
+ stage: config.stage || "DEV",
4538
+ animated,
4539
+ showAgentName,
4540
+ agentName,
4541
+ showAvatars,
4542
+ showUserAvatar,
4543
+ showAssistantAvatar,
4544
+ showExecutionSteps,
4545
+ showStreamingDot,
4546
+ streamingStepsText,
4547
+ completedStepsText,
4548
+ onExecutionTraceClick,
4549
+ onLoadMoreMessages,
4550
+ isLoadingMoreMessages,
4551
+ hasMoreMessages
4552
+ }
4553
+ ),
4554
+ inputElement
4555
+ ]
4556
+ },
4557
+ "chat-layout"
2338
4558
  ) }),
2339
4559
  /* @__PURE__ */ jsxRuntime.jsx(
2340
4560
  UserActionModal,
@@ -2346,20 +4566,60 @@ var PaymanChat = react.forwardRef(function PaymanChat2({
2346
4566
  onResend: resendOtp,
2347
4567
  clearOtpTrigger: userActionState.clearOtpTrigger
2348
4568
  }
4569
+ ),
4570
+ /* @__PURE__ */ jsxRuntime.jsx(
4571
+ ResetSessionConfirmModal,
4572
+ {
4573
+ isOpen: isResetSessionConfirmOpen,
4574
+ onClose: closeResetSessionConfirm,
4575
+ onConfirm: performResetSession
4576
+ }
2349
4577
  )
2350
4578
  ]
2351
4579
  }
2352
4580
  ) });
2353
4581
  });
4582
+ var PaymanChatV1Shell = react.forwardRef(
4583
+ function PaymanChatV1Shell2(props, ref) {
4584
+ const chat = paymanTypescriptAskSdk.useChat(props.config, props.callbacks);
4585
+ return /* @__PURE__ */ jsxRuntime.jsx(PaymanChatInner, { ...props, chat, ref });
4586
+ }
4587
+ );
4588
+ var PaymanChatV2Shell = react.forwardRef(
4589
+ function PaymanChatV2Shell2(props, ref) {
4590
+ const chat = paymanTypescriptAskSdk.useChatV2(props.config, props.callbacks);
4591
+ return /* @__PURE__ */ jsxRuntime.jsx(PaymanChatInner, { ...props, chat, ref });
4592
+ }
4593
+ );
4594
+ var PaymanChat = react.forwardRef(
4595
+ function PaymanChat2(props, ref) {
4596
+ if (props.config.uiVersion !== 1) {
4597
+ return /* @__PURE__ */ jsxRuntime.jsx(PaymanChatV2Shell, { ...props, ref });
4598
+ }
4599
+ return /* @__PURE__ */ jsxRuntime.jsx(PaymanChatV1Shell, { ...props, ref });
4600
+ }
4601
+ );
2354
4602
 
4603
+ Object.defineProperty(exports, "buildFormattedThinking", {
4604
+ enumerable: true,
4605
+ get: function () { return paymanTypescriptAskSdk.buildFormattedThinking; }
4606
+ });
2355
4607
  Object.defineProperty(exports, "cancelUserAction", {
2356
4608
  enumerable: true,
2357
4609
  get: function () { return paymanTypescriptAskSdk.cancelUserAction; }
2358
4610
  });
4611
+ Object.defineProperty(exports, "createInitialV2State", {
4612
+ enumerable: true,
4613
+ get: function () { return paymanTypescriptAskSdk.createInitialV2State; }
4614
+ });
2359
4615
  Object.defineProperty(exports, "generateId", {
2360
4616
  enumerable: true,
2361
4617
  get: function () { return paymanTypescriptAskSdk.generateId; }
2362
4618
  });
4619
+ Object.defineProperty(exports, "processStreamEventV2", {
4620
+ enumerable: true,
4621
+ get: function () { return paymanTypescriptAskSdk.processStreamEventV2; }
4622
+ });
2363
4623
  Object.defineProperty(exports, "resendUserAction", {
2364
4624
  enumerable: true,
2365
4625
  get: function () { return paymanTypescriptAskSdk.resendUserAction; }
@@ -2376,6 +4636,10 @@ Object.defineProperty(exports, "useChat", {
2376
4636
  enumerable: true,
2377
4637
  get: function () { return paymanTypescriptAskSdk.useChat; }
2378
4638
  });
4639
+ Object.defineProperty(exports, "useChatV2", {
4640
+ enumerable: true,
4641
+ get: function () { return paymanTypescriptAskSdk.useChatV2; }
4642
+ });
2379
4643
  Object.defineProperty(exports, "useVoice", {
2380
4644
  enumerable: true,
2381
4645
  get: function () { return paymanTypescriptAskSdk.useVoice; }