updated chat.min.js
Added template generation