<?php 

    /**
     * Display plugin administrator page
     */
    function vappv_ttw_draw_admin_section() {

        // Create settings controller and load settings
        $settings_controller = new VAPPV_TTW_Settings();
        $settings_controller->load_all_saved_settings();

        // Get stats data
        $ttw_stats_controller = new VAPPV_TTW_Statistics();
        $current_day_stats = $ttw_stats_controller->get_today_stats();

        // Get important settings from DB
        $is_openai_key_set 							= ( ! is_null( $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_openai_api_key ) ) && strlen( $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_openai_api_key ) ) > 0 );
        $are_primary_settings_saved 				= ( 'yes' === $settings_controller->try_get_setting( VAPPV_TTW_Settings::$primary_settings_saved ) );
        $is_assistant_configured 					= ( ! is_null( $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_current_assistant_data ) ) && strlen( $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_current_assistant_data ) ) > 0 );
        $settings_is_chatbot_displayed_right_now 	= ( ! is_null( $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_is_chatbot_displayed_right_now ) ) && 1 === $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_is_chatbot_displayed_right_now ) );
     
        //Demo (testing) values
        //$is_openai_key_set = false;
        //$are_primary_settings_saved = false;
        //$is_assistant_configured = false;

        ?>
            <div class="ttw-admin-section-container" id="ttw-admin-section-container">
                <div class="ttw-plugin-title-header">
                    <div class="ttw-logo"><svg width="50px" height="50px" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><title>ai</title><g id="Layer_2" data-name="Layer 2"><g id="invisible_box" data-name="invisible box"><rect width="48" height="48" fill="none"/></g><g id="Q3_icons" data-name="Q3 icons"><g><path d="M45.6,18.7,41,14.9V7.5a1,1,0,0,0-.6-.9L30.5,2.1h-.4l-.6.2L24,5.9,18.5,2.2,17.9,2h-.4L7.6,6.6a1,1,0,0,0-.6.9v7.4L2.4,18.7a.8.8,0,0,0-.4.8v9H2a.8.8,0,0,0,.4.8L7,33.1v7.4a1,1,0,0,0,.6.9l9.9,4.5h.4l.6-.2L24,42.1l5.5,3.7.6.2h.4l9.9-4.5a1,1,0,0,0,.6-.9V33.1l4.6-3.8a.8.8,0,0,0,.4-.7V19.4h0A.8.8,0,0,0,45.6,18.7Zm-5.1,6.8H42v1.6l-3.5,2.8-.4.3-.4-.2a1.4,1.4,0,0,0-2,.7,1.5,1.5,0,0,0,.6,2l.7.3h0v5.4l-6.6,3.1-4.2-2.8-.7-.5V25.5H27a1.5,1.5,0,0,0,0-3H25.5V9.7l.7-.5,4.2-2.8L37,9.5v5.4h0l-.7.3a1.5,1.5,0,0,0-.6,2,1.4,1.4,0,0,0,1.3.9l.7-.2.4-.2.4.3L42,20.9v1.6H40.5a1.5,1.5,0,0,0,0,3ZM21,25.5h1.5V38.3l-.7.5-4.2,2.8L11,38.5V33.1h0l.7-.3a1.5,1.5,0,0,0,.6-2,1.4,1.4,0,0,0-2-.7l-.4.2-.4-.3L6,27.1V25.5H7.5a1.5,1.5,0,0,0,0-3H6V20.9l3.5-2.8.4-.3.4.2.7.2a1.4,1.4,0,0,0,1.3-.9,1.5,1.5,0,0,0-.6-2L11,15h0V9.5l6.6-3.1,4.2,2.8.7.5V22.5H21a1.5,1.5,0,0,0,0,3Z"/><path d="M13.9,9.9a1.8,1.8,0,0,0,0,2.2l2.6,2.5v2.8l-4,4v5.2l4,4v2.8l-2.6,2.5a1.8,1.8,0,0,0,0,2.2,1.5,1.5,0,0,0,1.1.4,1.5,1.5,0,0,0,1.1-.4l3.4-3.5V29.4l-4-4V22.6l4-4V13.4L16.1,9.9A1.8,1.8,0,0,0,13.9,9.9Z"/><path d="M31.5,14.6l2.6-2.5a1.8,1.8,0,0,0,0-2.2,1.8,1.8,0,0,0-2.2,0l-3.4,3.5v5.2l4,4v2.8l-4,4v5.2l3.4,3.5a1.7,1.7,0,0,0,2.2,0,1.8,1.8,0,0,0,0-2.2l-2.6-2.5V30.6l4-4V21.4l-4-4Z"/></g></g></g></svg></div>
                    <div class="ttw-headers-block">
                        <h1 class="ttw-header-first-line"><?php echo esc_html( __( 'Talk To Website / ChatGPT AI chatbot', 'talk-to-website' ) ); ?></h1>
                        <div class="ttw-header-second-line"><?php echo esc_html( __( 'Let your website speak to users in human language', 'talk-to-website' ) ); ?> 😉</div>
                    </div>
                </div>
                <div class="ttw-plugin-main">
                    <div class="ttw-admin-std-container ttw-top-notifications-area">
                        <?php 
                            // Complete important notifications block area
							$draw_plugin_daily_stats_bar = false;
							$draw_plugin_is_disabled_by_admin_notification = false;
							$draw_plugin_is_enabled_by_admin_notification = false;
							$draw_please_finish_config_notification = false;

							// Make necessary checks
                            if (
								true === $are_primary_settings_saved &&
								true === $is_openai_key_set &&
								true === $is_assistant_configured
							) {
                                if ( false === $settings_is_chatbot_displayed_right_now ) {
	                                $draw_plugin_is_disabled_by_admin_notification = true;
                                }
                                else {
	                                $draw_plugin_is_enabled_by_admin_notification = true;
                                }
	                            $draw_plugin_daily_stats_bar = true;
                            }
							else {
								$draw_please_finish_config_notification = true;
							}
                        ?>
						<div id="ttw-chatbot-disabled-plugin-top-notification" class="ttw-chatbot-disabled-plugin-top-notification" <?php if ( false === $draw_plugin_is_disabled_by_admin_notification ) { echo 'style="display: none;"'; } ?>>
							<div class="ttw-chatbot-disabled-plugin-top-notification-inner">
								<span class="dashicons dashicons-welcome-comments"></span>
								<span><b><?php echo esc_html( __( 'Plugin is disabled by Admin', 'talk-to-website' ) ); ?></b> (<?php echo esc_html( __( 'check the -Is chat-bot displayed on the website- setting', 'talk-to-website' ) ); ?>)</span>
								<div id="ttw-enable-plugin-from-notification-bar" class="ttw-button ttw-button-mini"><?php echo esc_html( __( 'Turn on', 'talk-to-website' ) ); ?></div>
							</div>
						</div>
						<div id="ttw-chatbot-enabled-plugin-top-notification" class="ttw-chatbot-enabled-plugin-top-notification" <?php if ( false === $draw_plugin_is_enabled_by_admin_notification ) { echo 'style="display: none;"'; } ?>>
							<div class="ttw-chatbot-enabled-plugin-top-notification-inner">
								<span class="dashicons dashicons-yes-alt"></span>
								<span><b><?php echo esc_html( __( 'Plugin is running', 'talk-to-website' ) ); ?></b></span>
								<div id="ttw-disable-plugin-from-notification-bar" class="ttw-button ttw-button-mini"><?php echo esc_html( __( 'Turn off', 'talk-to-website' ) ); ?></div>
							</div>
						</div>
						<div id="ttw-config-and-train-plugin-to-start" class="ttw-config-and-train-plugin-to-start" <?php if ( false === $draw_please_finish_config_notification ) { echo 'style="display: none;"'; } ?>>
							<div class="ttw-config-and-train-plugin-to-start-inner">
								<span class="dashicons dashicons-admin-generic"></span>
								<span><b><?php echo esc_html( __( 'Please save settings and train AI to finish config', 'talk-to-website' ) ); ?></b></span>
							</div>
						</div>
                    </div>
                    <div class="ttw-admin-std-container ttw-top-stats-area">
                        <?php 

                            // Get specific limits data
                            $settings_max_input_words_per_day_by_all_users 		= $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_max_input_words_per_day_by_all_users );
                            $settings_max_input_characters_per_day_by_all_users = $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_max_input_characters_per_day_by_all_users );
                            $settings_max_output_characters_per_day_by_ai 		= $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_max_output_characters_per_day_by_ai );
                            $settings_max_output_tokens_per_day_by_ai 			= $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_max_output_tokens_per_day_by_ai );

                            // Daily limiters:
                            // ["income_words_count", "income_characters_count", "output_characters_count", "output_completion_tokens_count"]

                        ?>
						<div id="ttw-plugin-current-limits" class="ttw-plugin-current-limits" <?php if ( false === $draw_plugin_daily_stats_bar ) { echo 'style="display: none;"'; } ?>>
							<div class="ttw-plugin-current-limits-inner">
								<div class="ttw-limits-top-block-label">
									<div class="ttw-today-limits-and-stats-label-itself"><?php echo esc_html( __( 'Today usage limits and stats', 'talk-to-website' ) ); ?>:</div>
									<div class="ttw-messages-and-dialogues-subcounter-label">
										<?php echo esc_html( $current_day_stats["income_messages_count"] ); ?> <?php echo esc_html( __( 'messages', 'talk-to-website' ) ); ?>, <?php echo esc_html( $current_day_stats["dialogues_count"] ); ?> <?php echo esc_html( __( 'dialogues', 'talk-to-website' ) ); ?>
									</div>
								</div>
								<div class="ttw-limits-area-row">
									<div class="ttw-limit-area-bar ttw-left-limits-bar">
										<?php
											$percent_value = ( $current_day_stats['income_characters_count'] / $settings_max_input_characters_per_day_by_all_users ) * 100;
											$percent_value_rounded = round( $percent_value, 3 );
										?>
										<div class="ttw-limits-top-block-sublabel"><span class="dashicons dashicons-editor-spellcheck"></span> <b><?php echo esc_html( __( 'Input', 'talk-to-website' ) ); ?></b> <?php echo esc_html( __( 'char-s by users', 'talk-to-website' ) ); ?> (<?php echo esc_html( "{$current_day_stats["income_characters_count"]} / {$settings_max_input_characters_per_day_by_all_users}, {$percent_value_rounded}%" ); ?>)</div>
										<div class="ttw-progressbar-meter">
											<span style="width: <?php echo esc_attr( $percent_value ); ?>%"></span>
										</div>
									</div>
									<div class="ttw-limit-area-bar ttw-right-limits-bar">
										<?php
											$percent_value = ( $current_day_stats['income_words_count'] / $settings_max_input_words_per_day_by_all_users ) * 100;
											$percent_value_rounded = round( $percent_value, 3 );
										?>
										<div class="ttw-limits-top-block-sublabel"><span class="dashicons dashicons-editor-paragraph"></span> <b><?php echo esc_html( __( 'Input', 'talk-to-website' ) ); ?></b> <?php echo esc_html( __( 'words by users', 'talk-to-website' ) ); ?> (<?php echo esc_html( "{$current_day_stats["income_words_count"]} / {$settings_max_input_words_per_day_by_all_users}, {$percent_value_rounded}%" ); ?>)</div>
										<div class="ttw-progressbar-meter">
											<span style="width: <?php echo esc_attr( $percent_value ); ?>%"></span>
										</div>
									</div>
								</div>
								<div class="ttw-limits-area-row">
									<div class="ttw-limit-area-bar ttw-left-limits-bar">
										<?php
											$percent_value = ( $current_day_stats['output_characters_count'] / $settings_max_output_characters_per_day_by_ai ) * 100;
											$percent_value_rounded = round( $percent_value, 3 );
										?>
										<div class="ttw-limits-top-block-sublabel"><span class="dashicons dashicons-editor-spellcheck"></span> <b><?php echo esc_html( __( 'Output', 'talk-to-website' ) ); ?></b> <?php echo esc_html( __( 'char-s by AI', 'talk-to-website' ) ); ?> (<?php echo esc_html( "{$current_day_stats["output_characters_count"]} / {$settings_max_output_characters_per_day_by_ai}, {$percent_value_rounded}%" ); ?>)</div>
										<div class="ttw-progressbar-meter">
											<span style="width: <?php echo esc_attr( $percent_value ); ?>%"></span>
										</div>
									</div>
									<div class="ttw-limit-area-bar ttw-right-limits-bar">
										<?php
											$percent_value = ( $current_day_stats['output_completion_tokens_count'] / $settings_max_output_tokens_per_day_by_ai ) * 100;
											$percent_value_rounded = round( $percent_value, 3 );
										?>
										<div class="ttw-limits-top-block-sublabel"><span class="dashicons dashicons-book"></span> <b><?php echo esc_html( __( 'Output', 'talk-to-website' ) ); ?></b> <?php echo esc_html( __( 'tokens by AI', 'talk-to-website' ) ); ?> (<?php echo esc_html( "{$current_day_stats["output_completion_tokens_count"]} / {$settings_max_output_tokens_per_day_by_ai}, {$percent_value_rounded}%" ); ?>)</div>
										<div class="ttw-progressbar-meter">
											<span style="width: <?php echo esc_attr( $percent_value ); ?>%"></span>
										</div>
									</div>
								</div>
							</div>
						</div>
                    </div>
                    <div class="ttw-admin-std-container ttw-plugin-main-tabs">
                        <div class="ttw-tabs-headings" id="ttw-tabs-headings">
                            <div class="ttw-tab ttw-active" data-role="ttw-tab" data-tabid="info">
								<div class="ttw-tab-head-inner-row">
									<div class="icon">
										<svg width="20px" height="20px" viewBox="0 0 1920 1920" xmlns="http://www.w3.org/2000/svg" fill="#000000"><path d="M960 0c530.193 0 960 429.807 960 960s-429.807 960-960 960S0 1490.193 0 960 429.807 0 960 0Zm0 101.053c-474.384 0-858.947 384.563-858.947 858.947S485.616 1818.947 960 1818.947 1818.947 1434.384 1818.947 960 1434.384 101.053 960 101.053Zm-42.074 626.795c-85.075 39.632-157.432 107.975-229.844 207.898-10.327 14.249-10.744 22.907-.135 30.565 7.458 5.384 11.792 3.662 22.656-7.928 1.453-1.562 1.453-1.562 2.94-3.174 9.391-10.17 16.956-18.8 33.115-37.565 53.392-62.005 79.472-87.526 120.003-110.867 35.075-20.198 65.9 9.485 60.03 47.471-1.647 10.664-4.483 18.534-11.791 35.432-2.907 6.722-4.133 9.646-5.496 13.23-13.173 34.63-24.269 63.518-47.519 123.85l-1.112 2.886c-7.03 18.242-7.03 18.242-14.053 36.48-30.45 79.138-48.927 127.666-67.991 178.988l-1.118 3.008a10180.575 10180.575 0 0 0-10.189 27.469c-21.844 59.238-34.337 97.729-43.838 138.668-1.484 6.37-1.484 6.37-2.988 12.845-5.353 23.158-8.218 38.081-9.82 53.42-2.77 26.522-.543 48.24 7.792 66.493 9.432 20.655 29.697 35.43 52.819 38.786 38.518 5.592 75.683 5.194 107.515-2.048 17.914-4.073 35.638-9.405 53.03-15.942 50.352-18.932 98.861-48.472 145.846-87.52 41.11-34.26 80.008-76 120.788-127.872 3.555-4.492 3.555-4.492 7.098-8.976 12.318-15.707 18.352-25.908 20.605-36.683 2.45-11.698-7.439-23.554-15.343-19.587-3.907 1.96-7.993 6.018-14.22 13.872-4.454 5.715-6.875 8.77-9.298 11.514-9.671 10.95-19.883 22.157-30.947 33.998-18.241 19.513-36.775 38.608-63.656 65.789-13.69 13.844-30.908 25.947-49.42 35.046-29.63 14.559-56.358-3.792-53.148-36.635 2.118-21.681 7.37-44.096 15.224-65.767 17.156-47.367 31.183-85.659 62.216-170.048 13.459-36.6 19.27-52.41 26.528-72.201 21.518-58.652 38.696-105.868 55.04-151.425 20.19-56.275 31.596-98.224 36.877-141.543 3.987-32.673-5.103-63.922-25.834-85.405-22.986-23.816-55.68-34.787-96.399-34.305-45.053.535-97.607 15.256-145.963 37.783Zm308.381-388.422c-80.963-31.5-178.114 22.616-194.382 108.33-11.795 62.124 11.412 115.76 58.78 138.225 93.898 44.531 206.587-26.823 206.592-130.826.005-57.855-24.705-97.718-70.99-115.729Z" fill-rule="evenodd"/></svg>
									</div>
									<div class="text"><?php echo esc_html( __( 'Info', 'talk-to-website' ) ); ?></div>
								</div>
                            </div>
                            <div class="ttw-tab" data-role="ttw-tab" data-tabid="settings">
								<div class="ttw-tab-head-inner-row">
									<div class="icon">
										<svg width="20px" height="20px" viewBox="0 0 192 192" xmlns="http://www.w3.org/2000/svg" fill="none"><path fill="#000000" d="m80.16 29.054-5.958-.709 5.958.71Zm31.68 0-5.958.71 5.958-.71Zm34.217 19.756-2.365-5.515 2.365 5.514Zm10.081 3.352 5.196-3-5.196 3Zm7.896 13.676 5.196-3-5.196 3Zm-2.137 10.407-3.594-4.805 3.594 4.805Zm0 39.51 3.593-4.805-3.593 4.805Zm2.137 10.407 5.196 3-5.196-3Zm-7.896 13.676-5.196-3 5.196 3Zm-10.081 3.353 2.364-5.515-2.364 5.515Zm-34.217 19.755 5.958.709-5.958-.709Zm-31.68 0-5.958.709 5.958-.709Zm-34.217-19.755-2.364-5.515 2.364 5.515Zm-10.08-3.353-5.197 3 5.196-3Zm-7.897-13.676 5.196-3-5.196 3Zm2.137-10.407 3.594 4.805-3.594-4.805Zm0-39.51L26.51 81.05l3.593-4.805Zm-2.137-10.407 5.196 3-5.196-3Zm7.896-13.676-5.196-3 5.196 3Zm10.081-3.352-2.364 5.514 2.364-5.514Zm7.85 3.365-2.365 5.515 2.364-5.515Zm0 87.65 2.364 5.514-2.365-5.514ZM36.235 111.17l-3.594-4.805 3.594 4.805Zm76.823 41.535 5.958.71-5.958-.71Zm39.854-69.742-3.593-4.805 3.593 4.805Zm-16.369-30.074 2.364 5.514-2.364-5.514Zm-23.485-13.594-5.958.709 5.958-.71ZM88.104 16a14 14 0 0 0-13.902 12.345l11.916 1.419A2 2 0 0 1 88.104 28V16Zm15.792 0H88.104v12h15.792V16Zm13.902 12.345A14 14 0 0 0 103.896 16v12a2 2 0 0 1 1.986 1.764l11.916-1.419Zm1.219 10.24-1.219-10.24-11.916 1.419 1.219 10.24 11.916-1.419Zm24.675 4.71-9.513 4.08 4.729 11.028 9.513-4.08-4.729-11.028Zm17.642 5.867a14 14 0 0 0-17.642-5.867l4.729 11.029a2 2 0 0 1 2.521.838l10.392-6Zm7.896 13.676-7.896-13.676-10.392 6 7.896 13.676 10.392-6Zm-3.74 18.212a14 14 0 0 0 3.74-18.212l-10.392 6a2 2 0 0 1-.535 2.602l7.187 9.61Zm-8.984 6.718 8.984-6.718-7.187-9.61-8.983 6.718 7.186 9.61Zm8.984 23.182-8.984-6.718-7.186 9.61 8.983 6.718 7.187-9.61Zm3.74 18.212a14 14 0 0 0-3.74-18.212l-7.187 9.61a2 2 0 0 1 .535 2.602l10.392 6Zm-7.896 13.676 7.896-13.676-10.392-6-7.896 13.676 10.392 6Zm-17.642 5.867a14 14 0 0 0 17.642-5.867l-10.392-6a2.001 2.001 0 0 1-2.521.838l-4.729 11.029Zm-9.513-4.08 9.513 4.08 4.729-11.029-9.512-4.079-4.73 11.028Zm-16.381 19.03 1.219-10.24-11.916-1.419-1.219 10.24 11.916 1.419ZM103.896 176a14 14 0 0 0 13.902-12.345l-11.916-1.419a2 2 0 0 1-1.986 1.764v12Zm-15.792 0h15.792v-12H88.104v12Zm-13.902-12.345A14 14 0 0 0 88.104 176v-12a2 2 0 0 1-1.986-1.764l-11.916 1.419Zm-1.012-8.504 1.012 8.504 11.916-1.419-1.012-8.504-11.916 1.419ZM51.428 134.31l-7.85 3.366 4.73 11.029 7.849-3.366-4.73-11.029Zm-7.85 3.366a2 2 0 0 1-2.52-.838l-10.392 6a14 14 0 0 0 17.642 5.867l-4.73-11.029Zm-2.52-.838-7.896-13.676-10.392 6 7.896 13.676 10.392-6Zm-7.896-13.676a2 2 0 0 1 .535-2.602l-7.187-9.61a14 14 0 0 0-3.74 18.212l10.392-6Zm.535-2.602 6.132-4.585-7.187-9.61-6.132 4.585 7.187 9.61ZM26.51 81.05l6.132 4.586 7.187-9.61-6.132-4.586-7.187 9.61Zm-3.74-18.212a14 14 0 0 0 3.74 18.212l7.187-9.61a2 2 0 0 1-.535-2.602l-10.392-6Zm7.896-13.676L22.77 62.838l10.392 6 7.896-13.676-10.392-6Zm17.642-5.867a14 14 0 0 0-17.642 5.867l10.392 6a2 2 0 0 1 2.52-.838l4.73-11.029Zm7.849 3.366-7.85-3.366-4.729 11.029 7.85 3.366 4.729-11.029Zm18.045-18.316-1.012 8.504 11.916 1.419 1.012-8.504-11.916-1.419Zm-1.754 27.552c6.078-3.426 11.69-9.502 12.658-17.63L73.19 36.85c-.382 3.209-2.769 6.415-6.635 8.595l5.893 10.453Zm-21.02 1.793c7.284 3.124 15.055 1.57 21.02-1.793l-5.893-10.453c-3.704 2.088-7.481 2.468-10.398 1.217l-4.73 11.029ZM49 96c0-7.1-2.548-15.022-9.171-19.975l-7.187 9.61C35.36 87.668 37 91.438 37 96h12Zm23.448 40.103c-5.965-3.363-13.736-4.917-21.02-1.793l4.729 11.029c2.917-1.251 6.694-.871 10.398 1.218l5.893-10.454Zm-32.62-20.128C46.452 111.022 49 103.1 49 96H37c0 4.563-1.64 8.333-4.358 10.365l7.187 9.61Zm78.679 19.575c-5.536 3.298-10.517 8.982-11.406 16.446l11.916 1.419c.329-2.765 2.318-5.582 5.632-7.557l-6.142-10.308Zm20.402-1.953c-7.094-3.042-14.669-1.463-20.402 1.953l6.142 10.308c3.382-2.015 6.872-2.372 9.53-1.233l4.73-11.028Zm-53.803 20.135c-.968-8.127-6.58-14.202-12.658-17.629l-5.893 10.454c3.866 2.179 6.253 5.385 6.635 8.594l11.916-1.419ZM141 96c0 6.389 2.398 13.414 8.32 17.842l7.186-9.61C154.374 102.638 153 99.668 153 96h-12Zm8.32-17.842C143.398 82.586 141 89.61 141 96h12c0-3.668 1.374-6.638 3.506-8.232l-7.186-9.61ZM118.507 56.45c5.733 3.416 13.308 4.995 20.401 1.953l-4.729-11.029c-2.658 1.14-6.148.782-9.53-1.233l-6.142 10.31Zm-11.406-16.446c.889 7.464 5.87 13.148 11.406 16.446l6.142-10.309c-3.314-1.974-5.303-4.79-5.632-7.556l-11.916 1.419Z"/><path stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="12" d="M96 120c13.255 0 24-10.745 24-24s-10.745-24-24-24-24 10.745-24 24 10.745 24 24 24Z"/></svg>
									</div>
									<div class="text"><?php echo esc_html( __( 'Settings', 'talk-to-website' ) ); ?></div>
								</div>
                            </div>
                            <div class="ttw-tab" data-role="ttw-tab" data-tabid="training">
								<div class="ttw-tab-head-inner-row">
									<div class="icon">
										<svg width="20px" height="20px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="#000000"><path d="M4.626 8.878a7.937 7.937 0 0 1 1.71-2.541 7.92 7.92 0 0 1 2.542-1.71 8.12 8.12 0 0 1 6.13-.041A2.49 2.49 0 0 0 17.5 7C18.886 7 20 5.886 20 4.5S18.886 2 17.5 2c-.689 0-1.312.276-1.763.725-2.431-.973-5.223-.958-7.635.059-1.19.5-2.26 1.22-3.18 2.139A9.98 9.98 0 0 0 2 12h2c0-1.086.211-2.136.626-3.122zm14.747 6.244c-.401.952-.977 1.808-1.71 2.541s-1.589 1.309-2.542 1.71a8.12 8.12 0 0 1-6.13.041A2.488 2.488 0 0 0 6.5 17C5.114 17 4 18.114 4 19.5S5.114 22 6.5 22c.689 0 1.312-.276 1.763-.725A9.973 9.973 0 0 0 12 22a9.983 9.983 0 0 0 9.217-6.102A9.992 9.992 0 0 0 22 12h-2a7.993 7.993 0 0 1-.627 3.122z"/><path d="M12 7.462c-2.502 0-4.538 2.036-4.538 4.538S9.498 16.538 12 16.538c2.502 0 4.538-2.036 4.538-4.538S14.502 7.462 12 7.462z"/></svg>
									</div>
									<div class="text"><?php echo esc_html( __( 'Training', 'talk-to-website' ) ); ?></div>
								</div>
                            </div>
                            <div class="ttw-tab" data-role="ttw-tab" data-tabid="testing">
								<div class="ttw-tab-head-inner-row">
									<div class="icon">
										<svg width="20px" height="20px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 13.5997 2.37562 15.1116 3.04346 16.4525C3.22094 16.8088 3.28001 17.2161 3.17712 17.6006L2.58151 19.8267C2.32295 20.793 3.20701 21.677 4.17335 21.4185L6.39939 20.8229C6.78393 20.72 7.19121 20.7791 7.54753 20.9565C8.88837 21.6244 10.4003 22 12 22Z" stroke="#1C274C" stroke-width="1.5"/><path d="M10.0286 14.9426L9.54259 15.5139L10.0286 14.9426ZM12 9.50069L11.4641 10.0254C11.6052 10.1695 11.7983 10.2507 12 10.2507C12.2017 10.2507 12.3948 10.1695 12.5359 10.0254L12 9.50069ZM13.9714 14.9426L13.4855 14.3714L13.9714 14.9426ZM12 15.9939L12 15.2439H12L12 15.9939ZM10.5145 14.3714C9.93292 13.8766 9.34909 13.3035 8.91635 12.7109C8.47476 12.1061 8.25 11.562 8.25 11.1093H6.75C6.75 12.025 7.18465 12.8829 7.70492 13.5955C8.23403 14.3201 8.91448 14.9795 9.54259 15.5139L10.5145 14.3714ZM8.25 11.1093C8.25 10.0016 8.74454 9.41826 9.25333 9.22801C9.77052 9.03463 10.5951 9.13785 11.4641 10.0254L12.5359 8.97598C11.38 7.79544 9.95456 7.36438 8.72797 7.82302C7.49299 8.28481 6.75 9.53986 6.75 11.1093H8.25ZM14.4574 15.5139C15.0855 14.9795 15.766 14.3201 16.2951 13.5955C16.8154 12.8829 17.25 12.025 17.25 11.1093H15.75C15.75 11.562 15.5252 12.1062 15.0837 12.7109C14.6509 13.3036 14.0671 13.8766 13.4855 14.3714L14.4574 15.5139ZM17.25 11.1093C17.25 9.53985 16.507 8.2848 15.272 7.82302C14.0454 7.36438 12.62 7.79544 11.4641 8.97598L12.5359 10.0254C13.4049 9.13785 14.2295 9.03463 14.7467 9.22801C15.2555 9.41826 15.75 10.0016 15.75 11.1093H17.25ZM9.54259 15.5139C10.3221 16.177 10.9428 16.7439 12 16.7439L12 15.2439C11.586 15.2439 11.3828 15.11 10.5145 14.3714L9.54259 15.5139ZM13.4855 14.3714C12.6172 15.11 12.414 15.2439 12 15.2439L12 16.7439C13.0572 16.7439 13.6779 16.177 14.4574 15.5139L13.4855 14.3714Z" fill="#1C274C"/></svg>
									</div>
									<div class="text"><?php echo esc_html( __( 'Test chat', 'talk-to-website' ) ); ?></div>
								</div>
                            </div>
                            <div class="ttw-tab" data-role="ttw-tab" data-tabid="dialogues">
								<div class="ttw-tab-head-inner-row">
									<div class="icon">
										<svg width="20px" height="20px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 13.5997 2.37562 15.1116 3.04346 16.4525C3.22094 16.8088 3.28001 17.2161 3.17712 17.6006L2.58151 19.8267C2.32295 20.793 3.20701 21.677 4.17335 21.4185L6.39939 20.8229C6.78393 20.72 7.19121 20.7791 7.54753 20.9565C8.88837 21.6244 10.4003 22 12 22Z" stroke="#1C274C" stroke-width="1.5"/><path d="M8 10.5H16" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"/><path d="M8 14H13.5" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"/></svg>
										</div>
									<div class="text"><?php echo esc_html( __( 'Dialogues', 'talk-to-website' ) ); ?></div>
								</div>
                            </div> 
                            <div class="ttw-tab" data-role="ttw-tab" data-tabid="logs">
								<div class="ttw-tab-head-inner-row">
									<div class="icon">
										<svg width="20px" height="20px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M8 8H16M8 12H16M10 16H14M3.5 12C3.5 5.5 5.5 3.5 12 3.5C18.5 3.5 20.5 5.5 20.5 12C20.5 18.5 18.5 20.5 12 20.5C5.5 20.5 3.5 18.5 3.5 12Z" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
									</div>
									<div class="text"><?php echo esc_html( __( 'Logs', 'talk-to-website' ) ); ?></div>
								</div>
                            </div> 
                        </div>
                        <div class="ttw-tabs-content" id="ttw-tabs-content">
                            <div class="ttw-tab-content ttw-tab-content-first" data-role="ttw-tab-content" data-level="1" data-tabid="info">
                                <div class="tab-content-inner">
                                    <h2 class="ttw-settings-block-header"><?php echo esc_html( __( 'Welcome to WP GPT "Talk To Website" AI assistant!', 'talk-to-website' ) ); ?></h2>
									<div>
										<p class="ttw-plugin-intro-paragraph">
											<b><?php echo esc_html( __( 'This plugin is an online chat bot (AI assistant) that will be shown on all pages of your website.', 'talk-to-website' ) ); ?></b>
											<?php echo esc_html( __( 'The chatbot looks like a floating round cloud in the bottom right corner of your website pages. When you click on this cloud, a chat window opens.', 'talk-to-website' ) ); ?>
										</p>
										<p class="ttw-plugin-intro-paragraph">
											<b><?php echo esc_html( __( 'Website visitors will be able to chat with the AI assistant as if it were a live person who knows your website well.', 'talk-to-website' ) ); ?></b>
											<?php echo esc_html( __( 'Visitors will be able to ask it questions about your website content, as well as general questions. The assistant can answer questions directly, or return links to pages on your website.', 'talk-to-website' ) ); ?>
										</p>
										<p class="ttw-plugin-intro-paragraph">
											<b><?php echo esc_html( __( 'The plugin works using the OpenAI API. Payment for using API is not included in the price of the plugin.', 'talk-to-website' ) ); ?></b>
											<?php echo esc_html( __( 'You need to register on the OpenAI (Platform) website,', 'talk-to-website' ) ); ?> URL = <a href="https://platform.openai.com/" target="_blank">https://platform.openai.com/</a> ;
											<?php echo esc_html( __( 'Then, deposit your balance and get the API key. Don\'t worry - all this is very simple - when you go to the "Settings" tab you will find all the necessary information. We assure you that the whole setup will take ~15 minutes.', 'talk-to-website' ) ); ?>
										</p class="ttw-plugin-intro-paragraph">
										<p class="ttw-plugin-intro-paragraph" style="margin-bottom: 0;">
											<b><?php echo esc_html( __( 'For the plugin to work properly, it needs to be trained on the content of your website.', 'talk-to-website' ) ); ?></b>
											<?php echo esc_html( __( 'The plugin will send all articles from your website one-by-one to OpenAI (using a special format) and ask it to study them. Once the training is complete, ChatGPT from OpenAI will understand your website perfectly, and will communicate taking into account the context of the information from articles.', 'talk-to-website' ) ); ?>
										</p>
									</div>
									<div id="ttw-firstpage-setup-the-plugin-helping-button" class="ttw-firstpage-setup-the-plugin-helping-button" <?php if ( true === $is_openai_key_set ) { echo 'style="display: none;"'; } ?>>
										<b class="ttw-ready-to-go-first-page-label"><?php echo esc_html( __( 'Ready to go? Just click on the "Setup the settings" button!', 'talk-to-website' ) ); ?></b>
										<br /><br />
										<div class="ttw-buttons-bar">
											<div class="ttw-button ttw-green-button" id="ttw-setup-the-plugin"><?php echo esc_html( __( 'Setup the settings', 'talk-to-website' ) ); ?></div>
											<a class="ttw-button" id="ttw-view-readme-button" href="<?php echo esc_url( __( 'https://talktowebsite.com/plugin-usage-guide/?utm_source=plugin', 'talk-to-website' ) ); ?>" target="_blank"><?php echo esc_html( __( 'View starter guide (Readme)', 'talk-to-website' ) ); ?></a>
										</div>
									</div>
									<div class="ttw-need-help-bottom-area" id="ttw-need-help-bottom-area" <?php if ( false === $is_openai_key_set ) { echo 'style="display: none;"'; } ?>>
										<span class="dashicons dashicons-editor-help"></span>
										<span><?php echo esc_html( __( 'Need help? Check out our', 'talk-to-website' ) ); ?> <a href="<?php echo esc_url( __( 'https://talktowebsite.com/plugin-usage-guide/?utm_source=plugin', 'talk-to-website' ) ); ?>" target="_blank"><?php echo esc_html( __( 'starter guide (readme)', 'talk-to-website' ) ); ?></a> <?php echo esc_html( __( 'or', 'talk-to-website' ) ); ?> <a href="<?php echo esc_url( __( 'https://talktowebsite.com/contact/?utm_source=plugin', 'talk-to-website' ) ); ?>" target="_blank"><?php echo esc_html( __( 'contact support', 'talk-to-website' ) ); ?></a>.</span>
									</div>
                                </div>
                            </div>
                            <div class="ttw-tab-content" style="display: none;" data-role="ttw-tab-content" data-level="1" data-tabid="settings">
                                <div class="tab-content-inner">
									<div class="ttw-settings-subtabs ttw-subtabs-headings ttw-tabs-headings" id="ttw-settings-tabs-headings">
										<div class="ttw-tab ttw-training-tab ttw-active" data-role="ttw-tab" data-tabid="chatgpt-connection-block">
											<div class="ttw-training-tab-inner-row">
												<div class="text"><?php echo esc_html( __( 'OpenAI API', 'talk-to-website' ) ); ?></div>
											</div>
										</div>
										<div class="ttw-tab ttw-training-tab" data-role="ttw-tab" data-tabid="settings-chatgpt-details" <?php if ( false === $is_openai_key_set ) { echo 'style="display: none;"'; } ?>>
											<div class="ttw-training-tab-inner-row">
												<div class="text"><?php echo esc_html( __( 'AI params', 'talk-to-website' ) ); ?></div>
											</div>
										</div>
										<div class="ttw-tab ttw-training-tab" data-role="ttw-tab" data-tabid="settings-contacts" <?php if ( false === $is_openai_key_set ) { echo 'style="display: none;"'; } ?>>
											<div class="ttw-training-tab-inner-row">
												<div class="text"><?php echo esc_html( __( 'Contacts', 'talk-to-website' ) ); ?></div>
											</div>
										</div>
										<div class="ttw-tab ttw-training-tab" data-role="ttw-tab" data-tabid="settings-limits" <?php if ( false === $is_openai_key_set ) { echo 'style="display: none;"'; } ?>>
											<div class="ttw-training-tab-inner-row">
												<div class="text"><?php echo esc_html( __( 'Limits', 'talk-to-website' ) ); ?></div>
											</div>
										</div>
										<div class="ttw-tab ttw-training-tab" data-role="ttw-tab" data-tabid="settings-appearance" <?php if ( false === $is_openai_key_set ) { echo 'style="display: none;"'; } ?>>
											<div class="ttw-training-tab-inner-row">
												<div class="text"><?php echo esc_html( __( 'Appearance', 'talk-to-website' ) ); ?></div>
											</div>
										</div>
										<div class="ttw-tab ttw-training-tab" data-role="ttw-tab" data-tabid="settings-other" <?php if ( false === $is_openai_key_set ) { echo 'style="display: none;"'; } ?>>
											<div class="ttw-training-tab-inner-row">
												<div class="text"><?php echo esc_html( __( 'Other', 'talk-to-website' ) ); ?></div>
											</div>
										</div>
									</div>
									<div class="ttw-tabs-content" id="ttw-settings-tabs-content">
										<div class="ttw-settings-section ttw-tab-content chatgpt-connection-block" data-role="ttw-settings-section" data-tabid="chatgpt-connection-block" id="chatgpt-connection-block">
											<div class="ttw-openai-connetion-explanation">
												<p>
													<b><?php echo esc_html( __( 'For the plugin to work properly, it requires a connection to ChatGPT (OpenAI).', 'talk-to-website' ) ); ?></b>
													<br />
													<?php echo esc_html( __( 'You need to do the following', 'talk-to-website' ) ); ?>:
													<br />
													<?php echo esc_html( __( '(1) Register on the OpenAI platform. URL = ', 'talk-to-website' ) ); ?>
													<a href="<?php echo esc_url( __( 'https://platform.openai.com/', 'talk-to-website' ) ) ?>" target="_blank"><?php echo esc_url( __( 'https://platform.openai.com/', 'talk-to-website' ) ); ?></a>
													<br />
													<?php echo esc_html( __( '(2) Create an API key and copy it in the field below. URL = ', 'talk-to-website' ) ); ?>
													<a href="<?php echo esc_url( __( 'https://platform.openai.com/api-keys', 'talk-to-website' ) ); ?>" target="_blank"><?php echo esc_url( __( 'https://platform.openai.com/api-keys', 'talk-to-website' ) ); ?></a>
													<br />
													<?php echo esc_html( __( '(3) Deposit your API billing balance by $5-10. URL = ', 'talk-to-website' ) ); ?>
													<a href="<?php echo esc_url( __( 'https://platform.openai.com/account/billing/overview', 'talk-to-website' ) ); ?>" target="_blank"><?php echo esc_url( __( 'https://platform.openai.com/account/billing/overview', 'talk-to-website' ) ); ?></a>
													<br />
													<?php echo esc_html( __( '(4) Test the API connection (press "Test and save API key" button)', 'talk-to-website' ) ); ?>
												</p>
											</div>
											<div class="ttw-settings-block ttw-settings-api-key-block">
												<?php
													$openai_api_address = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_openai_api_address );
													if ( '' === $openai_api_address ) {
														$openai_api_address = VAPPV_TTW_Settings::$settings_openai_api_address__default;
													}
												?>
												<div class="ttw-settings-label"><label for="ttw-settings-openai-api-address"><span class="dashicons dashicons-admin-plugins"></span> <?php echo esc_html( __( 'OpenAI API address:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'You can manually specify the OpenAI API address in this field. Why might this be necessary? Because in some countries it is blocked (either by OpenAI policy or by the countries themselves). There are sites for proxying requests, repeating the API functionality "exactly the same" but with a different address. Either the OpenAI API address (by default) or the API address of the request proxy server should be entered in this field. If you don\'t understand what this paragraph is about, we strongly recommend leaving the default value.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input"><input type="text" id="ttw-settings-openai-api-address" name="ttw-settings-openai-api-address" autocomplete="off" value="<?php echo esc_url( $openai_api_address ); ?>" /></div>
											</div>
											<div class="ttw-settings-block ttw-settings-api-key-block">
												<?php
													$openai_api_key = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_openai_api_key );
												?>
												<div class="ttw-settings-label"><label for="ttw-settings-chatgpt-api-key"><span class="dashicons dashicons-admin-network"></span> <?php echo esc_html( __( 'Your OpenAI API key:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-input"><input type="text" id="ttw-settings-chatgpt-api-key" name="ttw-settings-chatgpt-api-key" autocomplete="off" value="<?php echo esc_attr( $openai_api_key ); ?>" /></div>
											</div>
											<div class="ttw-buttons-bar">
												<div class="ttw-button ttw-green-button" id="ttw-save-chatgpt-api-key-and-test-connection"><?php echo esc_html( __( 'Test and save API key', 'talk-to-website' ) ); ?></div>
											</div>
										</div>
										<div class="ttw-settings-section ttw-tab-content" data-role="ttw-settings-section" data-tabid="settings-chatgpt-details" style="display: none;">
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-chatgpt-model"><span class="dashicons dashicons-welcome-learn-more"></span> <?php echo esc_html( __( 'ChatGPT model:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'ChatGPT has several different language models. Each model has a "context" parameter - 4k, 8k, 16k and so on. The bigger this parameter is - the more information ChatGPT can "memorize", and the more correct answers it will give for your site. Also, the more this parameter is, the more expensive will be the training and answers to questions on your site.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$selected_gpt_model = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_chatgpt_model );
													?>
													<select id="ttw-settings-chatgpt-model" name="ttw-settings-chatgpt-model">
														<?php
															$chatgpt_models_text_string = '';
															foreach ( VAPPV_TTW_Settings::$chatgpt_available_models as $ModelNr => $ModelData ) {
														?>
																<option value="<?php echo esc_attr( $ModelData['Name'] ); ?>" <?php if ( $ModelData['Name'] === $selected_gpt_model ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_attr( $ModelData['Description'] ); ?></option>
														<?php
																$chatgpt_models_text_string .= $ModelData['Name'].";";
															}
														?>
													</select>
													<input type="hidden" id="ttw-settings-chatgpt-available-models" value="<?php echo esc_attr( $chatgpt_models_text_string ); ?>" />
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label><span class="dashicons dashicons-businessman"></span> <?php echo esc_html( __( 'AI character and behavioral model:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'You can choose one of the AI characters. This will determine the model of behavior, the style of communication with visitors, and the variability of responses. Each model is unique in its own way, and will be suitable for certain types of sites. We have more creative, and more rigorous models - choose the one that best suits your business.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<div class="ttw-ai-characters-area" id="ttw-ai-characters-area">
														<?php

														//Get current AI character
														$settings_ai_character = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_ai_character );

														//Define character name and parameters (descriptions)
														$character_names_and_params = array(
															'justaguy' => array(
																'name' => __( 'Just a guy', 'talk-to-website' ),
																'desc' => __( 'Standard AI character. A friendly robot who is happy to help and answer users\' questions. A bit modest, but very nice and helpful. His job is to be a friend, and a good counselor.', 'talk-to-website' )
															),
															'businessman' => array(
																'name' => __( 'Businessman', 'talk-to-website' ),
																'desc' => __( 'A tough businessman, a company owner. His task is serious business, large deals, and important meetings. He prefers to make deals, and talk serious topics. Money is his credo.', 'talk-to-website' )
															),
															'creator' => array(
																'name' => __( 'Creative person', 'talk-to-website' ),
																'desc' => __( 'A finely sensitive, creative and curious nature. This character is perfect for projects that require creativity and originality. Don\'t forget to increase the temperature parameter!', 'talk-to-website' )
															)
														);

														//Draw characters picker
														foreach ( VAPPV_TTW_Settings::$ttw_available_ai_characters as $CharacterCode => $CharacterParameters ) {

															$character_image_url = VAPPV_TTW_PLUGIN_URL . 'admin/img/' . $CharacterParameters['img'];
															$character_params = $character_names_and_params[ $CharacterCode ];
															$is_checked = ( $settings_ai_character === $CharacterCode );

															?>
																<div class="ttw-ai-character-type-selector">
																	<div class="ttw-ai-character-image"><img src="<?php echo esc_url( $character_image_url ); ?>" alt="<?php echo esc_html( __( 'AI character', 'talk-to-website' ) ); ?>" /></div>
																	<div class="ttw-ai-character-name-and-description">
																		<div class="ttw-ai-character-name"><?php echo esc_html( $character_params['name'] ); ?></div>
																		<div class="ttw-ai-character-description"><?php echo esc_html( $character_params['desc'] ); ?></div>
																	</div>
																	<div class="ttw-ai-character-option-container">
																		<div class="ttw-button <?php if ( true === $is_checked ) { echo esc_attr( 'ttw-green-button' ); } ?> ttw-button-mini ttw-ai-character-picker-button" data-role="ttw-ai-character-picker-button">
																			<input type="radio" class="ttw-ai-character-selector-input" name="ttw-ai-character-selector-input" value="<?php echo esc_attr( $CharacterCode ); ?>" <?php if ( true === $is_checked ) { echo 'checked="checked"'; } ?> />
																			<span class="ttw-ai-character-select-label" <?php if ( true === $is_checked ) { echo 'style="display: none;"'; } ?>><?php echo esc_html( __( 'Select', 'talk-to-website' ) ); ?></span>
																			<span class="ttw-ai-character-selected-label" <?php if ( false === $is_checked ) { echo 'style="display: none;"'; } ?>><?php echo esc_html( __( 'Selected', 'talk-to-website' ) ); ?></span>
																		</div>
																	</div>
																</div>
															<?php
														}

														?>
													</div>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-chatgpt-temperature"><span class="dashicons dashicons-performance"></span> <?php echo esc_html( __( 'ChatGPT temperature:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Lower values for temperature result in more consistent outputs (e.g. 0.2), while higher values generate more diverse and creative results (e.g. 1.0). Select a temperature value based on the desired trade-off between coherence and creativity for your specific application. The temperature can range is from 0 to 1.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$chatgpt_current_temperature = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_chatgpt_temperature );
														$chatgpt_current_temperature = str_replace( ',', '.', $chatgpt_current_temperature );
													?>
													<input type="range" id="ttw-settings-chatgpt-temperature" name="ttw-settings-chatgpt-temperature" min="0.1" max="1" step="0.1" list="ttw-chatgpt-temperature-datalist" value="<?php echo esc_attr( $chatgpt_current_temperature ); ?>" />
													<datalist id="ttw-chatgpt-temperature-datalist">
														<option value="0.1" label="0.1"></option>
														<option value="0.2" label="0.2"></option>
														<option value="0.3" label="0.3"></option>
														<option value="0.4" label="0.4"></option>
														<option value="0.5" label="0.5"></option>
														<option value="0.6" label="0.6"></option>
														<option value="0.7" label="0.7"></option>
														<option value="0.8" label="0.8"></option>
														<option value="0.9" label="0.9"></option>
														<option value="1" label="1"></option>
													</datalist>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-primary-language"><span class="dashicons dashicons-translation"></span> <?php echo esc_html( __( 'Primary language of communication:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php esc_html( __( 'Select the language in which the robot will give preferred answers to users. The default language is English, but if you select another language, the robot will try to communicate in that language.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$primary_talk_selected_language = $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_primary_language );
														if ( false === $primary_talk_selected_language || is_null( $primary_talk_selected_language ) || '' === $primary_talk_selected_language ) {
															$primary_talk_selected_language = 'English (United States)';
														}
													?>
													<select id="ttw-settings-primary-language" name="ttw-settings-primary-language">
														<?php
															foreach ( VAPPV_TTW_Settings::$ttw_available_languages as $LanguageNr => $LanguageName ) {
														?>
																<option value="<?php echo esc_attr( $LanguageName ); ?>" <?php if ( $LanguageName === $primary_talk_selected_language ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_attr( $LanguageName ); ?></option>
														<?php
															}
														?>
													</select>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-humor-level"><span class="dashicons dashicons-smiley"></span> <?php echo esc_html( __( 'Humor level:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'The level of jokes the robot will use. This information will characterize the degree of humor on a scale from 0 to 100%, where 0 is the minimum humor and 100% is the maximum humor. Be prepared that if the humor level is greater than 50%, the robot may be a bit rude (at its own discretion).', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$robot_humor_level = $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_humor_level );
														if ( false === $robot_humor_level || is_null( $robot_humor_level ) || '' === $robot_humor_level ) {
															$robot_humor_level = 30;
														}
													?>
													<select id="ttw-settings-humor-level" name="ttw-settings-humor-level">
														<?php
															foreach ( VAPPV_TTW_Settings::$ttw_available_humor_levels as $HumorLevel => $HumorLevelDescription ) {
														?>
																<option value="<?php echo esc_attr( $HumorLevel ); ?>" <?php if ( $HumorLevel === $robot_humor_level ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_attr( $HumorLevelDescription ); ?></option>
														<?php
															}
														?>
													</select>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-direct-instructions"><span class="dashicons dashicons-editor-paste-text"></span> <?php echo esc_html( __( 'Additional instructions to robot:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Please write in free format additional instructions on how to communicate with the site visitor. This can be any arbitrary text, as well as links to sections of the website.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<textarea id="ttw-settings-direct-instructions" name="ttw-settings-direct-instructions" placeholder="<?php echo esc_attr( __( 'Please talk to the clients like THIS and like THIS. Be patient and smart.', 'talk-to-website' ) ); ?>" style="height: 200px; resize: vertical;"><?php echo esc_textarea( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_any_direct_instructions ) ); ?></textarea>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-prohibited-topics-and-words"><span class="dashicons dashicons-shield"></span> <?php echo esc_html( __( 'Prohibited topics and words:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'You can prevent the robot from talking about specific topics, or mentioning specific words. The robot will avoid dialogs around these subjects.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<textarea id="ttw-settings-prohibited-topics-and-words" name="ttw-settings-prohibited-topics-and-words" placeholder="<?php echo esc_attr( __( 'Please never discuss elephants, pandas or penguins. Also, please never discuss politics.', 'talk-to-website' ) ); ?>" style="height: 200px; resize: vertical;"><?php echo esc_textarea( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_prohibited_topics_and_words ) ); ?></textarea>
												</div>
											</div>
										</div>
										<div class="ttw-settings-section ttw-tab-content" data-role="ttw-settings-section" data-tabid="settings-contacts" style="display: none;">
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-website-contacts-company-email"><span class="dashicons dashicons-email"></span> <?php echo esc_html( __( 'Your contact Email(s):', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Please provide your company\'s contact Email(s) separated by comma', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<input type="text" id="ttw-settings-website-contacts-company-email" name="ttw-settings-website-contacts-company-email" value="<?php echo esc_attr( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_website_contacts_company_email ) ); ?>" />
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-website-contacts-page"><span class="dashicons dashicons-admin-site-alt3"></span> <?php echo esc_html( __( 'Website contacts page:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'A link to the Company Contact page. AI may, at its discretion, send this link to the user in response to their questions. Please provide a full link to the contact page here, for example: https://websitename.com/contacts', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<input type="text" id="ttw-settings-website-contacts-page" name="ttw-settings-website-contacts-page" placeholder="https://website.name/contacts" value="<?php echo esc_attr( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_website_contacts_page ) ); ?>" />
												</div>
											</div>
										</div>
										<div class="ttw-settings-section ttw-tab-content" data-role="ttw-settings-section" data-tabid="settings-limits" style="display: none;">
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-sugar-limits-summary"><span class="dashicons dashicons-welcome-learn-more"></span> <?php echo esc_html( __( 'Summary limits master:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Use the Limits master to adjust the cost of using the OpenAI API per day. Note that as you move the slider, the settings of different limits will automatically change. Also note that the listed cost is approximate, it will actually vary with different models and actual communication with users.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$settings_sugar_limits_summary = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_sugar_limits_summary );
													?>
													<input type="range" id="ttw-settings-sugar-limits-summary" name="ttw-settings-sugar-limits-summary" min="1" max="6" step="1" list="ttw-chatgpt-temperature-datalist" value="<?php echo esc_attr( $settings_sugar_limits_summary ); ?>" />
													<datalist id="ttw-chatgpt-temperature-datalist">
														<option value="1" label="[<?php echo esc_html( __( 'Custom', 'talk-to-website' ) ); ?>]"></option>
														<option value="2" label="<?php echo esc_html( __( 'Small ($0-$5/day)', 'talk-to-website' ) ); ?>"></option>
														<option value="3" label="<?php echo esc_html( __( 'Medium (Max. ~$15/day)', 'talk-to-website' ) ); ?>"></option>
														<option value="4" label="<?php echo esc_html( __( 'Large (Max. ~$50/day)', 'talk-to-website' ) ); ?>"></option>
														<option value="5" label="<?php echo esc_html( __( 'Extra (~$100+/day)', 'talk-to-website' ) ); ?>"></option>
														<option value="6" label="<?php echo esc_html( __( 'No limits', 'talk-to-website' ) ); ?>"></option>
													</datalist>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-dialogue-lifetime-minutes"><span class="dashicons dashicons-backup"></span> <?php echo esc_html( __( 'Dialogue lifetime, minutes:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'One communication session with one user is called a "dialogue". In ChatGPT, the same term means "Thread". Within one dialogue (thread), the current context of communication is saved, during which the robot remembers what it talked about with the user. The length of the dialogue in minutes is the time during which we will maintain communication with the user within one dialogue (thread). If the user leaves the website and returns within the stated time, he will again be taken to the same dialogue, with the history preserved. After the specified time has passed, the dialogue will be closed and the communication context will be reset. This setting also affects dialogues with the administrator. Set the setting to -1 to ignore time ranges, and work on the principle of "one user - one infinite dialog without restart".', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$settings_dialogue_lifetime_minutes = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_dialogue_lifetime_minutes );
													?>
													<input type="number" id="ttw-settings-dialogue-lifetime-minutes" name="ttw-settings-dialogue-lifetime-minutes" placeholder="<?php echo esc_attr( $settings_controller->try_get_default_setting_as_string( VAPPV_TTW_Settings::$settings_dialogue_lifetime_minutes ) ); ?>" value="<?php echo esc_attr( $settings_dialogue_lifetime_minutes ); ?>" />
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-dialogue-lifetime-max-messages"><span class="dashicons dashicons-backup"></span> <?php echo esc_html( __( 'Dialogue lifetime, messages count:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Similar to the "Dialogue lifetime, minutes" setting, you can adjust the number of messages from a user that will be within a "single track". The more messages there are within a track - the more it will cost to process each next message. The fewer messages there are within a track - the cheaper it will be to process each message, but the less "memory" the robot will have. A value of 50 means that the robot will remember your last 50 questions and its answers to them, and will take this into account for the next messages. -1 means no limits. It is not recommended to set the value more than 200 messages - in this case processing of each subsequent message will cost $0.2 or more.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$settings_dialogue_lifetime_max_messages = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_dialogue_lifetime_max_messages );
													?>
													<input type="number" id="ttw-settings-dialogue-lifetime-max-messages" name="ttw-settings-dialogue-lifetime-max-messages" placeholder="<?php echo esc_attr( $settings_controller->try_get_default_setting_as_string( VAPPV_TTW_Settings::$settings_dialogue_lifetime_max_messages ) ); ?>" value="<?php echo esc_attr( $settings_dialogue_lifetime_max_messages ); ?>" />
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-max-characters-per-user-question"><span class="dashicons dashicons-format-status"></span> <?php echo esc_html( __( 'Max characters per one user question:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'You can limit the length of messages from a user to a certain number of characters. The more characters you allow a user to enter in a single message, the higher the cost of processing such a message will be. We recommend using a limit in the range of 200-500 characters.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<input type="number" id="ttw-settings-max-characters-per-user-question" name="ttw-settings-max-characters-per-user-question" placeholder="<?php echo esc_attr( $settings_controller->try_get_default_setting_as_string( VAPPV_TTW_Settings::$settings_max_characters_per_user_question ) ); ?>" value="<?php echo esc_attr( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_max_characters_per_user_question ) ); ?>" />
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-max-words-to-answer"><span class="dashicons dashicons-editor-paragraph"></span> <?php echo esc_html( __( 'Max words to answer per 1 message:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'In the basic version, any AI is not limited by the length of responses. The longer the response, the more you will have to pay for it. You can limit the length of the response to a certain number of words - we will pass this information to LLM model with each request from a client. Please note that this setting may limit the quality of responses. For unlimited replies, use -1.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<input type="number" id="ttw-settings-max-words-to-answer" name="ttw-settings-max-words-to-answer" placeholder="<?php echo esc_attr( $settings_controller->try_get_default_setting_as_string( VAPPV_TTW_Settings::$settings_max_words_to_answer ) ); ?>" value="<?php echo esc_attr( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_max_words_to_answer ) ); ?>" />
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-max-input-words-per-day-by-all-users"><span class="dashicons dashicons-editor-paragraph"></span> <?php echo esc_html( __( 'Max input words per day, by all users:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'The daily limit of the number of incoming words from all users is a very important parameter. With its help, you can limit the total incoming flow of information from all users. This allows you to limit the maximum daily consumption of OpenAI API. Approximate cost of 10000 words per day = $2 - $4, depending on the AI model used. For unlimited replies, use -1.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<input type="number" id="ttw-settings-max-input-words-per-day-by-all-users" name="ttw-settings-max-input-words-per-day-by-all-users" placeholder="<?php echo esc_attr( $settings_controller->try_get_default_setting_as_string( VAPPV_TTW_Settings::$settings_max_input_words_per_day_by_all_users ) ); ?>" value="<?php echo esc_attr( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_max_input_words_per_day_by_all_users ) ); ?>" />
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-max-input-characters-per-day-by-all-users"><span class="dashicons dashicons-editor-spellcheck"></span> <?php echo esc_html( __( 'Max input characters per day, by all users:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Daily limit on the number of incoming characters from all users is an additional limit that allows you to control your expenses. With its help, you can limit the total incoming flow of information from all users. This allows you to limit the maximum daily consumption of OpenAI API. Approximate cost 50000 characters per day (5 characters per 1 word) = 10000 words per day = $2 - $4, depending on the AI model used. For unlimited replies, use -1.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<input type="number" id="ttw-settings-max-input-characters-per-day-by-all-users" name="ttw-settings-max-input-characters-per-day-by-all-users" placeholder="<?php echo esc_attr( $settings_controller->try_get_default_setting_as_string( VAPPV_TTW_Settings::$settings_max_input_characters_per_day_by_all_users ) ); ?>" value="<?php echo esc_attr( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_max_input_characters_per_day_by_all_users ) ); ?>" />
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-max-output-characters-per-day-by-ai"><span class="dashicons dashicons-editor-spellcheck"></span> <?php echo esc_html( __( 'Max output characters per day, by AI:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'This limit allows you to stop the plugin as soon as the AI responds in a day with the specified number of characters. The total number of responses that the AI has given to all visitors to the site is taken into account. Use -1 to ignore this limit.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<input type="number" id="ttw-settings-max-output-characters-per-day-by-ai" name="ttw-settings-max-output-characters-per-day-by-ai" placeholder="<?php echo esc_attr( $settings_controller->try_get_default_setting_as_string( VAPPV_TTW_Settings::$settings_max_output_characters_per_day_by_ai ) ); ?>" value="<?php echo esc_attr( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_max_output_characters_per_day_by_ai ) ); ?>" />
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-max-output-tokens-per-day-by-ai"><span class="dashicons dashicons-book"></span> <?php echo esc_html( __( 'Max output tokens per day, by AI:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Similar to the character limit, you can limit the AI to the number of tokens per day. When this number of tokens is reached, the plugin will be stopped and a beautiful sleeping robot will appear in the public chat cloud.. For unlimited replies, use -1.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<input type="number" id="ttw-settings-max-output-tokens-per-day-by-ai" name="ttw-settings-max-output-tokens-per-day-by-ai" placeholder="<?php echo esc_attr( $settings_controller->try_get_default_setting_as_string( VAPPV_TTW_Settings::$settings_max_output_tokens_per_day_by_ai ) ); ?>" value="<?php echo esc_attr( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_max_output_tokens_per_day_by_ai ) ); ?>" />
												</div>
											</div>
										</div>
										<div class="ttw-settings-section ttw-tab-content" data-role="ttw-settings-section" data-tabid="settings-appearance" style="display: none;">
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-robot-name"><span class="dashicons dashicons-businessman"></span> <?php echo esc_html( __( 'Robot chat name:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Please enter the robot\'s name. This is the name it will use when chatting with users.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<input type="text" id="ttw-settings-robot-name" name="ttw-settings-robot-name" placeholder="<?php echo esc_attr( $settings_controller->try_get_default_setting_as_string( VAPPV_TTW_Settings::$settings_chat_bot_name ) ); ?>" value="<?php echo esc_attr( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_chat_bot_name ) ); ?>" />
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-welcome-message-html"><span class="dashicons dashicons-info-outline"></span> <?php echo esc_html( __( 'Welcome message text:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'When a user enters the chat for the first time, the robot greets them with a standard message. You can customize your own message / greeting text here.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$welcome_message_html_default_value = __( 'Hi there! I am an AI smart robot. Please ask any question about the website!', 'talk-to-website' );
														$welcome_message_html_current_value = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_welcome_message_html );
														if ( '' === trim( $welcome_message_html_current_value ) ) {
															$welcome_message_html_current_value = $welcome_message_html_default_value;
														}
													?>
													<textarea id="ttw-settings-welcome-message-html" name="ttw-settings-welcome-message-html" placeholder="<?php echo esc_attr( __( 'Any welcome message', 'talk-to-website' ) ); ?>" style="height: 200px; resize: vertical;"><?php echo esc_textarea( $welcome_message_html_current_value ); ?></textarea>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-robot-messages-post-scriptum"><span class="dashicons dashicons-format-quote"></span> <?php echo esc_html( __( 'Post scriptum below the messages from the robot:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Specify any small text to be displayed below the messages from the robot. This is like a post-scriptum in an Email message. You can specify advertising information, or some useful link to a website page.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<textarea id="ttw-settings-robot-messages-post-scriptum" name="ttw-settings-robot-messages-post-scriptum" placeholder="<?php echo esc_attr( __( 'Sincerely, your robot. Purchase our products! Come back again! You are welcome!', 'talk-to-website' ) ); ?>" style="height: 200px; resize: vertical;"><?php echo esc_textarea( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_robot_messages_post_scriptum ) ); ?></textarea>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label><span class="dashicons dashicons-plugins-checked"></span> <?php echo esc_html( __( 'Appearance of a floating bubble:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'You can choose from a variety of floating bubble appearance options. We recommend using a bright appearance so that the user can realize that this is a clickable chat button.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<div class="ttw-chat-bubbles-types-area" id="ttw-chat-bubbles-types-area">
														<?php
															$settings_chat_bubble_image_url = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_chat_bubble_image_url );
															foreach ( VAPPV_TTW_Settings::$ttw_available_chat_bubbles_types as $SettingNr => $SettingImageUrl ) {

																$image_url = VAPPV_TTW_PLUGIN_URL . 'admin/img/' . $SettingImageUrl;
																$is_checked = ( false !== strpos( $image_url, $settings_chat_bubble_image_url ) );

																?>
																	<div class="ttw-chat-bubble-type-selector">
																		<div class="ttw-chat-bubble-image"><img src="<?php echo esc_url( $image_url ); ?>" alt="<?php echo esc_attr( __( 'Chat bubble variant', 'talk-to-website' ) ); ?>" /></div>
																		<div class="ttw-chat-bubble-option-container">
																			<div class="ttw-button <?php if ( true === $is_checked ) { echo esc_attr( 'ttw-green-button' ); } ?> ttw-button-mini ttw-bubble-picker-button" data-role="ttw-bubble-picker-button">
																				<input type="radio" class="ttw-chat-bubble-appearence-selector-input" name="ttw-chat-bubble-appearence-selector-input" value="<?php echo esc_attr( $image_url ); ?>" <?php if ( true === $is_checked ) { echo 'checked="checked"'; } ?> />
																				<span class="ttw-bubble-select-label" <?php if ( true === $is_checked ) { echo 'style="display: none;"'; } ?>><?php echo esc_html( __( 'Select', 'talk-to-website' ) ); ?></span>
																				<span class="ttw-bubble-selected-label" <?php if ( false === $is_checked ) { echo 'style="display: none;"'; } ?>><?php echo esc_html( __( 'Selected', 'talk-to-website' ) ); ?></span>
																			</div>
																		</div>
																	</div>
																<?php
															}
														?>
													</div>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-chat-restricted-pages-urlmasks"><span class="dashicons dashicons-hidden"></span> <?php echo esc_html( __( 'Restrict the display of chat on specified pages of the site:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Specify a comma separated list of site pages (URL strings / URL masks) on which you do not want to show AI chat. Please use only page names without domain (URL strings / masks), for example: "page1, page2, page3, page4.php?a=b, page5/?abc=888, cde=735, page_id=999". Generally speaking, you can specify any URL substrings here, if they are found in the current URL, the chat will not be shown on the page.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<textarea id="ttw-settings-chat-restricted-pages-urlmasks" name="ttw-settings-chat-restricted-pages-urlmasks" placeholder="<?php echo esc_attr( __( 'A list of URL substrings separated with comma', 'talk-to-website' ) ); ?>" style="height: 200px; resize: vertical;"><?php echo esc_textarea( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_chat_restricted_pages_urlmasks ) ); ?></textarea>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-chat-bubble-ui-position"><span class="dashicons dashicons-align-wide"></span> <?php echo esc_html( __( 'Chat bubble UI position:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Please specify where on the public pages of the site the floating chat bubble should be located. Note that the bubble will only appear at this position on stationary devices. On mobile devices, it will always be at the bottom, in the center of the screen.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<select id="ttw-settings-chat-bubble-ui-position" name="ttw-settings-chat-bubble-ui-position">
														<?php
															$settings_chat_bubble_ui_position = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_chat_bubble_ui_position );
															if ( '' === $settings_chat_bubble_ui_position ) {
																$settings_chat_bubble_ui_position = VAPPV_TTW_Settings::$settings_chat_bubble_ui_position__default;
															}
															foreach ( VAPPV_TTW_Settings::$ttw_chat_bubble_ui_positions as $key => $value ) {
																?><option value="<?php echo esc_attr( $key ); ?>" <?php if ( $key === $settings_chat_bubble_ui_position ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_attr( $value ); ?></option><?php
															}
														?>
													</select>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-chat-bubble-ui-margin"><span class="dashicons dashicons-fullscreen-alt"></span> <?php echo esc_html( __( 'Indentation of the chat bubble from the screen border:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'Please specify the indentation in pixels from the screen border. This distance will be used to position the chat bubble on public pages of the site.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<input type="number" id="ttw-settings-chat-bubble-ui-margin" name="ttw-settings-chat-bubble-ui-margin" placeholder="<?php echo esc_attr( $settings_controller->try_get_default_setting_as_string( VAPPV_TTW_Settings::$settings_chat_bubble_ui_margin ) ); ?>" value="<?php echo esc_attr( $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_chat_bubble_ui_margin ) ); ?>" />
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-show-promo-popup-after-n-seconds"><span class="dashicons dashicons-bell"></span> <?php echo esc_html( __( 'Show a popup with a promotional message if user inactive (after N seconds):', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'There are times when a user simply didn\'t notice the chatbot. In this case, we can remind him to talk to the website. This setting allows us to show a promo bubble with a friendly reminder. It will be a small cloud with a waving hand inside.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$settings_show_promo_popup_after_n_seconds = $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_show_promo_popup_after_n_seconds );
													?>
													<select id="ttw-settings-show-promo-popup-after-n-seconds" name="ttw-settings-show-promo-popup-after-n-seconds">
														<option value="-1" <?php if ( -1 === $settings_show_promo_popup_after_n_seconds ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Don\'t show promo popup', 'talk-to-website' ) ); ?></option>
														<option value="10" <?php if ( 10 === $settings_show_promo_popup_after_n_seconds ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Show popup after 10 seconds after page loaded', 'talk-to-website' ) ); ?></option>
														<option value="15" <?php if ( 15 === $settings_show_promo_popup_after_n_seconds ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Show popup after 15 seconds after page loaded', 'talk-to-website' ) ); ?></option>
														<option value="30" <?php if ( 30 === $settings_show_promo_popup_after_n_seconds ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Show popup after 30 seconds after page loaded', 'talk-to-website' ) ); ?></option>
														<option value="60" <?php if ( 60 === $settings_show_promo_popup_after_n_seconds ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Show popup after 60 seconds after page loaded', 'talk-to-website' ) ); ?></option>
														<option value="90" <?php if ( 90 === $settings_show_promo_popup_after_n_seconds ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Show popup after 90 seconds after page loaded', 'talk-to-website' ) ); ?></option>
														<option value="120" <?php if ( 120 === $settings_show_promo_popup_after_n_seconds ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Show popup after 120 seconds after page loaded', 'talk-to-website' ) ); ?></option>
													</select>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-show-promo-popup-time-frequency-n-minutes"><span class="dashicons dashicons-bell"></span> <?php echo esc_html( __( 'Promo popup, display frequency in minutes:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'You can customize the promo popup so that it is displayed no more often than once every a certain number of minutes. For example, if you set the value to 1440 (24 hours), then when the user closes the popup, the next time it will be displayed only after 24 hours. A value of -1 to never show the popup again after closing it.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$settings_show_promo_popup_time_frequency_n_minutes = $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_show_promo_popup_time_frequency_n_minutes );
													?>
													<select id="ttw-settings-show-promo-popup-time-frequency-n-minutes" name="ttw-settings-show-promo-popup-time-frequency-n-minutes">
														<option value="-1" <?php if ( -1 === $settings_show_promo_popup_time_frequency_n_minutes ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Don\'t show promo popup again (Show only once)', 'talk-to-website' ) ); ?></option>
														<option value="60" <?php if ( 60 === $settings_show_promo_popup_time_frequency_n_minutes ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Reshow in 1 hour', 'talk-to-website' ) ); ?></option>
														<option value="120" <?php if ( 120 === $settings_show_promo_popup_time_frequency_n_minutes ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Reshow in 2 hour', 'talk-to-website' ) ); ?></option>
														<option value="360" <?php if ( 360 === $settings_show_promo_popup_time_frequency_n_minutes ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Reshow in 6 hours', 'talk-to-website' ) ); ?></option>
														<option value="720" <?php if ( 720 === $settings_show_promo_popup_time_frequency_n_minutes ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Reshow in 12 hours', 'talk-to-website' ) ); ?></option>
														<option value="1440" <?php if ( 1440 === $settings_show_promo_popup_time_frequency_n_minutes ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Reshow in 1 days', 'talk-to-website' ) ); ?></option>
														<option value="2880" <?php if ( 2880 === $settings_show_promo_popup_time_frequency_n_minutes ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Reshow in 2 days', 'talk-to-website' ) ); ?></option>
														<option value="10080" <?php if ( 10080 === $settings_show_promo_popup_time_frequency_n_minutes ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Reshow in 7 days', 'talk-to-website' ) ); ?></option>
														<option value="20160" <?php if ( 20160 === $settings_show_promo_popup_time_frequency_n_minutes ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Reshow in 14 days', 'talk-to-website' ) ); ?></option>
														<option value="43200" <?php if ( 43200 === $settings_show_promo_popup_time_frequency_n_minutes ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Reshow in 30 days', 'talk-to-website' ) ); ?></option>
													</select>
												</div>
											</div>
										</div>
										<div class="ttw-settings-section ttw-tab-content" data-role="ttw-settings-section" data-tabid="settings-other" style="display: none;">
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-is-chatbot-displayed-right-now"><span class="dashicons dashicons-plugins-checked"></span> <?php echo esc_html( __( 'Is chat-bot displayed on the website right now:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'You can turn the chatbot on or off at different points in time as you see fit. By default, the bot will be enabled. When you turn off the chatbot, it stops working on the public part of the site (the floating chat bubble disappears from all pages).', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<select id="ttw-settings-is-chatbot-displayed-right-now" name="ttw-settings-is-chatbot-displayed-right-now">
														<option value="0" <?php if ( false === $settings_is_chatbot_displayed_right_now ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'No, the chatbot is not displayed and is not currently running', 'talk-to-website' ) ); ?></option>
														<option value="1" <?php if ( true === $settings_is_chatbot_displayed_right_now ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Yes, the chatbot is displayed and working right now', 'talk-to-website' ) ); ?></option>
													</select>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-show-powered-by-ttw-public-label"><span class="dashicons dashicons-awards"></span> <?php echo esc_html( __( 'Show "Powered by talktowebsite.com" public label:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'In the public window of the plugin (after the user has already clicked on the chat bubble), by default the inscription "Powered by talktowebsite.com" is displayed. From our point of view, this gives the appearance more trust from the site visitors. If necessary, you can hide this inscription using this setting.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$settings_show_powered_by_ttw_public_label = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_show_powered_by_ttw_public_label );
														if ( '' === $settings_show_powered_by_ttw_public_label ) {
															$settings_show_powered_by_ttw_public_label = 'no';
														}
													?>
													<select id="ttw-settings-show-powered-by-ttw-public-label" name="ttw-settings-show-powered-by-ttw-public-label">
														<option value="yes" <?php if ( 'yes' === $settings_show_powered_by_ttw_public_label ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Yes, show the label', 'talk-to-website' ) ); ?></option>
														<option value="no" <?php if ( 'no' === $settings_show_powered_by_ttw_public_label ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'No, don\'t show the label', 'talk-to-website' ) ); ?></option>
													</select>
												</div>
											</div>
											<div class="ttw-settings-block">
												<div class="ttw-settings-label"><label for="ttw-settings-store-db-on-deletion"><span class="dashicons dashicons-database-view"></span> <?php echo esc_html( __( 'Store plugin DB data on deletion / updating:', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'When deleting or updating the plugin, it is usually necessary to delete the corresponding tables from the database. But, as you understand it, this may not be the best idea - because our plugin stores the history of dialogs with users and your settings. So, we have a separate setting to prevent deleting tables when you delete or update the plugin. So, we recommend leaving this setting set to "Keep the plugin tables and data" and this will save all your plugin data.', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
													$settings_store_db_on_deletion = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_store_db_on_deletion );
													if ( '' === $settings_store_db_on_deletion ) {
														$settings_store_db_on_deletion = 'no';
													}
													?>
													<select id="ttw-settings-store-db-on-deletion" name="ttw-settings-store-db-on-deletion">
														<option value="yes" <?php if ( 'yes' === $settings_store_db_on_deletion ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Keep the plugin tables and data', 'talk-to-website' ) ); ?></option>
														<option value="no" <?php if ( 'no' === $settings_store_db_on_deletion ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Delete data with the plugin', 'talk-to-website' ) ); ?></option>
													</select>
												</div>
											</div>
										</div>
										<div style="display: none;" id="ttw-temporarily-unused-settings-area">
											<div class="ttw-settings-block" style="display: none;">
												<div class="ttw-settings-label"><label for="ttw-settings-try-intercept-leaving-users"><span class="dashicons dashicons-editor-contract"></span> <?php echo esc_html( __( 'Try catch user on exit (once):', 'talk-to-website' ) ); ?></label></div>
												<div class="ttw-settings-label-description">
													<?php echo esc_html( __( 'If you set this setting to Yes, the robot will attempt to intercept the user before closing the page. In this case, we\'ll show the user a nice modal window informing them that the website has an integrated AI that can help. If the user decides to leave the page anyway, we won\'t prevent them from doing so. Please note that the user interception is only triggered once for a user. If the user visits the website again, he/she will not see this message (ethical issues with users).', 'talk-to-website' ) ); ?>
												</div>
												<div class="ttw-settings-input">
													<?php
														$settings_try_intercept_leaving_users = $settings_controller->try_get_setting_as_string( VAPPV_TTW_Settings::$settings_try_intercept_leaving_users );
														if ( '' === $settings_try_intercept_leaving_users ) {
															$settings_try_intercept_leaving_users = '0';
														}
													?>
													<select id="ttw-settings-try-intercept-leaving-users" name="ttw-settings-try-intercept-leaving-users">
														<option value="0" <?php if ( '0' === $settings_try_intercept_leaving_users ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'No, just let users leave the website', 'talk-to-website' ) ); ?></option>
														<option value="1" <?php if ( '1' === $settings_try_intercept_leaving_users ) { echo esc_attr( 'selected' ); } ?>><?php echo esc_html( __( 'Try intercept leaving users', 'talk-to-website' ) ); ?></option>
													</select>
												</div>
											</div>
										</div>
									</div>
                                    <div class="ttw-buttons-bar" data-role="settings-save-buttons" <?php if ( false === $is_openai_key_set ) { echo 'style="display: none;"'; } ?>>
                                        <div class="ttw-button ttw-green-button" id="ttw-save-all-settings" style="display: none;"><?php echo esc_html( __( 'Save all settings', 'talk-to-website' ) ); ?></div>
										<!--div class="ttw-button" id="ttw-list-ai-models">List AI models</div-->
                                    </div>
                                </div>
                            </div>
                            <div class="ttw-tab-content" style="display: none;" data-role="ttw-tab-content" data-level="1" data-tabid="training">
                                <div class="tab-content-inner">
                                    <div class="ttw-settings-not-set" data-role="ttw-settings-not-set" <?php if ( true === $are_primary_settings_saved ) { echo 'style="display: none;"'; } ?>>
                                        <b><?php echo esc_html( __( 'Oops! Looks like you haven\'t set the settings yet', 'talk-to-website' ) ); ?> ⚙️</b>
                                        <br />
										<?php echo esc_html( __( 'Please set the settings in the "Settings" tab - then this section will be available.', 'talk-to-website' ) ); ?>
                                    </div>
                                    <div class="ttw-training-container" id="ttw-training-container" <?php if ( false === $are_primary_settings_saved ) { echo 'style="display: none;"'; } ?>>
										<div class="ttw-settings-label-description ttw-training-tab-description">
										   <?php echo esc_html( __( 'Please train the robot on materials from your website. To do this, select the materials you want to send to the AI model via API. In the future you can retrain the AI model, add new materials or delete some already sent materials.', 'talk-to-website' ) ); ?>
										</div>
                                        <?php 
                                            //Get current assistant data (if already trained, and draw notification block)
                                            //Then, draw notification block into "Training" section
                                            $settings_current_assistant_data = $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_current_assistant_data );
                                            $settings_current_assistant_meta = $settings_controller->try_get_setting( VAPPV_TTW_Settings::$settings_current_assistant_meta );
                                            
                                            // Decode data from JSON plain text to JSON object
                                            $settings_current_assistant_data__decoded = array();
                                            if (
												! is_null( $settings_current_assistant_data) &&
												strlen( $settings_current_assistant_data ) > 0
											) {
	                                            $settings_current_assistant_data__decoded = json_decode( $settings_current_assistant_data, true );
                                            }
                                            
                                            $settings_current_assistant_meta__decoded = array();
                                            if (
												! is_null( $settings_current_assistant_meta) &&
												strlen( $settings_current_assistant_meta ) > 0
											) {
	                                            $settings_current_assistant_meta__decoded = json_decode( $settings_current_assistant_meta, true );
                                            }

                                            if (
												! is_null( $settings_current_assistant_meta ) &&
												'' != $settings_current_assistant_meta
											) {

                                                // Check is assistant created or it's just an installation process
                                                if (
                                                    isset( $settings_current_assistant_data__decoded['id'] ) &&
                                                    ! is_null( $settings_current_assistant_data__decoded['id'] ) &&
                                                    strlen( $settings_current_assistant_data__decoded['id'] ) > 0
                                                ) {

                                                    // Get assistant meta params
                                                    $training_last_date = new DateTime( $settings_current_assistant_meta__decoded['created_date'] );
                                                    $current_date = new DateTime( gmdate( 'Y-m-d H:i:s') );
                                                    $training_date_dates_diff = $current_date->diff( $training_last_date );
                                                    $training_date_days_diff = $training_date_dates_diff->format( "%a" );

                                                    // Display stats block
                                                    ?><div class="ttw-trained-assistant-tab-heading-data" id="ttw-trained-assistant-tab-heading-data">
                                                        <div>
                                                            <b><?php echo esc_html( __( 'Training date', 'talk-to-website' ) ); ?></b>: <?php echo esc_html( $training_last_date->format('Y-m-d H:i') ); ?> (<?php if ( $training_date_days_diff > 0) { echo esc_html( $training_date_days_diff ) . ' ' . esc_html( __( 'days ago', 'talk-to-website' ) ); } else { echo esc_html( __( 'today', 'talk-to-website' ) ); } ?>);
                                                            <b><?php echo esc_html( __( 'ChatGPT assistant name', 'talk-to-website' ) ); ?></b>: <?php echo esc_html( $settings_current_assistant_meta__decoded['name'] ); ?>;
                                                            <b><?php echo esc_html( __( 'Materials', 'talk-to-website' ) ); ?></b>: <?php echo esc_html( $settings_current_assistant_meta__decoded['materials_count'] ); ?>;
                                                            <b><?php echo esc_html( __( 'Words', 'talk-to-website' ) ); ?></b>: <?php echo esc_html( $settings_current_assistant_meta__decoded['words_count'] ); ?>;
                                                            <b><?php echo esc_html( __( 'Characters', 'talk-to-website' ) ); ?></b>: <?php echo esc_html( $settings_current_assistant_meta__decoded['characters_count'] ); ?>;
                                                            <b><?php echo esc_html( __( 'Training file URL', 'talk-to-website' ) ); ?></b>: <a href="<?php echo esc_url( $settings_current_assistant_meta__decoded['training_file_direct_url'] ); ?>" target="_blank"><?php echo esc_html( __( 'Open', 'talk-to-website' ) ); ?></a>;
                                                            <?php
                                                                if ( isset( $settings_current_assistant_meta__decoded['updated_date'] ) ) {

                                                                    $assistant_update_last_date = new DateTime( $settings_current_assistant_meta__decoded['updated_date'] );
                                                                    $current_date = new DateTime( gmdate( 'Y-m-d H:i:s' ) );
                                                                    $assistant_update_date_dates_diff = $current_date->diff( $assistant_update_last_date );
                                                                    $assistant_update_days_diff = $assistant_update_date_dates_diff->format( "%a" );

                                                                    ?>
                                                                        <b><?php echo esc_html( __( 'Assistant updated', 'talk-to-website' ) ); ?></b>: <?php echo esc_html( $assistant_update_last_date->format( 'Y-m-d H:i' ) ); ?> (<?php if ( $assistant_update_days_diff > 0 ) { echo esc_html( $assistant_update_days_diff ) . ' ' . esc_html( __( 'days ago', 'talk-to-website' ) ); } else { echo esc_html( __( 'today', 'talk-to-website' ) ); } ?>);
                                                                    <?php
                                                                } 
                                                            ?>
                                                        </div>
                                                    </div><?php
                                                }
                                            }
                                        ?>
                                        <div class="ttw-training-website-content" id="ttw-training-website-content">
                                            <div class="ttw-training-subtabs ttw-tabs-headings ttw-subtabs-headings" id="ttw-training-tabs-headings"></div>
                                            <div class="ttw-tabs-content" id="ttw-training-tabs-content"></div>
                                        </div>
                                        <div class="ttw-buttons-bar training-save-buttons" data-role="training-save-buttons" id="traning-tab-bottom-buttons" <?php if ( false === $is_openai_key_set) { echo 'style="display: none;"'; } ?>>
                                            <div id="ttw-make-training" class="ttw-button ttw-green-button"><input type="checkbox" checked="checked" disabled="disabled" /> <?php echo esc_html( __( 'Train AI', 'talk-to-website' ) ); ?></div>
                                            <label id="ttw-check-uncheck-all-materials" class="ttw-button ttw-check-uncheck-all-content-button"><input type="checkbox" id="check_uncheck_all_materials_input" /> <?php echo esc_html( __( 'Check all', 'talk-to-website' ) ); ?></label>
                                            <div id="ttw-refresh-training-content" class="ttw-button ttw-refresh-training-content-button"><?php echo esc_html( __( 'Refresh', 'talk-to-website' ) ); ?></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="ttw-tab-content ttw-admin-dialogue-tab" style="display: none;" data-role="ttw-tab-content" data-level="1" data-tabid="testing">
                                <div class="tab-content-inner">
                                    <div class="ttw-settings-not-set" data-role="ttw-settings-not-set" <?php if ( true === $are_primary_settings_saved ) { echo 'style="display: none;"'; } ?>>
                                        <b><?php echo esc_html( __( 'Oops! Looks like you haven\'t set the settings yet', 'talk-to-website' ) ); ?> ⚙️</b>
                                        <br /><?php echo esc_html( __( 'Please set the settings in the "Settings" tab - then this section will be available.', 'talk-to-website' ) ); ?>
                                    </div>
                                    <div class="ttw-ai-training-not-completed" data-role="ttw-ai-training-not-completed" <?php if ( true === $is_assistant_configured ) { echo 'style="display: none;"'; } ?>>
                                        <b><?php echo esc_html( __( 'Oops! Looks like you haven\'t trained the AI yet', 'talk-to-website' ) ); ?> 🤖</b>
                                        <br /><?php echo esc_html( __( 'Please train the AI in the "Training" tab - then this section will be available.', 'talk-to-website' ) ); ?>
                                    </div>
                                    <div class="ttw-testing-container" id="ttw-testing-container" class="ttw-dialogue-container ttw-testing-container" <?php if ( false === $are_primary_settings_saved || false === $is_assistant_configured ) { echo 'style="display: none;"'; } ?>>
                                        <div class="ttw-dialogue-block" id="ttw-dialogue-block"></div>
                                        <div class="ttw-dialogue-bottom-input-block">
                                            <textarea id="ttw-dialogue-input-textarea" class="ttw-dialogue-input-textarea" placeholder="<?php echo esc_attr( __( 'Write your message to AI bot here', 'talk-to-website' ) ); ?>"></textarea>
                                            <div class="ttw-button ttw-green-button ttw-dialogue-send-message-button" id="ttw-dialogue-send-message-button">
                                                <div class="ttw-send-message-label">
                                                    <?php echo esc_html( __( 'Send', 'talk-to-website' ) ); ?>
                                                </div>
                                                <div class="ttw-send-message-icon">
                                                    <div class="dashicons dashicons-editor-break"></div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="ttw-tab-content" style="display: none;" data-role="ttw-tab-content" data-level="1" data-tabid="dialogues">
                                <div class="tab-content-inner">
                                    <div class="ttw-settings-not-set" data-role="ttw-settings-not-set" <?php if ( true === $are_primary_settings_saved ) { echo 'style="display: none;"'; } ?>>
                                        <b><?php echo esc_html( __( 'Oops! Looks like you haven\'t set the settings yet', 'talk-to-website' ) ); ?> ⚙️</b>
                                        <br />
										<?php echo esc_html( __( 'Please set the settings in the "Settings" tab - then this section will be available.', 'talk-to-website' ) ); ?>
                                    </div>
                                    <div class="ttw-ai-training-not-completed" data-role="ttw-ai-training-not-completed" <?php if ( true === $is_assistant_configured ) { echo 'style="display: none;"'; } ?>>
                                        <b><?php echo esc_html( __( 'Oops! Looks like you haven\'t trained the AI yet', 'talk-to-website' ) ); ?> 🤖</b>
                                        <br /><?php echo esc_html( __( 'Please train the AI in the "Training" tab - then this section will be available.', 'talk-to-website' ) ); ?>
                                    </div>
                                    <div class="ttw-dialogues-container" id="ttw-dialogues-container"></div>
                                </div>                      
                            </div>
                            <div class="ttw-tab-content" style="display: none;" data-role="ttw-tab-content" data-level="1" data-tabid="logs">
                                <div class="tab-content-inner">    
                                    <div class="ttw-settings-not-set" data-role="ttw-settings-not-set" <?php if ( true === $are_primary_settings_saved ) { echo 'style="display: none;"'; } ?>>
                                        <b><?php echo esc_html( __( 'Oops! Looks like you haven\'t set the settings yet', 'talk-to-website' ) ); ?> ⚙️</b>
                                        <br />
										<?php echo esc_html( __( 'Please set the settings in the "Settings" tab - then this section will be available.', 'talk-to-website' ) ); ?>
                                    </div>
                                    <div class="ttw-logs-container" id="ttw-logs-container" <?php if ( false === $are_primary_settings_saved ) { echo 'style="display: none;"'; } ?>></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--div class="ttw-button" id="test-ajax-button">Text AJAX button</div-->
                </div>
                <div class="ttw-plugin-footer">
                    &copy; 2024 <?php echo esc_html( __( 'Copyright Vitalii A. Popov. All rights reserved.', 'talk-to-website' ) ); ?> | <a href="<?php echo esc_url( __( 'https://talktowebsite.com/?utm_source=plugin', 'talk-to-website' ) ); ?>" target="_blank"><?php echo esc_html( __( 'https://talktowebsite.com/', 'talk-to-website' ) ); ?></a>
                </div>
                <div id="ttw-wait-loader-modal" class="ttw-wait-loader-modal" style="display: none;">
                    <div class="ttw-loader-overlay"></div> 
                    <div class="ttw-loader-content-block"><div class="ttw-loading-animation-icon-svg"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: none; display: block; shape-rendering: auto;" width="100px" height="100px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><g transform="translate(80,50)"><g transform="rotate(0)"><circle cx="0" cy="0" r="6" fill="#1d3f72" fill-opacity="1"><animateTransform attributeName="transform" type="scale" begin="-0.875s" values="1.5 1.5;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.875s"></animate></circle></g></g><g transform="translate(71.21320343559643,71.21320343559643)"><g transform="rotate(45)"><circle cx="0" cy="0" r="6" fill="#1d3f72" fill-opacity="0.875"><animateTransform attributeName="transform" type="scale" begin="-0.75s" values="1.5 1.5;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.75s"></animate></circle></g></g><g transform="translate(50,80)"><g transform="rotate(90)"><circle cx="0" cy="0" r="6" fill="#1d3f72" fill-opacity="0.75"><animateTransform attributeName="transform" type="scale" begin="-0.625s" values="1.5 1.5;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.625s"></animate></circle></g></g><g transform="translate(28.786796564403577,71.21320343559643)"><g transform="rotate(135)"><circle cx="0" cy="0" r="6" fill="#1d3f72" fill-opacity="0.625"><animateTransform attributeName="transform" type="scale" begin="-0.5s" values="1.5 1.5;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.5s"></animate></circle></g></g><g transform="translate(20,50.00000000000001)"><g transform="rotate(180)"><circle cx="0" cy="0" r="6" fill="#1d3f72" fill-opacity="0.5"><animateTransform attributeName="transform" type="scale" begin="-0.375s" values="1.5 1.5;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.375s"></animate></circle></g></g><g transform="translate(28.78679656440357,28.786796564403577)"><g transform="rotate(225)"><circle cx="0" cy="0" r="6" fill="#1d3f72" fill-opacity="0.375"><animateTransform attributeName="transform" type="scale" begin="-0.25s" values="1.5 1.5;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.25s"></animate></circle></g></g><g transform="translate(49.99999999999999,20)"><g transform="rotate(270)"><circle cx="0" cy="0" r="6" fill="#1d3f72" fill-opacity="0.25"><animateTransform attributeName="transform" type="scale" begin="-0.125s" values="1.5 1.5;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.125s"></animate></circle></g></g><g transform="translate(71.21320343559643,28.78679656440357)"><g transform="rotate(315)"><circle cx="0" cy="0" r="6" fill="#1d3f72" fill-opacity="0.125"><animateTransform attributeName="transform" type="scale" begin="0s" values="1.5 1.5;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="0s"></animate></circle></g></g><!-- [ldio] generated by https://loading.io/ --></svg></div><div class="ttw-loader-text"><?php echo esc_html( __( 'Working on it', 'talk-to-website' ) ); ?>..</div></div>
                </div>
				<div style="display: none;" id="ttw-variables">
					<input type="hidden" id="ttw-is-chatgpt-key-set" value="<?php if ( true === $is_openai_key_set ) { echo esc_attr( 'yes' ); } else { echo esc_attr( 'no' ); } ?>" />
					<input type="hidden" id="ttw-are-plugin-settings-saved" value="<?php if ( true === $are_primary_settings_saved ) { echo esc_attr( 'yes' ); } else { echo esc_attr( 'no' ); } ?>" />
					<input type="hidden" id="ttw-is-assistant-assigned" value="<?php if ( true === $is_assistant_configured ) { echo esc_attr( 'yes' ); } else { echo esc_attr( 'no' ); } ?>" />
					<?php

						// Plugin localization. This array will be packed into JS variable:
						// window.talkToWebsiteAdminLocalization
						$talkToWebsiteAdminLocalizedTexts = array(

							/* Save OpenAI API key */
							"setOpenAIKey_ApiKeyIsEmpty" 					=> esc_attr( __( 'API key is empty. Please set valid API key.', 'talk-to-website' ) ),
							"setOpenAIKey_ApiAddressIsEmpty" 				=> esc_attr( __( 'API address is empty. Please set valid API address.', 'talk-to-website' ) ),
							"setOpenAIKey_ServerCallFailed" 				=> esc_attr( __( 'Unable to save the API key. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),
							"setOpenAIKey_OpenAIErrorTitle"					=> esc_attr( __( 'OpenAI error', 'talk-to-website' ) ),
							"setOpenAIKey_OpenAICommonTitle"				=> esc_attr( __( 'Common error', 'talk-to-website' ) ),
							"setOpenAIKey_PleaseContactSupport" 			=> esc_attr( __( 'please contact support', 'talk-to-website' ) ),
							"setOpenAIKey_ApiKeySaved"						=> esc_attr( __( 'OpenAI API key saved! Now you can set other settings.', 'talk-to-website' ) ),

							/* Save plugin settings */
							"saveSettings_ChatGPTModelNotSet"				=> esc_attr( __( 'ChatGPT model is not set', 'talk-to-website' ) ),
							"saveSettings_WrongCharGPTModel"				=> esc_attr( __( 'Wrong ChatGPT model', 'talk-to-website' ) ),
							"saveSettings_ChatGPTTemperatureNotSet" 		=> esc_attr( __( 'ChatGPT temperature is not set', 'talk-to-website' ) ),
							"saveSettings_ChatGPTTemperatureNotNumeric" 	=> esc_attr( __( 'ChatGPT temperature is not numeric', 'talk-to-website' ) ),
							"saveSettings_ChatGPTTemperatureWrongVal"		=> esc_attr( __( 'Wrong ChatGPT temperature. Should be > 0 and < 2', 'talk-to-website' ) ),
							"saveSettings_DialogueLifetimeNotSet"			=> esc_attr( __( 'Dialogue lifetime (minutes) is not set', 'talk-to-website' ) ),
							"saveSettings_DialogueLifetimeNotNumeric"		=> esc_attr( __( 'Dialogue lifetime (minutes) is not numeric', 'talk-to-website' ) ),
							"saveSettings_DialogueLifeTimeNotPositive"		=> esc_attr( __( 'Dialogue lifetime (minutes) should be positive', 'talk-to-website' ) ),
							"saveSettings_MaxCharPerQuestionNotSet"			=> esc_attr( __( 'Max characters count per one user question is not set', 'talk-to-website' ) ),
							"saveSettings_MaxCharPerQuestionNotNumeric" 	=> esc_attr( __( 'Max characters count per one user question is not numeric', 'talk-to-website' ) ),
							"saveSettings_MaxCharPerQuestionNotPositive" 	=> esc_attr( __( 'Max character per one user question should be positive', 'talk-to-website' ) ),
							"saveSettings_MaxWordsPerAnswerNotSet"			=> esc_attr( __( 'Max words to answer is not set', 'talk-to-website' ) ),
							"saveSettings_MaxWordsPerAnswerNotNumeric"		=> esc_attr( __( 'Max words to answer is not numeric', 'talk-to-website' ) ),
							"saveSettings_MaxWordsPerAnswerNotPositive"		=> esc_attr( __( 'Max character per one user question should be positive', 'talk-to-website' ) ),
							"saveSettings_MaxInputWordsPerDayNotSet"		=> esc_attr( __( 'Max input words per day is not set', 'talk-to-website' ) ),
							"saveSettings_MaxInputWordsPerDayNotNumeric"	=> esc_attr( __( 'Max input words per day is not numeric', 'talk-to-website' ) ),
							"saveSettings_MaxInputWordsPerDayNotPositive"	=> esc_attr( __( 'Max input words per day should be positive or equals to -1', 'talk-to-website' ) ),
							"saveSettings_MaxInputCharsPerDayNotSet"		=> esc_attr( __( 'Max input characters per day is not set', 'talk-to-website' ) ),
							"saveSettings_MaxInputCharsPerDayNotNumeric"	=> esc_attr( __( 'Max input characters per day is not numeric', 'talk-to-website' ) ),
							"saveSettings_MaxInputCharsPerDayNotPositive"	=> esc_attr( __( 'Max input characters per day should be positive or equals to -1', 'talk-to-website' ) ),
							"saveSettings_MaxOutputCharsPerDayNotSet"		=> esc_attr( __( 'Max output characters per day is not set', 'talk-to-website' ) ),
							"saveSettings_MaxOutputCharsPerDayNotNumeric"	=> esc_attr( __( 'Max output characters per day is not numeric', 'talk-to-website' ) ),
							"saveSettings_MaxOutputCharsPerDayNotPositive"	=> esc_attr( __( 'Max output characters per day should be positive or equals to -1', 'talk-to-website' ) ),
							"saveSettings_MaxOutputTokensPerDayNotSet"		=> esc_attr( __( 'Max output tokens per day is not set', 'talk-to-website' ) ),
							"saveSettings_MaxOutputTokensPerDayNotNumeric"	=> esc_attr( __( 'Max output tokens per day is not numeric', 'talk-to-website' ) ),
							"saveSettings_MaxOutputTokensPerDayNotPositive"	=> esc_attr( __( 'Max output tokens per day should be positive or equals to -1', 'talk-to-website' ) ),
							"saveSettings_ChatBubbleIndentationWrong"		=> esc_attr( __( 'Indentation of the chat bubble from the screen border should be positive number or equal to 0', 'talk-to-website' ) ),
							"saveSettings_WrongSettingsFixErrors"			=> esc_attr( __( 'Wrong settings, please fix error(s)', 'talk-to-website' ) ),
							"saveSettings_ServerCallFailed"					=> esc_attr( __( 'Unable to save the settings. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),
							"saveSettings_Success"							=> esc_attr( __( 'Settings saved. Now you can train the assistant!', 'talk-to-website' ) ),

							/* List AI models */
							"listAIModels_ServerCallFailed"					=> esc_attr( __( 'Unable to list AI models. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),
							"listAIModels_Success"							=> esc_attr( __( 'AI models are displayed into console', 'talk-to-website' ) ),

							/* Training: get website materials list */
							"getWebsiteMaterials_ServerCallFailed"			=> esc_attr( __( 'Unable to get website materials. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),
							"getWebsiteMaterials_LastTrained"				=> esc_attr( __( 'Last trained', 'talk-to-website' ) ),
							"getWebsiteMaterials_OpenMaterial"				=> esc_attr( __( 'Open material', 'talk-to-website' ) ),

							/* Training: train AI */
							"trainAI_NoMaterialsSelected"					=> esc_attr( __( 'You have not selected the materials to send to the AI for training. Please select the required materials using the checkboxes, or click on the "Select all materials" button, then try again.', 'talk-to-website' ) ),
							"trainAI_ServerCallFailed"						=> esc_attr( __( 'Unable to make AI training. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),
							"trainAI_Success"								=> esc_attr( __( 'AI has been successfully trained! We just created an assistant that knows your website content perfectly! Now you can try going to the "Testing" tab and talk to it.', 'talk-to-website' ) ),
							"trainAI_ReloadPageToViewStats"					=> esc_attr( __( 'Reload page to view training stats', 'talk-to-website' ) ),

							/* List admin messages | ttw_list_admin_messages() */
							"listAdminMessages_ServerCallFailed"			=> esc_attr( __( 'Unable to list dialogue between user and AI. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),

							/* Send admin message to the chat | adminDialogueTabSendChatMessage() */
							"sendChatMessageAdmin_EmptyMessage"				=> esc_attr( __( 'Message is empty. Please complete message.', 'talk-to-website' ) ),
							"sendChatMessageAdmin_ServerCallFailed"			=> esc_attr( __( 'Unable send message to the chat. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),

							/* Get responses from AI | ttw_try_get_message_responses_from_ai_as_admin() */
							"tryGetAIResponse_ServerCallFailed"				=> esc_attr( __( 'Unable to get response from the AI. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),

							/* List dialogues | ttw_list_dialogues() */
							"listDialogues_ServerCallFailed" 				=> esc_attr( __( 'Unable get dialogues. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),
							"listDialogues_Dialogue"						=> esc_attr( __( 'Dialogue', 'talk-to-website' ) ),
							"listDialogues_Started"							=> esc_attr( __( 'Started', 'talk-to-website' ) ),
							"listDialogues_LastMessage"						=> esc_attr( __( 'Last message', 'talk-to-website' ) ),
							"listDialogues_Duration"						=> esc_attr( __( 'Duration', 'talk-to-website' ) ),
							"listDialogues_DurationMinutesShort"			=> esc_attr( __( 'mins.', 'talk-to-website' ) ),
							"listDialogues_MessagesCount"					=> esc_attr( __( 'Messages count', 'talk-to-website' ) ),
							"listDialogues_UserCharactersCount"				=> esc_attr( __( 'Characters count from user', 'talk-to-website' ) ),
							"listDialogues_AICharactersCount"				=> esc_attr( __( 'Characters count from AI', 'talk-to-website' ) ),
							"listDialogues_NoMessagesIntoDialogue"			=> esc_attr( __( 'No messages in dialogue', 'talk-to-website' ) ),
							"listDialogues_ViewMessages"					=> esc_attr( __( 'View messages', 'talk-to-website' ) ),
							"listDialogues_HideMessages"					=> esc_attr( __( 'Hide messages', 'talk-to-website' ) ),
							"listDialogues_ThisDialogHasNotMessages"		=> esc_attr( __( 'This dialog does not contain any messages', 'talk-to-website' ) ),

							/* Get logs | ttw_get_logs() */
							"getLogs_ServerCallFailed"						=> esc_attr( __( 'Unable get logs. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),

							/* Enable / Disable plugin | ttw_qa_enable_plugin() + ttw_qa_disable_plugin() */
							"disablePlugin_ServerCallFailed"				=> esc_attr( __( 'Unable to disable plugin. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),
							"disablePlugin_PluginIsDisabled"				=> esc_attr( __( 'Plugin is disabled and will not be displayed on the website (according the schedule setting).', 'talk-to-website' ) ),

							"enablePlugin_ServerCallFailed"					=> esc_attr( __( 'Unable to disable plugin. Error during interaction with the server part of the plugin. Check console for details.', 'talk-to-website' ) ),
 							"enablePlugin_PluginIsEnabled"					=> esc_attr( __( 'Plugin is enabled and will be displayed on the website (according the schedule setting).', 'talk-to-website' ) ),

							/* Get message HTML / templates / other HTML | getChatMessageHTML() */
							"renderChatMessage_UserClickedOnTheLink"		=> esc_attr( __( 'User clicked on the link(s) inside the message', 'talk-to-website' ) ),
							"html_waitingForAIResponse"						=> esc_attr( __( 'Waiting for AI response', 'talk-to-website' ) ),
							"html_loadingMessages"							=> esc_attr( __( 'Loading messages', 'talk-to-website' ) ),
							"html_dialogueChangedTo"						=> esc_attr( __( 'Dialogue changed to', 'talk-to-website' ) ),
							"html_dialogueChangedToTimeout"					=> esc_attr( __( 'timeout', 'talk-to-website' ) ),

							/* Other | common */
							"commonText_Info"								=> esc_attr( __( 'Info', 'talk-to-website' ) ),
							"commonText_DefaultWelcomeText"					=> esc_attr( __( 'Hi there! I am an AI smart robot. Please ask any question about the website!', 'talk-to-website' ) ),
							"commonText_Error"								=> esc_attr( __( 'Error', 'talk-to-website' ) ),
							"commonText_Close"								=> esc_attr( __( 'Close', 'talk-to-website' ) ),
							"commonText_MaterialName"						=> esc_attr( __( 'Material name', 'talk-to-website' ) ),
							"commonText_MaterialTitle"						=> esc_attr( __( 'Material title', 'talk-to-website' ) ),
							"commonText_Date"								=> esc_attr( __( 'Date', 'talk-to-website' ) ),
							"commonText_Status"								=> esc_attr( __( 'Status', 'talk-to-website' ) ),
							"commonText_Characters"							=> esc_attr( __( 'Characters', 'talk-to-website' ) ),
							"commonText_Words"								=> esc_attr( __( 'Date', 'talk-to-website' ) ),
							"commonText_GPTTokens"							=> esc_attr( __( 'GPT tokens', 'talk-to-website' ) ),
							"commonText_Check"								=> esc_attr( __( 'Check', 'talk-to-website' ) ),
							"commonText_Admin"								=> esc_attr( __( 'Admin', 'talk-to-website' ) ),
							"commonText_RefreshDialogues"					=> esc_attr( __( 'Refresh dialogues', 'talk-to-website' ) ),
							"commonText_RefreshLogs"						=> esc_attr( __( 'Refresh logs', 'talk-to-website' ) )

						);

						echo sprintf( "<script type=\"text/javascript\">window.talkToWebsiteAdminLocalization = %s;</script>", wp_json_encode( $talkToWebsiteAdminLocalizedTexts ) );

					?>
				</div>
			</div>
        <?php

        /*
            © 2024 Copyright Vitalii A. Popov. All rights reserved.
        */

    }

?>