<?php $__env->startSection('content'); ?>
<?php echo $__env->make('users.partials.header', [
'title' => __tr('WhatsApp Chat'),
'description' => '',
// 'class' => 'col-lg-7'
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->startPush('head'); ?>
<?php echo __yesset('dist/css/whatsapp-chat.css', true); ?>

<?php $__env->stopPush(); ?>
<?php if($contact): ?>
<div class="container-fluid">
    <div class="">
        <div class="card lw-whatsapp-chat-block-container">
            <div id="lwWhatsAppChatWindow"
                class="card-body lw-whatsapp-chat-window lw-contact-window-<?php echo e($contact->_uid); ?>"
                data-contact-uid="<?php echo e($contact->_uid); ?>">
                <div class="row" x-cloak x-data="{isContactListOpened:false}">
                    <div class="col-sm-12 col-md-6 col-lg-4 col-xl-3 mb-4 lw-contact-list-block" x-show="isContactListOpened">
                        <h2 class="lw-contacts-header"><?php echo e(__tr('Contacts')); ?> <span class="btn btn-light btn-sm float-right d-sm-none" @click.prevent="isContactListOpened = false"><i class="fa fa-arrow-left"></i></span></h2>
                        <div class="list-group lw-contact-list shadow-lg list-group-flush" x-cloak
                            x-data="initialContactListData">
                            <template x-for="contactItem in contacts">
                                <a :data-messaged-at="contactItem.last_message?.messaged_at"
                                    :class="['lw-contact-' + contactItem._uid, ('<?php echo e($contact->_uid); ?>' == contactItem._uid) ? 'list-group-item-light' : '']"
                                    :href="('<?php echo e($contact->_uid); ?>' != contactItem._uid) ? __Utils.apiURL('<?php echo e(route('vendor.chat_message.contact.view', ['contactUid'])); ?>',{'contactUid': contactItem._uid}) : '#'"
                                    class="list-group-item list-group-item-action d-flex align-items-start lw-contact">
                                    <div class="ms-2 me-auto w-100 mt-1">
                                        <div class="float-left">
                                            <img class="lw-contact-avatar" :src="contactItem.gravatar"
                                                :alt="contactItem.full_name">
                                        </div>
                                        <div class="mt-1">
                                            <h3 x-text="contactItem.full_name"></h3>
                                        </div>
                                    </div>
                                    <div class="mt-2 text-right w-100 mt-3">
                                        <small class="text-muted lw-last-message-at"
                                            x-text="contactItem.last_message?.formatted_message_time"></small>
                                        <span x-show="contactItem.unread_messages_count"
                                            class="badge bg-success rounded-pill"
                                            x-text="contactItem.unread_messages_count"></span>
                                    </div>
                                </a>
                            </template>
                        </div>
                    </div>
                    <div class="page col-sm-12 col-md-6 col-lg-8 col-xl-9 mb-4">
                        <h2><?php echo e(__tr('Chat')); ?></h2>
                        <div class="marvel-device nexus5">
                            <div class="screen">
                                <div class="screen-container">
                                    <div class="chat">
                                        <div class="chat-container" x-clock x-data="initialMessageData">
                                            <div class="user-bar">
                                                <div class="back" @click.prevent="isContactListOpened = true">
                                                    <i class="fa fa-users"></i>
                                                </div>
                                                <div class="avatar">
                                                    <img src="https://www.gravatar.com/avatar/<?php echo e(md5(strtolower(trim($contact->email)))); ?>" alt="<?php echo e($contact->full_name); ?>">
                                                </div>
                                                <div class="name">
                                                    <span><?php echo e($contact->full_name); ?></span>
                                                    <?php if($isDirectMessageDeliveryWindowOpened): ?>
                                                    <abbr class="status text-success" title="<?php echo e(__tr('As you received message response in last 24 hours, you can send direct messages to this  contact for next __windowClosedTime__.', [
                                                        '__windowClosedTime__' => $directMessageDeliveryWindowOpenedTillMessage
                                                        ])); ?>"><?php echo e(__tr('You can reply')); ?></abbr>
                                                        <?php else: ?>
                                                        <abbr class="status text-warning" title="<?php echo e(__tr("As you may not received any response in last 24 hours, your direct message may not get delivered. However you can send template messages.")); ?>"><?php echo e(__tr('You can\'t reply')); ?></abbr>
                                                        <?php endif; ?>
                                                </div>
                                                <div class="actions more lw-user-new-actions">
                                                    <a href="#" class="lw-whatsapp-bar-icon-btn" data-toggle="dropdown" aria-expanded="false">
                                                        <i class="fas fa-ellipsis-v text-muted"></i>
                                                    </a>
                                                    <div class="dropdown-menu dropdown-menu-right">
                                                    <a href="<?php echo e(route('vendor.template_message.contact.view', ['contactUid' => $contact->_uid])); ?>"
                                                        class="dropdown-item"><i class="fas fa-paper-plane"></i> <?php echo e(__tr('Send New Template Message')); ?></a>
                                                    <a x-cloak
                                                        :class="whatsappMessageLogs.length <= 0 ? 'disabled' : ''"
                                                        data-method="post" data-confirm="#lwClearChatHistoryWarning"
                                                        href="<?php echo e(route('vendor.chat_message.delete.process', ['contactUid' => $contact->_uid])); ?>"
                                                        class="dropdown-item text-danger lw-ajax-link-action"><i class="fas fa-eraser"></i> <?php echo e(__tr('Clear Chat History')); ?></a>
                                                    <script type="text/template" id="lwClearChatHistoryWarning">
                                                        <h3><?php echo e(__tr('Are you sure you want to clear chat history for this contact?')); ?></h3>
                                                            <p><?php echo e(__tr('All the history will be deleted permanently.')); ?></p>
                                                        </script>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="conversation">
                                                <div class="conversation-container" id="lwConversionChatContainer">
                                                        <template x-for="whatsappMessageLogItem in whatsappMessageLogs">
                                                            <div class="lw-chat-message-item"
                                                                :id="whatsappMessageLogItem._uid">
                                                                <template
                                                                    x-if="whatsappMessageLogItem.is_incoming_message">
                                                                    <div class="message received">
                                                                        <template
                                                                            x-if="whatsappMessageLogItem.replied_to_whatsapp_message_logs__uid">
                                                                            <a href="#"
                                                                                @click.prevent="lwScrollTo('#'+whatsappMessageLogItem.replied_to_whatsapp_message_logs__uid)"
                                                                                class="badge float-right text-muted"><i
                                                                                    class="fa fa-link"></i> <?php echo e(__tr('Replied to')); ?></a>
                                                                        </template>
                                                                        <template
                                                                            x-if="whatsappMessageLogItem.template_message">
                                                                            <div class="lw-template-message"
                                                                                x-show="whatsappMessageLogItem.template_message"
                                                                                x-html="whatsappMessageLogItem.template_message">
                                                                            </div>
                                                                        </template>
                                                                        <div x-show="whatsappMessageLogItem.message"><span class="lw-plain-message-text" x-html="whatsappMessageLogItem.message"></span></div>
                                                                        <span class="metadata"><span class="time"
                                                                                x-text="whatsappMessageLogItem.formatted_message_time"></span></span>
                                                                    </div>
                                                                </template>
                                                                <template
                                                                    x-if="!whatsappMessageLogItem.is_incoming_message">
                                                                    <div class="message sent">
                                                                        <template
                                                                            x-if="whatsappMessageLogItem.__data?.options?.bot_reply">
                                                                            <span class="badge float-right text-muted"
                                                                                title="<?php echo e(__tr('Bot Reply')); ?>">
                                                                                <i class="fas fa-robot text-muted"></i>
                                                                            </span>
                                                                        </template>
                                                                        <template
                                                                            x-if="whatsappMessageLogItem.template_message">
                                                                            <div class="lw-template-message"
                                                                                x-show="whatsappMessageLogItem.template_message"
                                                                                x-html="whatsappMessageLogItem.template_message">
                                                                            </div>
                                                                        </template>
                                                                        <template x-if="whatsappMessageLogItem.message">
                                                                            <div class="lw-template-message"
                                                                                x-show="whatsappMessageLogItem.message"
                                                                                ><span class="lw-plain-message-text" x-html="whatsappMessageLogItem.message"></span>
                                                                            </div>
                                                                        </template>
                                                                        <template
                                                                            x-if="whatsappMessageLogItem.status == 'failed'">
                                                                            <div class="p-1 mt-2">
                                                                                <small class="text-danger"> <i
                                                                                        class="fas fa-exclamation-circle text-danger text-shadow"></i>
                                                                                    <em
                                                                                        x-text="whatsappMessageLogItem.whatsapp_message_error"></em></small>
                                                                            </div>
                                                                        </template>
                                                                        <span class="metadata">
                                                                            <span class="time"
                                                                                x-text="whatsappMessageLogItem.formatted_message_time"></span>
                                                                            <span class="tick">
                                                                                <template
                                                                                    x-if="whatsappMessageLogItem.status == 'read'">
                                                                                    <svg xmlns="http://www.w3.org/2000/svg"
                                                                                        width="16" height="15"
                                                                                        id="msg-dblcheck-ack" x="2063"
                                                                                        y="2076">
                                                                                        <path
                                                                                            d="M15.01 3.316l-.478-.372a.365.365 0 0 0-.51.063L8.666 9.88a.32.32 0 0 1-.484.032l-.358-.325a.32.32 0 0 0-.484.032l-.378.48a.418.418 0 0 0 .036.54l1.32 1.267a.32.32 0 0 0 .484-.034l6.272-8.048a.366.366 0 0 0-.064-.512zm-4.1 0l-.478-.372a.365.365 0 0 0-.51.063L4.566 9.88a.32.32 0 0 1-.484.032L1.892 7.77a.366.366 0 0 0-.516.005l-.423.433a.364.364 0 0 0 .006.514l3.255 3.185a.32.32 0 0 0 .484-.033l6.272-8.048a.365.365 0 0 0-.063-.51z"
                                                                                            fill="#4fc3f7" />
                                                                                    </svg>
                                                                                </template>
                                                                                <template
                                                                                    x-if="whatsappMessageLogItem.status == 'delivered'">
                                                                                    <svg xmlns="http://www.w3.org/2000/svg"
                                                                                        width="16" height="15"
                                                                                        id="msg-dblcheck" x="2047"
                                                                                        y="2061">
                                                                                        <path
                                                                                            d="M15.01 3.316l-.478-.372a.365.365 0 0 0-.51.063L8.666 9.88a.32.32 0 0 1-.484.032l-.358-.325a.32.32 0 0 0-.484.032l-.378.48a.418.418 0 0 0 .036.54l1.32 1.267a.32.32 0 0 0 .484-.034l6.272-8.048a.366.366 0 0 0-.064-.512zm-4.1 0l-.478-.372a.365.365 0 0 0-.51.063L4.566 9.88a.32.32 0 0 1-.484.032L1.892 7.77a.366.366 0 0 0-.516.005l-.423.433a.364.364 0 0 0 .006.514l3.255 3.185a.32.32 0 0 0 .484-.033l6.272-8.048a.365.365 0 0 0-.063-.51z"
                                                                                            fill="#92a58c" />
                                                                                    </svg>
                                                                                </template>
                                                                                <template
                                                                                    x-if="whatsappMessageLogItem.status == 'sent'">
                                                                                    <svg width="16" height="16"
                                                                                        viewBox="0 0 24 24" fill="none"
                                                                                        xmlns="http://www.w3.org/2000/svg">
                                                                                        <path
                                                                                            d="M4 12.6111L8.92308 17.5L20 6.5"
                                                                                            stroke="#92a58c"
                                                                                            stroke-width="2"
                                                                                            stroke-linecap="round"
                                                                                            stroke-linejoin="round" />
                                                                                    </svg>
                                                                                </template>
                                                                                <template
                                                                                    x-if="whatsappMessageLogItem.status == 'failed'">
                                                                                    <i
                                                                                        class="fas fa-exclamation-circle text-danger"></i>
                                                                                </template>
                                                                                <template
                                                                                    x-if="whatsappMessageLogItem.status == 'accepted'">
                                                                                    <i
                                                                                        class="far fa-clock text-muted"></i>
                                                                                </template>
                                                                            </span>
                                                                        </span>
                                                                    </div>
                                                                </template>
                                                            </div>
                                                        </template>
                                                    <div class="w-100" id="lwEndOfChats">&shy;</div>
                                                </div>
                                                <?php if (isset($component)) { $__componentOriginald0b55ee435ec3aeeadffee8b0df479da = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginald0b55ee435ec3aeeadffee8b0df479da = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.lw.form','data' => ['dataCallback' => 'appFuncs.resetForm','id' => 'whatsAppMessengerForm','class' => 'conversation-compose','dataShowProcessing' => 'false','action' => route('vendor.chat_message.send.process')]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('lw.form'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['data-callback' => 'appFuncs.resetForm','id' => 'whatsAppMessengerForm','class' => 'conversation-compose','data-show-processing' => 'false','action' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('vendor.chat_message.send.process'))]); ?>
                                                    <input type="hidden" name="contact_uid"
                                                        value="<?php echo e($contact->_uid); ?>">
                                                    
                                                    <div class="emoji">
                                                    </div>
                                                    <textarea name="message_body" required class="input-msg lw-input-emoji"
                                                        name="input" placeholder="<?php echo e(__tr(' Type a message')); ?>" autocomplete="off" autofocus></textarea>
                                                        <div class="photo dropup">
                                                            <!-- Default dropup button -->
                                                            <a href="#" class="lw-whatsapp-bar-icon-btn" data-toggle="dropdown" aria-expanded="false">
                                                                <i class=" fa fa-paperclip text-muted"></i>
                                                            </a>
                                                            <div class="dropdown-menu dropdown-menu-right">
                                                                <a title="<?php echo e(__tr('Send Document')); ?>"
                                                            class="lw-ajax-link-action dropdown-item" data-toggle="modal"
                                                            data-response-template="#lwWhatsappAttachment"
                                                            data-target="#lwMediaUploadAndSend"
                                                            data-callback="appFuncs.prepareUpload" href="<?php echo e(route('vendor.chat_message_media.upload.prepare', [
                                                            'mediaType' => 'document'
                                                        ])); ?>"><i class="fa fa-file text-muted"></i> <?php echo e(__tr('Send Document')); ?></a>
                                                        <a title="<?php echo e(__tr('Send Image')); ?>" class="lw-ajax-link-action dropdown-item"
                                                        data-toggle="modal"
                                                        data-response-template="#lwWhatsappAttachment"
                                                        data-target="#lwMediaUploadAndSend"
                                                        data-callback="appFuncs.prepareUpload" href="<?php echo e(route('vendor.chat_message_media.upload.prepare', [
                                                        'mediaType' => 'image'
                                                    ])); ?>"><i class="fa fa-image text-muted"></i> <?php echo e(__tr('Send Image')); ?></a>
                                                    <a title="<?php echo e(__tr('Send Video')); ?>" class="lw-ajax-link-action dropdown-item"
                                                    data-toggle="modal"
                                                    data-response-template="#lwWhatsappAttachment"
                                                    data-target="#lwMediaUploadAndSend"
                                                    data-callback="appFuncs.prepareUpload" href="<?php echo e(route('vendor.chat_message_media.upload.prepare', [
                                                    'mediaType' => 'video'
                                                ])); ?>"><i class="fa fa-video text-muted"></i> <?php echo e(__tr('Send Video')); ?></a>
                                                <a title="<?php echo e(__tr('Send Audio')); ?>" class="lw-ajax-link-action dropdown-item"
                                                data-toggle="modal"
                                                data-response-template="#lwWhatsappAttachment"
                                                data-target="#lwMediaUploadAndSend"
                                                data-callback="appFuncs.prepareUpload" href="<?php echo e(route('vendor.chat_message_media.upload.prepare', [
                                                'mediaType' => 'audio'
                                            ])); ?>"><i class="fa fa-headphones text-muted"></i> <?php echo e(__tr('Send Audio')); ?></a>
                                                            </div>
                                                        </div>
                                                    <button class="send" type="submit">
                                                        <div class="circle pl-2">
                                                            <svg xmlns="http://www.w3.org/2000/svg" width="1.5em"
                                                                height="1.5em" viewBox="0 0 24 24">
                                                                <path fill="currentColor"
                                                                    d="M2.01 21L23 12L2.01 3L2 10l15 2l-15 2z" />
                                                            </svg>
                                                        </div>
                                                    </button>
                                                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginald0b55ee435ec3aeeadffee8b0df479da)): ?>
