To resolve the Handlebars.js error that you are experiencing, it is recommended that you add cq.tsdk.handlebars as a dependency to the clientlib folder
I have created the content fragment and content fragment variants programmatically based on the data present in the map.
public static void createVariations(ResourceResolver resourceResolver, String variationTitle,Map<String, Object> variationData, String fragmentTitle, String pagePath, SlingHttpS...