"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
/**
 * Native AI.js Integration Demo
 *
 * A complete example of integrating native_aijs SDK with BFUI
 */
const react_1 = require("react");
const ai_js_1 = require("../components/ai.js");
const NativeAIJSIntegrationDemo = () => {
    // State
    const [activeTab, setActiveTab] = (0, react_1.useState)('chat');
    const [analysisResults, setAnalysisResults] = (0, react_1.useState)(null);
    // Handle tab change
    const handleTabChange = (tab) => {
        setActiveTab(tab);
    };
    // Handle analysis completion
    const handleAnalysisComplete = (results) => {
        setAnalysisResults(results);
    };
    return ((0, jsx_runtime_1.jsx)("div", { className: "max-w-6xl mx-auto p-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-white rounded-lg shadow-lg overflow-hidden", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-6 bg-blue-600 text-white", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold", children: "native_aijs SDK Integration Demo" }), (0, jsx_runtime_1.jsx)("p", { className: "mt-2 opacity-80", children: "This demo showcases the integration between BFUI and the native_aijs SDK." })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex border-b", children: [(0, jsx_runtime_1.jsx)("button", { className: `px-6 py-3 text-lg font-medium transition-colors ${activeTab === 'chat'
                                ? 'border-b-2 border-blue-500 text-blue-600'
                                : 'text-gray-500 hover:text-gray-700'}`, onClick: () => handleTabChange('chat'), children: "Chat Demo" }), (0, jsx_runtime_1.jsx)("button", { className: `px-6 py-3 text-lg font-medium transition-colors ${activeTab === 'analyzer'
                                ? 'border-b-2 border-blue-500 text-blue-600'
                                : 'text-gray-500 hover:text-gray-700'}`, onClick: () => handleTabChange('analyzer'), children: "Document Analyzer" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [activeTab === 'chat' && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-4", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-xl font-semibold mb-2", children: "AI Chat Example" }), (0, jsx_runtime_1.jsx)("p", { className: "text-gray-600", children: "This example demonstrates how to use the native_aijs SDK for chat functionality. The implementation uses React hooks and the SDK's streaming capabilities." })] }), (0, jsx_runtime_1.jsx)("div", { className: "h-[500px] border rounded-lg", children: (0, jsx_runtime_1.jsx)(ai_js_1.AIChatDemo, { initialPrompt: "Hello, I'd like to learn about native_aijs integration.", initialSystemPrompt: "You are a helpful assistant specialized in explaining software integration concepts. Provide clear, concise answers with examples when appropriate." }) })] })), activeTab === 'analyzer' && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "mb-4", children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-xl font-semibold mb-2", children: "Document Analyzer Example" }), (0, jsx_runtime_1.jsx)("p", { className: "text-gray-600", children: "This example shows how to use the native_aijs SDK for document analysis. You can paste any text and get AI-powered insights." })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-6", children: [(0, jsx_runtime_1.jsx)(ai_js_1.DocumentAnalyzer, { onAnalysisComplete: handleAnalysisComplete }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-gray-50 rounded-lg p-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-lg font-semibold mb-3", children: "Integration Details" }), (0, jsx_runtime_1.jsx)("p", { className: "text-gray-700 mb-4", children: "This component uses the native_aijs SDK under the hood, specifically:" }), (0, jsx_runtime_1.jsxs)("ul", { className: "list-disc pl-5 space-y-2 text-gray-700", children: [(0, jsx_runtime_1.jsxs)("li", { children: ["The ", (0, jsx_runtime_1.jsx)("code", { className: "bg-gray-100 px-1 py-0.5 rounded", children: "BfuiAdapter" }), " provides specialized methods for BFUI"] }), (0, jsx_runtime_1.jsxs)("li", { children: ["The ", (0, jsx_runtime_1.jsx)("code", { className: "bg-gray-100 px-1 py-0.5 rounded", children: "useAI" }), " hook manages React state and API calls"] }), (0, jsx_runtime_1.jsx)("li", { children: "Error handling and retries are managed by the SDK" }), (0, jsx_runtime_1.jsx)("li", { children: "Monitoring is automatically collected and exposed" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-6", children: [(0, jsx_runtime_1.jsx)("h4", { className: "font-medium mb-2", children: "SDK Configuration" }), (0, jsx_runtime_1.jsx)("pre", { className: "bg-gray-800 text-green-400 p-3 rounded-md text-sm overflow-x-auto", children: `// SDK Initialization
const sdk = new NativeAISDK({
  defaultProvider: 'anthropic',
  baseUrl: process.env.NATIVE_AI_API_URL,
  apiKey: process.env.NATIVE_AI_API_KEY,
  monitoring: {
    enabled: true,
    serviceName: 'bfui'
  }
});

// BFUI-specific adapter
const bfuiAdapter = new BfuiAdapter(sdk);` })] })] })] })] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "px-6 py-4 bg-gray-50 border-t", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-gray-600 text-sm", children: "This integration uses the native_aijs SDK developed as part of the standardization effort across the BlueAgent platform. The SDK provides type-safe, consistent integration patterns for all projects." }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-2 flex items-center text-sm text-gray-500", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-3 h-3 rounded-full bg-green-500 mr-2" }), (0, jsx_runtime_1.jsx)("span", { children: "SDK Connected" }), (0, jsx_runtime_1.jsx)("span", { className: "mx-2", children: "\u2022" }), (0, jsx_runtime_1.jsx)("span", { children: "Monitoring Enabled" }), (0, jsx_runtime_1.jsx)("span", { className: "mx-2", children: "\u2022" }), (0, jsx_runtime_1.jsx)("span", { children: "Version 1.0.0" })] })] })] }) }));
};
exports.default = NativeAIJSIntegrationDemo;
//# sourceMappingURL=NativeAIJSIntegrationDemo.js.map