{{ $macroId === null ? __('New macro') : __('Edit macro') }} {{-- Placeholder example sentence intentionally NOT included here. Why: Blade's preprocessor scans the entire template for `{{ ... }}` pairs BEFORE PHP runs. Putting literal `{{ customer.first_name }}` (or even the escaped `@{{ ... }}` form) inside an outer `{{ __('…') }}` echo confuses the brace matcher and produces the "Unclosed '(' does not match '}'" parse error the operator hit on /macros/new and /macros/{id}/edit. The placeholder picker that lives directly above the reply textarea (below) already lists every placeholder with a click-to-insert button + live example, so this sentence would be redundant anyway. --}}

{{ __('Use the placeholder picker above each text box to insert real customer / order / store fields into your templates.') }}

{{-- Single full-width form column — the placeholder picker was hoisted INSIDE the form, directly above the two textareas it writes into, so operators don't have to dart their eyes to a sidebar to insert a field. --}}
{{ __('Name') }} {{ __('Shortcut (optional)') }} {{ __('Operators can search by this token in the composer typeahead.') }} {{ __('Scope') }} @foreach ($this->availableStores() as $store) @endforeach {{-- ─── Placeholder picker ────────────────────────────────────── Sits ABOVE the textareas it writes into. Compact (~200px tall, internally scrollable, never grows the surrounding page). Click any placeholder to insert at the cursor of the last-focused textarea — Reply by default. The picker is generated from MacroPlaceholderRegistry, so every key here is pinned by MacroPlaceholderRegistryTest to actually render via MacroContextBuilder + MacroPlaceholderRenderer. --}}
{{ __('Insert placeholder') }} {{ __('→ Reply template') }} {{ __('→ Internal note') }}
{{-- Scrollable list — fixed at exactly 400px tall per operator spec. `h-[400px]` pins the height so the picker always reserves the same vertical space regardless of how many placeholders match the filter; `overflow-y-auto` makes the inner content scroll. `overscroll-contain` keeps wheel scroll inside the picker so an over-aggressive scroll doesn't leak onto the surrounding form. --}}
@foreach ($this->placeholderCategories() as $category) @php $catKey = $category['key']; @endphp
{{ $category['label'] }}
    @foreach ($category['placeholders'] as $placeholder) @php // Use string concatenation rather than a double-quoted string // here too — defence in depth against any future Blade // preprocessor surprise around inline `{{ }}`-shaped // characters in a PHP string literal. $snippet = '{{ '.$placeholder['key'].' }}'; @endphp
  • @endforeach
@endforeach
{{ __('Reply template (optional)') }} {{-- `x-on:focusin` updates `lastFocused` the moment the textarea gains focus, even via keyboard tab. Click always also fires focusin so the picker target hint above updates instantly. --}} {{ __('Inserted into the public-reply composer when the operator picks this macro. Agent signatures are appended on send — don\'t hard-code them here.') }} {{ __('Internal note template (optional)') }} {{ __('Leave blank for plain canned replies — empty templates write no audit row.') }}
{{ __('Set ticket status') }} @foreach ($this->statusOptions() as $value => $label) @endforeach {{ __('Assignee') }} @foreach ($this->assigneeStrategyOptions() as $value => $label) @endforeach
{{ __('Intent') }} @foreach ($this->intentOptions() as $value => $label) @endforeach {{ __('Classifies the macro for analytics + future AI auto-suggest. Pick the closest match.') }} {{ __('Keywords (optional, comma-separated)') }} {{ __('Searched by the composer typeahead in addition to name + shortcut.') }} {{-- ─── Suggested action panel (read-only) ────────────────────── Shows the operational action this macro will suggest when an operator applies it from the inbox composer. Today attachments are authored via the seeder, so this panel is read-only — but the operator can always see WHAT this macro does without leaving the page. --}}
{{ __('Suggested action') }} @if ($attachedAction === null) {{ __('No action attached.') }} @endif
@if ($attachedAction !== null)
{{ $attachedAction['label'] }}
@if ($attachedAction['prefill_summary'] !== '')
{{ $attachedAction['prefill_summary'] }}
@endif
@if ($attachedAction['is_stub']) {{ __('Coming soon — blocks on confirm') }} @endif @if ($attachedAction['reason_required']) {{ __('Reason required on confirm') }} @else {{ __('No reason picker') }} @endif {{ $attachedAction['action_type'] }}
@endif

{{ __('Macro-attached actions never auto-execute. Operators confirm them from the inbox composer when the macro is applied.') }}

{{ $macroId === null ? __('Create macro') : __('Save changes') }} {{ __('Cancel') }}