@bikdotai/bik-component-library 0.0.875-beta.0 → 0.0.875-beta.1

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 (30) hide show
  1. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +11 -11
  2. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  3. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +2 -2
  4. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +4 -4
  6. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  7. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js +1 -1
  8. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  9. package/dist/cjs/index.js +1 -1
  10. package/dist/esm/components/agent-builder/components/ConfigToolPanel.d.ts +6 -0
  11. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +143 -141
  12. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  13. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.d.ts +6 -0
  14. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +83 -81
  15. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  16. package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +6 -0
  17. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +50 -48
  18. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  19. package/dist/esm/components/agent-builder/index.d.ts +0 -2
  20. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.d.ts +2 -3
  21. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +117 -31
  22. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  23. package/dist/esm/index.js +316 -318
  24. package/dist/esm/index.js.map +1 -1
  25. package/package.json +1 -1
  26. package/dist/cjs/components/agent-builder/components/HandoverMethodSection.js +0 -2
  27. package/dist/cjs/components/agent-builder/components/HandoverMethodSection.js.map +0 -1
  28. package/dist/esm/components/agent-builder/components/HandoverMethodSection.d.ts +0 -22
  29. package/dist/esm/components/agent-builder/components/HandoverMethodSection.js +0 -109
  30. package/dist/esm/components/agent-builder/components/HandoverMethodSection.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.875-beta.0",
