Thailand to extend state of emergency until mid-January