@php $isEdit = $qr?->exists ?? false; $isChild = $isEdit ? (bool) $qr->parent_id : request()->parent_id; $action = $isEdit ? route('branch.qrs.update', ['qr' => $qr->id]) : route('branch.qrs.store', ['parent_id' => request('parent_id')]); $selectedStores = old('stores', $isEdit ? $qr->qrables->map(fn($item) => "{$item->qrable_id}-{$item->qrable_type}")->all() : []); $inheritStores = (bool) old('inherit_stores', $pageBuilder['inherit_stores']); $inheritCategories = (bool) old('page_builder.inherit_categories', $pageBuilder['inherit_categories']); $categoryDefaults = $pageBuilder['main_category_ids']; $categoryOrderDefaults = $pageBuilder['category_order']; if ($isChild && $inheritCategories) { $categoryParent = $isEdit ? $qr->parent : $parent; $categoryDefaults = $categoryParent?->pageBuilderConfig()['main_category_ids'] ?? $categoryDefaults; $categoryOrderDefaults = $categoryParent?->pageBuilderConfig()['category_order'] ?? $categoryOrderDefaults; } $selectedCategories = old('page_builder.main_category_ids', $categoryDefaults ?: ['all']); @endphp
@if (!$isChild) @endif

@lang('qr_builder.page_builder')

@if ($isChild) @endif @foreach (['ar', 'en'] as $contactLocale) @endforeach

@lang('qr_builder.display_options')

@include('branch.portfolio.partials.social-links') @foreach (['show_hero', 'show_search', 'show_section_nav', 'show_contact', 'show_language', 'show_footer', 'show_install_pwa', 'show_survey'] as $option) @endforeach

@lang('qr_builder.manage_category_sections')

@lang('qr_builder.category_visibility')

@lang('qr_builder.category_visibility_help')

@if ($isChild)
@else @endif
$inheritCategories])>

@lang('qr_builder.category_order_help')

@foreach ($mainCategories->where('id', '!=', 'all') as $categoryOption) @endforeach

@lang('qr_builder.stores')

@lang('qr_builder.store_assignment_help')

@if ($isChild)
@else @endif
$inheritStores])>
@php($identity = $pageBuilder['identity'])
@include('branch.portfolio.partials.identity')