import useLLM from "@react-llm/headless";
import Image from "next/image";
import { useCallback, useEffect, useState } from "react";
import MessageList from './MessageList';
import {FileLoader} from './FileLoader';
import Loader from "./Loader";
import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter';
import { XenovaTransformersEmbeddings } from '../embed/hf';
import { MemoryVectorStore } from "langchain/vectorstores/memory";  

import {
  Button,
  TextInput,
} from "react95";

function ChatWindow({
  stopStrings,
  maxTokens,
}) {
  const { loadingStatus, send, isGenerating, deleteMessages } = useLLM();
  const [fileText, setFileText] = useState();
  const [userInput, setUserInput] = useState("");  
  const [isLoading, setIsLoading] = useState(false);

  const handleChange = (event) => {
    setUserInput(event.target.value);
  };

  const isReady = loadingStatus.progress === 1;

  const handleClearChat = () => {
    deleteMessages();
  }

  const handleClearFile = () => {
    setFileText(null);
  }

  const qaHandler = async (fileText, userInput) => {
    const textSplitter = new RecursiveCharacterTextSplitter({ chunkSize: 1000 });
      const docs = await textSplitter.createDocuments([fileText]);
      let qaPrompt;
      try {
        const vectorStore = await MemoryVectorStore.fromTexts(
          [...docs.map(doc => doc.pageContent)],
          [...docs.map((v, k) => k)],
          new XenovaTransformersEmbeddings()
        )
        const queryResult = await vectorStore.similaritySearch(userInput, 2);
        qaPrompt = 
      `You are an AI assistant providing helpful advice. You are given the following extracted parts of a long document and a question. Provide a conversational answer based on the context provided.
        You should only provide hyperlinks that reference the context below. Do NOT make up hyperlinks.
        If you can't find the answer in the context below, just say "Hmm, I'm not sure." Don't try to make up an answer.
        If the question is not related to the context, politely respond that you are tuned to only answer questions that are related to the context.
        Question: ${userInput}
        =========
        ${queryResult.map(result => result.pageContent).join('')}
        =========
        Answer:
        `
        return qaPrompt;
      } catch (err) {
        console.log(err);
      }
  }

  const handleSubmit = useCallback(async () => {
    if (isGenerating || !isReady) {
      return;
    }
    
    if (fileText) {
      const qaPrompt = await qaHandler(fileText, userInput);
      send(qaPrompt, maxTokens, stopStrings);
    } else {
      send(userInput, maxTokens, stopStrings);
    }
    
    setUserInput("");
  }, [
    userInput,
    send,
    isGenerating,
    isReady,
    maxTokens,
    stopStrings,
    fileText
  ]);

  useEffect(() => {
    const handleKeyPress = (event) => {
      if (event.key === "Enter") {
        event.preventDefault();
        handleSubmit();
      }
    };
    window.addEventListener("keydown", handleKeyPress);

    return () => {
      window.removeEventListener("keydown", handleKeyPress);
    };
  }, [handleSubmit]);

  const loadFile = async (fileText) => {
    console.log('file loaded, demo mode');
    if (fileText) {
      setIsLoading(true);
      const qaPrompt = await qaHandler(fileText, "Based on the context what are some interesting questions that I can ask you?");
      send(qaPrompt, maxTokens, stopStrings);
      setIsLoading(false);
    }
  }

  useEffect(() => {
    loadFile(fileText);

  }, [fileText])

  return (
    <div className="window sm:w-[500px] w-full">
      
      <div className="window-content w-full">
        <div className="flex flex-col w-full">
          <MessageList
            screenName={"me"}
            assistantScreenName={"vicuna"}
          />
          {/* <Separator /> */}
          <div className="h-4" />
          {isReady && (
            <div>
              <form onSubmit={handleSubmit}>
                <div className="flex" style={{ color: 'white', textarea: { color: 'white' } }}>
                   <TextInput
                    value={userInput}
                    placeholder="Say something..."
                    onChange={handleChange}
                    fullWidth
                    multiline
                    rows={3}
                  />
                </div>
              </form>
              
              <div className="flex justify-start m-2">
                
                  <div>
                  <Button
                    onClick={handleSubmit}
                    className="submit"
                    style={{ backgroundColor: "black", height: "65px", width: "65px", float: "right" }}
                  >
                    <Image
                      src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7d13nF11nf/x17kzEzoJHZQihC66lAgYEIzJzISmq0IAERZXBdfCruWxurpqcNe6v1UBV8W1UlSKsggCk0kMKFWqtNAJTUghmUAKmXLP749JTAKTZMq953PuOa/n4+EDmcw95/0IM/N5z/d77jkJkvIvJWEa29DE1vQxhmTF/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Hy5hs1p4e+pcioJE/FrVI3vTuBCqlzoRX3KE3+4Kr+msy99nErCycAu0XGkIXgS+BUpF9LOQ9FhpIFYANQYOjiIhNPov6/AdtFxpAEsAH5PhQuYyAyX+JV3FgA1lpk000MbcALwTmDL4EQqtxdJuBK4lGZm+EAeNRILgBrXpTSxBW8l5QT6C8EO0ZFUCi8C15ByGVtxHePoiQ4kDYcFQMXQXwbeBryTlGOBPaIjqVAeAa4m5UoWcZMP4lERWABUTNPZjT4mUeE4UtrweQQamj7gVuAqKlzFJB6MDiTVmgVAxTeTMfQykZRWoBXYLTqScijlcWAaCZ0k/IFWFkVHkurJAqDymcFY+v5WBt6OFxKW1YvATGA6FTqZxBPRgaQsWQCkldsFCYfTXwh2Ck6k+phLwp9JuZGU6dzC3UylGh1KimIBkF6tk31IOYyEt5JyCLAPUImOpSGpAg8Ct5FyC1Vu5Cgejg4l5YkFQFqfa9icURxMH4dS4RBSDgBeHx1La3gWuJuUP5NwC73cztG8FB1KyjMLgDQcHWxLwv7AASQcsKIUjAWagpMVXR8Jj5FyN3APKXfRxz0czbzoYFKjsQBItTKTDelhb/q3DPYD9l7xz92A5shoDaiHhCdIeYCUWcD9pMyiykMczfLocFIRWACkeruDFuazC83sTpWxpOxOhd1J2Y3+hxxtEh0xyBLgKeDxFb/V9/+zwmNUeMrb6kr1ZQGQol3HljSzI33sDOwM7ETCDsA2JGxPynbANjTOzYy6gXkkzCHlBWAe8FdSngWepomneYVnOJaFsTGlcrMASI3iOrYkZRsqjKHCGKqMIWELEsaQMgYYTUoTCWNIaKHKpiRsBGy44gjNwGbrOcvL8LffvF8hZRkVFpPSQ0oX0EvCS8BCoIuULip0UV3xvz7mOtilxvD/AdNdiuyj84QBAAAAAElFTkSuQmCC"
                      alt="Send Message"
                      style={{
                        filter:
                          !isReady || isGenerating || isLoading
                            ? "grayscale(100%)"
                            : undefined,
                      }}
                      width="40"
                      height="40"
                    />
                  </Button>
                  
                  <FileLoader setFileText={setFileText} />
                  <Button onClick={handleClearChat}>Clear Chat</Button>
                  </div>
                  
                  <div
                    className="w-full h-1 mt-2"
                    style={{
                      backgroundColor:
                        !isReady || isGenerating ? "gray" : "green",
                      width: "100%",
                      height: "5px",
                      marginTop: "2px",
                    }}
                  ></div>
                
              </div>
            </div>
          )}
          {!isReady && <Loader />}
        </div>
      </div>
    </div>
  );
}

export default ChatWindow;