3
+ "version": "0.0.875-beta.1",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("../../../assets/icons/RedirectToNew.svg.js"),d=require("../../radioButton/RadioButton.js"),n=require("../../TypographyStyle.js"),t=require("../../../constants/Theme.js"),o=require("../AgentBuilder.styled.js"),x=require("../../tooltips/Tooltip.js"),s="default",C=({method:l,onMethodChange:r,onSmartAgentHandover:a,"data-test":c})=>{const i=l!==s;return e.jsxs(o.FieldBlock,{"data-test":c,children:[e.jsx(n.TitleSmall,{color:t.COLORS.content.primary,children:"Handover method"}),e.jsxs(o.CardRow,{children:[e.jsxs(o.RadioCard,{"data-test":"handover-method-default",type:"button",selected:!i,onClick:()=>r(s),children:[e.jsx(d.RadioButton,{isActive:!i,onValueChange:()=>r(s),skipSelectingOff:!0,activeColor:t.BASE_COLORS.brand[800]}),e.jsxs(o.RadioCardText,{children:[e.jsx(n.TitleSmall,{color:t.COLORS.content.primary,children:"Use default settings"}),e.jsxs(n.BodyCaption,{color:t.COLORS.content.secondary,children:["As defined in"," ",a?e.jsxs(o.ChannelsLink,{"data-test":"handover-smart-agent-link",type:"button",onClick:u=>{u.stopPropagation(),a()},style:{display:"inline-flex"},children:["Smart agent handover",e.jsx(h.default,{width:12,height:12})]}):"Smart agent handover"]})]})]}),e.jsx(x.Tooltip,{body:"Custom handover rules are coming soon. For now this agent follows your smart agent handover settings.",placement:"top",children:e.jsx("span",{style:{flex:1,display:"flex",cursor:"not-allowed"},children:e.jsxs(o.RadioCard,{"data-test":"handover-method-custom",type:"button",disabled:!0,selected:i,children:[e.jsx(d.RadioButton,{isActive:i,isDisabled:!0,onValueChange:()=>{},skipSelectingOff:!0,activeColor:t.BASE_COLORS.brand[800]}),e.jsxs(o.RadioCardText,{children:[e.jsx(n.TitleSmall,{color:t.COLORS.content.inactive,children:"Custom instructions"}),e.jsx(n.BodyCaption,{color:t.COLORS.content.inactive,children:"Write custom handover rules for this agent."})]})]})})})]})]})};exports.HandoverMethodSection=C;
2
- //# sourceMappingURL=HandoverMethodSection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HandoverMethodSection.js","sources":["../../../../../src/components/agent-builder/components/HandoverMethodSection.tsx"],"sourcesContent":["import RedirectIcon from '@src/assets/icons/RedirectToNew.svg';\nimport React from 'react';\nimport { RadioButton } from '@src/components/radioButton/RadioButton';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BodyCaption, TitleSmall } from '@src/components/TypographyStyle';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\nimport type { HandoverMethod } from '../AgentBuilder.model';\nimport {\n\tCardRow,\n\tChannelsLink,\n\tFieldBlock,\n\tRadioCard,\n\tRadioCardText,\n} from '../AgentBuilder.styled';\n\n/**\n * The stored `handover.method` that means \"inherit the store's smart-agent\n * handover settings\" — the BIK default, and the only method selectable today.\n */\nconst DEFAULT_METHOD: HandoverMethod = 'default';\n\nexport interface HandoverMethodSectionProps {\n\t/** The agent's current `handover.method`. */\n\tmethod: HandoverMethod;\n\t/** Called with the newly picked method. */\n\tonMethodChange: (method: HandoverMethod) => void;\n\t/**\n\t * Open the store's smart-agent-handover settings. When absent the\n\t * \"Smart agent handover\" text renders as plain text instead of a link.\n\t */\n\tonSmartAgentHandover?: () => void;\n\t'data-test'?: string;\n}\n\n/**\n * The BIK \"Handover method\" picker: \"Use default settings\" (selectable, links\n * out to smart agent handover) and \"Custom instructions\" (disabled until that\n * flow is built). Presentational and context-free so any host — the\n * AgentBuilder's Step 4 or an embedding product like the journey builder —\n * renders the identical UI.\n */\nexport const HandoverMethodSection: React.FC<HandoverMethodSectionProps> = ({\n\tmethod,\n\tonMethodChange,\n\tonSmartAgentHandover,\n\t'data-test': dataTest,\n}) => {\n\t// Anything other than the default method means the merchant is on custom\n\t// instructions.\n\tconst usesCustom = method !== DEFAULT_METHOD;\n\n\treturn (\n\t\t<FieldBlock data-test={dataTest}>\n\t\t\t<TitleSmall color={COLORS.content.primary}>Handover method</TitleSmall>\n\n\t\t\t<CardRow>\n\t\t\t\t<RadioCard\n\t\t\t\t\tdata-test=\"handover-method-default\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tselected={!usesCustom}\n\t\t\t\t\tonClick={() => onMethodChange(DEFAULT_METHOD)}\n\t\t\t\t>\n\t\t\t\t\t<RadioButton\n\t\t\t\t\t\tisActive={!usesCustom}\n\t\t\t\t\t\tonValueChange={() => onMethodChange(DEFAULT_METHOD)}\n\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t/>\n\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\tUse default settings\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\tAs defined in{' '}\n\t\t\t\t\t\t\t{onSmartAgentHandover ? (\n\t\t\t\t\t\t\t\t<ChannelsLink\n\t\t\t\t\t\t\t\t\tdata-test=\"handover-smart-agent-link\"\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t// The link sits inside the card's own click target, so\n\t\t\t\t\t\t\t\t\t// stop the click bubbling up and re-selecting the card.\n\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\tonSmartAgentHandover();\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tstyle={{ display: 'inline-flex' }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tSmart agent handover\n\t\t\t\t\t\t\t\t\t<RedirectIcon width={12} height={12} />\n\t\t\t\t\t\t\t\t</ChannelsLink>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t'Smart agent handover'\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t</RadioCardText>\n\t\t\t\t</RadioCard>\n\n\t\t\t\t{/* Custom handover rules aren't built yet — the card is shown so the\n\t\t\t\t merchant knows it's coming, but it can't be selected. */}\n\t\t\t\t<Tooltip\n\t\t\t\t\tbody=\"Custom handover rules are coming soon. For now this agent follows your smart agent handover settings.\"\n\t\t\t\t\tplacement=\"top\"\n\t\t\t\t>\n\t\t\t\t\t{/* A disabled <button> fires no mouse events, so the tooltip would\n\t\t\t\t\t never open on the card itself — the span is the hover target\n\t\t\t\t\t (same wrapper IconButton uses for its disabled tooltip). It also\n\t\t\t\t\t has to carry the card's `flex: 1`, since it is now the flex item. */}\n\t\t\t\t\t<span\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tflex: 1,\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tcursor: 'not-allowed',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioCard\n\t\t\t\t\t\t\tdata-test=\"handover-method-custom\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\tselected={usesCustom}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\t\tisActive={usesCustom}\n\t\t\t\t\t\t\t\tisDisabled\n\t\t\t\t\t\t\t\tonValueChange={() => undefined}\n\t\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.inactive}>\n\t\t\t\t\t\t\t\t\tCustom instructions\n\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.inactive}>\n\t\t\t\t\t\t\t\t\tWrite custom handover rules for this agent.\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t\t</RadioCard>\n\t\t\t\t\t</span>\n\t\t\t\t</Tooltip>\n\t\t\t</CardRow>\n\t\t</FieldBlock>\n\t);\n};\n"],"names":["DEFAULT_METHOD","HandoverMethodSection","method","onMethodChange","onSmartAgentHandover","dataTest","usesCustom","jsxs","FieldBlock","jsx","TitleSmall","COLORS","CardRow","RadioCard","RadioButton","BASE_COLORS","RadioCardText","BodyCaption","ChannelsLink","event","RedirectIcon","Tooltip"],"mappings":"wXAmBMA,EAAiC,UAsB1BC,EAA8D,CAAC,CAC3E,OAAAC,EACA,eAAAC,EACA,qBAAAC,EACA,YAAaC,CACd,IAAM,CAGL,MAAMC,EAAaJ,IAAWF,EAE9B,OACCO,EAAAA,KAACC,EAAAA,WAAA,CAAW,YAAWH,EACtB,SAAA,CAAAI,MAACC,EAAAA,WAAA,CAAW,MAAOC,EAAAA,OAAO,QAAQ,QAAS,SAAA,kBAAe,SAEzDC,EAAAA,QAAA,CACA,SAAA,CAAAL,EAAAA,KAACM,EAAAA,UAAA,CACA,YAAU,0BACV,KAAK,SACL,SAAU,CAACP,EACX,QAAS,IAAMH,EAAeH,CAAc,EAE5C,SAAA,CAAAS,EAAAA,IAACK,EAAAA,YAAA,CACA,SAAU,CAACR,EACX,cAAe,IAAMH,EAAeH,CAA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A,EACD,CAEF"}
@@ -1,22 +0,0 @@
1
- import { default as React } from 'react';
2
- import { HandoverMethod } from '../AgentBuilder.model';
3
- export interface HandoverMethodSectionProps {
4
- /** The agent's current `handover.method`. */
5
- method: HandoverMethod;
6
- /** Called with the newly picked method. */
7
- onMethodChange: (method: HandoverMethod) => void;
8
- /**
9
- * Open the store's smart-agent-handover settings. When absent the
10
- * "Smart agent handover" text renders as plain text instead of a link.
11
- */
12
- onSmartAgentHandover?: () => void;
13
- 'data-test'?: string;
14
- }
15
- /**
16
- * The BIK "Handover method" picker: "Use default settings" (selectable, links
17
- * out to smart agent handover) and "Custom instructions" (disabled until that
18
- * flow is built). Presentational and context-free so any host — the
19
- * AgentBuilder's Step 4 or an embedding product like the journey builder —
20
- * renders the identical UI.
21
- */
22
- export declare const HandoverMethodSection: React.FC<HandoverMethodSectionProps>;
@@ -1,109 +0,0 @@
1
- import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
- import v from "../../../assets/icons/RedirectToNew.svg.js";
3
- import { RadioButton as l } from "../../radioButton/RadioButton.js";
4
- import { TitleSmall as r, BodyCaption as s } from "../../TypographyStyle.js";
5
- import { COLORS as o, BASE_COLORS as c } from "../../../constants/Theme.js";
6
- import { FieldBlock as C, CardRow as g, RadioCard as h, RadioCardText as m, ChannelsLink as y } from "../AgentBuilder.styled.js";
7
- import { Tooltip as S } from "../../tooltips/Tooltip.js";
8
- const i = "default", A = ({
9
- method: u,
10
- onMethodChange: a,
11
- onSmartAgentHandover: d,
12
- "data-test": p
13
- }) => {
14
- const n = u !== i;
15
- return /* @__PURE__ */ e(C, { "data-test": p, children: [
16
- /* @__PURE__ */ t(r, { color: o.content.primary, children: "Handover method" }),
17
- /* @__PURE__ */ e(g, { children: [
18
- /* @__PURE__ */ e(
19
- h,
20
- {
21
- "data-test": "handover-method-default",
22
- type: "button",
23
- selected: !n,
24
- onClick: () => a(i),
25
- children: [
26
- /* @__PURE__ */ t(
27
- l,
28
- {
29
- isActive: !n,
30
- onValueChange: () => a(i),
31
- skipSelectingOff: !0,
32
- activeColor: c.brand[800]
33
- }
34
- ),
35
- /* @__PURE__ */ e(m, { children: [
36
- /* @__PURE__ */ t(r, { color: o.content.primary, children: "Use default settings" }),
37
- /* @__PURE__ */ e(s, { color: o.content.secondary, children: [
38
- "As defined in",
39
- " ",
40
- d ? /* @__PURE__ */ e(
41
- y,
42
- {
43
- "data-test": "handover-smart-agent-link",
44
- type: "button",
45
- onClick: (f) => {
46
- f.stopPropagation(), d();
47
- },
48
- style: { display: "inline-flex" },
49
- children: [
50
- "Smart agent handover",
51
- /* @__PURE__ */ t(v, { width: 12, height: 12 })
52
- ]
53
- }
54
- ) : "Smart agent handover"
55
- ] })
56
- ] })
57
- ]
58
- }
59
- ),
60
- /* @__PURE__ */ t(
61
- S,
62
- {
63
- body: "Custom handover rules are coming soon. For now this agent follows your smart agent handover settings.",
64
- placement: "top",
65
- children: /* @__PURE__ */ t(
66
- "span",
67
- {
68
- style: {
69
- flex: 1,
70
- display: "flex",
71
- cursor: "not-allowed"
72
- },
73
- children: /* @__PURE__ */ e(
74
- h,
75
- {
76
- "data-test": "handover-method-custom",
77
- type: "button",
78
- disabled: !0,
79
- selected: n,
80
- children: [
81
- /* @__PURE__ */ t(
82
- l,
83
- {
84
- isActive: n,
85
- isDisabled: !0,
86
- onValueChange: () => {
87
- },
88
- skipSelectingOff: !0,
89
- activeColor: c.brand[800]
90
- }
91
- ),
92
- /* @__PURE__ */ e(m, { children: [
93
- /* @__PURE__ */ t(r, { color: o.content.inactive, children: "Custom instructions" }),
94
- /* @__PURE__ */ t(s, { color: o.content.inactive, children: "Write custom handover rules for this agent." })
95
- ] })
96
- ]
97
- }
98
- )
99
- }
100
- )
101
- }
102
- )
103
- ] })
104
- ] });
105
- };
106
- export {
107
- A as HandoverMethodSection
108
- };
109
- //# sourceMappingURL=HandoverMethodSection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HandoverMethodSection.js","sources":["../../../../../src/components/agent-builder/components/HandoverMethodSection.tsx"],"sourcesContent":["import RedirectIcon from '@src/assets/icons/RedirectToNew.svg';\nimport React from 'react';\nimport { RadioButton } from '@src/components/radioButton/RadioButton';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BodyCaption, TitleSmall } from '@src/components/TypographyStyle';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\nimport type { HandoverMethod } from '../AgentBuilder.model';\nimport {\n\tCardRow,\n\tChannelsLink,\n\tFieldBlock,\n\tRadioCard,\n\tRadioCardText,\n} from '../AgentBuilder.styled';\n\n/**\n * The stored `handover.method` that means \"inherit the store's smart-agent\n * handover settings\" — the BIK default, and the only method selectable today.\n */\nconst DEFAULT_METHOD: HandoverMethod = 'default';\n\nexport interface HandoverMethodSectionProps {\n\t/** The agent's current `handover.method`. */\n\tmethod: HandoverMethod;\n\t/** Called with the newly picked method. */\n\tonMethodChange: (method: HandoverMethod) => void;\n\t/**\n\t * Open the store's smart-agent-handover settings. When absent the\n\t * \"Smart agent handover\" text renders as plain text instead of a link.\n\t */\n\tonSmartAgentHandover?: () => void;\n\t'data-test'?: string;\n}\n\n/**\n * The BIK \"Handover method\" picker: \"Use default settings\" (selectable, links\n * out to smart agent handover) and \"Custom instructions\" (disabled until that\n * flow is built). Presentational and context-free so any host — the\n * AgentBuilder's Step 4 or an embedding product like the journey builder —\n * renders the identical UI.\n */\nexport const HandoverMethodSection: React.FC<HandoverMethodSectionProps> = ({\n\tmethod,\n\tonMethodChange,\n\tonSmartAgentHandover,\n\t'data-test': dataTest,\n}) => {\n\t// Anything other than the default method means the merchant is on custom\n\t// instructions.\n\tconst usesCustom = method !== DEFAULT_METHOD;\n\n\treturn (\n\t\t<FieldBlock data-test={dataTest}>\n\t\t\t<TitleSmall color={COLORS.content.primary}>Handover method</TitleSmall>\n\n\t\t\t<CardRow>\n\t\t\t\t<RadioCard\n\t\t\t\t\tdata-test=\"handover-method-default\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tselected={!usesCustom}\n\t\t\t\t\tonClick={() => onMethodChange(DEFAULT_METHOD)}\n\t\t\t\t>\n\t\t\t\t\t<RadioButton\n\t\t\t\t\t\tisActive={!usesCustom}\n\t\t\t\t\t\tonValueChange={() => onMethodChange(DEFAULT_METHOD)}\n\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t/>\n\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\tUse default settings\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\tAs defined in{' '}\n\t\t\t\t\t\t\t{onSmartAgentHandover ? (\n\t\t\t\t\t\t\t\t<ChannelsLink\n\t\t\t\t\t\t\t\t\tdata-test=\"handover-smart-agent-link\"\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t// The link sits inside the card's own click target, so\n\t\t\t\t\t\t\t\t\t// stop the click bubbling up and re-selecting the card.\n\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\tonSmartAgentHandover();\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tstyle={{ display: 'inline-flex' }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tSmart agent handover\n\t\t\t\t\t\t\t\t\t<RedirectIcon width={12} height={12} />\n\t\t\t\t\t\t\t\t</ChannelsLink>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t'Smart agent handover'\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t</RadioCardText>\n\t\t\t\t</RadioCard>\n\n\t\t\t\t{/* Custom handover rules aren't built yet — the card is shown so the\n\t\t\t\t merchant knows it's coming, but it can't be selected. */}\n\t\t\t\t<Tooltip\n\t\t\t\t\tbody=\"Custom handover rules are coming soon. For now this agent follows your smart agent handover settings.\"\n\t\t\t\t\tplacement=\"top\"\n\t\t\t\t>\n\t\t\t\t\t{/* A disabled <button> fires no mouse events, so the tooltip would\n\t\t\t\t\t never open on the card itself — the span is the hover target\n\t\t\t\t\t (same wrapper IconButton uses for its disabled tooltip). It also\n\t\t\t\t\t has to carry the card's `flex: 1`, since it is now the flex item. */}\n\t\t\t\t\t<span\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tflex: 1,\n\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\tcursor: 'not-allowed',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioCard\n\t\t\t\t\t\t\tdata-test=\"handover-method-custom\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\tselected={usesCustom}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\t\tisActive={usesCustom}\n\t\t\t\t\t\t\t\tisDisabled\n\t\t\t\t\t\t\t\tonValueChange={() => undefined}\n\t\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.inactive}>\n\t\t\t\t\t\t\t\t\tCustom instructions\n\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.inactive}>\n\t\t\t\t\t\t\t\t\tWrite custom handover rules for this agent.\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t\t</RadioCard>\n\t\t\t\t\t</span>\n\t\t\t\t</Tooltip>\n\t\t\t</CardRow>\n\t\t</FieldBlock>\n\t);\n};\n"],"names":["DEFAULT_METHOD","HandoverMethodSection","method","onMethodChange","onSmartAgentHandover","dataTest","usesCustom","jsxs","FieldBlock","jsx","TitleSmall","COLORS","CardRow","RadioCard","RadioButton","BASE_COLORS","RadioCardText","BodyCaption","ChannelsLink","event","RedirectIcon","Tooltip"],"mappings":";;;;;;;AAmBA,MAAMA,IAAiC,WAsB1BC,IAA8D,CAAC;AAAA,EAC3E,QAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,aAAaC;AACd,MAAM;AAGL,QAAMC,IAAaJ,MAAWF;AAE9B,SACC,gBAAAO,EAACC,GAAA,EAAW,aAAWH,GACtB,UAAA;AAAA,IAAA,gBAAAI,EAACC,GAAA,EAAW,OAAOC,EAAO,QAAQ,SAAS,UAAA,mBAAe;AAAA,sBAEzDC,GAAA,EACA,UAAA;AAAA,MAAA,gBAAAL;AAAA,QAACM;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,MAAK;AAAA,UACL,UAAU,CAACP;AAAA,UACX,SAAS,MAAMH,EAAeH,CAAc;AAAA,UAE5C,UAAA;AAAA,YAAA,gBAAAS;AAAA,cAACK;AAAA,cAAA;AAAA,gBACA,UAAU,CAACR;AAAA,gBACX,eAAe,MAAMH,EAAeH,CAAc;AAAA,gBAClD,kBAAgB;AAAA,gBAChB,aAAae,EAAY,MAAM,GAAK;AAAA,cAAA;AAAA,YAAA;AAAA,8BAEpCC,GAAA,EACA,UAAA;AAAA,cAAA,gBAAAP,EAACC,GAAA,EAAW,OAAOC,EAAO,QAAQ,SAAS,UAAA,wBAE3C;AAAA,cACA,gBAAAJ,EAACU,GAAA,EAAY,OAAON,EAAO,QAAQ,WAAW,UAAA;AAAA,gBAAA;AAAA,gBAC/B;AAAA,gBACbP,IACA,gBAAAG;AAAA,kBAACW;AAAA,kBAAA;AAAA,oBACA,aAAU;AAAA,oBACV,MAAK;AAAA,oBAGL,SAAS,CAACC,MAAU;AACnB,sBAAAA,EAAM,gBAAA,GACNf,EAA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