@bigbinary/neeto-assist-frontend 1.2.1 → 1.3.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.
Files changed (43) hide show
  1. package/README.md +430 -21
  2. package/app/javascript/src/translations/en.json +39 -2
  3. package/dist/.ready +1 -1
  4. package/dist/NeetoAssistButton.js +13 -6
  5. package/dist/NeetoAssistButton.js.map +1 -1
  6. package/dist/NeetoAssistPane.js +1469 -166
  7. package/dist/NeetoAssistPane.js.map +1 -1
  8. package/dist/cjs/NeetoAssistButton.js +16 -9
  9. package/dist/cjs/NeetoAssistButton.js.map +1 -1
  10. package/dist/cjs/NeetoAssistPane.js +1491 -188
  11. package/dist/cjs/NeetoAssistPane.js.map +1 -1
  12. package/dist/cjs/index.js +11 -5
  13. package/dist/cjs/index.js.map +1 -1
  14. package/dist/cjs/useNeetoAssistAssistant.js +43 -0
  15. package/dist/cjs/useNeetoAssistAssistant.js.map +1 -0
  16. package/dist/cjs/useNeetoAssistStatus.js +3 -1
  17. package/dist/cjs/useNeetoAssistStatus.js.map +1 -1
  18. package/dist/index.js +10 -5
  19. package/dist/index.js.map +1 -1
  20. package/dist/neeto_assist-COp7BR77.js +249 -0
  21. package/dist/neeto_assist-COp7BR77.js.map +1 -0
  22. package/dist/neeto_assist-D1wzZ3ou.js +219 -0
  23. package/dist/neeto_assist-D1wzZ3ou.js.map +1 -0
  24. package/dist/useNeetoAssistAssistant.js +41 -0
  25. package/dist/useNeetoAssistAssistant.js.map +1 -0
  26. package/dist/useNeetoAssistStatus.js +3 -1
  27. package/dist/useNeetoAssistStatus.js.map +1 -1
  28. package/dist/useNeetoAssistStore-Bj6niQdc.js +103 -0
  29. package/dist/useNeetoAssistStore-Bj6niQdc.js.map +1 -0
  30. package/dist/useNeetoAssistStore-Dgt8aV52.js +101 -0
  31. package/dist/useNeetoAssistStore-Dgt8aV52.js.map +1 -0
  32. package/dist/{useNeetoAssistStore-InICsbe8.js → useRunsApi-BgsICthX.js} +228 -113
  33. package/dist/useRunsApi-BgsICthX.js.map +1 -0
  34. package/dist/{useNeetoAssistStore-VaZp3268.js → useRunsApi-Rh6xXOwm.js} +232 -112
  35. package/dist/useRunsApi-Rh6xXOwm.js.map +1 -0
  36. package/package.json +4 -4
  37. package/types.d.ts +81 -8
  38. package/dist/neeto_assist-CpUBA-3Z.js +0 -135
  39. package/dist/neeto_assist-CpUBA-3Z.js.map +0 -1
  40. package/dist/neeto_assist-CznTN_YY.js +0 -157
  41. package/dist/neeto_assist-CznTN_YY.js.map +0 -1
  42. package/dist/useNeetoAssistStore-InICsbe8.js.map +0 -1
  43. package/dist/useNeetoAssistStore-VaZp3268.js.map +0 -1
