@bikdotai/bik-component-library 0.0.861 → 0.0.862-beta.0
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 +4 -0
- package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +54 -44
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/AgentStateModal.js +2 -0
- package/dist/cjs/components/agent-builder/components/AgentStateModal.js.map +1 -0
- package/dist/cjs/components/agent-listing/AgentTableRow.js +1 -1
- package/dist/cjs/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.js +3 -3
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +23 -0
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js +99 -86
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/esm/components/agent-builder/components/AgentStateModal.d.ts +47 -0
- package/dist/esm/components/agent-builder/components/AgentStateModal.js +82 -0
- package/dist/esm/components/agent-builder/components/AgentStateModal.js.map +1 -0
- package/dist/esm/components/agent-builder/index.d.ts +2 -0
- package/dist/esm/components/agent-listing/AgentTableRow.js +71 -38
- package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
- package/dist/esm/index.js +549 -547
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentStateModal.js","sources":["../../../../../src/components/agent-builder/components/AgentStateModal.tsx"],"sourcesContent":["import ErrorIcon from '@src/assets/icons/errorIcon.svg';\nimport React from 'react';\nimport { Button } from '@src/components/button';\nimport { StyledModal } from '@src/components/modals';\nimport { Spinner } from '@src/components/spinner/Spinner';\nimport { BodyPrimary, TitleMedium } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport {\n\tAgentStateModalBody,\n\tAgentStateModalHero,\n\tModalActions,\n\tModalIcon,\n} from '../AgentBuilder.styled';\n\nexport type AgentModalState = 'loading' | 'error';\n\ninterface AgentStateAction {\n\ttext: string;\n\tonClick: () => void;\n\tisLoading?: boolean;\n}\n\ninterface AgentStateModalProps {\n\topen: boolean;\n\t/** `loading` while the write is in flight, `error` once it came back badly. */\n\tstate: AgentModalState;\n\t/** Heading, e.g. \"Agent couldn't go live\". Comes from the caller — on `error` the\n\t * server owns this copy, so the builder never composes it. */\n\ttitle: string;\n\t/** Body copy. Line breaks are preserved, so a caller can pass one line per reason\n\t * (e.g. per conflicting intent) without markup. */\n\tmessage: string;\n\t/** Right-hand action, e.g. \"Try again\", or the step to fix when the caller knows\n\t * one (\"Go to When it steps in\"). */\n\tprimaryButton?: AgentStateAction;\n\t/** Left-hand action, e.g. \"Go back to editing\". */\n\tsecondaryButton?: AgentStateAction;\n\t/** 64px image for the `loading` badge — pass the host's loader asset to match its\n\t * other dialogs. Falls back to `Spinner`, so the library needs no remote asset. */\n\tloadingImageUrl?: string;\n\t/** Cross button / outside click. Always available, so a message-only dialog is\n\t * still dismissible with no actions at all. Not offered while `loading`. */\n\tonClose: () => void;\n\tzIndex?: number;\n}\n\n/**\n * What's happening to a save or publish: in flight, or failed. Sibling of\n * `GoLiveModal` — same hero layout (badge, title, body, actions), and the actions sit\n * inside the body for the same reason (see GoLiveModal). Every state is pinned to\n * `AGENT_STATE_MODAL_MIN_HEIGHT`, the go-live success height, so the card doesn't\n * resize as one state replaces another.\n *\n * Deliberately copy-free: title, message and button labels all come from the caller,\n * because the server owns the wording of the failure it just reported.\n *\n * Both buttons are optional, so one component covers every shape — two actions, one,\n * or message-only. That last one is for a failure with nothing to offer: no step to\n * send the merchant to and nothing a retry would change. `loading` never renders\n * actions or a cross, since there is nothing to decide yet.\n */\nexport const AgentStateModal: React.FC<AgentStateModalProps> = ({\n\topen,\n\tstate,\n\ttitle,\n\tmessage,\n\tprimaryButton,\n\tsecondaryButton,\n\tloadingImageUrl,\n\tonClose,\n\tzIndex,\n}) => {\n\tif (!open) {\n\t\treturn null;\n\t}\n\n\tconst isLoading = state === 'loading';\n\tconst actions = isLoading ? null : secondaryButton ?? primaryButton;\n\n\treturn (\n\t\t<StyledModal\n\t\t\tdata-test=\"agent-state-modal\"\n\t\t\topen\n\t\t\tonClose={onClose}\n\t\t\twidth=\"520px\"\n\t\t\tzIndex={zIndex}\n\t\t\thideCrossButton={isLoading}\n\t\t\tcloseOnOutsideClick={!isLoading}\n\t\t\tcloseOnEscapeKey={!isLoading}\n\t\t>\n\t\t\t<AgentStateModalBody style={{ gap: '24px' }}>\n\t\t\t\t<AgentStateModalHero>\n\t\t\t\t\t<ModalIcon>\n\t\t\t\t\t\t{isLoading ? (\n\t\t\t\t\t\t\tloadingImageUrl ? (\n\t\t\t\t\t\t\t\t<img src={loadingImageUrl} alt=\"\" width={64} height={64} />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Spinner size=\"large\" color={COLORS.stroke.brand} />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ErrorIcon width={64} height={64} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ModalIcon>\n\n\t\t\t\t\t<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>\n\t\t\t\t\t\t<TitleMedium color={COLORS.content.primary}>{title}</TitleMedium>\n\t\t\t\t\t\t<BodyPrimary\n\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\tstyle={{ whiteSpace: 'pre-line' }}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{message}\n\t\t\t\t\t\t</BodyPrimary>\n\t\t\t\t\t</div>\n\t\t\t\t</AgentStateModalHero>\n\n\t\t\t\t{actions && (\n\t\t\t\t\t<ModalActions>\n\t\t\t\t\t\t{secondaryButton && (\n\t\t\t\t\t\t\t<div style={{ display: 'flex' }}>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdata-test=\"agent-state-secondary\"\n\t\t\t\t\t\t\t\t\tbuttonType=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\tmatchParentWidth\n\t\t\t\t\t\t\t\t\tbuttonText={secondaryButton.text}\n\t\t\t\t\t\t\t\t\tisLoading={secondaryButton.isLoading}\n\t\t\t\t\t\t\t\t\tonClick={secondaryButton.onClick}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{primaryButton && (\n\t\t\t\t\t\t\t<div style={{ display: 'flex' }}>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdata-test=\"agent-state-primary\"\n\t\t\t\t\t\t\t\t\tbuttonType=\"primary\"\n\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\tmatchParentWidth\n\t\t\t\t\t\t\t\t\tbuttonText={primaryButton.text}\n\t\t\t\t\t\t\t\t\tisLoading={primaryButton.isLoading}\n\t\t\t\t\t\t\t\t\tonClick={primaryButton.onClick}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ModalActions>\n\t\t\t\t)}\n\t\t\t</AgentStateModalBody>\n\t\t</StyledModal>\n\t);\n};\n"],"names":["AgentStateModal","open","state","title","message","primaryButton","secondaryButton","loadingImageUrl","onClose","zIndex","isLoading","actions","jsx","StyledModal","AgentStateModalBody","jsxs","AgentStateModalHero","ModalIcon","Spinner","COLORS","ErrorIcon","TitleMedium","BodyPrimary","ModalActions","Button"],"mappings":";;;;;;;;AA6DO,MAAMA,IAAkD,CAAC;AAAA,EAC/D,MAAAC;AAAA,EACA,OAAAC;AAAA,E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A;AAAA,UAAAjB,uBACC,OAAA,EAAI,OAAO,EAAE,SAAS,UACtB,UAAA,gBAAAM;AAAA,YAACY;AAAA,YAAA;AAAA,cACA,aAAU;AAAA,cACV,YAAW;AAAA,cACX,MAAK;AAAA,cACL,kBAAgB;AAAA,cAChB,YAAYlB,EAAgB;AAAA,cAC5B,WAAWA,EAAgB;AAAA,cAC3B,SAASA,EAAgB;AAAA,YAAA;AAAA,UAAA,GAE3B;AAAA,UAEAD,KACA,gBAAAO,EAAC,OAAA,EAAI,OAAO,EAAE,SAAS,UACtB,UAAA,gBAAAA;AAAA,YAACY;AAAA,YAAA;AAAA,cACA,aAAU;AAAA,cACV,YAAW;AAAA,cACX,MAAK;AAAA,cACL,kBAAgB;AAAA,cAChB,YAAYnB,EAAc;AAAA,cAC1B,WAAWA,EAAc;AAAA,cACzB,SAASA,EAAc;AAAA,YAAA;AAAA,UAAA,EACxB,CACD;AAAA,QAAA,EAAA,CAEF;AAAA,MAAA,EAAA,CAEF;AAAA,IAAA;AAAA,EAAA;AAGH;"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { AgentBuilder } from './AgentBuilder';
|
|
2
|
+
export { AgentStateModal } from './components/AgentStateModal';
|
|
3
|
+
export type { AgentModalState } from './components/AgentStateModal';
|
|
2
4
|
export { useAgentDraft } from './hooks/useAgentDraft';
|
|
3
5
|
export type { AgentDraft } from './hooks/useAgentDraft';
|
|
4
6
|
export { AGENT_CHAR_LIMITS } from './constants/charLimits';
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import S from "../../assets/icons/
|
|
5
|
-
import T from "../../assets/icons/
|
|
6
|
-
import
|
|
2
|
+
import x from "../../assets/icons/delete.svg.js";
|
|
3
|
+
import w from "../../assets/icons/edit.svg.js";
|
|
4
|
+
import S from "../../assets/icons/info.svg.js";
|
|
5
|
+
import T from "../../assets/icons/playOutline.svg.js";
|
|
6
|
+
import D from "../../assets/icons/vertical_dots.svg.js";
|
|
7
|
+
import { DropdownPopover as B } from "../dropdown/DropdownPopover/index.js";
|
|
7
8
|
import { BikShimmer as C } from "../shimmer/ShimmerComponent/BikShimmer.js";
|
|
8
|
-
import { TitleSmall as L, BodyCaption as O, BodySecondary as
|
|
9
|
+
import { TitleSmall as L, BodyCaption as O, BodySecondary as m } from "../TypographyStyle.js";
|
|
9
10
|
import R from "../../utils/StringUtils.js";
|
|
10
11
|
import { COLORS as o } from "../../constants/Theme.js";
|
|
11
|
-
import { ActionButton as
|
|
12
|
-
import { Tooltip as
|
|
13
|
-
import { Tag as
|
|
14
|
-
import { unwrapDropdownValue as
|
|
15
|
-
const
|
|
12
|
+
import { ActionButton as h, BodyGridRow as P, Cell as n, ActionGroup as $ } from "./AgentListing.styled.js";
|
|
13
|
+
import { Tooltip as c } from "../tooltips/Tooltip.js";
|
|
14
|
+
import { Tag as k } from "../tag/Tag.js";
|
|
15
|
+
import { unwrapDropdownValue as I } from "../dropdown/utils.js";
|
|
16
|
+
const A = (e) => {
|
|
16
17
|
switch (e.kind) {
|
|
17
18
|
case "topic":
|
|
18
19
|
return `Topic: ${R.capitalize(
|
|
@@ -23,21 +24,21 @@ const j = (e) => {
|
|
|
23
24
|
default:
|
|
24
25
|
return e.label ?? "";
|
|
25
26
|
}
|
|
26
|
-
},
|
|
27
|
+
}, Q = ({
|
|
27
28
|
agent: e,
|
|
28
29
|
onRunAgent: u,
|
|
29
30
|
onEditAgent: f,
|
|
30
31
|
onDeleteAgent: a,
|
|
31
32
|
onRowClick: l,
|
|
32
|
-
triggerCountLoading:
|
|
33
|
+
triggerCountLoading: y
|
|
33
34
|
}) => {
|
|
34
|
-
const
|
|
35
|
+
const d = e.status === "live", s = A(e.trigger), b = (i) => {
|
|
35
36
|
i.stopPropagation(), !e.isRunDisabled && u(e);
|
|
36
|
-
},
|
|
37
|
+
}, g = [
|
|
37
38
|
{
|
|
38
39
|
label: "Edit",
|
|
39
40
|
value: "edit",
|
|
40
|
-
leadingIcon: /* @__PURE__ */ t(
|
|
41
|
+
leadingIcon: /* @__PURE__ */ t(w, { width: 16, height: 16, color: o.content.secondary })
|
|
41
42
|
},
|
|
42
43
|
...a ? [
|
|
43
44
|
{
|
|
@@ -57,7 +58,7 @@ const j = (e) => {
|
|
|
57
58
|
},
|
|
58
59
|
children: [
|
|
59
60
|
/* @__PURE__ */ t(
|
|
60
|
-
|
|
61
|
+
x,
|
|
61
62
|
{
|
|
62
63
|
width: 16,
|
|
63
64
|
height: 16,
|
|
@@ -70,17 +71,17 @@ const j = (e) => {
|
|
|
70
71
|
)
|
|
71
72
|
}
|
|
72
73
|
] : []
|
|
73
|
-
],
|
|
74
|
+
], v = (i) => {
|
|
74
75
|
i === "edit" ? f(e) : i === "delete" && a?.(e);
|
|
75
|
-
},
|
|
76
|
-
|
|
76
|
+
}, p = /* @__PURE__ */ t(
|
|
77
|
+
h,
|
|
77
78
|
{
|
|
78
79
|
"data-test": `agent-row-run-${e.id}`,
|
|
79
80
|
disabled: e.isRunDisabled,
|
|
80
|
-
onClick:
|
|
81
|
+
onClick: b,
|
|
81
82
|
"aria-label": "Run agent",
|
|
82
83
|
children: /* @__PURE__ */ t(
|
|
83
|
-
|
|
84
|
+
T,
|
|
84
85
|
{
|
|
85
86
|
width: 20,
|
|
86
87
|
height: 20,
|
|
@@ -90,21 +91,53 @@ const j = (e) => {
|
|
|
90
91
|
}
|
|
91
92
|
);
|
|
92
93
|
return /* @__PURE__ */ r(
|
|
93
|
-
|
|
94
|
+
P,
|
|
94
95
|
{
|
|
95
96
|
"data-test": `agent-row-${e.id}`,
|
|
96
97
|
clickable: !!l,
|
|
97
98
|
onClick: l ? () => l(e) : void 0,
|
|
98
99
|
children: [
|
|
99
100
|
/* @__PURE__ */ r(n, { children: [
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ r(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
style: {
|
|
105
|
+
display: "flex",
|
|
106
|
+
alignItems: "center",
|
|
107
|
+
gap: 8,
|
|
108
|
+
minWidth: 0
|
|
109
|
+
},
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ t(L, { numberOfLines: 1, color: o.content.primary, children: e.name }),
|
|
112
|
+
e.sourceBadge ? /* @__PURE__ */ t(c, { body: e.sourceBadge, placement: "top", children: /* @__PURE__ */ t(
|
|
113
|
+
"span",
|
|
114
|
+
{
|
|
115
|
+
style: {
|
|
116
|
+
display: "flex",
|
|
117
|
+
flexShrink: 0,
|
|
118
|
+
cursor: "help"
|
|
119
|
+
},
|
|
120
|
+
"aria-label": "Agent source",
|
|
121
|
+
children: /* @__PURE__ */ t(
|
|
122
|
+
S,
|
|
123
|
+
{
|
|
124
|
+
width: 16,
|
|
125
|
+
height: 16,
|
|
126
|
+
color: o.content.secondary
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
) }) : null
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
),
|
|
101
134
|
/* @__PURE__ */ r(O, { numberOfLines: 1, color: o.content.secondary, children: [
|
|
102
135
|
"Created: ",
|
|
103
136
|
e.createdAtLabel
|
|
104
137
|
] })
|
|
105
138
|
] }),
|
|
106
|
-
/* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(
|
|
107
|
-
/* @__PURE__ */ t(n, { align: "right", children:
|
|
139
|
+
/* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(c, { body: s, placement: "top", children: /* @__PURE__ */ t(m, { numberOfLines: 2, color: o.content.primary, children: s }) }) }),
|
|
140
|
+
/* @__PURE__ */ t(n, { align: "right", children: y ? /* @__PURE__ */ t(
|
|
108
141
|
C,
|
|
109
142
|
{
|
|
110
143
|
boxes: [
|
|
@@ -116,37 +149,37 @@ const j = (e) => {
|
|
|
116
149
|
}
|
|
117
150
|
]
|
|
118
151
|
}
|
|
119
|
-
) : /* @__PURE__ */ t(
|
|
152
|
+
) : /* @__PURE__ */ t(m, { color: o.content.primary, children: e.triggerCount }) }),
|
|
120
153
|
/* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(
|
|
121
|
-
|
|
154
|
+
k,
|
|
122
155
|
{
|
|
123
|
-
tagText:
|
|
124
|
-
type:
|
|
156
|
+
tagText: d ? "Live" : "Draft",
|
|
157
|
+
type: d ? "positive" : "neutral",
|
|
125
158
|
variant: "regular"
|
|
126
159
|
}
|
|
127
160
|
) }),
|
|
128
|
-
/* @__PURE__ */ t(n, { align: "center", children: /* @__PURE__ */ r(
|
|
129
|
-
e.isRunDisabled && e.runDisabledTooltip ? /* @__PURE__ */ t(
|
|
161
|
+
/* @__PURE__ */ t(n, { align: "center", children: /* @__PURE__ */ r($, { children: [
|
|
162
|
+
e.isRunDisabled && e.runDisabledTooltip ? /* @__PURE__ */ t(c, { body: e.runDisabledTooltip, placement: "top", children: /* @__PURE__ */ t("span", { style: { display: "flex" }, children: p }) }) : p,
|
|
130
163
|
/* @__PURE__ */ t(
|
|
131
164
|
"span",
|
|
132
165
|
{
|
|
133
166
|
style: { display: "flex" },
|
|
134
167
|
onClick: (i) => i.stopPropagation(),
|
|
135
168
|
children: /* @__PURE__ */ t(
|
|
136
|
-
|
|
169
|
+
B,
|
|
137
170
|
{
|
|
138
171
|
"data-test": `agent-row-menu-${e.id}`,
|
|
139
|
-
options:
|
|
172
|
+
options: g,
|
|
140
173
|
placement: "bottom-end",
|
|
141
174
|
width: "160px",
|
|
142
|
-
onSelect: (i) =>
|
|
175
|
+
onSelect: (i) => v(I(i)),
|
|
143
176
|
children: /* @__PURE__ */ t(
|
|
144
|
-
|
|
177
|
+
h,
|
|
145
178
|
{
|
|
146
179
|
"data-test": `agent-row-menu-button-${e.id}`,
|
|
147
180
|
"aria-label": "More actions",
|
|
148
181
|
children: /* @__PURE__ */ t(
|
|
149
|
-
|
|
182
|
+
D,
|
|
150
183
|
{
|
|
151
184
|
width: 20,
|
|
152
185
|
height: 20,
|
|
@@ -165,6 +198,6 @@ const j = (e) => {
|
|
|
165
198
|
);
|
|
166
199
|
};
|
|
167
200
|
export {
|
|
168
|
-
|
|
201
|
+
Q as AgentTableRow
|
|
169
202
|
};
|
|
170
203
|
//# sourceMappingURL=AgentTableRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentTableRow.js","sources":["../../../../src/components/agent-listing/AgentTableRow.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport EditIcon from '@src/assets/icons/edit.svg';\nimport PlayOutlineIcon from '@src/assets/icons/playOutline.svg';\nimport MoreIcon from '@src/assets/icons/vertical_dots.svg';\nimport React from 'react';\nimport { unwrapDropdownValue } from '@src/components/dropdown';\nimport { DropdownPopover } from '@src/components/dropdown/DropdownPopover';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport BikShimmer from '@src/components/shimmer/ShimmerComponent/BikShimmer';\nimport { Tag } from '@src/components/tag';\nimport { Tooltip } from '@src/components/tooltips';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport StringUtils from '@src/utils/StringUtils';\nimport { COLORS } from '@src/constants/Theme';\nimport { AgentListItem, AgentTriggerSummary } from './AgentListing.model';\nimport {\n\tActionButton,\n\tActionGroup,\n\tBodyGridRow,\n\tCell,\n} from './AgentListing.styled';\n\nconst triggerToText = (trigger: AgentTriggerSummary): string => {\n\tswitch (trigger.kind) {\n\t\tcase 'topic':\n\t\t\t// Intent keys arrive snake_cased (e.g. \"order_cancellation\"); show them\n\t\t\t// space-separated and sentence-cased (first letter capital) so the\n\t\t\t// trigger reads as plain words, not a raw key.\n\t\t\treturn `Topic: ${StringUtils.capitalize(\n\t\t\t\t(trigger.label ?? '').replace(/_/g, ' '),\n\t\t\t)}`;\n\t\tcase 'phrases':\n\t\t\t// No enumerable phrase list (free-text trigger) → just the word.\n\t\t\treturn trigger.items?.length\n\t\t\t\t? `Phrases: ${trigger.items.join(', ')}`\n\t\t\t\t: 'Phrases';\n\t\tcase 'custom':\n\t\tdefault:\n\t\t\treturn trigger.label ?? '';\n\t}\n};\n\ninterface AgentTableRowProps {\n\tagent: AgentListItem;\n\tonRunAgent: (agent: AgentListItem) => void;\n\tonEditAgent: (agent: AgentListItem) => void;\n\t/** When set, render a delete action (the listing handles confirmation). */\n\tonDeleteAgent?: (agent: AgentListItem) => void;\n\tonRowClick?: (agent: AgentListItem) => void;\n\t/** Shimmer the trigger-count cell while the analytics count is still loading. */\n\ttriggerCountLoading?: boolean;\n}\n\nexport const AgentTableRow: React.FC<AgentTableRowProps> = ({\n\tagent,\n\tonRunAgent,\n\tonEditAgent,\n\tonDeleteAgent,\n\tonRowClick,\n\ttriggerCountLoading,\n}) => {\n\tconst isLive = agent.status === 'live';\n\tconst triggerText = triggerToText(agent.trigger);\n\n\tconst handleRun = (e: React.MouseEvent) => {\n\t\te.stopPropagation();\n\t\tif (agent.isRunDisabled) {\n\t\t\treturn;\n\t\t}\n\t\tonRunAgent(agent);\n\t};\n\n\t// Edit + Delete live in the \"⋮\" menu beside the run button.\n\tconst menuOptions: SingleOption[] = [\n\t\t{\n\t\t\tlabel: 'Edit',\n\t\t\tvalue: 'edit',\n\t\t\tleadingIcon: (\n\t\t\t\t<EditIcon width={16} height={16} color={COLORS.content.secondary} />\n\t\t\t),\n\t\t},\n\t\t...(onDeleteAgent\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Delete',\n\t\t\t\t\t\tvalue: 'delete',\n\t\t\t\t\t\t// Rendered red (icon + label) via customComponent.\n\t\t\t\t\t\tcustomComponent: (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t\tgap: 8,\n\t\t\t\t\t\t\t\t\tcolor: COLORS.content.negative,\n\t\t\t\t\t\t\t\t\tfontFamily: 'Inter',\n\t\t\t\t\t\t\t\t\tfontSize: 14,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DeleteIcon\n\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.negative}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\tDelete\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t ]\n\t\t\t: []),\n\t];\n\n\tconst handleMenuSelect = (value: string | undefined) => {\n\t\tif (value === 'edit') {\n\t\t\tonEditAgent(agent);\n\t\t} else if (value === 'delete') {\n\t\t\tonDeleteAgent?.(agent);\n\t\t}\n\t};\n\n\tconst playButton = (\n\t\t<ActionButton\n\t\t\tdata-test={`agent-row-run-${agent.id}`}\n\t\t\tdisabled={agent.isRunDisabled}\n\t\t\tonClick={handleRun}\n\t\t\taria-label=\"Run agent\"\n\t\t>\n\t\t\t<PlayOutlineIcon\n\t\t\t\twidth={20}\n\t\t\t\theight={20}\n\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t/>\n\t\t</ActionButton>\n\t);\n\n\treturn (\n\t\t<BodyGridRow\n\t\t\tdata-test={`agent-row-${agent.id}`}\n\t\t\tclickable={!!onRowClick}\n\t\t\tonClick={onRowClick ? () => onRowClick(agent) : undefined}\n\t\t>\n\t\t\t<Cell>\n\t\t\t\t<TitleSmall numberOfLines={1} color={COLORS.content.primary}>\n\t\t\t\t\t{agent.name}\n\t\t\t\t</TitleSmall>\n\t\t\t\t<BodyCaption numberOfLines={1} color={COLORS.content.secondary}>\n\t\t\t\t\tCreated: {agent.createdAtLabel}\n\t\t\t\t</BodyCaption>\n\t\t\t</Cell>\n\n\t\t\t<Cell>\n\t\t\t\t{/* Cell truncates to 2 lines; the tooltip reveals the full trigger. */}\n\t\t\t\t<Tooltip body={triggerText} placement=\"top\">\n\t\t\t\t\t<BodySecondary numberOfLines={2} color={COLORS.content.primary}>\n\t\t\t\t\t\t{triggerText}\n\t\t\t\t\t</BodySecondary>\n\t\t\t\t</Tooltip>\n\t\t\t</Cell>\n\n\t\t\t<Cell align=\"right\">\n\t\t\t\t{triggerCountLoading ? (\n\t\t\t\t\t<BikShimmer\n\t\t\t\t\t\tboxes={[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twidth: '48px',\n\t\t\t\t\t\t\t\theight: '16px',\n\t\t\t\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t\t\t\tmarginTop: '0',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\t{agent.triggerCount}\n\t\t\t\t\t</BodySecondary>\n\t\t\t\t)}\n\t\t\t</Cell>\n\n\t\t\t<Cell>\n\t\t\t\t<Tag\n\t\t\t\t\ttagText={isLive ? 'Live' : 'Draft'}\n\t\t\t\t\ttype={isLive ? 'positive' : 'neutral'}\n\t\t\t\t\tvariant=\"regular\"\n\t\t\t\t/>\n\t\t\t</Cell>\n\n\t\t\t<Cell align=\"center\">\n\t\t\t\t<ActionGroup>\n\t\t\t\t\t{agent.isRunDisabled && agent.runDisabledTooltip ? (\n\t\t\t\t\t\t<Tooltip body={agent.runDisabledTooltip} placement=\"top\">\n\t\t\t\t\t\t\t<span style={{ display: 'flex' }}>{playButton}</span>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tplayButton\n\t\t\t\t\t)}\n\t\t\t\t\t{/* Stop the row's onClick from firing when interacting with the menu. */}\n\t\t\t\t\t<span\n\t\t\t\t\t\tstyle={{ display: 'flex' }}\n\t\t\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DropdownPopover\n\t\t\t\t\t\t\tdata-test={`agent-row-menu-${agent.id}`}\n\t\t\t\t\t\t\toptions={menuOptions}\n\t\t\t\t\t\t\tplacement=\"bottom-end\"\n\t\t\t\t\t\t\twidth=\"160px\"\n\t\t\t\t\t\t\tonSelect={(opt) => handleMenuSelect(unwrapDropdownValue(opt))}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ActionButton\n\t\t\t\t\t\t\t\tdata-test={`agent-row-menu-button-${agent.id}`}\n\t\t\t\t\t\t\t\taria-label=\"More actions\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MoreIcon\n\t\t\t\t\t\t\t\t\twidth={20}\n\t\t\t\t\t\t\t\t\theight={20}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ActionButton>\n\t\t\t\t\t\t</DropdownPopover>\n\t\t\t\t\t</span>\n\t\t\t\t</ActionGroup>\n\t\t\t</Cell>\n\t\t</BodyGridRow>\n\t);\n};\n"],"names":["triggerToText","trigger","StringUtils","AgentTableRow","agent","onRunAgent","onEditAgent","onDeleteAgent","onRowClick","triggerCountLoading","isLive","triggerText","handleRun","e","menuOptions","jsx","EditIcon","COLORS","jsxs","DeleteIcon","handleMenuSelect","value","playButton","ActionButton","PlayOutlineIcon","BodyGridRow","Cell","TitleSmall","BodyCaption","Tooltip","BodySecondary","BikShimmer","Tag","ActionGroup","DropdownPopover","opt","unwrapDropdownValue","MoreIcon"],"mappings":";;;;;;;;;;;;;;AA0BA,MAAMA,IAAgB,CAACC,MAAyC;AAC/D,UAAQA,EAAQ,MAAA;AAAA,IACf,KAAK;AAIJ,aAAO,UAAUC,EAAY;AAAA,SAC3BD,EAAQ,SAAS,IAAI,QAAQ,MAAM,GAAG;AAAA,MAAA,CACvC;AAAA,IACF,KAAK;AAEJ,aAAOA,EAAQ,OAAO,SACnB,YAAYA,EAAQ,MAAM,KAAK,IAAI,CAAC,KACpC;AAAA,IAEJ;AACC,aAAOA,EAA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ableRow.tsx"],"sourcesContent":["import DeleteIcon from '@src/assets/icons/delete.svg';\nimport EditIcon from '@src/assets/icons/edit.svg';\nimport InfoIcon from '@src/assets/icons/info.svg';\nimport PlayOutlineIcon from '@src/assets/icons/playOutline.svg';\nimport MoreIcon from '@src/assets/icons/vertical_dots.svg';\nimport React from 'react';\nimport { unwrapDropdownValue } from '@src/components/dropdown';\nimport { DropdownPopover } from '@src/components/dropdown/DropdownPopover';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport BikShimmer from '@src/components/shimmer/ShimmerComponent/BikShimmer';\nimport { Tag } from '@src/components/tag';\nimport { Tooltip } from '@src/components/tooltips';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tTitleSmall,\n} from '@src/components/TypographyStyle';\nimport StringUtils from '@src/utils/StringUtils';\nimport { COLORS } from '@src/constants/Theme';\nimport { AgentListItem, AgentTriggerSummary } from './AgentListing.model';\nimport {\n\tActionButton,\n\tActionGroup,\n\tBodyGridRow,\n\tCell,\n} from './AgentListing.styled';\n\nconst triggerToText = (trigger: AgentTriggerSummary): string => {\n\tswitch (trigger.kind) {\n\t\tcase 'topic':\n\t\t\t// Intent keys arrive snake_cased (e.g. \"order_cancellation\"); show them\n\t\t\t// space-separated and sentence-cased (first letter capital) so the\n\t\t\t// trigger reads as plain words, not a raw key.\n\t\t\treturn `Topic: ${StringUtils.capitalize(\n\t\t\t\t(trigger.label ?? '').replace(/_/g, ' '),\n\t\t\t)}`;\n\t\tcase 'phrases':\n\t\t\t// No enumerable phrase list (free-text trigger) → just the word.\n\t\t\treturn trigger.items?.length\n\t\t\t\t? `Phrases: ${trigger.items.join(', ')}`\n\t\t\t\t: 'Phrases';\n\t\tcase 'custom':\n\t\tdefault:\n\t\t\treturn trigger.label ?? '';\n\t}\n};\n\ninterface AgentTableRowProps {\n\tagent: AgentListItem;\n\tonRunAgent: (agent: AgentListItem) => void;\n\tonEditAgent: (agent: AgentListItem) => void;\n\t/** When set, render a delete action (the listing handles confirmation). */\n\tonDeleteAgent?: (agent: AgentListItem) => void;\n\tonRowClick?: (agent: AgentListItem) => void;\n\t/** Shimmer the trigger-count cell while the analytics count is still loading. */\n\ttriggerCountLoading?: boolean;\n}\n\nexport const AgentTableRow: React.FC<AgentTableRowProps> = ({\n\tagent,\n\tonRunAgent,\n\tonEditAgent,\n\tonDeleteAgent,\n\tonRowClick,\n\ttriggerCountLoading,\n}) => {\n\tconst isLive = agent.status === 'live';\n\tconst triggerText = triggerToText(agent.trigger);\n\n\tconst handleRun = (e: React.MouseEvent) => {\n\t\te.stopPropagation();\n\t\tif (agent.isRunDisabled) {\n\t\t\treturn;\n\t\t}\n\t\tonRunAgent(agent);\n\t};\n\n\t// Edit + Delete live in the \"⋮\" menu beside the run button.\n\tconst menuOptions: SingleOption[] = [\n\t\t{\n\t\t\tlabel: 'Edit',\n\t\t\tvalue: 'edit',\n\t\t\tleadingIcon: (\n\t\t\t\t<EditIcon width={16} height={16} color={COLORS.content.secondary} />\n\t\t\t),\n\t\t},\n\t\t...(onDeleteAgent\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Delete',\n\t\t\t\t\t\tvalue: 'delete',\n\t\t\t\t\t\t// Rendered red (icon + label) via customComponent.\n\t\t\t\t\t\tcustomComponent: (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t\tgap: 8,\n\t\t\t\t\t\t\t\t\tcolor: COLORS.content.negative,\n\t\t\t\t\t\t\t\t\tfontFamily: 'Inter',\n\t\t\t\t\t\t\t\t\tfontSize: 14,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DeleteIcon\n\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.negative}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\tDelete\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t ]\n\t\t\t: []),\n\t];\n\n\tconst handleMenuSelect = (value: string | undefined) => {\n\t\tif (value === 'edit') {\n\t\t\tonEditAgent(agent);\n\t\t} else if (value === 'delete') {\n\t\t\tonDeleteAgent?.(agent);\n\t\t}\n\t};\n\n\tconst playButton = (\n\t\t<ActionButton\n\t\t\tdata-test={`agent-row-run-${agent.id}`}\n\t\t\tdisabled={agent.isRunDisabled}\n\t\t\tonClick={handleRun}\n\t\t\taria-label=\"Run agent\"\n\t\t>\n\t\t\t<PlayOutlineIcon\n\t\t\t\twidth={20}\n\t\t\t\theight={20}\n\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t/>\n\t\t</ActionButton>\n\t);\n\n\treturn (\n\t\t<BodyGridRow\n\t\t\tdata-test={`agent-row-${agent.id}`}\n\t\t\tclickable={!!onRowClick}\n\t\t\tonClick={onRowClick ? () => onRowClick(agent) : undefined}\n\t\t>\n\t\t\t<Cell>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\tgap: 8,\n\t\t\t\t\t\tminWidth: 0,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<TitleSmall numberOfLines={1} color={COLORS.content.primary}>\n\t\t\t\t\t\t{agent.name}\n\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t{/* Provenance: an info icon beside the name reveals where this\n\t\t\t\t\t agent was copied from (source store + agent, or the agent\n\t\t\t\t\t library). Consumer's doc→row mapper builds the tooltip text. */}\n\t\t\t\t\t{agent.sourceBadge ? (\n\t\t\t\t\t\t<Tooltip body={agent.sourceBadge} placement=\"top\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\tflexShrink: 0,\n\t\t\t\t\t\t\t\t\tcursor: 'help',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\taria-label=\"Agent source\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<InfoIcon\n\t\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t\t<BodyCaption numberOfLines={1} color={COLORS.content.secondary}>\n\t\t\t\t\tCreated: {agent.createdAtLabel}\n\t\t\t\t</BodyCaption>\n\t\t\t</Cell>\n\n\t\t\t<Cell>\n\t\t\t\t{/* Cell truncates to 2 lines; the tooltip reveals the full trigger. */}\n\t\t\t\t<Tooltip body={triggerText} placement=\"top\">\n\t\t\t\t\t<BodySecondary numberOfLines={2} color={COLORS.content.primary}>\n\t\t\t\t\t\t{triggerText}\n\t\t\t\t\t</BodySecondary>\n\t\t\t\t</Tooltip>\n\t\t\t</Cell>\n\n\t\t\t<Cell align=\"right\">\n\t\t\t\t{triggerCountLoading ? (\n\t\t\t\t\t<BikShimmer\n\t\t\t\t\t\tboxes={[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twidth: '48px',\n\t\t\t\t\t\t\t\theight: '16px',\n\t\t\t\t\t\t\t\tborderRadius: '4px',\n\t\t\t\t\t\t\t\tmarginTop: '0',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\t{agent.triggerCount}\n\t\t\t\t\t</BodySecondary>\n\t\t\t\t)}\n\t\t\t</Cell>\n\n\t\t\t<Cell>\n\t\t\t\t<Tag\n\t\t\t\t\ttagText={isLive ? 'Live' : 'Draft'}\n\t\t\t\t\ttype={isLive ? 'positive' : 'neutral'}\n\t\t\t\t\tvariant=\"regular\"\n\t\t\t\t/>\n\t\t\t</Cell>\n\n\t\t\t<Cell align=\"center\">\n\t\t\t\t<ActionGroup>\n\t\t\t\t\t{agent.isRunDisabled && agent.runDisabledTooltip ? (\n\t\t\t\t\t\t<Tooltip body={agent.runDisabledTooltip} placement=\"top\">\n\t\t\t\t\t\t\t<span style={{ display: 'flex' }}>{playButton}</span>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tplayButton\n\t\t\t\t\t)}\n\t\t\t\t\t{/* Stop the row's onClick from firing when interacting with the menu. */}\n\t\t\t\t\t<span\n\t\t\t\t\t\tstyle={{ display: 'flex' }}\n\t\t\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DropdownPopover\n\t\t\t\t\t\t\tdata-test={`agent-row-menu-${agent.id}`}\n\t\t\t\t\t\t\toptions={menuOptions}\n\t\t\t\t\t\t\tplacement=\"bottom-end\"\n\t\t\t\t\t\t\twidth=\"160px\"\n\t\t\t\t\t\t\tonSelect={(opt) => handleMenuSelect(unwrapDropdownValue(opt))}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ActionButton\n\t\t\t\t\t\t\t\tdata-test={`agent-row-menu-button-${agent.id}`}\n\t\t\t\t\t\t\t\taria-label=\"More actions\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MoreIcon\n\t\t\t\t\t\t\t\t\twidth={20}\n\t\t\t\t\t\t\t\t\theight={20}\n\t\t\t\t\t\t\t\t\tcolor={COLORS.content.secondary}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ActionButton>\n\t\t\t\t\t\t</DropdownPopover>\n\t\t\t\t\t</span>\n\t\t\t\t</ActionGroup>\n\t\t\t</Cell>\n\t\t</BodyGridRow>\n\t);\n};\n"],"names":["triggerToText","trigger","StringUtils","AgentTableRow","agent","onRunAgent","onEditAgent","onDeleteAgent","onRowClick","triggerCountLoading","isLive","triggerText","handleRun","e","menuOptions","jsx","EditIcon","COLORS","jsxs","DeleteIcon","handleMenuSelect","value","playButton","ActionButton","PlayOutlineIcon","BodyGridRow","Cell","TitleSmall","Tooltip","InfoIcon","BodyCaption","BodySecondary","BikShimmer","Tag","ActionGroup","DropdownPopover","opt","unwrapDropdownValue","MoreIcon"],"mappings":";;;;;;;;;;;;;;;AA2BA,MAAMA,IAAgB,CAACC,MAAyC;AAC/D,UAAQA,EAAQ,MAAA;AAAA,IACf,KAAK;AAIJ,aAAO,UAAUC,EAAY;AAAA,SAC3BD,EAAQ,SAAS,IAAI,QAAQ,MAAM,GAAG;AAAA,MAAA,CACvC;AAAA,IACF,KAAK;AAEJ,aAAOA,EAAQ,OAAO,SACnB,YAAYA,EAAQ,MAAM,KAAK,IAAI,CAAC,KACpC;AAAA,IAEJ;AACC,aAAOA,EAAQ,SAAS;AAAA,EAAA;AAE3B,GAaaE,IAA8C,CAAC;AAAA,EAC3D,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,qBAAAC;AACD,MAAM;AACL,QAAMC,IAASN,EAAM,WAAW,QAC1BO,IAAcX,EAAcI,EAAM,OAAO,GAEzCQ,IAAY,CAACC,MAAwB;AAE1C,IADAA,EAAE,gBAAA,GACE,CAAAT,EAAM,iBAGVC,EAAWD,CAAK;AAAA,EACjB,GAGMU,IAA8B;AAAA,IACnC;AAAA,MACC,OAAO;AAAA,MACP,OAAO;AAAA,MACP,aACC,gBAAAC,EAACC,GAAA,EAAS,OAAO,IAAI,QAAQ,IAAI,OAAOC,EAAO,QAAQ,UAAA,CAAW;AAAA,IAAA;AAAA,IAGpE,GAAIV,IACD;AAAA,MACA;AAAA,QACC,OAAO;AAAA,QACP,OAAO;AAAA;AAAA,QAEP,iB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