@php
   
    $photourl = $currentUser->photourl[0] ?? '/resource-photos/No_image_available.svg.png';
    $name = $currentUser->name ?? $currentUser->nickname ?? $currentUser->fullname ?? $currentUser->username ?? '';
    $fullname = $currentUser->fullname ?? $currentUser->name ?? '';
    $mobile = $currentUser->mobile_number;
    $landline = $currentUser?->landline ?? '';
    $email = $currentUser->email;


    $script_asset = App\Http\Controllers\PageMemoryController::readPublicAssetInMemory('account_settings.js');
    if (!$script_asset) {
        echo 'empty asset';
    }

     $account_settings_loaded_text =  'let account_settings_loaded = true;';

@endphp
<script>
{!! $account_settings_loaded_text !!}
</script>

<br><br><br>
<div class="mt-1">
    <div class="tf-container">
        <div class="box-user">
            <div class="inner d-flex flex-column align-items-center justify-content-center">
                <div class="box-avatar">
                    <img src="{{ $photourl }}" id="account_settings_profile_picture" alt="image">
                    <span class="icon-camera-to-take-photos"></span>
                </div>
                <div class="info">
                    <h2 class="fw_8 mt-3 text-center" id="account_settings_fullname_profile">
                        {{ $name }}
                    </h2>
                    <p id="">
                    <h6 id="account_settings_credit_card_profile_pic"></h6> <i class="icon-copy1"></i></p>
                </div>
            </div>


        </div>
        <ul class="mt-7">
            <li class="list-user-info"><span class="icon-user"></span>
                <h5 id="account_settings_fullname_main"> {{ $fullname }}</h5>
            </li>
            <li class="list-user-info"><span class="icon-credit-card2"></span>
                <h4 id="account_settings_credit_card_main">{{ $mobile }}</h4>
            </li>
            <li class="list-user-info"><span class="icon-phone"></span>
                <h4 id="account_settings_mobile_number">{{ $landline }}</h4>
            </li>
            <li class="list-user-info"><span class="icon-email"></span>
                <h4 id="account_settings_email">{{ $email }}</h4>
            </li>
        </ul>
    </div>

</div>
<div class="card-section" id="main-card-section">



</div>

<br><br>


<script>

if (typeof window.account_settings_loaded === 'undefined') {
    let account_settings_loaded = false;
}

     account_settings_loaded = {{ $account_settings_loaded ?? false ? 'true' : 'false' }};

    {!! App\Http\Controllers\PageMemoryController::readAssetInMemory('account_settings.js') !!}
</script>

<script>

    $(document).ready(function () {
        if (typeof window.account_settings_loaded === 'undefined') {
            window.account_settings_loaded = false; 
        }

        if (!account_settings_loaded) {
            account_details_load_data();
        }
    });


</script>