{{-- No cap on how many providers a reseller may connect: the plan sells the ABILITY, it never meters the use of it. --}} {{-- The store's SUPPLY, one level above the grid: where what gets sold comes from. Only drawn here, and only a plan with its own providers opens this screen — for everyone else the platform catalogue isn't a switch they can move, it's their product. --}}
{{ __('Platform catalogue') }} {{ $usesOwnerCatalog ? __('On sale') : __('Not on sale') }}

@if ($usesOwnerCatalog) {{ __('You resell the platform catalogue alongside whatever your own providers supply.') }} @else {{ __('Your storefront sells only what your own providers supply. Turn it on to resell the platform catalogue too.') }} @endif

@if ($usesOwnerCatalog) @else @endif
@forelse ($providers as $p) @php $breaker = ['closed' => ['success', __('Healthy')], 'half_open' => ['warning', __('Recovering')], 'open' => ['danger', __('Tripped')]][$p->breaker_state] ?? ['neutral', $p->breaker_state]; // Seed for the sync modal: pre-fills the margin and the last // toggles for THIS provider with a deferred $set, so opening // the modal doesn't cost a request. $so = $p->sync_options ?? []; $syncSeed = [ 'syncProviderId' => $p->id, 'syncProviderName' => $p->name, // A provider already configured from this modal remembers // ITS OWN margin. A freshly connected one starts with the // panel's base commission — just like the owner's global // "price increment" governs every provider that hasn't set // one of its own. 'syncMarkup' => $so === [] && $baseCommission !== null ? $baseCommission : (rtrim(rtrim(number_format((float) $p->default_markup_percent, 2, '.', ''), '0'), '.') ?: '0'), 'syncScope' => ($so['scope'] ?? 'current') === 'all' ? 'all' : 'current', 'syncOriginalPrice' => (bool) ($so['sync_original_price'] ?? true), 'syncNewPrice' => (bool) ($so['sync_new_price'] ?? true), 'syncStatus' => (bool) ($so['sync_status'] ?? true), 'syncName' => (bool) ($so['sync_name'] ?? false), 'syncDescription' => (bool) ($so['sync_description'] ?? false), 'syncMin' => (bool) ($so['sync_min'] ?? true), 'syncMax' => (bool) ($so['sync_max'] ?? true), 'syncDripfeed' => (bool) ($so['sync_dripfeed'] ?? false), 'syncCancel' => (bool) ($so['sync_cancel'] ?? false), 'convertCurrency' => (bool) ($so['convert_currency'] ?? false), 'showSyncModal' => true, ]; @endphp @empty @endforelse
{{ __('Provider') }} {{ __('Balance') }} {{ __('Connected') }} {{ __('Breaker') }} {{ __('Status') }} {{ __('Action') }}
{{ $p->name }}
{{ $p->url }}
@if ($p->balance !== null) {{ money($p->balance, $p->currency_code ?: 'USD') }} @else {{-- Never checked: asking for it is more honest than showing a fake 0.00. --}} @endif {{ number_format($p->services_count) }} {{ $breaker[1] }} {{ __('Manage catalogue') }} @if ($p->scrape_enabled && $p->public_services_url) @endif
@error('name')

{{ $message }}

@enderror
@error('url')

{{ $message }}

@enderror
@error('api_key')

{{ $message }}

@enderror

{{ __('Stored encrypted at rest.') }}

{{-- ══ Metadata scraping — same block as the owner's ══ --}}
@error('public_services_url')

{{ $message }}

@enderror

{{ __('Public page listing this provider\'s services (no login required). Used to fetch descriptions and average delivery times.') }}

{{-- ══ Sync configuration modal — same as the owner's ══ --}}

{{ __('Configure the synchronisation for') }}

%

{{ __('Added over the provider cost to set the sale price. Auto-rounded to 2 decimals.') }}

{{ __('“Current” only updates imported services. “All” also imports upstream services not yet in your catalogue.') }}

{{ __('Your saved choices are remembered per provider. New price recalculates the sale price from the current cost and the percentage above.') }}