@extends('admin.layouts.app')

@section('title', $title)

@push('head')
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <!-- Material Icons -->
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" rel="stylesheet" />
@endpush

@section('content')
    <div class="row">
        <div class="col-12">
            <!-- mount point for Vue app -->
            <div id="product-manager-app"></div>
        </div>
    </div>
    @php
        $currencyConfig = [
            'symbol'   => html_entity_decode(ch_currency_symbol(setting('currency', 'USD'))),
            'code'     => setting('currency', 'USD'),
            'format'   => setting('price_format', '1'),
            'position' => setting('currency_position', 'left'),
        ];
    @endphp
    <script>
        window.ChargePandaConfig = {
            categories: @json($categories),
            constants: @json($constants),
            product: @json($product ?? null),
            routes: @json($routes ?? []),
            gallery: @json($gallery ?? []),
            available_products: @json($available_products ?? []),
            currency: @json($currencyConfig)
        };
        window.pricingModelsUrl = "{{ route('ch-admin.products.pricing-models.get') }}";
        window.planTabsUrl = "{{ route('ch-admin.products.plan-tabs.get') }}";
    </script>
@endsection

@push('head')
    <link rel="stylesheet" href="{{ url('assets/backend/css/jodit.min.css') }}">
@endpush

@push('scripts')
    <script src="{{ url('assets/backend/js/vendors/jodit.min.js') }}"></script>
    <script src="{{ asset('assets/backend/js/product_v3.js') }}"></script>
@endpush
