radeax-ai-chatbot 0.0.0-stage → 1.0.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 CHANGED
@@ -1,3 +1,255 @@
1
- # Temporary Holding Version
1
+ # Radeax AI Chatbot
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > **Developed by Muhammad Owais Khan, Senior Software Engineer**
4
+
5
+ An enterprise-grade, plug-and-play AI Chatbot React library powered by **Google Gemini** with custom **Knowledge Base grounding (URLs, Q&A Pairs, Documents)**, **automated Lead Generation**, and **comprehensive appearance customization**.
6
+
7
+ ---
8
+
9
+ ## 🛡️ Public Security & Zero-Tampering Guarantee
10
+
11
+ When you install `radeax-ai-chatbot` on any website (e.g. `abc.com`):
12
+
13
+ ```jsx
14
+ <RadeaxAIChatbot apiKey="..." />
15
+ ```
16
+
17
+ - **Public End-User View**: Visitors **only** see the clean floating chat bubble in the corner.
18
+ - **Strict Privacy**:
19
+ - ❌ **No admin controls or settings gear icon** rendered in the public widget.
20
+ - ❌ **Zero possibility of public visitors viewing or tampering with API keys**.
21
+ - ❌ **No access to the knowledge base or collected leads by visitors**.
22
+ - All configuration is cleanly and securely controlled via React props (Option A) by the website developer.
23
+
24
+ ---
25
+
26
+ ## 📦 Installation
27
+
28
+ Install `radeax-ai-chatbot` and its peer icon dependency via npm:
29
+
30
+ ```bash
31
+ npm install radeax-ai-chatbot lucide-react
32
+ ```
33
+
34
+ ---
35
+
36
+ ## 🚀 Complete Developer Usage Guide (Option A - Props Based)
37
+
38
+ ### 1. Minimal Zero-Config Example
39
+
40
+ ```jsx
41
+ import React from 'react';
42
+ import { RadeaxAIChatbot } from 'radeax-ai-chatbot';
43
+ import 'radeax-ai-chatbot/style.css';
44
+
45
+ export default function App() {
46
+ return (
47
+ <div>
48
+ {/* Your website content */}
49
+
50
+ <RadeaxAIChatbot
51
+ apiKey={process.env.REACT_APP_GEMINI_API_KEY}
52
+ />
53
+ </div>
54
+ );
55
+ }
56
+ ```
57
+
58
+ ---
59
+
60
+ ### 2. Comprehensive Customization Example
61
+
62
+ Every visual element, branding, status caption, and message can be customized via props:
63
+
64
+ ```jsx
65
+ import React from 'react';
66
+ import { RadeaxAIChatbot } from 'radeax-ai-chatbot';
67
+ import 'radeax-ai-chatbot/style.css';
68
+
69
+ export default function App() {
70
+ return (
71
+ <RadeaxAIChatbot
72
+ // 1. Google Gemini API Configuration
73
+ apiKey={process.env.REACT_APP_GEMINI_API_KEY}
74
+ model="gemini-1.5-flash" // 'gemini-1.5-flash' | 'gemini-1.5-pro' | 'gemini-2.0-flash-exp'
75
+ temperature={0.7} // 0.0 (Strict/Factual) to 1.0 (Creative)
76
+
77
+ // 2. Assistant Branding & Status Text
78
+ botName="Support Specialist"
79
+ statusText="Online • Typically replies in seconds"
80
+ showStatusIndicator={true} // Shows/hides the glowing green indicator
81
+ widgetTitle="Ask Support"
82
+ welcomeMessage="Welcome to our website! How can I assist you today?"
83
+
84
+ // 3. Complete Color & Aesthetic Styling
85
+ primaryColor="#2563eb" // Brand accent color (Hex or CSS gradient)
86
+ backgroundColor="#ffffff" // Chat window background
87
+ textColor="#0f172a" // Text color
88
+ borderRadius="16px" // Corner curvature
89
+ fontSize="14px" // Base typography size
90
+ position="bottom-right" // 'bottom-right' or 'bottom-left'
91
+ customAvatar="https://abc.com/avatar.png" // Image URL or emoji string (default: 🤖)
92
+
93
+ // 4. Automatic Lead Capture & GDPR
94
+ enableLeadGeneration={true}
95
+ leadMessageThreshold={2} // Triggers lead prompt after 2 user messages
96
+ leadCollectionMessage="Would you like a team member to follow up with you? Please share your details."
97
+ gdprEnabled={true}
98
+ gdprMessage="I consent to the collection of my contact details for follow-up purposes."
99
+ onLeadSubmit={(lead) => {
100
+ console.log('New lead collected:', lead);
101
+ // Dispatch to CRM or backend database
102
+ }}
103
+ />
104
+ );
105
+ }
106
+ ```
107
+
108
+ ---
109
+
110
+ ### 3. Grounding with a Custom Knowledge Base (URLs & Q/A Pairs)
111
+
112
+ To prevent hallucinations and guarantee accurate, domain-specific responses, pass your knowledge base items directly:
113
+
114
+ ```jsx
115
+ import React from 'react';
116
+ import { RadeaxAIChatbot } from 'radeax-ai-chatbot';
117
+ import 'radeax-ai-chatbot/style.css';
118
+
119
+ export default function App() {
120
+ const companyKnowledge = [
121
+ // A. Direct Q&A Pair
122
+ {
123
+ type: 'qa',
124
+ question: 'What are your support operating hours?',
125
+ answer: 'Our customer support team is available Monday through Friday from 8:00 AM to 7:00 PM EST.',
126
+ category: 'Support'
127
+ },
128
+ // B. Policy / Billing Q&A
129
+ {
130
+ type: 'qa',
131
+ question: 'What is your refund policy?',
132
+ answer: 'We provide a 30-day full refund guarantee on all subscription plans with no questions asked.',
133
+ category: 'Billing'
134
+ },
135
+ // C. Webpage / Documentation Content
136
+ {
137
+ type: 'url',
138
+ title: 'API & Integration Guide',
139
+ url: 'https://abc.com/docs',
140
+ content: 'Our REST API authenticates using Bearer tokens and supports webhooks for real-time order tracking.'
141
+ },
142
+ // D. Text Document Snippet
143
+ {
144
+ type: 'doc',
145
+ title: 'Shipping & Delivery',
146
+ content: 'Standard shipping takes 3-5 business days across the US and Europe. Expedited shipping is available at checkout.'
147
+ }
148
+ ];
149
+
150
+ return (
151
+ <RadeaxAIChatbot
152
+ apiKey={process.env.REACT_APP_GEMINI_API_KEY}
153
+ knowledgeBase={companyKnowledge}
154
+ />
155
+ );
156
+ }
157
+ ```
158
+
159
+ ---
160
+
161
+ ### 4. Enterprise Backend Proxy Support (Hiding API Keys)
162
+
163
+ To keep your Google Gemini API key completely hidden on your server, use the `apiEndpoint` prop:
164
+
165
+ ```jsx
166
+ <RadeaxAIChatbot
167
+ apiEndpoint="/api/chat"
168
+ botName="Radeax AI Assistant"
169
+ />
170
+ ```
171
+
172
+ Your server endpoint (Node.js/Next.js/Express) receives the prompt payload and forwards it to Gemini, keeping the API key secure.
173
+
174
+ ---
175
+
176
+ ## 📋 Props API Reference Table
177
+
178
+ | Prop Name | Type | Default | Description |
179
+ |---|---|---|---|
180
+ | `apiKey` | `string` | `""` | Google Gemini API key (from Google AI Studio) |
181
+ | `apiEndpoint` | `string` | `""` | Optional server proxy URL to avoid exposing API keys in client bundles |
182
+ | `model` | `string` | `"gemini-1.5-flash"` | Model ID (`gemini-1.5-flash`, `gemini-1.5-pro`, `gemini-2.0-flash-exp`) |
183
+ | `temperature` | `number` | `0.7` | AI temperature between `0.0` (factual) and `1.0` (creative) |
184
+ | `botName` | `string` | `"Radeax AI Assistant"` | Display name shown in header and messages |
185
+ | `statusText` | `string` | `"Active & Ready"` | Status caption displayed under the bot name (e.g. `"Online"`) |
186
+ | `showStatusIndicator`| `boolean` | `true` | Shows/hides the glowing green status indicator |
187
+ | `widgetTitle` | `string` | `"Chat with us"` | Label on the floating toggle badge |
188
+ | `welcomeMessage` | `string` | `"Hello! How can I help..."` | Greeting message from the bot upon opening |
189
+ | `leadCollectionMessage`| `string`| `"I would love to..."` | Prompt message displayed on the lead form |
190
+ | `primaryColor` | `string` | `"#6366f1"` | Primary brand color (Hex code or CSS gradient) |
191
+ | `textColor` | `string` | `"#0f172a"` | Main text color |
192
+ | `backgroundColor` | `string` | `"#ffffff"` | Chat window background color |
193
+ | `borderRadius` | `string` | `"18px"` | Chat window border radius |
194
+ | `fontSize` | `string` | `"14px"` | Base typography font size |
195
+ | `position` | `string` | `"bottom-right"` | Screen position (`"bottom-right"` or `"bottom-left"`) |
196
+ | `customAvatar` | `string` | `""` | Custom image URL or emoji string (default: 🤖) |
197
+ | `knowledgeBase` | `array` | `null` | Array of `{ type, title, url, content, question, answer }` |
198
+ | `enableLeadGeneration`| `boolean`| `true` | Enables automatic lead collection modal |
199
+ | `leadMessageThreshold`| `number` | `2` | Number of user messages before prompting for lead info |
200
+ | `gdprEnabled` | `boolean` | `true` | Displays GDPR compliance checkbox on lead form |
201
+ | `gdprMessage` | `string` | `"I consent to..."` | GDPR agreement statement text |
202
+ | `onLeadSubmit` | `function` | `null` | Callback function fired on lead submission: `(lead) => {}` |
203
+ | `defaultOpen` | `boolean` | `false` | Whether chat window opens automatically on page load |
204
+
205
+ ---
206
+
207
+ ## 📤 Step-by-Step Guide: How to Publish to NPM
208
+
209
+ ### Step 1: Open Terminal in the Library Directory
210
+ ```bash
211
+ cd c:\Users\OwaisZafar\Desktop\flutterplugin\chatbot\multinet-ai-chatbot
212
+ ```
213
+
214
+ ### Step 2: Build the Production Distribution
215
+ ```bash
216
+ npm run build
217
+ ```
218
+ This compiles the library bundle into `dist/`:
219
+ - `dist/index.js` (Modern ES Module)
220
+ - `dist/index.cjs` (CommonJS format)
221
+ - `dist/index.d.ts` (Full TypeScript definitions)
222
+ - `dist/style.css` (Optimized CSS)
223
+
224
+ ### Step 3: Login to your NPM Account
225
+ If you don't have an NPM account yet, register for free at [npmjs.com](https://www.npmjs.com/). Then run:
226
+ ```bash
227
+ npm login
228
+ ```
229
+ Enter your NPM username, password, email, and one-time authentication code.
230
+
231
+ ### Step 4: Publish to NPM Registry
232
+ ```bash
233
+ npm publish --access public
234
+ ```
235
+
236
+ Once published, developers worldwide can install your package:
237
+ ```bash
238
+ npm install radeax-ai-chatbot
239
+ ```
240
+
241
+ ---
242
+
243
+ ## 👨‍💻 Developer & Author
244
+
245
+ **Radeax AI Chatbot** was engineered and developed by:
246
+
247
+ **Muhammad Owais Khan**
248
+ *Senior Software Engineer*
249
+ Expertise in Generative AI Integration, React Systems Architecture, and Enterprise Web Applications.
250
+
251
+ ---
252
+
253
+ ## 📄 License
254
+
255
+ MIT License. Free for commercial and personal use.
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-49.64" y="2.03" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-45.045" y="20.029" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-43.513" y="21.178" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="15.756" y="-17.901" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-27.636" y="-22.853" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="20.116" y="-38.415" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="24.641" y="-11.323" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="8.244" y="-2.416" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="18.713" y="10.588" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter></defs></svg>
package/dist/icons.svg ADDED
@@ -0,0 +1,24 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg">
2
+ <symbol id="bluesky-icon" viewBox="0 0 16 17">
3
+ <g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
4
+ <defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
5
+ </symbol>
6
+ <symbol id="discord-icon" viewBox="0 0 20 19">
7
+ <path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
8
+ </symbol>
9
+ <symbol id="documentation-icon" viewBox="0 0 21 20">
10
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
11
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
12
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
13
+ </symbol>
14
+ <symbol id="github-icon" viewBox="0 0 19 19">
15
+ <path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
16
+ </symbol>
17
+ <symbol id="social-icon" viewBox="0 0 20 20">
18
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
19
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
20
+ </symbol>
21
+ <symbol id="x-icon" viewBox="0 0 19 19">
22
+ <path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
23
+ </symbol>
24
+ </svg>
package/dist/index.cjs ADDED
@@ -0,0 +1,55 @@
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("react");c=s(c,1);let l=require("react/jsx-runtime");var u=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase();function d(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:u(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var f=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},p=e=>{let t=f(e);return t.charAt(0).toUpperCase()+t.slice(1)},m=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)},h={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function g(e){return e!=null}function _(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??h.width,a=e.size??e.height??h.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?m(...c):m(`lucide`,...s,...c),u=t.strokeWidth??h[`stroke-width`];if(t.absoluteStrokeWidth){let n=Number(u)*Number(e.size??e.width??h.width)/Number(t.size??t.width??h.width);Number.isFinite(n)&&(u=n)}return[`svg`,{...Object.entries(h).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&g(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&g(t.width)&&{[r(`width`)]:t.width},...`height`in t&&g(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function v(e,t={}){return _(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var y=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1},b=(0,c.createContext)({}),x=()=>(0,c.useContext)(b),S=(0,c.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:l,iconNode:u=[],icon:d={node:u,aliases:[],size:24},...f},p)=>{let{size:h=24,strokeWidth:g=2,absoluteStrokeWidth:_=!1,nonScalingStroke:b=!1,color:S=`currentColor`,className:C=``}=x()??{},w=!!l||y(f),[ee,T,te=[]]=v(d,{color:e??S,width:n??t??h,height:r??t??h,strokeWidth:i??g,absoluteStrokeWidth:a??_,nonScalingStroke:o??b,className:m(C,s),hasA11yProp:w,attributes:f});return(0,c.createElement)(ee,{ref:p,...T},[...te.map(([e,t])=>(0,c.createElement)(e,t)),...Array.isArray(l)?l:[l]])});function C(e,t=[],n=[]){let r=typeof e==`string`?d(e,t,n):e,i=(0,c.forwardRef)(({className:e,...t},n)=>(0,c.createElement)(S,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=p(r.name)),i}var w={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};w.node;var ee=C(w),T={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]};T.node;var te=C(T),E={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};E.node;var ne=C(E),D={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};D.node;var re=C(D),O={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};O.node;var ie=C(O),k={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};k.node;var ae=C(k),A={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};A.node;var j=C(A),M={name:`key`,size:24,node:[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]};M.node;var N=C(M),P={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};P.node;var oe=C(P),F={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};F.node;var se=C(F),I={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};I.node;var L=C(I),R={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};R.node;var ce=C(R),z={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};z.node;var B=C(z),V={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};V.node;var le=C(V),H={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};H.node;var ue=C(H),U={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};U.node;var de=C(U),W={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};W.node;var fe=C(W),G={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};G.node;var K=C(G),q={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};q.node;var pe=C(q),J=[{id:`gemini-1.5-flash`,name:`Gemini 1.5 Flash (Fast & Recommended)`},{id:`gemini-1.5-pro`,name:`Gemini 1.5 Pro (Advanced Reasoning)`},{id:`gemini-2.0-flash-exp`,name:`Gemini 2.0 Flash (Next-Gen Preview)`}],me=[`is there anything else`,`anything else i can help`,`hope i was able to help`,`thank you for chatting`,`have a great day`,`goodbye`,`take care`,`feel free to ask`,`glad i could help`];function Y({message:e,knowledgeContext:t,conversationHistory:n,botName:r=`Radeax AI Assistant`}){let i=`You are "${r}", a helpful, empathetic, and knowledgeable AI assistant for Radeax AI Chatbot.\n`;return i+=`Developed by Muhammad Owais Khan, Senior Software Engineer.
2
+ `,i+=`Provide human-like, natural, and polite responses that are conversational, accurate, and concise.
3
+
4
+ `,t&&t.trim().length>0&&(i+=`=== KNOWLEDGE BASE CONTEXT (Primary Source of Truth) ===
5
+ `,i+=`${t}\n`,i+=`=== END KNOWLEDGE BASE ===
6
+
7
+ `,i+=`INSTRUCTION: Base your answers primarily on the Knowledge Base above. If the information is found there, answer directly and confidently. If the user asks something not covered in the knowledge base, answer politely based on general knowledge or mention that our team can provide further specific details.
8
+
9
+ `),n&&n.length>0&&(i+=`=== RECENT CONVERSATION HISTORY ===
10
+ `,n.slice(-8).forEach(e=>{i+=`User: ${e.user}\n`,i+=`Assistant: ${e.bot}\n`}),i+=`=== END HISTORY ===
11
+
12
+ `),i+=`Current User Message: ${e}\n\n`,i+=`Please provide a helpful, friendly response. If the user's inquiry seems fully addressed, end with a gentle question like "Is there anything else I can help you with today?".`,i}function X(e){if(!e)return!1;let t=e.toLowerCase();return me.some(e=>t.includes(e))}async function he({apiKey:e,apiEndpoint:t,message:n,knowledgeContext:r=``,conversationHistory:i=[],model:a=`gemini-1.5-flash`,botName:o=`Radeax AI Assistant`,temperature:s=.7}){if(t){let e=await fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({message:n,knowledgeContext:r,conversationHistory:i,model:a,botName:o})});if(!e.ok)throw Error(`Backend server error: ${e.statusText}`);let s=await e.json();return{text:s.message||s.text||`Received response.`,isEnd:X(s.message||s.text)}}if(!e||e.trim()===``)return _e(n,r,o);let c=Y({message:n,knowledgeContext:r,conversationHistory:i,botName:o}),l=`https://generativelanguage.googleapis.com/v1beta/models/${a}:generateContent?key=${e.trim()}`,u={contents:[{parts:[{text:c}]}],generationConfig:{temperature:Number(s)||.7,topK:40,topP:.95,maxOutputTokens:1024},safetySettings:[{category:`HARM_CATEGORY_HARASSMENT`,threshold:`BLOCK_MEDIUM_AND_ABOVE`},{category:`HARM_CATEGORY_HATE_SPEECH`,threshold:`BLOCK_MEDIUM_AND_ABOVE`},{category:`HARM_CATEGORY_SEXUALLY_EXPLICIT`,threshold:`BLOCK_MEDIUM_AND_ABOVE`},{category:`HARM_CATEGORY_DANGEROUS_CONTENT`,threshold:`BLOCK_MEDIUM_AND_ABOVE`}]},d=await fetch(l,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(u)}),f=await d.json();if(!d.ok){let e=f?.error?.message||`API error (${d.status})`;throw Error(e)}let p=f?.candidates?.[0]?.content?.parts?.[0]?.text;if(!p)throw Error(`No response generated by Gemini. Check safety settings or prompt.`);return{text:p.trim(),isEnd:X(p)}}async function ge(e,t=`gemini-1.5-flash`){if(!e||e.trim()===``)return{success:!1,message:`Please enter a valid Google Gemini API key.`};try{let n=`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent?key=${e.trim()}`,r=await fetch(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({contents:[{parts:[{text:`Hello, this is a connection test.`}]}]})}),i=await r.json();return r.ok&&i?.candidates?.[0]?.content?{success:!0,message:`Connection successful! Your Google Gemini API key is valid.`}:{success:!1,message:i?.error?.message||`Connection failed: Invalid API response.`}}catch(e){return{success:!1,message:`Connection error: ${e.message}`}}}function _e(e,t,n){let r=e.toLowerCase();return t&&t.length>0?{text:`Based on our Knowledge Base:\n\n${t.slice(0,400)}...\n\n(Note: Configure your Gemini API key in Radeax AI Chatbot props to enable full AI reasoning!)`,isEnd:!1}:r.includes(`hello`)||r.includes(`hi`)||r.includes(`hey`)?{text:`Hello! I'm ${n}. I am ready to assist your visitors. How can I help you today?`,isEnd:!1}:r.includes(`who created`)||r.includes(`who developed`)||r.includes(`developer`)?{text:`Radeax AI Chatbot was engineered and developed by Muhammad Owais Khan, Senior Software Engineer.`,isEnd:!0}:{text:`Thank you for your inquiry! Radeax AI Chatbot is running smoothly. To enable live Google Gemini intelligence, provide your API key in the component props.`,isEnd:!0}}var ve=`radeax_ai_knowledge_base`,Z=[{id:`kb-default-1`,type:`qa`,title:`About Radeax AI Chatbot`,question:`What is Radeax AI Chatbot and who created it?`,answer:`Radeax AI Chatbot is an enterprise-grade AI chatbot widget and library for modern React applications. It was engineered and developed by Muhammad Owais Khan, Senior Software Engineer, featuring Google Gemini integration, lead capture, and an interactive URL/Q&A knowledge base.`,category:`General`,createdAt:new Date().toISOString()},{id:`kb-default-2`,type:`qa`,title:`Supported AI Models`,question:`Which AI models are supported by Radeax AI Chatbot?`,answer:`Radeax AI Chatbot natively integrates with Google Gemini models including Gemini 1.5 Flash, Gemini 1.5 Pro, and Gemini 2.0 Flash. It supports custom system prompts, temperature tuning, and rolling conversation history.`,category:`Features`,createdAt:new Date().toISOString()},{id:`kb-default-3`,type:`qa`,title:`Lead Generation & GDPR`,question:`How does lead generation work in Radeax AI Chatbot?`,answer:`Radeax AI Chatbot automatically prompts visitors for contact information (Name, Email, Phone number, and Message) after a configurable number of messages or at the natural conclusion of their conversation. It includes full GDPR consent controls and CSV/JSON export.`,category:`Features`,createdAt:new Date().toISOString()},{id:`kb-default-4`,type:`url`,title:`Google Gemini Documentation Overview`,url:`https://ai.google.dev/gemini-api/docs`,content:`Google Gemini API provides powerful multimodal generative AI capabilities with low latency, large context windows, and advanced reasoning. The API uses standard REST/JSON endpoints with an API key.`,createdAt:new Date().toISOString()}];function ye(){try{let e=localStorage.getItem(ve);if(!e)return Q(Z),Z;let t=JSON.parse(e);return Array.isArray(t)?t:Z}catch{return Z}}function Q(e){try{localStorage.setItem(ve,JSON.stringify(e))}catch(e){console.error(`Failed to save knowledge base:`,e)}}function be(e){if(!e)return``;let t=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,` `);return t=t.replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi,` `),t=t.replace(/<header\b[^<]*(?:(?!<\/header>)<[^<]*)*<\/header>/gi,` `),t=t.replace(/<footer\b[^<]*(?:(?!<\/footer>)<[^<]*)*<\/footer>/gi,` `),t=t.replace(/<nav\b[^<]*(?:(?!<\/nav>)<[^<]*)*<\/nav>/gi,` `),t=t.replace(/<[^>]+>/g,` `),t=t.replace(/&nbsp;/g,` `).replace(/&amp;/g,`&`).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`).replace(/&#39;/g,`'`),t.replace(/\s+/g,` `).trim()}async function xe(e){if(!e||!e.startsWith(`http`))throw Error(`Please enter a valid URL starting with http:// or https://`);let t=``;try{let n=await fetch(e,{headers:{Accept:`text/html,application/xhtml+xml`}});n.ok&&(t=await n.text())}catch{}if(!t){let n=[`https://api.allorigins.win/raw?url=${encodeURIComponent(e)}`,`https://corsproxy.io/?url=${encodeURIComponent(e)}`],r=!1;for(let e of n)try{let n=await fetch(e);if(n.ok){t=await n.text(),r=!0;break}}catch{continue}if(!r||!t)throw Error(`Could not automatically scrape this URL due to CORS restrictions or firewall. You can paste the content directly into the Q&A / Knowledge form!`)}let n=t.match(/<title[^>]*>([^<]+)<\/title>/i),r=n?n[1].trim():e,i=be(t);if(!i||i.length<20)throw Error(`Extracted text from this URL was empty or too short. Please verify the URL.`);return{title:r,content:i.slice(0,12e3),url:e}}function Se(e){let t=new Set(`the.a.an.and.or.but.in.on.at.to.for.of.with.by.is.are.was.were.be.been.have.has.had.do.does.did.will.would.could.should.may.might.can.this.that.these.those.i.you.he.she.it.we.they.me.him.her.us.them.what.which.who.whom.whose.how.when.where.why.tell.about.give.please`.split(`.`));return e.toLowerCase().replace(/[^a-z0-9\s]/g,` `).split(/\s+/).filter(e=>e.length>2&&!t.has(e))}function Ce(e,t=[],n=4){if(!e||t.length===0)return``;let r=Se(e);r.length===0&&r.push(e.toLowerCase().trim());let i=t.map(e=>{let t=0,n=(e.title||``).toLowerCase(),i=(e.question||``).toLowerCase(),a=(e.answer||``).toLowerCase(),o=(e.content||``).toLowerCase();return r.forEach(e=>{n.includes(e)&&(t+=5),i.includes(e)&&(t+=6),a.includes(e)&&(t+=3),o.includes(e)&&(t+=2)}),{item:e,score:t}}).filter(e=>e.score>0).sort((e,t)=>t.score-e.score).slice(0,n).map(e=>e.item);if(i.length===0)return``;let a=``;return i.forEach((e,t)=>{a+=`[Document #${t+1}: ${e.title||`Knowledge Entry`}]\n`,e.type===`qa`?a+=`Question: ${e.question}\nAnswer: ${e.answer}\n\n`:e.type===`url`?a+=`Source: ${e.url}\nExcerpt: ${e.content.slice(0,1200)}\n\n`:a+=`Content: ${(e.content||``).slice(0,1200)}\n\n`}),a.trim()}var we=`radeax_ai_leads`;function $(){try{let e=localStorage.getItem(we);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function Te(e){let t=$(),n=t.findIndex(t=>t.email?.toLowerCase()===e.email?.toLowerCase()),r={id:e.id||`lead-${Date.now()}-${Math.random().toString(36).substr(2,5)}`,name:e.name?.trim()||``,email:e.email?.trim()||``,phone:e.phone?.trim()||``,message:e.message?.trim()||``,gdprConsent:!!e.gdprConsent,sessionId:e.sessionId||``,createdAt:e.createdAt||new Date().toISOString()};n>=0?t[n]={...t[n],...r}:t.unshift(r);try{localStorage.setItem(we,JSON.stringify(t))}catch(e){console.error(`Failed to save lead:`,e)}return r}function Ee(e){let t=$().filter(t=>t.id!==e);try{localStorage.setItem(we,JSON.stringify(t))}catch(e){console.error(`Failed to delete lead:`,e)}return t}function De(){let e=$();if(e.length===0){alert(`No leads available to export.`);return}let t=[`ID`,`Name`,`Email`,`Phone`,`Message`,`GDPR Consent`,`Created At`],n=e.map(e=>[`"${e.id||``}"`,`"${(e.name||``).replace(/"/g,`""`)}"`,`"${(e.email||``).replace(/"/g,`""`)}"`,`"${(e.phone||``).replace(/"/g,`""`)}"`,`"${(e.message||``).replace(/"/g,`""`)}"`,`"${e.gdprConsent?`Yes`:`No`}"`,`"${e.createdAt||``}"`]),r=[t.join(`,`),...n.map(e=>e.join(`,`))].join(`
13
+ `),i=new Blob([r],{type:`text/csv;charset=utf-8;`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.setAttribute(`href`,a),o.setAttribute(`download`,`radeax-chatbot-leads-${new Date().toISOString().slice(0,10)}.csv`),document.body.appendChild(o),o.click(),document.body.removeChild(o)}function Oe(){let e=$(),t=new Date(new Date().getTime()-6048e5);return{total:e.length,withConsent:e.filter(e=>e.gdprConsent).length,thisWeek:e.filter(e=>new Date(e.createdAt)>=t).length}}function ke({apiKey:e=``,apiEndpoint:t=``,model:n=`gemini-1.5-flash`,temperature:r=.7,systemPrompt:i=``,botName:a=`Radeax AI Assistant`,statusText:o=`Active & Ready`,showStatusIndicator:s=!0,widgetTitle:u=`Chat with us`,welcomeMessage:d=`Hello! How can I help you today?`,leadCollectionMessage:f=`I would love to follow up with you. Could you please share your contact details?`,primaryColor:p=`#6366f1`,textColor:m=`#0f172a`,backgroundColor:h=`#ffffff`,borderRadius:g=`18px`,fontSize:_=`14px`,position:v=`bottom-right`,customAvatar:y=``,enableLeadGeneration:b=!0,leadMessageThreshold:x=2,gdprEnabled:S=!0,gdprMessage:C=`I consent to the collection of my contact details for follow-up purposes.`,onLeadSubmit:w=null,knowledgeBase:ee=null,defaultOpen:T=!1}){let te=ee||ye(),[E,ne]=(0,c.useState)(T),[D,re]=(0,c.useState)(!1),[O,ie]=(0,c.useState)(``),[k,ae]=(0,c.useState)(!1),[A,j]=(0,c.useState)(!1),[M,N]=(0,c.useState)(!1),[P,oe]=(0,c.useState)(0),[F,I]=(0,c.useState)(``),[R,ce]=(0,c.useState)(``),[z,B]=(0,c.useState)(``),[V,le]=(0,c.useState)(``),[H,U]=(0,c.useState)(!1),[de,W]=(0,c.useState)(!1),fe=(0,c.useRef)(`session_${Date.now()}_${Math.random().toString(36).substr(2,7)}`),[G,K]=(0,c.useState)([{id:`welcome-msg`,sender:`bot`,text:d,time:new Date().toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}]),q=(0,c.useRef)(null),J=(0,c.useRef)(null);(0,c.useEffect)(()=>{G.length===1&&G[0].id===`welcome-msg`&&K([{id:`welcome-msg`,sender:`bot`,text:d,time:new Date().toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}])},[d]),(0,c.useEffect)(()=>{E&&!D&&q.current?.scrollIntoView({behavior:`smooth`})},[G,k,E,D]);let me=e=>{ie(e.target.value),J.current&&(J.current.style.height=`auto`,J.current.style.height=`${Math.min(J.current.scrollHeight,120)}px`)},Y=async i=>{i&&i.preventDefault();let o=O.trim();if(!o||k)return;let s=new Date().toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),c={id:`msg-${Date.now()}`,sender:`user`,text:o,time:s};K(e=>[...e,c]),ie(``),J.current&&(J.current.style.height=`auto`);let l=P+1;oe(l),ae(!0);try{let i=await he({apiKey:e,apiEndpoint:t,message:o,knowledgeContext:Ce(o,te,4),conversationHistory:G.slice(-8).map(e=>({user:e.sender===`user`?e.text:``,bot:e.sender===`bot`?e.text:``})),model:n,botName:a,temperature:r}),s={id:`msg-bot-${Date.now()}`,sender:`bot`,text:i.text,time:new Date().toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})};K(e=>[...e,s]),b&&!A&&(l>=(x||2)||i.isEnd)&&setTimeout(()=>{N(!0)},1500)}catch(e){K(t=>[...t,{id:`msg-err-${Date.now()}`,sender:`bot`,text:`⚠️ ${e.message||`Sorry, something went wrong while connecting to the AI. Please verify your settings.`}`,time:new Date().toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}])}finally{ae(!1)}},X=e=>{if(e.preventDefault(),!F||!R){alert(`Please enter your name and email.`);return}if(S&&!H){alert(`Please agree to the privacy consent to continue.`);return}W(!0);let t={name:F,email:R,phone:z,message:V,gdprConsent:H,sessionId:fe.current,createdAt:new Date().toISOString()};if(Te(t),w)try{w(t)}catch(e){console.error(`onLeadSubmit callback error:`,e)}j(!0),N(!1),W(!1),K(e=>[...e,{id:`lead-ack-${Date.now()}`,sender:`bot`,text:`Thank you, ${F}! Your information has been securely noted. A team member will reach out to you shortly. Feel free to ask any other questions!`,time:new Date().toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}])},ge={"--radeax-primary":p||`#6366f1`,"--radeax-primary-gradient":p&&p.includes(`gradient`)?p:`linear-gradient(135deg, ${p||`#6366f1`} 0%, #8b5cf6 50%, #d946ef 100%)`,...h?{"--radeax-bg":h}:{},...m?{"--radeax-text":m}:{},...g?{"--radeax-radius":g}:{},..._?{"--radeax-font-size":_}:{}};return(0,l.jsxs)(`div`,{className:`radeax-chatbot-widget ${v===`bottom-left`?`radeax-bottom-left`:`radeax-bottom-right`}`,style:ge,children:[!E&&(0,l.jsxs)(`button`,{className:`radeax-chat-toggle`,onClick:()=>{ne(!0),re(!1)},title:`Open AI Chatbot`,children:[(0,l.jsx)(`div`,{className:`radeax-toggle-avatar`,children:y?(0,l.jsx)(`img`,{src:y,alt:`Avatar`}):(0,l.jsx)(`span`,{children:`🤖`})}),(0,l.jsx)(`span`,{className:`radeax-toggle-text`,children:u}),(0,l.jsx)(`span`,{className:`radeax-unread-badge`,children:`1`})]}),(0,l.jsxs)(`div`,{className:`radeax-chat-window ${E?`radeax-open`:``} ${D?`radeax-minimized`:``}`,children:[(0,l.jsxs)(`div`,{className:`radeax-chat-header`,children:[(0,l.jsxs)(`div`,{className:`radeax-header-left`,children:[(0,l.jsx)(`div`,{className:`radeax-header-avatar`,children:y?(0,l.jsx)(`img`,{src:y,alt:`Avatar`}):(0,l.jsx)(`span`,{children:`🤖`})}),(0,l.jsxs)(`div`,{className:`radeax-header-details`,children:[(0,l.jsx)(`h3`,{children:a}),o&&(0,l.jsxs)(`div`,{className:`radeax-header-status`,children:[s&&(0,l.jsx)(`span`,{className:`radeax-status-indicator`}),(0,l.jsx)(`span`,{children:o})]})]})]}),(0,l.jsxs)(`div`,{className:`radeax-header-actions`,children:[(0,l.jsx)(`button`,{className:`radeax-header-btn`,onClick:()=>re(!D),title:D?`Expand`:`Minimize`,children:D?(0,l.jsx)(se,{size:16}):(0,l.jsx)(L,{size:16})}),(0,l.jsx)(`button`,{className:`radeax-header-btn`,onClick:()=>ne(!1),title:`Close`,children:(0,l.jsx)(pe,{size:16})})]})]}),!D&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`radeax-chat-messages`,children:[G.map(e=>(0,l.jsxs)(`div`,{className:`radeax-message-row ${e.sender}`,children:[e.sender===`bot`&&(0,l.jsx)(`div`,{className:`radeax-msg-avatar`,children:y?(0,l.jsx)(`img`,{src:y,alt:`Bot`}):(0,l.jsx)(`span`,{children:`🤖`})}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`radeax-msg-bubble`,children:e.text}),(0,l.jsx)(`div`,{className:`radeax-msg-time`,children:e.time})]})]},e.id)),k&&(0,l.jsxs)(`div`,{className:`radeax-message-row bot`,children:[(0,l.jsx)(`div`,{className:`radeax-msg-avatar`,children:(0,l.jsx)(`span`,{children:`🤖`})}),(0,l.jsxs)(`div`,{className:`radeax-typing-indicator`,children:[(0,l.jsx)(`span`,{className:`radeax-typing-dot`}),(0,l.jsx)(`span`,{className:`radeax-typing-dot`}),(0,l.jsx)(`span`,{className:`radeax-typing-dot`})]})]}),(0,l.jsx)(`div`,{ref:q})]}),M&&(0,l.jsx)(`div`,{className:`radeax-lead-modal-overlay`,children:(0,l.jsxs)(`div`,{className:`radeax-lead-modal-card`,children:[(0,l.jsx)(`button`,{className:`radeax-lead-close`,onClick:()=>N(!1),title:`Close`,children:`×`}),(0,l.jsx)(`h4`,{children:`Get in Touch`}),(0,l.jsx)(`p`,{children:f}),(0,l.jsxs)(`form`,{className:`radeax-lead-form`,onSubmit:X,children:[(0,l.jsx)(`input`,{type:`text`,className:`radeax-lead-input`,placeholder:`Your Full Name *`,value:F,onChange:e=>I(e.target.value),required:!0}),(0,l.jsx)(`input`,{type:`email`,className:`radeax-lead-input`,placeholder:`Your Email Address *`,value:R,onChange:e=>ce(e.target.value),required:!0}),(0,l.jsx)(`input`,{type:`tel`,className:`radeax-lead-input`,placeholder:`Phone Number (Optional)`,value:z,onChange:e=>B(e.target.value)}),(0,l.jsx)(`textarea`,{className:`radeax-lead-input`,rows:2,placeholder:`How can we assist you? (Optional)`,value:V,onChange:e=>le(e.target.value)}),S&&(0,l.jsxs)(`div`,{className:`radeax-lead-gdpr`,children:[(0,l.jsx)(`input`,{type:`checkbox`,id:`radeax-gdpr`,checked:H,onChange:e=>U(e.target.checked),required:!0}),(0,l.jsx)(`label`,{htmlFor:`radeax-gdpr`,children:C})]}),(0,l.jsx)(`button`,{type:`submit`,className:`radeax-lead-submit`,disabled:de,children:de?`Submitting...`:`Send Information`})]})]})}),(0,l.jsxs)(`form`,{className:`radeax-chat-input-bar`,onSubmit:Y,children:[(0,l.jsx)(`textarea`,{ref:J,className:`radeax-input-textarea`,placeholder:`Type your message...`,rows:1,value:O,onChange:me,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Y())}}),(0,l.jsx)(`button`,{type:`submit`,className:`radeax-send-button`,disabled:!O.trim()||k,title:`Send Message`,children:(0,l.jsx)(ue,{size:18})})]})]})]})]})}function Ae({isOpen:e,onClose:t,config:n={},onUpdateConfig:r=()=>{},knowledgeBase:i=[],onUpdateKnowledgeBase:a=()=>{}}){let[o,s]=(0,c.useState)(`knowledge`),[u,d]=(0,c.useState)(`url`),[f,p]=(0,c.useState)(``),[m,h]=(0,c.useState)(``),[g,_]=(0,c.useState)(!1),[v,y]=(0,c.useState)(``),[b,x]=(0,c.useState)(``),[S,C]=(0,c.useState)(``),[w,T]=(0,c.useState)(``),[E,D]=(0,c.useState)(`General`),[O,k]=(0,c.useState)(``),[A,M]=(0,c.useState)(``),[P,F]=(0,c.useState)(``),[se,I]=(0,c.useState)([]),[L,R]=(0,c.useState)(``),[z,V]=(0,c.useState)({total:0,withConsent:0,thisWeek:0}),[H,ue]=(0,c.useState)(!1),[U,W]=(0,c.useState)(null);if((0,c.useEffect)(()=>{if(o===`leads`){let e=$();I(e),V(Oe())}},[o]),!e)return null;let G=async e=>{if(e.preventDefault(),f){_(!0),y(``),x(``);try{let e=await xe(f),t={id:`kb-url-${Date.now()}`,type:`url`,title:m.trim()||e.title,url:f.trim(),content:e.content,createdAt:new Date().toISOString()},n=[t,...i];a(n),Q(n),x(`Successfully indexed "${t.title}" (${e.content.length} characters)!`),p(``),h(``)}catch(e){y(e.message||`Failed to extract content from URL.`)}finally{_(!1)}}},q=e=>{if(e.preventDefault(),!S.trim()||!w.trim())return;let t=[{id:`kb-qa-${Date.now()}`,type:`qa`,title:S.trim().slice(0,50)+`...`,question:S.trim(),answer:w.trim(),category:E.trim()||`General`,createdAt:new Date().toISOString()},...i];a(t),Q(t),C(``),T(``),x(`New Q&A pair added to Knowledge Base!`),setTimeout(()=>x(``),3e3)},me=e=>{if(e.preventDefault(),!O.trim()||!A.trim())return;let t=[{id:`kb-doc-${Date.now()}`,type:`doc`,title:O.trim(),content:A.trim(),createdAt:new Date().toISOString()},...i];a(t),Q(t),k(``),M(``),x(`New Document text added to Knowledge Base!`),setTimeout(()=>x(``),3e3)},Y=e=>{if(window.confirm(`Are you sure you want to delete this knowledge entry?`)){let t=i.filter(t=>t.id!==e);a(t),Q(t)}},X=e=>{if(window.confirm(`Delete this lead entry?`)){let t=Ee(e);I(t),V(Oe())}},he=async()=>{ue(!0),W(null);try{let e=await ge(n.apiKey,n.model);W(e)}catch(e){W({success:!1,message:e.message})}finally{ue(!1)}},_e=i.filter(e=>{if(!P)return!0;let t=P.toLowerCase();return e.title&&e.title.toLowerCase().includes(t)||e.question&&e.question.toLowerCase().includes(t)||e.answer&&e.answer.toLowerCase().includes(t)||e.url&&e.url.toLowerCase().includes(t)||e.content&&e.content.toLowerCase().includes(t)}),ve=se.filter(e=>{if(!L)return!0;let t=L.toLowerCase();return e.name&&e.name.toLowerCase().includes(t)||e.email&&e.email.toLowerCase().includes(t)||e.phone&&e.phone.toLowerCase().includes(t)||e.message&&e.message.toLowerCase().includes(t)});return(0,l.jsx)(`div`,{className:`radeax-admin-overlay`,onClick:t,children:(0,l.jsxs)(`div`,{className:`radeax-admin-modal`,onClick:e=>e.stopPropagation(),children:[(0,l.jsxs)(`div`,{className:`radeax-admin-header`,children:[(0,l.jsxs)(`div`,{className:`radeax-admin-header-title`,children:[(0,l.jsx)(de,{size:24,color:`#818cf8`}),(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,l.jsx)(`h2`,{children:`Radeax AI Chatbot Control Center`}),(0,l.jsx)(`span`,{className:`radeax-admin-badge`,children:`React Library v1.0`})]}),(0,l.jsxs)(`div`,{className:`radeax-admin-author-tag`,children:[`Developed by `,(0,l.jsx)(`strong`,{children:`Muhammad Owais Khan`}),`, Senior Software Engineer`]})]})]}),(0,l.jsx)(`button`,{className:`radeax-admin-close-btn`,onClick:t,title:`Close Panel`,children:(0,l.jsx)(pe,{size:20})})]}),(0,l.jsxs)(`div`,{className:`radeax-admin-tabs`,children:[(0,l.jsxs)(`button`,{className:`radeax-admin-tab-btn ${o===`knowledge`?`active`:``}`,onClick:()=>s(`knowledge`),children:[(0,l.jsx)(j,{size:18}),`Knowledge Base (`,i.length,`)`]}),(0,l.jsxs)(`button`,{className:`radeax-admin-tab-btn ${o===`leads`?`active`:``}`,onClick:()=>s(`leads`),children:[(0,l.jsx)(K,{size:18}),`Leads & Inquiries (`,z.total,`)`]}),(0,l.jsxs)(`button`,{className:`radeax-admin-tab-btn ${o===`appearance`?`active`:``}`,onClick:()=>s(`appearance`),children:[(0,l.jsx)(ce,{size:18}),`Appearance Customizer`]}),(0,l.jsxs)(`button`,{className:`radeax-admin-tab-btn ${o===`api`?`active`:``}`,onClick:()=>s(`api`),children:[(0,l.jsx)(N,{size:18}),`Gemini API Settings`]}),(0,l.jsxs)(`button`,{className:`radeax-admin-tab-btn ${o===`embed`?`active`:``}`,onClick:()=>s(`embed`),children:[(0,l.jsx)(re,{size:18}),`React Embed Code`]})]}),(0,l.jsxs)(`div`,{className:`radeax-admin-body`,children:[o===`knowledge`&&(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`radeax-admin-card`,children:[(0,l.jsxs)(`div`,{className:`radeax-admin-card-header`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`h3`,{className:`radeax-admin-card-title`,children:[(0,l.jsx)(B,{size:20,color:`#6366f1`}),` Add New Knowledge`]}),(0,l.jsx)(`p`,{className:`radeax-admin-card-desc`,children:`Non-technical interface: Scrape any webpage URL, create custom Q&A pairs, or enter documents.`})]}),(0,l.jsxs)(`div`,{style:{display:`flex`,gap:6},children:[(0,l.jsxs)(`button`,{className:`radeax-btn-secondary ${u===`url`?`radeax-btn-primary`:``}`,onClick:()=>d(`url`),children:[(0,l.jsx)(j,{size:16}),` Webpage URL`]}),(0,l.jsxs)(`button`,{className:`radeax-btn-secondary ${u===`qa`?`radeax-btn-primary`:``}`,onClick:()=>d(`qa`),children:[(0,l.jsx)(ne,{size:16}),` Q&A Pair`]}),(0,l.jsxs)(`button`,{className:`radeax-btn-secondary ${u===`doc`?`radeax-btn-primary`:``}`,onClick:()=>d(`doc`),children:[(0,l.jsx)(B,{size:16}),` Text Document`]})]})]}),b&&(0,l.jsxs)(`div`,{style:{padding:`10px 14px`,background:`#dcfce7`,color:`#166534`,borderRadius:8,marginBottom:16,display:`flex`,alignItems:`center`,gap:8,fontSize:13},children:[(0,l.jsx)(ee,{size:18}),` `,b]}),v&&(0,l.jsxs)(`div`,{style:{padding:`10px 14px`,background:`#fee2e2`,color:`#991b1b`,borderRadius:8,marginBottom:16,display:`flex`,alignItems:`center`,gap:8,fontSize:13},children:[(0,l.jsx)(te,{size:18}),` `,v]}),u===`url`&&(0,l.jsx)(`form`,{onSubmit:G,children:(0,l.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`2fr 1fr auto`,gap:12,alignItems:`end`},children:[(0,l.jsxs)(`div`,{className:`radeax-form-group`,style:{marginBottom:0},children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Webpage URL to Scrape`}),(0,l.jsx)(`input`,{type:`url`,className:`radeax-form-input`,placeholder:`https://example.com/faq-or-about`,value:f,onChange:e=>p(e.target.value),required:!0})]}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,style:{marginBottom:0},children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Optional Label / Title`}),(0,l.jsx)(`input`,{type:`text`,className:`radeax-form-input`,placeholder:`e.g. Company About Page`,value:m,onChange:e=>h(e.target.value)})]}),(0,l.jsx)(`button`,{type:`submit`,className:`radeax-btn-primary`,disabled:g,style:{height:42},children:g?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(oe,{size:18,className:`radeax-spin`}),` Scraping...`]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(j,{size:18}),` Scrape & Index`]})})]})}),u===`qa`&&(0,l.jsxs)(`form`,{onSubmit:q,children:[(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`User Question`}),(0,l.jsx)(`input`,{type:`text`,className:`radeax-form-input`,placeholder:`e.g. What are your business operating hours?`,value:S,onChange:e=>C(e.target.value),required:!0})]}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`AI Answer (Ground Truth)`}),(0,l.jsx)(`textarea`,{className:`radeax-form-textarea`,rows:3,placeholder:`e.g. We are open Monday through Friday from 9:00 AM to 6:00 PM EST.`,value:w,onChange:e=>T(e.target.value),required:!0})]}),(0,l.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,l.jsxs)(`div`,{style:{width:220},children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Category`}),(0,l.jsx)(`input`,{type:`text`,className:`radeax-form-input`,placeholder:`General, Support, Pricing...`,value:E,onChange:e=>D(e.target.value)})]}),(0,l.jsxs)(`button`,{type:`submit`,className:`radeax-btn-primary`,children:[(0,l.jsx)(B,{size:18}),` Add Q&A Pair`]})]})]}),u===`doc`&&(0,l.jsxs)(`form`,{onSubmit:me,children:[(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Document Title`}),(0,l.jsx)(`input`,{type:`text`,className:`radeax-form-input`,placeholder:`e.g. Return and Refund Policy`,value:O,onChange:e=>k(e.target.value),required:!0})]}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Content Text`}),(0,l.jsx)(`textarea`,{className:`radeax-form-textarea`,rows:4,placeholder:`Paste document text, terms, or product details here...`,value:A,onChange:e=>M(e.target.value),required:!0})]}),(0,l.jsx)(`div`,{style:{textAlign:`right`},children:(0,l.jsxs)(`button`,{type:`submit`,className:`radeax-btn-primary`,children:[(0,l.jsx)(B,{size:18}),` Save Document`]})})]})]}),(0,l.jsxs)(`div`,{className:`radeax-admin-card`,children:[(0,l.jsxs)(`div`,{className:`radeax-admin-card-header`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`h3`,{className:`radeax-admin-card-title`,children:[(0,l.jsx)(j,{size:20,color:`#10b981`}),` Indexed Knowledge Base Entries (`,i.length,`)`]}),(0,l.jsx)(`p`,{className:`radeax-admin-card-desc`,children:`Items matched against user queries to provide grounded, accurate AI responses.`})]}),(0,l.jsxs)(`div`,{style:{position:`relative`,width:240},children:[(0,l.jsx)(le,{size:16,style:{position:`absolute`,left:10,top:12,color:`#94a3b8`}}),(0,l.jsx)(`input`,{type:`text`,className:`radeax-form-input`,placeholder:`Search knowledge...`,style:{paddingLeft:34},value:P,onChange:e=>F(e.target.value)})]})]}),_e.length===0?(0,l.jsx)(`div`,{style:{textAlign:`center`,padding:`30px 0`,color:`#94a3b8`},children:`No knowledge items found matching your search.`}):(0,l.jsx)(`div`,{style:{overflowX:`auto`},children:(0,l.jsxs)(`table`,{className:`radeax-kb-table`,children:[(0,l.jsx)(`thead`,{children:(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`th`,{style:{width:80},children:`Type`}),(0,l.jsx)(`th`,{children:`Title / Question`}),(0,l.jsx)(`th`,{children:`Content Preview`}),(0,l.jsx)(`th`,{style:{width:90},children:`Action`})]})}),(0,l.jsx)(`tbody`,{children:_e.map(e=>(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`td`,{children:(0,l.jsx)(`span`,{className:`radeax-kb-tag ${e.type}`,children:e.type})}),(0,l.jsxs)(`td`,{children:[(0,l.jsx)(`strong`,{children:e.title||e.question}),e.url&&(0,l.jsx)(`div`,{style:{fontSize:11,color:`#6366f1`,marginTop:4},children:(0,l.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,style:{display:`inline-flex`,alignItems:`center`,gap:4,color:`inherit`},children:[e.url,` `,(0,l.jsx)(ae,{size:11})]})})]}),(0,l.jsx)(`td`,{style:{color:`#475569`,fontSize:12.5},children:e.type===`qa`?e.answer:e.content?e.content.slice(0,160)+`...`:``}),(0,l.jsx)(`td`,{children:(0,l.jsx)(`button`,{className:`radeax-btn-danger`,onClick:()=>Y(e.id),title:`Delete entry`,children:(0,l.jsx)(fe,{size:14})})})]},e.id))})]})})]})]}),o===`leads`&&(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(3, 1fr)`,gap:16,marginBottom:20},children:[(0,l.jsxs)(`div`,{className:`radeax-admin-card`,style:{padding:18,marginBottom:0},children:[(0,l.jsx)(`div`,{style:{fontSize:12,color:`#64748b`,fontWeight:600},children:`TOTAL LEADS`}),(0,l.jsx)(`div`,{style:{fontSize:28,fontWeight:700,color:`#0f172a`,marginTop:4},children:z.total})]}),(0,l.jsxs)(`div`,{className:`radeax-admin-card`,style:{padding:18,marginBottom:0},children:[(0,l.jsx)(`div`,{style:{fontSize:12,color:`#64748b`,fontWeight:600},children:`WITH GDPR CONSENT`}),(0,l.jsx)(`div`,{style:{fontSize:28,fontWeight:700,color:`#16a34a`,marginTop:4},children:z.withConsent})]}),(0,l.jsxs)(`div`,{className:`radeax-admin-card`,style:{padding:18,marginBottom:0},children:[(0,l.jsx)(`div`,{style:{fontSize:12,color:`#64748b`,fontWeight:600},children:`THIS WEEK`}),(0,l.jsx)(`div`,{style:{fontSize:28,fontWeight:700,color:`#6366f1`,marginTop:4},children:z.thisWeek})]})]}),(0,l.jsxs)(`div`,{className:`radeax-admin-card`,children:[(0,l.jsxs)(`div`,{className:`radeax-admin-card-header`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`h3`,{className:`radeax-admin-card-title`,children:[(0,l.jsx)(K,{size:20,color:`#6366f1`}),` Captured Leads & Inquiries`]}),(0,l.jsx)(`p`,{className:`radeax-admin-card-desc`,children:`Automatically captured when visitors submit the contact modal.`})]}),(0,l.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,l.jsxs)(`div`,{style:{position:`relative`,width:220},children:[(0,l.jsx)(le,{size:16,style:{position:`absolute`,left:10,top:12,color:`#94a3b8`}}),(0,l.jsx)(`input`,{type:`text`,className:`radeax-form-input`,placeholder:`Search leads...`,style:{paddingLeft:34},value:L,onChange:e=>R(e.target.value)})]}),(0,l.jsxs)(`button`,{className:`radeax-btn-primary`,onClick:De,children:[(0,l.jsx)(ie,{size:16}),` Export CSV`]})]})]}),ve.length===0?(0,l.jsx)(`div`,{style:{textAlign:`center`,padding:`40px 0`,color:`#94a3b8`},children:`No leads collected yet. Trigger the lead modal in the chat widget to test collection!`}):(0,l.jsx)(`div`,{style:{overflowX:`auto`},children:(0,l.jsxs)(`table`,{className:`radeax-kb-table`,children:[(0,l.jsx)(`thead`,{children:(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`th`,{children:`Name`}),(0,l.jsx)(`th`,{children:`Email`}),(0,l.jsx)(`th`,{children:`Phone`}),(0,l.jsx)(`th`,{children:`Message`}),(0,l.jsx)(`th`,{children:`GDPR`}),(0,l.jsx)(`th`,{children:`Date`}),(0,l.jsx)(`th`,{style:{width:60},children:`Action`})]})}),(0,l.jsx)(`tbody`,{children:ve.map(e=>(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`td`,{children:(0,l.jsx)(`strong`,{children:e.name})}),(0,l.jsx)(`td`,{children:e.email}),(0,l.jsx)(`td`,{children:e.phone||`-`}),(0,l.jsx)(`td`,{style:{fontSize:12},children:e.message||`-`}),(0,l.jsx)(`td`,{children:(0,l.jsx)(`span`,{style:{padding:`3px 8px`,borderRadius:6,fontSize:11,fontWeight:600,background:e.gdprConsent?`#dcfce7`:`#fee2e2`,color:e.gdprConsent?`#15803d`:`#991b1b`},children:e.gdprConsent?`Consented`:`None`})}),(0,l.jsx)(`td`,{style:{fontSize:12,color:`#64748b`},children:new Date(e.createdAt).toLocaleDateString()}),(0,l.jsx)(`td`,{children:(0,l.jsx)(`button`,{className:`radeax-btn-danger`,onClick:()=>X(e.id),title:`Delete lead`,children:(0,l.jsx)(fe,{size:14})})})]},e.id))})]})})]})]}),o===`appearance`&&(0,l.jsxs)(`div`,{className:`radeax-admin-card`,children:[(0,l.jsx)(`div`,{className:`radeax-admin-card-header`,children:(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`h3`,{className:`radeax-admin-card-title`,children:[(0,l.jsx)(ce,{size:20,color:`#ec4899`}),` Widget Appearance & Behavior`]}),(0,l.jsx)(`p`,{className:`radeax-admin-card-desc`,children:`Customize titles, colors, positioning, avatars, and lead generation messages.`})]})}),(0,l.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:20},children:[(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Widget Toggle Title`}),(0,l.jsx)(`input`,{type:`text`,className:`radeax-form-input`,value:n.widgetTitle||`Chat with us`,onChange:e=>r({widgetTitle:e.target.value})})]}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`AI Assistant Name`}),(0,l.jsx)(`input`,{type:`text`,className:`radeax-form-input`,value:n.botName||`Radeax AI Assistant`,onChange:e=>r({botName:e.target.value})})]}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Welcome Message`}),(0,l.jsx)(`textarea`,{className:`radeax-form-textarea`,rows:2,value:n.welcomeMessage||`Hello! How can I help you today?`,onChange:e=>r({welcomeMessage:e.target.value})})]}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Lead Collection Prompt`}),(0,l.jsx)(`textarea`,{className:`radeax-form-textarea`,rows:2,value:n.leadCollectionMessage||`I would love to follow up with you. Could you please share your contact details?`,onChange:e=>r({leadCollectionMessage:e.target.value})})]}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Widget Placement Position`}),(0,l.jsxs)(`select`,{className:`radeax-form-select`,value:n.position||`bottom-right`,onChange:e=>r({position:e.target.value}),children:[(0,l.jsx)(`option`,{value:`bottom-right`,children:`Bottom Right (Standard)`}),(0,l.jsx)(`option`,{value:`bottom-left`,children:`Bottom Left`})]})]}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Primary Color Theme`}),(0,l.jsxs)(`div`,{style:{display:`flex`,gap:10,alignItems:`center`},children:[(0,l.jsx)(`input`,{type:`color`,value:n.primaryColor||`#6366f1`,onChange:e=>r({primaryColor:e.target.value}),style:{width:44,height:40,border:`none`,cursor:`pointer`,borderRadius:8}}),(0,l.jsx)(`input`,{type:`text`,className:`radeax-form-input`,value:n.primaryColor||`#6366f1`,onChange:e=>r({primaryColor:e.target.value})})]})]}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Custom Avatar Image URL (Optional)`}),(0,l.jsx)(`input`,{type:`url`,className:`radeax-form-input`,placeholder:`https://your-domain.com/avatar.png (leave blank for 🤖)`,value:n.customAvatar||``,onChange:e=>r({customAvatar:e.target.value})})]}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Lead Capture Trigger Threshold`}),(0,l.jsx)(`input`,{type:`number`,min:1,max:20,className:`radeax-form-input`,value:n.leadMessageThreshold||2,onChange:e=>r({leadMessageThreshold:Number(e.target.value)||2})})]})]}),(0,l.jsxs)(`div`,{style:{marginTop:10,padding:14,background:`#f8fafc`,borderRadius:12,border:`1px solid #e2e8f0`},children:[(0,l.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:10,cursor:`pointer`,fontWeight:600,fontSize:13.5},children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:n.gdprEnabled??!0,onChange:e=>r({gdprEnabled:e.target.checked})}),`Enable GDPR Compliance Consent Checkbox`]}),n.gdprEnabled&&(0,l.jsxs)(`div`,{style:{marginTop:10},children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`GDPR Consent Message`}),(0,l.jsx)(`input`,{type:`text`,className:`radeax-form-input`,value:n.gdprMessage||`I consent to the collection of my contact details for follow-up purposes.`,onChange:e=>r({gdprMessage:e.target.value})})]})]})]}),o===`api`&&(0,l.jsxs)(`div`,{className:`radeax-admin-card`,children:[(0,l.jsx)(`div`,{className:`radeax-admin-card-header`,children:(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`h3`,{className:`radeax-admin-card-title`,children:[(0,l.jsx)(N,{size:20,color:`#f59e0b`}),` Google Gemini Intelligence Settings`]}),(0,l.jsx)(`p`,{className:`radeax-admin-card-desc`,children:`Configure your Google Gemini API key and AI parameters.`})]})}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Google Gemini API Key`}),(0,l.jsxs)(`div`,{style:{display:`flex`,gap:10},children:[(0,l.jsx)(`input`,{type:`password`,className:`radeax-form-input`,placeholder:`AIzaSy...`,value:n.apiKey||``,onChange:e=>r({apiKey:e.target.value})}),(0,l.jsxs)(`button`,{type:`button`,className:`radeax-btn-primary`,onClick:he,disabled:H||!n.apiKey,style:{whiteSpace:`nowrap`},children:[H?(0,l.jsx)(oe,{size:16,className:`radeax-spin`}):(0,l.jsx)(N,{size:16}),`Test Connection`]})]}),(0,l.jsxs)(`div`,{style:{fontSize:12,color:`#64748b`,marginTop:6},children:[`Get an API key for free at `,(0,l.jsx)(`a`,{href:`https://aistudio.google.com/app/apikey`,target:`_blank`,rel:`noreferrer`,style:{color:`#6366f1`,fontWeight:600},children:`Google AI Studio`}),`.`]})]}),U&&(0,l.jsxs)(`div`,{style:{padding:`12px 16px`,borderRadius:10,marginBottom:16,display:`flex`,alignItems:`center`,gap:10,background:U.success?`#dcfce7`:`#fee2e2`,color:U.success?`#15803d`:`#991b1b`,fontSize:13.5},children:[U.success?(0,l.jsx)(ee,{size:20}):(0,l.jsx)(te,{size:20}),(0,l.jsx)(`div`,{children:U.message})]}),(0,l.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:20},children:[(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsx)(`label`,{className:`radeax-form-label`,children:`Gemini AI Model`}),(0,l.jsx)(`select`,{className:`radeax-form-select`,value:n.model||`gemini-1.5-flash`,onChange:e=>r({model:e.target.value}),children:J.map(e=>(0,l.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,l.jsxs)(`div`,{className:`radeax-form-group`,children:[(0,l.jsxs)(`label`,{className:`radeax-form-label`,children:[`Temperature (`,n.temperature??.7,`) - Creativity Level`]}),(0,l.jsx)(`input`,{type:`range`,min:`0`,max:`1`,step:`0.05`,value:n.temperature??.7,onChange:e=>r({temperature:parseFloat(e.target.value)}),style:{width:`100%`,marginTop:8}}),(0,l.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,fontSize:11,color:`#64748b`,marginTop:4},children:[(0,l.jsx)(`span`,{children:`Strict & Precise (0.0)`}),(0,l.jsx)(`span`,{children:`Balanced (0.7)`}),(0,l.jsx)(`span`,{children:`Creative (1.0)`})]})]})]})]}),o===`embed`&&(0,l.jsxs)(`div`,{className:`radeax-admin-card`,children:[(0,l.jsx)(`div`,{className:`radeax-admin-card-header`,children:(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`h3`,{className:`radeax-admin-card-title`,children:[(0,l.jsx)(re,{size:20,color:`#6366f1`}),` Ready-to-Use React Integration`]}),(0,l.jsx)(`p`,{className:`radeax-admin-card-desc`,children:`Drop this component into any React, Vite, or Next.js app!`})]})}),(0,l.jsxs)(`div`,{className:`radeax-code-box`,children:[(0,l.jsx)(`button`,{className:`radeax-copy-code-btn`,onClick:()=>{let e=`import { RadeaxAIChatbot } from 'radeax-ai-chatbot';
14
+ import 'radeax-ai-chatbot/style.css';
15
+
16
+ function App() {
17
+ return (
18
+ <div className="App">
19
+ {/* Public Visitor Chatbot Widget */}
20
+ <RadeaxAIChatbot
21
+ apiKey="${n.apiKey||`YOUR_GEMINI_API_KEY`}"
22
+ botName="${n.botName||`Radeax AI Assistant`}"
23
+ welcomeMessage="${n.welcomeMessage||`Hello! How can I help you today?`}"
24
+ primaryColor="${n.primaryColor||`#6366f1`}"
25
+ position="${n.position||`bottom-right`}"
26
+ enableLeadGeneration={true}
27
+ onLeadSubmit={(lead) => console.log('Lead captured:', lead)}
28
+ />
29
+ </div>
30
+ );
31
+ }`;navigator.clipboard.writeText(e),alert(`React integration code copied to clipboard!`)},children:`Copy React Code`}),(0,l.jsx)(`pre`,{style:{margin:0},children:`// 1. Install via npm:
32
+ // npm install radeax-ai-chatbot
33
+
34
+ // 2. Import into your React application:
35
+ import { RadeaxAIChatbot } from 'radeax-ai-chatbot';
36
+ import 'radeax-ai-chatbot/style.css';
37
+
38
+ // 3. Add to your JSX tree:
39
+ export default function App() {
40
+ return (
41
+ <div>
42
+ {/* Radeax AI Chatbot (Developed by Muhammad Owais Khan) */}
43
+ <RadeaxAIChatbot
44
+ apiKey="${n.apiKey||`YOUR_GEMINI_API_KEY`}"
45
+ botName="${n.botName||`Radeax AI Assistant`}"
46
+ welcomeMessage="${n.welcomeMessage||`Hello! How can I help you today?`}"
47
+ primaryColor="${n.primaryColor||`#6366f1`}"
48
+ position="${n.position||`bottom-right`}"
49
+ enableLeadGeneration={true}
50
+ onLeadSubmit={(lead) => console.log('Captured Lead:', lead)}
51
+ />
52
+ </div>
53
+ );
54
+ }`})]})]})]})]})})}exports.DEFAULT_KNOWLEDGE_BASE=Z,exports.GEMINI_MODELS=J,exports.RadeaxAIChatbot=ke,exports.default=ke,exports.RadeaxAdminPanel=Ae,exports.buildPrompt=Y,exports.deleteLead=Ee,exports.exportLeadsToCsv=De,exports.extractKeywords=Se,exports.extractTextFromHtml=be,exports.getLeadStats=Oe,exports.getRelevantKnowledge=Ce,exports.isEndMessage=X,exports.loadKnowledgeBase=ye,exports.loadLeads=$,exports.saveKnowledgeBase=Q,exports.saveLead=Te,exports.scrapeUrlContent=xe,exports.sendGeminiChat=he,exports.testGeminiConnection=ge;
55
+ //# sourceMappingURL=index.cjs.map