<?php $attributes = $__attributesOriginald0b55ee435ec3aeeadffee8b0df479da; ?>
<?php unset($__attributesOriginald0b55ee435ec3aeeadffee8b0df479da); ?>
<?php endif; ?>
<?php if (isset($__componentOriginald0b55ee435ec3aeeadffee8b0df479da)): ?>
<?php $component = $__componentOriginald0b55ee435ec3aeeadffee8b0df479da; ?>
<?php unset($__componentOriginald0b55ee435ec3aeeadffee8b0df479da); ?>
<?php endif; ?>
                                                
                                                <div data-form-id="#whatsAppMessengerForm"
                                                    class="lw-error-container-message_body p-2"></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php if (isset($component)) { $__componentOriginal64816a37b1766c5cb5d0bcd192fb685f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal64816a37b1766c5cb5d0bcd192fb685f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.lw.modal','data' => ['id' => 'lwMediaUploadAndSend','header' => __tr('Send Media'),'hasForm' => true,'dataPreCallback' => 'clearModelContainer']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('lw.modal'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['id' => 'lwMediaUploadAndSend','header' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(__tr('Send Media')),'hasForm' => true,'data-pre-callback' => 'clearModelContainer']); ?>
    <!--  document form -->
    <?php if (isset($component)) { $__componentOriginald0b55ee435ec3aeeadffee8b0df479da = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginald0b55ee435ec3aeeadffee8b0df479da = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.lw.form','data' => ['id' => 'lwMediaUploadAndSendForm','action' => route('vendor.chat_message_media.send.process'),'dataCallback' => 'appFuncs.modelSuccessCallback','dataCallbackParams' => ['modalId' => '#lwMediaUploadAndSend']]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('lw.form'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['id' => 'lwMediaUploadAndSendForm','action' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('vendor.chat_message_media.send.process')),'data-callback' => 'appFuncs.modelSuccessCallback','data-callback-params' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(['modalId' => '#lwMediaUploadAndSend'])]); ?>
        <!-- form body -->
        <input type="hidden" name="contact_uid" value="<?php echo e($contact->_uid); ?>">
        <div id="lwWhatsappAttachment" class="lw-form-modal-body"></div>
        <script type="text/template" id="lwWhatsappAttachment-template">
            <% if(__tData.mediaType == 'document') { %>
            <div class="form-group col-sm-12">
                <input id="lwDocumentMediaFilepond" type="file" data-allow-revert="true"
                    data-label-idle="<?php echo e(__tr('Select Document')); ?>" class="lw-file-uploader" data-instant-upload="true"
                    data-action="<?= route('media.upload_temp_media', 'whatsapp_document') ?>" id="lwDocumentField" data-file-input-element="#lwDocumentMedia" data-raw-upload-data-element="#lwRawDocumentMedia" data-allowed-media='<?= getMediaRestriction('whatsapp_document') ?>' />
                <input id="lwDocumentMedia" type="hidden" value="" name="uploaded_media_file_name" />
                <input type="hidden" value="document" name="media_type" />
            </div>
            <% } else if(__tData.mediaType == 'image') { %>
                <div class="form-group col-sm-12">
                    <input id="lwImageMediaFilepond" type="file" data-allow-revert="true"
                        data-label-idle="<?php echo e(__tr('Select Image')); ?>" class="lw-file-uploader" data-instant-upload="true"
                        data-action="<?= route('media.upload_temp_media', 'whatsapp_image') ?>" id="lwImageField" data-file-input-element="#lwImageMedia" data-raw-upload-data-element="#lwRawDocumentMedia" data-allowed-media='<?= getMediaRestriction('whatsapp_image') ?>' />
                    <input id="lwImageMedia" type="hidden" value="" name="uploaded_media_file_name" />
                    <input type="hidden" value="image" name="media_type" />
                </div>
                <% } else if(__tData.mediaType == 'video') { %>
                    <div class="form-group col-sm-12">
                        <input id="lwVideoMediaFilepond" type="file" data-allow-revert="true"
                            data-label-idle="<?php echo e(__tr('Select Video')); ?>" class="lw-file-uploader" data-instant-upload="true"
                            data-action="<?= route('media.upload_temp_media', 'whatsapp_video') ?>" id="lwVideoField" data-file-input-element="#lwVideoMedia" data-raw-upload-data-element="#lwRawDocumentMedia" data-allowed-media='<?= getMediaRestriction('whatsapp_video') ?>' />
                        <input id="lwVideoMedia" type="hidden" value="" name="uploaded_media_file_name" />
                        <input type="hidden" value="video" name="media_type" />
                    </div>
                <% } else if(__tData.mediaType == 'audio') { %>
                    <div class="form-group col-sm-12">
                        <input id="lwAudioMediaFilepond" type="file" data-allow-revert="true"
                            data-label-idle="<?php echo e(__tr('Select Audio')); ?>" class="lw-file-uploader" data-instant-upload="true"
                            data-action="<?= route('media.upload_temp_media', 'whatsapp_audio') ?>" id="lwAudioField" data-file-input-element="#lwAudioMedia" data-raw-upload-data-element="#lwRawDocumentMedia" data-allowed-media='<?= getMediaRestriction('whatsapp_audio') ?>' />
                        <input id="lwAudioMedia" type="hidden" value="" name="uploaded_media_file_name" />
                        <input type="hidden" value="audio" name="media_type" />
                    </div>
                <% } %>
                <input id="lwRawDocumentMedia" type="hidden" value="" name="raw_upload_data"/>
                <% if(__tData.mediaType != 'audio') { %>
                <?php if (isset($component)) { $__componentOriginalc48421d24039f3f08f3bb9a3b9254b69 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc48421d24039f3f08f3bb9a3b9254b69 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.lw.input-field','data' => ['type' => 'text','dataFormGroupClass' => '','label' => __tr('Caption'),'value' => '','name' => 'caption']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('lw.input-field'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['type' => 'text','data-form-group-class' => '','label' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(__tr('Caption')),'value' => '','name' => 'caption']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc48421d24039f3f08f3bb9a3b9254b69)): ?>
<?php $attributes = $__attributesOriginalc48421d24039f3f08f3bb9a3b9254b69; ?>
<?php unset($__attributesOriginalc48421d24039f3f08f3bb9a3b9254b69); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc48421d24039f3f08f3bb9a3b9254b69)): ?>
<?php $component = $__componentOriginalc48421d24039f3f08f3bb9a3b9254b69; ?>
<?php unset($__componentOriginalc48421d24039f3f08f3bb9a3b9254b69); ?>
<?php endif; ?>
                <% } %>
        </script>
        <!-- form footer -->
        <div class="modal-footer">
            <!-- Submit Button -->
            <button type="submit" class="btn btn-primary"><?php echo e(__('Send')); ?></button>
            <button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo e(__tr('Cancel')); ?></button>
        </div>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginald0b55ee435ec3aeeadffee8b0df479da)): ?>
