true, 'strategy' => 'defer', ) ); $version = Replyvane_Plugin::data_version(); $live = Replyvane_Live::enabled(); wp_localize_script( 'replyvane-chat', 'replyVane', array( 'dataUrl' => add_query_arg( 'v', rawurlencode( $version ), rest_url( 'replyvane/v1/data' ) ), 'eventUrl' => rest_url( 'replyvane/v1/event' ), 'answerUrl' => esc_url_raw( rest_url( 'replyvane/v1/answer' ) ), 'siteAnswers' => (bool) Replyvane_Plugin::get( 'answer_from_site' ), 'version' => $version, 'botName' => (string) Replyvane_Plugin::get( 'bot_name' ), 'welcome' => (string) Replyvane_Plugin::get( 'welcome' ), 'popularTitle' => (string) Replyvane_Plugin::get( 'popular_title' ), 'noMatch' => (string) Replyvane_Plugin::get( 'no_match' ), 'contactUrl' => (string) Replyvane_Plugin::get( 'contact_url' ), 'color' => Replyvane_Appearance::accent(), 'style' => Replyvane_Appearance::css_vars(), 'icon' => Replyvane_Appearance::launcher_icon(), 'personIcon' => Replyvane_Appearance::person_svg(), 'notify' => (bool) Replyvane_Plugin::get( 'notify_enabled' ), 'notifySound' => (bool) Replyvane_Plugin::get( 'notify_sound' ), 'aiLabel' => (bool) Replyvane_Plugin::get( 'ai_label' ), 'avatars' => (bool) Replyvane_Plugin::get( 'message_avatars' ), 'position' => 'left' === Replyvane_Plugin::get( 'position' ) ? 'left' : 'right', 'showSearch' => (bool) Replyvane_Plugin::get( 'show_search' ), 'preview' => $preview, 'live' => $live ? array( 'enabled' => true, 'base' => esc_url_raw( rest_url( 'replyvane/v1/live' ) ), 'label' => (string) Replyvane_Plugin::get( 'live_label' ), 'requireEmail' => (bool) Replyvane_Plugin::get( 'require_email' ), 'consent' => (string) Replyvane_Plugin::get( 'live_consent' ), ) : null, 'siteHost' => (string) wp_parse_url( home_url(), PHP_URL_HOST ), 'i18n' => array( 'open' => __( 'Questions? Chat with us', 'replyvane-chat-support' ), 'close' => __( 'Close chat', 'replyvane-chat-support' ), 'subtitle' => __( 'Answers from our team', 'replyvane-chat-support' ), 'preview' => __( 'Preview: only administrators can see this chat', 'replyvane-chat-support' ), 'placeholder' => __( 'Type your question', 'replyvane-chat-support' ), 'send' => __( 'Search', 'replyvane-chat-support' ), 'topics' => __( 'Browse by topic', 'replyvane-chat-support' ), 'allTopics' => __( 'All topics', 'replyvane-chat-support' ), 'related' => __( 'Related questions', 'replyvane-chat-support' ), 'didYouMean' => __( 'Here are the closest questions I have:', 'replyvane-chat-support' ), /* translators: %s: topic name. */ 'topicIntro' => __( 'Questions about %s:', 'replyvane-chat-support' ), 'contact' => __( 'Contact us', 'replyvane-chat-support' ), 'restart' => __( 'Start over', 'replyvane-chat-support' ), 'loading' => __( 'Loading questions…', 'replyvane-chat-support' ), 'aiLabel' => __( 'AI answer based on our website', 'replyvane-chat-support' ), 'newReply' => __( 'New reply', 'replyvane-chat-support' ), 'ourTeam' => __( 'Our team', 'replyvane-chat-support' ), 'teamWaiting' => __( 'Waiting for someone to join…', 'replyvane-chat-support' ), /* translators: %s: team member's first name. */ 'isTyping' => __( '%s is typing…', 'replyvane-chat-support' ), 'teamOnline' => __( 'is chatting with you', 'replyvane-chat-support' ), 'dismiss' => __( 'Dismiss', 'replyvane-chat-support' ), 'searching' => __( 'Looking through our website…', 'replyvane-chat-support' ), 'fromSite' => __( 'From our website:', 'replyvane-chat-support' ), 'loadError' => __( "The questions couldn't load. Please refresh the page, or contact us directly.", 'replyvane-chat-support' ), // Live chat. 'back' => __( 'Questions', 'replyvane-chat-support' ), 'endChat' => __( 'End chat', 'replyvane-chat-support' ), 'checking' => __( 'Checking who is available…', 'replyvane-chat-support' ), 'liveTitle' => __( 'Chat with our team', 'replyvane-chat-support' ), 'liveIntro' => __( "Tell us your name and question, and someone from our team will join you shortly.", 'replyvane-chat-support' ), 'offlineTitle' => __( 'Leave us a message', 'replyvane-chat-support' ), 'offlineIntro' => __( "We're not online right now. Leave your message and we'll reply by email.", 'replyvane-chat-support' ), 'name' => __( 'Your name', 'replyvane-chat-support' ), 'email' => __( 'Your email', 'replyvane-chat-support' ), 'emailOptional' => __( 'Your email (optional)', 'replyvane-chat-support' ), 'question' => __( 'Your question', 'replyvane-chat-support' ), 'startChat' => __( 'Start chat', 'replyvane-chat-support' ), 'sendMessage' => __( 'Send message', 'replyvane-chat-support' ), /* translators: %s: visitor's name. */ 'waiting' => __( 'Thanks, %s! Someone from our team will be with you shortly. You can keep browsing; this chat stays open.', 'replyvane-chat-support' ), /* translators: %s: visitor's email address. */ 'busy' => __( "Our team is a little busy right now. Stay here and someone will join as soon as possible. If you need to leave, we'll reply to %s.", 'replyvane-chat-support' ), /* translators: 1: visitor's name, 2: visitor's email address. */ 'offlineSent' => __( 'Thanks, %1$s! We\'ve received your message and will reply to %2$s as soon as we can.', 'replyvane-chat-support' ), /* translators: %s: visitor's name. */ 'offlineSentNo' => __( "Thanks, %s! We've received your message.", 'replyvane-chat-support' ), 'wentOffline' => __( "Our team couldn't join this time. We've saved your message and will reply by email.", 'replyvane-chat-support' ), 'ended' => __( 'This chat has ended. Thanks for chatting with us!', 'replyvane-chat-support' ), 'newChat' => __( 'Start a new chat', 'replyvane-chat-support' ), 'typeMessage' => __( 'Type a message', 'replyvane-chat-support' ), 'openChat' => __( 'You have a chat open with our team.', 'replyvane-chat-support' ), 'returnChat' => __( 'Return to chat', 'replyvane-chat-support' ), 'newMessages' => __( 'New message', 'replyvane-chat-support' ), 'you' => __( 'You', 'replyvane-chat-support' ), 'sendFailed' => __( "That didn't send. Please check your connection and try again.", 'replyvane-chat-support' ), 'confirmEnd' => __( 'End this chat?', 'replyvane-chat-support' ), ), ) ); } }