
<?php $__env->startSection('title', $title); ?>
<?php $__env->startSection('content'); ?>
<div class="min-h-screen bg-gray-900 p-4 md:p-6" x-data="cryptoExchange()" x-init="init()">
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.danger-alert','data' => []]); ?>
<?php $component->withName('danger-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.success-alert','data' => []]); ?>
<?php $component->withName('success-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>

    <!-- System Status Notice -->
    <div class="mb-6">
        <div class="bg-blue-900/50 border border-blue-700 rounded-xl p-4">
            <div class="flex items-start gap-3">
                <div class="w-5 h-5 bg-blue-500 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5">
                    <i data-lucide="info" class="w-3 h-3 text-white"></i>
                </div>
                <div>
                    <h3 class="text-blue-200 font-medium text-sm mb-1">Exchange System Enhanced</h3>
                    <p class="text-blue-300 text-xs leading-relaxed">
                        Our exchange now uses multiple price sources with database fallback for improved reliability.
                        If you experience any pricing issues, please refresh the page or contact support.
                    </p>
                </div>
                <button onclick="this.parentElement.parentElement.parentElement.style.display='none'"
                        class="text-blue-400 hover:text-blue-300 ml-auto flex-shrink-0">
                    <i data-lucide="x" class="w-4 h-4"></i>
                </button>
            </div>
        </div>
    </div>

    <!-- Header Section -->
    <div class="mb-8">
        <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
            <div>
                <h1 class="text-2xl md:text-3xl font-bold text-white mb-2">Crypto Exchange</h1>
                <p class="text-gray-400 text-sm md:text-base">
                    Trade cryptocurrencies with real-time pricing and low fees
                </p>
            </div>
            <div class="flex flex-col sm:flex-row gap-3">
                <a href="<?php echo e(route('swaphistory')); ?>"
                   class="inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-lg transition-colors duration-200">
                    <i data-lucide="history" class="w-4 h-4 mr-2"></i>
                    Transaction History
                </a>
            </div>
        </div>
    </div>

    <!-- Portfolio Overview Cards -->
    <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-6 mb-8">
        <!-- USD Balance Card -->
        <div class="bg-gray-800 border border-gray-700 rounded-xl p-6 hover:border-blue-500/50 transition-all duration-300">
            <div class="flex items-center justify-between mb-4">
                <div class="w-12 h-12 bg-green-500/20 rounded-xl flex items-center justify-center">
                    <i data-lucide="dollar-sign" class="w-6 h-6 text-green-400"></i>
                </div>
                <div class="text-right">
                    <p class="text-xs text-gray-400 uppercase tracking-wide">Account Balance</p>
                    <p class="text-lg font-bold text-white">
                        <?php echo e(Auth::user()->currency); ?><?php echo e(number_format(Auth::user()->account_bal, 2, '.', ',')); ?>

                    </p>
                </div>
            </div>
            <div class="w-full h-1 bg-gray-700 rounded-full">
                <div class="w-full h-full bg-gradient-to-r from-green-400 to-green-500 rounded-full"></div>
            </div>
        </div>

        <!-- Crypto Balance Cards -->
        <?php if($moresettings->btc == 'enabled'): ?>
        <div class="bg-gray-800 border border-gray-700 rounded-xl p-6 hover:border-orange-500/50 transition-all duration-300">
            <div class="flex items-center justify-between mb-4">
                <div class="w-12 h-12 bg-orange-500/20 rounded-xl flex items-center justify-center">
                    <img src="https://img.icons8.com/color/48/000000/bitcoin--v1.png" alt="BTC" class="w-8 h-8">
                </div>
                <div class="text-right">
                    <p class="text-xs text-gray-400 uppercase tracking-wide">Bitcoin</p>
                    <p class="text-lg font-bold text-white"><?php echo e(round($cbalance->btc, 8)); ?> BTC</p>
                    <p class="text-xs text-gray-400 usdelement" id="btc">Loading...</p>
                </div>
            </div>
            <div class="w-full h-1 bg-gray-700 rounded-full">
                <div class="w-3/4 h-full bg-gradient-to-r from-orange-400 to-orange-500 rounded-full"></div>
            </div>
        </div>
        <?php endif; ?>

        <?php if($moresettings->eth == 'enabled'): ?>
        <div class="bg-gray-800 border border-gray-700 rounded-xl p-6 hover:border-blue-500/50 transition-all duration-300">
            <div class="flex items-center justify-between mb-4">
                <div class="w-12 h-12 bg-blue-500/20 rounded-xl flex items-center justify-center">
                    <img src="https://img.icons8.com/fluency/48/000000/ethereum.png" alt="ETH" class="w-8 h-8">
                </div>
                <div class="text-right">
                    <p class="text-xs text-gray-400 uppercase tracking-wide">Ethereum</p>
                    <p class="text-lg font-bold text-white"><?php echo e(round($cbalance->eth, 8)); ?> ETH</p>
                    <p class="text-xs text-gray-400 usdelement" id="eth">Loading...</p>
                </div>
            </div>
            <div class="w-full h-1 bg-gray-700 rounded-full">
                <div class="w-2/3 h-full bg-gradient-to-r from-blue-400 to-blue-500 rounded-full"></div>
            </div>
        </div>
        <?php endif; ?>

        <?php if($moresettings->usdt == 'enabled'): ?>
        <div class="bg-gray-800 border border-gray-700 rounded-xl p-6 hover:border-green-500/50 transition-all duration-300">
            <div class="flex items-center justify-between mb-4">
                <div class="w-12 h-12 bg-green-500/20 rounded-xl flex items-center justify-center">
                    <img src="https://img.icons8.com/color/48/000000/tether--v2.png" alt="USDT" class="w-8 h-8">
                </div>
                <div class="text-right">
                    <p class="text-xs text-gray-400 uppercase tracking-wide">Tether</p>
                    <p class="text-lg font-bold text-white"><?php echo e(round($cbalance->usdt, 8)); ?> USDT</p>
                    <p class="text-xs text-gray-400"><?php echo e(Auth::user()->currency); ?><?php echo e(number_format(round($cbalance->usdt))); ?></p>
                </div>
            </div>
            <div class="w-full h-1 bg-gray-700 rounded-full">
                <div class="w-full h-full bg-gradient-to-r from-green-400 to-green-500 rounded-full"></div>
            </div>
        </div>
        <?php endif; ?>

        <!-- Additional crypto cards with improved styling -->
        <!-- Additional crypto cards with improved styling -->
        <?php if($moresettings->ltc == 'enabled'): ?>
        <div class="bg-gray-800 border border-gray-700 rounded-xl p-6 hover:border-gray-400/50 transition-all duration-300">
            <div class="flex items-center justify-between mb-4">
                <div class="w-12 h-12 bg-gray-500/20 rounded-xl flex items-center justify-center">
                    <img src="https://img.icons8.com/fluency/48/000000/litecoin.png" alt="LTC" class="w-8 h-8">
                </div>
                <div class="text-right">
                    <p class="text-xs text-gray-400 uppercase tracking-wide">Litecoin</p>
                    <p class="text-lg font-bold text-white"><?php echo e(round($cbalance->ltc, 8)); ?> LTC</p>
                    <p class="text-xs text-gray-400 usdelement" id="ltc">Loading...</p>
                </div>
            </div>
            <div class="w-full h-1 bg-gray-700 rounded-full">
                <div class="w-1/2 h-full bg-gradient-to-r from-gray-400 to-gray-500 rounded-full"></div>
            </div>
        </div>
        <?php endif; ?>

        <?php if($moresettings->xrp == 'enabled'): ?>
        <div class="bg-gray-800 border border-gray-700 rounded-xl p-6 hover:border-blue-400/50 transition-all duration-300">
            <div class="flex items-center justify-between mb-4">
                <div class="w-12 h-12 bg-blue-400/20 rounded-xl flex items-center justify-center">
                    <img src="https://img.icons8.com/fluency/48/000000/ripple.png" alt="XRP" class="w-8 h-8">
                </div>
                <div class="text-right">
                    <p class="text-xs text-gray-400 uppercase tracking-wide">Ripple</p>
                    <p class="text-lg font-bold text-white"><?php echo e(round($cbalance->xrp, 8)); ?> XRP</p>
                    <p class="text-xs text-gray-400 usdelement" id="xrp">Loading...</p>
                </div>
            </div>
            <div class="w-full h-1 bg-gray-700 rounded-full">
                <div class="w-1/3 h-full bg-gradient-to-r from-blue-400 to-blue-500 rounded-full"></div>
            </div>
        </div>
        <?php endif; ?>

        <!-- Show additional crypto cards in a collapsible section for mobile -->
        <div x-data="{ showMore: false }" class="col-span-full">
            <div x-show="!showMore" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-6">
                <?php $cryptos = collect(['link', 'bnb', 'ada', 'aave', 'bch', 'xlm'])->filter(function($crypto) use($moresettings) { return $moresettings->$crypto == 'enabled'; })->take(4); ?>
                <?php $__currentLoopData = $cryptos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $crypto): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="bg-gray-800 border border-gray-700 rounded-xl p-6 hover:border-purple-500/50 transition-all duration-300">
                    <div class="flex items-center justify-between mb-4">
                        <div class="w-12 h-12 bg-purple-500/20 rounded-xl flex items-center justify-center">
                            <?php switch($crypto):
                                case ('link'): ?>
                                    <img src="https://img.icons8.com/cotton/64/000000/chainlink.png" alt="LINK" class="w-8 h-8">
                                    <?php break; ?>
                                <?php case ('bnb'): ?>
                                    <img src="https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png" alt="BNB" class="w-8 h-8">
                                    <?php break; ?>
                                <?php case ('ada'): ?>
                                    <img src="https://s2.coinmarketcap.com/static/img/coins/64x64/2010.png" alt="ADA" class="w-8 h-8">
                                    <?php break; ?>
                                <?php case ('aave'): ?>
                                    <img src="https://dynamic-assets.coinbase.com/6ad513d3c9108b163cf0a4c9fd3441cadcb9cf656ea7b9fb333eb7e4a94cd503528e0a94188285d31aedfc392f0793fd4161f7ad4e04d5f6b82e4d70a314d295/asset_icons/80f3d2256652f5ccd680fc48702d130dd01f1bd7c9737fac560a02949efac3b9.png" alt="AAVE" class="w-6 h-6">
                                    <?php break; ?>
                                <?php case ('bch'): ?>
                                    <img src="https://img.icons8.com/material-sharp/24/000000/bitcoin.png" alt="BCH" class="w-8 h-8">
                                    <?php break; ?>
                                <?php case ('xlm'): ?>
                                    <img src="https://img.icons8.com/ios/50/000000/stellar.png" alt="XLM" class="w-8 h-8">
                                    <?php break; ?>
                            <?php endswitch; ?>
                        </div>
                        <div class="text-right">
                            <p class="text-xs text-gray-400 uppercase tracking-wide"><?php echo e(strtoupper($crypto)); ?></p>
                            <p class="text-lg font-bold text-white"><?php echo e(round($cbalance->$crypto, 8)); ?> <?php echo e(strtoupper($crypto)); ?></p>
                            <p class="text-xs text-gray-400 usdelement" id="<?php echo e($crypto); ?>">Loading...</p>
                        </div>
                    </div>
                    <div class="w-full h-1 bg-gray-700 rounded-full">
                        <div class="w-1/4 h-full bg-gradient-to-r from-purple-400 to-purple-500 rounded-full"></div>
                    </div>
                </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>

            <?php if($cryptos->count() > 4): ?>
            <div class="flex justify-center mt-4">
                <button @click="showMore = !showMore"
                        class="px-4 py-2 bg-gray-800 hover:bg-gray-700 text-white text-sm font-medium rounded-lg border border-gray-600 transition-colors duration-200">
                    <span x-text="showMore ? 'Show Less' : 'Show More Assets'"></span>
                    <i data-lucide="chevron-down" x-bind:class="showMore ? 'rotate-180' : ''" class="w-4 h-4 ml-2 inline transition-transform duration-200"></i>
                </button>
            </div>
            <?php endif; ?>
        </div>
    </div>

    <!-- Main Trading Interface -->
    <div class="grid grid-cols-1 xl:grid-cols-3 gap-6 md:gap-8">
        <!-- Trading Chart -->
        <div class="xl:col-span-2">
            <div class="bg-gray-800 border border-gray-700 rounded-xl p-4 md:p-6">
                <div class="flex items-center justify-between mb-6">
                    <h2 class="text-xl font-bold text-white">Market Chart</h2>
                    <div class="flex items-center space-x-2">
                        <div class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></div>
                        <span class="text-xs text-gray-400">Live Data</span>
                    </div>
                </div>
                <div class="tradingview-widget-container">
                    <div id="tradingview_f933e" class="rounded-lg overflow-hidden"></div>
                </div>
            </div>
        </div>

        <!-- Exchange Form -->
        <div class="xl:col-span-1">
            <div class="bg-gray-800 border border-gray-700 rounded-xl p-4 md:p-6">
                <div class="flex items-center justify-between mb-6">
                    <h2 class="text-xl font-bold text-white">Quick Exchange</h2>
                    <div class="px-3 py-1 bg-blue-500/20 text-blue-400 text-xs font-medium rounded-full">
                        Fee: <?php echo e($moresettings->fee); ?>%
                    </div>
                </div>

                <form method="POST" action="javascript:void(0)" id="exchnageform" class="space-y-6">
                    <!-- From Currency -->
                    <div class="space-y-2">
                        <label class="block text-sm font-medium text-gray-300">From</label>
                        <div class="relative">
                            <select name="source" id="sourceasset"
                                    class="w-full bg-gray-900 border border-gray-600 text-white rounded-lg px-4 py-3 focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 appearance-none cursor-pointer">
                                <?php if($moresettings->btc == 'enabled'): ?>
                                    <option value="btc">Bitcoin (BTC)</option>
                                <?php endif; ?>
                                <?php if($moresettings->eth == 'enabled'): ?>
                                    <option value="eth">Ethereum (ETH)</option>
                                <?php endif; ?>
                                <?php if($moresettings->usdt == 'enabled'): ?>
                                    <option value="usdt">Tether (USDT)</option>
                                <?php endif; ?>
                                <?php if($moresettings->ltc == 'enabled'): ?>
                                    <option value="ltc">Litecoin (LTC)</option>
                                <?php endif; ?>
                                <?php if($moresettings->xrp == 'enabled'): ?>
                                    <option value="xrp">Ripple (XRP)</option>
                                <?php endif; ?>
                                <?php if($moresettings->link == 'enabled'): ?>
                                    <option value="link">Chainlink (LINK)</option>
                                <?php endif; ?>
                                <?php if($moresettings->bnb == 'enabled'): ?>
                                    <option value="bnb">Binance Coin (BNB)</option>
                                <?php endif; ?>
                                <?php if($moresettings->ada == 'enabled'): ?>
                                    <option value="ada">Cardano (ADA)</option>
                                <?php endif; ?>
                                <?php if($moresettings->aave == 'enabled'): ?>
                                    <option value="aave">Aave (AAVE)</option>
                                <?php endif; ?>
                                <?php if($moresettings->bch == 'enabled'): ?>
                                    <option value="bch">Bitcoin Cash (BCH)</option>
                                <?php endif; ?>
                                <?php if($moresettings->xlm == 'enabled'): ?>
                                    <option value="xlm">Stellar (XLM)</option>
                                <?php endif; ?>
                                <option value="usd">US Dollar (USD)</option>
                            </select>
                            <i data-lucide="chevron-down" class="absolute right-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"></i>
                        </div>
                    </div>

                    <!-- Swap Icon -->
                    <div class="flex justify-center">
                        <button type="button" @click="swapCurrencies()"
                                class="w-10 h-10 bg-blue-600 hover:bg-blue-700 rounded-full flex items-center justify-center transition-all duration-200 hover:scale-110">
                            <i data-lucide="arrow-up-down" class="w-5 h-5 text-white"></i>
                        </button>
                    </div>

                    <!-- To Currency -->
                    <div class="space-y-2">
                        <label class="block text-sm font-medium text-gray-300">To</label>
                        <div class="relative">
                            <select name="destination" id="destinationasset"
                                    class="w-full bg-gray-900 border border-gray-600 text-white rounded-lg px-4 py-3 focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 appearance-none cursor-pointer">
                                <option value="usd">US Dollar (USD)</option>
                                <?php if($moresettings->btc == 'enabled'): ?>
                                    <option value="btc">Bitcoin (BTC)</option>
                                <?php endif; ?>
                                <?php if($moresettings->eth == 'enabled'): ?>
                                    <option value="eth">Ethereum (ETH)</option>
                                <?php endif; ?>
                                <?php if($moresettings->usdt == 'enabled'): ?>
                                    <option value="usdt">Tether (USDT)</option>
                                <?php endif; ?>
                                <?php if($moresettings->ltc == 'enabled'): ?>
                                    <option value="ltc">Litecoin (LTC)</option>
                                <?php endif; ?>
                                <?php if($moresettings->xrp == 'enabled'): ?>
                                    <option value="xrp">Ripple (XRP)</option>
                                <?php endif; ?>
                                <?php if($moresettings->link == 'enabled'): ?>
                                    <option value="link">Chainlink (LINK)</option>
                                <?php endif; ?>
                                <?php if($moresettings->bnb == 'enabled'): ?>
                                    <option value="bnb">Binance Coin (BNB)</option>
                                <?php endif; ?>
                                <?php if($moresettings->ada == 'enabled'): ?>
                                    <option value="ada">Cardano (ADA)</option>
                                <?php endif; ?>
                                <?php if($moresettings->aave == 'enabled'): ?>
                                    <option value="aave">Aave (AAVE)</option>
                                <?php endif; ?>
                                <?php if($moresettings->bch == 'enabled'): ?>
                                    <option value="bch">Bitcoin Cash (BCH)</option>
                                <?php endif; ?>
                                <?php if($moresettings->xlm == 'enabled'): ?>
                                    <option value="xlm">Stellar (XLM)</option>
                                <?php endif; ?>
                            </select>
                            <i data-lucide="chevron-down" class="absolute right-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400 pointer-events-none"></i>
                        </div>
                        <p class="text-xs text-gray-400">
                            <i data-lucide="info" class="w-3 h-3 inline mr-1"></i>
                            USD represents your account balance
                        </p>
                    </div>

                    <!-- Amount Input -->
                    <div class="space-y-2">
                        <label class="block text-sm font-medium text-gray-300">Amount</label>
                        <div class="relative">
                            <input type="text" name="amount" id="amount"
                                   placeholder="0.00000000"
                                   class="w-full bg-gray-900 border border-gray-600 text-white rounded-lg px-4 py-3 focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 placeholder-gray-500">
                            <div class="absolute right-3 top-1/2 transform -translate-y-1/2 text-xs text-gray-400 pointer-events-none" x-text="sourceSymbol"></div>
                        </div>
                    </div>

                    <!-- Estimated Amount -->
                    <div class="space-y-2">
                        <label class="block text-sm font-medium text-gray-300">You'll Receive</label>
                        <div class="relative">
                            <input type="text" id="quantity" readonly
                                   placeholder="0.00000000"
                                   class="w-full bg-gray-900 border border-gray-600 text-gray-300 rounded-lg px-4 py-3 cursor-not-allowed">
                            <div class="absolute right-3 top-1/2 transform -translate-y-1/2 text-xs text-gray-400 pointer-events-none" x-text="destSymbol"></div>
                        </div>
                        <input type="hidden" id="realquantity" name="quantity">
                    </div>

                    <!-- Exchange Rate & Fee Info -->
                    <div class="bg-gray-900 rounded-lg p-4 space-y-2" x-show="exchangeRate" x-transition>
                        <div class="flex justify-between text-sm">
                            <span class="text-gray-400">Exchange Rate</span>
                            <span class="text-white" x-text="exchangeRate"></span>
                        </div>
                        <div class="flex justify-between text-sm">
                            <span class="text-gray-400">Trading Fee (<?php echo e($moresettings->fee); ?>%)</span>
                            <span class="text-white" x-text="feeAmount"></span>
                        </div>
                        <div class="border-t border-gray-700 pt-2 flex justify-between text-sm font-medium">
                            <span class="text-gray-300">Total</span>
                            <span class="text-white" x-text="totalAmount"></span>
                        </div>
                    </div>

                    <!-- Submit Button -->
                    <button type="submit"
                            class="w-full bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white font-semibold py-3 px-4 rounded-lg transition-all duration-200 transform hover:scale-105 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100"
                            :disabled="isLoading || !amount">
                        <span x-show="!isLoading" class="flex items-center justify-center">
                            <i data-lucide="repeat" class="w-5 h-5 mr-2"></i>
                            Exchange Now
                        </span>
                        <span x-show="isLoading" class="flex items-center justify-center">
                            <svg class="animate-spin -ml-1 mr-3 h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
                                <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
                                <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
                            </svg>
                            Processing...
                        </span>
                    </button>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- Enhanced TradingView Script -->
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
<script type="text/javascript">
    document.addEventListener('DOMContentLoaded', function() {
        new TradingView.widget({
            "width": "100%",
            "height": "400",
            "symbol": "COINBASE:BTCUSD",
            "interval": "1",
            "timezone": "Etc/UTC",
            "theme": "dark",
            "style": "1",
            "locale": "en",
            "toolbar_bg": "#1f2937",
            "enable_publishing": false,
            "hide_side_toolbar": false,
            "allow_symbol_change": true,
            "calendar": false,
            "studies": ["BB@tv-basicstudies"],
            "container_id": "tradingview_f933e"
        });
    });
</script>

<!-- Alpine.js Exchange Component -->
<script>
function cryptoExchange() {
    return {
        isLoading: false,
        exchangeRate: '',
        feeAmount: '',
        totalAmount: '',
        sourceSymbol: 'BTC',
        destSymbol: 'USD',
        amount: '',

        init() {
            this.updateSymbols();
            lucide.createIcons();
        },

        updateSymbols() {
            const source = document.getElementById('sourceasset').value.toUpperCase();
            const dest = document.getElementById('destinationasset').value.toUpperCase();
            this.sourceSymbol = source;
            this.destSymbol = dest;
        },

        swapCurrencies() {
            const sourceSelect = document.getElementById('sourceasset');
            const destSelect = document.getElementById('destinationasset');
            const tempValue = sourceSelect.value;
            sourceSelect.value = destSelect.value;
            destSelect.value = tempValue;
            this.updateSymbols();
            document.getElementById('amount').value = '';
            document.getElementById('quantity').value = '';
            document.getElementById('realquantity').value = '';
        }
    }
}
</script>

<?php echo $__env->make('user.exchangescript', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.dasht', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/elitemaxpro/trade.elitemaxpro.click/resources/views/user/asset.blade.php ENDPATH**/ ?>