config.availableFields may be undefined or a non-array value (e.g. {}),
causing TypeError when calling .includes/.every directly on it.
Precompute cfgAvailableFields with Array.isArray guard before use.
Fixes: N.includes is not a function on rules/new page.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When config.fields is a non-array value (e.g. empty object {}),
the fallback logic could still result in a non-array if both
config.fields and config.selectedFields are abnormal values.
Added double-guard: after the fallback chain, explicitly assert
Array.isArray before using selectedFields.includes().
Fixes: TypeError: _.includes is not a function on rules/new page.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>