<?php $attributes = $__attributesOriginald0b55ee435ec3aeeadffee8b0df479da; ?>
<?php unset($__attributesOriginald0b55ee435ec3aeeadffee8b0df479da); ?>
<?php endif; ?>
<?php if (isset($__componentOriginald0b55ee435ec3aeeadffee8b0df479da)): ?>
<?php $component = $__componentOriginald0b55ee435ec3aeeadffee8b0df479da; ?>
<?php unset($__componentOriginald0b55ee435ec3aeeadffee8b0df479da); ?>
<?php endif; ?>
    <!--/  document form -->
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal64816a37b1766c5cb5d0bcd192fb685f)): ?>
<?php $attributes = $__attributesOriginal64816a37b1766c5cb5d0bcd192fb685f; ?>
<?php unset($__attributesOriginal64816a37b1766c5cb5d0bcd192fb685f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal64816a37b1766c5cb5d0bcd192fb685f)): ?>
<?php $component = $__componentOriginal64816a37b1766c5cb5d0bcd192fb685f; ?>
<?php unset($__componentOriginal64816a37b1766c5cb5d0bcd192fb685f); ?>
<?php endif; ?>
<script>
     (function() {
        'use strict';
    document.addEventListener('alpine:init', () => {
        Alpine.data('initialMessageData', () => ({
            whatsappMessageLogs: <?php echo json_encode($whatsappMessageLog, 15, 512) ?>
        }));
        Alpine.data('initialContactListData', () => ({
            contacts: <?php echo json_encode($contacts, 15, 512) ?>
        }));
    });
})();
</script>
<?php $__env->startPush('head'); ?>
    <?php echo __yesset('dist/emojionearea/emojionearea.min.css', true); ?>