@@ -0,0 +1,219 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
+ import axios from 'axios';
4
+
5
+ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ var BASE_URL = "/neeto_assist/api/v1";
8
+
9
+ // The pane shows NeetoAssist's errors itself. Without these, the host's axios
10
+ // setup would raise a toast, or swap the page for an error page on a 403, 404
11
+ // or 429.
12
+ var REQUEST_OPTIONS = {
13
+ showToastr: false,
14
+ show403ErrorPage: false,
15
+ show404ErrorPage: false,
16
+ show429ErrorPage: false
17
+ };
18
+ var QUERY_KEYS = {
19
+ STATUS: "neeto-assist-status",
20
+ RUNS: "neeto-assist-runs",
21
+ ASSISTANT_THREAD: "neeto-assist-assistant-thread"
22
+ };
23
+
24
+ // What the pane shows: the conversation a NeetoAssistButton opened it on, or
25
+ // the signed-in person's own assistant. A host that never opens the assistant
26
+ // only ever has the first.
27
+ var PANE_MODES = {
28
+ CONVERSATION: "conversation",
29
+ ASSISTANT: "assistant"
30
+ };
31
+
32
+ // The engine sends at most six first questions for an empty thread.
33
+ var MAX_ASSISTANT_SUGGESTIONS = 6;
34
+ var PENDING_POLL_INTERVAL = 2000;
35
+ var IDLE_POLL_INTERVAL = 30000;
36
+ var PENDING_STATUSES = ["queued", "running"];
37
+ var RATEABLE_STATUSES = ["completed", "skipped"];
38
+
39
+ // A person stopped their ask before NeetoAssist answered it.
40
+ var STOPPED_STATUS = "stopped";
41
+
42
+ // How long a copy button shows that it copied.
43
+ var COPIED_FOR = 1500;
44
+
45
+ // The word before a source's title for what kind of thing it is, for the kinds
46
+ // that have one. A conversation's title already says it is one, as in
47
+ // "Conversation with Priya Nair on 3 November 2026", so it gets none, nor does
48
+ // a record. A lookup is named by the product it read. A map, so that only these
49
+ // kinds have a word, and no name an object has of its own, such as
50
+ // "constructor", reads as one.
51
+ var SOURCE_KIND_KEYS = new Map([["help_article", "neetoAssist.sources.helpArticle"], ["api_doc", "neetoAssist.sources.apiDoc"]]);
52
+
53
+ // The kind of a source from an older NeetoAssist, which cited nothing else.
54
+ var DEFAULT_SOURCE_KIND = "help_article";
55
+ var LOOKUP_SOURCE_KIND = "lookup";
56
+
57
+ // What became of a suggested action. NeetoAssist has the last word on an
58
+ // action in one of these: nothing a click says can be newer.
59
+ var SETTLED_ACTION_STATUSES = ["applied", "failed", "dismissed", "expired"];
60
+
61
+ // A suggestion nobody took up steps back to one muted line.
62
+ var QUIET_ACTION_STATUS_KEYS = {
63
+ dismissed: "neetoAssist.actions.dismissed",
64
+ expired: "neetoAssist.actions.expired"
65
+ };
66
+
67
+ // The skips from the workspace's quiet rules, in NeetoAssist's settings. Each
68
+ // one holds for every visitor message until something changes, such as the
69
+ // agent who owns the conversation handing it back.
70
+ var QUIET_SKIPPED_REASONS = ["assigned_to_human", "handed_off", "no_answer_cooldown"];
71
+
72
+ // These skips come from the workspace's state, not from reading the
73
+ // conversation, so there is nothing for a rep to judge.
74
+ var UNRATEABLE_SKIPPED_REASONS = ["disabled", "no_knowledge_source", "out_of_credits"].concat(QUIET_SKIPPED_REASONS);
75
+ var MAX_QUESTION_LENGTH = 2000;
76
+ var MAX_NOTE_LENGTH = 2000;
77
+
78
+ // The same widths as Neeti's pane in NeetoCal, so Neeto's assistants feel alike.
79
+ var COLLAPSED_PANE_WIDTH = "min(100vw, 400px)";
80
+ var EXPANDED_PANE_WIDTH = "min(50vw, 800px)";
81
+ var EXPANDED_STORAGE_KEY = "neetoAssist.isExpanded";
82
+ var REPLY_SUGGESTION = "reply_suggestion";
83
+ var RUN_TEST_ID = "neeto-assist-run";
84
+ var SUGGESTION_KEYS = ["neetoAssist.suggestions.summarize", "neetoAssist.suggestions.whatToReply", "neetoAssist.suggestions.writtenBefore", "neetoAssist.suggestions.whatNext"];
85
+ var SKIPPED_REASON_MESSAGE_KEYS = {
86
+ greeting: "neetoAssist.skippedReasons.greeting",
87
+ acknowledgment: "neetoAssist.skippedReasons.acknowledgment",
88
+ agent_handoff: "neetoAssist.skippedReasons.agentHandoff",
89
+ unclear: "neetoAssist.skippedReasons.unclear",
90
+ other_product: "neetoAssist.skippedReasons.otherProduct",
91
+ no_knowledge_source: "neetoAssist.skippedReasons.noKnowledgeSource",
92
+ disabled: "neetoAssist.skippedReasons.disabled",
93
+ no_question: "neetoAssist.skippedReasons.noQuestion",
94
+ out_of_credits: "neetoAssist.skippedReasons.outOfCredits",
95
+ assigned_to_human: "neetoAssist.skippedReasons.assignedToHuman",
96
+ handed_off: "neetoAssist.skippedReasons.handedOff",
97
+ no_answer_cooldown: "neetoAssist.skippedReasons.noAnswerCooldown"
98
+ };
99
+ var ERROR_MESSAGE_KEYS = {
100
+ 404: "neetoAssist.errors.notFound",
101
+ 409: "neetoAssist.errors.disabled",
102
+ 422: "neetoAssist.errors.invalid",
103
+ 503: "neetoAssist.errors.unavailable"
104
+ };
105
+
106
+ // The assistant is no conversation, so a 404 there says so in its own words.
107
+ var ASSISTANT_ERROR_MESSAGE_KEYS = _objectSpread$1(_objectSpread$1({}, ERROR_MESSAGE_KEYS), {}, {
108
+ 404: "neetoAssist.assistant.errors.notFound"
109
+ });
110
+
111
+ // A click on a card that changed nothing. The other answers fall back to the
112
+ // keys above.
113
+ var ACTION_ERROR_MESSAGE_KEYS = {
114
+ 403: "neetoAssist.actions.errors.forbidden",
115
+ 503: "neetoAssist.actions.errors.unavailable"
116
+ };
117
+
118
+ var _excluded = ["question", "requestId"],
119
+ _excluded2 = ["runId", "rating", "note"],
120
+ _excluded3 = ["runId"];
121
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
122
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
123
+
124
+ // Runs live on a conversation, or on one of the signed-in person's own
125
+ // assistant threads. The engine builds the thread's id at NeetoAssist from the
126
+ // session's person, so the key is all the browser sends.
127
+ var threadUrl = function threadUrl(_ref) {
128
+ var conversationId = _ref.conversationId,
129
+ threadId = _ref.threadId;
130
+ return threadId ? "".concat(BASE_URL, "/assistant/threads/").concat(encodeURIComponent(threadId)) : "".concat(BASE_URL, "/conversations/").concat(encodeURIComponent(conversationId));
131
+ };
132
+ var runsUrl = function runsUrl(where) {
133
+ return "".concat(threadUrl(where), "/runs");
134
+ };
135
+
136
+ // Cards are only ever on a conversation: an assistant thread has none.
137
+ var actionUrl = function actionUrl(_ref2) {
138
+ var conversationId = _ref2.conversationId,
139
+ actionId = _ref2.actionId;
140
+ return "".concat(BASE_URL, "/conversations/").concat(encodeURIComponent(conversationId), "/actions/").concat(encodeURIComponent(actionId));
141
+ };
142
+ var fetchStatus = function fetchStatus() {
143
+ return axios.get("".concat(BASE_URL, "/status"), REQUEST_OPTIONS);
144
+ };
145
+ var fetchAssistantThread = function fetchAssistantThread() {
146
+ return axios.get("".concat(BASE_URL, "/assistant/thread"), REQUEST_OPTIONS);
147
+ };
148
+ var createAssistantThread = function createAssistantThread() {
149
+ return axios.post("".concat(BASE_URL, "/assistant/thread"), {}, REQUEST_OPTIONS);
150
+ };
151
+ var fetchRuns = function fetchRuns(where) {
152
+ return axios.get(runsUrl(where), REQUEST_OPTIONS);
153
+ };
154
+
155
+ // The page a person asks the assistant on, read at the moment they ask, so
156
+ // NeetoAssist knows what they are looking at: the pathname and the page's
157
+ // title. Search terms and fragments can name a customer, so neither goes.
158
+ var currentPage = function currentPage() {
159
+ return {
160
+ path: globalThis.location.pathname,
161
+ title: globalThis.document.title
162
+ };
163
+ };
164
+ var createRun = function createRun(_ref3) {
165
+ var question = _ref3.question,
166
+ requestId = _ref3.requestId,
167
+ where = _objectWithoutProperties(_ref3, _excluded);
168
+ return axios.post(runsUrl(where), _objectSpread({
169
+ run: {
170
+ question: question,
171
+ request_id: requestId
172
+ }
173
+ }, where.threadId ? {
174
+ page: currentPage()
175
+ } : {}), REQUEST_OPTIONS);
176
+ };
177
+ var updateFeedback = function updateFeedback(_ref4) {
178
+ var runId = _ref4.runId,
179
+ rating = _ref4.rating,
180
+ note = _ref4.note,
181
+ where = _objectWithoutProperties(_ref4, _excluded2);
182
+ return axios.put("".concat(runsUrl(where), "/").concat(encodeURIComponent(runId), "/feedback"), {
183
+ feedback: {
184
+ rating: rating,
185
+ note: note
186
+ }
187
+ }, REQUEST_OPTIONS);
188
+ };
189
+
190
+ // Stops the person's own ask while NeetoAssist is still on it. The engine says
191
+ // who is asking, so the request names only the run.
192
+ var stopRun = function stopRun(_ref5) {
193
+ var runId = _ref5.runId,
194
+ where = _objectWithoutProperties(_ref5, _excluded3);
195
+ return axios.post("".concat(runsUrl(where), "/").concat(encodeURIComponent(runId), "/stop"), {}, REQUEST_OPTIONS);
196
+ };
197
+
198
+ // The host makes the change as the signed-in rep, so the request says only
199
+ // which action. Nothing about the change itself comes from the browser.
200
+ var applyAction = function applyAction(action) {
201
+ return axios.post("".concat(actionUrl(action), "/apply"), {}, REQUEST_OPTIONS);
202
+ };
203
+ var dismissAction = function dismissAction(action) {
204
+ return axios.post("".concat(actionUrl(action), "/dismiss"), {}, REQUEST_OPTIONS);
205
+ };
206
+ var neetoAssistApi = {
207
+ fetchStatus: fetchStatus,
208
+ fetchAssistantThread: fetchAssistantThread,
209
+ createAssistantThread: createAssistantThread,
210
+ fetchRuns: fetchRuns,
211
+ createRun: createRun,
212
+ updateFeedback: updateFeedback,
213
+ stopRun: stopRun,
214
+ applyAction: applyAction,
215
+ dismissAction: dismissAction
216
+ };
217
+
218
+ export { ASSISTANT_ERROR_MESSAGE_KEYS as A, COPIED_FOR as C, DEFAULT_SOURCE_KIND as D, EXPANDED_STORAGE_KEY as E, IDLE_POLL_INTERVAL as I, LOOKUP_SOURCE_KIND as L, MAX_ASSISTANT_SUGGESTIONS as M, PANE_MODES as P, QUERY_KEYS as Q, RATEABLE_STATUSES as R, SKIPPED_REASON_MESSAGE_KEYS as S, UNRATEABLE_SKIPPED_REASONS as U, ERROR_MESSAGE_KEYS as a, PENDING_STATUSES as b, STOPPED_STATUS as c, SOURCE_KIND_KEYS as d, REPLY_SUGGESTION as e, QUIET_SKIPPED_REASONS as f, PENDING_POLL_INTERVAL as g, SUGGESTION_KEYS as h, MAX_QUESTION_LENGTH as i, ACTION_ERROR_MESSAGE_KEYS as j, SETTLED_ACTION_STATUSES as k, QUIET_ACTION_STATUS_KEYS as l, MAX_NOTE_LENGTH as m, neetoAssistApi as n, RUN_TEST_ID as o, EXPANDED_PANE_WIDTH as p, COLLAPSED_PANE_WIDTH as q };
219
+ //# sourceMappingURL=neeto_assist-D1wzZ3ou.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neeto_assist-D1wzZ3ou.js","sources":["../app/javascript/src/common/constants.js","../app/javascript/src/apis/neeto_assist.js"],"sourcesContent":["export const BASE_URL = \"/neeto_assist/api/v1\";\n\n// The pane shows NeetoAssist's errors itself. Without these, the host's axios\n// setup would raise a toast, or swap the page for an error page on a 403, 404\n// or 429.\nexport const REQUEST_OPTIONS = {\n showToastr: false,\n show403ErrorPage: false,\n show404ErrorPage: false,\n show429ErrorPage: false,\n};\n\nexport const QUERY_KEYS = {\n STATUS: \"neeto-assist-status\",\n RUNS: \"neeto-assist-runs\",\n ASSISTANT_THREAD: \"neeto-assist-assistant-thread\",\n};\n\n// What the pane shows: the conversation a NeetoAssistButton opened it on, or\n// the signed-in person's own assistant. A host that never opens the assistant\n// only ever has the first.\nexport const PANE_MODES = {\n CONVERSATION: \"conversation\",\n ASSISTANT: \"assistant\",\n};\n\n// The engine sends at most six first questions for an empty thread.\nexport const MAX_ASSISTANT_SUGGESTIONS = 6;\n\nexport const PENDING_POLL_INTERVAL = 2_000;\n\nexport const IDLE_POLL_INTERVAL = 30_000;\n\nexport const PENDING_STATUSES = [\"queued\", \"running\"];\n\nexport const RATEABLE_STATUSES = [\"completed\", \"skipped\"];\n\n// A person stopped their ask before NeetoAssist answered it.\nexport const STOPPED_STATUS = \"stopped\";\n\n// How long a copy button shows that it copied.\nexport const COPIED_FOR = 1_500;\n\n// The word before a source's title for what kind of thing it is, for the kinds\n// that have one. A conversation's title already says it is one, as in\n// \"Conversation with Priya Nair on 3 November 2026\", so it gets none, nor does\n// a record. A lookup is named by the product it read. A map, so that only these\n// kinds have a word, and no name an object has of its own, such as\n// \"constructor\", reads as one.\nexport const SOURCE_KIND_KEYS = new Map([\n [\"help_article\", \"neetoAssist.sources.helpArticle\"],\n [\"api_doc\", \"neetoAssist.sources.apiDoc\"],\n]);\n\n// The kind of a source from an older NeetoAssist, which cited nothing else.\nexport const DEFAULT_SOURCE_KIND = \"help_article\";\n\nexport const LOOKUP_SOURCE_KIND = \"lookup\";\n\n// What became of a suggested action. NeetoAssist has the last word on an\n// action in one of these: nothing a click says can be newer.\nexport const SETTLED_ACTION_STATUSES = [\n \"applied\",\n \"failed\",\n \"dismissed\",\n \"expired\",\n];\n\n// A suggestion nobody took up steps back to one muted line.\nexport const QUIET_ACTION_STATUS_KEYS = {\n dismissed: \"neetoAssist.actions.dismissed\",\n expired: \"neetoAssist.actions.expired\",\n};\n\n// The skips from the workspace's quiet rules, in NeetoAssist's settings. Each\n// one holds for every visitor message until something changes, such as the\n// agent who owns the conversation handing it back.\nexport const QUIET_SKIPPED_REASONS = [\n \"assigned_to_human\",\n \"handed_off\",\n \"no_answer_cooldown\",\n];\n\n// These skips come from the workspace's state, not from reading the\n// conversation, so there is nothing for a rep to judge.\nexport const UNRATEABLE_SKIPPED_REASONS = [\n \"disabled\",\n \"no_knowledge_source\",\n \"out_of_credits\",\n ...QUIET_SKIPPED_REASONS,\n];\n\nexport const MAX_QUESTION_LENGTH = 2_000;\n\nexport const MAX_NOTE_LENGTH = 2_000;\n\n// The same widths as Neeti's pane in NeetoCal, so Neeto's assistants feel alike.\nexport const COLLAPSED_PANE_WIDTH = \"min(100vw, 400px)\";\n\nexport const EXPANDED_PANE_WIDTH = \"min(50vw, 800px)\";\n\nexport const EXPANDED_STORAGE_KEY = \"neetoAssist.isExpanded\";\n\nexport const REPLY_SUGGESTION = \"reply_suggestion\";\n\nexport const RUN_TEST_ID = \"neeto-assist-run\";\n\nexport const SUGGESTION_KEYS = [\n \"neetoAssist.suggestions.summarize\",\n \"neetoAssist.suggestions.whatToReply\",\n \"neetoAssist.suggestions.writtenBefore\",\n \"neetoAssist.suggestions.whatNext\",\n];\n\nexport const SKIPPED_REASON_MESSAGE_KEYS = {\n greeting: \"neetoAssist.skippedReasons.greeting\",\n acknowledgment: \"neetoAssist.skippedReasons.acknowledgment\",\n agent_handoff: \"neetoAssist.skippedReasons.agentHandoff\",\n unclear: \"neetoAssist.skippedReasons.unclear\",\n other_product: \"neetoAssist.skippedReasons.otherProduct\",\n no_knowledge_source: \"neetoAssist.skippedReasons.noKnowledgeSource\",\n disabled: \"neetoAssist.skippedReasons.disabled\",\n no_question: \"neetoAssist.skippedReasons.noQuestion\",\n out_of_credits: \"neetoAssist.skippedReasons.outOfCredits\",\n assigned_to_human: \"neetoAssist.skippedReasons.assignedToHuman\",\n handed_off: \"neetoAssist.skippedReasons.handedOff\",\n no_answer_cooldown: \"neetoAssist.skippedReasons.noAnswerCooldown\",\n};\n\nexport const ERROR_MESSAGE_KEYS = {\n 404: \"neetoAssist.errors.notFound\",\n 409: \"neetoAssist.errors.disabled\",\n 422: \"neetoAssist.errors.invalid\",\n 503: \"neetoAssist.errors.unavailable\",\n};\n\n// The assistant is no conversation, so a 404 there says so in its own words.\nexport const ASSISTANT_ERROR_MESSAGE_KEYS = {\n ...ERROR_MESSAGE_KEYS,\n 404: \"neetoAssist.assistant.errors.notFound\",\n};\n\n// A click on a card that changed nothing. The other answers fall back to the\n// keys above.\nexport const ACTION_ERROR_MESSAGE_KEYS = {\n 403: \"neetoAssist.actions.errors.forbidden\",\n 503: \"neetoAssist.actions.errors.unavailable\",\n};\n","import axios from \"axios\";\n\nimport { BASE_URL, REQUEST_OPTIONS } from \"common/constants\";\n\n// Runs live on a conversation, or on one of the signed-in person's own\n// assistant threads. The engine builds the thread's id at NeetoAssist from the\n// session's person, so the key is all the browser sends.\nconst threadUrl = ({ conversationId, threadId }) =>\n threadId\n ? `${BASE_URL}/assistant/threads/${encodeURIComponent(threadId)}`\n : `${BASE_URL}/conversations/${encodeURIComponent(conversationId)}`;\n\nconst runsUrl = where => `${threadUrl(where)}/runs`;\n\n// Cards are only ever on a conversation: an assistant thread has none.\nconst actionUrl = ({ conversationId, actionId }) =>\n `${BASE_URL}/conversations/${encodeURIComponent(\n conversationId\n )}/actions/${encodeURIComponent(actionId)}`;\n\nconst fetchStatus = () => axios.get(`${BASE_URL}/status`, REQUEST_OPTIONS);\n\nconst fetchAssistantThread = () =>\n axios.get(`${BASE_URL}/assistant/thread`, REQUEST_OPTIONS);\n\nconst createAssistantThread = () =>\n axios.post(`${BASE_URL}/assistant/thread`, {}, REQUEST_OPTIONS);\n\nconst fetchRuns = where => axios.get(runsUrl(where), REQUEST_OPTIONS);\n\n// The page a person asks the assistant on, read at the moment they ask, so\n// NeetoAssist knows what they are looking at: the pathname and the page's\n// title. Search terms and fragments can name a customer, so neither goes.\nconst currentPage = () => ({\n path: globalThis.location.pathname,\n title: globalThis.document.title,\n});\n\nconst createRun = ({ question, requestId, ...where }) =>\n axios.post(\n runsUrl(where),\n {\n run: { question, request_id: requestId },\n ...(where.threadId ? { page: currentPage() } : {}),\n },\n REQUEST_OPTIONS\n );\n\nconst updateFeedback = ({ runId, rating, note, ...where }) =>\n axios.put(\n `${runsUrl(where)}/${encodeURIComponent(runId)}/feedback`,\n { feedback: { rating, note } },\n REQUEST_OPTIONS\n );\n\n// Stops the person's own ask while NeetoAssist is still on it. The engine says\n// who is asking, so the request names only the run.\nconst stopRun = ({ runId, ...where }) =>\n axios.post(\n `${runsUrl(where)}/${encodeURIComponent(runId)}/stop`,\n {},\n REQUEST_OPTIONS\n );\n\n// The host makes the change as the signed-in rep, so the request says only\n// which action. Nothing about the change itself comes from the browser.\nconst applyAction = action =>\n axios.post(`${actionUrl(action)}/apply`, {}, REQUEST_OPTIONS);\n\nconst dismissAction = action =>\n axios.post(`${actionUrl(action)}/dismiss`, {}, REQUEST_OPTIONS);\n\nconst neetoAssistApi = {\n fetchStatus,\n fetchAssistantThread,\n createAssistantThread,\n fetchRuns,\n createRun,\n updateFeedback,\n stopRun,\n applyAction,\n dismissAction,\n};\n\nexport default neetoAssistApi;\n"],"names":["BASE_URL","REQUEST_OPTIONS","showToastr","show403ErrorPage","show404ErrorPage","show429ErrorPage","QUERY_KEYS","STATUS","RUNS","ASSISTANT_THREAD","PANE_MODES","CONVERSATION","ASSISTANT","MAX_ASSISTANT_SUGGESTIONS","PENDING_POLL_INTERVAL","IDLE_POLL_INTERVAL","PENDING_STATUSES","RATEABLE_STATUSES","STOPPED_STATUS","COPIED_FOR","SOURCE_KIND_KEYS","Map","DEFAULT_SOURCE_KIND","LOOKUP_SOURCE_KIND","SETTLED_ACTION_STATUSES","QUIET_ACTION_STATUS_KEYS","dismissed","expired","QUIET_SKIPPED_REASONS","UNRATEABLE_SKIPPED_REASONS","concat","MAX_QUESTION_LENGTH","MAX_NOTE_LENGTH","COLLAPSED_PANE_WIDTH","EXPANDED_PANE_WIDTH","EXPANDED_STORAGE_KEY","REPLY_SUGGESTION","RUN_TEST_ID","SUGGESTION_KEYS","SKIPPED_REASON_MESSAGE_KEYS","greeting","acknowledgment","agent_handoff","unclear","other_product","no_knowledge_source","disabled","no_question","out_of_credits","assigned_to_human","handed_off","no_answer_cooldown","ERROR_MESSAGE_KEYS","ASSISTANT_ERROR_MESSAGE_KEYS","_objectSpread","ACTION_ERROR_MESSAGE_KEYS","threadUrl","_ref","conversationId","threadId","encodeURIComponent","runsUrl","where","actionUrl","_ref2","actionId","fetchStatus","axios","get","fetchAssistantThread","createAssistantThread","post","fetchRuns","currentPage","path","globalThis","location","pathname","title","document","createRun","_ref3","question","requestId","_objectWithoutProperties","_excluded","run","request_id","page","updateFeedback","_ref4","runId","rating","note","_excluded2","put","feedback","stopRun","_ref5","_excluded3","applyAction","action","dismissAction","neetoAssistApi"],"mappings":";;;;;;AAAO,IAAMA,QAAQ,GAAG,sBAAsB;;AAE9C;AACA;AACA;AACO,IAAMC,eAAe,GAAG;AAC7BC,EAAAA,UAAU,EAAE,KAAK;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rC,EAAAA,WAAW,EAAXA,WAAW;AACXG,EAAAA,oBAAoB,EAApBA,oBAAoB;AACpBC,EAAAA,qBAAqB,EAArBA,qBAAqB;AACrBE,EAAAA,SAAS,EAATA,SAAS;AACTQ,EAAAA,SAAS,EAATA,SAAS;AACTS,EAAAA,cAAc,EAAdA,cAAc;AACdQ,EAAAA,OAAO,EAAPA,OAAO;AACPG,EAAAA,WAAW,EAAXA,WAAW;AACXE,EAAAA,aAAa,EAAbA;AACF;;;;"}
@@ -0,0 +1,41 @@
1
+ import { P as PANE_MODES } from './neeto_assist-D1wzZ3ou.js';
2
+ import useNeetoAssistStatus from './useNeetoAssistStatus.js';
3
+ import { u as useNeetoAssistStore } from './useNeetoAssistStore-Dgt8aV52.js';
4
+ import '@babel/runtime/helpers/defineProperty';
5
+ import '@babel/runtime/helpers/objectWithoutProperties';
6
+ import 'axios';
7
+ import '@tanstack/react-query';
8
+ import '@bigbinary/neeto-commons-frontend/v2/react-utils';
9
+ import '@bigbinary/neeto-commons-frontend/v2/utils';
10
+ import 'zustand';
11
+
12
+ // For a host's own entry to the assistant, such as a sidebar item: whether the
13
+ // signed-in person may use it, whether the pane shows it, and the way to open
14
+ // and close it. The pane mounted in the layout shows it. Opening it takes the
15
+ // pane's place from a conversation, and a NeetoAssistButton takes it back.
16
+ var useNeetoAssistAssistant = function useNeetoAssistAssistant() {
17
+ var _useNeetoAssistStatus = useNeetoAssistStatus(),
18
+ status = _useNeetoAssistStatus.data;
19
+ var isOpen = useNeetoAssistStore(function (state) {
20
+ return state.isOpen && state.mode === PANE_MODES.ASSISTANT;
21
+ });
22
+ var open = useNeetoAssistStore(function (state) {
23
+ return state.openAssistant;
24
+ });
25
+ var close = useNeetoAssistStore(function (state) {
26
+ return state.closeAssistant;
27
+ });
28
+ var toggle = useNeetoAssistStore(function (state) {
29
+ return state.toggleAssistant;
30
+ });
31
+ return {
32
+ isAvailable: (status === null || status === void 0 ? void 0 : status.assistant) === true,
33
+ isOpen: isOpen,
34
+ open: open,
35
+ close: close,
36
+ toggle: toggle
37
+ };
38
+ };
39
+
40
+ export { useNeetoAssistAssistant as default };
41
+ //# sourceMappingURL=useNeetoAssistAssistant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNeetoAssistAssistant.js","sources":["../app/javascript/src/hooks/useNeetoAssistAssistant.js"],"sourcesContent":["import { PANE_MODES } from \"common/constants\";\nimport useNeetoAssistStatus from \"hooks/useNeetoAssistStatus\";\nimport useNeetoAssistStore from \"stores/useNeetoAssistStore\";\n\n// For a host's own entry to the assistant, such as a sidebar item: whether the\n// signed-in person may use it, whether the pane shows it, and the way to open\n// and close it. The pane mounted in the layout shows it. Opening it takes the\n// pane's place from a conversation, and a NeetoAssistButton takes it back.\nconst useNeetoAssistAssistant = () => {\n const { data: status } = useNeetoAssistStatus();\n const isOpen = useNeetoAssistStore(\n state => state.isOpen && state.mode === PANE_MODES.ASSISTANT\n );\n const open = useNeetoAssistStore(state => state.openAssistant);\n const close = useNeetoAssistStore(state => state.closeAssistant);\n const toggle = useNeetoAssistStore(state => state.toggleAssistant);\n\n return {\n isAvailable: status?.assistant === true,\n isOpen,\n open,\n close,\n toggle,\n };\n};\n\nexport default useNeetoAssistAssistant;\n"],"names":["useNeetoAssistAssistant","_useNeetoAssistStatus","useNeetoAssistStatus","status","data","isOpen","useNeetoAssistStore","state","mode","PANE_MODES","ASSISTANT","open","openAssistant","close","closeAssistant","toggle","toggleAssistant","isAvailable","assistant"],"mappings":";;;;;;;;;;;AAIA;AACA;AACA;AACA;AACA,IAAMA,uBAAuB,GAAG,SAA1BA,uBAAuBA,GAAS;AACpC,EAAA,IAAAC,qBAAA,GAAyBC,oBAAoB,EAAE;IAAjCC,MAAM,GAAAF,qBAAA,CAAZG,IAAI;AACZ,EAAA,IAAMC,MAAM,GAAGC,mBAAmB,CAChC,UAAAC,KAAK,EAAA;IAAA,OAAIA,KAAK,CAACF,MAAM,IAAIE,KAAK,CAACC,IAAI,KAAKC,UAAU,CAACC,SAAS;AAAA,EAAA,CAC9D,CAAC;AACD,EAAA,IAAMC,IAAI,GAAGL,mBAAmB,CAAC,UAAAC,KAAK,EAAA;IAAA,OAAIA,KAAK,CAACK,aAAa;EAAA,CAAA,CAAC;AAC9D,EAAA,IAAMC,KAAK,GAAGP,mBAAmB,CAAC,UAAAC,KAAK,EAAA;IAAA,OAAIA,KAAK,CAACO,cAAc;EAAA,CAAA,CAAC;AAChE,EAAA,IAAMC,MAAM,GAAGT,mBAAmB,CAAC,UAAAC,KAAK,EAAA;IAAA,OAAIA,KAAK,CAACS,eAAe;EAAA,CAAA,CAAC;EAElE,OAAO;IACLC,WAAW,EAAE,CAAAd,MAAM,KAAA,IAAA,IAANA,MAAM,uBAANA,MAAM,CAAEe,SAAS,MAAK,IAAI;AACvCb,IAAAA,MAAM,EAANA,MAAM;AACNM,IAAAA,IAAI,EAAJA,IAAI;AACJE,IAAAA,KAAK,EAALA,KAAK;AACLE,IAAAA,MAAM,EAANA;GACD;AACH;;;;"}
@@ -1,5 +1,7 @@
1
1
  import { useQuery } from '@tanstack/react-query';
