@bikdotai/bik-component-library 0.0.858-beta.1 → 0.0.858
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 -4
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js +23 -23
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/AiTextArea.js +1 -1
- package/dist/cjs/components/agent-builder/components/AiTextArea.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js +2 -2
- package/dist/cjs/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
- package/dist/cjs/components/bik-chatbot/components/ChatWindow.js +20 -20
- package/dist/cjs/components/bik-chatbot/components/ChatWindow.js.map +1 -1
- package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js +2 -2
- package/dist/cjs/components/feature-announcements/FeatureAnnouncementProvider.js.map +1 -1
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js +2 -2
- package/dist/cjs/components/feature-announcements/MajorUpdatePopup.js.map +1 -1
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js +1 -1
- package/dist/cjs/components/feature-announcements/MinorUpdatePopup.js.map +1 -1
- package/dist/cjs/components/input/ChipInput.js +1 -1
- package/dist/cjs/components/input/ChipInput.js.map +1 -1
- package/dist/cjs/components/input/Input-helper.js +1 -1
- package/dist/cjs/components/input/Input-helper.js.map +1 -1
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/input/Input.js.map +1 -1
- package/dist/cjs/components/plans/SubscriptionPlanSelector.js +5 -5
- package/dist/cjs/components/plans/SubscriptionPlanSelector.js.map +1 -1
- package/dist/cjs/editor/BikEditor.js +1 -1
- package/dist/cjs/editor/BikEditor.js.map +1 -1
- package/dist/cjs/editor/BikEditor.utils.js +3 -3
- package/dist/cjs/editor/BikEditor.utils.js.map +1 -1
- package/dist/cjs/editor/extensions/buildExtensions.js +2 -2
- package/dist/cjs/editor/extensions/buildExtensions.js.map +1 -1
- package/dist/cjs/editor/extensions/htmlTagStrip/HtmlTagStripExtension.js +2 -0
- package/dist/cjs/editor/extensions/htmlTagStrip/HtmlTagStripExtension.js.map +1 -0
- package/dist/cjs/helpers/sanitize.js +2 -0
- package/dist/cjs/helpers/sanitize.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js +144 -143
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js.map +1 -1
- package/dist/esm/components/agent-builder/components/AiTextArea.js +24 -23
- package/dist/esm/components/agent-builder/components/AiTextArea.js.map +1 -1
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.js +38 -37
- package/dist/esm/components/agent-builder/components/ToolInstructionsField.js.map +1 -1
- package/dist/esm/components/bik-chatbot/components/ChatWindow.js +54 -53
- package/dist/esm/components/bik-chatbot/components/ChatWindow.js.map +1 -1
- package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js +346 -420
- package/dist/esm/components/feature-announcements/FeatureAnnouncementProvider.js.map +1 -1
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.js +35 -33
- package/dist/esm/components/feature-announcements/MajorUpdatePopup.js.map +1 -1
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.js +48 -47
- package/dist/esm/components/feature-announcements/MinorUpdatePopup.js.map +1 -1
- package/dist/esm/components/feature-announcements/types/props.types.d.ts +2 -2
- package/dist/esm/components/input/ChipInput.js +41 -40
- package/dist/esm/components/input/ChipInput.js.map +1 -1
- package/dist/esm/components/input/Input-helper.d.ts +7 -0
- package/dist/esm/components/input/Input-helper.js +16 -25
- package/dist/esm/components/input/Input-helper.js.map +1 -1
- package/dist/esm/components/input/Input.js +59 -57
- package/dist/esm/components/input/Input.js.map +1 -1
- package/dist/esm/components/input/Input.model.d.ts +1 -0
- package/dist/esm/components/plans/SubscriptionPlanSelector.js +42 -40
- package/dist/esm/components/plans/SubscriptionPlanSelector.js.map +1 -1
- package/dist/esm/editor/BikEditor.js +221 -217
- package/dist/esm/editor/BikEditor.js.map +1 -1
- package/dist/esm/editor/BikEditor.utils.d.ts +1 -1
- package/dist/esm/editor/BikEditor.utils.js +141 -140
- package/dist/esm/editor/BikEditor.utils.js.map +1 -1
- package/dist/esm/editor/extensions/buildExtensions.js +35 -25
- package/dist/esm/editor/extensions/buildExtensions.js.map +1 -1
- package/dist/esm/editor/extensions/htmlTagStrip/HtmlTagStripExtension.d.ts +13 -0
- package/dist/esm/editor/extensions/htmlTagStrip/HtmlTagStripExtension.js +64 -0
- package/dist/esm/editor/extensions/htmlTagStrip/HtmlTagStripExtension.js.map +1 -0
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/sanitize.d.ts +32 -0
- package/dist/esm/helpers/sanitize.js +207 -0
- package/dist/esm/helpers/sanitize.js.map +1 -0
- package/dist/esm/icons/index.d.ts +25 -25
- package/dist/esm/index.js +125 -115
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolInstructionsField.js","sources":["../../../../../src/components/agent-builder/components/ToolInstructionsField.tsx"],"sourcesContent":["import { WandSparkles } from '@src/icons';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport type { VariableListInterfaceV3 } from '../../variable-picker-v3/model';\nimport {\n\tAiTextAreaInput,\n\tAiTextAreaShell,\n\tFieldBlock,\n} from '../AgentBuilder.styled';\nimport { MentionEditor } from './MentionEditor';\n\ninterface ToolInstructionsFieldProps {\n\tlabel: string;\n\tvalue: string;\n\tonChange: (value: string) => void;\n\tmaxLength: number;\n\tplaceholder?: string;\n\tminHeight?: string;\n\t/** \"Improve with AI\" — resolves with rewritten text. Omit to hide the button. */\n\tonImprove?: (text: string) => Promise<string>;\n\t/**\n\t * Variable catalog. When non-empty the field upgrades from a plain textarea\n\t * to a variables-only `@` mention editor: typing `@` opens the variable\n\t * categories directly (Variables is the sole category, so the picker skips\n\t * the Tools / Sub-agent root), and picks render as chips persisted as\n\t * `{{variable:<name>}}` tokens.\n\t */\n\tvariablesData?: VariableListInterfaceV3[];\n\t'data-test'?: string;\n}\n\n/**\n * A labelled multiline field with an inline \"Improve with AI\" action pinned to\n * the bottom-left of the box (Figma: Rest API / Handover-to-email drawers). The\n * button is hidden when `onImprove` is omitted.\n */\nexport const ToolInstructionsField: React.FC<ToolInstructionsFieldProps> = ({\n\tlabel,\n\tvalue,\n\tonChange,\n\tmaxLength,\n\tplaceholder,\n\tminHeight = '120px',\n\tonImprove,\n\tvariablesData,\n\t...rest\n}) => {\n\tconst [focused, setFocused] = useState(false);\n\tconst [improving, setImproving] = useState(false);\n\t// Bumped when \"Improve with AI\" replaces the text externally — the mention\n\t// editor only reads `value` on (re)mount, so it must be remounted.\n\tconst [editorEpoch, setEditorEpoch] = useState(0);\n\n\tconst withVariables = (variablesData?.length ?? 0) > 0;\n\n\tconst handleImprove = async () => {\n\t\tif (!onImprove || improving || value.trim().length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tsetImproving(true);\n\t\ttry {\n\t\t\tonChange(await onImprove(value));\n\t\t\tif (withVariables) {\n\t\t\t\tsetEditorEpoch((e) => e + 1);\n\t\t\t}\n\t\t} finally {\n\t\t\tsetImproving(false);\n\t\t}\n\t};\n\n\tconst improveAction = onImprove ? (\n\t\t<ImproveRow>\n\t\t\t<Button\n\t\t\t\tdata-test={`${rest['data-test'] ?? 'tool'}-improve`}\n\t\t\t\tbuttonType=\"ai\"\n\t\t\t\tsize=\"small\"\n\t\t\t\tLeadingIcon={WandSparkles}\n\t\t\t\tbuttonText=\"Improve with AI\"\n\t\t\t\tisLoading={improving}\n\t\t\t\tdisabled={improving || value.trim().length === 0}\n\t\t\t\tonClick={handleImprove}\n\t\t\t/>\n\t\t</ImproveRow>\n\t) : undefined;\n\n\t// Variables enabled → the mention-editor variant. `mentionItems` / tool\n\t// hooks stay empty so Variables is the picker's ONLY category and `@` lands\n\t// straight in the variable list.\n\tif (withVariables) {\n\t\treturn (\n\t\t\t<MentionEditor\n\t\t\t\tdata-test={rest['data-test']}\n\t\t\t\tlabel={label}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={onChange}\n\t\t\t\tmaxLength={maxLength}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tminHeight={minHeight}\n\t\t\t\tresetKey={`improve-${editorEpoch}`}\n\t\t\t\tmentionItems={[]}\n\t\t\t\ttools={[]}\n\t\t\t\tvariablesData={variablesData}\n\t\t\t\t// Drawers get the same focused-field \"+ Add data\" affordance as the\n\t\t\t\t// main Step-3 editors.\n\t\t\t\taddDataButton\n\t\t\t\taction={improveAction}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<FieldBlock>\n\t\t\t<TitleSmall color={COLORS.content.primary}>{label}</TitleSmall>\n\t\t\t<AiTextAreaShell focused={focused} minHeight={minHeight}>\n\t\t\t\t<AiTextAreaInput\n\t\t\t\t\tdata-test={rest['data-test']}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\tonFocus={() => setFocused(true)}\n\t\t\t\t\tonBlur={() => setFocused(false)}\n\t\t\t\t\tonChange={(e) => onChange(e.target.value)}\n\t\t\t\t/>\n\t\t\t\t{improveAction}\n\t\t\t</AiTextAreaShell>\n\t\t</FieldBlock>\n\t);\n};\n\nconst ImproveRow = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n`;\n"],"names":["ToolInstructionsField","label","value","onChange","maxLength","placeholder","minHeight","onImprove","variablesData","rest","focused","setFocused","useState","improving","setImproving","editorEpoch","setEditorEpoch","withVariables","handleImprove","e","improveAction","jsx","ImproveRow","Button","WandSparkles","MentionEditor","FieldBlock","TitleSmall","COLORS","jsxs","AiTextAreaShell","AiTextAreaInput","styled"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToolInstructionsField.js","sources":["../../../../../src/components/agent-builder/components/ToolInstructionsField.tsx"],"sourcesContent":["import { stripHtmlTags } from '@src/helpers/sanitize';\nimport { WandSparkles } from '@src/icons';\nimport React, { useState } from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport type { VariableListInterfaceV3 } from '../../variable-picker-v3/model';\nimport {\n\tAiTextAreaInput,\n\tAiTextAreaShell,\n\tFieldBlock,\n} from '../AgentBuilder.styled';\nimport { MentionEditor } from './MentionEditor';\n\ninterface ToolInstructionsFieldProps {\n\tlabel: string;\n\tvalue: string;\n\tonChange: (value: string) => void;\n\tmaxLength: number;\n\tplaceholder?: string;\n\tminHeight?: string;\n\t/** \"Improve with AI\" — resolves with rewritten text. Omit to hide the button. */\n\tonImprove?: (text: string) => Promise<string>;\n\t/**\n\t * Variable catalog. When non-empty the field upgrades from a plain textarea\n\t * to a variables-only `@` mention editor: typing `@` opens the variable\n\t * categories directly (Variables is the sole category, so the picker skips\n\t * the Tools / Sub-agent root), and picks render as chips persisted as\n\t * `{{variable:<name>}}` tokens.\n\t */\n\tvariablesData?: VariableListInterfaceV3[];\n\t'data-test'?: string;\n}\n\n/**\n * A labelled multiline field with an inline \"Improve with AI\" action pinned to\n * the bottom-left of the box (Figma: Rest API / Handover-to-email drawers). The\n * button is hidden when `onImprove` is omitted.\n */\nexport const ToolInstructionsField: React.FC<ToolInstructionsFieldProps> = ({\n\tlabel,\n\tvalue,\n\tonChange,\n\tmaxLength,\n\tplaceholder,\n\tminHeight = '120px',\n\tonImprove,\n\tvariablesData,\n\t...rest\n}) => {\n\tconst [focused, setFocused] = useState(false);\n\tconst [improving, setImproving] = useState(false);\n\t// Bumped when \"Improve with AI\" replaces the text externally — the mention\n\t// editor only reads `value` on (re)mount, so it must be remounted.\n\tconst [editorEpoch, setEditorEpoch] = useState(0);\n\n\tconst withVariables = (variablesData?.length ?? 0) > 0;\n\n\tconst handleImprove = async () => {\n\t\tif (!onImprove || improving || value.trim().length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tsetImproving(true);\n\t\ttry {\n\t\t\tonChange(await onImprove(value));\n\t\t\tif (withVariables) {\n\t\t\t\tsetEditorEpoch((e) => e + 1);\n\t\t\t}\n\t\t} finally {\n\t\t\tsetImproving(false);\n\t\t}\n\t};\n\n\tconst improveAction = onImprove ? (\n\t\t<ImproveRow>\n\t\t\t<Button\n\t\t\t\tdata-test={`${rest['data-test'] ?? 'tool'}-improve`}\n\t\t\t\tbuttonType=\"ai\"\n\t\t\t\tsize=\"small\"\n\t\t\t\tLeadingIcon={WandSparkles}\n\t\t\t\tbuttonText=\"Improve with AI\"\n\t\t\t\tisLoading={improving}\n\t\t\t\tdisabled={improving || value.trim().length === 0}\n\t\t\t\tonClick={handleImprove}\n\t\t\t/>\n\t\t</ImproveRow>\n\t) : undefined;\n\n\t// Variables enabled → the mention-editor variant. `mentionItems` / tool\n\t// hooks stay empty so Variables is the picker's ONLY category and `@` lands\n\t// straight in the variable list.\n\tif (withVariables) {\n\t\treturn (\n\t\t\t<MentionEditor\n\t\t\t\tdata-test={rest['data-test']}\n\t\t\t\tlabel={label}\n\t\t\t\tvalue={value}\n\t\t\t\tonChange={onChange}\n\t\t\t\tmaxLength={maxLength}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tminHeight={minHeight}\n\t\t\t\tresetKey={`improve-${editorEpoch}`}\n\t\t\t\tmentionItems={[]}\n\t\t\t\ttools={[]}\n\t\t\t\tvariablesData={variablesData}\n\t\t\t\t// Drawers get the same focused-field \"+ Add data\" affordance as the\n\t\t\t\t// main Step-3 editors.\n\t\t\t\taddDataButton\n\t\t\t\taction={improveAction}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<FieldBlock>\n\t\t\t<TitleSmall color={COLORS.content.primary}>{label}</TitleSmall>\n\t\t\t<AiTextAreaShell focused={focused} minHeight={minHeight}>\n\t\t\t\t<AiTextAreaInput\n\t\t\t\t\tdata-test={rest['data-test']}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tmaxLength={maxLength}\n\t\t\t\t\tonFocus={() => setFocused(true)}\n\t\t\t\t\tonBlur={() => setFocused(false)}\n\t\t\t\t\tonChange={(e) => onChange(stripHtmlTags(e.target.value))}\n\t\t\t\t/>\n\t\t\t\t{improveAction}\n\t\t\t</AiTextAreaShell>\n\t\t</FieldBlock>\n\t);\n};\n\nconst ImproveRow = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n`;\n"],"names":["ToolInstructionsField","label","value","onChange","maxLength","placeholder","minHeight","onImprove","variablesData","rest","focused","setFocused","useState","improving","setImproving","editorEpoch","setEditorEpoch","withVariables","handleImprove","e","improveAction","jsx","ImproveRow","Button","WandSparkles","MentionEditor","FieldBlock","TitleSmall","COLORS","jsxs","AiTextAreaShell","AiTextAreaInput","stripHtmlTags","styled"],"mappings":";;;;;;;;;;AAwCO,MAAMA,IAA8D,CAAC;AAAA,EAC3E,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACJ,MAAM;AACL,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK,GACtC,CAACC,GAAWC,CAAY,IAAIF,EAAS,EAAK,GAG1C,CAACG,GAAaC,CAAc,IAAIJ,EAAS,CAAC,GAE1CK,KAAiBT,GAAe,UAAU,KAAK,GAE/CU,IAAgB,YAAY;AACjC,QAAI,GAACX,KAAaM,KAAaX,EAAM,KAAA,EAAO,WAAW,IAGvD;AAAA,MAAAY,EAAa,EAAI;AACjB,UAAI;AACH,QAAAX,EAAS,MAAMI,EAAUL,CAAK,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AAcb,EAAE,OAAO,KAAK,CAAC;AAAA,QAAA;AAAA,MAAA;AAAA,MAEvDC;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACD;AAEF,GAEME,IAAaW,EAAO;AAAA;AAAA;AAAA;"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import L from "../../../assets/icons/Ai_event_generating.svg.js";
|
|
3
|
-
import {
|
|
3
|
+
import { stripHtmlTags as V } from "../../../helpers/sanitize.js";
|
|
4
|
+
import { useState as f, useRef as S, useEffect as W } from "react";
|
|
4
5
|
import n from "styled-components";
|
|
5
|
-
import { BodySecondary as
|
|
6
|
-
import { renderMarkdownLite as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
6
|
+
import { BodySecondary as E, BodyCaption as K } from "../../TypographyStyle.js";
|
|
7
|
+
import { renderMarkdownLite as R } from "../utils/markdown.js";
|
|
8
|
+
import P from "./ThinkingIndicator.js";
|
|
9
|
+
const _ = n.div`
|
|
9
10
|
display: flex;
|
|
10
11
|
flex-direction: column;
|
|
11
12
|
width: 100%;
|
|
@@ -34,7 +35,7 @@ const P = n.div`
|
|
|
34
35
|
`;
|
|
35
36
|
}
|
|
36
37
|
}}
|
|
37
|
-
`,
|
|
38
|
+
`, N = n.div`
|
|
38
39
|
padding: 16px;
|
|
39
40
|
border-bottom: 1px solid #e5e7eb;
|
|
40
41
|
display: flex;
|
|
@@ -48,13 +49,13 @@ const P = n.div`
|
|
|
48
49
|
font-weight: 500;
|
|
49
50
|
color: #374151;
|
|
50
51
|
}
|
|
51
|
-
`,
|
|
52
|
+
`, q = n.div`
|
|
52
53
|
flex: 1;
|
|
53
54
|
display: flex;
|
|
54
55
|
flex-direction: column;
|
|
55
56
|
overflow: hidden;
|
|
56
57
|
min-height: 0;
|
|
57
|
-
`,
|
|
58
|
+
`, J = n.div`
|
|
58
59
|
flex: 1;
|
|
59
60
|
overflow-y: auto;
|
|
60
61
|
padding: 16px;
|
|
@@ -83,13 +84,13 @@ const P = n.div`
|
|
|
83
84
|
&::-webkit-scrollbar-thumb:hover {
|
|
84
85
|
background: #a8a8a8;
|
|
85
86
|
}
|
|
86
|
-
`,
|
|
87
|
+
`, O = n.div`
|
|
87
88
|
background: white;
|
|
88
89
|
border-radius: 12px;
|
|
89
90
|
padding: 16px;
|
|
90
91
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
91
92
|
border: 1px solid #e5e7eb;
|
|
92
|
-
`,
|
|
93
|
+
`, Q = n.div`
|
|
93
94
|
width: 100%;
|
|
94
95
|
height: 180px;
|
|
95
96
|
background: #f3f4f6;
|
|
@@ -99,7 +100,7 @@ const P = n.div`
|
|
|
99
100
|
justify-content: center;
|
|
100
101
|
position: relative;
|
|
101
102
|
margin-bottom: 12px;
|
|
102
|
-
`,
|
|
103
|
+
`, U = n.div`
|
|
103
104
|
width: 48px;
|
|
104
105
|
height: 48px;
|
|
105
106
|
background: rgba(0, 0, 0, 0.7);
|
|
@@ -121,11 +122,11 @@ const P = n.div`
|
|
|
121
122
|
fill: white;
|
|
122
123
|
margin-left: 2px;
|
|
123
124
|
}
|
|
124
|
-
`,
|
|
125
|
+
`, X = n.div`
|
|
125
126
|
font-size: 14px;
|
|
126
127
|
color: #374151;
|
|
127
128
|
line-height: 1.5;
|
|
128
|
-
`,
|
|
129
|
+
`, Y = n.div`
|
|
129
130
|
padding: 12px 16px;
|
|
130
131
|
border-radius: 16px;
|
|
131
132
|
font-size: 14px;
|
|
@@ -161,15 +162,15 @@ const P = n.div`
|
|
|
161
162
|
border-bottom-left-radius: 4px;
|
|
162
163
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
163
164
|
`}
|
|
164
|
-
`,
|
|
165
|
+
`, Z = n.div`
|
|
165
166
|
padding: 16px;
|
|
166
167
|
flex-shrink: 0;
|
|
167
|
-
`,
|
|
168
|
+
`, ee = n.div`
|
|
168
169
|
display: flex;
|
|
169
170
|
flex-direction: column;
|
|
170
171
|
gap: 8px;
|
|
171
172
|
align-items: flex-end;
|
|
172
|
-
`,
|
|
173
|
+
`, te = n.button`
|
|
173
174
|
border: 1px dotted #febad2;
|
|
174
175
|
background: linear-gradient(
|
|
175
176
|
92.69deg,
|
|
@@ -198,14 +199,14 @@ const P = n.div`
|
|
|
198
199
|
&:active:not(:disabled) {
|
|
199
200
|
transform: scale(0.98);
|
|
200
201
|
}
|
|
201
|
-
`,
|
|
202
|
+
`, ie = n.div`
|
|
202
203
|
padding: 16px;
|
|
203
204
|
background: white;
|
|
204
|
-
`,
|
|
205
|
+
`, ne = n.div`
|
|
205
206
|
display: flex;
|
|
206
207
|
flex-direction: column;
|
|
207
208
|
gap: 8px;
|
|
208
|
-
`,
|
|
209
|
+
`, re = n.button`
|
|
209
210
|
background: #fef2f2;
|
|
210
211
|
color: #dc2626;
|
|
211
212
|
padding: 12px 16px;
|
|
@@ -225,14 +226,14 @@ const P = n.div`
|
|
|
225
226
|
&:active:not(:disabled) {
|
|
226
227
|
transform: scale(0.98);
|
|
227
228
|
}
|
|
228
|
-
`,
|
|
229
|
+
`, oe = n.div`
|
|
229
230
|
padding: 16px;
|
|
230
231
|
flex-shrink: 0;
|
|
231
|
-
`,
|
|
232
|
+
`, ae = n.div`
|
|
232
233
|
position: relative;
|
|
233
234
|
display: flex;
|
|
234
235
|
width: 100%;
|
|
235
|
-
`,
|
|
236
|
+
`, de = n.textarea`
|
|
236
237
|
flex: 1;
|
|
237
238
|
border: 1px solid ${(e) => e.hasText ? "#3b82f6" : "#d1d5db"};
|
|
238
239
|
border-radius: 12px;
|
|
@@ -259,7 +260,7 @@ const P = n.div`
|
|
|
259
260
|
&::placeholder {
|
|
260
261
|
color: #9ca3af;
|
|
261
262
|
}
|
|
262
|
-
`,
|
|
263
|
+
`, le = n.button`
|
|
263
264
|
position: absolute;
|
|
264
265
|
bottom: 10px;
|
|
265
266
|
right: 10px;
|
|
@@ -291,7 +292,7 @@ const P = n.div`
|
|
|
291
292
|
fill: white;
|
|
292
293
|
font-weight: bold;
|
|
293
294
|
}
|
|
294
|
-
`,
|
|
295
|
+
`, se = n.span`
|
|
295
296
|
background: linear-gradient(
|
|
296
297
|
${(e) => e.angle || 92.69}deg,
|
|
297
298
|
${(e) => e.colors || "#ff166a 0.37%, #fb5f08 100%"}
|
|
@@ -300,11 +301,11 @@ const P = n.div`
|
|
|
300
301
|
-webkit-text-fill-color: transparent;
|
|
301
302
|
background-clip: text;
|
|
302
303
|
display: inline-block;
|
|
303
|
-
`,
|
|
304
|
+
`, ke = ({
|
|
304
305
|
messages: e,
|
|
305
306
|
onSend: p,
|
|
306
|
-
header:
|
|
307
|
-
placeholder:
|
|
307
|
+
header: T = "Create with AI",
|
|
308
|
+
placeholder: I = "Discover the right event & launch campaigns for better conversions...",
|
|
308
309
|
suggestions: u = [
|
|
309
310
|
"Top festivals for marketing",
|
|
310
311
|
"Top events this week?",
|
|
@@ -325,51 +326,51 @@ const P = n.div`
|
|
|
325
326
|
r || i.key === "Enter" && !i.shiftKey && (i.preventDefault(), !b && a.trim() && F());
|
|
326
327
|
}, H = (i) => {
|
|
327
328
|
if (r) return;
|
|
328
|
-
const C = i.target.value;
|
|
329
|
+
const C = V(i.target.value);
|
|
329
330
|
w(C), j(C.trim().length > 0);
|
|
330
331
|
const h = y.current;
|
|
331
332
|
h && (h.style.height = "auto", h.style.height = `${Math.min(h.scrollHeight, 117)}px`);
|
|
332
333
|
}, x = a.trim().length > 0, G = r || b || !x;
|
|
333
|
-
return
|
|
334
|
+
return W(() => {
|
|
334
335
|
v.current?.scrollIntoView({ behavior: "smooth" });
|
|
335
|
-
}, [e, c, s]), /* @__PURE__ */ o(
|
|
336
|
-
/* @__PURE__ */ o(
|
|
336
|
+
}, [e, c, s]), /* @__PURE__ */ o(_, { chatState: d, style: { height: B || "100%" }, children: [
|
|
337
|
+
/* @__PURE__ */ o(N, { children: [
|
|
337
338
|
/* @__PURE__ */ t(L, { height: 24, width: 24 }),
|
|
338
|
-
/* @__PURE__ */ t("div", { className: "header-text", children:
|
|
339
|
+
/* @__PURE__ */ t("div", { className: "header-text", children: T })
|
|
339
340
|
] }),
|
|
340
|
-
/* @__PURE__ */ o(
|
|
341
|
-
/* @__PURE__ */ o(
|
|
342
|
-
d === "conversation-starter" && l && /* @__PURE__ */ o(
|
|
343
|
-
/* @__PURE__ */ t(
|
|
344
|
-
/* @__PURE__ */ o(
|
|
345
|
-
/* @__PURE__ */ t(
|
|
346
|
-
/* @__PURE__ */ t(
|
|
341
|
+
/* @__PURE__ */ o(q, { children: [
|
|
342
|
+
/* @__PURE__ */ o(J, { children: [
|
|
343
|
+
d === "conversation-starter" && l && /* @__PURE__ */ o(O, { children: [
|
|
344
|
+
/* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(U, { onClick: l.onPlay, children: /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ t("path", { d: "M8 5v14l11-7z" }) }) }) }),
|
|
345
|
+
/* @__PURE__ */ o(X, { children: [
|
|
346
|
+
/* @__PURE__ */ t(E, { style: { fontWeight: 500, marginBottom: "4px" }, children: l.title }),
|
|
347
|
+
/* @__PURE__ */ t(K, { children: l.description })
|
|
347
348
|
] })
|
|
348
349
|
] }),
|
|
349
|
-
e.map((i) => /* @__PURE__ */ t(
|
|
350
|
+
e.map((i) => /* @__PURE__ */ t(Y, { role: i.role, children: i.role === "assistant" ? /* @__PURE__ */ t(
|
|
350
351
|
"div",
|
|
351
352
|
{
|
|
352
353
|
dangerouslySetInnerHTML: {
|
|
353
|
-
__html:
|
|
354
|
+
__html: R(i.content)
|
|
354
355
|
}
|
|
355
356
|
}
|
|
356
357
|
) : /* @__PURE__ */ t("div", { style: { whiteSpace: "pre-wrap" }, children: i.content }) }, i.id)),
|
|
357
|
-
(c || s) && /* @__PURE__ */ t(
|
|
358
|
+
(c || s) && /* @__PURE__ */ t(P, {}),
|
|
358
359
|
/* @__PURE__ */ t("div", { ref: v })
|
|
359
360
|
] }),
|
|
360
|
-
g && d === "conversation-starter" && /* @__PURE__ */ t(
|
|
361
|
-
|
|
361
|
+
g && d === "conversation-starter" && /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t(ee, { children: g.map((i) => /* @__PURE__ */ t(
|
|
362
|
+
te,
|
|
362
363
|
{
|
|
363
364
|
disabled: r,
|
|
364
365
|
onClick: () => {
|
|
365
366
|
r || (z?.(i), p(i.text));
|
|
366
367
|
},
|
|
367
|
-
children: /* @__PURE__ */ t(
|
|
368
|
+
children: /* @__PURE__ */ t(se, { children: i.text })
|
|
368
369
|
},
|
|
369
370
|
i.id
|
|
370
371
|
)) }) }),
|
|
371
|
-
!g && u.length > 0 && d === "default" && /* @__PURE__ */ t(
|
|
372
|
-
|
|
372
|
+
!g && u.length > 0 && d === "default" && /* @__PURE__ */ t(ie, { children: /* @__PURE__ */ t(ne, { children: u.map((i) => /* @__PURE__ */ t(
|
|
373
|
+
re,
|
|
373
374
|
{
|
|
374
375
|
disabled: r,
|
|
375
376
|
onClick: () => !r && p(i),
|
|
@@ -377,14 +378,14 @@ const P = n.div`
|
|
|
377
378
|
},
|
|
378
379
|
i
|
|
379
380
|
)) }) }),
|
|
380
|
-
/* @__PURE__ */ t(
|
|
381
|
+
/* @__PURE__ */ t(oe, { children: /* @__PURE__ */ o(ae, { children: [
|
|
381
382
|
/* @__PURE__ */ t(
|
|
382
|
-
|
|
383
|
+
de,
|
|
383
384
|
{
|
|
384
385
|
ref: y,
|
|
385
386
|
value: a,
|
|
386
387
|
onChange: H,
|
|
387
|
-
placeholder:
|
|
388
|
+
placeholder: I,
|
|
388
389
|
onKeyDown: D,
|
|
389
390
|
disabled: r,
|
|
390
391
|
hasText: x,
|
|
@@ -392,7 +393,7 @@ const P = n.div`
|
|
|
392
393
|
}
|
|
393
394
|
),
|
|
394
395
|
/* @__PURE__ */ t(
|
|
395
|
-
|
|
396
|
+
le,
|
|
396
397
|
{
|
|
397
398
|
onClick: F,
|
|
398
399
|
disabled: G,
|
|
@@ -422,7 +423,7 @@ const P = n.div`
|
|
|
422
423
|
] });
|
|
423
424
|
};
|
|
424
425
|
export {
|
|
425
|
-
|
|
426
|
-
|
|
426
|
+
se as CustomGradientText,
|
|
427
|
+
ke as default
|
|
427
428
|
};
|
|
428
429
|
//# sourceMappingURL=ChatWindow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatWindow.js","sources":["../../../../../src/components/bik-chatbot/components/ChatWindow.tsx"],"sourcesContent":["import AiIcon from '@src/assets/icons/Ai_event_generating.svg';\nimport React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { BodyCaption, BodySecondary } from '@src/components/TypographyStyle';\nimport { ChatState, ChatWindowProps } from '../types';\nimport { renderMarkdownLite } from '../utils/markdown';\nimport ThinkingIndicator from './ThinkingIndicator';\n\n// Single-column layout container\nconst ChatContainer = styled.div<{ chatState: ChatState }>`\n\tdisplay: flex;\n\tflex-direction: column;\n\twidth: 100%;\n\tmin-width: 0;\n\tmin-height: 0;\n\theight: 100%;\n\tmax-height: 100%;\n\tbackground: white;\n\tborder-left: 1px solid #e5e7eb;\n\tposition: relative;\n\n\t/* State-based styling */\n\t${(props) => {\n\t\tswitch (props.chatState) {\n\t\t\tcase 'conversation-starter':\n\t\t\t\treturn `\n background: linear-gradient(180deg, #FFF6F9 0%, #FFFFFF 100%);\n `;\n\t\t\tcase 'thinking':\n\t\t\t\treturn `\n background: linear-gradient(180deg, #F8F9FA 0%, #FFFFFF 100%);\n `;\n\t\t\tdefault:\n\t\t\t\treturn `\n background: white;\n `;\n\t\t}\n\t}}\n`;\n\nconst Header = styled.div`\n\tpadding: 16px;\n\tborder-bottom: 1px solid #e5e7eb;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tbackground: white;\n\tflex-shrink: 0;\n\n\t.header-text {\n\t\tfont-size: 14px;\n\t\tfont-weight: 500;\n\t\tcolor: #374151;\n\t}\n`;\n\n// Main content area - single column\nconst MainContent = styled.div`\n\tflex: 1;\n\tdisplay: flex;\n\tflex-direction: column;\n\toverflow: hidden;\n\tmin-height: 0;\n`;\n\nconst MessagesWrapper = styled.div`\n\tflex: 1;\n\toverflow-y: auto;\n\tpadding: 16px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n\tbackground: #fafafa;\n\tscroll-behavior: smooth;\n\tmin-height: 0;\n\n\t/* Custom scrollbar */\n\t&::-webkit-scrollbar {\n\t\twidth: 6px;\n\t}\n\n\t&::-webkit-scrollbar-track {\n\t\tbackground: #f1f1f1;\n\t\tborder-radius: 3px;\n\t}\n\n\t&::-webkit-scrollbar-thumb {\n\t\tbackground: #c1c1c1;\n\t\tborder-radius: 3px;\n\t}\n\n\t&::-webkit-scrollbar-thumb:hover {\n\t\tbackground: #a8a8a8;\n\t}\n`;\n\nconst VideoCard = styled.div`\n\tbackground: white;\n\tborder-radius: 12px;\n\tpadding: 16px;\n\tbox-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n\tborder: 1px solid #e5e7eb;\n`;\n\nconst VideoContainer = styled.div`\n\twidth: 100%;\n\theight: 180px;\n\tbackground: #f3f4f6;\n\tborder-radius: 8px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tposition: relative;\n\tmargin-bottom: 12px;\n`;\n\nconst PlayButton = styled.div`\n\twidth: 48px;\n\theight: 48px;\n\tbackground: rgba(0, 0, 0, 0.7);\n\tborder-radius: 50%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n\n\t&:hover {\n\t\tbackground: rgba(0, 0, 0, 0.8);\n\t\ttransform: scale(1.05);\n\t}\n\n\tsvg {\n\t\twidth: 16px;\n\t\theight: 16px;\n\t\tfill: white;\n\t\tmargin-left: 2px;\n\t}\n`;\n\nconst VideoText = styled.div`\n\tfont-size: 14px;\n\tcolor: #374151;\n\tline-height: 1.5;\n`;\n\nconst Bubble = styled.div<{ role: 'user' | 'assistant' | 'system' }>`\n\tpadding: 12px 16px;\n\tborder-radius: 16px;\n\tfont-size: 14px;\n\tmax-width: 80%;\n\twhite-space: pre-line;\n\tword-wrap: break-word;\n\n\t${(props) =>\n\t\tprops.role === 'user'\n\t\t\t? `\n background: linear-gradient(92.69deg, rgba(255, 230, 238, 0.5) 0.37%, rgba(255, 240, 231, 0.5) 100%);\n margin-left: auto;\n border-bottom-right-radius: 4px;\n \n & > div {\n background: linear-gradient(92.69deg, #FF166A 0.37%, #FB5F08 100%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n display: inline-block;\n }\n `\n\t\t\t: props.role === 'system'\n\t\t\t? `\n background: #f3f4f6;\n color: #6b7280;\n font-size: 12px;\n font-style: italic;\n text-align: center;\n margin: 0 auto;\n max-width: 90%;\n `\n\t\t\t: `\n background: white;\n color: #111827;\n border: 1px solid #e5e7eb;\n margin-right: auto;\n border-bottom-left-radius: 4px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n `}\n`;\n\n// Ice breakers section - at the bottom before input\nconst IceBreakersSection = styled.div`\n\tpadding: 16px;\n\tflex-shrink: 0;\n`;\n\nconst IceBreakersGrid = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\talign-items: flex-end;\n`;\n\nconst IceBreakerChip = styled.button<{ disabled?: boolean }>`\n\tborder: 1px dotted #febad2;\n\tbackground: linear-gradient(\n\t\t92.69deg,\n\t\trgba(255, 230, 238, 0.5) 0.37%,\n\t\trgba(255, 240, 231, 0.5) 100%\n\t);\n\tpadding: 8px 16px;\n\tborder-radius: 8px;\n\tfont-size: 13px;\n\tcursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n\ttransition: all 0.2s ease;\n\ttext-align: left;\n\tmax-width: 280px;\n\talign-self: flex-end;\n\topacity: ${(props) => (props.disabled ? 0.5 : 1)};\n\n\t&:hover:not(:disabled) {\n\t\tbackground: linear-gradient(\n\t\t\t92.69deg,\n\t\t\trgba(255, 230, 238, 0.7) 0.37%,\n\t\t\trgba(255, 240, 231, 0.7) 100%\n\t\t);\n\t\tborder-color: #f472b6;\n\t}\n\n\t&:active:not(:disabled) {\n\t\ttransform: scale(0.98);\n\t}\n`;\n\n// Suggestions section - styled like ice breakers but for regular suggestions\nconst SuggestionsSection = styled.div`\n\tpadding: 16px;\n\tbackground: white;\n`;\n\nconst SuggestionsGrid = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n`;\n\nconst SuggestionChip = styled.button<{ disabled?: boolean }>`\n\tbackground: #fef2f2;\n\tcolor: #dc2626;\n\tpadding: 12px 16px;\n\tborder-radius: 8px;\n\tfont-size: 13px;\n\tborder: 1px solid #fecaca;\n\tcursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n\ttransition: all 0.2s ease;\n\ttext-align: left;\n\topacity: ${(props) => (props.disabled ? 0.5 : 1)};\n\n\t&:hover:not(:disabled) {\n\t\tbackground: #fee2e2;\n\t\tborder-color: #fca5a5;\n\t}\n\n\t&:active:not(:disabled) {\n\t\ttransform: scale(0.98);\n\t}\n`;\n\nconst InputContainer = styled.div`\n\tpadding: 16px;\n\tflex-shrink: 0;\n`;\n\nconst InputBubble = styled.div`\n\tposition: relative;\n\tdisplay: flex;\n\twidth: 100%;\n`;\n\nconst TextInput = styled.textarea<{ hasText: boolean; chatState: ChatState }>`\n\tflex: 1;\n\tborder: 1px solid ${(props) => (props.hasText ? '#3b82f6' : '#d1d5db')};\n\tborder-radius: 12px;\n\tpadding: 12px;\n\tpadding-right: 48px;\n\tfont-size: 14px;\n\toutline: none;\n\tcolor: #374151;\n\tbackground: white;\n\tbox-shadow: 0px 2px 8px 0px #0000001f;\n\ttransition: all 0.2s ease;\n\tresize: none;\n\tmin-height: 44px;\n\tmax-height: 120px;\n\tfont-family: inherit;\n\twidth: 100%;\n\n\t&:focus {\n\t\tborder-color: #3b82f6;\n\t\tbackground: white;\n\t\tbox-shadow: 0px 2px 8px 0px #0000001f, 0 0 0 3px rgba(59, 130, 246, 0.1);\n\t}\n\n\t&::placeholder {\n\t\tcolor: #9ca3af;\n\t}\n`;\n\nconst SendButton = styled.button<{ disabled?: boolean; hasText: boolean }>`\n\tposition: absolute;\n\tbottom: 10px;\n\tright: 10px;\n\twidth: 36px;\n\theight: 36px;\n\tborder-radius: 50%;\n\tbackground: ${(props) =>\n\t\tprops.hasText\n\t\t\t? 'linear-gradient(135deg, #FF166A 0%, #FB5F08 100%)'\n\t\t\t: '#e5e7eb'};\n\tborder: none;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n\ttransition: all 0.2s ease;\n\tbox-shadow: 0 2px 8px 0px #fa709a1c;\n\tz-index: 2;\n\n\t&:hover:not(:disabled) {\n\t\tbackground: ${(props) =>\n\t\t\tprops.hasText && !props.disabled\n\t\t\t\t? 'linear-gradient(135deg, #F857A6 0%, #FF5858 100%)'\n\t\t\t\t: '#e5e7eb'};\n\t\ttransform: scale(1.05);\n\t}\n\n\t&:active:not(:disabled) {\n\t\ttransform: scale(0.95);\n\t}\n\n\tsvg {\n\t\twidth: 16px;\n\t\theight: 16px;\n\t\tfill: white;\n\t\tfont-weight: bold;\n\t}\n`;\n\n// Customizable gradient text component\nexport const CustomGradientText = styled.span<{\n\tcolors?: string;\n\tangle?: number;\n}>`\n\tbackground: linear-gradient(\n\t\t${(props) => props.angle || 92.69}deg,\n\t\t${(props) => props.colors || '#ff166a 0.37%, #fb5f08 100%'}\n\t);\n\t-webkit-background-clip: text;\n\t-webkit-text-fill-color: transparent;\n\tbackground-clip: text;\n\tdisplay: inline-block;\n`;\n\n// Export ChatState type for backward compatibility\nexport type { ChatState } from '../types';\n\ninterface ChatWindowWithHeightProps extends ChatWindowProps {\n\tchatWindowHeight?: string | number;\n}\n\nconst ChatWindow: React.FC<ChatWindowWithHeightProps> = ({\n\tmessages,\n\tonSend,\n\theader = 'Create with AI',\n\tplaceholder = 'Discover the right event & launch campaigns for better conversions...',\n\tsuggestions = [\n\t\t'Top festivals for marketing',\n\t\t'Top events this week?',\n\t\t'Top August festivals near you',\n\t],\n\ticeBreakers,\n\tvideoStarter,\n\tdisabled = false,\n\tisThinking = false,\n\tonIceBreakerClick,\n\tchatState,\n\tchatWindowHeight,\n\tinputDisabled = false,\n}) => {\n\tconst [input, setInput] = useState('');\n\tconst [thinking, setThinking] = useState(false);\n\tconst [isTyping, setIsTyping] = useState(false);\n\tconst bottomRef = useRef<HTMLDivElement>(null);\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\tconst isThinkingState = thinking || isThinking;\n\tconst isInputDisabledState = disabled || inputDisabled;\n\n\t// Determine current chat state\n\tconst getCurrentChatState = (): ChatState => {\n\t\tif (chatState) return chatState; // Explicit state override\n\t\tif (thinking || isThinking) return 'thinking';\n\t\tif (isTyping && input.trim().length > 0) return 'typing';\n\t\tif (messages.length === 0) return 'conversation-starter';\n\t\tif (messages.length > 0) return 'conversation';\n\t\treturn 'default';\n\t};\n\n\tconst currentState = getCurrentChatState();\n\n\t// markdown renderer moved to ../utils/markdown\n\n\tconst handleSend = () => {\n\t\tif (!input.trim() || isInputDisabledState || isThinkingState) return;\n\t\tonSend(input);\n\t\tsetInput('');\n\t\tsetThinking(true);\n\t\tsetTimeout(() => setThinking(false), 1500);\n\t};\n\n\tconst handleKeyDown = (e: React.KeyboardEvent) => {\n\t\tif (isInputDisabledState) return;\n\t\tif (e.key === 'Enter' && !e.shiftKey) {\n\t\t\te.preventDefault();\n\t\t\tif (!isThinkingState && input.trim()) {\n\t\t\t\thandleSend();\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handleInputChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\tif (isInputDisabledState) return;\n\t\tconst value = e.target.value;\n\t\tsetInput(value);\n\t\tsetIsTyping(value.trim().length > 0);\n\n\t\t// Auto-resize textarea\n\t\tconst textarea = textareaRef.current;\n\t\tif (textarea) {\n\t\t\ttextarea.style.height = 'auto';\n\t\t\ttextarea.style.height = `${Math.min(textarea.scrollHeight, 117)}px`;\n\t\t}\n\t};\n\n\tconst hasText = input.trim().length > 0;\n\tconst isSendDisabled = isInputDisabledState || isThinkingState || !hasText;\n\n\tuseEffect(() => {\n\t\tbottomRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t}, [messages, thinking, isThinking]);\n\n\t// Use chatWindowHeight if provided, otherwise use 100% if fullHeight is active\n\tconst containerHeight = chatWindowHeight || '100%';\n\n\treturn (\n\t\t<ChatContainer chatState={currentState} style={{ height: containerHeight }}>\n\t\t\t{/* Header */}\n\t\t\t<Header>\n\t\t\t\t<AiIcon height={24} width={24} />\n\t\t\t\t<div className=\"header-text\">{header}</div>\n\t\t\t</Header>\n\n\t\t\t{/* Main Content - Single Column Layout */}\n\t\t\t<MainContent>\n\t\t\t\t{/* Messages Section */}\n\t\t\t\t<MessagesWrapper>\n\t\t\t\t\t{/* Video starter card - only when no messages and videoStarter provided */}\n\t\t\t\t\t{currentState === 'conversation-starter' && videoStarter && (\n\t\t\t\t\t\t<VideoCard>\n\t\t\t\t\t\t\t<VideoContainer>\n\t\t\t\t\t\t\t\t<PlayButton onClick={videoStarter.onPlay}>\n\t\t\t\t\t\t\t\t\t<svg viewBox=\"0 0 24 24\" fill=\"currentColor\">\n\t\t\t\t\t\t\t\t\t\t<path d=\"M8 5v14l11-7z\" />\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</PlayButton>\n\t\t\t\t\t\t\t</VideoContainer>\n\t\t\t\t\t\t\t<VideoText>\n\t\t\t\t\t\t\t\t<BodySecondary style={{ fontWeight: 500, marginBottom: '4px' }}>\n\t\t\t\t\t\t\t\t\t{videoStarter.title}\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t<BodyCaption>{videoStarter.description}</BodyCaption>\n\t\t\t\t\t\t\t</VideoText>\n\t\t\t\t\t\t</VideoCard>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Render messages (assistant supports lite Markdown) */}\n\t\t\t\t\t{messages.map((m) => (\n\t\t\t\t\t\t<Bubble key={m.id} role={m.role}>\n\t\t\t\t\t\t\t{m.role === 'assistant' ? (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t\t\t\t__html: renderMarkdownLite(m.content),\n\t\t\t\t\t\t\t\t\t}}\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<div style={{ whiteSpace: 'pre-wrap' }}>{m.content}</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Bubble>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{/* Thinking bubble */}\n\t\t\t\t\t{(thinking || isThinking) && <ThinkingIndicator />}\n\n\t\t\t\t\t<div ref={bottomRef} />\n\t\t\t\t</MessagesWrapper>\n\n\t\t\t\t{/* Ice Breakers Section - At bottom when no messages and ice breakers provided */}\n\t\t\t\t{iceBreakers && currentState === 'conversation-starter' && (\n\t\t\t\t\t<IceBreakersSection>\n\t\t\t\t\t\t<IceBreakersGrid>\n\t\t\t\t\t\t\t{iceBreakers.map((iceBreaker) => (\n\t\t\t\t\t\t\t\t<IceBreakerChip\n\t\t\t\t\t\t\t\t\tkey={iceBreaker.id}\n\t\t\t\t\t\t\t\t\tdisabled={isInputDisabledState}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tif (!isInputDisabledState) {\n\t\t\t\t\t\t\t\t\t\t\tonIceBreakerClick?.(iceBreaker);\n\t\t\t\t\t\t\t\t\t\t\tonSend(iceBreaker.text);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CustomGradientText>{iceBreaker.text}</CustomGradientText>\n\t\t\t\t\t\t\t\t</IceBreakerChip>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</IceBreakersGrid>\n\t\t\t\t\t</IceBreakersSection>\n\t\t\t\t)}\n\n\t\t\t\t{/* Regular Suggestions - Show when no ice breakers are provided */}\n\t\t\t\t{!iceBreakers &&\n\t\t\t\t\tsuggestions.length > 0 &&\n\t\t\t\t\tcurrentState === 'default' && (\n\t\t\t\t\t\t<SuggestionsSection>\n\t\t\t\t\t\t\t<SuggestionsGrid>\n\t\t\t\t\t\t\t\t{suggestions.map((s) => (\n\t\t\t\t\t\t\t\t\t<SuggestionChip\n\t\t\t\t\t\t\t\t\t\tkey={s}\n\t\t\t\t\t\t\t\t\t\tdisabled={isInputDisabledState}\n\t\t\t\t\t\t\t\t\t\tonClick={() => !isInputDisabledState && onSend(s)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{s}\n\t\t\t\t\t\t\t\t\t</SuggestionChip>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</SuggestionsGrid>\n\t\t\t\t\t\t</SuggestionsSection>\n\t\t\t\t\t)}\n\n\t\t\t\t{/* Input Container - Always at bottom */}\n\t\t\t\t<InputContainer>\n\t\t\t\t\t<InputBubble>\n\t\t\t\t\t\t<TextInput\n\t\t\t\t\t\t\tref={textareaRef}\n\t\t\t\t\t\t\tvalue={input}\n\t\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tdisabled={isInputDisabledState}\n\t\t\t\t\t\t\thasText={hasText}\n\t\t\t\t\t\t\tchatState={currentState}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<SendButton\n\t\t\t\t\t\t\tonClick={handleSend}\n\t\t\t\t\t\t\tdisabled={isSendDisabled}\n\t\t\t\t\t\t\thasText={hasText}\n\t\t\t\t\t\t\taria-label=\"Send\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\t\tstroke=\"white\"\n\t\t\t\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<path d=\"M6 12h12\" />\n\t\t\t\t\t\t\t\t<path d=\"M12 6l6 6-6 6\" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</SendButton>\n\t\t\t\t\t</InputBubble>\n\t\t\t\t</InputContainer>\n\t\t\t</MainContent>\n\t\t</ChatContainer>\n\t);\n};\n\nexport default ChatWindow;\n"],"names":["ChatContainer","styled","props","Header","MainContent","MessagesWrapper","VideoCard","VideoContainer","PlayButton","VideoText","Bubble","IceBreakersSection","IceBreakersGrid","IceBreakerChip","SuggestionsSection","SuggestionsGrid","SuggestionChip","InputContainer","InputBubble","TextInput","SendButton","CustomGradientText","ChatWindow","messages","onSend","header","placeholder","suggestions","iceBreakers","videoStarter","disabled","isThinking","onIceBreakerClick","chatState","chatWindowHeight","inputDisabled","input","setInput","useState","thinking","setThinking","isTyping","setIsTyping","bottomRef","useRef","textareaRef","isThinkingState","isInputDisabledState","currentState","handleSend","handleKeyDown","e","handleInputChange","value","textarea","hasText","isSendDisabled","useEffect","jsxs","jsx","AiIcon","BodySecondary","BodyCaption","m","renderMarkdownLite","ThinkingIndicator","iceBreaker","s"],"mappings":";;;;;;;AASA,MAAMA,IAAgBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAa1B,CAACC,MAAU;AACZ,UAAQA,EAAM,WAAA;AA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bot/components/ChatWindow.tsx"],"sourcesContent":["import AiIcon from '@src/assets/icons/Ai_event_generating.svg';\nimport { stripHtmlTags } from '@src/helpers/sanitize';\nimport React, { useEffect, useRef, useState } from 'react';\nimport styled from 'styled-components';\nimport { BodyCaption, BodySecondary } from '@src/components/TypographyStyle';\nimport { ChatState, ChatWindowProps } from '../types';\nimport { renderMarkdownLite } from '../utils/markdown';\nimport ThinkingIndicator from './ThinkingIndicator';\n\n// Single-column layout container\nconst ChatContainer = styled.div<{ chatState: ChatState }>`\n\tdisplay: flex;\n\tflex-direction: column;\n\twidth: 100%;\n\tmin-width: 0;\n\tmin-height: 0;\n\theight: 100%;\n\tmax-height: 100%;\n\tbackground: white;\n\tborder-left: 1px solid #e5e7eb;\n\tposition: relative;\n\n\t/* State-based styling */\n\t${(props) => {\n\t\tswitch (props.chatState) {\n\t\t\tcase 'conversation-starter':\n\t\t\t\treturn `\n background: linear-gradient(180deg, #FFF6F9 0%, #FFFFFF 100%);\n `;\n\t\t\tcase 'thinking':\n\t\t\t\treturn `\n background: linear-gradient(180deg, #F8F9FA 0%, #FFFFFF 100%);\n `;\n\t\t\tdefault:\n\t\t\t\treturn `\n background: white;\n `;\n\t\t}\n\t}}\n`;\n\nconst Header = styled.div`\n\tpadding: 16px;\n\tborder-bottom: 1px solid #e5e7eb;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tbackground: white;\n\tflex-shrink: 0;\n\n\t.header-text {\n\t\tfont-size: 14px;\n\t\tfont-weight: 500;\n\t\tcolor: #374151;\n\t}\n`;\n\n// Main content area - single column\nconst MainContent = styled.div`\n\tflex: 1;\n\tdisplay: flex;\n\tflex-direction: column;\n\toverflow: hidden;\n\tmin-height: 0;\n`;\n\nconst MessagesWrapper = styled.div`\n\tflex: 1;\n\toverflow-y: auto;\n\tpadding: 16px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n\tbackground: #fafafa;\n\tscroll-behavior: smooth;\n\tmin-height: 0;\n\n\t/* Custom scrollbar */\n\t&::-webkit-scrollbar {\n\t\twidth: 6px;\n\t}\n\n\t&::-webkit-scrollbar-track {\n\t\tbackground: #f1f1f1;\n\t\tborder-radius: 3px;\n\t}\n\n\t&::-webkit-scrollbar-thumb {\n\t\tbackground: #c1c1c1;\n\t\tborder-radius: 3px;\n\t}\n\n\t&::-webkit-scrollbar-thumb:hover {\n\t\tbackground: #a8a8a8;\n\t}\n`;\n\nconst VideoCard = styled.div`\n\tbackground: white;\n\tborder-radius: 12px;\n\tpadding: 16px;\n\tbox-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n\tborder: 1px solid #e5e7eb;\n`;\n\nconst VideoContainer = styled.div`\n\twidth: 100%;\n\theight: 180px;\n\tbackground: #f3f4f6;\n\tborder-radius: 8px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tposition: relative;\n\tmargin-bottom: 12px;\n`;\n\nconst PlayButton = styled.div`\n\twidth: 48px;\n\theight: 48px;\n\tbackground: rgba(0, 0, 0, 0.7);\n\tborder-radius: 50%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n\n\t&:hover {\n\t\tbackground: rgba(0, 0, 0, 0.8);\n\t\ttransform: scale(1.05);\n\t}\n\n\tsvg {\n\t\twidth: 16px;\n\t\theight: 16px;\n\t\tfill: white;\n\t\tmargin-left: 2px;\n\t}\n`;\n\nconst VideoText = styled.div`\n\tfont-size: 14px;\n\tcolor: #374151;\n\tline-height: 1.5;\n`;\n\nconst Bubble = styled.div<{ role: 'user' | 'assistant' | 'system' }>`\n\tpadding: 12px 16px;\n\tborder-radius: 16px;\n\tfont-size: 14px;\n\tmax-width: 80%;\n\twhite-space: pre-line;\n\tword-wrap: break-word;\n\n\t${(props) =>\n\t\tprops.role === 'user'\n\t\t\t? `\n background: linear-gradient(92.69deg, rgba(255, 230, 238, 0.5) 0.37%, rgba(255, 240, 231, 0.5) 100%);\n margin-left: auto;\n border-bottom-right-radius: 4px;\n \n & > div {\n background: linear-gradient(92.69deg, #FF166A 0.37%, #FB5F08 100%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n display: inline-block;\n }\n `\n\t\t\t: props.role === 'system'\n\t\t\t? `\n background: #f3f4f6;\n color: #6b7280;\n font-size: 12px;\n font-style: italic;\n text-align: center;\n margin: 0 auto;\n max-width: 90%;\n `\n\t\t\t: `\n background: white;\n color: #111827;\n border: 1px solid #e5e7eb;\n margin-right: auto;\n border-bottom-left-radius: 4px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n `}\n`;\n\n// Ice breakers section - at the bottom before input\nconst IceBreakersSection = styled.div`\n\tpadding: 16px;\n\tflex-shrink: 0;\n`;\n\nconst IceBreakersGrid = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\talign-items: flex-end;\n`;\n\nconst IceBreakerChip = styled.button<{ disabled?: boolean }>`\n\tborder: 1px dotted #febad2;\n\tbackground: linear-gradient(\n\t\t92.69deg,\n\t\trgba(255, 230, 238, 0.5) 0.37%,\n\t\trgba(255, 240, 231, 0.5) 100%\n\t);\n\tpadding: 8px 16px;\n\tborder-radius: 8px;\n\tfont-size: 13px;\n\tcursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n\ttransition: all 0.2s ease;\n\ttext-align: left;\n\tmax-width: 280px;\n\talign-self: flex-end;\n\topacity: ${(props) => (props.disabled ? 0.5 : 1)};\n\n\t&:hover:not(:disabled) {\n\t\tbackground: linear-gradient(\n\t\t\t92.69deg,\n\t\t\trgba(255, 230, 238, 0.7) 0.37%,\n\t\t\trgba(255, 240, 231, 0.7) 100%\n\t\t);\n\t\tborder-color: #f472b6;\n\t}\n\n\t&:active:not(:disabled) {\n\t\ttransform: scale(0.98);\n\t}\n`;\n\n// Suggestions section - styled like ice breakers but for regular suggestions\nconst SuggestionsSection = styled.div`\n\tpadding: 16px;\n\tbackground: white;\n`;\n\nconst SuggestionsGrid = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n`;\n\nconst SuggestionChip = styled.button<{ disabled?: boolean }>`\n\tbackground: #fef2f2;\n\tcolor: #dc2626;\n\tpadding: 12px 16px;\n\tborder-radius: 8px;\n\tfont-size: 13px;\n\tborder: 1px solid #fecaca;\n\tcursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n\ttransition: all 0.2s ease;\n\ttext-align: left;\n\topacity: ${(props) => (props.disabled ? 0.5 : 1)};\n\n\t&:hover:not(:disabled) {\n\t\tbackground: #fee2e2;\n\t\tborder-color: #fca5a5;\n\t}\n\n\t&:active:not(:disabled) {\n\t\ttransform: scale(0.98);\n\t}\n`;\n\nconst InputContainer = styled.div`\n\tpadding: 16px;\n\tflex-shrink: 0;\n`;\n\nconst InputBubble = styled.div`\n\tposition: relative;\n\tdisplay: flex;\n\twidth: 100%;\n`;\n\nconst TextInput = styled.textarea<{ hasText: boolean; chatState: ChatState }>`\n\tflex: 1;\n\tborder: 1px solid ${(props) => (props.hasText ? '#3b82f6' : '#d1d5db')};\n\tborder-radius: 12px;\n\tpadding: 12px;\n\tpadding-right: 48px;\n\tfont-size: 14px;\n\toutline: none;\n\tcolor: #374151;\n\tbackground: white;\n\tbox-shadow: 0px 2px 8px 0px #0000001f;\n\ttransition: all 0.2s ease;\n\tresize: none;\n\tmin-height: 44px;\n\tmax-height: 120px;\n\tfont-family: inherit;\n\twidth: 100%;\n\n\t&:focus {\n\t\tborder-color: #3b82f6;\n\t\tbackground: white;\n\t\tbox-shadow: 0px 2px 8px 0px #0000001f, 0 0 0 3px rgba(59, 130, 246, 0.1);\n\t}\n\n\t&::placeholder {\n\t\tcolor: #9ca3af;\n\t}\n`;\n\nconst SendButton = styled.button<{ disabled?: boolean; hasText: boolean }>`\n\tposition: absolute;\n\tbottom: 10px;\n\tright: 10px;\n\twidth: 36px;\n\theight: 36px;\n\tborder-radius: 50%;\n\tbackground: ${(props) =>\n\t\tprops.hasText\n\t\t\t? 'linear-gradient(135deg, #FF166A 0%, #FB5F08 100%)'\n\t\t\t: '#e5e7eb'};\n\tborder: none;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n\ttransition: all 0.2s ease;\n\tbox-shadow: 0 2px 8px 0px #fa709a1c;\n\tz-index: 2;\n\n\t&:hover:not(:disabled) {\n\t\tbackground: ${(props) =>\n\t\t\tprops.hasText && !props.disabled\n\t\t\t\t? 'linear-gradient(135deg, #F857A6 0%, #FF5858 100%)'\n\t\t\t\t: '#e5e7eb'};\n\t\ttransform: scale(1.05);\n\t}\n\n\t&:active:not(:disabled) {\n\t\ttransform: scale(0.95);\n\t}\n\n\tsvg {\n\t\twidth: 16px;\n\t\theight: 16px;\n\t\tfill: white;\n\t\tfont-weight: bold;\n\t}\n`;\n\n// Customizable gradient text component\nexport const CustomGradientText = styled.span<{\n\tcolors?: string;\n\tangle?: number;\n}>`\n\tbackground: linear-gradient(\n\t\t${(props) => props.angle || 92.69}deg,\n\t\t${(props) => props.colors || '#ff166a 0.37%, #fb5f08 100%'}\n\t);\n\t-webkit-background-clip: text;\n\t-webkit-text-fill-color: transparent;\n\tbackground-clip: text;\n\tdisplay: inline-block;\n`;\n\n// Export ChatState type for backward compatibility\nexport type { ChatState } from '../types';\n\ninterface ChatWindowWithHeightProps extends ChatWindowProps {\n\tchatWindowHeight?: string | number;\n}\n\nconst ChatWindow: React.FC<ChatWindowWithHeightProps> = ({\n\tmessages,\n\tonSend,\n\theader = 'Create with AI',\n\tplaceholder = 'Discover the right event & launch campaigns for better conversions...',\n\tsuggestions = [\n\t\t'Top festivals for marketing',\n\t\t'Top events this week?',\n\t\t'Top August festivals near you',\n\t],\n\ticeBreakers,\n\tvideoStarter,\n\tdisabled = false,\n\tisThinking = false,\n\tonIceBreakerClick,\n\tchatState,\n\tchatWindowHeight,\n\tinputDisabled = false,\n}) => {\n\tconst [input, setInput] = useState('');\n\tconst [thinking, setThinking] = useState(false);\n\tconst [isTyping, setIsTyping] = useState(false);\n\tconst bottomRef = useRef<HTMLDivElement>(null);\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\tconst isThinkingState = thinking || isThinking;\n\tconst isInputDisabledState = disabled || inputDisabled;\n\n\t// Determine current chat state\n\tconst getCurrentChatState = (): ChatState => {\n\t\tif (chatState) return chatState; // Explicit state override\n\t\tif (thinking || isThinking) return 'thinking';\n\t\tif (isTyping && input.trim().length > 0) return 'typing';\n\t\tif (messages.length === 0) return 'conversation-starter';\n\t\tif (messages.length > 0) return 'conversation';\n\t\treturn 'default';\n\t};\n\n\tconst currentState = getCurrentChatState();\n\n\t// markdown renderer moved to ../utils/markdown\n\n\tconst handleSend = () => {\n\t\tif (!input.trim() || isInputDisabledState || isThinkingState) return;\n\t\tonSend(input);\n\t\tsetInput('');\n\t\tsetThinking(true);\n\t\tsetTimeout(() => setThinking(false), 1500);\n\t};\n\n\tconst handleKeyDown = (e: React.KeyboardEvent) => {\n\t\tif (isInputDisabledState) return;\n\t\tif (e.key === 'Enter' && !e.shiftKey) {\n\t\t\te.preventDefault();\n\t\t\tif (!isThinkingState && input.trim()) {\n\t\t\t\thandleSend();\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handleInputChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\tif (isInputDisabledState) return;\n\t\tconst value = stripHtmlTags(e.target.value);\n\t\tsetInput(value);\n\t\tsetIsTyping(value.trim().length > 0);\n\n\t\t// Auto-resize textarea\n\t\tconst textarea = textareaRef.current;\n\t\tif (textarea) {\n\t\t\ttextarea.style.height = 'auto';\n\t\t\ttextarea.style.height = `${Math.min(textarea.scrollHeight, 117)}px`;\n\t\t}\n\t};\n\n\tconst hasText = input.trim().length > 0;\n\tconst isSendDisabled = isInputDisabledState || isThinkingState || !hasText;\n\n\tuseEffect(() => {\n\t\tbottomRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t}, [messages, thinking, isThinking]);\n\n\t// Use chatWindowHeight if provided, otherwise use 100% if fullHeight is active\n\tconst containerHeight = chatWindowHeight || '100%';\n\n\treturn (\n\t\t<ChatContainer chatState={currentState} style={{ height: containerHeight }}>\n\t\t\t{/* Header */}\n\t\t\t<Header>\n\t\t\t\t<AiIcon height={24} width={24} />\n\t\t\t\t<div className=\"header-text\">{header}</div>\n\t\t\t</Header>\n\n\t\t\t{/* Main Content - Single Column Layout */}\n\t\t\t<MainContent>\n\t\t\t\t{/* Messages Section */}\n\t\t\t\t<MessagesWrapper>\n\t\t\t\t\t{/* Video starter card - only when no messages and videoStarter provided */}\n\t\t\t\t\t{currentState === 'conversation-starter' && videoStarter && (\n\t\t\t\t\t\t<VideoCard>\n\t\t\t\t\t\t\t<VideoContainer>\n\t\t\t\t\t\t\t\t<PlayButton onClick={videoStarter.onPlay}>\n\t\t\t\t\t\t\t\t\t<svg viewBox=\"0 0 24 24\" fill=\"currentColor\">\n\t\t\t\t\t\t\t\t\t\t<path d=\"M8 5v14l11-7z\" />\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t</PlayButton>\n\t\t\t\t\t\t\t</VideoContainer>\n\t\t\t\t\t\t\t<VideoText>\n\t\t\t\t\t\t\t\t<BodySecondary style={{ fontWeight: 500, marginBottom: '4px' }}>\n\t\t\t\t\t\t\t\t\t{videoStarter.title}\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t<BodyCaption>{videoStarter.description}</BodyCaption>\n\t\t\t\t\t\t\t</VideoText>\n\t\t\t\t\t\t</VideoCard>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{/* Render messages (assistant supports lite Markdown) */}\n\t\t\t\t\t{messages.map((m) => (\n\t\t\t\t\t\t<Bubble key={m.id} role={m.role}>\n\t\t\t\t\t\t\t{m.role === 'assistant' ? (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t\t\t\t__html: renderMarkdownLite(m.content),\n\t\t\t\t\t\t\t\t\t}}\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<div style={{ whiteSpace: 'pre-wrap' }}>{m.content}</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Bubble>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{/* Thinking bubble */}\n\t\t\t\t\t{(thinking || isThinking) && <ThinkingIndicator />}\n\n\t\t\t\t\t<div ref={bottomRef} />\n\t\t\t\t</MessagesWrapper>\n\n\t\t\t\t{/* Ice Breakers Section - At bottom when no messages and ice breakers provided */}\n\t\t\t\t{iceBreakers && currentState === 'conversation-starter' && (\n\t\t\t\t\t<IceBreakersSection>\n\t\t\t\t\t\t<IceBreakersGrid>\n\t\t\t\t\t\t\t{iceBreakers.map((iceBreaker) => (\n\t\t\t\t\t\t\t\t<IceBreakerChip\n\t\t\t\t\t\t\t\t\tkey={iceBreaker.id}\n\t\t\t\t\t\t\t\t\tdisabled={isInputDisabledState}\n\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\tif (!isInputDisabledState) {\n\t\t\t\t\t\t\t\t\t\t\tonIceBreakerClick?.(iceBreaker);\n\t\t\t\t\t\t\t\t\t\t\tonSend(iceBreaker.text);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CustomGradientText>{iceBreaker.text}</CustomGradientText>\n\t\t\t\t\t\t\t\t</IceBreakerChip>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</IceBreakersGrid>\n\t\t\t\t\t</IceBreakersSection>\n\t\t\t\t)}\n\n\t\t\t\t{/* Regular Suggestions - Show when no ice breakers are provided */}\n\t\t\t\t{!iceBreakers &&\n\t\t\t\t\tsuggestions.length > 0 &&\n\t\t\t\t\tcurrentState === 'default' && (\n\t\t\t\t\t\t<SuggestionsSection>\n\t\t\t\t\t\t\t<SuggestionsGrid>\n\t\t\t\t\t\t\t\t{suggestions.map((s) => (\n\t\t\t\t\t\t\t\t\t<SuggestionChip\n\t\t\t\t\t\t\t\t\t\tkey={s}\n\t\t\t\t\t\t\t\t\t\tdisabled={isInputDisabledState}\n\t\t\t\t\t\t\t\t\t\tonClick={() => !isInputDisabledState && onSend(s)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{s}\n\t\t\t\t\t\t\t\t\t</SuggestionChip>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</SuggestionsGrid>\n\t\t\t\t\t\t</SuggestionsSection>\n\t\t\t\t\t)}\n\n\t\t\t\t{/* Input Container - Always at bottom */}\n\t\t\t\t<InputContainer>\n\t\t\t\t\t<InputBubble>\n\t\t\t\t\t\t<TextInput\n\t\t\t\t\t\t\tref={textareaRef}\n\t\t\t\t\t\t\tvalue={input}\n\t\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\tdisabled={isInputDisabledState}\n\t\t\t\t\t\t\thasText={hasText}\n\t\t\t\t\t\t\tchatState={currentState}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<SendButton\n\t\t\t\t\t\t\tonClick={handleSend}\n\t\t\t\t\t\t\tdisabled={isSendDisabled}\n\t\t\t\t\t\t\thasText={hasText}\n\t\t\t\t\t\t\taria-label=\"Send\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\twidth=\"20\"\n\t\t\t\t\t\t\t\theight=\"20\"\n\t\t\t\t\t\t\t\tstroke=\"white\"\n\t\t\t\t\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\t\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<path d=\"M6 12h12\" />\n\t\t\t\t\t\t\t\t<path d=\"M12 6l6 6-6 6\" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</SendButton>\n\t\t\t\t\t</InputBubble>\n\t\t\t\t</InputContainer>\n\t\t\t</MainContent>\n\t\t</ChatContainer>\n\t);\n};\n\nexport default ChatWindow;\n"],"names":["ChatContainer","styled","props","Header","MainContent","MessagesWrapper","VideoCard","VideoContainer","PlayButton","VideoText","Bubble","IceBreakersSection","IceBreakersGrid","IceBreakerChip","SuggestionsSection","SuggestionsGrid","SuggestionChip","InputContainer","InputBubble","TextInput","SendButton","CustomGradientText","ChatWindow","messages","onSend","header","placeholder","suggestions","iceBreakers","videoStarter","disabled","isThinking","onIceBreakerClick","chatState","chatWindowHeight","inputDisabled","input","setInput","useState","thinking","setThinking","isTyping","setIsTyping","bottomRef","useRef","textareaRef","isThinkingState","isInputDisabledState","currentState","handleSend","handleKeyDown","e","handleInputChange","value","stripHtmlTags","textarea","hasText","isSendDisabled","useEffect","jsxs","jsx","AiIcon","BodySecondary","BodyCaption","m","renderMarkdownLite","ThinkingIndicator","iceBreaker","s"],"mappings":";;;;;;;;AAUA,MAAMA,IAAgBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAa1B,CAACC,MAAU;AACZ,UAAQA,EAAM,WAAA;AAAA,IACb,KAAK;AACJ,aAAO;AAAA;AAAA;AAAA,IAGR,KAAK;AACJ,aAAO;AAAA;AAAA;AAAA,IAGR;AACC,aAAO;AAAA;AAAA;AAAA,EAAA;AAIV,CAAC;AAAA,GAGIC,IAASF,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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