<?php $__env->stopPush(); ?>
<?php $__env->startPush('appScripts'); ?>
<?php echo __yesset('dist/emojionearea/emojionearea.min.js', true); ?>

<script>
(function($) {
    'use strict';
    window.lwScrollTo('#lwEndOfChats', true);
    window.lwMessengerEmojiArea = $(".lw-input-emoji").emojioneArea({
    useInternalCDN: true,
    pickerPosition: "top",
    searchPlaceholder: "<?php echo e(__tr('Search')); ?>",
    buttonTitle: "<?php echo e(__tr('Use the TAB key to insert emoji faster')); ?>",
    events: {
        'emojibtn.click': function (editor, event) {
            this.hidePicker();
        },
        keyUp: function (editor, event) {
            if (event && event.which == 13 && !event.shiftKey && $.trim(this.getText())) { // On Enter
                $('.lw-input-emoji').val(this.getText());
                $('#whatsAppMessengerForm').submit();
                this.hidePicker();
            }
        }
    }
});
})(jQuery);
</script>
<?php $__env->stopPush(); ?>
<?php else: ?>
<div class="container-fluid">
    <div class="col-12">
        <div class="alert alert-danger">
            <?php echo e(__tr('There isn\'t any contact to chat with. Create contact to start chat with.')); ?>

        </div>
    </div>
</div>
<?php endif; ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', ['title' => __tr('WhatsApp Chat')], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\zap\resources\views/whatsapp/chat.blade.php ENDPATH**/ ?>