2
- import { n as neetoAssistApi, Q as QUERY_KEYS } from './neeto_assist-CpUBA-3Z.js';
2
+ import { n as neetoAssistApi, Q as QUERY_KEYS } from './neeto_assist-D1wzZ3ou.js';
3
+ import '@babel/runtime/helpers/defineProperty';
4
+ import '@babel/runtime/helpers/objectWithoutProperties';
3
5
  import 'axios';
4
6
 
5
7
  // Answers every signed-in rep with { enabled }. A failure shows nothing to the
@@ -1 +1 @@
1
- {"version":3,"file":"useNeetoAssistStatus.js","sources":["../app/javascript/src/hooks/useNeetoAssistStatus.js"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\n\nimport neetoAssistApi from \"apis/neeto_assist\";\nimport { QUERY_KEYS } from \"common/constants\";\n\n// Answers every signed-in rep with { enabled }. A failure shows nothing to the\n// rep and leaves data empty, so the host reads it as not enabled.\nconst useNeetoAssistStatus = () =>\n useQuery({\n queryKey: [QUERY_KEYS.STATUS],\n queryFn: neetoAssistApi.fetchStatus,\n retry: false,\n });\n\nexport default useNeetoAssistStatus;\n"],"names":["useNeetoAssistStatus","useQuery","queryKey","QUERY_KEYS","STATUS","queryFn","neetoAssistApi","fetchStatus","retry"],"mappings":";;;;AAKA;AACA;AACA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,GAAA;AAAA,EAAA,OACxBC,QAAQ,CAAC;AACPC,IAAAA,QAAQ,EAAE,CAACC,UAAU,CAACC,MAAM,CAAC;IAC7BC,OAAO,EAAEC,cAAc,CAACC,WAAW;AACnCC,IAAAA,KAAK,EAAE;AACT,GAAC,CAAC;AAAA;;;;"}
1
+ {"version":3,"file":"useNeetoAssistStatus.js","sources":["../app/javascript/src/hooks/useNeetoAssistStatus.js"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\n\nimport neetoAssistApi from \"apis/neeto_assist\";\nimport { QUERY_KEYS } from \"common/constants\";\n\n// Answers every signed-in rep with { enabled }. A failure shows nothing to the\n// rep and leaves data empty, so the host reads it as not enabled.\nconst useNeetoAssistStatus = () =>\n useQuery({\n queryKey: [QUERY_KEYS.STATUS],\n queryFn: neetoAssistApi.fetchStatus,\n retry: false,\n });\n\nexport default useNeetoAssistStatus;\n"],"names":["useNeetoAssistStatus","useQuery","queryKey","QUERY_KEYS","STATUS","queryFn","neetoAssistApi","fetchStatus","retry"],"mappings":";;;;;;AAKA;AACA;AACA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,GAAA;AAAA,EAAA,OACxBC,QAAQ,CAAC;AACPC,IAAAA,QAAQ,EAAE,CAACC,UAAU,CAACC,MAAM,CAAC;IAC7BC,OAAO,EAAEC,cAAc,CAACC,WAAW;AACnCC,IAAAA,KAAK,EAAE;AACT,GAAC,CAAC;AAAA;;;;"}
@@ -0,0 +1,103 @@
1
+ 'use strict';
2
+
3
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/v2/react-utils');
5
+ var utils = require('@bigbinary/neeto-commons-frontend/v2/utils');
6
+ var zustand = require('zustand');
7
+ var neeto_assist = require('./neeto_assist-COp7BR77.js');
8
+
9
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
+ var isShowingAssistant = function isShowingAssistant(state) {
12
+ return state.isOpen && state.mode === neeto_assist.PANE_MODES.ASSISTANT;
13
+ };
14
+
15
+ // The pane is mounted once in the host's layout and the button sits on the
16
+ // ticket, so this is how they talk: whether the pane is open and how wide, and
17
+ // which conversation it is about. A reload starts closed, and the width is kept.
18
+ // The host can open the person's own assistant in the same pane, and whichever
19
+ // was opened last is what the pane shows. A host that never opens the
20
+ // assistant only ever shows conversations.
21
+ /** @type {import("neetocommons/react-utils").ZustandStoreHook} */
22
+ var useNeetoAssistStore = zustand.create(reactUtils.withImmutableActions(function (set) {
23
+ return {
24
+ isOpen: false,
25
+ isExpanded: utils.getFromLocalStorage(neeto_assist.EXPANDED_STORAGE_KEY) || false,
26
+ mode: neeto_assist.PANE_MODES.CONVERSATION,
27
+ conversation: null,
28
+ seenDrafts: {},
29
+ close: function close() {
30
+ return set({
31
+ isOpen: false
32
+ });
33
+ },
34
+ // The button on a ticket. It closes the pane when the pane shows that
35
+ // conversation, and otherwise shows the conversation, the assistant giving
36
+ // way to it.
37
+ toggle: function toggle() {
38
+ return set(function (state) {
39
+ return state.isOpen && state.mode !== neeto_assist.PANE_MODES.ASSISTANT ? {
40
+ isOpen: false
41
+ } : {
42
+ isOpen: true,
43
+ mode: neeto_assist.PANE_MODES.CONVERSATION
44
+ };
45
+ });
46
+ },
47
+ openAssistant: function openAssistant() {
48
+ return set({
49
+ isOpen: true,
50
+ mode: neeto_assist.PANE_MODES.ASSISTANT
51
+ });
52
+ },
53
+ // Only the assistant: a conversation the pane shows instead stays open.
54
+ closeAssistant: function closeAssistant() {
55
+ return set(function (state) {
56
+ return isShowingAssistant(state) ? {
57
+ isOpen: false
58
+ } : {};
59
+ });
60
+ },
61
+ toggleAssistant: function toggleAssistant() {
62
+ return set(function (state) {
63
+ return isShowingAssistant(state) ? {
64
+ isOpen: false
65
+ } : {
66
+ isOpen: true,
67
+ mode: neeto_assist.PANE_MODES.ASSISTANT
68
+ };
69
+ });
70
+ },
71
+ setExpanded: function setExpanded(value) {
72
+ utils.setToLocalStorage(neeto_assist.EXPANDED_STORAGE_KEY, value);
73
+ set({
74
+ isExpanded: value
75
+ });
76
+ },
77
+ setConversation: function setConversation(conversation) {
78
+ return set({
79
+ conversation: conversation
80
+ });
81
+ },
82
+ // Only the conversation that is leaving: the next one's button may already
83
+ // have taken its place.
84
+ clearConversation: function clearConversation(conversationId) {
85
+ return set(function (state) {
86
+ var _state$conversation;
87
+ return ((_state$conversation = state.conversation) === null || _state$conversation === void 0 ? void 0 : _state$conversation.id) === conversationId ? {
88
+ conversation: null
89
+ } : {};
90
+ });
91
+ },
92
+ markDraftSeen: function markDraftSeen(conversationId, runId) {
93
+ return set(function (state) {
94
+ return {
95
+ seenDrafts: _objectSpread(_objectSpread({}, state.seenDrafts), {}, _defineProperty({}, conversationId, runId))
96
+ };
97
+ });
98
+ }
99
+ };
100
+ }));
101
+
102
+ exports.useNeetoAssistStore = useNeetoAssistStore;
103
+ //# sourceMappingURL=useNeetoAssistStore-Bj6niQdc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNeetoAssistStore-Bj6niQdc.js","sources":["../app/javascript/src/stores/useNeetoAssistStore.js"],"sourcesContent":["import { withImmutableActions } from \"neetocommons/v2/react-utils\";\nimport { getFromLocalStorage, setToLocalStorage } from \"neetocommons/v2/utils\";\nimport { create } from \"zustand\";\n\nimport { EXPANDED_STORAGE_KEY, PANE_MODES } from \"common/constants\";\n\nconst isShowingAssistant = state =>\n state.isOpen && state.mode === PANE_MODES.ASSISTANT;\n\n// The pane is mounted once in the host's layout and the button sits on the\n// ticket, so this is how they talk: whether the pane is open and how wide, and\n// which conversation it is about. A reload starts closed, and the width is kept.\n// The host can open the person's own assistant in the same pane, and whichever\n// was opened last is what the pane shows. A host that never opens the\n// assistant only ever shows conversations.\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useNeetoAssistStore = create(\n withImmutableActions(set => ({\n isOpen: false,\n isExpanded: getFromLocalStorage(EXPANDED_STORAGE_KEY) || false,\n mode: PANE_MODES.CONVERSATION,\n conversation: null,\n seenDrafts: {},\n\n close: () => set({ isOpen: false }),\n\n // The button on a ticket. It closes the pane when the pane shows that\n // conversation, and otherwise shows the conversation, the assistant giving\n // way to it.\n toggle: () =>\n set(state =>\n state.isOpen && state.mode !== PANE_MODES.ASSISTANT\n ? { isOpen: false }\n : { isOpen: true, mode: PANE_MODES.CONVERSATION }\n ),\n\n openAssistant: () => set({ isOpen: true, mode: PANE_MODES.ASSISTANT }),\n\n // Only the assistant: a conversation the pane shows instead stays open.\n closeAssistant: () =>\n set(state => (isShowingAssistant(state) ? { isOpen: false } : {})),\n\n toggleAssistant: () =>\n set(state =>\n isShowingAssistant(state)\n ? { isOpen: false }\n : { isOpen: true, mode: PANE_MODES.ASSISTANT }\n ),\n\n setExpanded: value => {\n setToLocalStorage(EXPANDED_STORAGE_KEY, value);\n set({ isExpanded: value });\n },\n\n setConversation: conversation => set({ conversation }),\n\n // Only the conversation that is leaving: the next one's button may already\n // have taken its place.\n clearConversation: conversationId =>\n set(state =>\n state.conversation?.id === conversationId ? { conversation: null } : {}\n ),\n\n markDraftSeen: (conversationId, runId) =>\n set(state => ({\n seenDrafts: { ...state.seenDrafts, [conversationId]: runId },\n })),\n }))\n);\n\nexport default useNeetoAssistStore;\n"],"names":["isShowingAssistant","state","isOpen","mode","PANE_MODES","ASSISTANT","useNeetoAssistStore","create","withImmutableActions","set","isExpanded","getFromLocalStorage","EXPANDED_STORAGE_KEY","CONVERSATION","conversation","seenDrafts","close","toggle","openAssistant","closeAssistant","toggleAssistant","setExpanded","value","setToLocalStorage","setConversation","clearConversation","conversationId","_state$conversation","id","markDraftSeen","runId","_objectSpread","_defineProperty"],"mappings":";;;;;;;;;;AAMA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAGC,KAAK,EAAA;EAAA,OAC9BA,KAAK,CAACC,MAAM,IAAID,KAAK,CAACE,IAAI,KAAKC,uBAAU,CAACC,SAAS;AAAA,CAAA;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,mBAAmB,GAAGC,cAAM,CAChCC,+BAAoB,CAAC,UAAAC,GAAG,EAAA;EAAA,OAAK;AAC3BP,IAAAA,MAAM,EAAE,KAAK;AACbQ,IAAAA,UAAU,EAAEC,yBAAmB,CAACC,iCAAoB,CAAC,IAAI,KAAK;IAC9DT,IAAI,EAAEC,uBAAU,CAACS,YAAY;AAC7BC,IAAAA,YAAY,EAAE,IAAI;IAClBC,UAAU,EAAE,EAAE;IAEdC,KAAK,EAAE,SAAPA,KAAKA,GAAA;AAAA,MAAA,OAAQP,GAAG,CAAC;AAAEP,QAAAA,MAAM,EAAE;AAAM,OAAC,CAAC;AAAA,IAAA,CAAA;AAEnC;AACA;AACA;IACAe,MAAM,EAAE,SAARA,MAAMA,GAAA;MAAA,OACJR,GAAG,CAAC,UAAAR,KAAK,EAAA;QAAA,OACPA,KAAK,CAACC,MAAM,IAAID,KAAK,CAACE,IAAI,KAAKC,uBAAU,CAACC,SAAS,GAC/C;AAAEH,UAAAA,MAAM,EAAE;AAA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nBA,iBAAiBA,CAAEC,cAAc,EAAA;MAAA,OAC/BjB,GAAG,CAAC,UAAAR,KAAK,EAAA;AAAA,QAAA,IAAA0B,mBAAA;AAAA,QAAA,OACP,CAAA,CAAAA,mBAAA,GAAA1B,KAAK,CAACa,YAAY,MAAA,IAAA,IAAAa,mBAAA,KAAA,MAAA,GAAA,MAAA,GAAlBA,mBAAA,CAAoBC,EAAE,MAAKF,cAAc,GAAG;AAAEZ,UAAAA,YAAY,EAAE;SAAM,GAAG,EAAE;AAAA,MAAA,CACzE,CAAC;AAAA,IAAA,CAAA;AAEHe,IAAAA,aAAa,EAAE,SAAfA,aAAaA,CAAGH,cAAc,EAAEI,KAAK,EAAA;MAAA,OACnCrB,GAAG,CAAC,UAAAR,KAAK,EAAA;QAAA,OAAK;AACZc,UAAAA,UAAU,EAAAgB,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAO9B,KAAK,CAACc,UAAU,CAAA,EAAA,EAAA,EAAAiB,eAAA,CAAA,EAAA,EAAGN,cAAc,EAAGI,KAAK,CAAA;SAC3D;AAAA,MAAA,CAAC,CAAC;AAAA,IAAA;GACN;AAAA,CAAC,CACJ;;;;"}
@@ -0,0 +1,101 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import { withImmutableActions } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
3
+ import { setToLocalStorage, getFromLocalStorage } from '@bigbinary/neeto-commons-frontend/v2/utils';
4
+ import { create } from 'zustand';
5
+ import { P as PANE_MODES, E as EXPANDED_STORAGE_KEY } from './neeto_assist-D1wzZ3ou.js';
6
+
7
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
+ var isShowingAssistant = function isShowingAssistant(state) {
10
+ return state.isOpen && state.mode === PANE_MODES.ASSISTANT;
11
+ };
12
+
13
+ // The pane is mounted once in the host's layout and the button sits on the
14
+ // ticket, so this is how they talk: whether the pane is open and how wide, and
15
+ // which conversation it is about. A reload starts closed, and the width is kept.
16
+ // The host can open the person's own assistant in the same pane, and whichever
17
+ // was opened last is what the pane shows. A host that never opens the
18
+ // assistant only ever shows conversations.
19
+ /** @type {import("neetocommons/react-utils").ZustandStoreHook} */
20
+ var useNeetoAssistStore = create(withImmutableActions(function (set) {
21
+ return {
22
+ isOpen: false,
23
+ isExpanded: getFromLocalStorage(EXPANDED_STORAGE_KEY) || false,
24
+ mode: PANE_MODES.CONVERSATION,
25
+ conversation: null,
26
+ seenDrafts: {},
27
+ close: function close() {
28
+ return set({
29
+ isOpen: false
30
+ });
31
+ },
32
+ // The button on a ticket. It closes the pane when the pane shows that
33
+ // conversation, and otherwise shows the conversation, the assistant giving
34
+ // way to it.
35
+ toggle: function toggle() {
36
+ return set(function (state) {
37
+ return state.isOpen && state.mode !== PANE_MODES.ASSISTANT ? {
38
+ isOpen: false
39
+ } : {
40
+ isOpen: true,
41
+ mode: PANE_MODES.CONVERSATION
42
+ };
43
+ });
44
+ },
45
+ openAssistant: function openAssistant() {
46
+ return set({
47
+ isOpen: true,
48
+ mode: PANE_MODES.ASSISTANT
49
+ });
50
+ },
51
+ // Only the assistant: a conversation the pane shows instead stays open.
52
+ closeAssistant: function closeAssistant() {
53
+ return set(function (state) {
54
+ return isShowingAssistant(state) ? {
55
+ isOpen: false
56
+ } : {};
57
+ });
58
+ },
59
+ toggleAssistant: function toggleAssistant() {
60
+ return set(function (state) {
61
+ return isShowingAssistant(state) ? {
62
+ isOpen: false
63
+ } : {
64
+ isOpen: true,
65
+ mode: PANE_MODES.ASSISTANT
66
+ };
67
+ });
68
+ },
69
+ setExpanded: function setExpanded(value) {
70
+ setToLocalStorage(EXPANDED_STORAGE_KEY, value);
71
+ set({
72
+ isExpanded: value
73
+ });
74
+ },
75
+ setConversation: function setConversation(conversation) {
76
+ return set({
77
+ conversation: conversation
78
+ });
79
+ },
80
+ // Only the conversation that is leaving: the next one's button may already
81
+ // have taken its place.
82
+ clearConversation: function clearConversation(conversationId) {
83
+ return set(function (state) {
84
+ var _state$conversation;
85
+ return ((_state$conversation = state.conversation) === null || _state$conversation === void 0 ? void 0 : _state$conversation.id) === conversationId ? {
86
+ conversation: null
87
+ } : {};
88
+ });
89
+ },
90
+ markDraftSeen: function markDraftSeen(conversationId, runId) {
91
+ return set(function (state) {
92
+ return {
93
+ seenDrafts: _objectSpread(_objectSpread({}, state.seenDrafts), {}, _defineProperty({}, conversationId, runId))
94
+ };
95
+ });
96
+ }
97
+ };
98
+ }));
99
+
100
+ export { useNeetoAssistStore as u };
101
+ //# sourceMappingURL=useNeetoAssistStore-Dgt8aV52.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNeetoAssistStore-Dgt8aV52.js","sources":["../app/javascript/src/stores/useNeetoAssistStore.js"],"sourcesContent":["import { withImmutableActions } from \"neetocommons/v2/react-utils\";\nimport { getFromLocalStorage, setToLocalStorage } from \"neetocommons/v2/utils\";\nimport { create } from \"zustand\";\n\nimport { EXPANDED_STORAGE_KEY, PANE_MODES } from \"common/constants\";\n\nconst isShowingAssistant = state =>\n state.isOpen && state.mode === PANE_MODES.ASSISTANT;\n\n// The pane is mounted once in the host's layout and the button sits on the\n// ticket, so this is how they talk: whether the pane is open and how wide, and\n// which conversation it is about. A reload starts closed, and the width is kept.\n// The host can open the person's own assistant in the same pane, and whichever\n// was opened last is what the pane shows. A host that never opens the\n// assistant only ever shows conversations.\n/** @type {import(\"neetocommons/react-utils\").ZustandStoreHook} */\nconst useNeetoAssistStore = create(\n withImmutableActions(set => ({\n isOpen: false,\n isExpanded: getFromLocalStorage(EXPANDED_STORAGE_KEY) || false,\n mode: PANE_MODES.CONVERSATION,\n conversation: null,\n seenDrafts: {},\n\n close: () => set({ isOpen: false }),\n\n // The button on a ticket. It closes the pane when the pane shows that\n // conversation, and otherwise shows the conversation, the assistant giving\n // way to it.\n toggle: () =>\n set(state =>\n state.isOpen && state.mode !== PANE_MODES.ASSISTANT\n ? { isOpen: false }\n : { isOpen: true, mode: PANE_MODES.CONVERSATION }\n ),\n\n openAssistant: () => set({ isOpen: true, mode: PANE_MODES.ASSISTANT }),\n\n // Only the assistant: a conversation the pane shows instead stays open.\n closeAssistant: () =>\n set(state => (isShowingAssistant(state) ? { isOpen: false } : {})),\n\n toggleAssistant: () =>\n set(state =>\n isShowingAssistant(state)\n ? { isOpen: false }\n : { isOpen: true, mode: PANE_MODES.ASSISTANT }\n ),\n\n setExpanded: value => {\n setToLocalStorage(EXPANDED_STORAGE_KEY, value);\n set({ isExpanded: value });\n },\n\n setConversation: conversation => set({ conversation }),\n\n // Only the conversation that is leaving: the next one's button may already\n // have taken its place.\n clearConversation: conversationId =>\n set(state =>\n state.conversation?.id === conversationId ? { conversation: null } : {}\n ),\n\n markDraftSeen: (conversationId, runId) =>\n set(state => ({\n seenDrafts: { ...state.seenDrafts, [conversationId]: runId },\n })),\n }))\n);\n\nexport default useNeetoAssistStore;\n"],"names":["isShowingAssistant","state","isOpen","mode","PANE_MODES","ASSISTANT","useNeetoAssistStore","create","withImmutableActions","set","isExpanded","getFromLocalStorage","EXPANDED_STORAGE_KEY","CONVERSATION","conversation","seenDrafts","close","toggle","openAssistant","closeAssistant","toggleAssistant","setExpanded","value","setToLocalStorage","setConversation","clearConversation","conversationId","_state$conversation","id","markDraftSeen","runId","_objectSpread","_defineProperty"],"mappings":";;;;;;;;AAMA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAGC,KAA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