@bigbinary/neeto-assist-frontend 1.1.0 → 1.2.0-beta1
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/README.md +193 -41
- package/app/javascript/src/translations/ar.json +27 -4
- package/app/javascript/src/translations/bg.json +27 -4
- package/app/javascript/src/translations/ca.json +27 -4
- package/app/javascript/src/translations/cs.json +27 -4
- package/app/javascript/src/translations/da.json +27 -4
- package/app/javascript/src/translations/de.json +27 -4
- package/app/javascript/src/translations/en.json +6 -0
- package/app/javascript/src/translations/es-MX.json +27 -4
- package/app/javascript/src/translations/es.json +27 -4
- package/app/javascript/src/translations/et.json +27 -4
- package/app/javascript/src/translations/fi.json +27 -4
- package/app/javascript/src/translations/fil.json +27 -4
- package/app/javascript/src/translations/fr.json +27 -4
- package/app/javascript/src/translations/he.json +27 -4
- package/app/javascript/src/translations/hi.json +27 -4
- package/app/javascript/src/translations/hr.json +27 -4
- package/app/javascript/src/translations/hu.json +27 -4
- package/app/javascript/src/translations/id.json +27 -4
- package/app/javascript/src/translations/it.json +27 -4
- package/app/javascript/src/translations/ja.json +27 -4
- package/app/javascript/src/translations/ko.json +27 -4
- package/app/javascript/src/translations/lv.json +27 -4
- package/app/javascript/src/translations/nl.json +27 -4
- package/app/javascript/src/translations/pl.json +27 -4
- package/app/javascript/src/translations/pt-BR.json +27 -4
- package/app/javascript/src/translations/pt.json +27 -4
- package/app/javascript/src/translations/ro.json +27 -4
- package/app/javascript/src/translations/ru.json +27 -4
- package/app/javascript/src/translations/sk.json +27 -4
- package/app/javascript/src/translations/sl.json +27 -4
- package/app/javascript/src/translations/sv.json +27 -4
- package/app/javascript/src/translations/th.json +27 -4
- package/app/javascript/src/translations/tr.json +27 -4
- package/app/javascript/src/translations/uk.json +27 -4
- package/app/javascript/src/translations/vi.json +27 -4
- package/app/javascript/src/translations/zh-CN.json +27 -4
- package/app/javascript/src/translations/zh-TW.json +27 -4
- package/dist/.ready +1 -1
- package/dist/NeetoAssistButton.js +3 -1
- package/dist/NeetoAssistButton.js.map +1 -1
- package/dist/NeetoAssistPane.js +586 -329
- package/dist/NeetoAssistPane.js.map +1 -1
- package/dist/cjs/NeetoAssistButton.js +3 -1
- package/dist/cjs/NeetoAssistButton.js.map +1 -1
- package/dist/cjs/NeetoAssistPane.js +575 -318
- package/dist/cjs/NeetoAssistPane.js.map +1 -1
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/{useNeetoAssistStore--JwP_Upt.js → useNeetoAssistStore-InICsbe8.js} +89 -6
- package/dist/useNeetoAssistStore-InICsbe8.js.map +1 -0
- package/dist/{useNeetoAssistStore-CGEUMbes.js → useNeetoAssistStore-VaZp3268.js} +91 -4
- package/dist/useNeetoAssistStore-VaZp3268.js.map +1 -0
- package/package.json +1 -1
- package/types.d.ts +31 -6
- package/dist/useNeetoAssistStore--JwP_Upt.js.map +0 -1
- package/dist/useNeetoAssistStore-CGEUMbes.js.map +0 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"neetoAssist": {
|
|
6
6
|
"title": "NeetoAssist",
|
|
7
7
|
"beta": "BETA",
|
|
8
|
-
"betaNote": "NeetoAssist soạn thảo phản hồi
|
|
8
|
+
"betaNote": "NeetoAssist soạn thảo phản hồi, tìm kiếm thông tin và gợi ý hành động cho đại diện của bạn. Nó không bao giờ viết cho khách hàng, và không có gì thay đổi cho đến khi một đại diện nhấn.",
|
|
9
9
|
"askButton": "Hỏi NeetoAssist",
|
|
10
10
|
"draftReady": "Một phản hồi được gợi ý đã sẵn sàng",
|
|
11
11
|
"expand": "Mở rộng",
|
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
"shadowNote": "Khách hàng không bao giờ thấy cuộc trò chuyện này.",
|
|
15
15
|
"intro": {
|
|
16
16
|
"title": "Xin chào, tôi là NeetoAssist.",
|
|
17
|
-
"description": "Khi khách hàng viết, tôi soạn
|
|
17
|
+
"description": "Khi khách hàng viết, tôi soạn một phản hồi từ các bài viết trợ giúp của bạn. Hãy hỏi tôi bất cứ điều gì về cuộc trò chuyện này, hoặc cho tôi biết những gì bạn cần làm. Không có gì thay đổi cho đến khi bạn nhấn Áp dụng."
|
|
18
18
|
},
|
|
19
19
|
"suggestions": {
|
|
20
20
|
"summarize": "Tóm tắt cuộc trò chuyện này",
|
|
21
21
|
"whatToReply": "Tôi nên trả lời gì?",
|
|
22
|
-
"whatToCheck": "Tôi nên kiểm tra điều gì trước?"
|
|
22
|
+
"whatToCheck": "Tôi nên kiểm tra điều gì trước?",
|
|
23
|
+
"writtenBefore": "Khách hàng này đã viết trước đây chưa?",
|
|
24
|
+
"whatNext": "Tôi nên làm gì tiếp theo?"
|
|
23
25
|
},
|
|
24
26
|
"run": {
|
|
25
27
|
"repAsked": "{{name, anyCase}} đã hỏi",
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
"ratedNotHelpful": "{{name, anyCase}} thấy điều này không hữu ích"
|
|
65
67
|
},
|
|
66
68
|
"ask": {
|
|
67
|
-
"placeholder": "Hãy hỏi
|
|
69
|
+
"placeholder": "Hãy hỏi bất cứ điều gì, hoặc nói những gì bạn cần làm",
|
|
68
70
|
"submit": "Gửi đến NeetoAssist"
|
|
69
71
|
},
|
|
70
72
|
"errors": {
|
|
@@ -73,6 +75,27 @@
|
|
|
73
75
|
"notFound": "NeetoAssist không có sẵn cho cuộc trò chuyện này.",
|
|
74
76
|
"invalid": "NeetoAssist không thể tiếp nhận điều đó. Kiểm tra và thử lại.",
|
|
75
77
|
"generic": "Có gì đó đã xảy ra với NeetoAssist. Hãy thử lại."
|
|
78
|
+
},
|
|
79
|
+
"lookingAt": "Đang xem {{label, anyCase}}",
|
|
80
|
+
"steps": {
|
|
81
|
+
"lookedAt_one": "Đã xem {{count}} điều",
|
|
82
|
+
"lookedAt_other": "Đã xem {{count}} điều",
|
|
83
|
+
"completed": "Hoàn thành",
|
|
84
|
+
"failed": "Không thành công"
|
|
85
|
+
},
|
|
86
|
+
"actions": {
|
|
87
|
+
"apply": "Áp dụng",
|
|
88
|
+
"dismiss": "Bỏ qua",
|
|
89
|
+
"applying": "Đang áp dụng...",
|
|
90
|
+
"applied": "Đã áp dụng",
|
|
91
|
+
"by": "bởi {{name, anyCase}}",
|
|
92
|
+
"failed": "Không thể thực hiện điều này.",
|
|
93
|
+
"dismissed": "Đã bị bỏ qua",
|
|
94
|
+
"expired": "Đã hết hạn",
|
|
95
|
+
"errors": {
|
|
96
|
+
"forbidden": "Bạn không có quyền thực hiện việc này. Hãy hỏi quản trị viên.",
|
|
97
|
+
"unavailable": "NeetoAssist hiện không thể tiếp cận. Vui lòng thử lại sau."
|
|
98
|
+
}
|
|
76
99
|
}
|
|
77
100
|
}
|
|
78
101
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"neetoAssist": {
|
|
6
6
|
"title": "NeetoAssist",
|
|
7
7
|
"beta": "测试版",
|
|
8
|
-
"betaNote": "NeetoAssist
|
|
8
|
+
"betaNote": "NeetoAssist 草拟回复,查找信息并为您的代表建议行动。它永远不会直接写信给客户,直到代表点击之前,没有任何更改。",
|
|
9
9
|
"askButton": "问 NeetoAssist",
|
|
10
10
|
"draftReady": "建议的回复已准备好",
|
|
11
11
|
"expand": "展开",
|
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
"shadowNote": "客户永远看不到此聊天。",
|
|
15
15
|
"intro": {
|
|
16
16
|
"title": "你好,我是 NeetoAssist。",
|
|
17
|
-
"description": "
|
|
17
|
+
"description": "当客户写信时,我会根据您的帮助文章草拟回复。问我任何有关此对话的问题,或告诉我您需要做的事情。直到您点击应用,什么都不会改变。"
|
|
18
18
|
},
|
|
19
19
|
"suggestions": {
|
|
20
20
|
"summarize": "总结此对话",
|
|
21
21
|
"whatToReply": "我该回复什么?",
|
|
22
|
-
"whatToCheck": "我该先检查什么?"
|
|
22
|
+
"whatToCheck": "我该先检查什么?",
|
|
23
|
+
"writtenBefore": "这个客户以前写过吗?",
|
|
24
|
+
"whatNext": "我接下来该怎么办?"
|
|
23
25
|
},
|
|
24
26
|
"run": {
|
|
25
27
|
"repAsked": "{{name, anyCase}} 问了",
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
"ratedNotHelpful": "{{name, anyCase}} 发现这没有帮助"
|
|
65
67
|
},
|
|
66
68
|
"ask": {
|
|
67
|
-
"placeholder": "
|
|
69
|
+
"placeholder": "询问任何问题,或说出您需要做的事情",
|
|
68
70
|
"submit": "发送给 NeetoAssist"
|
|
69
71
|
},
|
|
70
72
|
"errors": {
|
|
@@ -73,6 +75,27 @@
|
|
|
73
75
|
"notFound": "NeetoAssist 在此对话中不可用。",
|
|
74
76
|
"invalid": "NeetoAssist 无法处理该请求。请检查并重试。",
|
|
75
77
|
"generic": "NeetoAssist 出现了一些错误。请重试。"
|
|
78
|
+
},
|
|
79
|
+
"lookingAt": "查看 {{label, anyCase}}",
|
|
80
|
+
"steps": {
|
|
81
|
+
"lookedAt_one": "查看了 {{count}} 件事",
|
|
82
|
+
"lookedAt_other": "查看了 {{count}} 件事",
|
|
83
|
+
"completed": "完成",
|
|
84
|
+
"failed": "失败"
|
|
85
|
+
},
|
|
86
|
+
"actions": {
|
|
87
|
+
"apply": "应用",
|
|
88
|
+
"dismiss": "忽略",
|
|
89
|
+
"applying": "正在应用...",
|
|
90
|
+
"applied": "已应用",
|
|
91
|
+
"by": "由 {{name, anyCase}}",
|
|
92
|
+
"failed": "无法完成此操作。",
|
|
93
|
+
"dismissed": "已忽略",
|
|
94
|
+
"expired": "已过期",
|
|
95
|
+
"errors": {
|
|
96
|
+
"forbidden": "您没有权限这样做。请联系管理员。",
|
|
97
|
+
"unavailable": "NeetoAssist 目前无法访问。请稍后再试。"
|
|
98
|
+
}
|
|
76
99
|
}
|
|
77
100
|
}
|
|
78
101
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"neetoAssist": {
|
|
6
6
|
"title": "NeetoAssist",
|
|
7
7
|
"beta": "BETA",
|
|
8
|
-
"betaNote": "NeetoAssist
|
|
8
|
+
"betaNote": "NeetoAssist 編寫回覆、查詢信息並為您的代表建議行動。它永遠不會向客戶發送信息,並且在代表點擊之前不會進行任何更改。",
|
|
9
9
|
"askButton": "詢問 NeetoAssist",
|
|
10
10
|
"draftReady": "建議的回覆已準備好",
|
|
11
11
|
"expand": "展開",
|
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
"shadowNote": "客戶永遠不會看到此聊天。",
|
|
15
15
|
"intro": {
|
|
16
16
|
"title": "嗨,我是 NeetoAssist。",
|
|
17
|
-
"description": "
|
|
17
|
+
"description": "當客戶寫信時,我會根據您的幫助文章草擬回覆。隨時問我任何關於這次對話的問題,或告訴我您需要做什麼。在您點擊應用之前,什麼都不會改變。"
|
|
18
18
|
},
|
|
19
19
|
"suggestions": {
|
|
20
20
|
"summarize": "總結這次對話",
|
|
21
21
|
"whatToReply": "我應該回覆什麼?",
|
|
22
|
-
"whatToCheck": "我應該先檢查什麼?"
|
|
22
|
+
"whatToCheck": "我應該先檢查什麼?",
|
|
23
|
+
"writtenBefore": "這位客戶以前有寫過嗎?",
|
|
24
|
+
"whatNext": "我接下來該做什麼?"
|
|
23
25
|
},
|
|
24
26
|
"run": {
|
|
25
27
|
"repAsked": "{{name, anyCase}} 提問",
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
"ratedNotHelpful": "{{name, anyCase}} 認為這沒有幫助"
|
|
65
67
|
},
|
|
66
68
|
"ask": {
|
|
67
|
-
"placeholder": "
|
|
69
|
+
"placeholder": "問任何問題,或說出您需要完成的事情",
|
|
68
70
|
"submit": "發送給 NeetoAssist"
|
|
69
71
|
},
|
|
70
72
|
"errors": {
|
|
@@ -73,6 +75,27 @@
|
|
|
73
75
|
"notFound": "NeetoAssist 在此對話中不可用。",
|
|
74
76
|
"invalid": "NeetoAssist 無法處理該請求。請檢查並重試。",
|
|
75
77
|
"generic": "NeetoAssist 出現問題。請再試一次。"
|
|
78
|
+
},
|
|
79
|
+
"lookingAt": "查看 {{label, anyCase}}",
|
|
80
|
+
"steps": {
|
|
81
|
+
"lookedAt_one": "查看了 {{count}} 個事物",
|
|
82
|
+
"lookedAt_other": "查看了 {{count}} 個事物",
|
|
83
|
+
"completed": "完成",
|
|
84
|
+
"failed": "失敗"
|
|
85
|
+
},
|
|
86
|
+
"actions": {
|
|
87
|
+
"apply": "應用",
|
|
88
|
+
"dismiss": "駁回",
|
|
89
|
+
"applying": "正在應用...",
|
|
90
|
+
"applied": "已應用",
|
|
91
|
+
"by": "由 {{name, anyCase}} 所寫",
|
|
92
|
+
"failed": "無法完成此操作。",
|
|
93
|
+
"dismissed": "已駁回",
|
|
94
|
+
"expired": "已過期",
|
|
95
|
+
"errors": {
|
|
96
|
+
"forbidden": "您沒有權限執行此操作。請詢問管理員。",
|
|
97
|
+
"unavailable": "目前無法訪問 NeetoAssist。請稍後再試。"
|
|
98
|
+
}
|
|
76
99
|
}
|
|
77
100
|
}
|
|
78
101
|
}
|
package/dist/.ready
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Built at 2026-11-
|
|
1
|
+
Built at 2026-11-12T15:59:35.673Z
|
|
@@ -2,13 +2,15 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import { useRef, useEffect } from 'react';
|
|
3
3
|
import { Button } from '@bigbinary/neeto-atoms';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { u as useNeetoAssistStore, a as useFetchRuns, l as latestDraftId, S as Sparkle } from './useNeetoAssistStore
|
|
5
|
+
import { u as useNeetoAssistStore, a as useFetchRuns, l as latestDraftId, S as Sparkle } from './useNeetoAssistStore-InICsbe8.js';
|
|
6
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
7
|
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
8
8
|
import '@tanstack/react-query';
|
|
9
9
|
import '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
10
10
|
import './neeto_assist-CpUBA-3Z.js';
|
|
11
11
|
import 'axios';
|
|
12
|
+
import '@babel/runtime/helpers/toConsumableArray';
|
|
13
|
+
import '@babel/runtime/helpers/toArray';
|
|
12
14
|
import 'ramda';
|
|
13
15
|
import '@bigbinary/neeto-commons-frontend/v2/utils';
|
|
14
16
|
import 'zustand';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeetoAssistButton.js","sources":["../app/javascript/src/components/NeetoAssistButton/index.jsx"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nimport { Button } from \"neetoatoms\";\nimport { useTranslation } from \"react-i18next\";\n\nimport Sparkle from \"components/commons/Sparkle\";\nimport { useFetchRuns } from \"hooks/reactQuery/useRunsApi\";\nimport useNeetoAssistStore from \"stores/useNeetoAssistStore\";\nimport { latestDraftId } from \"utils/runs\";\n\nconst NeetoAssistIcon = props => (\n <Sparkle {...props} className=\"text-purple-600\" />\n);\n\n// Goes on the ticket: it opens the pane, and tells the pane which ticket it is\n// about for as long as the button is on screen, along with the host's words\n// for what the rep is looking at. A dot says a suggested reply is waiting,\n// since the pane is closed until the rep asks for it.\nconst NeetoAssistButton = ({\n conversationId,\n contextLabel,\n onActionApplied,\n onUseReply,\n}) => {\n const { t } = useTranslation();\n const isOpen = useNeetoAssistStore(state => state.isOpen);\n const toggle = useNeetoAssistStore(state => state.toggle);\n const setConversation = useNeetoAssistStore(state => state.setConversation);\n const clearConversation = useNeetoAssistStore(\n state => state.clearConversation\n );\n\n const seenDraftId = useNeetoAssistStore(\n state => state.seenDrafts[conversationId]\n );\n\n const { data: { runs = [] } = {} } = useFetchRuns(conversationId);\n const draftId = latestDraftId(runs);\n const hasUnseenDraft = !isOpen && !!draftId && draftId !== seenDraftId;\n\n // The host's handlers change on every render. Only whether there is one for\n // \"Use reply\" matters to the pane, and one for an applied action changes\n // nothing it shows, so the pane gets stand-ins that call the latest.\n const useReplyRef = useRef(onUseReply);\n const actionAppliedRef = useRef(onActionApplied);\n const canUseReply = !!onUseReply;\n useEffect(() => {\n useReplyRef.current = onUseReply;\n actionAppliedRef.current = onActionApplied;\n });\n\n useEffect(() => {\n // The answer to a click on Apply can arrive after the button has moved on\n // to another ticket. It then goes to the handler the host last gave for\n // this ticket, not to the one for the ticket now on screen.\n let handlerOnLeaving;\n let hasLeft = false;\n\n setConversation({\n id: conversationId,\n contextLabel,\n onUseReply: canUseReply\n ? (text, html) => useReplyRef.current?.(text, html)\n : undefined,\n onActionApplied: action =>\n (hasLeft ? handlerOnLeaving : actionAppliedRef.current)?.(action),\n });\n\n return () => {\n handlerOnLeaving = actionAppliedRef.current;\n hasLeft = true;\n clearConversation(conversationId);\n };\n }, [\n canUseReply,\n clearConversation,\n contextLabel,\n conversationId,\n setConversation,\n ]);\n\n return (\n <span className=\"relative inline-flex\">\n <Button\n aria-pressed={isOpen}\n data-testid=\"neeto-assist-button\"\n icon={NeetoAssistIcon}\n iconPosition=\"left\"\n label={t(\"neetoAssist.askButton\")}\n size=\"sm\"\n variant={isOpen ? \"secondary\" : \"outline\"}\n tooltipProps={\n hasUnseenDraft ? { content: t(\"neetoAssist.draftReady\") } : undefined\n }\n onClick={toggle}\n />\n {hasUnseenDraft && (\n <span\n aria-label={t(\"neetoAssist.draftReady\")}\n className=\"ring-background absolute -end-0.5 -top-0.5 size-2.5 rounded-full bg-purple-600 ring-2\"\n data-testid=\"neeto-assist-draft-dot\"\n role=\"status\"\n />\n )}\n </span>\n );\n};\n\nexport default NeetoAssistButton;\n"],"names":["NeetoAssistIcon","props","_jsx","Sparkle","_objectSpread","className","NeetoAssistButton","_ref","conversationId","contextLabel","onActionApplied","onUseReply","_useTranslation","useTranslation","t","isOpen","useNeetoAssistStore","state","toggle","setConversation","clearConversation","seenDraftId","seenDrafts","_useFetchRuns","useFetchRuns","_useFetchRuns$data","data","_useFetchRuns$data2","_useFetchRuns$data2$r","runs","draftId","latestDraftId","hasUnseenDraft","useReplyRef","useRef","actionAppliedRef","canUseReply","useEffect","current","handlerOnLeaving","hasLeft","id","text","html","_useReplyRef$current","call","undefined","action","_ref2","_jsxs","children","Button","icon","iconPosition","label","size","variant","tooltipProps","content","onClick","role"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NeetoAssistButton.js","sources":["../app/javascript/src/components/NeetoAssistButton/index.jsx"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nimport { Button } from \"neetoatoms\";\nimport { useTranslation } from \"react-i18next\";\n\nimport Sparkle from \"components/commons/Sparkle\";\nimport { useFetchRuns } from \"hooks/reactQuery/useRunsApi\";\nimport useNeetoAssistStore from \"stores/useNeetoAssistStore\";\nimport { latestDraftId } from \"utils/runs\";\n\nconst NeetoAssistIcon = props => (\n <Sparkle {...props} className=\"text-purple-600\" />\n);\n\n// Goes on the ticket: it opens the pane, and tells the pane which ticket it is\n// about for as long as the button is on screen, along with the host's words\n// for what the rep is looking at. A dot says a suggested reply is waiting,\n// since the pane is closed until the rep asks for it.\nconst NeetoAssistButton = ({\n conversationId,\n contextLabel,\n onActionApplied,\n onUseReply,\n}) => {\n const { t } = useTranslation();\n const isOpen = useNeetoAssistStore(state => state.isOpen);\n const toggle = useNeetoAssistStore(state => state.toggle);\n const setConversation = useNeetoAssistStore(state => state.setConversation);\n const clearConversation = useNeetoAssistStore(\n state => state.clearConversation\n );\n\n const seenDraftId = useNeetoAssistStore(\n state => state.seenDrafts[conversationId]\n );\n\n const { data: { runs = [] } = {} } = useFetchRuns(conversationId);\n const draftId = latestDraftId(runs);\n const hasUnseenDraft = !isOpen && !!draftId && draftId !== seenDraftId;\n\n // The host's handlers change on every render. Only whether there is one for\n // \"Use reply\" matters to the pane, and one for an applied action changes\n // nothing it shows, so the pane gets stand-ins that call the latest.\n const useReplyRef = useRef(onUseReply);\n const actionAppliedRef = useRef(onActionApplied);\n const canUseReply = !!onUseReply;\n useEffect(() => {\n useReplyRef.current = onUseReply;\n actionAppliedRef.current = onActionApplied;\n });\n\n useEffect(() => {\n // The answer to a click on Apply can arrive after the button has moved on\n // to another ticket. It then goes to the handler the host last gave for\n // this ticket, not to the one for the ticket now on screen.\n let handlerOnLeaving;\n let hasLeft = false;\n\n setConversation({\n id: conversationId,\n contextLabel,\n onUseReply: canUseReply\n ? (text, html) => useReplyRef.current?.(text, html)\n : undefined,\n onActionApplied: action =>\n (hasLeft ? handlerOnLeaving : actionAppliedRef.current)?.(action),\n });\n\n return () => {\n handlerOnLeaving = actionAppliedRef.current;\n hasLeft = true;\n clearConversation(conversationId);\n };\n }, [\n canUseReply,\n clearConversation,\n contextLabel,\n conversationId,\n setConversation,\n ]);\n\n return (\n <span className=\"relative inline-flex\">\n <Button\n aria-pressed={isOpen}\n data-testid=\"neeto-assist-button\"\n icon={NeetoAssistIcon}\n iconPosition=\"left\"\n label={t(\"neetoAssist.askButton\")}\n size=\"sm\"\n variant={isOpen ? \"secondary\" : \"outline\"}\n tooltipProps={\n hasUnseenDraft ? { content: t(\"neetoAssist.draftReady\") } : undefined\n }\n onClick={toggle}\n />\n {hasUnseenDraft && (\n <span\n aria-label={t(\"neetoAssist.draftReady\")}\n className=\"ring-background absolute -end-0.5 -top-0.5 size-2.5 rounded-full bg-purple-600 ring-2\"\n data-testid=\"neeto-assist-draft-dot\"\n role=\"status\"\n />\n )}\n </span>\n );\n};\n\nexport default NeetoAssistButton;\n"],"names":["NeetoAssistIcon","props","_jsx","Sparkle","_objectSpread","className","NeetoAssistButton","_ref","conversationId","contextLabel","onActionApplied","onUseReply","_useTranslation","useTranslation","t","isOpen","useNeetoAssistStore","state","toggle","setConversation","clearConversation","seenDraftId","seenDrafts","_useFetchRuns","useFetchRuns","_useFetchRuns$data","data","_useFetchRuns$data2","_useFetchRuns$data2$r","runs","draftId","latestDraftId","hasUnseenDraft","useReplyRef","useRef","actionAppliedRef","canUseReply","useEffect","current","handlerOnLeaving","hasLeft","id","text","html","_useReplyRef$current","call","undefined","action","_ref2","_jsxs","children","Button","icon","iconPosition","label","size","variant","tooltipProps","content","onCl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