// AI i RH CHAT

const lang = $('html').attr('lang');

//console.log({ lang });

if (lang == 'pl') {
    const chatConfig = {
        noBackground: true,
        options: {
            phone: true,
            aiChat: true,
            rhChat: true,
            position: 'left'
        },
        texts: {
            aiChatHeader: 'Asystent AI',
            rhChatHeader: 'Rozmowa z konsultantem',
            aiChatTooltip: 'Asystent AI odpowie <br /> na Twoje pytania.',
            firstMessage:
                'Cześć! Jestem wirtualnym asystentem.<br />Zadaj pytanie, postaram sie odpowiedzieć.',
            welcomeBack: 'Witaj ponownie!'
        },
        apiUrl: 'chatbot',
        localStorageKey: 'aiChatHistory',
        questions: [
            'Rozmowa z konsultantem',
            'Jaki jest czas wysyłki?',
            'Ile kosztuje dostawa?',
            'Co z moim zamówieniem?'
        ],
        autoResponses: [
            'Daj mi chwilkę, aby odpowiedzieć na to pytanie',
            'Poczekaj jeszcze chwilę',
            'Potrzebuję chwili, aby odpowiedzieć na to pytanie',
            'Proszę poczekaj chwilę, staram się przeanalizować Twoje pytanie i znaleźć odpowiedź.',
            'Dziękuję za pytanie. Potrzebuję chwili, aby zgłębić temat i zapewnić Ci najlepszą odpowiedź.',
            'To chwilę potrwa, zanim znajdę odpowiedź na Twoje pytanie.',
            'Dziękuję za cierpliwość. Szukam najlepszej odpowiedzi.',
            'Staram się znaleźć odpowiedź, ale potrzebuję chwili, aby zweryfikować swoje informacje.'
        ],
        autoResponseInterval: 30 * 1000,
        style: {
            brand: '#ee892b',
            brandLight: '#e89446',
            brandDark: '#96581e',
            radius: '20px'
        },
        translates: {
            messagePlaceholder: 'Podaj treść wiadomość'
        }
    };
    const myAiChat = new aiChat(chatConfig, false);
} else {
    const chatConfig = {
        noBackground: true,
        options: {
            phone: false,
            aiChat: true,
            rhChat: true,
            position: 'left'
        },
        texts: {
            aiChatHeader: 'AI assistant',
            rhChatHeader: 'Conversation with a consultant',
            aiChatTooltip: 'The consultant will answer <br /> your questions.',
            firstMessage:
                "Hi! I'm a virtual assistant.<br />Ask a question, I will try to answear.",
            welcomeBack: 'Welcome back!'
        },
        apiUrl: 'chatbot',
        localStorageKey: 'aiChatHistory',
        questions: [
            'Conversation with a consultant',
            'What is the shipping time?',
            'How much does delivery cost?',
            "What's with my order?"
        ],
        autoResponses: [
            'Give me a moment to answer this question',
            'Wait just a moment',
            'I need a moment to answer this question',
            "Please wait a moment, I'm trying to analyze your question and find the answer.",
            'Thank you for your question. I need a moment to research the topic and provide you with the best answer.',
            'It will take a while to find the answer to your question.',
            "Thank you for your patience. I'm looking for the best answer.",
            "I'm trying to find the answer, but I need a moment to verify my information."
        ],
        autoResponseInterval: 30 * 1000,
        style: {
            brand: '#ee892b',
            brandLight: '#e89446',
            brandDark: '#96581e',
            radius: '20px'
        },
        translates: {
            tak: 'Yes',
            nie: 'No',
            week: [
                'Sunday',
                'Monday',
                'Tuesday',
                'Wednesday',
                'Thursday',
                'Friday',
                'Saturday'
            ],
            error: 'Oops! Something went wrong. Please check your internet connection. If the issue persists, our developers will be notified!',
            telPlaceholder: 'Enter your phone number',
            telSet: 'Please provide your phone number, and we will call you during our office hours (Mon-Fri: 8:00 AM - 4:00 PM).',
            telEnd: 'Thank you for providing your phone number. We will call you back as soon as possible!',
            messagePlaceholder: 'Write your message...',
            endRhChatQuestionMode: 'End the conversation with the consultant',
            rhChatQuestionQuestionMode:
                'Would you like our staff to contact you at the earliest available time?',
            rhChatUnavailable:
                'Sorry, chatting with a consultant is currently unavailable.',
            rhChatNoAdmin: 'No consultants are available at the moment.',
            rhChatQuestion: 'Do you want to talk to a live consultant?',
            rhChatAddAdmin: 'A consultant has joined the conversation.',
            rhChatAwayAdmin: 'The consultant has left the conversation.',
            rhChatStart: 'Hi there! Our consultants are ready to assist you.',
            rhChatToTel:
                'Sorry, none of our consultants are available at the moment. Please contact us by phone.',
            rhChatToLater:
                'Sorry, none of our consultants are available at the moment. Please try again later.',
            reconnect: 'Try reconnecting',
            reconnectLoading: 'Connecting to the consultant<br>Please wait',
            reconnecting: 'Chat connection lost. Reconnecting...',
            offline: 'No internet connection',
            online: 'Internet connection restored',
            connected: 'Connected to chat',
            connectLost: 'Disconnected from chat',
            welcomeBack: 'Welcome back!'
        }
    };
    const myAiChat = new aiChat(chatConfig, false);
}
