@php $input = 'w-full rounded-xl border border-input bg-card px-3 text-[15px] outline-none transition placeholder:text-muted-foreground/70 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 sm:text-sm'; $heading = fn (int $n, string $title) => ''.e($title); @endphp {{-- Port of order-builder.tsx: ONE card with four numbered steps (worksite, materials, note, summary + submit). --}}
@if ($created)

{{ __('orders.builder.success.title') }}

{{ $created['number'] }}

{{ __('orders.worksite.label') }}
{{ $created['worksite'] }}
{{ __('orders.builder.success.submitted') }}
{{ $created['submitted'] }}
{{ __('orders.builder.success.items') }}
{{ $created['count'] }}
{{ __('orders.builder.success.expected') }}
@if ($created['expected']){{ $fmt($created['expected']) }} ({{ __('orders.delivery.provisional') }})@else—@endif

{{ __('orders.delivery.notice') }}

{{ __('orders.builder.success.saved') }}

{{ __('orders.builder.success.viewOrders') }}
@else
{{-- 1 · Worksite / order location (one per order) --}}

{!! $heading(1, __('orders.builder.worksite.label')) !!}

@foreach ($suggestions as $s)@endforeach @if (in_array($error, ['WORKSITE_REQUIRED', 'WORKSITE_TOO_LONG'])) @else

{{ __('orders.builder.worksite.helper') }}

@endif
{{-- 2 · Materials --}}

{!! $heading(2, __('orders.builder.lines.title')) !!}

    @foreach ($lines as $i => $line)
  • ! empty($lineErrors[$i]), 'border-border focus-within:border-primary/40' => empty($lineErrors[$i])])>
    @if (! empty($lineErrors[$i]))@endif
  • @endforeach
@if (count($lines) < $maxLines) @endif
{{-- 3 · Optional note --}}

{!! $heading(3, __('orders.builder.notes.title')) !!}

{{-- 4 · Summary + submit --}}

{!! $heading(4, __('orders.builder.summary.title')) !!}

{{ __('orders.builder.summary.worksite') }}
@if (trim($worksite) !== ''){{ trim($worksite) }}@else—@endif
{{ __('orders.builder.summary.items') }}
{{ $nonEmpty }}
@if ($totals)
@foreach ($totals as $t){{ $t['total'] }} {{ __('orders.units.'.$t['unit']->langKey()) }}{{ ! $loop->last ? ', ' : '' }}@endforeach
@endif
{{ __('orders.builder.summary.expected') }}
{{ $fmt($preview) }} ({{ __('orders.delivery.provisional') }})

{{ __('orders.delivery.notice') }}

@if ($error && ! in_array($error, ['WORKSITE_REQUIRED', 'WORKSITE_TOO_LONG']))@endif
@endif