@php $page = isset($page) ? $page : 'dashboard'; $chatbot = App\Models\Chatbot\Chatbot::query() ->where('id', $settings_two->chatbot_template) ->first(); if (!$chatbot) { return; } $ipAddress = isset($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : request()->ip(); $db_ip_address = App\Models\RateLimit::query()->where('ip_address', $ipAddress)->where('type', 'chatbot')->first(); $chatbot_history = App\Models\ChatBotHistory::query()->where('ip', $ipAddress)->first(); $position = $settings_two->chatbot_position ?? 'bottom-left'; $chatbot_custom_dimensions = ''; switch ($position) { case 'top-left': $trigger_class = 'top-10 start-10'; $chat_class = 'start-0 top-full'; break; case 'top-right': $trigger_class = 'top-10 end-12'; $chat_class = 'end-0 top-full'; break; case 'bottom-right': $trigger_class = 'end-10 ' . ($page === 'dashboard' ? 'bottom-20 lg:bottom-16' : 'bottom-8'); $chat_class = 'end-0 bottom-full'; break; case 'bottom-left': $trigger_class = 'start-10 ' . ($page === 'dashboard' ? 'bottom-20 lg:bottom-16' : 'bottom-8'); $chat_class = 'start-0 bottom-full'; break; } if ($chatbot->width || $chatbot->height) { $chatbot_custom_dimensions = sprintf( '%s %s', $chatbot->width ? 'width:' . $chatbot->width . '!important;' : '', $chatbot->height ? 'height:' . $chatbot->height . '!important;' : '', ); } @endphp
{{-- trigger --}} {{-- chat --}}