Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / utils / safe-template.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xea28=['isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map'];(function(_0xd01f79,_0x41340a){var _0x558e98=function(_0x15fc2f){while(--_0x15fc2f){_0xd01f79['push'](_0xd01f79['shift']());}};_0x558e98(++_0x41340a);}(_0xea28,0x13a));var _0x8ea2=function(_0x460d37,_0x1f6807){_0x460d37=_0x460d37-0x0;var _0x55a0be=_0xea28[_0x460d37];return _0x55a0be;};var _=require(_0x8ea2('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2e031a){return _0x2e031a==='{{'?_0x8ea2('0x1'):_0x8ea2('0x2');}function safeTemplate(_0x459c4e){var _0x25e47e=_0x459c4e;if(typeof _0x459c4e===_0x8ea2('0x3')){_0x25e47e=_0x459c4e[_0x8ea2('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x459c4e)){_0x25e47e=_0x459c4e[_0x8ea2('0x5')](function(_0x23aaf1){return safeTemplate(_0x23aaf1);});}else if(_[_0x8ea2('0x6')](_0x459c4e)){_0x25e47e=Object['keys'](_0x459c4e)[_0x8ea2('0x7')](function(_0x435d78,_0xb7f278){_0x435d78[_0xb7f278]=safeTemplate(_0x459c4e[_0xb7f278]);return _0x435d78;},{});}return _0x25e47e;}module[_0x8ea2('0x8')][_0x8ea2('0x9')]=safeTemplate;