<?php $__env->startSection('content'); ?>

<div class="container py-60">
    <div class="card">
        <div class="card-body text-white rounded">
            <?php if(auth()->user()->referrer): ?>
                <h4 class="mb-2"><?php echo app('translator')->get('You are referred by'); ?> <?php echo e(auth()->user()->referrer->fullname); ?></h4>
            <?php endif; ?>
            <div class="col-md-12 mb-4">
                <label><?php echo app('translator')->get('Referral Link'); ?></label>
                <div class="input-group">
                    <input type="text" name="text" class="form-control form--control referralURL"
                        value="<?php echo e(route('home')); ?>?reference=<?php echo e(auth()->user()->username); ?>" readonly>
                        <span class="input-group-text copytext copyBoard" id="copyBoard"> <i class="fa fa-copy"></i> </span>
                </div>
            </div>
            <?php if($user->allReferrals->count() > 0 && $maxLevel > 0): ?>
            <div class="treeview-container">
                <ul class="treeview">
                    <li class="items-expanded"> <?php echo e($user->fullname); ?> ( <?php echo e($user->username); ?> )
                        <?php echo $__env->make($activeTemplate.'partials.under_tree',['user'=>$user,'layer'=>0,'isFirst'=>true], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    </li>
                </ul>
            </div>
            <?php endif; ?>
        </div>
    </div>
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startPush('style-lib'); ?>
    <link href="<?php echo e(asset('assets/global/css/jquery.treeView.css')); ?>" rel="stylesheet" type="text/css">
<?php $__env->stopPush(); ?>

<?php $__env->startPush('script'); ?>
<script src="<?php echo e(asset('assets/global/js/jquery.treeView.js')); ?>"></script>
<script>
    (function($){
    "use strict"
        $('.treeview').treeView();
        $('.copyBoard').click(function(){
                var copyText = document.getElementsByClassName("referralURL");
                copyText = copyText[0];
                copyText.select();
                copyText.setSelectionRange(0, 99999);

                /*For mobile devices*/
                document.execCommand("copy");
                copyText.blur();
                this.classList.add('copied');
                setTimeout(() => this.classList.remove('copied'), 1500);
        });
    })(jQuery);
</script>
<?php $__env->stopPush(); ?>


<?php $__env->startPush('style'); ?>
<style>
    .copied::after {
        background-color: var(--main);
    }
</style>
<?php $__env->stopPush(); ?>

<?php echo $__env->make($activeTemplate.'layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/trad84539424/public_html/core/resources/views/templates/basic/user/referrals.blade.php ENDPATH**/ ?>