  Aromatic infrared bands (AIBs) are a set of broad emission bands at 3.3, 6.2,
7.7, 8.6, 11.2, and 12.7 $\mu$m, seen in the infrared spectra of most galaxies.
With JWST, the 3.3 $\mu$m AIB can in principle be detected up to a redshift of
$\sim$ 7. Relating the evolution of the 3.3 $\mu$m AIB to local physical
properties of the ISM is thus of paramount importance. By applying a dedicated
machine learning algorithm to JWST NIRSpec observations of the Orion Bar
photodissociation region obtained as part of the PDRs4All Early Release Science
(ERS) program, we extracted two template spectra capturing the evolution of the
AIB-related emission in the 3.2-3.6 $\mu$m range, which includes the AIB at 3.3
$\mu$m and its main satellite band at 3.4 $\mu$m. In the Orion Bar, we analyze
the spatial distribution of the templates and their relationship with the
fluorescent emission of H$_2$ in the near infrared. We find that one template
("AIB$_{\rm Irrad}$") traces regions of neutral atomic gas with strong far-UV
fields, while the other template ("AIB$_{\rm Shielded}$") corresponds to
shielded regions with lower FUV fields and a higher molecular gas fraction. We
then show that these two templates can be used to fit the NIRSpec AIB-related
spectra of nearby galaxies. The relative weight of the two templates (AIB$_{\rm
Irrad/Shielded}$) is a tracer of the radiative feedback from massive stars on
the ISM. We derive an estimate of AIB$_{\rm Irrad/Shielded}$ in a $z$ = 4.22
lensed galaxy, and find that it has a lower value than for local galaxies. This
pilot study illustrates how a detailed analysis of AIB emission in nearby
regions can be used to probe the physical conditions of the extragalactic ISM.
