@rabbitio/ui-kit 1.0.0-beta.3 → 1.0.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -0
- package/README.md +23 -16
- package/dist/index.cjs +3150 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4480 -1635
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +2446 -11
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +3128 -11
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +3151 -12
- package/dist/index.umd.js.map +1 -1
- package/index.js +1 -1
- package/package.json +16 -23
- package/src/common/amountUtils.js +434 -0
- package/src/common/errorUtils.js +27 -0
- package/src/common/fiatCurrenciesService.js +161 -0
- package/src/common/models/blockchain.js +10 -0
- package/src/common/models/coin.js +157 -0
- package/src/common/models/protocol.js +5 -0
- package/src/common/utils/cache.js +268 -0
- package/src/common/utils/emailAPI.js +18 -0
- package/src/common/utils/logging/logger.js +48 -0
- package/src/common/utils/logging/logsStorage.js +61 -0
- package/src/common/utils/safeStringify.js +50 -0
- package/src/components/atoms/AssetIcon/AssetIcon.jsx +55 -0
- package/src/components/atoms/AssetIcon/asset-icon.module.scss +42 -0
- package/{stories → src/components}/atoms/LoadingDots/LoadingDots.module.scss +1 -1
- package/src/components/atoms/SupportChat/SupportChat.jsx +48 -0
- package/{stories → src/components}/atoms/buttons/Button/Button.jsx +11 -7
- package/{stories → src/components}/atoms/buttons/Button/Button.module.scss +6 -1
- package/src/components/hooks/useCallHandlingErrors.js +26 -0
- package/src/components/hooks/useReferredState.js +24 -0
- package/src/index.js +33 -0
- package/src/swaps-lib/external-apis/swapProvider.js +188 -0
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +856 -0
- package/src/swaps-lib/models/baseSwapCreationInfo.js +40 -0
- package/src/swaps-lib/models/existingSwap.js +58 -0
- package/src/swaps-lib/models/existingSwapWithFiatData.js +115 -0
- package/src/swaps-lib/services/publicSwapService.js +647 -0
- package/src/swaps-lib/utils/swapUtils.js +219 -0
- package/stories/index.js +0 -2
- /package/{stories → src/components}/atoms/LoadingDots/LoadingDots.jsx +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
var React = require('react');
|
|
2
|
-
var
|
|
2
|
+
var bignumber_js = require('bignumber.js');
|
|
3
|
+
var axios = require('axios');
|
|
4
|
+
var EventBusInstance = require('eventbusjs');
|
|
3
5
|
|
|
4
6
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
5
7
|
|
|
6
8
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
|
+
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
10
|
+
var EventBusInstance__default = /*#__PURE__*/_interopDefaultLegacy(EventBusInstance);
|
|
7
11
|
|
|
8
12
|
function createCommonjsModule(fn) {
|
|
9
13
|
var module = { exports: {} };
|
|
@@ -1156,9 +1160,9 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
1156
1160
|
|
|
1157
1161
|
var PropTypes = propTypes;
|
|
1158
1162
|
|
|
1159
|
-
var styles$1 = {"container":"_Og09u","button":"_Jk9i-","m-0":"_1KRN6","p-0":"_gcKRj","m-1":"_yWCA-","p-1":"_vnN2l","m-2":"_oVgmY","p-2":"_OguP4","m-3":"_Kh1Mk","p-3":"_Z3Isk","m-4":"_6MAp6","p-4":"_Diglh","m-5":"_TO5Nq","p-5":"_HXLSK","m-6":"_HUNIG","p-6":"_f4arD","m-7":"_mZxzR","p-7":"_wzNuy","m-8":"_RVlle","p-8":"_OjqW3","m-9":"_Dejbg","p-9":"_islrX","m-10":"_wj-xZ","p-10":"_xz5kd","ml-0":"_B6vO4","pl-0":"_d137A","ml-1":"_F964v","pl-1":"_cUcnb","ml-2":"_sAUua","pl-2":"_ineea","ml-3":"_Q7vDo","pl-3":"_RaOUn","ml-4":"_QXOxT","pl-4":"_IOfD0","ml-5":"_yxiUW","pl-5":"_Tppy4","ml-6":"_mMW5i","pl-6":"_74GpL","ml-7":"_fFz-u","pl-7":"_QJPKy","ml-8":"_6sPXU","pl-8":"_6-6Yi","ml-9":"_9eU2j","pl-9":"_5QdLq","ml-10":"_AppHk","pl-10":"_czH97","mr-0":"_vcD-O","pr-0":"_yLhIL","mr-1":"_oSLHt","pr-1":"_whfEJ","mr-2":"_nyXH6","pr-2":"_reUdF","mr-3":"_Rs2-c","pr-3":"_sGm42","mr-4":"_vobRL","pr-4":"_wpM-u","mr-5":"_q3dAo","pr-5":"_6PIFR","mr-6":"_ZqDGE","pr-6":"_gw5Dd","mr-7":"_lFAcr","pr-7":"_b36Iz","mr-8":"_PTl3K","pr-8":"_Znc0Y","mr-9":"_P1LS0","pr-9":"_n8V-T","mr-10":"_wdhB1","pr-10":"_xiGuq","mt-0":"_wTXui","pt-0":"_qv-eO","mt-1":"_EZHmH","pt-1":"_rVDqJ","mt-2":"_Vokqr","pt-2":"_Gy6Cr","mt-3":"_W8aoH","pt-3":"_r82YV","mt-4":"_muG0F","pt-4":"_CGaJi","mt-5":"_hiY1E","pt-5":"_7v6rs","mt-6":"_bQZSd","pt-6":"_jAtjI","mt-7":"_R5w8y","pt-7":"_4mWsy","mt-8":"_Sj-di","pt-8":"_-NNao","mt-9":"_Q-fHV","pt-9":"_r8woe","mt-10":"_bSMww","pt-10":"_avmlE","mb-0":"_iCCS3","pb-0":"_gwmOn","mb-1":"_Xl7QX","pb-1":"_WUz0H","mb-2":"_XgCgc","pb-2":"_jPgTM","mb-3":"_3teTS","pb-3":"_dG1rJ","mb-4":"_b9OzE","pb-4":"_IgI2C","mb-5":"_smDd1","pb-5":"_50YOa","mb-6":"_uJfnB","pb-6":"_kl0z7","mb-7":"_L-oZk","pb-7":"_3aui0","mb-8":"_SmtYl","pb-8":"_n-QXT","mb-9":"_mkkKF","pb-9":"_jS1HG","mb-10":"_KDXkK","pb-10":"_eFwJS","mx-0":"_e-HqA","px-0":"_BSmPJ","mx-1":"_x36PW","px-1":"_Gx2xG","mx-2":"_QNnpK","px-2":"_RRwnp","mx-3":"_ZPmuA","px-3":"_f61Ux","mx-4":"_DgyA6","px-4":"_BAKix","mx-5":"_vibgJ","px-5":"_bTxPW","mx-6":"_Yj9Z7","px-6":"_fhT5q","mx-7":"_q-6lp","px-7":"_DQb93","mx-8":"_6G9nX","px-8":"_o-551","mx-9":"_2cubL","px-9":"_4JCU0","mx-10":"_KxEiD","px-10":"_czVGr","my-0":"_CqLSs","py-0":"_8uC-B","my-1":"_ZZG5X","py-1":"_aYbyO","my-2":"_w8TwE","py-2":"_qpOCn","my-3":"_PkA2e","py-3":"_OMDQd","my-4":"_aNFBd","py-4":"_eCXIU","my-5":"_apq2l","py-5":"_mk-sc","my-6":"_sh1-C","py-6":"_ZobGH","my-7":"_8758c","py-7":"_1iT1D","my-8":"_bAfQx","py-8":"_WWkd-","my-9":"_ynwaZ","py-9":"_4bOJI","my-10":"_l-I5b","py-10":"_re6Jp","m-sm-0":"_UPkcx","p-sm-0":"_t5gDA","m-sm-1":"_Rx29j","p-sm-1":"_t6SQY","m-sm-2":"_TyVqN","p-sm-2":"_Z1ogo","m-sm-3":"_gbZcT","p-sm-3":"_Mb1ST","m-sm-4":"_cUvON","p-sm-4":"_Pi4BO","m-sm-5":"_GgM3g","p-sm-5":"_uPFJ2","m-sm-6":"_cCDZS","p-sm-6":"_-e-Jr","m-sm-7":"_f2nRJ","p-sm-7":"_B6vun","m-sm-8":"_pidE0","p-sm-8":"_Qf8oe","m-sm-9":"_OyLmR","p-sm-9":"_soKag","m-sm-10":"_Hnysz","p-sm-10":"_SceBA","ml-sm-0":"_-l5XN","pl-sm-0":"_23QUK","ml-sm-1":"_3nzoa","pl-sm-1":"_Ys-wQ","ml-sm-2":"_cnl0C","pl-sm-2":"_9zniH","ml-sm-3":"_COjSH","pl-sm-3":"_ZoalV","ml-sm-4":"_7PcV0","pl-sm-4":"_yBtfl","ml-sm-5":"_0t-j9","pl-sm-5":"_lrbtT","ml-sm-6":"_441I5","pl-sm-6":"_kDiN3","ml-sm-7":"_7LdG3","pl-sm-7":"_g0gh-","ml-sm-8":"_J0xVz","pl-sm-8":"_Y6n12","ml-sm-9":"_0WKKn","pl-sm-9":"_3Seov","ml-sm-10":"_LbfWV","pl-sm-10":"_yJT8F","mr-sm-0":"_5iTiW","pr-sm-0":"_Z-yPd","mr-sm-1":"_HjxwF","pr-sm-1":"_JibpI","mr-sm-2":"_osijT","pr-sm-2":"_tlR9d","mr-sm-3":"_xxUub","pr-sm-3":"_OM4YU","mr-sm-4":"_tZTrU","pr-sm-4":"_co3SR","mr-sm-5":"_ZV8NG","pr-sm-5":"_6lrgR","mr-sm-6":"_mgH6r","pr-sm-6":"_oirFH","mr-sm-7":"_cDefz","pr-sm-7":"_PbMd1","mr-sm-8":"_GEylU","pr-sm-8":"_w9iBc","mr-sm-9":"_U-I4Y","pr-sm-9":"_VM49L","mr-sm-10":"_A-Fqb","pr-sm-10":"_jAp4X","mt-sm-0":"_kxvbF","pt-sm-0":"_-1AUk","mt-sm-1":"_utpJq","pt-sm-1":"_5aGnP","mt-sm-2":"_hH5bv","pt-sm-2":"_Lf-Hs","mt-sm-3":"_QKQTL","pt-sm-3":"_pS4ep","mt-sm-4":"_cf-lt","pt-sm-4":"_lGSoR","mt-sm-5":"_gSiyG","pt-sm-5":"_WWQxH","mt-sm-6":"_u9dIF","pt-sm-6":"_3rt-l","mt-sm-7":"_9HdeB","pt-sm-7":"_zzUxk","mt-sm-8":"_6dlAC","pt-sm-8":"_gDL-V","mt-sm-9":"_o7STq","pt-sm-9":"_7uyRq","mt-sm-10":"_VRUs5","pt-sm-10":"_nuFOu","mb-sm-0":"_gYIh5","pb-sm-0":"_9EoF6","mb-sm-1":"_h47Qi","pb-sm-1":"_zEE-R","mb-sm-2":"_qNAln","pb-sm-2":"_lAEEB","mb-sm-3":"_qz2f7","pb-sm-3":"_zDV2S","mb-sm-4":"_HziQr","pb-sm-4":"_Z8Nr-","mb-sm-5":"_2-0Mg","pb-sm-5":"_jd6YT","mb-sm-6":"_29u0R","pb-sm-6":"_rv5lz","mb-sm-7":"_34gYX","pb-sm-7":"_QK5rm","mb-sm-8":"_GTTt-","pb-sm-8":"_i9KXS","mb-sm-9":"_aOWnz","pb-sm-9":"_he9qa","mb-sm-10":"_zzLEf","pb-sm-10":"_a3Kx7","mx-sm-0":"_BxA9q","px-sm-0":"_W9ngp","mx-sm-1":"_sw7Ji","px-sm-1":"_CC5F4","mx-sm-2":"_wNsfZ","px-sm-2":"_7HUQW","mx-sm-3":"_7SvR7","px-sm-3":"_MhTrn","mx-sm-4":"_iQFZf","px-sm-4":"_-Kc-C","mx-sm-5":"_uAYfU","px-sm-5":"_zSyRo","mx-sm-6":"_M9NRe","px-sm-6":"_rqh6J","mx-sm-7":"_xC2ZW","px-sm-7":"_2ldRI","mx-sm-8":"_IdyE1","px-sm-8":"_nEOT4","mx-sm-9":"_MZcKX","px-sm-9":"_gn7RL","mx-sm-10":"_qc1L8","px-sm-10":"_eqRhA","my-sm-0":"_Fz6F6","py-sm-0":"_xO1X5","my-sm-1":"_-FpA3","py-sm-1":"_nbaB5","my-sm-2":"_O9I74","py-sm-2":"_luGVj","my-sm-3":"_HiEIn","py-sm-3":"_CYpX7","my-sm-4":"_J6Y94","py-sm-4":"_wB9Cu","my-sm-5":"_NsPY8","py-sm-5":"_mLSOY","my-sm-6":"_KsNN2","py-sm-6":"_ksiG3","my-sm-7":"_I-MIQ","py-sm-7":"_8LmM-","my-sm-8":"_N9K-q","py-sm-8":"_UmDUW","my-sm-9":"_Kx729","py-sm-9":"_T07OJ","my-sm-10":"_IW66T","py-sm-10":"_4gdB-","m-lg-0":"_zIg6p","p-lg-0":"_JuNiH","m-lg-1":"_PYsvw","p-lg-1":"_lcX2G","m-lg-2":"_FqRzp","p-lg-2":"_61LiW","m-lg-3":"_lKWuo","p-lg-3":"_c-9AA","m-lg-4":"_5iPC8","p-lg-4":"_3ucGN","m-lg-5":"_ZcKza","p-lg-5":"_53nUa","m-lg-6":"_nf5Tb","p-lg-6":"_QOkP1","m-lg-7":"_Yaf7S","p-lg-7":"_fS5OB","m-lg-8":"_3hP03","p-lg-8":"_w90dv","m-lg-9":"_eTZmn","p-lg-9":"_rEjn2","m-lg-10":"_MRZfv","p-lg-10":"_GvH8S","ml-lg-0":"_dma-K","pl-lg-0":"_dtgDg","ml-lg-1":"_lSg5Q","pl-lg-1":"_3Bq7W","ml-lg-2":"_ai140","pl-lg-2":"_eHQz2","ml-lg-3":"_IjfYo","pl-lg-3":"_mhnHv","ml-lg-4":"_gB4r4","pl-lg-4":"_GZbML","ml-lg-5":"_i2xfh","pl-lg-5":"_x9yPX","ml-lg-6":"_SeQQZ","pl-lg-6":"_wS39q","ml-lg-7":"_r8f4e","pl-lg-7":"_irihU","ml-lg-8":"_1QsQf","pl-lg-8":"_GXSU9","ml-lg-9":"_MJYz8","pl-lg-9":"_yaJGg","ml-lg-10":"_-AsD8","pl-lg-10":"_yn9Yb","mr-lg-0":"_vjC97","pr-lg-0":"_V3kGD","mr-lg-1":"_wf9z-","pr-lg-1":"_McW7I","mr-lg-2":"_kheh0","pr-lg-2":"_Q9Upz","mr-lg-3":"_zCz0A","pr-lg-3":"_YtfCI","mr-lg-4":"_qQN9B","pr-lg-4":"_S9PbV","mr-lg-5":"_bDTdZ","pr-lg-5":"_AcAC1","mr-lg-6":"_Ei18A","pr-lg-6":"_5YQVo","mr-lg-7":"_x18aw","pr-lg-7":"_N8GDD","mr-lg-8":"_OaFkM","pr-lg-8":"_-9lBB","mr-lg-9":"_52zo-","pr-lg-9":"_9T-Cb","mr-lg-10":"_IXqTb","pr-lg-10":"_zJmVt","mt-lg-0":"_2g62L","pt-lg-0":"_XBXKM","mt-lg-1":"_HMX9J","pt-lg-1":"_7rDIG","mt-lg-2":"_Y6X7U","pt-lg-2":"_fyycG","mt-lg-3":"_DvRKb","pt-lg-3":"_QKOEA","mt-lg-4":"_7qwy-","pt-lg-4":"_wl7f7","mt-lg-5":"_r-Zpt","pt-lg-5":"_-SnjV","mt-lg-6":"_q-hht","pt-lg-6":"_sOK9J","mt-lg-7":"_SUp-d","pt-lg-7":"_PugoZ","mt-lg-8":"_3NhkP","pt-lg-8":"_1n7tp","mt-lg-9":"_N7-FS","pt-lg-9":"_dnC7J","mt-lg-10":"_8IqDn","pt-lg-10":"_zMpbv","mb-lg-0":"_v5nv6","pb-lg-0":"_PMrYJ","mb-lg-1":"_O-soc","pb-lg-1":"_11FYR","mb-lg-2":"_zEeyp","pb-lg-2":"_hXqMT","mb-lg-3":"_san6w","pb-lg-3":"_7Xb0V","mb-lg-4":"_2Vzmv","pb-lg-4":"_fMirW","mb-lg-5":"_pKo-L","pb-lg-5":"_xC4Fx","mb-lg-6":"_snApN","pb-lg-6":"_b9Dsw","mb-lg-7":"_bFu0D","pb-lg-7":"_0qgZX","mb-lg-8":"_Gf3om","pb-lg-8":"_hX-O2","mb-lg-9":"_zZ-9Y","pb-lg-9":"_jk292","mb-lg-10":"_gYyhL","pb-lg-10":"_aPUfC","mx-lg-0":"_tmMx3","px-lg-0":"_GxctH","mx-lg-1":"_Ky0cs","px-lg-1":"_oGNqQ","mx-lg-2":"_9mQLc","px-lg-2":"_laRSV","mx-lg-3":"_xZFwU","px-lg-3":"_BgGbp","mx-lg-4":"_8m58X","px-lg-4":"_hosE8","mx-lg-5":"_r-0ww","px-lg-5":"_pIVfH","mx-lg-6":"_-BStC","px-lg-6":"_v42m-","mx-lg-7":"_DVgVD","px-lg-7":"_olele","mx-lg-8":"_5Vgts","px-lg-8":"_vV7Sg","mx-lg-9":"_R6Pid","px-lg-9":"_qmY7B","mx-lg-10":"_NW4OT","px-lg-10":"_i8Zad","my-lg-0":"_7PFtp","py-lg-0":"_vhTEf","my-lg-1":"_1yOov","py-lg-1":"_oKB3P","my-lg-2":"_loQJ5","py-lg-2":"_S67Pf","my-lg-3":"_HNTDI","py-lg-3":"_LWHvE","my-lg-4":"_b-KHI","py-lg-4":"_0mixG","my-lg-5":"_Vlo-t","py-lg-5":"_xLHlx","my-lg-6":"_0KXBa","py-lg-6":"_9s-me","my-lg-7":"_60cF9","py-lg-7":"_qwIHZ","my-lg-8":"_suf27","py-lg-8":"_c6pD4","my-lg-9":"_KSJpX","py-lg-9":"_C6ZV-","my-lg-10":"_JA-YG","py-lg-10":"_YuxKJ","m-md-0":"_62Zm-","p-md-0":"_7qxYP","m-md-1":"_3xHIn","p-md-1":"_A0jQv","m-md-2":"_gn3k4","p-md-2":"_EpVD0","m-md-3":"_apmcB","p-md-3":"_ldRmv","m-md-4":"_BOjUR","p-md-4":"_93an6","m-md-5":"_W5v56","p-md-5":"_SIBoU","m-md-6":"_VBmMD","p-md-6":"_7ZqTb","m-md-7":"_5Jogx","p-md-7":"_KpbGF","m-md-8":"_lw6bA","p-md-8":"_D21Xs","m-md-9":"_buMId","p-md-9":"_87RlS","m-md-10":"_ojudf","p-md-10":"_sjNOB","ml-md-0":"_V1IX-","pl-md-0":"_ZTBpt","ml-md-1":"_4jtTs","pl-md-1":"_cY-xk","ml-md-2":"_ydZsR","pl-md-2":"_MJk1L","ml-md-3":"_ocW9e","pl-md-3":"_WuBzD","ml-md-4":"_eKU4l","pl-md-4":"_cgptP","ml-md-5":"_Ov-v8","pl-md-5":"_gDnV3","ml-md-6":"_o3eWU","pl-md-6":"_Cr8hz","ml-md-7":"_sX69x","pl-md-7":"_-Ci6A","ml-md-8":"_fGNjF","pl-md-8":"_PeKiX","ml-md-9":"_yVD5i","pl-md-9":"_gxUIi","ml-md-10":"_ZPQrh","pl-md-10":"_oL88W","mr-md-0":"_rETVL","pr-md-0":"_UePrS","mr-md-1":"_wGOhL","pr-md-1":"_lXRvw","mr-md-2":"_5zLmB","pr-md-2":"_gZGtH","mr-md-3":"_jFCGk","pr-md-3":"_iimql","mr-md-4":"_yhePq","pr-md-4":"_xtBfX","mr-md-5":"_KiBHO","pr-md-5":"_WCKkT","mr-md-6":"_Q8jWF","pr-md-6":"_mu6zn","mr-md-7":"_wgy4D","pr-md-7":"_HaN0x","mr-md-8":"_0hc4i","pr-md-8":"_RomM-","mr-md-9":"_vHSBw","pr-md-9":"_4D7JM","mr-md-10":"_4kgs5","pr-md-10":"_KbOqY","mt-md-0":"_PnJEf","pt-md-0":"_Wr2Ts","mt-md-1":"_ZhVjl","pt-md-1":"_0DgRY","mt-md-2":"_WCZNy","pt-md-2":"_632Ah","mt-md-3":"_I1rX1","pt-md-3":"_yLblG","mt-md-4":"_H6sYD","pt-md-4":"_EHXef","mt-md-5":"_A-e3J","pt-md-5":"_-sV7U","mt-md-6":"_hXU9-","pt-md-6":"_n13ly","mt-md-7":"_NvbHC","pt-md-7":"_og4j4","mt-md-8":"_K3M9K","pt-md-8":"_G0D0h","mt-md-9":"_gqgsH","pt-md-9":"_2DuSs","mt-md-10":"_Bd2SX","pt-md-10":"_4zQZt","mb-md-0":"_-zK4R","pb-md-0":"_-5KU3","mb-md-1":"_DsvDi","pb-md-1":"_iBeit","mb-md-2":"_1DyrC","pb-md-2":"_We5TJ","mb-md-3":"_gHMvz","pb-md-3":"_zYpR2","mb-md-4":"_OEEgj","pb-md-4":"_Rc-ZO","mb-md-5":"_qmwpY","pb-md-5":"_t53dC","mb-md-6":"_Z7IKd","pb-md-6":"_Tr1Mj","mb-md-7":"_VAOZd","pb-md-7":"_F6Hvf","mb-md-8":"_bDJti","pb-md-8":"_-Hyix","mb-md-9":"_5NMzS","pb-md-9":"_ka3la","mb-md-10":"_m7Y4u","pb-md-10":"_GKtFW","mx-md-0":"_S-sWu","px-md-0":"_Cbp07","mx-md-1":"_0cWET","px-md-1":"_B62bC","mx-md-2":"_fk8cj","px-md-2":"_hDUD4","mx-md-3":"_3rc6m","px-md-3":"_Ybukf","mx-md-4":"_Cc05e","px-md-4":"_WuZgX","mx-md-5":"_Bizql","px-md-5":"_-p46c","mx-md-6":"_9UcKL","px-md-6":"_JBebf","mx-md-7":"_v-pvB","px-md-7":"_rA-mH","mx-md-8":"_IuwmJ","px-md-8":"_q43Ow","mx-md-9":"_d-qUi","px-md-9":"_z4nCB","mx-md-10":"_kRlX7","px-md-10":"_c-33g","my-md-0":"_PDUR4","py-md-0":"_bYhI-","my-md-1":"_GuZMi","py-md-1":"_odsUL","my-md-2":"_PnosJ","py-md-2":"_eF79-","my-md-3":"_nqJqe","py-md-3":"_Wcv28","my-md-4":"_pg-Cw","py-md-4":"_TQVBc","my-md-5":"_oq3ru","py-md-5":"_ruQ8P","my-md-6":"_udw0b","py-md-6":"_vStkc","my-md-7":"_EHkUk","py-md-7":"_oGosV","my-md-8":"_Sr4G3","py-md-8":"_eDYMt","my-md-9":"_mmQcX","py-md-9":"_J0xZx","my-md-10":"_6PNQm","py-md-10":"_N-J8O","m-xl-0":"_b9ste","p-xl-0":"_09iuo","m-xl-1":"_6sC3f","p-xl-1":"_PtZdh","m-xl-2":"_9tNY-","p-xl-2":"_ovaeX","m-xl-3":"_P2BFM","p-xl-3":"_FEEeY","m-xl-4":"_PVfE9","p-xl-4":"_65pR5","m-xl-5":"_--nhA","p-xl-5":"_jsSAE","m-xl-6":"_R6Xge","p-xl-6":"_m8aQq","m-xl-7":"_siLSo","p-xl-7":"_v7l5L","m-xl-8":"_hHbXe","p-xl-8":"_Rqlns","m-xl-9":"_oGDyI","p-xl-9":"_s-jO5","m-xl-10":"_Acff7","p-xl-10":"_r1WLU","ml-xl-0":"_R-5jP","pl-xl-0":"_4Q5-9","ml-xl-1":"_KtDt9","pl-xl-1":"_WO0X1","ml-xl-2":"_1iTCd","pl-xl-2":"_cwGpB","ml-xl-3":"_U-UBZ","pl-xl-3":"_K6-fp","ml-xl-4":"_Qj-GA","pl-xl-4":"_3HWJh","ml-xl-5":"_tHgFt","pl-xl-5":"_HDbai","ml-xl-6":"_R5iu-","pl-xl-6":"_kiBpR","ml-xl-7":"_IBpxp","pl-xl-7":"_dnEPn","ml-xl-8":"_BKEU-","pl-xl-8":"_Na3WX","ml-xl-9":"_ChhZh","pl-xl-9":"_mn3TM","ml-xl-10":"_-UMhn","pl-xl-10":"_sYOxA","mr-xl-0":"_cpZo1","pr-xl-0":"_JNcnY","mr-xl-1":"_OCoEG","pr-xl-1":"_1muOs","mr-xl-2":"_jhx4t","pr-xl-2":"_vT9VS","mr-xl-3":"_Syl0-","pr-xl-3":"_Vh6yI","mr-xl-4":"_Andea","pr-xl-4":"_IELTR","mr-xl-5":"_tR-Dd","pr-xl-5":"_tFdrE","mr-xl-6":"_MfbBj","pr-xl-6":"_-RDRT","mr-xl-7":"_2TUZ4","pr-xl-7":"_FDwKR","mr-xl-8":"_JILtJ","pr-xl-8":"_vHCTj","mr-xl-9":"_7wU9i","pr-xl-9":"_SqcZw","mr-xl-10":"_V70NV","pr-xl-10":"_-KQQG","mt-xl-0":"_sKVTL","pt-xl-0":"_ZF6Hm","mt-xl-1":"_I5EGT","pt-xl-1":"_-Ig-5","mt-xl-2":"_RIFhP","pt-xl-2":"_zaWNn","mt-xl-3":"_dPd93","pt-xl-3":"_O4wYu","mt-xl-4":"_T1XOW","pt-xl-4":"_b6dFq","mt-xl-5":"_dTI2S","pt-xl-5":"_qyuWu","mt-xl-6":"_0pvAa","pt-xl-6":"_sSQ8V","mt-xl-7":"_P-2W8","pt-xl-7":"_ek09W","mt-xl-8":"_g4vXZ","pt-xl-8":"_b2MMp","mt-xl-9":"_6JmBY","pt-xl-9":"_EG1jC","mt-xl-10":"_tHeBK","pt-xl-10":"_nYubC","mb-xl-0":"_9fyt1","pb-xl-0":"_66Js3","mb-xl-1":"_ARk1H","pb-xl-1":"_kKNTV","mb-xl-2":"_0TmE5","pb-xl-2":"_Zysst","mb-xl-3":"_XiA7F","pb-xl-3":"_SO1hI","mb-xl-4":"_W-4kw","pb-xl-4":"_-sfn8","mb-xl-5":"_NTfVD","pb-xl-5":"_LFC-6","mb-xl-6":"_pp7Gy","pb-xl-6":"_j-vtb","mb-xl-7":"_wpFKE","pb-xl-7":"_BbnyF","mb-xl-8":"_4qmjI","pb-xl-8":"_7pytN","mb-xl-9":"_B3YZo","pb-xl-9":"_cRfJG","mb-xl-10":"_NMhPX","pb-xl-10":"_Ekqdk","mx-xl-0":"_SkbmN","px-xl-0":"_JKZdb","mx-xl-1":"_UKYJi","px-xl-1":"_f-FqJ","mx-xl-2":"_gwtRl","px-xl-2":"_CSJ3f","mx-xl-3":"_tg3Yl","px-xl-3":"_EWUVo","mx-xl-4":"_p2pqT","px-xl-4":"_3DzEy","mx-xl-5":"_0xDrA","px-xl-5":"_NUhX6","mx-xl-6":"_bhY09","px-xl-6":"_mUAfo","mx-xl-7":"_Lug5G","px-xl-7":"_2kUJp","mx-xl-8":"_kTsP1","px-xl-8":"_Chv-7","mx-xl-9":"_h9kIo","px-xl-9":"_gfikM","mx-xl-10":"_3Th0M","px-xl-10":"_A4Mab","my-xl-0":"_62UqO","py-xl-0":"_BkC6O","my-xl-1":"_QJWcf","py-xl-1":"_WWFRs","my-xl-2":"_tkrQM","py-xl-2":"_-qca8","my-xl-3":"_bpoTO","py-xl-3":"_OnKLk","my-xl-4":"_o-kvn","py-xl-4":"_Icmal","my-xl-5":"_cEkTF","py-xl-5":"_mPD3K","my-xl-6":"_b2wEf","py-xl-6":"_SPrOl","my-xl-7":"_BpIhB","py-xl-7":"_9p80f","my-xl-8":"_u3RLs","py-xl-8":"_mc-ae","my-xl-9":"_Q8X-B","py-xl-9":"_SAYlD","my-xl-10":"_vUbME","py-xl-10":"_JgNyS","background-shine":"_31QK4","path":"_LID96","line":"_w2-BZ","skeleton":"_rfGkx","skeleton-animate":"_UY78C","skeleton-dark":"_KmySi","skeleton-dark-animate":"_KF46B","skeleton-transparent":"_50VFe","skeleton-transparent-animate":"_Q6BCG","semi-transparent":"_y91i5","disable":"_87Qkw","full-width-on-tablets":"_wymzG","full-width-on-mobiles":"_uhhSq","xl":"_zdQKm","lg":"_jG9wj","md":"_QrK--","sm":"_jc1W9","small-padding-on-small-mobiles":"_rS2Bk","primary":"_d-gJO","primary-bordered":"_jjfA2","primary-transparent":"_AEbcr","transparent":"_w53db","transparent-bordered":"_WW-Ps","transparent-without-shadow":"_Ltn9c","white":"_csamW","button-primary-dots-wrapper":"_Dmv-l","show":"_GkptB","button-success-icon":"_xImUU","button-text":"_ur-Oh","hide":"_-5XCZ","button-with-icon":"_ZrOKh","button-with-icon-text":"_ixQmJ","big-icon":"_8e4E7"};
|
|
1163
|
+
var styles$1 = {"container":"_lIpAT","button":"_sS-Yj","m-0":"_hBGrg","p-0":"_fOezx","m-1":"_R79vC","p-1":"_BGhZS","m-2":"_4WQa1","p-2":"_-hkj1","m-3":"_ePtXr","p-3":"_ihe2B","m-4":"_KplPo","p-4":"_2vDkp","m-5":"_4AqfI","p-5":"_FfAMs","m-6":"_53MvX","p-6":"_e-x4J","m-7":"_EtdrG","p-7":"_FLCe5","m-8":"_1IHYX","p-8":"_fZzmM","m-9":"_QsD9D","p-9":"_6Sr2Q","m-10":"_LvJdU","p-10":"_ah-tz","ml-0":"_De6uE","pl-0":"_aQ1ph","ml-1":"_5Bwy4","pl-1":"_j4wAR","ml-2":"_qeK50","pl-2":"_VC868","ml-3":"_LuNZb","pl-3":"_3fxbv","ml-4":"_XiU0I","pl-4":"_hPWPx","ml-5":"_xkmy7","pl-5":"_vZWUx","ml-6":"_HJ-Oe","pl-6":"_nx5bN","ml-7":"_L-cTm","pl-7":"_XyNJZ","ml-8":"_GUJTt","pl-8":"_O-OPx","ml-9":"_4DBUs","pl-9":"_W5E4J","ml-10":"_TsFNa","pl-10":"_a07G-","mr-0":"_KuY5-","pr-0":"_Zv2gF","mr-1":"_IylJL","pr-1":"_DIaMC","mr-2":"_wodzN","pr-2":"_x7vGR","mr-3":"_cg-WA","pr-3":"_-GR0e","mr-4":"_zip09","pr-4":"_mrzBz","mr-5":"_Z3SdR","pr-5":"_FOt7u","mr-6":"_DX3gj","pr-6":"_caE8K","mr-7":"_SRVDr","pr-7":"_7h7Xw","mr-8":"_bvjcP","pr-8":"_WxJl8","mr-9":"_CDXo1","pr-9":"_uftSg","mr-10":"_WqvBW","pr-10":"_75aX1","mt-0":"_lfLEb","pt-0":"_FszNW","mt-1":"_xtok6","pt-1":"_cDFtN","mt-2":"_j96uZ","pt-2":"_BX40s","mt-3":"_3--yt","pt-3":"_qkmXr","mt-4":"_DhLUo","pt-4":"_AG7V9","mt-5":"_Gn5bX","pt-5":"_5-rlk","mt-6":"_c6g6t","pt-6":"_iWQbs","mt-7":"_6X-oB","pt-7":"_i82Td","mt-8":"_uK93t","pt-8":"_ESUrY","mt-9":"_LmSrq","pt-9":"_BgZxc","mt-10":"_mPy8r","pt-10":"_ddKoS","mb-0":"_gs1hc","pb-0":"_k94Xn","mb-1":"_8XN6g","pb-1":"_lJSHs","mb-2":"_y04oG","pb-2":"_cNkcX","mb-3":"_3-Ex4","pb-3":"_UlTDL","mb-4":"_ZchCM","pb-4":"_PrDJ0","mb-5":"_Al-qI","pb-5":"_9ExxH","mb-6":"_38fJH","pb-6":"_YPJnw","mb-7":"_ViLUm","pb-7":"_YtQHK","mb-8":"_Jm2m3","pb-8":"_hQSln","mb-9":"_73cuP","pb-9":"_Hm-oe","mb-10":"_90atw","pb-10":"_GxdOW","mx-0":"_786dB","px-0":"_b-KUL","mx-1":"_1sw2D","px-1":"_pfikG","mx-2":"_ZCsfc","px-2":"_-E-rP","mx-3":"_Vzqfk","px-3":"_Evygh","mx-4":"_g6XKX","px-4":"_hzPZK","mx-5":"_6Yusw","px-5":"_43D2o","mx-6":"_l7jig","px-6":"_X4DAB","mx-7":"_xCEJ4","px-7":"_kFsKL","mx-8":"_bcZ3x","px-8":"_qKJ-o","mx-9":"_pmzk-","px-9":"_5kFZh","mx-10":"_ZtyHL","px-10":"_RzSP4","my-0":"_iGkHt","py-0":"_tFXK8","my-1":"_9p151","py-1":"_1ExYH","my-2":"_hDX-y","py-2":"_j2Iqz","my-3":"_ZoP-i","py-3":"_JiyfX","my-4":"_6dHeQ","py-4":"_Val1l","my-5":"_yF8w9","py-5":"_3Do00","my-6":"_5ATW7","py-6":"_EqQi0","my-7":"_6Kng-","py-7":"_kFB05","my-8":"_fqkrf","py-8":"_wkYlc","my-9":"_yC6ha","py-9":"_nR4hK","my-10":"_46v2E","py-10":"_yjbuZ","m-sm-0":"_mXg7O","p-sm-0":"_sRkzF","m-sm-1":"_uh76t","p-sm-1":"_mnvOq","m-sm-2":"_-Lxwk","p-sm-2":"_9AoV6","m-sm-3":"_k6uGI","p-sm-3":"_FPlck","m-sm-4":"_XWNGm","p-sm-4":"_UhY4z","m-sm-5":"_nqmEm","p-sm-5":"_O3yzT","m-sm-6":"_1C7QT","p-sm-6":"_yR3CC","m-sm-7":"_vlqMl","p-sm-7":"_otIfI","m-sm-8":"_f-GUL","p-sm-8":"_oMnLQ","m-sm-9":"_Klhy3","p-sm-9":"_xYdqe","m-sm-10":"_jg7tY","p-sm-10":"_-28KU","ml-sm-0":"_6hhVb","pl-sm-0":"_WV4uZ","ml-sm-1":"_u--dD","pl-sm-1":"_k2dSZ","ml-sm-2":"_ng1Wx","pl-sm-2":"_A6pLt","ml-sm-3":"_OKwcI","pl-sm-3":"_uxcE6","ml-sm-4":"_dHy5x","pl-sm-4":"_loKKN","ml-sm-5":"_pWXnn","pl-sm-5":"_6KcZ0","ml-sm-6":"_8DdT4","pl-sm-6":"_atdfH","ml-sm-7":"_-BksR","pl-sm-7":"_B6uGl","ml-sm-8":"_rL6Yi","pl-sm-8":"_L0Gt6","ml-sm-9":"_sDCuc","pl-sm-9":"_5ndTT","ml-sm-10":"_d0sOv","pl-sm-10":"_MzCci","mr-sm-0":"_TxpxL","pr-sm-0":"_ReTjB","mr-sm-1":"_ZDd-C","pr-sm-1":"_6ux6P","mr-sm-2":"_SbIys","pr-sm-2":"_0dAjY","mr-sm-3":"_WT-FE","pr-sm-3":"_hgzpB","mr-sm-4":"_ovLOk","pr-sm-4":"_YVXRD","mr-sm-5":"_3gKfj","pr-sm-5":"_GKqKE","mr-sm-6":"_EJ3Ig","pr-sm-6":"_pKU7W","mr-sm-7":"_MfWyc","pr-sm-7":"_439vk","mr-sm-8":"_HsLqa","pr-sm-8":"_Afu8-","mr-sm-9":"_k-uXQ","pr-sm-9":"_GSZg6","mr-sm-10":"_buR-E","pr-sm-10":"_GoGHq","mt-sm-0":"_3eC5V","pt-sm-0":"_w0Row","mt-sm-1":"_lFsar","pt-sm-1":"_rhMZX","mt-sm-2":"_HchNc","pt-sm-2":"_Xyn5a","mt-sm-3":"_INU0e","pt-sm-3":"_i9zkC","mt-sm-4":"_d1xqQ","pt-sm-4":"_eMU-M","mt-sm-5":"_gYMLN","pt-sm-5":"_sG2g-","mt-sm-6":"_U4BDm","pt-sm-6":"_nagya","mt-sm-7":"_f4nLP","pt-sm-7":"_3jMHw","mt-sm-8":"_hZW3J","pt-sm-8":"_woC7I","mt-sm-9":"_SFf2s","pt-sm-9":"_nuLoR","mt-sm-10":"_k1lF9","pt-sm-10":"_WG3-N","mb-sm-0":"_fQPR-","pb-sm-0":"_eL6LV","mb-sm-1":"_Z7gTR","pb-sm-1":"_OdGhD","mb-sm-2":"_dkjwo","pb-sm-2":"_kKhvE","mb-sm-3":"_meX0E","pb-sm-3":"_kh7Ku","mb-sm-4":"_rrb92","pb-sm-4":"_aytJc","mb-sm-5":"_wPkH4","pb-sm-5":"_1nZ-9","mb-sm-6":"_MkdDA","pb-sm-6":"_BxNLc","mb-sm-7":"_Nfm1A","pb-sm-7":"_-r452","mb-sm-8":"_K1omF","pb-sm-8":"_4-6gt","mb-sm-9":"_OUWsR","pb-sm-9":"_7DXr5","mb-sm-10":"_wZv7f","pb-sm-10":"_21WIP","mx-sm-0":"_hCRDg","px-sm-0":"_Bdj31","mx-sm-1":"_sx6bH","px-sm-1":"_jQXbZ","mx-sm-2":"_aCjIb","px-sm-2":"_-DBsZ","mx-sm-3":"_p2bFN","px-sm-3":"_d6ice","mx-sm-4":"_GZmNE","px-sm-4":"_7D10W","mx-sm-5":"_tKkEN","px-sm-5":"_J2iH5","mx-sm-6":"_iJju-","px-sm-6":"_m2ygK","mx-sm-7":"_chPCu","px-sm-7":"_C0aVt","mx-sm-8":"_twRB-","px-sm-8":"_6DezI","mx-sm-9":"_z1iZL","px-sm-9":"_HLE-F","mx-sm-10":"_F58U0","px-sm-10":"_Mat2S","my-sm-0":"_nADuT","py-sm-0":"_yu79u","my-sm-1":"_TEHyf","py-sm-1":"_MkRV5","my-sm-2":"_wfxJN","py-sm-2":"_qjIa5","my-sm-3":"_ch7TX","py-sm-3":"_0ZM5Q","my-sm-4":"_KQyj3","py-sm-4":"_npV56","my-sm-5":"_antvz","py-sm-5":"_qK29t","my-sm-6":"_PIZw6","py-sm-6":"_kwzra","my-sm-7":"_IPjVc","py-sm-7":"_NPJ-2","my-sm-8":"_Sxu2p","py-sm-8":"_VUG-4","my-sm-9":"_mLy-T","py-sm-9":"_U-1Tz","my-sm-10":"_6LGF-","py-sm-10":"_1I7Qo","m-lg-0":"_7JHxT","p-lg-0":"_dZxSG","m-lg-1":"_ap69K","p-lg-1":"_yAiEU","m-lg-2":"_cu0Gq","p-lg-2":"_p2Nvp","m-lg-3":"_ipTnO","p-lg-3":"_uekmi","m-lg-4":"_Ocj1U","p-lg-4":"_T5xZ0","m-lg-5":"_9QwAr","p-lg-5":"_S73RR","m-lg-6":"_TQDUS","p-lg-6":"_SVpzt","m-lg-7":"_u7-7x","p-lg-7":"_tVwwR","m-lg-8":"_VMheR","p-lg-8":"_dnoel","m-lg-9":"_bs68b","p-lg-9":"_-fPka","m-lg-10":"_JaRq8","p-lg-10":"_222SK","ml-lg-0":"_snW5C","pl-lg-0":"_cbC4p","ml-lg-1":"_ZcZqo","pl-lg-1":"_Ox1R-","ml-lg-2":"_GYhhL","pl-lg-2":"_RQnGa","ml-lg-3":"_PUix3","pl-lg-3":"_TXjNe","ml-lg-4":"_ctO4e","pl-lg-4":"_HGdnK","ml-lg-5":"_0kAql","pl-lg-5":"_j374-","ml-lg-6":"_DTSzU","pl-lg-6":"_f8fRt","ml-lg-7":"_SOGpN","pl-lg-7":"_ftCov","ml-lg-8":"_yyg3O","pl-lg-8":"_es-pp","ml-lg-9":"_ujiYm","pl-lg-9":"_hEH2f","ml-lg-10":"_sOymp","pl-lg-10":"_zABMD","mr-lg-0":"_bZvOK","pr-lg-0":"_1MjdX","mr-lg-1":"_lVGe-","pr-lg-1":"_hJzV5","mr-lg-2":"_9az71","pr-lg-2":"_vBVKt","mr-lg-3":"_SK-xp","pr-lg-3":"_BymTx","mr-lg-4":"_C-P-K","pr-lg-4":"_oDktY","mr-lg-5":"_e8X2c","pr-lg-5":"_XugCG","mr-lg-6":"_CycFS","pr-lg-6":"_aXn7x","mr-lg-7":"_woi9n","pr-lg-7":"_Xz9XT","mr-lg-8":"_p4H3g","pr-lg-8":"_2GHoq","mr-lg-9":"_OZukC","pr-lg-9":"_ckY7k","mr-lg-10":"_tu3W5","pr-lg-10":"_9v3FG","mt-lg-0":"_I-1g6","pt-lg-0":"_cUyFD","mt-lg-1":"_c94QP","pt-lg-1":"_g75ry","mt-lg-2":"_XiT9Y","pt-lg-2":"_OzwIr","mt-lg-3":"_TZnYh","pt-lg-3":"_qC-3V","mt-lg-4":"_ClD8h","pt-lg-4":"_n1T93","mt-lg-5":"_yfqL8","pt-lg-5":"_oRkf6","mt-lg-6":"_6sndc","pt-lg-6":"_zKuFI","mt-lg-7":"_61kz3","pt-lg-7":"_5Q2hr","mt-lg-8":"_s2ReT","pt-lg-8":"_Ap8SS","mt-lg-9":"_bV6Hp","pt-lg-9":"_G5Dl9","mt-lg-10":"_hSJ91","pt-lg-10":"_amgjj","mb-lg-0":"_p-7me","pb-lg-0":"_ys8Fm","mb-lg-1":"_ZFPzR","pb-lg-1":"_Low3Q","mb-lg-2":"_UKfD5","pb-lg-2":"_Z4xYz","mb-lg-3":"_WYCZq","pb-lg-3":"_lOmpq","mb-lg-4":"_3f13Q","pb-lg-4":"_tfvEW","mb-lg-5":"_DxAtv","pb-lg-5":"_lN1KV","mb-lg-6":"_pEAAo","pb-lg-6":"_9pLfP","mb-lg-7":"_lZzWZ","pb-lg-7":"_E76Lg","mb-lg-8":"_Biywb","pb-lg-8":"_PKNGt","mb-lg-9":"_af7LP","pb-lg-9":"_769vF","mb-lg-10":"_p6W2n","pb-lg-10":"_44r6t","mx-lg-0":"_noonL","px-lg-0":"_g6n-m","mx-lg-1":"_V3fJC","px-lg-1":"_h-048","mx-lg-2":"_VBXFM","px-lg-2":"_yXjeI","mx-lg-3":"_anxPB","px-lg-3":"_umXxh","mx-lg-4":"_arYWt","px-lg-4":"_v21qY","mx-lg-5":"_VJrBv","px-lg-5":"_Wg7-s","mx-lg-6":"_qiDC7","px-lg-6":"_1VXpg","mx-lg-7":"_d0c15","px-lg-7":"_sfSeF","mx-lg-8":"_2gYLA","px-lg-8":"_DEL7d","mx-lg-9":"_KmU1j","px-lg-9":"_Qs2ud","mx-lg-10":"_cEBsK","px-lg-10":"_mQH7b","my-lg-0":"_ag2WO","py-lg-0":"_lnVBo","my-lg-1":"_xEHQX","py-lg-1":"_9Tj2M","my-lg-2":"_Iqbzp","py-lg-2":"_8tcVx","my-lg-3":"_caNHW","py-lg-3":"_XJ-2h","my-lg-4":"_6q91a","py-lg-4":"_EwkV-","my-lg-5":"_vAyw8","py-lg-5":"_5fbq2","my-lg-6":"_15LIk","py-lg-6":"_HIyvD","my-lg-7":"_kBk-L","py-lg-7":"_t5Eqq","my-lg-8":"_7QdOv","py-lg-8":"_mWXQT","my-lg-9":"_AgF1j","py-lg-9":"_Hw03a","my-lg-10":"_lgtEt","py-lg-10":"_VLUO-","m-md-0":"_bZzK1","p-md-0":"_hf1u1","m-md-1":"_D90hf","p-md-1":"_T8Wci","m-md-2":"_OV2C9","p-md-2":"_GFg-F","m-md-3":"_tOGww","p-md-3":"_p0NdJ","m-md-4":"_gUtm-","p-md-4":"_92JAP","m-md-5":"_V4DwP","p-md-5":"_KzYIR","m-md-6":"_RYzMI","p-md-6":"_bV-UI","m-md-7":"_bZ8rT","p-md-7":"_sz5lw","m-md-8":"_Tt85A","p-md-8":"_o9XsL","m-md-9":"_5Z2zG","p-md-9":"_QFUvw","m-md-10":"_o-CSv","p-md-10":"_I0UW7","ml-md-0":"_Ec-jt","pl-md-0":"_AsNUW","ml-md-1":"_FkvyK","pl-md-1":"_eWpHd","ml-md-2":"_C-N9j","pl-md-2":"_f4IXC","ml-md-3":"_i4rpE","pl-md-3":"_u1wxV","ml-md-4":"_bfpFB","pl-md-4":"_LFkDV","ml-md-5":"_ChenT","pl-md-5":"_Tseed","ml-md-6":"_5OVzE","pl-md-6":"_kKZuw","ml-md-7":"_HkEvd","pl-md-7":"_-UCQ1","ml-md-8":"_Mil4J","pl-md-8":"_ibj8N","ml-md-9":"_hZgvD","pl-md-9":"_x58o7","ml-md-10":"_aNTRb","pl-md-10":"_B9Ytk","mr-md-0":"_5fzNR","pr-md-0":"_UcmnK","mr-md-1":"_7GSVQ","pr-md-1":"_lKZ6y","mr-md-2":"_Vuc2l","pr-md-2":"_OWoeF","mr-md-3":"_GfGNW","pr-md-3":"_039xq","mr-md-4":"_XUUw7","pr-md-4":"_hNdK8","mr-md-5":"_PchvO","pr-md-5":"_YBTBv","mr-md-6":"_irZPz","pr-md-6":"_xez9v","mr-md-7":"_IWCJD","pr-md-7":"_Nymwz","mr-md-8":"_1ypEg","pr-md-8":"_hJvwk","mr-md-9":"_AisV-","pr-md-9":"_6jqua","mr-md-10":"_LdBUv","pr-md-10":"_Rhahl","mt-md-0":"_iI75A","pt-md-0":"_GCK2h","mt-md-1":"_QoRcE","pt-md-1":"_Q3gZh","mt-md-2":"_rzNrf","pt-md-2":"_mrtOR","mt-md-3":"_-Xx-x","pt-md-3":"_vhZY4","mt-md-4":"_Ie5M9","pt-md-4":"_Bv-Vz","mt-md-5":"_sC4OE","pt-md-5":"_sZzfz","mt-md-6":"_b8qW3","pt-md-6":"_sca5l","mt-md-7":"_Pn6m9","pt-md-7":"_9klOR","mt-md-8":"_oY4i-","pt-md-8":"_QpcKU","mt-md-9":"_-PssV","pt-md-9":"_IBITO","mt-md-10":"_hmDGa","pt-md-10":"_rPOnf","mb-md-0":"_KsSuI","pb-md-0":"_E01ZW","mb-md-1":"_mu8n4","pb-md-1":"_obt8N","mb-md-2":"_4uUmS","pb-md-2":"_eCQut","mb-md-3":"_gckFx","pb-md-3":"_v76WA","mb-md-4":"_HNG1G","pb-md-4":"_WF2cS","mb-md-5":"_y0d7f","pb-md-5":"_Ulg5o","mb-md-6":"_gGNca","pb-md-6":"_L6tTJ","mb-md-7":"_JFKoe","pb-md-7":"_cotbI","mb-md-8":"_zWuLC","pb-md-8":"_PZ98d","mb-md-9":"_0OLPw","pb-md-9":"_diSZ0","mb-md-10":"_tZv9r","pb-md-10":"_8DINx","mx-md-0":"_TlILw","px-md-0":"_nYb1A","mx-md-1":"_8F9Eu","px-md-1":"_zdtgY","mx-md-2":"_Hf2VU","px-md-2":"_R7ntT","mx-md-3":"_7koGZ","px-md-3":"_SjYZ0","mx-md-4":"_mfX1U","px-md-4":"_wpmO4","mx-md-5":"_yWbVN","px-md-5":"_c-PDJ","mx-md-6":"_F98A-","px-md-6":"_k2aB-","mx-md-7":"_PyjZi","px-md-7":"_1p7LO","mx-md-8":"_at5B-","px-md-8":"_Wlop7","mx-md-9":"_MP-IT","px-md-9":"_ZEJLn","mx-md-10":"_t-qxH","px-md-10":"_m2jcH","my-md-0":"_mamXD","py-md-0":"_XfnLL","my-md-1":"_wltQA","py-md-1":"_kMSov","my-md-2":"_PB9Lu","py-md-2":"_ZHQxJ","my-md-3":"_ROfrO","py-md-3":"_5pjW-","my-md-4":"_asOWk","py-md-4":"_521lJ","my-md-5":"_sfKXT","py-md-5":"_0hhLg","my-md-6":"_vBIkT","py-md-6":"_mh-mU","my-md-7":"_SbaIW","py-md-7":"_4U--m","my-md-8":"_8Ml4g","py-md-8":"_8CAbC","my-md-9":"_2W5Vi","py-md-9":"_ifVgs","my-md-10":"_jOwwL","py-md-10":"_xGEHg","m-xl-0":"_Cmi8h","p-xl-0":"_YOJnv","m-xl-1":"_IlYRc","p-xl-1":"_qg39r","m-xl-2":"_NZu1F","p-xl-2":"_ChCeZ","m-xl-3":"_wCJFO","p-xl-3":"_s5DXB","m-xl-4":"_-ooyS","p-xl-4":"_1rcFF","m-xl-5":"_2--cB","p-xl-5":"_0s8cD","m-xl-6":"_zMbs-","p-xl-6":"_qAR79","m-xl-7":"_sRWyz","p-xl-7":"_ykFCJ","m-xl-8":"_dj226","p-xl-8":"_XLB7-","m-xl-9":"_eM-R4","p-xl-9":"_QuQVl","m-xl-10":"_UUuwy","p-xl-10":"_nDqX9","ml-xl-0":"_LL8WU","pl-xl-0":"_AIPph","ml-xl-1":"_pKFo-","pl-xl-1":"_tQEXN","ml-xl-2":"_F-wn7","pl-xl-2":"_wcxv3","ml-xl-3":"_M94zg","pl-xl-3":"_I3KoK","ml-xl-4":"_0PzeG","pl-xl-4":"_lzci3","ml-xl-5":"_XRI4C","pl-xl-5":"_XlhyA","ml-xl-6":"_GjzL0","pl-xl-6":"_ASrOm","ml-xl-7":"_-0WjA","pl-xl-7":"_hx5P8","ml-xl-8":"_XlbUH","pl-xl-8":"_Vonli","ml-xl-9":"_LwuSL","pl-xl-9":"_MxuFJ","ml-xl-10":"_v7xZI","pl-xl-10":"_Tvo-Z","mr-xl-0":"_SzVWx","pr-xl-0":"_K1dhq","mr-xl-1":"_JOZtq","pr-xl-1":"_c1i37","mr-xl-2":"_R3B8Q","pr-xl-2":"_63cME","mr-xl-3":"_91LCJ","pr-xl-3":"_WxNaS","mr-xl-4":"_BauAg","pr-xl-4":"_V6rST","mr-xl-5":"_H0Uy4","pr-xl-5":"_idyBA","mr-xl-6":"_lIBS-","pr-xl-6":"_hm7f2","mr-xl-7":"_DcV1a","pr-xl-7":"_L9DAM","mr-xl-8":"_M62Cx","pr-xl-8":"_nso5O","mr-xl-9":"_M-vkg","pr-xl-9":"_Jm-de","mr-xl-10":"_V5v9Y","pr-xl-10":"_jt-a5","mt-xl-0":"_YPHmA","pt-xl-0":"_XVXEh","mt-xl-1":"_pJbYc","pt-xl-1":"_i-ZXc","mt-xl-2":"_SHsME","pt-xl-2":"_ak-Hh","mt-xl-3":"_wzbs7","pt-xl-3":"_py3lR","mt-xl-4":"_HBXKA","pt-xl-4":"_GQBlv","mt-xl-5":"_5d6Ee","pt-xl-5":"_KFPkO","mt-xl-6":"_Yf-yF","pt-xl-6":"_1e6oC","mt-xl-7":"_kg9lU","pt-xl-7":"_SHs7f","mt-xl-8":"_KXugL","pt-xl-8":"_VyRfA","mt-xl-9":"_EOyB7","pt-xl-9":"_5KMcS","mt-xl-10":"_8W-Zj","pt-xl-10":"_cz8iz","mb-xl-0":"_rWALs","pb-xl-0":"_LpkfT","mb-xl-1":"_RzmHQ","pb-xl-1":"_6ad54","mb-xl-2":"_Ajc4e","pb-xl-2":"_SbX8t","mb-xl-3":"_vSzzB","pb-xl-3":"_yidEJ","mb-xl-4":"_mrCP3","pb-xl-4":"_3TrW-","mb-xl-5":"_6j8-6","pb-xl-5":"_D1WrN","mb-xl-6":"_XDRU9","pb-xl-6":"_dcA8T","mb-xl-7":"_-i7kC","pb-xl-7":"_81QE4","mb-xl-8":"_X9-zp","pb-xl-8":"_HTClM","mb-xl-9":"_klb-D","pb-xl-9":"_RReN9","mb-xl-10":"_vPsb7","pb-xl-10":"_OVfeI","mx-xl-0":"_YNCB1","px-xl-0":"_hiVA4","mx-xl-1":"_k6kz-","px-xl-1":"_rONSC","mx-xl-2":"_pBneY","px-xl-2":"_po-3F","mx-xl-3":"_Bpbr7","px-xl-3":"_KdGyy","mx-xl-4":"_brh6E","px-xl-4":"_qqxT0","mx-xl-5":"_BfzzU","px-xl-5":"_R-Rw5","mx-xl-6":"_sSR5n","px-xl-6":"_thByS","mx-xl-7":"_r5nPW","px-xl-7":"_Qn6um","mx-xl-8":"_J9EDO","px-xl-8":"_9rkVI","mx-xl-9":"_Mltks","px-xl-9":"_g-Ham","mx-xl-10":"_sbya6","px-xl-10":"_8-jLj","my-xl-0":"_5yWBG","py-xl-0":"_xbHHG","my-xl-1":"_PlYBL","py-xl-1":"_F3Fon","my-xl-2":"_tsmUe","py-xl-2":"_a-0sQ","my-xl-3":"_sY3wJ","py-xl-3":"_iMcG-","my-xl-4":"_oHAzn","py-xl-4":"_SVfuw","my-xl-5":"_PvaIf","py-xl-5":"_J1xNt","my-xl-6":"_opQCd","py-xl-6":"_BykWn","my-xl-7":"_wYtgV","py-xl-7":"_rWN6g","my-xl-8":"_QHTpr","py-xl-8":"_6lwHD","my-xl-9":"_sKUSa","py-xl-9":"_HEg44","my-xl-10":"_mR1Ig","py-xl-10":"_-KK9e","background-shine":"_GS93D","path":"_Yio2J","line":"_hUBrW","skeleton":"_jhzCK","skeleton-animate":"_E3Vdv","skeleton-dark":"_wQ36Y","skeleton-dark-animate":"_j-rmG","skeleton-transparent":"_trTiX","skeleton-transparent-animate":"_4QQUW","semi-transparent":"_jW9cZ","disable":"_07-2N","full-width-on-tablets":"_at3Is","full-width-on-mobiles":"_7mVhH","xl":"_YBEjy","lg":"_4T1JY","md":"_y81Q7","sm":"_HlFvs","small-padding-on-small-mobiles":"_pC5i6","primary":"_rf33o","primary-bordered":"_bpdoC","primary-transparent":"_FNwOe","transparent":"_9LspZ","transparent-bordered":"_HgM7r","transparent-without-shadow":"_tkp-m","white":"_bv597","white-flat":"_IhewT","button-primary-dots-wrapper":"_OEKG8","show":"_MQYPo","button-success-icon":"_Y24W2","button-text":"_o-rLq","hide":"_4GC9-","button-with-icon":"_m1W6m","button-with-icon-text":"_75-fw","big-icon":"_gHcQi"};
|
|
1160
1164
|
|
|
1161
|
-
var styles = {"container":"_wfTsj","m-0":"_UeiuB","p-0":"_QD4AZ","m-1":"_wOM1E","p-1":"_kJ3GD","m-2":"_5G5Rf","p-2":"_dyuup","m-3":"_m4kZr","p-3":"_-aSKV","m-4":"_lqeth","p-4":"_WFhaj","m-5":"_bgee8","p-5":"_Y2Iup","m-6":"_c873k","p-6":"_Huak-","m-7":"_c2rt4","p-7":"_2dT3Y","m-8":"_7rQUz","p-8":"_fjzT8","m-9":"_jmGJQ","p-9":"_CTpOZ","m-10":"_lEJ9M","p-10":"_1LfZ2","ml-0":"_j6sNe","pl-0":"_i8R7s","ml-1":"_oM6Eu","pl-1":"_QllX8","ml-2":"_r3xcV","pl-2":"_fd0jL","ml-3":"_SP5MI","pl-3":"_wQD-b","ml-4":"_uV9BF","pl-4":"_k1Kla","ml-5":"_FTlGy","pl-5":"_k20cZ","ml-6":"_5gR0D","pl-6":"_ICAcq","ml-7":"_-PQGU","pl-7":"_VxSDF","ml-8":"_bKyKZ","pl-8":"_2DqEG","ml-9":"_1SlOv","pl-9":"_EIiNs","ml-10":"_5WCGB","pl-10":"_qdKd3","mr-0":"_JWuXP","pr-0":"_5aqFq","mr-1":"_GTimu","pr-1":"_VC6Mm","mr-2":"_iuK1E","pr-2":"_YREDe","mr-3":"_qttq2","pr-3":"_FRB7c","mr-4":"_tyLXy","pr-4":"_khAbL","mr-5":"_-pPmp","pr-5":"_Zn6P3","mr-6":"_UXDvD","pr-6":"_Pyjz-","mr-7":"_ydv6O","pr-7":"_W2-PF","mr-8":"_AeBpV","pr-8":"_GNhM6","mr-9":"_6r58X","pr-9":"_nDQS4","mr-10":"_z6oMu","pr-10":"_NqF8M","mt-0":"_5BywF","pt-0":"_G3lb7","mt-1":"_O8qGt","pt-1":"_KxUDK","mt-2":"_feZvx","pt-2":"_i4LGd","mt-3":"_8rWTr","pt-3":"_5KtzE","mt-4":"_22EES","pt-4":"_ktDxC","mt-5":"_hNJ8a","pt-5":"_l-BdA","mt-6":"_V7rTE","pt-6":"_yO380","mt-7":"_64Gbc","pt-7":"_slV9V","mt-8":"_PAPZ0","pt-8":"_SlH81","mt-9":"_OmKU7","pt-9":"_m4Y5T","mt-10":"_N7MOD","pt-10":"_5EmMY","mb-0":"_umP3K","pb-0":"_tdjdM","mb-1":"_RUpVI","pb-1":"_qhSG-","mb-2":"_UE6hY","pb-2":"_bhwY3","mb-3":"_gCNY5","pb-3":"_CT9SA","mb-4":"_hXf14","pb-4":"_dBd4j","mb-5":"_BJm2f","pb-5":"_osAXf","mb-6":"_sksVG","pb-6":"_vq2P1","mb-7":"_GGqWv","pb-7":"_Wp-xn","mb-8":"_ao8-b","pb-8":"_Fcz6J","mb-9":"_HTDCN","pb-9":"_j2geM","mb-10":"_tQ3f4","pb-10":"_k5-cY","mx-0":"_C-RwH","px-0":"_fGmBQ","mx-1":"_SJIAI","px-1":"_V6h6n","mx-2":"_RpAL-","px-2":"_MtnJr","mx-3":"_bJAjq","loading-dots":"_i9YR0","big":"_Gf-5X","dot":"_yU4CC","px-3":"_bKF6h","mx-4":"_2YwpF","px-4":"_sv9HO","mx-5":"_fyywB","px-5":"_PAvUg","mx-6":"_-7Y93","px-6":"_2HnrR","mx-7":"_mO0GJ","px-7":"_-XBUb","mx-8":"_rPzNl","px-8":"_lxUkB","mx-9":"_wtwwN","px-9":"_ewGa-","mx-10":"_CUJzg","px-10":"_9fyow","my-0":"_D3hCP","py-0":"_fUhkb","my-1":"_-gS0u","py-1":"_DCjg-","my-2":"_REwX3","py-2":"_5qEqQ","my-3":"_4P9yd","py-3":"_3Q6jo","my-4":"_pJ9JL","py-4":"_fvyEP","my-5":"_7HH0Y","py-5":"_pfPnT","my-6":"_HMzw4","py-6":"_nGGuj","my-7":"_ZQcHb","py-7":"_Q5rCt","my-8":"_yurdg","py-8":"_z2Rnm","my-9":"_SGsqH","py-9":"_RkTBo","my-10":"_hgG--","py-10":"_iKSyb","m-sm-0":"_hG8Pd","p-sm-0":"_paicL","m-sm-1":"_zYVem","p-sm-1":"_Iifls","m-sm-2":"_C0HAk","p-sm-2":"_tyMH8","m-sm-3":"_Nw8NT","p-sm-3":"_mOvjR","m-sm-4":"_auqaY","p-sm-4":"_nqq-T","m-sm-5":"_uC7a4","p-sm-5":"_QmBt-","m-sm-6":"_E1Mby","p-sm-6":"_2b-XB","m-sm-7":"_shE-L","p-sm-7":"_DZiE4","m-sm-8":"_VrAWC","p-sm-8":"_wBvI1","m-sm-9":"_nT5hR","p-sm-9":"_utagJ","m-sm-10":"_suXWh","p-sm-10":"_HqYvz","ml-sm-0":"_XKTYr","pl-sm-0":"_-69hr","ml-sm-1":"_EnQBB","pl-sm-1":"_OBDbZ","ml-sm-2":"_4uEtT","pl-sm-2":"_jxnnV","ml-sm-3":"_4dyy7","pl-sm-3":"_fcp9m","ml-sm-4":"_Su7vR","pl-sm-4":"_iGsH0","ml-sm-5":"_j5bIe","pl-sm-5":"_iiiem","ml-sm-6":"_OSCRC","pl-sm-6":"_a6Ij8","ml-sm-7":"_cESaw","pl-sm-7":"_PZAKp","ml-sm-8":"_u1e7W","pl-sm-8":"_MMjU3","ml-sm-9":"_AEo-h","pl-sm-9":"_g6Qm-","ml-sm-10":"_RSzPa","pl-sm-10":"_5lIjk","mr-sm-0":"_iq-8E","pr-sm-0":"_6e7Oo","mr-sm-1":"_eRKuI","pr-sm-1":"_HaKr0","mr-sm-2":"_sl8Y1","pr-sm-2":"_-eAaQ","mr-sm-3":"_hqMXk","pr-sm-3":"_-nPxR","mr-sm-4":"_PFLZC","pr-sm-4":"_bz8kn","mr-sm-5":"_IDOFd","pr-sm-5":"_YphYe","mr-sm-6":"_DFP8e","pr-sm-6":"_uffDW","mr-sm-7":"_K4gIP","pr-sm-7":"_mFIwC","mr-sm-8":"_ZnbXS","pr-sm-8":"_SJ5sd","mr-sm-9":"_I4pB1","pr-sm-9":"_7Be-A","mr-sm-10":"_BlQpX","pr-sm-10":"_zoDIK","mt-sm-0":"_PpfXn","pt-sm-0":"_MLL-T","mt-sm-1":"_sFLGW","pt-sm-1":"_cssHG","mt-sm-2":"_-CEBu","pt-sm-2":"_3164x","mt-sm-3":"_Q-yYF","pt-sm-3":"_aSP--","mt-sm-4":"_HCnTw","pt-sm-4":"_pkP3Z","mt-sm-5":"_wpfr4","pt-sm-5":"_090aI","mt-sm-6":"_1YJBr","pt-sm-6":"_jYnK3","mt-sm-7":"_1f6jW","pt-sm-7":"_yPAeS","mt-sm-8":"_dNsVh","pt-sm-8":"_5n5Di","mt-sm-9":"_4RACJ","pt-sm-9":"_lgByZ","mt-sm-10":"_SBIrM","pt-sm-10":"_YsBHF","mb-sm-0":"_-z2mG","pb-sm-0":"_uz-nV","mb-sm-1":"_bPTQE","pb-sm-1":"_qTKZa","mb-sm-2":"_DWs80","pb-sm-2":"_7Pkyh","mb-sm-3":"_c5AbJ","pb-sm-3":"_0BQOV","mb-sm-4":"_V1gvx","pb-sm-4":"_s56MP","mb-sm-5":"_abqTk","pb-sm-5":"_YVQSJ","mb-sm-6":"_URgQP","pb-sm-6":"_3cTRb","mb-sm-7":"_tbZgH","pb-sm-7":"_oprz5","mb-sm-8":"_1tsmq","pb-sm-8":"_rp6hG","mb-sm-9":"_HI-9l","pb-sm-9":"_FnTxa","mb-sm-10":"_RHo4c","pb-sm-10":"_PZUR0","mx-sm-0":"_AvLmU","px-sm-0":"_PtUTn","mx-sm-1":"_WdN3k","px-sm-1":"_ytExi","mx-sm-2":"_RWE1V","px-sm-2":"_vw43o","mx-sm-3":"_Cbm5H","px-sm-3":"_P-Cf6","mx-sm-4":"_pjfwR","px-sm-4":"_WtStS","mx-sm-5":"_9a-hP","px-sm-5":"_JMDVm","mx-sm-6":"_OS2my","px-sm-6":"_-GrIc","mx-sm-7":"_BCsIq","px-sm-7":"_WhZnF","mx-sm-8":"_1aj2C","px-sm-8":"_THUvZ","mx-sm-9":"_JGLYJ","px-sm-9":"_A-5uV","mx-sm-10":"_va7ij","px-sm-10":"_XIozX","my-sm-0":"_iYNXh","py-sm-0":"_A4kOE","my-sm-1":"_vMEVL","py-sm-1":"_Xp5yf","my-sm-2":"_VXJt9","py-sm-2":"_LFrIT","my-sm-3":"_KkriU","py-sm-3":"_5locy","my-sm-4":"_FbhGv","py-sm-4":"_lhkY0","my-sm-5":"_iI3NO","py-sm-5":"_YPAWx","my-sm-6":"_nsvtx","py-sm-6":"_fzqyr","my-sm-7":"_HCcpN","py-sm-7":"_yw1CE","my-sm-8":"_FvOZ-","py-sm-8":"_H3dR0","my-sm-9":"_AgJBK","py-sm-9":"_1xEHl","my-sm-10":"_TkKl8","py-sm-10":"_B3-Sv","m-lg-0":"_67BGW","p-lg-0":"_hLq7o","m-lg-1":"_7N5-4","p-lg-1":"_b-vnX","m-lg-2":"_7k7Vs","p-lg-2":"_Q2FO1","m-lg-3":"_ZTSBV","p-lg-3":"_rstCV","m-lg-4":"_juJVU","p-lg-4":"_-F4s-","m-lg-5":"_e2ifF","p-lg-5":"_U4gTc","m-lg-6":"_-4I70","p-lg-6":"_VEcMB","m-lg-7":"_LQqFi","p-lg-7":"_eX0vJ","m-lg-8":"_qPpjy","p-lg-8":"_Bhr2u","m-lg-9":"_DPuMB","p-lg-9":"_H5C3L","m-lg-10":"_1EPHM","p-lg-10":"_mVFm8","ml-lg-0":"_jLUCv","pl-lg-0":"_sdQR4","ml-lg-1":"_dO-42","pl-lg-1":"_RDmEN","ml-lg-2":"_zilrt","pl-lg-2":"_3ZlSF","ml-lg-3":"_ywVg2","pl-lg-3":"_EVjPm","ml-lg-4":"_PBq8D","pl-lg-4":"_-NNsy","ml-lg-5":"_EKt1p","pl-lg-5":"_AAU--","ml-lg-6":"_M3D3t","pl-lg-6":"_VXvIT","ml-lg-7":"_yRT7X","pl-lg-7":"_0XsPz","ml-lg-8":"_HazA-","pl-lg-8":"_JZBh1","ml-lg-9":"_BU6zu","pl-lg-9":"_UPban","ml-lg-10":"_17FL5","pl-lg-10":"_mtv0u","mr-lg-0":"_YxsrA","pr-lg-0":"_1Wmvv","mr-lg-1":"_cQiRZ","pr-lg-1":"_9oheo","mr-lg-2":"_hwBOD","pr-lg-2":"_3i51G","mr-lg-3":"_iwzVs","pr-lg-3":"_1oRFN","mr-lg-4":"_3NfjL","pr-lg-4":"_9OJfa","mr-lg-5":"_YokXX","pr-lg-5":"_owhix","mr-lg-6":"_5Grwo","pr-lg-6":"_r0hct","mr-lg-7":"_dSkGq","pr-lg-7":"_mohcn","mr-lg-8":"_NUor1","pr-lg-8":"_Sjzdu","mr-lg-9":"_Py-ID","pr-lg-9":"_cZdrq","mr-lg-10":"_Etrwm","pr-lg-10":"_YCNLZ","mt-lg-0":"_qEoXx","pt-lg-0":"_nAw0E","mt-lg-1":"_pzDlL","pt-lg-1":"_h8g2E","mt-lg-2":"_QBTy7","pt-lg-2":"_IQoFB","mt-lg-3":"_UGd6N","pt-lg-3":"_PBzO5","mt-lg-4":"_SCRsd","pt-lg-4":"_aFnaW","mt-lg-5":"_EvBB0","pt-lg-5":"_U2iJt","mt-lg-6":"_5mahS","pt-lg-6":"_bzKPx","mt-lg-7":"_E-ZPb","pt-lg-7":"_bspLi","mt-lg-8":"_UA8zu","pt-lg-8":"_3KcAQ","mt-lg-9":"_Ze8Hr","pt-lg-9":"_FKo1d","mt-lg-10":"_kIAZR","pt-lg-10":"_j2qBV","mb-lg-0":"_u8RSu","pb-lg-0":"_7uW-o","mb-lg-1":"_1MnIg","pb-lg-1":"_EeRag","mb-lg-2":"_D-pBo","pb-lg-2":"_TTAjX","mb-lg-3":"_ZldL-","pb-lg-3":"_racM9","mb-lg-4":"_bv3JQ","pb-lg-4":"_m4wR1","mb-lg-5":"_G-OW-","pb-lg-5":"_hTxUe","mb-lg-6":"_-r5uZ","pb-lg-6":"_Ri3sL","mb-lg-7":"_yay34","pb-lg-7":"_H0ybB","mb-lg-8":"_kWcyP","pb-lg-8":"_f7KWI","mb-lg-9":"_f-ap7","pb-lg-9":"_piZbL","mb-lg-10":"_7GnNB","pb-lg-10":"_8RaRH","mx-lg-0":"_E0yc1","px-lg-0":"_jXVGt","mx-lg-1":"_SLGEt","px-lg-1":"_sfpGl","mx-lg-2":"_TQdd5","px-lg-2":"_ZH4kx","mx-lg-3":"_ByYI-","px-lg-3":"_sa8fi","mx-lg-4":"_QFKsD","px-lg-4":"_S-owE","mx-lg-5":"_T-3pC","px-lg-5":"_592xL","mx-lg-6":"_nHCUC","px-lg-6":"_SHGGx","mx-lg-7":"_u8AGu","px-lg-7":"_HGDmM","mx-lg-8":"_DoojR","px-lg-8":"_-xfYS","mx-lg-9":"_a39AX","px-lg-9":"_otRdO","mx-lg-10":"_0jC0L","px-lg-10":"_o3uqZ","my-lg-0":"_fWar-","py-lg-0":"_1KGBQ","my-lg-1":"_rmTwc","py-lg-1":"_SNpLr","my-lg-2":"_nZTm1","py-lg-2":"_fo45m","my-lg-3":"_DP8Cy","py-lg-3":"_tWJ-N","my-lg-4":"_Unnfi","py-lg-4":"_TJ7sH","my-lg-5":"_xIoEe","py-lg-5":"_CH2tq","my-lg-6":"_-4iWK","py-lg-6":"_di773","my-lg-7":"_ZAyLn","py-lg-7":"_yxUoV","my-lg-8":"_AAbVi","py-lg-8":"_ijW6K","my-lg-9":"_2SOZJ","py-lg-9":"_904so","my-lg-10":"_RuT9u","py-lg-10":"_bM8I-","m-md-0":"_JzJkX","p-md-0":"_f8nh5","m-md-1":"_hBYXm","p-md-1":"_X1BU4","m-md-2":"_dnzT0","p-md-2":"_5y79V","m-md-3":"_eBoSQ","p-md-3":"_3KIpC","m-md-4":"_J4f2b","p-md-4":"_-GqF4","m-md-5":"_FaWzb","p-md-5":"_c-ssZ","m-md-6":"_R6a8a","p-md-6":"_3OwFZ","m-md-7":"_VwKx8","p-md-7":"_oICA0","m-md-8":"_D9SPT","p-md-8":"_WqmxK","m-md-9":"_K-6kd","p-md-9":"_RNgLg","m-md-10":"_X2S0Q","p-md-10":"_dUN9U","ml-md-0":"_KI-v9","pl-md-0":"_J-z-m","ml-md-1":"_40NhZ","pl-md-1":"_dwk56","ml-md-2":"_-gtX1","pl-md-2":"_M-jkC","ml-md-3":"_bbVwf","pl-md-3":"_RzC-C","ml-md-4":"_QmHWn","pl-md-4":"_2Lg6Z","ml-md-5":"_TwW16","pl-md-5":"_NvcKj","ml-md-6":"_wxYmK","pl-md-6":"_Ay-nQ","ml-md-7":"_7FRbu","pl-md-7":"_zQusT","ml-md-8":"_f0-0U","pl-md-8":"_rE4oG","ml-md-9":"_8sF7X","pl-md-9":"_RPdXC","ml-md-10":"_-3o3f","pl-md-10":"_JN4N-","mr-md-0":"_5uGyZ","pr-md-0":"_sHCfS","mr-md-1":"_T-APd","pr-md-1":"_EWggr","mr-md-2":"_-IV1z","pr-md-2":"_Mj-hm","mr-md-3":"_W4jcg","pr-md-3":"_rACeA","mr-md-4":"_NVp7l","pr-md-4":"_6LfUe","mr-md-5":"_VyxVE","pr-md-5":"_edWIM","mr-md-6":"_FZQF6","pr-md-6":"_LJpMl","mr-md-7":"_xwZ6q","pr-md-7":"_YflPE","mr-md-8":"_RiPLi","pr-md-8":"_HZNIr","mr-md-9":"_2ZsDj","pr-md-9":"_XBBrF","mr-md-10":"_-kG-G","pr-md-10":"_co3mI","mt-md-0":"_e6IV0","pt-md-0":"_eLP-0","mt-md-1":"_27KXx","pt-md-1":"_gQ2-y","mt-md-2":"_L6-1Q","pt-md-2":"_x7jaE","mt-md-3":"_r5yZl","pt-md-3":"_jTIZh","mt-md-4":"_TxxTT","pt-md-4":"_znNzQ","mt-md-5":"_aPml3","pt-md-5":"_o-WiU","mt-md-6":"_ePcku","pt-md-6":"_7PW3g","mt-md-7":"_qOy4h","pt-md-7":"_czEFY","mt-md-8":"_C5QNJ","pt-md-8":"_LXyGu","mt-md-9":"_BzCq8","pt-md-9":"_j6x7Q","mt-md-10":"_RyoZo","pt-md-10":"_HO6RH","mb-md-0":"_dBqjR","pb-md-0":"_Vtnl-","mb-md-1":"_4CIBM","pb-md-1":"_nkuIR","mb-md-2":"_jioqc","pb-md-2":"_KVlPp","mb-md-3":"_NVp7e","pb-md-3":"_51YgW","mb-md-4":"_6ZjBo","pb-md-4":"_5ewFY","mb-md-5":"_ttOxi","pb-md-5":"_VLqqB","mb-md-6":"_Vl1FM","pb-md-6":"_lj2o-","mb-md-7":"_fY9Hi","pb-md-7":"_vdqU0","mb-md-8":"_MBU95","pb-md-8":"_z-gSw","mb-md-9":"_Wr9dI","pb-md-9":"_D1Q7Q","mb-md-10":"_-resl","pb-md-10":"_Jamfb","mx-md-0":"_0r9rS","px-md-0":"_epgof","mx-md-1":"_aYYOb","px-md-1":"_g6u4x","mx-md-2":"_v6Jsi","px-md-2":"_e7lpx","mx-md-3":"_B5OpT","px-md-3":"_IJdST","mx-md-4":"_Vgq7O","px-md-4":"_q2tQ3","mx-md-5":"_udCxk","px-md-5":"_dkBwz","mx-md-6":"_HAAdk","px-md-6":"_gxcpD","mx-md-7":"_-wAGl","px-md-7":"_PBj8s","mx-md-8":"_51YzX","px-md-8":"_Ht55U","mx-md-9":"_UaNNS","px-md-9":"_A3qbp","mx-md-10":"_O9ir-","px-md-10":"_2jJOG","my-md-0":"_p6EfS","py-md-0":"_8FGSM","my-md-1":"_T6eYc","py-md-1":"_Jrh0m","my-md-2":"_oxohh","py-md-2":"_DTd2y","my-md-3":"_iGc8i","py-md-3":"_jqXbJ","my-md-4":"_wCkrO","py-md-4":"_4p1cz","my-md-5":"_m1Dhe","py-md-5":"_UFngr","my-md-6":"_FdWqj","py-md-6":"_utySi","my-md-7":"_TsKhD","py-md-7":"_8aght","my-md-8":"_H2tbJ","py-md-8":"_mX8dL","my-md-9":"_YP8V8","py-md-9":"_GEd1x","my-md-10":"_qnAfn","py-md-10":"_3MK3a","m-xl-0":"_QUeDl","p-xl-0":"_tpnY6","m-xl-1":"_JhTnG","p-xl-1":"_leasc","m-xl-2":"_rj70q","p-xl-2":"_nmUas","m-xl-3":"_SH7Mw","p-xl-3":"_2sLhA","m-xl-4":"_WKBLF","p-xl-4":"_JTlZn","m-xl-5":"_keccz","p-xl-5":"_W2L9n","m-xl-6":"_MmHtB","p-xl-6":"_16QWL","m-xl-7":"_qoXt8","p-xl-7":"_aZTjp","m-xl-8":"_Gl1CI","p-xl-8":"_u033S","m-xl-9":"_fgyK-","p-xl-9":"_gWQMQ","m-xl-10":"_1zthQ","p-xl-10":"_jYgaz","ml-xl-0":"_Gc0yF","pl-xl-0":"_7r0qa","ml-xl-1":"_riQOx","pl-xl-1":"_ZOf2r","ml-xl-2":"_aqpam","pl-xl-2":"_Kzewg","ml-xl-3":"_riGnY","pl-xl-3":"_fImnr","ml-xl-4":"_Spb-1","pl-xl-4":"_xqk-P","ml-xl-5":"_5ZrWS","pl-xl-5":"_KEqQd","ml-xl-6":"_6cdvz","pl-xl-6":"_RjL-8","ml-xl-7":"_hfyi5","pl-xl-7":"_-xSML","ml-xl-8":"_eHDDu","pl-xl-8":"_iDidv","ml-xl-9":"_Gg4Fk","pl-xl-9":"_fYSK3","ml-xl-10":"_1V3MM","pl-xl-10":"_4jnhK","mr-xl-0":"_8fnBs","pr-xl-0":"_Kemkd","mr-xl-1":"_4ox8d","pr-xl-1":"_zG2Y2","mr-xl-2":"_Pl4X2","pr-xl-2":"_EZpb9","mr-xl-3":"_efgC0","pr-xl-3":"_6hd7x","mr-xl-4":"_rp8M9","pr-xl-4":"_nsRMj","mr-xl-5":"_ayyUE","pr-xl-5":"_BHXMH","mr-xl-6":"_Ez0-c","pr-xl-6":"_xTS9o","mr-xl-7":"_KlyJI","pr-xl-7":"_w3-5z","mr-xl-8":"_onnmv","pr-xl-8":"_aQYpF","mr-xl-9":"_D4mrX","pr-xl-9":"_-MGmg","mr-xl-10":"_KmLe8","pr-xl-10":"_rxxtP","mt-xl-0":"_0-1Kw","pt-xl-0":"_jVAPE","mt-xl-1":"_dO4nc","pt-xl-1":"_oFjXt","mt-xl-2":"_njinL","pt-xl-2":"_EVcqW","mt-xl-3":"_k7EwU","pt-xl-3":"_oALYA","mt-xl-4":"_SSrqv","pt-xl-4":"_8ZIWU","mt-xl-5":"_PXga1","pt-xl-5":"_ewSdF","mt-xl-6":"_0hKMy","pt-xl-6":"_fmLlw","mt-xl-7":"_aBbeO","pt-xl-7":"_Ghd-T","mt-xl-8":"_QILjg","pt-xl-8":"_4401M","mt-xl-9":"_mdFN4","pt-xl-9":"_uBjA3","mt-xl-10":"_l3TPU","pt-xl-10":"_hIKVS","mb-xl-0":"_2Et8-","pb-xl-0":"_uBGMl","mb-xl-1":"_AnrEX","pb-xl-1":"_-PMBv","mb-xl-2":"_cr4lU","pb-xl-2":"_BVCap","mb-xl-3":"_PgCvP","pb-xl-3":"_69b-5","mb-xl-4":"_x5odK","pb-xl-4":"_LzoYk","mb-xl-5":"_3q-dE","pb-xl-5":"_DXCCv","mb-xl-6":"_I8Qbz","pb-xl-6":"_wK-Lg","mb-xl-7":"_NXT2E","pb-xl-7":"_hw62n","mb-xl-8":"_w5tOT","pb-xl-8":"_KA9xk","mb-xl-9":"_B5jk4","pb-xl-9":"_N5trL","mb-xl-10":"_JU9c5","pb-xl-10":"_kP-VE","mx-xl-0":"_jgBYj","px-xl-0":"_iLny2","mx-xl-1":"_1PpJT","px-xl-1":"_eAdDk","mx-xl-2":"_v1kJm","px-xl-2":"_hU50M","mx-xl-3":"_L1JqU","px-xl-3":"_lGvGI","mx-xl-4":"_KNNj2","px-xl-4":"_6-Kgj","mx-xl-5":"_r9t8u","px-xl-5":"_pI6ok","mx-xl-6":"_YO3KF","px-xl-6":"_LIjtn","mx-xl-7":"_Yz-3Z","px-xl-7":"_7xWar","mx-xl-8":"_NEAsT","px-xl-8":"_KSLjS","mx-xl-9":"_XqTby","px-xl-9":"_y5sVK","mx-xl-10":"_GysTi","px-xl-10":"_udCRM","my-xl-0":"_iWpWS","py-xl-0":"_cyc8U","my-xl-1":"_IcUiN","py-xl-1":"_bfKBO","my-xl-2":"_IFTOa","py-xl-2":"_sXWH4","my-xl-3":"_TXATm","py-xl-3":"_Vt5Ze","my-xl-4":"_GLPso","py-xl-4":"_dI2DM","my-xl-5":"_twkBw","py-xl-5":"_m7dMy","my-xl-6":"_a-KcP","py-xl-6":"_dLwS8","my-xl-7":"_qkPb4","py-xl-7":"_uZaN7","my-xl-8":"_2btRT","py-xl-8":"_qsAt5","my-xl-9":"_LpPEh","py-xl-9":"_v1Rtf","my-xl-10":"_xKXEK","py-xl-10":"_pZt9W","background-shine":"_K7sQH","path":"_ko8i0","line":"_uhBI-","skeleton":"_tfiqH","skeleton-animate":"_haT-0","skeleton-dark":"_ZpubN","skeleton-dark-animate":"_BVbU1","skeleton-transparent":"_p-CoM","skeleton-transparent-animate":"_YElIQ","semi-transparent":"_wSCsK","no-margins":"_lNgTM","dots":"_igFzN","colored":"_iCiK-","small":"_zvmsC","extra-small":"_6tLmp","align-left":"_jJMP1","align-right":"_jpWFr"};
|
|
1165
|
+
var styles = {"container":"_a5RSj","m-0":"_wcoyj","p-0":"_Rd5sE","m-1":"_vAsxv","p-1":"_KZ14Z","m-2":"_Bvk20","p-2":"_Z7fhL","m-3":"_ZqDCi","p-3":"_CiGc9","m-4":"_8JK-L","p-4":"_FadoA","m-5":"_baCle","p-5":"_cvJqX","m-6":"_P3lUT","p-6":"_ZmGGH","m-7":"_5Tnff","p-7":"_-t7z9","m-8":"_1JxUQ","p-8":"_EATOh","m-9":"_pJGV0","p-9":"_B762d","m-10":"_Z3rGU","p-10":"_0ULM0","ml-0":"_ZSfG7","pl-0":"_hjKq0","ml-1":"_srwbU","pl-1":"_oz-sG","ml-2":"_RnILi","pl-2":"_-nAjZ","ml-3":"_lges5","pl-3":"_AwVsn","ml-4":"_p4arL","pl-4":"_upAfC","ml-5":"_-iEnG","pl-5":"_bqApa","ml-6":"_uF0xd","pl-6":"_WUUFo","ml-7":"_eXFZs","pl-7":"_ZforM","ml-8":"_2AA5o","pl-8":"_u6bF0","ml-9":"_19IxL","pl-9":"_vmLg6","ml-10":"_eyqFK","pl-10":"_mr36J","mr-0":"_6RpFz","pr-0":"_fgnzi","mr-1":"_fBjrA","pr-1":"_QrC2Y","mr-2":"_0Y6RC","pr-2":"_5kZkr","mr-3":"_iaZj-","pr-3":"_A-IQ7","mr-4":"_zBHHn","pr-4":"_pHQ4t","mr-5":"_1JTCi","pr-5":"_ODvHf","mr-6":"_n6Enr","pr-6":"_XNdBl","mr-7":"_YfaVy","pr-7":"_ZfZDh","mr-8":"_le3sp","pr-8":"_K1rvN","mr-9":"_mL6UV","pr-9":"_76mZn","mr-10":"_fo-sf","pr-10":"_xvsK1","mt-0":"_1uBdK","pt-0":"_30qg7","mt-1":"_NKlWd","pt-1":"_3yj99","mt-2":"_lLyiG","pt-2":"_GsXqc","mt-3":"_zC55o","pt-3":"_3OZTc","mt-4":"_v1VXO","pt-4":"_sFrdR","mt-5":"_qbBFx","pt-5":"_DQrF8","mt-6":"_dJG8P","pt-6":"_Zxte7","mt-7":"_sUtkp","pt-7":"_9B1r5","mt-8":"_Qrnld","pt-8":"_7xBV7","mt-9":"_OPKw2","pt-9":"_cXhnD","mt-10":"_m5k36","pt-10":"_b9nMR","mb-0":"_7AyaR","pb-0":"_u0vFs","mb-1":"_ivpnr","pb-1":"_1dkPf","mb-2":"_D8KfL","pb-2":"_wzuIB","mb-3":"_zwh5E","pb-3":"_rT8wS","mb-4":"_wpLh9","pb-4":"_AGvn8","mb-5":"_-phDB","pb-5":"_r4HWg","mb-6":"_RZI7I","pb-6":"_-t4Gs","mb-7":"_Vw-z1","pb-7":"_qwD1B","mb-8":"_f3nKh","pb-8":"_Sk1Fn","mb-9":"_2MDAw","pb-9":"_jZbwv","mb-10":"_gRDI3","pb-10":"_W7OVZ","mx-0":"_I6mmv","px-0":"_BVRG5","mx-1":"_b7fTJ","px-1":"_bZf6u","mx-2":"_FoGd8","px-2":"_-vX3t","mx-3":"_0H3Cj","loading-dots":"_pnWN9","big":"_k0j0g","dot":"_9LXS6","px-3":"_ggifM","mx-4":"_leP-v","px-4":"_7Kcun","mx-5":"_sBxud","px-5":"_oJO7X","mx-6":"_F-Una","px-6":"_Bl-A8","mx-7":"_NVWrT","px-7":"_Bn6vR","mx-8":"_OK9GD","px-8":"_iv1v2","mx-9":"_WVtLI","px-9":"_ntW3v","mx-10":"_21M1-","px-10":"_BjXo-","my-0":"_3v8p4","py-0":"_EBmV-","my-1":"_DcOh5","py-1":"_udCfN","my-2":"_Lk0RK","py-2":"_wIENK","my-3":"_nsOf5","py-3":"_No-oK","my-4":"_L1ycy","py-4":"_42DgQ","my-5":"_3bZSh","py-5":"_XjTMT","my-6":"_Ty-GG","py-6":"_7Dr5E","my-7":"_PILBF","py-7":"_vyvsk","my-8":"_AkmkO","py-8":"_X0xg-","my-9":"_VSxcf","py-9":"_Hq-yp","my-10":"_FxwFR","py-10":"_BnN2G","m-sm-0":"_EZHgz","p-sm-0":"_oKPqX","m-sm-1":"_gdysh","p-sm-1":"_-7KK8","m-sm-2":"_BLBqZ","p-sm-2":"_IgrmD","m-sm-3":"_zbrA7","p-sm-3":"_eimPJ","m-sm-4":"_7RaaP","p-sm-4":"_0-Cvi","m-sm-5":"_PhCOs","p-sm-5":"_CIKFA","m-sm-6":"_8WC3P","p-sm-6":"_2FqT5","m-sm-7":"_D7sDK","p-sm-7":"_L3EpN","m-sm-8":"_mG6-A","p-sm-8":"_D2Gx9","m-sm-9":"_2tGFi","p-sm-9":"_8n6VA","m-sm-10":"_G-MMA","p-sm-10":"_pgJzb","ml-sm-0":"_BF125","pl-sm-0":"_81k6q","ml-sm-1":"_JSywC","pl-sm-1":"_1eoeN","ml-sm-2":"_q5cSf","pl-sm-2":"_A6Li5","ml-sm-3":"_-7C1-","pl-sm-3":"_lBIcx","ml-sm-4":"_bvj1N","pl-sm-4":"_SQmLb","ml-sm-5":"_pwy33","pl-sm-5":"_iuqDu","ml-sm-6":"_CNiYb","pl-sm-6":"_tQ2J-","ml-sm-7":"_Zuec-","pl-sm-7":"_iJF5q","ml-sm-8":"_lP-ls","pl-sm-8":"_1xIwn","ml-sm-9":"_Jld-6","pl-sm-9":"_pfOVT","ml-sm-10":"_TGfAU","pl-sm-10":"_MYgNP","mr-sm-0":"_CEiPO","pr-sm-0":"_rZ5kD","mr-sm-1":"_-bdjz","pr-sm-1":"_nRBRL","mr-sm-2":"_17O3E","pr-sm-2":"_uBaUj","mr-sm-3":"_5oO1d","pr-sm-3":"_jQWXm","mr-sm-4":"_peO4Y","pr-sm-4":"_P2f3n","mr-sm-5":"_AUc3q","pr-sm-5":"_7TR99","mr-sm-6":"_e3d5h","pr-sm-6":"_QqPl1","mr-sm-7":"_Yc1cR","pr-sm-7":"_5fd5H","mr-sm-8":"_z4g3-","pr-sm-8":"_gY3T9","mr-sm-9":"_P9chP","pr-sm-9":"_G4k6A","mr-sm-10":"_QWMD2","pr-sm-10":"_2POWv","mt-sm-0":"_xYS0m","pt-sm-0":"_gYD3b","mt-sm-1":"_08rCY","pt-sm-1":"_UsP-z","mt-sm-2":"_HWQec","pt-sm-2":"_cjIgZ","mt-sm-3":"_gZV20","pt-sm-3":"_zJZJm","mt-sm-4":"_4FE5W","pt-sm-4":"_VpJhv","mt-sm-5":"_eu88H","pt-sm-5":"_V7qwC","mt-sm-6":"_09LyL","pt-sm-6":"_n8bba","mt-sm-7":"_q-ASs","pt-sm-7":"_3b9S8","mt-sm-8":"_iTxDv","pt-sm-8":"_--Hdk","mt-sm-9":"_OaVE-","pt-sm-9":"_cd-UP","mt-sm-10":"_ZIr-H","pt-sm-10":"_6jYkb","mb-sm-0":"_YgN23","pb-sm-0":"_F8F6A","mb-sm-1":"_4QH8u","pb-sm-1":"_A2I8v","mb-sm-2":"_jrZxh","pb-sm-2":"_2VL1m","mb-sm-3":"_IB8uX","pb-sm-3":"_meger","mb-sm-4":"_-gCVy","pb-sm-4":"_R-qMm","mb-sm-5":"_YwvXh","pb-sm-5":"_pyu5v","mb-sm-6":"_qwhTX","pb-sm-6":"_l61nc","mb-sm-7":"_0KfeR","pb-sm-7":"_YXuNM","mb-sm-8":"_75fJr","pb-sm-8":"_jp-Qe","mb-sm-9":"_V0wM-","pb-sm-9":"_vMKpc","mb-sm-10":"_sxEY8","pb-sm-10":"_k2mOD","mx-sm-0":"_qPF9i","px-sm-0":"_cl18e","mx-sm-1":"_LvMUO","px-sm-1":"_RcIbD","mx-sm-2":"_xLMK5","px-sm-2":"_GCL1S","mx-sm-3":"_t0q4o","px-sm-3":"_cuiW8","mx-sm-4":"_pHjdd","px-sm-4":"_LDu1N","mx-sm-5":"_cYpLd","px-sm-5":"_24Yji","mx-sm-6":"_pXCM6","px-sm-6":"_uoSDI","mx-sm-7":"_qbXoQ","px-sm-7":"_0RlFx","mx-sm-8":"_3f-s3","px-sm-8":"_xAS-y","mx-sm-9":"_vx3dZ","px-sm-9":"_ndXm6","mx-sm-10":"_6lFsZ","px-sm-10":"_EZ6Qr","my-sm-0":"_0t-Cg","py-sm-0":"_N3sbI","my-sm-1":"_jdmVi","py-sm-1":"_GlMKb","my-sm-2":"_yFRs8","py-sm-2":"_LNRZQ","my-sm-3":"_qSuwF","py-sm-3":"_ON3vd","my-sm-4":"_1h6pX","py-sm-4":"_TZg0h","my-sm-5":"_vT295","py-sm-5":"_J1zu8","my-sm-6":"_7LuwF","py-sm-6":"_qbbdP","my-sm-7":"_9vKuY","py-sm-7":"_C9gzg","my-sm-8":"_Nx1-S","py-sm-8":"_8lmEZ","my-sm-9":"_LxGxx","py-sm-9":"_3y4jy","my-sm-10":"_61y0C","py-sm-10":"_fxmBa","m-lg-0":"_PJydR","p-lg-0":"_3o1cd","m-lg-1":"_MAdi8","p-lg-1":"_JDc1V","m-lg-2":"_pEH2Q","p-lg-2":"_Ic9tL","m-lg-3":"_P6cGt","p-lg-3":"_nzx-g","m-lg-4":"_9bH-j","p-lg-4":"_KdZTF","m-lg-5":"_hxjaE","p-lg-5":"_LDamm","m-lg-6":"_xXtVI","p-lg-6":"_ZWhTL","m-lg-7":"_mPnVe","p-lg-7":"_lJnBT","m-lg-8":"_J-MQA","p-lg-8":"_MGs60","m-lg-9":"_ixlkP","p-lg-9":"_Lru1O","m-lg-10":"_eH6ht","p-lg-10":"_ugZzQ","ml-lg-0":"_6z3OE","pl-lg-0":"_PDwaH","ml-lg-1":"_GMcN9","pl-lg-1":"_NoDTB","ml-lg-2":"_PQ5AQ","pl-lg-2":"_8-Pu6","ml-lg-3":"_PktVo","pl-lg-3":"_JTpEZ","ml-lg-4":"_zIcyb","pl-lg-4":"_e4YYS","ml-lg-5":"_HrlcA","pl-lg-5":"_cwG3s","ml-lg-6":"_Xf7Wv","pl-lg-6":"_XYe-E","ml-lg-7":"_vnGAT","pl-lg-7":"_NnScU","ml-lg-8":"_9z7Tj","pl-lg-8":"_DDEn1","ml-lg-9":"_sxSQp","pl-lg-9":"_-r39c","ml-lg-10":"_kppNg","pl-lg-10":"_1mgTz","mr-lg-0":"_WtS6h","pr-lg-0":"_NKNU9","mr-lg-1":"_kxaOQ","pr-lg-1":"_8OvSK","mr-lg-2":"_bTQt8","pr-lg-2":"_yQerd","mr-lg-3":"_f7H9P","pr-lg-3":"_Kwfoa","mr-lg-4":"_lkF5d","pr-lg-4":"_b7tIe","mr-lg-5":"_H4e5a","pr-lg-5":"_pxwBt","mr-lg-6":"_I81Hq","pr-lg-6":"_1Xwlf","mr-lg-7":"_gtO-Y","pr-lg-7":"_vjm3Z","mr-lg-8":"_ZfEr1","pr-lg-8":"_je0MD","mr-lg-9":"_h43Co","pr-lg-9":"_Lnbh5","mr-lg-10":"_HoaFo","pr-lg-10":"_3puFA","mt-lg-0":"_a7pDC","pt-lg-0":"_-URo7","mt-lg-1":"_Ot-U1","pt-lg-1":"_rMvMf","mt-lg-2":"_95ooz","pt-lg-2":"_vkEgW","mt-lg-3":"_9XqX5","pt-lg-3":"_b-oGK","mt-lg-4":"_eYL6E","pt-lg-4":"_zgUGu","mt-lg-5":"_BqCaM","pt-lg-5":"_Y9PL4","mt-lg-6":"_0aOPb","pt-lg-6":"_nvMum","mt-lg-7":"_-pNQS","pt-lg-7":"_funa7","mt-lg-8":"_sDweY","pt-lg-8":"_S1hmu","mt-lg-9":"_Y4BpR","pt-lg-9":"_J3203","mt-lg-10":"_Jm-dV","pt-lg-10":"_0WSnk","mb-lg-0":"_4uWrE","pb-lg-0":"_qy0mb","mb-lg-1":"_jUNMm","pb-lg-1":"_pUTOt","mb-lg-2":"_aGqhb","pb-lg-2":"_xAKUw","mb-lg-3":"_kado5","pb-lg-3":"_htLgL","mb-lg-4":"_mWWU1","pb-lg-4":"_gqGWe","mb-lg-5":"_ceycQ","pb-lg-5":"_RzNIh","mb-lg-6":"_VLMG4","pb-lg-6":"_-8-Aj","mb-lg-7":"_HBnRW","pb-lg-7":"_ZsIEk","mb-lg-8":"_bj2r5","pb-lg-8":"_cBnkL","mb-lg-9":"_w3001","pb-lg-9":"_Kua-7","mb-lg-10":"_wZKsF","pb-lg-10":"_GX-Wb","mx-lg-0":"_-G50w","px-lg-0":"_OTPQl","mx-lg-1":"_JJ9DD","px-lg-1":"_jedSl","mx-lg-2":"_n9zl3","px-lg-2":"_Cg-Eq","mx-lg-3":"_6ZhL3","px-lg-3":"_0oPYT","mx-lg-4":"_H9sE1","px-lg-4":"_aV3U2","mx-lg-5":"_Y2BNn","px-lg-5":"_EzRHI","mx-lg-6":"_fp9jU","px-lg-6":"_wghWL","mx-lg-7":"_zB5Qv","px-lg-7":"_gclTH","mx-lg-8":"_Qxq2x","px-lg-8":"_M7akr","mx-lg-9":"_Vfhs-","px-lg-9":"_Rv7m-","mx-lg-10":"_lni3U","px-lg-10":"_gdVVu","my-lg-0":"_rMuza","py-lg-0":"_MZopi","my-lg-1":"_Thq10","py-lg-1":"_BXQnr","my-lg-2":"_lHRe-","py-lg-2":"_6MiWj","my-lg-3":"_-vobr","py-lg-3":"_xtsGY","my-lg-4":"_m2hen","py-lg-4":"_-069Y","my-lg-5":"_nTHzp","py-lg-5":"_r4pes","my-lg-6":"_LTkTV","py-lg-6":"_13TOF","my-lg-7":"_Em859","py-lg-7":"_mJzVF","my-lg-8":"_T8EVh","py-lg-8":"_h2ol5","my-lg-9":"_T-LZJ","py-lg-9":"_QIrnZ","my-lg-10":"_EY0q7","py-lg-10":"_hvU2E","m-md-0":"_u8Not","p-md-0":"_PVgyV","m-md-1":"_y-q4l","p-md-1":"_7X2x6","m-md-2":"_r3IGF","p-md-2":"_abaFH","m-md-3":"_rH0Ca","p-md-3":"_m-V0R","m-md-4":"_NQj-k","p-md-4":"_xjGzA","m-md-5":"_41oza","p-md-5":"_cgf0Z","m-md-6":"_lelHI","p-md-6":"_2C8Oa","m-md-7":"_w1Eil","p-md-7":"_EtEzw","m-md-8":"_Q8a3D","p-md-8":"_5nsxA","m-md-9":"_LzOqJ","p-md-9":"_7LEzr","m-md-10":"_CRNVR","p-md-10":"_ClNNV","ml-md-0":"_3abXz","pl-md-0":"_7BRiC","ml-md-1":"_Jbe0V","pl-md-1":"_Ok-KV","ml-md-2":"_5SO4-","pl-md-2":"_IvJ88","ml-md-3":"_NWLcP","pl-md-3":"_XASwl","ml-md-4":"_La-jA","pl-md-4":"_M8vz7","ml-md-5":"_4UZJ3","pl-md-5":"_ikRMN","ml-md-6":"_GpxKA","pl-md-6":"_-vp4I","ml-md-7":"_qZisY","pl-md-7":"_UspU5","ml-md-8":"_xTqIg","pl-md-8":"_8LLNG","ml-md-9":"_u3Wi6","pl-md-9":"_yukVA","ml-md-10":"_BJ3Kb","pl-md-10":"_Ncx33","mr-md-0":"_-dCKD","pr-md-0":"_p4Xdb","mr-md-1":"_DZXj3","pr-md-1":"_YZLPN","mr-md-2":"_IEATr","pr-md-2":"_OGWz-","mr-md-3":"_UxMFq","pr-md-3":"_qMmI8","mr-md-4":"_KEt4t","pr-md-4":"_nLevO","mr-md-5":"_AMVPM","pr-md-5":"_3m10o","mr-md-6":"_fzrrj","pr-md-6":"_Wbjjj","mr-md-7":"_mZWrU","pr-md-7":"_mqIEB","mr-md-8":"_5p3E5","pr-md-8":"_NyrXd","mr-md-9":"_gez8y","pr-md-9":"_qLaJ8","mr-md-10":"_TR-zd","pr-md-10":"_SqjX-","mt-md-0":"_Okpug","pt-md-0":"_xIGF1","mt-md-1":"_kkttT","pt-md-1":"_6Fntk","mt-md-2":"_jjt3V","pt-md-2":"_MBCLj","mt-md-3":"_AcRpn","pt-md-3":"_9e4N3","mt-md-4":"_TEYLB","pt-md-4":"_G-b2b","mt-md-5":"_ADYmJ","pt-md-5":"_-PW2W","mt-md-6":"_IiBSh","pt-md-6":"_oOMKv","mt-md-7":"_LzMKR","pt-md-7":"_P93Fk","mt-md-8":"_ZPChR","pt-md-8":"_IjZLd","mt-md-9":"_OYWyj","pt-md-9":"_6VDq-","mt-md-10":"_NFUMl","pt-md-10":"_9N5Rs","mb-md-0":"_KNEZM","pb-md-0":"_dlRtG","mb-md-1":"_2TJCJ","pb-md-1":"_FYJz-","mb-md-2":"_p5q4o","pb-md-2":"_W20R5","mb-md-3":"_QMtNI","pb-md-3":"_X4ghG","mb-md-4":"_ROsHu","pb-md-4":"_LLz3c","mb-md-5":"_FKlov","pb-md-5":"_qQje5","mb-md-6":"_zHdHt","pb-md-6":"_7vH68","mb-md-7":"_5-25V","pb-md-7":"_a5Jzs","mb-md-8":"_9NPzr","pb-md-8":"_NpZZI","mb-md-9":"_F5182","pb-md-9":"_2SM3y","mb-md-10":"_R3bvz","pb-md-10":"_Sop9H","mx-md-0":"_OUA4d","px-md-0":"_s-0Qy","mx-md-1":"_cBeVb","px-md-1":"_34ZBT","mx-md-2":"_-dnuU","px-md-2":"_0-UrT","mx-md-3":"_CewFh","px-md-3":"_ZrFGb","mx-md-4":"_5Cvub","px-md-4":"_9CpfN","mx-md-5":"_O1iRv","px-md-5":"_dnUx0","mx-md-6":"_QmgAB","px-md-6":"_vP8Uq","mx-md-7":"_PcZ9w","px-md-7":"_5l4s3","mx-md-8":"_isOXv","px-md-8":"_cvHBA","mx-md-9":"_LIRJ0","px-md-9":"_09Gju","mx-md-10":"_b-TCB","px-md-10":"_5UoX8","my-md-0":"_wrYvU","py-md-0":"_Fwd2A","my-md-1":"_vBwvs","py-md-1":"_vl1f-","my-md-2":"_7g5va","py-md-2":"_D0JS-","my-md-3":"_8DN0N","py-md-3":"_qvNWl","my-md-4":"_o5Mnp","py-md-4":"_rFfbU","my-md-5":"_7XZDH","py-md-5":"_1B0Rr","my-md-6":"_s09ut","py-md-6":"_jnQRw","my-md-7":"_PgL1b","py-md-7":"_T4779","my-md-8":"_R0d0D","py-md-8":"_Fkri-","my-md-9":"_FM-XK","py-md-9":"_H-snR","my-md-10":"_Z49JP","py-md-10":"_01G-F","m-xl-0":"_H4Jyh","p-xl-0":"_WMtq9","m-xl-1":"_FeJPz","p-xl-1":"_00t3r","m-xl-2":"_svLno","p-xl-2":"_2C22I","m-xl-3":"_T5qYA","p-xl-3":"_dcbn0","m-xl-4":"_Xl89-","p-xl-4":"_Ctf-y","m-xl-5":"_ZWihS","p-xl-5":"_Lzig2","m-xl-6":"_jljvY","p-xl-6":"_X1owU","m-xl-7":"_l1myf","p-xl-7":"_T1fTP","m-xl-8":"_FWU16","p-xl-8":"_R2T50","m-xl-9":"_2TtzQ","p-xl-9":"_-142y","m-xl-10":"_975wG","p-xl-10":"_DPori","ml-xl-0":"_9Zc9q","pl-xl-0":"_On2x0","ml-xl-1":"_IryvS","pl-xl-1":"_J2DXA","ml-xl-2":"_S7cyp","pl-xl-2":"_YxNk9","ml-xl-3":"_6eyqg","pl-xl-3":"_cwyGU","ml-xl-4":"_TbIDB","pl-xl-4":"_JKpl8","ml-xl-5":"_P17BD","pl-xl-5":"_w8ccI","ml-xl-6":"_fUJPM","pl-xl-6":"_mgqKZ","ml-xl-7":"_p-Fn9","pl-xl-7":"_eMF8n","ml-xl-8":"_VO2-y","pl-xl-8":"_O9n-E","ml-xl-9":"_wqX4W","pl-xl-9":"_wDG35","ml-xl-10":"_-TNE-","pl-xl-10":"_jyfgf","mr-xl-0":"_9aQeC","pr-xl-0":"_zWCV0","mr-xl-1":"_vL8LJ","pr-xl-1":"_yA6nk","mr-xl-2":"_ZkYxH","pr-xl-2":"_-LN7c","mr-xl-3":"_WtPxc","pr-xl-3":"_Yn0F0","mr-xl-4":"_M1pzN","pr-xl-4":"_zX1qM","mr-xl-5":"_HWX7s","pr-xl-5":"_0jJWY","mr-xl-6":"_cG-JL","pr-xl-6":"_o2-cg","mr-xl-7":"_g0V5o","pr-xl-7":"_seBWS","mr-xl-8":"_1Rg0L","pr-xl-8":"_uZxYI","mr-xl-9":"_DJD2r","pr-xl-9":"_WXY42","mr-xl-10":"_-EWpt","pr-xl-10":"_W-0Oq","mt-xl-0":"_A3mxM","pt-xl-0":"_mG8-q","mt-xl-1":"_eSV7Q","pt-xl-1":"_9SJkd","mt-xl-2":"_mdspA","pt-xl-2":"_GloWk","mt-xl-3":"_Fn9WR","pt-xl-3":"_l5z5Q","mt-xl-4":"_J5EuO","pt-xl-4":"_z4jGH","mt-xl-5":"_SjIc3","pt-xl-5":"_inlrN","mt-xl-6":"_9iy8O","pt-xl-6":"_FGdNq","mt-xl-7":"_DNLb-","pt-xl-7":"_FDvwW","mt-xl-8":"_cB8Ua","pt-xl-8":"_sFRzN","mt-xl-9":"_iFCES","pt-xl-9":"_M8U3T","mt-xl-10":"_zrBn9","pt-xl-10":"_kYhdD","mb-xl-0":"_AVjLW","pb-xl-0":"_S2OiP","mb-xl-1":"_vnN5p","pb-xl-1":"_ukgJ7","mb-xl-2":"_wZjwy","pb-xl-2":"_rINJ4","mb-xl-3":"_MFAs1","pb-xl-3":"_BjtEQ","mb-xl-4":"_72dvy","pb-xl-4":"_bCnbX","mb-xl-5":"_Uyt6r","pb-xl-5":"_F3Ibd","mb-xl-6":"_iBLUD","pb-xl-6":"_yjY5Y","mb-xl-7":"_6TfYx","pb-xl-7":"_QdVWm","mb-xl-8":"_p-cIL","pb-xl-8":"_saIeH","mb-xl-9":"_Z3PUh","pb-xl-9":"_f8cy7","mb-xl-10":"_ndw2F","pb-xl-10":"_Yxkus","mx-xl-0":"_Bb6PX","px-xl-0":"_M5EOJ","mx-xl-1":"_iWwKY","px-xl-1":"_nWXZF","mx-xl-2":"_OCB5d","px-xl-2":"_GIqDO","mx-xl-3":"_mskG2","px-xl-3":"_-TVSP","mx-xl-4":"_rp-dc","px-xl-4":"_rfQsy","mx-xl-5":"_FgYNJ","px-xl-5":"_yA-K0","mx-xl-6":"_KJ12G","px-xl-6":"_gmhRk","mx-xl-7":"_XF8NS","px-xl-7":"_C0zhm","mx-xl-8":"_rOBd5","px-xl-8":"_FZf4w","mx-xl-9":"_GosX1","px-xl-9":"_zvpad","mx-xl-10":"_uU6kY","px-xl-10":"_XfRJ5","my-xl-0":"_zhez-","py-xl-0":"_-Dum7","my-xl-1":"_QvfIQ","py-xl-1":"_66V5-","my-xl-2":"_e84Sk","py-xl-2":"_pOej1","my-xl-3":"_uv8an","py-xl-3":"_6iY-g","my-xl-4":"_Ur6W4","py-xl-4":"_JPq7T","my-xl-5":"_3GKlh","py-xl-5":"_Gcnsl","my-xl-6":"_JrBH1","py-xl-6":"_IP0ND","my-xl-7":"_7BzpU","py-xl-7":"_BIUqI","my-xl-8":"_mZ-p0","py-xl-8":"_Sdn5j","my-xl-9":"_P3V1N","py-xl-9":"_Z9lbF","my-xl-10":"_VAfcF","py-xl-10":"_X4Bq6","background-shine":"_361tW","path":"_qtb88","line":"_XQ9Yw","skeleton":"_BQ0X7","skeleton-animate":"_vEv3B","skeleton-dark":"_l5qsf","skeleton-dark-animate":"_yk159","skeleton-transparent":"_857E4","skeleton-transparent-animate":"_RzhIE","semi-transparent":"_LacS6","no-margins":"_bmB3S","dots":"_5kMd-","colored":"_-lTGD","small":"_GTU1q","extra-small":"_BEmi7","align-left":"_HuG6N","align-right":"_U3h5U"};
|
|
1162
1166
|
|
|
1163
1167
|
/**
|
|
1164
1168
|
* LoadingDots Component - Displays a loading animation with dots.
|
|
@@ -1201,7 +1205,7 @@ LoadingDots.propTypes = {
|
|
|
1201
1205
|
/**
|
|
1202
1206
|
* Button component - A versatile and customizable button for React applications.
|
|
1203
1207
|
* It supports various sizes, styles, and functionalities, including loaders, icons, and handling of click events.
|
|
1204
|
-
* This component can also be used as a link
|
|
1208
|
+
* This component can also be used as a link if "to" is provided.
|
|
1205
1209
|
*
|
|
1206
1210
|
* @component
|
|
1207
1211
|
* @param {Object} props
|
|
@@ -1301,7 +1305,10 @@ var Button = function Button(_ref) {
|
|
|
1301
1305
|
setIsCheckShown(false);
|
|
1302
1306
|
}, 2000);
|
|
1303
1307
|
}
|
|
1304
|
-
e
|
|
1308
|
+
if (e != null && e.persist) {
|
|
1309
|
+
// Persisting React's SyntheticEvent to be able to use it in any async context
|
|
1310
|
+
e.persist();
|
|
1311
|
+
}
|
|
1305
1312
|
!propagatePrimaryButtonClick && e.stopPropagation();
|
|
1306
1313
|
if (loader) {
|
|
1307
1314
|
setIsLoading(true);
|
|
@@ -1316,13 +1323,13 @@ var Button = function Button(_ref) {
|
|
|
1316
1323
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isFormSubmittingButton ? /*#__PURE__*/React__default["default"].createElement("input", {
|
|
1317
1324
|
type: "submit",
|
|
1318
1325
|
hidden: true
|
|
1319
|
-
}) : null, to ? /*#__PURE__*/React__default["default"].createElement(
|
|
1326
|
+
}) : null, to ? /*#__PURE__*/React__default["default"].createElement("a", {
|
|
1320
1327
|
className: classNames,
|
|
1321
1328
|
onClick: function onClick(e) {
|
|
1322
1329
|
return handleError(buttonClick, e);
|
|
1323
1330
|
},
|
|
1324
|
-
|
|
1325
|
-
|
|
1331
|
+
href: to,
|
|
1332
|
+
ref: buttonRef
|
|
1326
1333
|
}, icon ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1327
1334
|
className: styles$1["button-with-icon"] + (bigIcon ? " " + styles$1["big-icon"] : "")
|
|
1328
1335
|
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
@@ -1356,7 +1363,7 @@ var Button = function Button(_ref) {
|
|
|
1356
1363
|
Button.propTypes = {
|
|
1357
1364
|
size: PropTypes.oneOf(["xl", "lg", "md", "sm"]),
|
|
1358
1365
|
className: PropTypes.string,
|
|
1359
|
-
mode: PropTypes.oneOf(["transparent", "white", "primary", "primary-bordered", "primary-transparent", "transparent-bordered", "transparent-without-shadow"]),
|
|
1366
|
+
mode: PropTypes.oneOf(["transparent", "white", "white-flat", "primary", "primary-bordered", "primary-transparent", "transparent-bordered", "transparent-without-shadow"]),
|
|
1360
1367
|
onClick: PropTypes.func,
|
|
1361
1368
|
loader: PropTypes.bool,
|
|
1362
1369
|
loading: PropTypes.bool,
|
|
@@ -1398,6 +1405,3140 @@ Button.defaultProps = {
|
|
|
1398
1405
|
}
|
|
1399
1406
|
};
|
|
1400
1407
|
|
|
1408
|
+
var SupportChat = function SupportChat(_ref) {
|
|
1409
|
+
var url = _ref.url,
|
|
1410
|
+
websiteToken = _ref.websiteToken,
|
|
1411
|
+
_ref$welcomeMessage = _ref.welcomeMessage,
|
|
1412
|
+
welcomeMessage = _ref$welcomeMessage === void 0 ? "" : _ref$welcomeMessage,
|
|
1413
|
+
_ref$locale = _ref.locale,
|
|
1414
|
+
locale = _ref$locale === void 0 ? "en" : _ref$locale;
|
|
1415
|
+
React.useEffect(function () {
|
|
1416
|
+
window.chatwootSettings = {
|
|
1417
|
+
position: "right",
|
|
1418
|
+
type: "standard",
|
|
1419
|
+
launcherTitle: welcomeMessage,
|
|
1420
|
+
locale: locale
|
|
1421
|
+
};
|
|
1422
|
+
(function (d, t) {
|
|
1423
|
+
var BASE_URL = url;
|
|
1424
|
+
var g = d.createElement(t),
|
|
1425
|
+
s = d.getElementsByTagName(t)[0];
|
|
1426
|
+
g.src = BASE_URL + "/packs/js/sdk.js";
|
|
1427
|
+
g.defer = true;
|
|
1428
|
+
g.async = true;
|
|
1429
|
+
s.parentNode.insertBefore(g, s);
|
|
1430
|
+
g.onload = function () {
|
|
1431
|
+
window.chatwootSDK.run({
|
|
1432
|
+
websiteToken: websiteToken,
|
|
1433
|
+
baseUrl: BASE_URL
|
|
1434
|
+
});
|
|
1435
|
+
};
|
|
1436
|
+
})(document, "script");
|
|
1437
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1438
|
+
}, []);
|
|
1439
|
+
return null;
|
|
1440
|
+
};
|
|
1441
|
+
SupportChat.propTypes = {
|
|
1442
|
+
url: PropTypes.string.isRequired,
|
|
1443
|
+
websiteToken: PropTypes.string.isRequired,
|
|
1444
|
+
welcomeMessage: PropTypes.string,
|
|
1445
|
+
locale: PropTypes.string
|
|
1446
|
+
};
|
|
1447
|
+
SupportChat.defaultProps = {
|
|
1448
|
+
welcomeMessage: "",
|
|
1449
|
+
locale: "en"
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
var s = {"container":"_DYS-g","m-0":"_85R9d","p-0":"_wi0-U","m-1":"_YoewO","p-1":"_vuJBW","m-2":"_ruaYI","p-2":"_dO-cg","m-3":"_3Oh59","p-3":"_x4uSr","m-4":"_zN8us","p-4":"_rjv4I","m-5":"_5T1F-","p-5":"_-nWHT","m-6":"_Skgdf","p-6":"_Oux4z","m-7":"_yKPSq","p-7":"_sOsqF","m-8":"_8EoDT","p-8":"_G4M7b","m-9":"_ZZJBC","p-9":"_2PU3N","m-10":"_XRmXO","p-10":"_lhLN8","ml-0":"_SIynD","pl-0":"_VCLgc","ml-1":"_9vhMT","pl-1":"_4O5ig","ml-2":"_f1saV","pl-2":"_sHxk9","ml-3":"_kiltH","pl-3":"_jUw5Z","ml-4":"_CF1wj","pl-4":"_eXCZ1","ml-5":"_HZlH9","pl-5":"_6xbwv","ml-6":"_jNpyz","pl-6":"_k5lHk","ml-7":"_LgB9F","pl-7":"_ol9Tb","ml-8":"_I25tR","pl-8":"_TN4dc","ml-9":"_ywWxC","pl-9":"_4UsSQ","ml-10":"_9rfct","pl-10":"_LoViP","mr-0":"_-1PzO","pr-0":"_Ekco3","mr-1":"_EfRd0","pr-1":"_GspC-","mr-2":"_91QSK","pr-2":"_dU7Vb","mr-3":"_tW92i","pr-3":"_qNnnG","mr-4":"_XC1FW","pr-4":"_09RVw","mr-5":"_I4KRh","pr-5":"_eag2b","mr-6":"_E-KDc","pr-6":"_0d7JN","mr-7":"_9GUd-","pr-7":"_5Jseh","mr-8":"_Z-z3u","pr-8":"_rjPRa","mr-9":"_R2d68","pr-9":"_YI-lc","mr-10":"_ORX-B","pr-10":"_F5ib8","mt-0":"_OAl4b","pt-0":"_iJ5QU","mt-1":"_x72-c","pt-1":"_DGuKS","mt-2":"_ZYCC4","pt-2":"_6oj3E","mt-3":"_ADXHX","pt-3":"_asJoO","mt-4":"_Bz8Hu","pt-4":"_N7CCb","mt-5":"_OyQQ8","pt-5":"_C46Cf","mt-6":"_Bfrcj","pt-6":"_NN4sF","mt-7":"_RWFV0","pt-7":"_zUauA","mt-8":"_v7txm","pt-8":"_qgvMl","mt-9":"_9s32w","pt-9":"_aJZt7","mt-10":"_feBhr","pt-10":"_EfI4E","mb-0":"_RUzt9","pb-0":"_0Zjn8","mb-1":"_EmcPj","pb-1":"_zuqTv","mb-2":"_jYcdG","pb-2":"_fjMa6","mb-3":"_Lcgzu","pb-3":"_MHHa3","mb-4":"_Aoo0-","pb-4":"_B1ap3","mb-5":"_xdjCc","pb-5":"_lnrC3","mb-6":"_TFmkS","pb-6":"_YNj2R","mb-7":"_i0-JZ","pb-7":"_qSvSL","mb-8":"_7ziqB","pb-8":"_W-Cdi","mb-9":"_lUUVq","pb-9":"_LrgoL","mb-10":"_xX8mu","pb-10":"_DU6C6","mx-0":"_71D1Q","px-0":"_U8dyv","mx-1":"_2VhDN","px-1":"_d8Tlo","mx-2":"_uDkn4","px-2":"_a6Z6h","mx-3":"_W9yqm","px-3":"_MCbca","mx-4":"_sIDVk","px-4":"_wZ8Qz","mx-5":"_-6tEi","px-5":"_8vfpL","mx-6":"_mbXa9","px-6":"_LcSh5","mx-7":"_mF9-c","px-7":"_TfjhQ","mx-8":"_RG7wu","px-8":"_19Sdb","mx-9":"_JkKgx","px-9":"_Ir3LH","mx-10":"_70tWA","px-10":"_d1BrW","my-0":"_0PauS","py-0":"_FP0FE","my-1":"_znn6s","py-1":"_-FHoU","my-2":"_EqZco","py-2":"_fuTfe","my-3":"_D2LQ5","py-3":"_YWhnK","my-4":"_kCXTL","py-4":"_j1vj6","my-5":"_naEoR","py-5":"_QK3Z-","my-6":"_L1TOy","py-6":"_dQH-e","my-7":"_sVZ3Y","py-7":"_Fi779","my-8":"_1mAkX","py-8":"_yTTVv","my-9":"_jCeMV","py-9":"_qfn2C","my-10":"_eqneu","py-10":"_Atu-j","m-sm-0":"_hsKWE","p-sm-0":"_j3m-2","m-sm-1":"_NQOee","p-sm-1":"_sB5mJ","m-sm-2":"_KivoH","p-sm-2":"_YjE2j","m-sm-3":"_kObhZ","p-sm-3":"_TDlKW","m-sm-4":"_aJWH3","p-sm-4":"_Vntgp","m-sm-5":"_k-Hjs","p-sm-5":"_mJt7k","m-sm-6":"_Yxxob","p-sm-6":"_E5a-A","m-sm-7":"_M1OJO","p-sm-7":"_-5OJr","m-sm-8":"_UYrWD","p-sm-8":"_FJeV6","m-sm-9":"_DosWW","p-sm-9":"_T9yES","m-sm-10":"_tLYqH","p-sm-10":"_5dbE7","ml-sm-0":"_PM9wP","pl-sm-0":"_0Eoi7","ml-sm-1":"_Mb-hF","pl-sm-1":"_n4rCF","ml-sm-2":"_JJgiX","pl-sm-2":"_WOdAR","ml-sm-3":"_umhPB","pl-sm-3":"_tETqx","ml-sm-4":"_PQ088","pl-sm-4":"_ON2pV","ml-sm-5":"_IrMTT","pl-sm-5":"_12IZU","ml-sm-6":"_s8vHJ","pl-sm-6":"_9Od-S","ml-sm-7":"_4uuhE","pl-sm-7":"_TTrnJ","ml-sm-8":"_6TEO5","pl-sm-8":"_ZEPSH","ml-sm-9":"_I05iS","pl-sm-9":"_F5rHi","ml-sm-10":"_AJZ2R","pl-sm-10":"_zgudu","mr-sm-0":"_AD7v0","pr-sm-0":"_katlS","mr-sm-1":"_RMNwS","pr-sm-1":"_SC0VS","mr-sm-2":"_YFbee","pr-sm-2":"_I2cqm","mr-sm-3":"_KJzfk","pr-sm-3":"_aDNge","mr-sm-4":"_ERg9u","pr-sm-4":"_wlgHy","mr-sm-5":"_spxY0","pr-sm-5":"_pAEEu","mr-sm-6":"_HM7Z6","pr-sm-6":"_rf9My","mr-sm-7":"_b-V6W","pr-sm-7":"_YFXWV","mr-sm-8":"_96NiE","pr-sm-8":"_0ynKz","mr-sm-9":"_9NqL0","pr-sm-9":"_ZEN2v","mr-sm-10":"_oxmC7","pr-sm-10":"_AsAlz","mt-sm-0":"_Yl8e7","pt-sm-0":"_fkSmd","mt-sm-1":"_l4X69","pt-sm-1":"_i7WdP","mt-sm-2":"_ggYWK","pt-sm-2":"_3-z2g","mt-sm-3":"_IzZ-y","pt-sm-3":"_c3PEq","mt-sm-4":"_BbTvo","pt-sm-4":"_iAXVy","mt-sm-5":"_RNscW","pt-sm-5":"_7dHkj","mt-sm-6":"_iKCRS","pt-sm-6":"_an673","mt-sm-7":"_1Atcr","pt-sm-7":"_KA-HC","mt-sm-8":"_45ifh","pt-sm-8":"_26wBi","mt-sm-9":"_VaqUk","pt-sm-9":"_cx10Q","mt-sm-10":"_83RI-","pt-sm-10":"_vTZq7","mb-sm-0":"_IDhal","pb-sm-0":"_3IjzN","mb-sm-1":"_sjxoK","pb-sm-1":"_fmWwG","mb-sm-2":"_GNlxw","pb-sm-2":"_r3zJV","mb-sm-3":"_FFWRt","pb-sm-3":"_arvvr","mb-sm-4":"_qaIKp","pb-sm-4":"_wSca9","mb-sm-5":"_-cXAZ","pb-sm-5":"_grIUD","mb-sm-6":"_PUPyR","pb-sm-6":"_nA8VL","mb-sm-7":"_t7JYD","pb-sm-7":"_OpbJn","mb-sm-8":"_x1wdN","pb-sm-8":"_3Z-mA","mb-sm-9":"_BPrSY","pb-sm-9":"_b-NQ7","mb-sm-10":"_lSN9Q","pb-sm-10":"_E7xwy","mx-sm-0":"_-cSXk","px-sm-0":"_VlISI","mx-sm-1":"_6derN","px-sm-1":"_in01f","mx-sm-2":"_nskhZ","px-sm-2":"_Thnqg","mx-sm-3":"_xR8rV","px-sm-3":"_zUOaf","mx-sm-4":"_0c-bw","px-sm-4":"_X-g0R","mx-sm-5":"_p3iVv","px-sm-5":"_RdgSR","mx-sm-6":"_vK8xL","px-sm-6":"_xGpLP","mx-sm-7":"_uvb2q","px-sm-7":"_YvDjG","mx-sm-8":"_8nvEy","px-sm-8":"_L3gRg","mx-sm-9":"_pRh4Y","px-sm-9":"_5yig0","mx-sm-10":"_syXdz","px-sm-10":"_TfV9e","my-sm-0":"_WXfoP","py-sm-0":"_SBx-N","my-sm-1":"_dPEq6","py-sm-1":"_UrxQl","my-sm-2":"_ULvTZ","py-sm-2":"_I4Sll","my-sm-3":"_YVvfW","py-sm-3":"_9qflx","my-sm-4":"_j4ltv","py-sm-4":"_u-NN2","my-sm-5":"_mC1LQ","py-sm-5":"_6Wcc2","my-sm-6":"_eE8rw","py-sm-6":"_AeFpW","my-sm-7":"_CAnzA","py-sm-7":"_7h-Vs","my-sm-8":"_Z9Aft","py-sm-8":"_Ww8LU","my-sm-9":"_3sbBd","py-sm-9":"_ZcdCh","my-sm-10":"_PGBDh","py-sm-10":"_i6Fc2","m-lg-0":"_PkOb8","p-lg-0":"_3UpkE","m-lg-1":"_nCbz9","p-lg-1":"_1lThO","m-lg-2":"_ARtYq","p-lg-2":"_vHeBX","m-lg-3":"_cpKBp","p-lg-3":"_n-7p1","m-lg-4":"_1bWgj","p-lg-4":"_niPSW","m-lg-5":"_T9s09","p-lg-5":"_OS1Yy","m-lg-6":"_GvZeA","p-lg-6":"_8cgsA","m-lg-7":"_d0oC7","p-lg-7":"_TuBYJ","m-lg-8":"_slAc2","p-lg-8":"_ay3FH","m-lg-9":"_r3-kR","p-lg-9":"_IuC-U","m-lg-10":"_9P6I9","p-lg-10":"_RUR7-","ml-lg-0":"_xf3wx","pl-lg-0":"_Q-8ZY","ml-lg-1":"_4tg9Q","pl-lg-1":"_2rsuI","ml-lg-2":"_-YU8G","pl-lg-2":"_Eds1N","ml-lg-3":"_tD4RQ","pl-lg-3":"_R0Rk2","ml-lg-4":"_pZcNJ","pl-lg-4":"_5jvIR","ml-lg-5":"_sjk-4","pl-lg-5":"_RwLHv","ml-lg-6":"_dyXyT","pl-lg-6":"_nVLAC","ml-lg-7":"_FPuf8","pl-lg-7":"_M5bYC","ml-lg-8":"_Uet9k","pl-lg-8":"_UrAQv","ml-lg-9":"_VPraG","pl-lg-9":"_8HJkV","ml-lg-10":"_ILHbQ","pl-lg-10":"_QaxaT","mr-lg-0":"_2QrJI","pr-lg-0":"_0XJPD","mr-lg-1":"_qSATY","pr-lg-1":"_fzyzB","mr-lg-2":"_pY4IE","pr-lg-2":"_lc7Gu","mr-lg-3":"_KeRuW","pr-lg-3":"_zc2cu","mr-lg-4":"_RvxVY","pr-lg-4":"_v5XDn","mr-lg-5":"_Kipoo","pr-lg-5":"_K-vHR","mr-lg-6":"_1nl-K","pr-lg-6":"_nVUH-","mr-lg-7":"_M1Ue1","pr-lg-7":"_B75ua","mr-lg-8":"_CmlKz","pr-lg-8":"_FnY12","mr-lg-9":"_8-uRA","pr-lg-9":"_1DG22","mr-lg-10":"_vzMQh","pr-lg-10":"_2iqul","mt-lg-0":"_1eCp-","pt-lg-0":"_ucRUw","mt-lg-1":"_9YQ4e","pt-lg-1":"_pzmV0","mt-lg-2":"_1Z7OF","pt-lg-2":"_FUFhX","mt-lg-3":"_HPI-W","pt-lg-3":"_NwVgV","mt-lg-4":"_duZYq","pt-lg-4":"_h0NfP","mt-lg-5":"_sszGU","pt-lg-5":"_nNi-i","mt-lg-6":"_YYWl4","pt-lg-6":"_rqDrl","mt-lg-7":"_MmkeY","pt-lg-7":"_TZx0T","mt-lg-8":"_mdoth","pt-lg-8":"_2pGPR","mt-lg-9":"_csumg","pt-lg-9":"_BIWSR","mt-lg-10":"_TN07y","pt-lg-10":"_ojQGh","mb-lg-0":"_eXETo","pb-lg-0":"_FeL5F","mb-lg-1":"_Zc1bw","pb-lg-1":"_34sNS","mb-lg-2":"_2XgD-","pb-lg-2":"_OTB4o","mb-lg-3":"_xJ4EC","pb-lg-3":"_-Uc7P","mb-lg-4":"_thqbO","pb-lg-4":"_lqHuw","mb-lg-5":"_gDmAe","pb-lg-5":"_zAiLu","mb-lg-6":"_96HP2","pb-lg-6":"_TCehU","mb-lg-7":"_1Guas","pb-lg-7":"_vn7-Z","mb-lg-8":"_Cc-m8","pb-lg-8":"_dbCuX","mb-lg-9":"_U5Qon","pb-lg-9":"_b54cM","mb-lg-10":"_cGYyA","pb-lg-10":"_U5qus","mx-lg-0":"_TDPp0","px-lg-0":"_hUlWn","mx-lg-1":"_uh5DO","px-lg-1":"_N8r0e","mx-lg-2":"_vsfWJ","px-lg-2":"_LaBP6","mx-lg-3":"_JxquV","px-lg-3":"_Tb8mk","mx-lg-4":"_wDKd1","px-lg-4":"_lIguL","mx-lg-5":"_RSd-x","px-lg-5":"_Mdf1f","mx-lg-6":"_uvK2D","px-lg-6":"_4k20p","mx-lg-7":"_iXTh7","px-lg-7":"_W2faz","mx-lg-8":"_HHM9t","px-lg-8":"_n54Rq","mx-lg-9":"_douwI","px-lg-9":"_KWSHJ","mx-lg-10":"_L-r4v","px-lg-10":"_qeSLU","my-lg-0":"_U9qcF","py-lg-0":"_sSD4U","my-lg-1":"_vNl2c","py-lg-1":"_Cfkag","my-lg-2":"_gVDuB","py-lg-2":"_FwQsB","my-lg-3":"_oiJaa","py-lg-3":"_FASGS","my-lg-4":"_va2Tm","py-lg-4":"_EPTkJ","my-lg-5":"_jvYOP","py-lg-5":"_NTxiG","my-lg-6":"_8Y7Xj","py-lg-6":"_Nrsd7","my-lg-7":"_-e9e5","py-lg-7":"_NOh2l","my-lg-8":"_nyCDl","py-lg-8":"_fpL5p","my-lg-9":"_BbcqH","py-lg-9":"_VlI3L","my-lg-10":"_OGNmd","py-lg-10":"_Q-3bw","m-md-0":"_P6WIc","p-md-0":"_3YuAI","m-md-1":"_VwK3z","p-md-1":"_ArFsR","m-md-2":"_5Hp7o","p-md-2":"_-R4rJ","m-md-3":"_J55VC","p-md-3":"_TxlAj","m-md-4":"_FHPQG","p-md-4":"_iZW10","m-md-5":"_Kiuiv","p-md-5":"_0Qiry","m-md-6":"_Ja9dp","p-md-6":"_GBAS-","m-md-7":"_uuE4u","p-md-7":"_kAuu-","m-md-8":"_CaU4W","p-md-8":"_GbyMJ","m-md-9":"_brWmN","p-md-9":"_-1z0O","m-md-10":"_dIML4","p-md-10":"_eJliD","ml-md-0":"_nuVMQ","pl-md-0":"_PCyiw","ml-md-1":"_NX2qp","pl-md-1":"_yJ39l","ml-md-2":"_BV1WB","pl-md-2":"_x24YX","ml-md-3":"_kvTBw","pl-md-3":"_7G7wo","ml-md-4":"_s1oaO","pl-md-4":"_nTHBq","ml-md-5":"_2AyzN","pl-md-5":"_VmocP","ml-md-6":"_QEhdf","pl-md-6":"_Ywy9t","ml-md-7":"_Mybnc","pl-md-7":"_zHudI","ml-md-8":"_AT4F-","pl-md-8":"_1-CLq","ml-md-9":"_cZ0UL","pl-md-9":"_AKT8q","ml-md-10":"_uo54H","pl-md-10":"_2Edrz","mr-md-0":"_8NtcB","pr-md-0":"_BN5kR","mr-md-1":"_hIIXR","pr-md-1":"_KWi0C","mr-md-2":"_kP9GD","pr-md-2":"_fo1s0","mr-md-3":"_ptgO9","pr-md-3":"_AIGLm","mr-md-4":"_GJNi6","pr-md-4":"_-ZfQA","mr-md-5":"_hW-OG","pr-md-5":"_ePqmc","mr-md-6":"_ghuDl","pr-md-6":"_C9rlZ","mr-md-7":"_bIHB6","pr-md-7":"_xPHzJ","mr-md-8":"_6ZssD","pr-md-8":"_-N-QR","mr-md-9":"_T-XzG","pr-md-9":"_k8hdA","mr-md-10":"_26xvU","pr-md-10":"_U6Fpn","mt-md-0":"_ZIFgT","pt-md-0":"_6JBhp","mt-md-1":"_lIu84","pt-md-1":"_yPyiK","mt-md-2":"_sWcbm","pt-md-2":"_-7S2K","mt-md-3":"_-Zt6X","pt-md-3":"_pmFds","mt-md-4":"_dlz9t","pt-md-4":"_HQv-M","mt-md-5":"_9tUBj","pt-md-5":"_Jdc38","mt-md-6":"_BEZDD","pt-md-6":"_c3r6r","mt-md-7":"_KSCEr","pt-md-7":"_-Tpjo","mt-md-8":"_O-cOs","pt-md-8":"_DPwEz","mt-md-9":"_eBVAf","pt-md-9":"_Fnftl","mt-md-10":"_tlAu5","pt-md-10":"_ufMho","mb-md-0":"_NKFtN","pb-md-0":"_QEyOV","mb-md-1":"_t8EVs","pb-md-1":"_hVqy6","mb-md-2":"_Dwa5p","pb-md-2":"_A6iqX","mb-md-3":"_DAzrF","pb-md-3":"_o9L2-","mb-md-4":"_zMG5y","pb-md-4":"_wC2az","mb-md-5":"_LYF0o","pb-md-5":"_rrbij","mb-md-6":"_tUQcN","pb-md-6":"_MgAD-","mb-md-7":"_9lVsl","pb-md-7":"_Z7z8R","mb-md-8":"_CMrj4","pb-md-8":"_X4Qb0","mb-md-9":"_dQuWg","pb-md-9":"_98aa5","mb-md-10":"_tjfzH","pb-md-10":"_n5Id2","mx-md-0":"_kbQ3E","px-md-0":"_LWqO4","mx-md-1":"_8dqNC","px-md-1":"_QBFBY","mx-md-2":"_QXy6I","px-md-2":"_vBqGQ","mx-md-3":"_asgRe","px-md-3":"_i67O7","mx-md-4":"_-9eXp","px-md-4":"_ZQIEY","mx-md-5":"_l4FN1","px-md-5":"_vYBmq","mx-md-6":"_j4Fiy","px-md-6":"_BLvHs","mx-md-7":"_hg5ZA","px-md-7":"_OclOz","mx-md-8":"_NNMXz","px-md-8":"_KUBjL","mx-md-9":"_x5vxD","px-md-9":"_x1Hj-","mx-md-10":"_RnJFW","px-md-10":"_laoTv","my-md-0":"_gAG5i","py-md-0":"_KQkB8","my-md-1":"_90Emt","py-md-1":"_a93vq","my-md-2":"_wzerE","py-md-2":"_vpawj","my-md-3":"_ijUtT","py-md-3":"_9G-7C","my-md-4":"_GfQTx","py-md-4":"_vGRDM","my-md-5":"_MVaN3","py-md-5":"_5Ju4e","my-md-6":"_StvD2","py-md-6":"_03iO9","my-md-7":"_nlUi8","py-md-7":"_e58lN","my-md-8":"_VKoKR","py-md-8":"_Xa5lD","my-md-9":"_nLjef","py-md-9":"_88ryZ","my-md-10":"_-f4Oc","py-md-10":"_60CJ8","m-xl-0":"_YdUVc","p-xl-0":"_ceNl-","m-xl-1":"_cn-PK","p-xl-1":"_8pBVr","m-xl-2":"_UNu8h","p-xl-2":"_6mIBX","m-xl-3":"_LXA70","p-xl-3":"_nkNjg","m-xl-4":"_DH3uC","p-xl-4":"_b631X","m-xl-5":"_PU5TK","p-xl-5":"_Y9Pj5","m-xl-6":"_DQUfX","p-xl-6":"_cmXs1","m-xl-7":"_Hr4dN","p-xl-7":"_pwyLG","m-xl-8":"_XkBIo","p-xl-8":"_oSfQ1","m-xl-9":"_TXGD8","p-xl-9":"_r8XiA","m-xl-10":"_cbucW","p-xl-10":"_FnUT2","ml-xl-0":"_Lc2b0","pl-xl-0":"_8ofmI","ml-xl-1":"_yOkOl","pl-xl-1":"_5cZix","ml-xl-2":"_F0JQw","pl-xl-2":"_pWIp6","ml-xl-3":"_9CDHy","pl-xl-3":"_M9MOq","ml-xl-4":"_L6LLW","pl-xl-4":"_NZlEo","ml-xl-5":"_Milvj","pl-xl-5":"_N-hPa","ml-xl-6":"_HEU-c","pl-xl-6":"_x-uz3","ml-xl-7":"_xVYoD","pl-xl-7":"_TV3yu","ml-xl-8":"_WVmm8","pl-xl-8":"_Wsfh3","ml-xl-9":"_Rse0C","pl-xl-9":"_p-0My","ml-xl-10":"_LN1Pv","pl-xl-10":"_WtXyv","mr-xl-0":"_aQ8fC","pr-xl-0":"_x7HY1","mr-xl-1":"_rzUKT","pr-xl-1":"_ggRzA","mr-xl-2":"_j88Jb","pr-xl-2":"_6Ztzi","mr-xl-3":"_RNldP","pr-xl-3":"_uC4PP","mr-xl-4":"_14KPU","pr-xl-4":"_RoGxi","mr-xl-5":"_MYSFB","pr-xl-5":"_0fjNm","mr-xl-6":"_aK553","pr-xl-6":"_B-5Vf","mr-xl-7":"_nLta-","pr-xl-7":"_AhsZ-","mr-xl-8":"_emyPo","pr-xl-8":"_Dc6lK","mr-xl-9":"_MqsWc","pr-xl-9":"_j4A-H","mr-xl-10":"_v7rIi","pr-xl-10":"_aIhOc","mt-xl-0":"_1KMHA","pt-xl-0":"_SmBQC","mt-xl-1":"_FpHTe","pt-xl-1":"_tRIkV","mt-xl-2":"_ISAHh","pt-xl-2":"_KcOk8","mt-xl-3":"_cklRo","pt-xl-3":"_MqQSr","mt-xl-4":"_iaWfp","pt-xl-4":"_mcXBl","mt-xl-5":"_qNaL5","pt-xl-5":"_3tRQZ","mt-xl-6":"_MjyPP","pt-xl-6":"_wGTYM","mt-xl-7":"_WkpWd","pt-xl-7":"_-fXMT","mt-xl-8":"_xgRm6","pt-xl-8":"_mNE0F","mt-xl-9":"_tHRgU","pt-xl-9":"_pUanr","mt-xl-10":"_75l23","pt-xl-10":"_VjjB-","mb-xl-0":"_wNZHn","pb-xl-0":"_6weX6","mb-xl-1":"_xbDsG","pb-xl-1":"_WLHB6","mb-xl-2":"_JCck5","pb-xl-2":"_Ef822","mb-xl-3":"_-Izvj","pb-xl-3":"_kizTx","mb-xl-4":"_wDLLt","pb-xl-4":"_6vfXW","mb-xl-5":"_qa8hX","pb-xl-5":"_2cdIL","mb-xl-6":"_PPuX7","pb-xl-6":"_SYsiu","mb-xl-7":"_au29R","pb-xl-7":"_Wo-v3","mb-xl-8":"_7DCh1","pb-xl-8":"_8Qtxz","mb-xl-9":"_U5ePL","pb-xl-9":"_QdSRg","mb-xl-10":"_xwDK-","pb-xl-10":"_5HXQF","mx-xl-0":"_U-5An","px-xl-0":"_t0GQI","mx-xl-1":"_l2Q9y","px-xl-1":"_-6SLy","mx-xl-2":"_OO5ra","px-xl-2":"_DpWnU","mx-xl-3":"_umWwt","px-xl-3":"_gLeFm","mx-xl-4":"_O6nxp","px-xl-4":"_RXch7","mx-xl-5":"_GLCbl","px-xl-5":"_wOP1U","mx-xl-6":"_n1gJF","px-xl-6":"_jHA8-","mx-xl-7":"_ZG5zQ","px-xl-7":"_33-Bi","mx-xl-8":"_wGBwu","px-xl-8":"_jnqCE","mx-xl-9":"_-q541","px-xl-9":"_hQqb-","mx-xl-10":"_oOjVu","px-xl-10":"_8iBI4","my-xl-0":"_5V5-G","py-xl-0":"_ZIETe","my-xl-1":"_VhBbg","py-xl-1":"_qkd1g","my-xl-2":"_MONRd","py-xl-2":"_wBVYq","my-xl-3":"_oUD7x","py-xl-3":"_9C1YA","my-xl-4":"_akz7W","py-xl-4":"_sczsh","my-xl-5":"_CEcRg","py-xl-5":"_xFnw3","my-xl-6":"_RReJQ","py-xl-6":"_gx-E-","my-xl-7":"_NTw09","py-xl-7":"_VniPR","my-xl-8":"_zhVnN","py-xl-8":"_e-lj8","my-xl-9":"_p5Z-c","py-xl-9":"_L1zCc","my-xl-10":"_NqJ-Z","py-xl-10":"_LGmu1","background-shine":"_HkIXJ","path":"_VW1Ys","line":"_x1Ry-","skeleton":"_rh5J1","skeleton-animate":"_ukRhW","skeleton-dark":"_SuY0j","skeleton-dark-animate":"_wHz7j","skeleton-transparent":"_DehL2","skeleton-transparent-animate":"_nwZzB","semi-transparent":"_KJuSy","asset-icon":"_V0pcT","small":"_AXy-6","asset-icon-primary":"_wDjNx","asset-icon-secondary":"_uTjfo"};
|
|
1453
|
+
|
|
1454
|
+
var AssetIcon = function AssetIcon(_ref) {
|
|
1455
|
+
var assetIconSrc = _ref.assetIconSrc,
|
|
1456
|
+
_ref$assetIconProtoco = _ref.assetIconProtocolSrc,
|
|
1457
|
+
assetIconProtocolSrc = _ref$assetIconProtoco === void 0 ? null : _ref$assetIconProtoco,
|
|
1458
|
+
_ref$fallbackSrc = _ref.fallbackSrc,
|
|
1459
|
+
fallbackSrc = _ref$fallbackSrc === void 0 ? null : _ref$fallbackSrc,
|
|
1460
|
+
_ref$small = _ref.small,
|
|
1461
|
+
small = _ref$small === void 0 ? false : _ref$small;
|
|
1462
|
+
var handleFailedLoad = function handleFailedLoad(e) {
|
|
1463
|
+
e.target.onerror = null;
|
|
1464
|
+
e.target.src = fallbackSrc;
|
|
1465
|
+
};
|
|
1466
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1467
|
+
className: s["asset-icon"] + (small ? " " + s["small"] : "")
|
|
1468
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
1469
|
+
src: assetIconSrc,
|
|
1470
|
+
className: s["asset-icon-primary"] + (small ? " " + s["small"] : ""),
|
|
1471
|
+
alt: " ",
|
|
1472
|
+
onError: handleFailedLoad
|
|
1473
|
+
}), assetIconProtocolSrc ? /*#__PURE__*/React__default["default"].createElement("img", {
|
|
1474
|
+
src: assetIconProtocolSrc,
|
|
1475
|
+
className: s["asset-icon-secondary"] + (small ? " " + s["small"] : ""),
|
|
1476
|
+
alt: " ",
|
|
1477
|
+
onError: handleFailedLoad
|
|
1478
|
+
}) : "");
|
|
1479
|
+
};
|
|
1480
|
+
AssetIcon.propTypes = {
|
|
1481
|
+
assetIconSrc: PropTypes.string.isRequired,
|
|
1482
|
+
assetIconProtocolSrc: PropTypes.string,
|
|
1483
|
+
fallbackSrc: PropTypes.string,
|
|
1484
|
+
small: PropTypes.bool
|
|
1485
|
+
};
|
|
1486
|
+
AssetIcon.defaultProps = {
|
|
1487
|
+
assetIconProtocolSrc: null,
|
|
1488
|
+
fallbackSrc: null,
|
|
1489
|
+
small: false
|
|
1490
|
+
};
|
|
1491
|
+
|
|
1492
|
+
var LogsStorage = /*#__PURE__*/function () {
|
|
1493
|
+
function LogsStorage() {}
|
|
1494
|
+
LogsStorage.saveLog = function saveLog(log) {
|
|
1495
|
+
this._inMemoryStorage.push(log);
|
|
1496
|
+
};
|
|
1497
|
+
LogsStorage.getInMemoryLogs = function getInMemoryLogs() {
|
|
1498
|
+
return this._inMemoryStorage;
|
|
1499
|
+
};
|
|
1500
|
+
LogsStorage.getAllLogs = function getAllLogs() {
|
|
1501
|
+
var storedLogs = "";
|
|
1502
|
+
if (typeof window !== "undefined") {
|
|
1503
|
+
storedLogs = localStorage.getItem(this._logsStorageId);
|
|
1504
|
+
}
|
|
1505
|
+
return storedLogs + "\n" + this._inMemoryStorage.join("\n");
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
/**
|
|
1509
|
+
* @param logger {Logger}
|
|
1510
|
+
*/;
|
|
1511
|
+
LogsStorage.saveToTheDisk = function saveToTheDisk(logger) {
|
|
1512
|
+
try {
|
|
1513
|
+
var MAX_LOCAL_STORAGE_VOLUME_BYTES = 5 * 1024 * 1024;
|
|
1514
|
+
var MAX_LOGS_STORAGE_BYTES = MAX_LOCAL_STORAGE_VOLUME_BYTES * 0.65;
|
|
1515
|
+
if (typeof window !== "undefined") {
|
|
1516
|
+
var existingLogs = localStorage.getItem(this._logsStorageId);
|
|
1517
|
+
var logsString = existingLogs + "\n" + this._inMemoryStorage.join("\n");
|
|
1518
|
+
var lettersCountToRemove = logsString.length - Math.round(MAX_LOGS_STORAGE_BYTES / 2);
|
|
1519
|
+
if (lettersCountToRemove > 0) {
|
|
1520
|
+
localStorage.setItem(this._logsStorageId, logsString.slice(lettersCountToRemove, logsString.length));
|
|
1521
|
+
} else {
|
|
1522
|
+
localStorage.setItem(this._logsStorageId, logsString);
|
|
1523
|
+
}
|
|
1524
|
+
this._inMemoryStorage = [];
|
|
1525
|
+
}
|
|
1526
|
+
} catch (e) {
|
|
1527
|
+
logger == null || logger.logError(e, "saveToTheDisk", "Failed to save logs to disk");
|
|
1528
|
+
}
|
|
1529
|
+
};
|
|
1530
|
+
LogsStorage.removeAllClientLogs = function removeAllClientLogs() {
|
|
1531
|
+
if (typeof window !== "undefined") {
|
|
1532
|
+
if (localStorage.getItem("doNotRemoveClientLogsWhenSignedOut") !== "true") {
|
|
1533
|
+
localStorage.removeItem(this._logsStorageId);
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
this._inMemoryStorage = [];
|
|
1537
|
+
};
|
|
1538
|
+
LogsStorage.setDoNotRemoveClientLogsWhenSignedOut = function setDoNotRemoveClientLogsWhenSignedOut(value) {
|
|
1539
|
+
if (typeof window !== "undefined") {
|
|
1540
|
+
localStorage.setItem("doNotRemoveClientLogsWhenSignedOut", value);
|
|
1541
|
+
}
|
|
1542
|
+
};
|
|
1543
|
+
return LogsStorage;
|
|
1544
|
+
}();
|
|
1545
|
+
LogsStorage._inMemoryStorage = [];
|
|
1546
|
+
LogsStorage._logsStorageId = "clietnLogs_j203fj2D0n-d1";
|
|
1547
|
+
|
|
1548
|
+
/**
|
|
1549
|
+
* Stringify given object by use of JSON.stringify but handles circular structures and "response", "request" properties
|
|
1550
|
+
* to avoid stringing redundant data when printing errors containing request/response objects.
|
|
1551
|
+
*
|
|
1552
|
+
* @param object - object to be stringed
|
|
1553
|
+
* @param indent - custom indentation
|
|
1554
|
+
* @return {string} - stringed object
|
|
1555
|
+
*/
|
|
1556
|
+
function safeStringify(object, indent) {
|
|
1557
|
+
if (indent === void 0) {
|
|
1558
|
+
indent = 2;
|
|
1559
|
+
}
|
|
1560
|
+
var cache = [];
|
|
1561
|
+
if (typeof object === "string" || typeof object === "function" || typeof object === "number" || typeof object === "undefined" || typeof object === "boolean") {
|
|
1562
|
+
return String(object);
|
|
1563
|
+
}
|
|
1564
|
+
var retVal = JSON.stringify(object, function (key, value) {
|
|
1565
|
+
if (key.toLowerCase().includes("request")) {
|
|
1566
|
+
return JSON.stringify({
|
|
1567
|
+
body: value == null ? void 0 : value.body,
|
|
1568
|
+
query: value == null ? void 0 : value.query,
|
|
1569
|
+
headers: value == null ? void 0 : value.headers
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
if (key.toLowerCase().includes("response")) {
|
|
1573
|
+
return JSON.stringify({
|
|
1574
|
+
statusText: value == null ? void 0 : value.statusText,
|
|
1575
|
+
status: value == null ? void 0 : value.status,
|
|
1576
|
+
data: value == null ? void 0 : value.data,
|
|
1577
|
+
headers: value == null ? void 0 : value.headers
|
|
1578
|
+
});
|
|
1579
|
+
}
|
|
1580
|
+
return typeof value === "object" && value !== null ? cache.includes(value) ? "duplicated reference" // Duplicated references were found, discarding this key
|
|
1581
|
+
: cache.push(value) && value // Store value in our collection
|
|
1582
|
+
: value;
|
|
1583
|
+
}, indent);
|
|
1584
|
+
cache = null;
|
|
1585
|
+
return retVal;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
var Logger = /*#__PURE__*/function () {
|
|
1589
|
+
function Logger() {}
|
|
1590
|
+
/**
|
|
1591
|
+
* Logs to client logs storage.
|
|
1592
|
+
*
|
|
1593
|
+
* WARNING! this method should ce used carefully for critical logging as we have the restriction for storing logs
|
|
1594
|
+
* on client side as we store them inside the local storage. Please see details inside storage.js
|
|
1595
|
+
* @param logString {string} log string
|
|
1596
|
+
* @param source {string} source of the log entry
|
|
1597
|
+
*/
|
|
1598
|
+
Logger.log = function log(logString, source) {
|
|
1599
|
+
var timestamp = new Date().toISOString();
|
|
1600
|
+
LogsStorage.saveLog(timestamp + "|" + source + ":" + logString);
|
|
1601
|
+
};
|
|
1602
|
+
Logger.logError = function logError(e, settingFunction, additionalMessage, onlyToConsole) {
|
|
1603
|
+
var _e$errorDescription, _e$howToFix;
|
|
1604
|
+
if (additionalMessage === void 0) {
|
|
1605
|
+
additionalMessage = "";
|
|
1606
|
+
}
|
|
1607
|
+
if (onlyToConsole === void 0) {
|
|
1608
|
+
onlyToConsole = false;
|
|
1609
|
+
}
|
|
1610
|
+
var message = "\nFunction call " + (settingFunction != null ? settingFunction : "") + " failed. Error message: " + (e == null ? void 0 : e.message) + ". " + additionalMessage + " ";
|
|
1611
|
+
message += "" + ((_e$errorDescription = e == null ? void 0 : e.errorDescription) != null ? _e$errorDescription : "") + ((_e$howToFix = e == null ? void 0 : e.howToFix) != null ? _e$howToFix : "") + ((e == null ? void 0 : e.httpStatus) === 403 ? "Authentication has expired or was lost. " : "");
|
|
1612
|
+
if (e != null && e.response) {
|
|
1613
|
+
try {
|
|
1614
|
+
var responseData = safeStringify({
|
|
1615
|
+
response: e.response
|
|
1616
|
+
});
|
|
1617
|
+
responseData && (message += "\n" + responseData + ". ");
|
|
1618
|
+
} catch (e) {}
|
|
1619
|
+
}
|
|
1620
|
+
var finalErrorText = message + ". " + safeStringify(e);
|
|
1621
|
+
// eslint-disable-next-line no-console
|
|
1622
|
+
console.error(finalErrorText, e);
|
|
1623
|
+
if (!onlyToConsole) {
|
|
1624
|
+
this.log(finalErrorText, "logError");
|
|
1625
|
+
}
|
|
1626
|
+
};
|
|
1627
|
+
return Logger;
|
|
1628
|
+
}();
|
|
1629
|
+
|
|
1630
|
+
function _catch$4(body, recover) {
|
|
1631
|
+
try {
|
|
1632
|
+
var result = body();
|
|
1633
|
+
} catch (e) {
|
|
1634
|
+
return recover(e);
|
|
1635
|
+
}
|
|
1636
|
+
if (result && result.then) {
|
|
1637
|
+
return result.then(void 0, recover);
|
|
1638
|
+
}
|
|
1639
|
+
return result;
|
|
1640
|
+
}
|
|
1641
|
+
function useCallHandlingErrors() {
|
|
1642
|
+
var _useState = React.useState(),
|
|
1643
|
+
setState = _useState[1];
|
|
1644
|
+
return React.useCallback(function (functionToBeCalled, event) {
|
|
1645
|
+
try {
|
|
1646
|
+
var _temp = _catch$4(function () {
|
|
1647
|
+
return Promise.resolve(functionToBeCalled(event)).then(function () {});
|
|
1648
|
+
}, function (error) {
|
|
1649
|
+
Logger.logError(error, (functionToBeCalled == null ? void 0 : functionToBeCalled.name) || "errorBoundaryTrigger", "Caught by ErrorBoundary");
|
|
1650
|
+
// Triggering ErrorBoundary
|
|
1651
|
+
setState(function () {
|
|
1652
|
+
throw error;
|
|
1653
|
+
});
|
|
1654
|
+
});
|
|
1655
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
1656
|
+
} catch (e) {
|
|
1657
|
+
return Promise.reject(e);
|
|
1658
|
+
}
|
|
1659
|
+
}, []);
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
/**
|
|
1663
|
+
* Adds reference to standard state variable. It is helpful to be able to use state variable value inside
|
|
1664
|
+
* event handlers and other callbacks without the need to call setState(prev => { value = prev; return prev; }).
|
|
1665
|
+
*
|
|
1666
|
+
* @param initialValue {any} to be passed to useState
|
|
1667
|
+
* @return {[React.Ref, function]} reference to state variable and its setter
|
|
1668
|
+
*/
|
|
1669
|
+
function useReferredState(initialValue) {
|
|
1670
|
+
var _React$useState = React__default["default"].useState(initialValue),
|
|
1671
|
+
state = _React$useState[0],
|
|
1672
|
+
setState = _React$useState[1];
|
|
1673
|
+
var reference = React__default["default"].useRef(state);
|
|
1674
|
+
var setReferredState = function setReferredState(value) {
|
|
1675
|
+
if (value && {}.toString.call(value) === "[object Function]") {
|
|
1676
|
+
value = value(reference.current);
|
|
1677
|
+
}
|
|
1678
|
+
reference.current = value;
|
|
1679
|
+
setState(value);
|
|
1680
|
+
};
|
|
1681
|
+
return [reference, setReferredState];
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
/**
|
|
1685
|
+
* This function improves the passed error object (its message) by adding the passed function name
|
|
1686
|
+
* and additional message to it.
|
|
1687
|
+
* This is useful as Javascript doesn't guarantee the stack-traces, so we should manually add these details to errors
|
|
1688
|
+
* to be able to troubleshoot.
|
|
1689
|
+
*
|
|
1690
|
+
* @param e {Error}
|
|
1691
|
+
* @param settingFunction {string}
|
|
1692
|
+
* @param [additionalMessage=""] {string|undefined}
|
|
1693
|
+
* @throws {Error} always rethrows the original passed error but with an improved message
|
|
1694
|
+
*/
|
|
1695
|
+
function improveAndRethrow(e, settingFunction, additionalMessage) {
|
|
1696
|
+
if (additionalMessage === void 0) {
|
|
1697
|
+
additionalMessage = "";
|
|
1698
|
+
}
|
|
1699
|
+
var message = improvedErrorMessage(e, settingFunction, additionalMessage);
|
|
1700
|
+
if (e) {
|
|
1701
|
+
e.message = message;
|
|
1702
|
+
throw e; // to preserve existing stacktrace if present
|
|
1703
|
+
}
|
|
1704
|
+
throw new Error(message);
|
|
1705
|
+
}
|
|
1706
|
+
function improvedErrorMessage(e, settingFunction, additionalMessage) {
|
|
1707
|
+
var message = "\nFunction call " + (settingFunction != null ? settingFunction : "") + " failed. ";
|
|
1708
|
+
e && e.message && (message += "Error message: " + e.message + ". ");
|
|
1709
|
+
additionalMessage && (message += additionalMessage + " ");
|
|
1710
|
+
return message;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
var FiatCurrenciesService = /*#__PURE__*/function () {
|
|
1714
|
+
function FiatCurrenciesService() {}
|
|
1715
|
+
FiatCurrenciesService.getFullCurrencyNameByCode = function getFullCurrencyNameByCode(code) {
|
|
1716
|
+
if (code === void 0) {
|
|
1717
|
+
code = "";
|
|
1718
|
+
}
|
|
1719
|
+
var data = fiatCurrenciesList.find(function (currencyData) {
|
|
1720
|
+
return currencyData[0] === code.toUpperCase();
|
|
1721
|
+
});
|
|
1722
|
+
return data && data[2] || null;
|
|
1723
|
+
};
|
|
1724
|
+
FiatCurrenciesService.isCodeValid = function isCodeValid(code) {
|
|
1725
|
+
return !!fiatCurrenciesList.find(function (currenciesData) {
|
|
1726
|
+
return currenciesData[0] === code;
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
/**
|
|
1731
|
+
* Returns currency symbol by code if present
|
|
1732
|
+
*
|
|
1733
|
+
* @param code {string} currency code
|
|
1734
|
+
* @return {string|null} code or null if there is no symbol for the currency
|
|
1735
|
+
*/;
|
|
1736
|
+
FiatCurrenciesService.getCurrencySymbolByCode = function getCurrencySymbolByCode(code) {
|
|
1737
|
+
var _data$;
|
|
1738
|
+
if (code === void 0) {
|
|
1739
|
+
code = "";
|
|
1740
|
+
}
|
|
1741
|
+
var data = fiatCurrenciesList.find(function (currencyData) {
|
|
1742
|
+
return currencyData[0] === code.toUpperCase();
|
|
1743
|
+
});
|
|
1744
|
+
return (_data$ = data == null ? void 0 : data[1]) != null ? _data$ : null;
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
/**
|
|
1748
|
+
* @param code {string}
|
|
1749
|
+
* @return {number|null}
|
|
1750
|
+
*/;
|
|
1751
|
+
FiatCurrenciesService.getCurrencyDecimalCountByCode = function getCurrencyDecimalCountByCode(code) {
|
|
1752
|
+
var _data$2;
|
|
1753
|
+
if (code === void 0) {
|
|
1754
|
+
code = "";
|
|
1755
|
+
}
|
|
1756
|
+
var data = fiatCurrenciesList.find(function (currencyData) {
|
|
1757
|
+
return currencyData[0] === code.toUpperCase();
|
|
1758
|
+
});
|
|
1759
|
+
return (_data$2 = data == null ? void 0 : data[3]) != null ? _data$2 : null;
|
|
1760
|
+
};
|
|
1761
|
+
return FiatCurrenciesService;
|
|
1762
|
+
}();
|
|
1763
|
+
var fiatCurrenciesList = [["USD", "$", "US Dollar", 2], ["CAD", "CA$", "Canadian Dollar", 2], ["EUR", "€", "Euro", 2], ["AED", "AED", "UAE Dirham", 2], ["AFN", "؋", "Afghan Afghani", 0], ["ALL", "ALL", "Albanian Lek", 0], ["AMD", "֏", "Armenian Dram", 0], ["ARS", "AR$", "Argentine Peso", 2], ["AUD", "AU$", "Australian Dollar", 2], ["AZN", "₼", "Azerbaijani Manat", 2], ["BAM", "KM", "Bosnia-Herzegovina Convertible Mark", 2], ["BDT", "Tk", "Bangladeshi Taka", 2], ["BGN", "BGN", "Bulgarian Lev", 2], ["BHD", "BD", "Bahraini Dinar", 3], ["BIF", "FBu", "Burundian Franc", 0], ["BND", "BN$", "Brunei Dollar", 2], ["BOB", "Bs", "Bolivian Boliviano", 2], ["BRL", "R$", "Brazilian Real", 2], ["BWP", "BWP", "Botswanan Pula", 2], ["BYN", "Br", "Belarusian Ruble", 2], ["BZD", "BZ$", "Belize Dollar", 2], ["CDF", "CDF", "Congolese Franc", 2], ["CHF", "CHF", "Swiss Franc", 2], ["CLP", "CL$", "Chilean Peso", 0], ["CNY", "CN¥", "Chinese Yuan", 2], ["COP", "CO$", "Colombian Peso", 0], ["CRC", "₡", "Costa Rican Colón", 0], ["CVE", "CV$", "Cape Verdean Escudo", 2], ["CZK", "Kč", "Czech Republic Koruna", 2], ["DJF", "Fdj", "Djiboutian Franc", 0], ["DKK", "Dkr", "Danish Krone", 2], ["DOP", "RD$", "Dominican Peso", 2], ["DZD", "DA", "Algerian Dinar", 2], ["EEK", "Ekr", "Estonian Kroon", 2], ["EGP", "EGP", "Egyptian Pound", 2], ["ERN", "Nfk", "Eritrean Nakfa", 2], ["ETB", "Br", "Ethiopian Birr", 2], ["GBP", "£", "British Pound Sterling", 2], ["GEL", "₾", "Georgian Lari", 2], ["GHS", "₵", "Ghanaian Cedi", 2], ["GNF", "FG", "Guinean Franc", 0], ["GTQ", "GTQ", "Guatemalan Quetzal", 2], ["HKD", "HK$", "Hong Kong Dollar", 2], ["HNL", "HNL", "Honduran Lempira", 2], ["HRK", "kn", "Croatian Kuna", 2], ["HUF", "Ft", "Hungarian Forint", 0], ["IDR", "Rp", "Indonesian Rupiah", 0], ["ILS", "₪", "Israeli New Sheqel", 2], ["INR", "₹", "Indian Rupee", 2], ["IQD", "IQD", "Iraqi Dinar", 0], ["IRR", "﷼", "Iranian Rial", 0], ["ISK", "Ikr", "Icelandic Króna", 0], ["JMD", "J$", "Jamaican Dollar", 2], ["JOD", "JD", "Jordanian Dinar", 3], ["JPY", "¥", "Japanese Yen", 0], ["KES", "Ksh", "Kenyan Shilling", 2], ["KHR", "KHR", "Cambodian Riel", 2], ["KMF", "CF", "Comorian Franc", 0], ["KRW", "₩", "South Korean Won", 0], ["KWD", "KD", "Kuwaiti Dinar", 3], ["KZT", "₸", "Kazakhstani Tenge", 2], ["LBP", "LB£", "Lebanese Pound", 0], ["LKR", "SLRs", "Sri Lankan Rupee", 2], ["LTL", "Lt", "Lithuanian Litas", 2], ["LVL", "Ls", "Latvian Lats", 2], ["LYD", "LD", "Libyan Dinar", 3], ["MAD", "MAD", "Moroccan Dirham", 2], ["MDL", "MDL", "Moldovan Leu", 2], ["MGA", "MGA", "Malagasy Ariary", 0], ["MKD", "MKD", "Macedonian Denar", 2], ["MMK", "MMK", "Myanma Kyat", 0], ["MNT", "₮", "Mongolian Tugrik", 0], ["MOP", "MOP$", "Macanese Pataca", 2], ["MUR", "MURs", "Mauritian Rupee", 0], ["MXN", "MX$", "Mexican Peso", 2], ["MYR", "RM", "Malaysian Ringgit", 2], ["MZN", "MTn", "Mozambican Metical", 2], ["NAD", "N$", "Namibian Dollar", 2], ["NGN", "₦", "Nigerian Naira", 2], ["NIO", "C$", "Nicaraguan Córdoba", 2], ["NOK", "Nkr", "Norwegian Krone", 2], ["NPR", "NPRs", "Nepalese Rupee", 2], ["NZD", "NZ$", "New Zealand Dollar", 2], ["OMR", "OMR", "Omani Rial", 3], ["PAB", "B/.", "Panamanian Balboa", 2], ["PEN", "S/.", "Peruvian Nuevo Sol", 2], ["PHP", "₱", "Philippine Peso", 2], ["PKR", "PKRs", "Pakistani Rupee", 0], ["PLN", "zł", "Polish Zloty", 2], ["PYG", "₲", "Paraguayan Guarani", 0], ["QAR", "QR", "Qatari Rial", 2], ["RON", "RON", "Romanian Leu", 2], ["RSD", "din.", "Serbian Dinar", 0], ["RUB", "₽", "Russian Ruble", 2], ["RWF", "RWF", "Rwandan Franc", 0], ["SAR", "SR", "Saudi Riyal", 2], ["SDG", "SDG", "Sudanese Pound", 2], ["SEK", "Skr", "Swedish Krona", 2], ["SGD", "S$", "Singapore Dollar", 2], ["SOS", "Ssh", "Somali Shilling", 0], ["SYP", "SY£", "Syrian Pound", 0], ["THB", "฿", "Thai Baht", 2], ["TND", "DT", "Tunisian Dinar", 3], ["TOP", "T$", "Tongan Paʻanga", 2], ["TRY", "₺", "Turkish Lira", 2], ["TTD", "TT$", "Trinidad and Tobago Dollar", 2], ["TWD", "NT$", "New Taiwan Dollar", 2], ["TZS", "TSh", "Tanzanian Shilling", 0], ["UAH", "₴", "Ukrainian Hryvnia", 2], ["UGX", "USh", "Ugandan Shilling", 0], ["UYU", "$U", "Uruguayan Peso", 2], ["UZS", "UZS", "Uzbekistan Som", 0], ["VEF", "Bs.F.", "Venezuelan Bolívar", 2], ["VND", "₫", "Vietnamese Dong", 0], ["XAF", "FCFA", "CFA Franc BEAC", 0], ["XOF", "CFA", "CFA Franc BCEAO", 0], ["YER", "﷼", "Yemeni Rial", 0], ["ZAR", "R", "South African Rand", 2], ["ZMK", "ZK", "Zambian Kwacha", 0], ["ZWL", "ZWL$", "Zimbabwean Dollar", 0]];
|
|
1764
|
+
|
|
1765
|
+
function _extends() {
|
|
1766
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
1767
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
1768
|
+
var source = arguments[i];
|
|
1769
|
+
for (var key in source) {
|
|
1770
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
1771
|
+
target[key] = source[key];
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
return target;
|
|
1776
|
+
};
|
|
1777
|
+
return _extends.apply(this, arguments);
|
|
1778
|
+
}
|
|
1779
|
+
function _inheritsLoose(subClass, superClass) {
|
|
1780
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
1781
|
+
subClass.prototype.constructor = subClass;
|
|
1782
|
+
_setPrototypeOf(subClass, superClass);
|
|
1783
|
+
}
|
|
1784
|
+
function _setPrototypeOf(o, p) {
|
|
1785
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
1786
|
+
o.__proto__ = p;
|
|
1787
|
+
return o;
|
|
1788
|
+
};
|
|
1789
|
+
return _setPrototypeOf(o, p);
|
|
1790
|
+
}
|
|
1791
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
1792
|
+
if (!o) return;
|
|
1793
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
1794
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1795
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1796
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
1797
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
1798
|
+
}
|
|
1799
|
+
function _arrayLikeToArray(arr, len) {
|
|
1800
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
1801
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
1802
|
+
return arr2;
|
|
1803
|
+
}
|
|
1804
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
1805
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
1806
|
+
if (it) return (it = it.call(o)).next.bind(it);
|
|
1807
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
1808
|
+
if (it) o = it;
|
|
1809
|
+
var i = 0;
|
|
1810
|
+
return function () {
|
|
1811
|
+
if (i >= o.length) return {
|
|
1812
|
+
done: true
|
|
1813
|
+
};
|
|
1814
|
+
return {
|
|
1815
|
+
done: false,
|
|
1816
|
+
value: o[i++]
|
|
1817
|
+
};
|
|
1818
|
+
};
|
|
1819
|
+
}
|
|
1820
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
// TODO: [dev] return addCommasToAmountString internal method to encapsulate commas adding
|
|
1824
|
+
|
|
1825
|
+
var AmountUtils = /*#__PURE__*/function () {
|
|
1826
|
+
function AmountUtils() {}
|
|
1827
|
+
AmountUtils.fiatXs = function fiatXs(amount, code) {
|
|
1828
|
+
return this.fiat(amount, code, {
|
|
1829
|
+
extraSmallLength: true
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
/**
|
|
1834
|
+
* Universal method for rendering of fiat amounts, taking into account the rules of
|
|
1835
|
+
* the passed fiat currency code.
|
|
1836
|
+
*
|
|
1837
|
+
* TODO: [feature, high] remove 'number' from accepted types list task_id=1e692bcfabbe487a9d1638fc8ff17448
|
|
1838
|
+
* @param amount {BigNumber|number|string|null|undefined} The number value to be trimmed
|
|
1839
|
+
* @param currencyCode {string|null} The currency code. Can be omitted if { ticker: false } in the config
|
|
1840
|
+
* @param [passedParams={}] {object} Formatting parameters
|
|
1841
|
+
* @return {string} Formatted fiat amount string
|
|
1842
|
+
*/;
|
|
1843
|
+
AmountUtils.fiat = function fiat(amount, currencyCode, passedParams) {
|
|
1844
|
+
if (passedParams === void 0) {
|
|
1845
|
+
passedParams = {};
|
|
1846
|
+
}
|
|
1847
|
+
try {
|
|
1848
|
+
var params = _extends({}, this.defaultFiatParams, passedParams);
|
|
1849
|
+
if (this._checkIfAmountInvalid(amount, true) || typeof currencyCode !== "string") return "NULL";
|
|
1850
|
+
var currencySymbol = FiatCurrenciesService.getCurrencySymbolByCode(currencyCode);
|
|
1851
|
+
var currencyDecimalCount = FiatCurrenciesService.getCurrencyDecimalCountByCode(currencyCode);
|
|
1852
|
+
var trimmedByMaxDigits = bignumber_js.BigNumber(amount).toFixed(currencyDecimalCount, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
1853
|
+
var processedAmount = bignumber_js.BigNumber(trimmedByMaxDigits);
|
|
1854
|
+
if (params.collapsible && processedAmount.gte(bignumber_js.BigNumber("1000000"))) {
|
|
1855
|
+
processedAmount = this._collapseToMillionsAndFormat(processedAmount, this.collapsedDecimalCount, params);
|
|
1856
|
+
} else {
|
|
1857
|
+
var limitResult = this._limitTotalAmountLengthIfNeeded(trimmedByMaxDigits, params);
|
|
1858
|
+
processedAmount = bignumber_js.BigNumber(limitResult.processedAmount).toFormat(); // Adds commas to integer part
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
// Add the currency code or currency symbol, if symbol is enabled and available
|
|
1862
|
+
if (params.ticker) {
|
|
1863
|
+
if (typeof currencySymbol === "string" && params.enableCurrencySymbols) {
|
|
1864
|
+
processedAmount = currencySymbol + (currencySymbol.length > 1 ? " " : "") + processedAmount;
|
|
1865
|
+
} else {
|
|
1866
|
+
processedAmount = processedAmount + " " + currencyCode;
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
return processedAmount;
|
|
1870
|
+
} catch (e) {
|
|
1871
|
+
improveAndRethrow(e, "fiat", "Passed: " + amount);
|
|
1872
|
+
}
|
|
1873
|
+
};
|
|
1874
|
+
AmountUtils.cryptoWoTicker = function cryptoWoTicker(amount, digits) {
|
|
1875
|
+
return this.crypto(amount, null, digits, {
|
|
1876
|
+
ticker: false
|
|
1877
|
+
});
|
|
1878
|
+
};
|
|
1879
|
+
AmountUtils.cryptoWoTickerXs = function cryptoWoTickerXs(amount, digits) {
|
|
1880
|
+
return this.crypto(amount, null, digits, {
|
|
1881
|
+
ticker: false,
|
|
1882
|
+
extraSmallLength: true
|
|
1883
|
+
});
|
|
1884
|
+
};
|
|
1885
|
+
AmountUtils.cryptoXs = function cryptoXs(amount, ticker, digits) {
|
|
1886
|
+
return this.crypto(amount, ticker, digits, {
|
|
1887
|
+
extraSmallLength: true,
|
|
1888
|
+
periods: false
|
|
1889
|
+
});
|
|
1890
|
+
};
|
|
1891
|
+
AmountUtils.cryptoFull = function cryptoFull(amount, ticker, digits) {
|
|
1892
|
+
return this.crypto(amount, ticker, digits, {
|
|
1893
|
+
collapsible: false,
|
|
1894
|
+
trim: false,
|
|
1895
|
+
limitTotalLength: false
|
|
1896
|
+
});
|
|
1897
|
+
};
|
|
1898
|
+
AmountUtils.cryptoFullPureNumber = function cryptoFullPureNumber(amount, digits) {
|
|
1899
|
+
return this.crypto(amount, null, digits, {
|
|
1900
|
+
ticker: false,
|
|
1901
|
+
collapsible: false,
|
|
1902
|
+
trim: false,
|
|
1903
|
+
limitTotalLength: false,
|
|
1904
|
+
numberPartsSeparator: false
|
|
1905
|
+
});
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
/**
|
|
1909
|
+
* Universal method for rendering of crypto amounts, taking into account the rules of
|
|
1910
|
+
* the passed ticker. Requires the number of digits after period to be less of equal to
|
|
1911
|
+
* the number of digits, supported by the passed ticker.
|
|
1912
|
+
*
|
|
1913
|
+
* @param amount {BigNumber|string|null|undefined} The number value to be formatted
|
|
1914
|
+
* @param ticker {string|null} Coin ticker
|
|
1915
|
+
* @param [digits=8] {number} max digits after the dot
|
|
1916
|
+
* @param passedParams {object} Formatting parameters
|
|
1917
|
+
* @return {string} Formatted crypto amount string
|
|
1918
|
+
*/;
|
|
1919
|
+
AmountUtils.crypto = function crypto(amount, ticker, digits, passedParams) {
|
|
1920
|
+
if (digits === void 0) {
|
|
1921
|
+
digits = this.significantDecimalCount;
|
|
1922
|
+
}
|
|
1923
|
+
try {
|
|
1924
|
+
var params = _extends({}, this.defaultCryptoParams, passedParams);
|
|
1925
|
+
if (this._checkIfAmountInvalid(amount) || typeof ticker !== "string" && params.ticker) return "NULL";
|
|
1926
|
+
var addPeriods = false;
|
|
1927
|
+
var amountBigNumber = bignumber_js.BigNumber(amount);
|
|
1928
|
+
var processedAmount = amountBigNumber.toFixed(digits, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
1929
|
+
processedAmount = this.removeRedundantRightZerosFromNumberString(processedAmount);
|
|
1930
|
+
var originalAmountDecimalPlaces = bignumber_js.BigNumber(processedAmount).decimalPlaces();
|
|
1931
|
+
// Check decimal count and throw an error, if the amount has more decimal digits than supported by the asset
|
|
1932
|
+
if (originalAmountDecimalPlaces > digits) {
|
|
1933
|
+
var errorMessage = "An attempt to render a crypto value with too many digits after period was made: " + amount + ", allowed digits: " + digits + ". This is a no-op, since the logical and visually rendered values would differ, which is not acceptable for crypto amounts. Please trim the amount before rendering, using the trimCryptoAmountByCoin(amount, coin) method.";
|
|
1934
|
+
// throw new Error(errorMessage);
|
|
1935
|
+
// eslint-disable-next-line no-console
|
|
1936
|
+
console.log(errorMessage, "crypto");
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
// Shortening the value to general significant number of digits after period
|
|
1940
|
+
if (params.trim) {
|
|
1941
|
+
processedAmount = this.removeRedundantRightZerosFromNumberString(amountBigNumber.toFixed(this.significantDecimalCount, bignumber_js.BigNumber.ROUND_FLOOR));
|
|
1942
|
+
addPeriods = originalAmountDecimalPlaces > this.significantDecimalCount;
|
|
1943
|
+
}
|
|
1944
|
+
var limitResult = this._limitTotalAmountLengthIfNeeded(processedAmount, params);
|
|
1945
|
+
processedAmount = limitResult.processedAmount;
|
|
1946
|
+
addPeriods || (addPeriods = limitResult.addPeriods);
|
|
1947
|
+
var wereMillionsCollapsed = false;
|
|
1948
|
+
if (params.collapsible && amountBigNumber.gte("1000000")) {
|
|
1949
|
+
// Collapse the 1M+ amounts if applicable
|
|
1950
|
+
processedAmount = this._collapseToMillionsAndFormat(bignumber_js.BigNumber(processedAmount), this.collapsedDecimalCount, params);
|
|
1951
|
+
wereMillionsCollapsed = true;
|
|
1952
|
+
} else if (params.numberPartsSeparator) {
|
|
1953
|
+
// Add separators to integer part of the amount
|
|
1954
|
+
processedAmount = bignumber_js.BigNumber(processedAmount).toFormat();
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
// Adding periods, if the amount was shortened
|
|
1958
|
+
if (params.periods && addPeriods && !wereMillionsCollapsed) {
|
|
1959
|
+
processedAmount = processedAmount + this.periods;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
// Adding an adaptive (printable/full) ticker
|
|
1963
|
+
if (params.ticker && ticker) {
|
|
1964
|
+
processedAmount = processedAmount + " " + ticker;
|
|
1965
|
+
}
|
|
1966
|
+
return processedAmount;
|
|
1967
|
+
} catch (e) {
|
|
1968
|
+
improveAndRethrow(e, "crypto", "Passed: " + amount + ", " + ticker + ", " + digits);
|
|
1969
|
+
}
|
|
1970
|
+
};
|
|
1971
|
+
AmountUtils._checkIfAmountInvalid = function _checkIfAmountInvalid(amount, allowNumbers) {
|
|
1972
|
+
if (allowNumbers === void 0) {
|
|
1973
|
+
allowNumbers = false;
|
|
1974
|
+
}
|
|
1975
|
+
return amount == null || amount === "" || !bignumber_js.BigNumber.isBigNumber(amount) && typeof amount !== "string" && (!allowNumbers || typeof amount !== "number");
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
/**
|
|
1979
|
+
* Trims all digits after period that exceed the number of digits provided.
|
|
1980
|
+
* Use this everywhere when calculating some amount value to ensure the result is correct in terms
|
|
1981
|
+
* of max digits allowed by specific currency.
|
|
1982
|
+
*
|
|
1983
|
+
* @param amount {BigNumber|number|string|null|undefined} The number value to be trimmed.
|
|
1984
|
+
* HEX strings also allowed "0x..." and JS hex numbers
|
|
1985
|
+
* @param digits {number} allowed digits
|
|
1986
|
+
* @return {string|null} String with trimmed number or null for invalid amount
|
|
1987
|
+
*/;
|
|
1988
|
+
AmountUtils.trim = function trim(amount, digits) {
|
|
1989
|
+
try {
|
|
1990
|
+
if (this._checkIfAmountInvalid(amount, true)) return null;
|
|
1991
|
+
return bignumber_js.BigNumber(amount).toFixed(digits, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
1992
|
+
} catch (e) {
|
|
1993
|
+
improveAndRethrow(e, "trim", "Passed: " + amount + ", " + digits);
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
/**
|
|
1998
|
+
* @param amount {BigNumber|number|string|null|undefined} The number value to be trimmed.
|
|
1999
|
+
* HEX strings also allowed "0x..." and JS hex numbers
|
|
2000
|
+
* @return {string|null}
|
|
2001
|
+
*/;
|
|
2002
|
+
AmountUtils.intStr = function intStr(amount) {
|
|
2003
|
+
return this.trim(amount, 0);
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
/**
|
|
2007
|
+
* Shortens the line length by using a "1.52M" representation of big amounts.
|
|
2008
|
+
*
|
|
2009
|
+
* @param amountBigNumber {BigNumber} The number value to be trimmed
|
|
2010
|
+
* @param decimalCount {number} The number of digits after period to keep in millions representation
|
|
2011
|
+
* @param params {object} params object
|
|
2012
|
+
* @return {string} A shortened string, converted into "millions" format, if the amount exceeds 1 million
|
|
2013
|
+
*/;
|
|
2014
|
+
AmountUtils._collapseToMillionsAndFormat = function _collapseToMillionsAndFormat(amountBigNumber, decimalCount, params) {
|
|
2015
|
+
if (params === void 0) {
|
|
2016
|
+
params = {};
|
|
2017
|
+
}
|
|
2018
|
+
try {
|
|
2019
|
+
// TODO: [feature, moderate] use local format here - take from JS locales (comma/dot etc.)
|
|
2020
|
+
var millionBigNumber = bignumber_js.BigNumber("1000000");
|
|
2021
|
+
var millions = amountBigNumber.div(millionBigNumber).toFixed(decimalCount, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
2022
|
+
var limitedResult = this._limitTotalAmountLengthIfNeeded(millions, params);
|
|
2023
|
+
var formatted = bignumber_js.BigNumber(limitedResult.processedAmount).toFormat();
|
|
2024
|
+
return formatted + "M";
|
|
2025
|
+
} catch (e) {
|
|
2026
|
+
improveAndRethrow(e, "_collapseAmountAndFormat", "Passed: " + amountBigNumber.toFixed() + ", " + decimalCount);
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
/**
|
|
2031
|
+
* @param amountString {string} The amount to be restricted by length
|
|
2032
|
+
* @param params {object} Params object used for formatting
|
|
2033
|
+
* @return {{processedAmount:string, addPeriods: boolean}} A shortened string
|
|
2034
|
+
*/;
|
|
2035
|
+
AmountUtils._limitTotalAmountLengthIfNeeded = function _limitTotalAmountLengthIfNeeded(amountString, params) {
|
|
2036
|
+
try {
|
|
2037
|
+
var addPeriods = false;
|
|
2038
|
+
if (params.limitTotalLength || params.extraSmallLength) {
|
|
2039
|
+
var maxLength = params.extraSmallLength ? this.extraSmallMaxTotalLength : this.maxTotalLength;
|
|
2040
|
+
if (amountString.length > maxLength) {
|
|
2041
|
+
var delta = amountString.length - maxLength;
|
|
2042
|
+
var currentDecimalsCount = bignumber_js.BigNumber(amountString).decimalPlaces();
|
|
2043
|
+
var newDecimalCount = currentDecimalsCount - delta;
|
|
2044
|
+
amountString = bignumber_js.BigNumber(amountString).toFixed(newDecimalCount > 2 ? newDecimalCount : 2, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
2045
|
+
addPeriods = currentDecimalsCount > newDecimalCount;
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
return {
|
|
2049
|
+
addPeriods: addPeriods,
|
|
2050
|
+
processedAmount: amountString
|
|
2051
|
+
};
|
|
2052
|
+
} catch (e) {
|
|
2053
|
+
improveAndRethrow(e, "_limitTotalAmountLengthIfNeeded", "Passed: " + amountString + ", " + params);
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
/**
|
|
2058
|
+
* Safely composes rate string (handles small/big rates)
|
|
2059
|
+
*
|
|
2060
|
+
* @param leftTicker {string}
|
|
2061
|
+
* @param rightTicker {string}
|
|
2062
|
+
* @param rate {number|string|BigNumber}
|
|
2063
|
+
* @param [rightCurrencyDigitsAfterDots=8] {number}
|
|
2064
|
+
* @return {string}
|
|
2065
|
+
*/;
|
|
2066
|
+
AmountUtils.composeRateText = function composeRateText(leftTicker, rightTicker, rate, rightCurrencyDigitsAfterDots) {
|
|
2067
|
+
if (rightCurrencyDigitsAfterDots === void 0) {
|
|
2068
|
+
rightCurrencyDigitsAfterDots = this.significantDecimalCount;
|
|
2069
|
+
}
|
|
2070
|
+
try {
|
|
2071
|
+
/* Here we try to calculate a clear rate for the user. The difficulty is that the rate value can be pretty
|
|
2072
|
+
* small as some coins have significantly higher price than the other. For such cases we calculate
|
|
2073
|
+
* not the "1 <coin_A> is X <coin B>" but "Y <coin_A> is X <coin B>" where Y is one of the powers of 100.
|
|
2074
|
+
*/
|
|
2075
|
+
var leftNumber = bignumber_js.BigNumber("1");
|
|
2076
|
+
var multiplier = bignumber_js.BigNumber("100");
|
|
2077
|
+
var maxAttemptsToGetRate = 10;
|
|
2078
|
+
var right = null;
|
|
2079
|
+
var rateBigNumber = bignumber_js.BigNumber(rate);
|
|
2080
|
+
for (var i = 0; i < maxAttemptsToGetRate; ++i) {
|
|
2081
|
+
var rightNumberAttempt = rateBigNumber.times(leftNumber).toFixed(rightCurrencyDigitsAfterDots, bignumber_js.BigNumber.ROUND_FLOOR);
|
|
2082
|
+
if (!bignumber_js.BigNumber(rightNumberAttempt).eq(bignumber_js.BigNumber("0"))) {
|
|
2083
|
+
right = bignumber_js.BigNumber(rightNumberAttempt);
|
|
2084
|
+
break;
|
|
2085
|
+
} else {
|
|
2086
|
+
leftNumber = leftNumber.times(multiplier);
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
var leftAmountString = AmountUtils.intStr(leftNumber);
|
|
2090
|
+
var rightAmountString = right != null ? right.toFixed(rightCurrencyDigitsAfterDots, bignumber_js.BigNumber.ROUND_FLOOR) : null;
|
|
2091
|
+
return leftAmountString + " " + leftTicker + " ~ " + (rightAmountString != null ? rightAmountString : "?") + " " + rightTicker;
|
|
2092
|
+
} catch (e) {
|
|
2093
|
+
// eslint-disable-next-line no-console
|
|
2094
|
+
console.log("composeRateText", e);
|
|
2095
|
+
}
|
|
2096
|
+
return "-";
|
|
2097
|
+
}
|
|
2098
|
+
|
|
2099
|
+
/**
|
|
2100
|
+
* @param numberAsAString {string}
|
|
2101
|
+
* @return {string}
|
|
2102
|
+
*/;
|
|
2103
|
+
AmountUtils.removeRedundantRightZerosFromNumberString = function removeRedundantRightZerosFromNumberString(numberAsAString) {
|
|
2104
|
+
try {
|
|
2105
|
+
var _right2;
|
|
2106
|
+
var parts = ("" + numberAsAString).split(".");
|
|
2107
|
+
var right = parts[1];
|
|
2108
|
+
while ((_right = right) != null && _right.length && right[right.length - 1] === "0") {
|
|
2109
|
+
var _right;
|
|
2110
|
+
right = right.slice(0, right.length - 1);
|
|
2111
|
+
}
|
|
2112
|
+
return "" + parts[0] + ((_right2 = right) != null && _right2.length ? "." + right : "");
|
|
2113
|
+
} catch (e) {
|
|
2114
|
+
improveAndRethrow(e, "removeRedundantRightZerosFromNumberString", "Passed: " + numberAsAString);
|
|
2115
|
+
}
|
|
2116
|
+
};
|
|
2117
|
+
return AmountUtils;
|
|
2118
|
+
}();
|
|
2119
|
+
AmountUtils.significantDecimalCount = 8;
|
|
2120
|
+
AmountUtils.collapsedDecimalCount = 2;
|
|
2121
|
+
AmountUtils.maxTotalLength = 12;
|
|
2122
|
+
AmountUtils.extraSmallMaxTotalLength = 9;
|
|
2123
|
+
// >=10 breaks transactions list (mobile) and it is hard to avoid this
|
|
2124
|
+
AmountUtils.periods = "..";
|
|
2125
|
+
AmountUtils.defaultFiatParams = {
|
|
2126
|
+
ticker: true,
|
|
2127
|
+
// If true, currency code will be shown
|
|
2128
|
+
enableCurrencySymbols: true,
|
|
2129
|
+
// Enables currency symbols where available. Requires "ticker: true"
|
|
2130
|
+
collapsible: true,
|
|
2131
|
+
// Enables minimization of amounts over 1 million (example: 1.52M)
|
|
2132
|
+
limitTotalLength: true,
|
|
2133
|
+
// Limits the total amount length to maxTotalLength
|
|
2134
|
+
extraSmallLength: false // Limits the total amount length to extraSmallMaxTotalLength
|
|
2135
|
+
};
|
|
2136
|
+
AmountUtils.defaultCryptoParams = {
|
|
2137
|
+
ticker: true,
|
|
2138
|
+
// If true, asset ticker will be shown
|
|
2139
|
+
collapsible: true,
|
|
2140
|
+
// Enables minimization of amounts over 1 million (example: 1.52M)
|
|
2141
|
+
trim: true,
|
|
2142
|
+
// Cuts the right part of the amount if necessary, and adds ".." in the end
|
|
2143
|
+
limitTotalLength: true,
|
|
2144
|
+
// Limits the total amount length to maxTotalLength
|
|
2145
|
+
extraSmallLength: false,
|
|
2146
|
+
// Limits the total amount length to extraSmallMaxTotalLength
|
|
2147
|
+
periods: true,
|
|
2148
|
+
// Whether we add periods ("..") as suffix for trimmed numbers
|
|
2149
|
+
numberPartsSeparator: true // Whether we add separators e.g. for 1000000 -> 1,000,000
|
|
2150
|
+
};
|
|
2151
|
+
|
|
2152
|
+
var Blockchain =
|
|
2153
|
+
/**
|
|
2154
|
+
* @param name {string} latin printable name of blockchain
|
|
2155
|
+
* @param supportedProtocols {Protocol[]}
|
|
2156
|
+
*/
|
|
2157
|
+
function Blockchain(name, supportedProtocols) {
|
|
2158
|
+
if (supportedProtocols === void 0) {
|
|
2159
|
+
supportedProtocols = [];
|
|
2160
|
+
}
|
|
2161
|
+
this.name = name;
|
|
2162
|
+
this.supportedProtocols = supportedProtocols;
|
|
2163
|
+
};
|
|
2164
|
+
|
|
2165
|
+
var Protocol = function Protocol(protocolName) {
|
|
2166
|
+
this.protocol = protocolName;
|
|
2167
|
+
};
|
|
2168
|
+
|
|
2169
|
+
/**
|
|
2170
|
+
* The model for cryptocurrency coins.
|
|
2171
|
+
*
|
|
2172
|
+
* WARNING: this class should not be instantiated directly. Use only predefined singleton Coin (or descendants) instances.
|
|
2173
|
+
*/
|
|
2174
|
+
var Coin = /*#__PURE__*/function () {
|
|
2175
|
+
/**
|
|
2176
|
+
* Creates new coin
|
|
2177
|
+
*
|
|
2178
|
+
* @param latinName {string} the coin name in latin symbols like "Bitcoin"
|
|
2179
|
+
* @param ticker {string} the coin symbol/ticker/code like 'BTC'. Always upper case. A unique coin identifier
|
|
2180
|
+
* @param tickerPrintable {string} ticker but in printable format. Useful for tokens based on external blockchains
|
|
2181
|
+
* like ERC20 or TRC20. It is not friendly to display USDTERC20 or BUSDTRC20 - more neat options are just
|
|
2182
|
+
* USDT and BUSD. Note that you should always care about user's understanding of what coin he/she is working
|
|
2183
|
+
* with as printable ticker for USDTERC20 and USDTTRC20 are the same.
|
|
2184
|
+
* @param digitsCountAfterComma {number} count of digits after the comma. E.g. 8 for bitcoin
|
|
2185
|
+
* @param maxValue {number|null} max possible value for cryptocurrency. Null means that the currency has no max possible value
|
|
2186
|
+
* @param atomName {string} name of the coin's atomic value. Like 'satoshi' for bitcoin
|
|
2187
|
+
* @param mainnet {Network} main network for this coin
|
|
2188
|
+
* @param testnet {Network} test network for this coin
|
|
2189
|
+
* @param minConfirmations {number} min confirmations count to treat the coin's transaction confirmed
|
|
2190
|
+
* @param payableEntityStringForFeeRate {string|null} the payable fee entity like byte for bitcoin or gas for ether if present
|
|
2191
|
+
* @param feeOptionsTimeStringsSortedDesc {string[]} array of 4 strings for fee options when sending coins. Should be sorted from the highest time to the smallest
|
|
2192
|
+
* @param feeRatesExpirationTimeMs {number} number of milliseconds to treat the fee rates as expired
|
|
2193
|
+
* @param blockchain {Blockchain} blockchain object
|
|
2194
|
+
* @param [protocol] {Protocol|null} token/coin protocol if relevant
|
|
2195
|
+
* @param [tokenAddress] {string|null} address of contract of this token (if the coin is token)
|
|
2196
|
+
* @param [doesUseLowerCaseAddresses] {boolean} flag to clarify whether we can use lower case addresses to ensure more robust comparisons
|
|
2197
|
+
* @param [doesUseOutputs=false] {boolean} true if this coin uses inputs/outputs concept and false if it uses just balances
|
|
2198
|
+
*/
|
|
2199
|
+
function Coin(latinName, ticker, tickerPrintable, digitsCountAfterComma, maxValue, atomName, mainnet, testnet, minConfirmations, payableEntityStringForFeeRate, feeOptionsTimeStringsSortedDesc, feeRatesExpirationTimeMs, blockchain, protocol, tokenAddress, doesUseLowerCaseAddresses, doesUseOutputs) {
|
|
2200
|
+
if (protocol === void 0) {
|
|
2201
|
+
protocol = null;
|
|
2202
|
+
}
|
|
2203
|
+
if (tokenAddress === void 0) {
|
|
2204
|
+
tokenAddress = null;
|
|
2205
|
+
}
|
|
2206
|
+
if (doesUseLowerCaseAddresses === void 0) {
|
|
2207
|
+
doesUseLowerCaseAddresses = true;
|
|
2208
|
+
}
|
|
2209
|
+
if (doesUseOutputs === void 0) {
|
|
2210
|
+
doesUseOutputs = false;
|
|
2211
|
+
}
|
|
2212
|
+
this.latinName = latinName;
|
|
2213
|
+
this.ticker = ticker;
|
|
2214
|
+
this.tickerPrintable = tickerPrintable;
|
|
2215
|
+
this.digits = digitsCountAfterComma;
|
|
2216
|
+
this.maxValue = maxValue;
|
|
2217
|
+
this.atomName = atomName;
|
|
2218
|
+
this.mainnet = mainnet;
|
|
2219
|
+
this.testnet = testnet;
|
|
2220
|
+
this.minConfirmations = minConfirmations;
|
|
2221
|
+
this.payableEntityStringForFeeRate = payableEntityStringForFeeRate;
|
|
2222
|
+
this.feeOptionsTimeStringsSortedDesc = feeOptionsTimeStringsSortedDesc;
|
|
2223
|
+
this.feeRatesExpirationTimeMs = feeRatesExpirationTimeMs;
|
|
2224
|
+
this.protocol = protocol;
|
|
2225
|
+
this.blockchain = blockchain;
|
|
2226
|
+
// TODO: [bug, critical] use testnet property for testnet contract address as it blocks the app work in testnets
|
|
2227
|
+
this.tokenAddress = tokenAddress;
|
|
2228
|
+
this.feeCoin = this;
|
|
2229
|
+
this._significantDigits = 8;
|
|
2230
|
+
this.doesUseLowerCaseAddresses = doesUseLowerCaseAddresses;
|
|
2231
|
+
this.doesUseOutputs = doesUseOutputs;
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
/**
|
|
2235
|
+
* Sets fee coin
|
|
2236
|
+
*
|
|
2237
|
+
* @param feeCoin {Coin} some tokens use another coin to charge transaction fee as they work on top of some external
|
|
2238
|
+
* blockchain. So pass here the coin the token uses for fee charging. Like for ERC20 token the fee coin is ETH.
|
|
2239
|
+
* By default, the creating coin will be set as a value for this field.
|
|
2240
|
+
*/
|
|
2241
|
+
var _proto = Coin.prototype;
|
|
2242
|
+
_proto.setFeeCoin = function setFeeCoin(feeCoin) {
|
|
2243
|
+
this.feeCoin = feeCoin;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
/**
|
|
2247
|
+
* Checks whether this coin uses another coin (blockchain) to charge fee for transactions (means works on base of
|
|
2248
|
+
* some external blockchain).
|
|
2249
|
+
*
|
|
2250
|
+
* @return {boolean} true if this coin uses external blockchain to perform transactions and charge fee
|
|
2251
|
+
*/;
|
|
2252
|
+
_proto.doesUseDifferentCoinFee = function doesUseDifferentCoinFee() {
|
|
2253
|
+
return this.feeCoin !== this;
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
/**
|
|
2257
|
+
* Converts the given atoms string/number to string representing the same amount in coin itself - floating point number
|
|
2258
|
+
*
|
|
2259
|
+
* @param atoms {string} atoms positive integer amount
|
|
2260
|
+
* @return {string} coin amount floating point number as a string
|
|
2261
|
+
*/;
|
|
2262
|
+
_proto.atomsToCoinAmount = function atomsToCoinAmount(atoms) {
|
|
2263
|
+
throw new Error("Not implemented in base Coin");
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
/**
|
|
2267
|
+
* Converts the given coins amount string/number to string representing the same amount in coin atoms - integer number
|
|
2268
|
+
*
|
|
2269
|
+
* @param coinsAmount {string} coins positive floating point amount
|
|
2270
|
+
* @return {string} coin atoms amount integer number as a string
|
|
2271
|
+
*/;
|
|
2272
|
+
_proto.coinAmountToAtoms = function coinAmountToAtoms(coinsAmount) {
|
|
2273
|
+
throw new Error("Not implemented in base Coin");
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
/**
|
|
2277
|
+
* Composes URL to view the tx with given id in the external blockchain explorer
|
|
2278
|
+
*
|
|
2279
|
+
* @param txId {string} id of transaction
|
|
2280
|
+
* @return {string} URL string
|
|
2281
|
+
*/;
|
|
2282
|
+
_proto.composeUrlToTransactionExplorer = function composeUrlToTransactionExplorer(txId) {
|
|
2283
|
+
throw new Error("Not implemented in base Coin");
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
/**
|
|
2287
|
+
* Most of the cryptocurrencies has specific fee rate or fee price metric. This value usually has specific measure
|
|
2288
|
+
* like satoshi/byte or gWei/gas. This function adds the described denomination string to the given amount
|
|
2289
|
+
* as a suffix and returns the result string ready to be show to a user.
|
|
2290
|
+
*
|
|
2291
|
+
* @param coinAtomsString {string} coin atoms positive integer amount
|
|
2292
|
+
* @return {string} string of coin amount and fee rate units
|
|
2293
|
+
*/;
|
|
2294
|
+
_proto.coinAtomsFeeRateToCommonlyUsedAmountFormatWithDenominationString = function coinAtomsFeeRateToCommonlyUsedAmountFormatWithDenominationString(coinAtomsString) {
|
|
2295
|
+
throw new Error("Not implemented in base Coin");
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* Check whether this coin support transaction prioritisation during the sending process.
|
|
2300
|
+
*
|
|
2301
|
+
* @return {boolean} true if support transaction prioritisation and false otherwise
|
|
2302
|
+
*/;
|
|
2303
|
+
_proto.doesSupportTransactionPrioritisation = function doesSupportTransactionPrioritisation() {
|
|
2304
|
+
return Array.isArray(this.feeOptionsTimeStringsSortedDesc);
|
|
2305
|
+
};
|
|
2306
|
+
_proto.tickerAndProtocol = function tickerAndProtocol() {
|
|
2307
|
+
try {
|
|
2308
|
+
var _ref;
|
|
2309
|
+
return "" + this.tickerPrintable + (this.protocol ? (_ref = " " + this.protocol.protocol) != null ? _ref : "" : "");
|
|
2310
|
+
} catch (e) {
|
|
2311
|
+
improveAndRethrow(e, "tickerAndProtocol");
|
|
2312
|
+
}
|
|
2313
|
+
};
|
|
2314
|
+
return Coin;
|
|
2315
|
+
}();
|
|
2316
|
+
|
|
2317
|
+
/**
|
|
2318
|
+
* TODO: [tests, critical] Ued by payments logic
|
|
2319
|
+
*
|
|
2320
|
+
* Simple cache based on Map.
|
|
2321
|
+
* Provides ability to store event-dependent data.
|
|
2322
|
+
*/
|
|
2323
|
+
var Cache = /*#__PURE__*/function () {
|
|
2324
|
+
/**
|
|
2325
|
+
* @param eventBus {EventBus} EventBus.js lib instance
|
|
2326
|
+
* @param [noSessionEvents=[]] {string[]} array of events that will be treated as "no session"
|
|
2327
|
+
*/
|
|
2328
|
+
function Cache(eventBus, noSessionEvents) {
|
|
2329
|
+
if (noSessionEvents === void 0) {
|
|
2330
|
+
noSessionEvents = [];
|
|
2331
|
+
}
|
|
2332
|
+
this._cache = new Map();
|
|
2333
|
+
this._eventDependentDataKeys = [];
|
|
2334
|
+
this._noSessionEvents = noSessionEvents;
|
|
2335
|
+
this._eventBus = eventBus;
|
|
2336
|
+
}
|
|
2337
|
+
var _proto = Cache.prototype;
|
|
2338
|
+
_proto._setupIntervalClearingExpired = function _setupIntervalClearingExpired() {
|
|
2339
|
+
var cleaner = function cleaner() {
|
|
2340
|
+
try {
|
|
2341
|
+
for (var _iterator = _createForOfIteratorHelperLoose(this._cache.keys()), _step; !(_step = _iterator()).done;) {
|
|
2342
|
+
var key = _step.value;
|
|
2343
|
+
var item = this._cache.get(key);
|
|
2344
|
+
if (item && item.ttlMs && item.addedMsTimestamp + item.ttlMs < Date.now()) {
|
|
2345
|
+
this._cache["delete"](key);
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
} catch (e) {
|
|
2349
|
+
improveAndRethrow(e, "_intervalClearingExpiredCache");
|
|
2350
|
+
}
|
|
2351
|
+
};
|
|
2352
|
+
cleaner = cleaner.bind(this);
|
|
2353
|
+
setInterval(cleaner, 1000);
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
/**
|
|
2357
|
+
* Puts data to cache
|
|
2358
|
+
*
|
|
2359
|
+
* @param key {string} string key for this data
|
|
2360
|
+
* @param data {any} any data
|
|
2361
|
+
* @param ttlMs {number|null} optional milliseconds number for cache lifetime
|
|
2362
|
+
* @throws {Error} when the data is null/undefined because these values for data are reserved for internal logic
|
|
2363
|
+
*/;
|
|
2364
|
+
_proto.put = function put(key, data, ttlMs) {
|
|
2365
|
+
if (ttlMs === void 0) {
|
|
2366
|
+
ttlMs = null;
|
|
2367
|
+
}
|
|
2368
|
+
try {
|
|
2369
|
+
if (typeof key !== "string" || data == null) {
|
|
2370
|
+
throw new Error("Trying to cache corrupted data: " + key + ", " + data);
|
|
2371
|
+
}
|
|
2372
|
+
this._cache.set(key, {
|
|
2373
|
+
data: data,
|
|
2374
|
+
addedMsTimestamp: Date.now(),
|
|
2375
|
+
ttlMs: ttlMs
|
|
2376
|
+
});
|
|
2377
|
+
} catch (e) {
|
|
2378
|
+
improveAndRethrow(e, "cache.put");
|
|
2379
|
+
}
|
|
2380
|
+
};
|
|
2381
|
+
_proto.putSessionDependentData = function putSessionDependentData(key, data, ttlMs) {
|
|
2382
|
+
if (ttlMs === void 0) {
|
|
2383
|
+
ttlMs = null;
|
|
2384
|
+
}
|
|
2385
|
+
this._putEventDependentData(key, data, this._noSessionEvents, ttlMs);
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
/**
|
|
2389
|
+
* Puts data to cache and adds its key to list of keys that should be related by each of given events.
|
|
2390
|
+
*
|
|
2391
|
+
* @param key {string} key for cache
|
|
2392
|
+
* @param data {any} any caching data
|
|
2393
|
+
* @param events {string[]} list of events forcing putting data to be removed when triggered
|
|
2394
|
+
* @param ttlMs {|null} optional time to live for this cache item
|
|
2395
|
+
* @throws {Error} when the data is null/undefined because these values for data are reserved for internal logic
|
|
2396
|
+
*/;
|
|
2397
|
+
_proto.putEventDependentData = function putEventDependentData(key, data, events, ttlMs) {
|
|
2398
|
+
if (ttlMs === void 0) {
|
|
2399
|
+
ttlMs = null;
|
|
2400
|
+
}
|
|
2401
|
+
this._putEventDependentData(key, data, events, ttlMs);
|
|
2402
|
+
};
|
|
2403
|
+
_proto._putEventDependentData = function _putEventDependentData(key, data, events, ttlMs) {
|
|
2404
|
+
var _this = this;
|
|
2405
|
+
if (ttlMs === void 0) {
|
|
2406
|
+
ttlMs = null;
|
|
2407
|
+
}
|
|
2408
|
+
try {
|
|
2409
|
+
if (typeof key !== "string" || data == null) {
|
|
2410
|
+
throw new Error("Trying to cache corrupted data: " + key + ", " + data);
|
|
2411
|
+
}
|
|
2412
|
+
this._cache.set(key, {
|
|
2413
|
+
data: data,
|
|
2414
|
+
addedMsTimestamp: Date.now(),
|
|
2415
|
+
ttlMs: ttlMs
|
|
2416
|
+
});
|
|
2417
|
+
var _loop = function _loop() {
|
|
2418
|
+
var event = _step2.value;
|
|
2419
|
+
var eventAndKeys = _this._eventDependentDataKeys.find(function (item) {
|
|
2420
|
+
return item[0] === event;
|
|
2421
|
+
});
|
|
2422
|
+
if (eventAndKeys) {
|
|
2423
|
+
eventAndKeys.push(key);
|
|
2424
|
+
} else {
|
|
2425
|
+
_this._eventDependentDataKeys.push([event, key]);
|
|
2426
|
+
_this._eventBus.addEventListener(event, function () {
|
|
2427
|
+
try {
|
|
2428
|
+
var keys = _this._eventDependentDataKeys.find(function (item) {
|
|
2429
|
+
return item[0] === event;
|
|
2430
|
+
});
|
|
2431
|
+
(keys != null ? keys : [event]).slice(1).forEach(function (key) {
|
|
2432
|
+
return _this._cache["delete"](key);
|
|
2433
|
+
});
|
|
2434
|
+
} catch (e) {
|
|
2435
|
+
Logger.logError(e, "cache.removing-for-event", "Event: " + event);
|
|
2436
|
+
}
|
|
2437
|
+
});
|
|
2438
|
+
}
|
|
2439
|
+
};
|
|
2440
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(events), _step2; !(_step2 = _iterator2()).done;) {
|
|
2441
|
+
_loop();
|
|
2442
|
+
}
|
|
2443
|
+
} catch (e) {
|
|
2444
|
+
improveAndRethrow(e, "cache.putEventDependentData");
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
|
|
2448
|
+
// TODO: [feature, low] add clearing of expired data by schedule
|
|
2449
|
+
;
|
|
2450
|
+
_proto.get = function get(key) {
|
|
2451
|
+
try {
|
|
2452
|
+
var item = this._cache.get(key);
|
|
2453
|
+
if (item) {
|
|
2454
|
+
if (item.addedMsTimestamp && item.ttlMs !== null && item.addedMsTimestamp + item.ttlMs < Date.now()) {
|
|
2455
|
+
this._cache["delete"](key);
|
|
2456
|
+
return null;
|
|
2457
|
+
} else {
|
|
2458
|
+
return item.data;
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
return null;
|
|
2462
|
+
} catch (e) {
|
|
2463
|
+
improveAndRethrow(e, "cache.get");
|
|
2464
|
+
}
|
|
2465
|
+
};
|
|
2466
|
+
_proto.getLastUpdateTimestamp = function getLastUpdateTimestamp(key) {
|
|
2467
|
+
var _this$_cache$get$adde, _this$_cache$get;
|
|
2468
|
+
return (_this$_cache$get$adde = (_this$_cache$get = this._cache.get(key)) == null ? void 0 : _this$_cache$get.addedMsTimestamp) != null ? _this$_cache$get$adde : null;
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
/**
|
|
2472
|
+
* Updates the timestamp of the last update for specified key to the provided value.
|
|
2473
|
+
* Can be useful when TTL is controlled outside this class.
|
|
2474
|
+
*
|
|
2475
|
+
* @param key {string}
|
|
2476
|
+
* @param timestamp {number}
|
|
2477
|
+
* @return {boolean}
|
|
2478
|
+
*/;
|
|
2479
|
+
_proto.setLastUpdateTimestamp = function setLastUpdateTimestamp(key, timestamp) {
|
|
2480
|
+
try {
|
|
2481
|
+
var item = this._cache.get(key);
|
|
2482
|
+
if (item != null && typeof timestamp === "number") {
|
|
2483
|
+
this._cache.set(key, _extends({}, item, {
|
|
2484
|
+
addedTimestampMs: timestamp
|
|
2485
|
+
}));
|
|
2486
|
+
return true;
|
|
2487
|
+
}
|
|
2488
|
+
return false;
|
|
2489
|
+
} catch (e) {
|
|
2490
|
+
improveAndRethrow("cache.setLastUpdateTimestamp");
|
|
2491
|
+
}
|
|
2492
|
+
};
|
|
2493
|
+
_proto.invalidate = function invalidate(key) {
|
|
2494
|
+
try {
|
|
2495
|
+
this._cache["delete"](key);
|
|
2496
|
+
} catch (e) {
|
|
2497
|
+
improveAndRethrow(e, "cache.invalidate");
|
|
2498
|
+
}
|
|
2499
|
+
};
|
|
2500
|
+
_proto.invalidateContaining = function invalidateContaining(keyPart) {
|
|
2501
|
+
if (typeof keyPart !== "string" || keyPart === "") {
|
|
2502
|
+
throw new Error("Trying to invalidate containing wrong key or empty key: " + keyPart);
|
|
2503
|
+
}
|
|
2504
|
+
try {
|
|
2505
|
+
var matchedKeys = Array.from(this._cache.keys()).filter(function (key) {
|
|
2506
|
+
return typeof key === "string" && new RegExp(keyPart).test(key);
|
|
2507
|
+
});
|
|
2508
|
+
for (var i = 0; i < matchedKeys.length; ++i) {
|
|
2509
|
+
this._cache["delete"](matchedKeys[i]);
|
|
2510
|
+
}
|
|
2511
|
+
} catch (e) {
|
|
2512
|
+
improveAndRethrow(e, "invalidateContaining");
|
|
2513
|
+
}
|
|
2514
|
+
};
|
|
2515
|
+
_proto.clear = function clear() {
|
|
2516
|
+
this._cache.clear();
|
|
2517
|
+
this._sessionDependentDataKeys = [];
|
|
2518
|
+
}
|
|
2519
|
+
|
|
2520
|
+
/**
|
|
2521
|
+
* Saves given data string to persistent cache.
|
|
2522
|
+
* NOTE: we have no TTL here, implement if needed.
|
|
2523
|
+
*
|
|
2524
|
+
* WARNING: use only when really needed and don't store big data as we use localStorage
|
|
2525
|
+
* under the hood and its capacity is restricted.
|
|
2526
|
+
*
|
|
2527
|
+
* @param uniqueKey {string} the key should be unique
|
|
2528
|
+
* @param data {string} only string data allowed
|
|
2529
|
+
*/;
|
|
2530
|
+
_proto.putClientPersistentData = function putClientPersistentData(uniqueKey, data) {
|
|
2531
|
+
try {
|
|
2532
|
+
if (typeof window !== "undefined") {
|
|
2533
|
+
localStorage.setItem(uniqueKey, data);
|
|
2534
|
+
}
|
|
2535
|
+
} catch (e) {
|
|
2536
|
+
improveAndRethrow(e, "cache.putClientPersistentData");
|
|
2537
|
+
}
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
/**
|
|
2541
|
+
* @param uniqueKey {string}
|
|
2542
|
+
* @return {string|null}
|
|
2543
|
+
*/;
|
|
2544
|
+
_proto.getClientPersistentData = function getClientPersistentData(uniqueKey) {
|
|
2545
|
+
try {
|
|
2546
|
+
if (typeof window !== "undefined") {
|
|
2547
|
+
return localStorage.getItem(uniqueKey);
|
|
2548
|
+
}
|
|
2549
|
+
return null;
|
|
2550
|
+
} catch (e) {
|
|
2551
|
+
improveAndRethrow(e, "cache.getClientPersistentData");
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
/**
|
|
2556
|
+
* Only makes effect if the TTL is not null.
|
|
2557
|
+
*
|
|
2558
|
+
* @param key {string}
|
|
2559
|
+
* @param ttlMs {number|null}
|
|
2560
|
+
*/;
|
|
2561
|
+
_proto.markCacheItemAsExpiredButDontRemove = function markCacheItemAsExpiredButDontRemove(key, ttlMs) {
|
|
2562
|
+
if (ttlMs === void 0) {
|
|
2563
|
+
ttlMs = null;
|
|
2564
|
+
}
|
|
2565
|
+
try {
|
|
2566
|
+
var _ttlMs;
|
|
2567
|
+
var item = this._cache.get(key);
|
|
2568
|
+
var ttlFinalMs = (_ttlMs = ttlMs) != null ? _ttlMs : item == null ? void 0 : item.ttlMs;
|
|
2569
|
+
if (item != null && ttlFinalMs) {
|
|
2570
|
+
this._cache.set(key, {
|
|
2571
|
+
data: item.data,
|
|
2572
|
+
addedMsTimestamp: Date.now() - ttlFinalMs - 1,
|
|
2573
|
+
ttlMs: ttlFinalMs
|
|
2574
|
+
});
|
|
2575
|
+
}
|
|
2576
|
+
} catch (e) {
|
|
2577
|
+
improveAndRethrow(e, "cache.markCacheItemAsExpiredButDontRemove");
|
|
2578
|
+
}
|
|
2579
|
+
};
|
|
2580
|
+
return Cache;
|
|
2581
|
+
}();
|
|
2582
|
+
|
|
2583
|
+
function _catch$3(body, recover) {
|
|
2584
|
+
try {
|
|
2585
|
+
var result = body();
|
|
2586
|
+
} catch (e) {
|
|
2587
|
+
return recover(e);
|
|
2588
|
+
}
|
|
2589
|
+
if (result && result.then) {
|
|
2590
|
+
return result.then(void 0, recover);
|
|
2591
|
+
}
|
|
2592
|
+
return result;
|
|
2593
|
+
}
|
|
2594
|
+
var EmailsApi = /*#__PURE__*/function () {
|
|
2595
|
+
function EmailsApi() {}
|
|
2596
|
+
EmailsApi.sendEmail = function sendEmail(subject, body) {
|
|
2597
|
+
try {
|
|
2598
|
+
var _this = this;
|
|
2599
|
+
var _temp = _catch$3(function () {
|
|
2600
|
+
var url = window.location.protocol + "//" + window.location.host + "/api/v1/" + _this.serverEndpointEntity;
|
|
2601
|
+
return Promise.resolve(axios__default["default"].post(url, {
|
|
2602
|
+
subject: subject,
|
|
2603
|
+
body: body
|
|
2604
|
+
})).then(function () {});
|
|
2605
|
+
}, function (e) {
|
|
2606
|
+
improveAndRethrow(e, "sendEmail", subject + body);
|
|
2607
|
+
});
|
|
2608
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
2609
|
+
} catch (e) {
|
|
2610
|
+
return Promise.reject(e);
|
|
2611
|
+
}
|
|
2612
|
+
};
|
|
2613
|
+
return EmailsApi;
|
|
2614
|
+
}();
|
|
2615
|
+
EmailsApi.serverEndpointEntity = "emails";
|
|
2616
|
+
|
|
2617
|
+
var ExistingSwap =
|
|
2618
|
+
/**
|
|
2619
|
+
* @param swapId {string}
|
|
2620
|
+
* @param status {SwapProvider.SWAP_STATUSES}
|
|
2621
|
+
* @param createdAt {number}
|
|
2622
|
+
* @param expiresAt {number}
|
|
2623
|
+
* @param confirmations {number}
|
|
2624
|
+
* @param rate {string}
|
|
2625
|
+
* @param refundAddress {string}
|
|
2626
|
+
* @param fromCoin {Coin}
|
|
2627
|
+
* @param fromAmount {string}
|
|
2628
|
+
* @param fromTransactionId {string}
|
|
2629
|
+
* @param toCoin {Coin}
|
|
2630
|
+
* @param toAmount {string}
|
|
2631
|
+
* @param toTransactionId {string|null}
|
|
2632
|
+
* @param toAddress {string}
|
|
2633
|
+
* @param partner {string}
|
|
2634
|
+
*/
|
|
2635
|
+
function ExistingSwap(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress,
|
|
2636
|
+
// TODO: [refactoring, moderate] toAddress is not quite clear. How about recipientAddress? task_id=0815a111c99543b78d374217eadbde4f
|
|
2637
|
+
partner) {
|
|
2638
|
+
this.swapId = swapId;
|
|
2639
|
+
this.status = status;
|
|
2640
|
+
this.createdAt = createdAt;
|
|
2641
|
+
this.expiresAt = expiresAt;
|
|
2642
|
+
this.confirmations = confirmations;
|
|
2643
|
+
this.rate = rate;
|
|
2644
|
+
this.refundAddress = refundAddress;
|
|
2645
|
+
this.payToAddress = payToAddress;
|
|
2646
|
+
this.fromCoin = fromCoin;
|
|
2647
|
+
this.fromTransactionId = fromTransactionId;
|
|
2648
|
+
this.fromAmount = fromAmount;
|
|
2649
|
+
this.fromTransactionLink = fromTransactionLink;
|
|
2650
|
+
this.toCoin = toCoin;
|
|
2651
|
+
this.toTransactionId = toTransactionId;
|
|
2652
|
+
this.toTransactionLink = toTransactionLink;
|
|
2653
|
+
this.toAmount = toAmount;
|
|
2654
|
+
this.toAddress = toAddress;
|
|
2655
|
+
this.partner = partner;
|
|
2656
|
+
};
|
|
2657
|
+
|
|
2658
|
+
var ExistingSwapWithFiatData = /*#__PURE__*/function (_ExistingSwap) {
|
|
2659
|
+
_inheritsLoose(ExistingSwapWithFiatData, _ExistingSwap);
|
|
2660
|
+
/**
|
|
2661
|
+
* @param swapId {string}
|
|
2662
|
+
* @param status {SwapProvider.SWAP_STATUSES}
|
|
2663
|
+
* @param createdAt {number}
|
|
2664
|
+
* @param expiresAt {number}
|
|
2665
|
+
* @param confirmations {number}
|
|
2666
|
+
* @param rate {string}
|
|
2667
|
+
* @param refundAddress {string}
|
|
2668
|
+
* @param fromCoin {Coin}
|
|
2669
|
+
* @param fromAmount {string}
|
|
2670
|
+
* @param fromTransactionId {string}
|
|
2671
|
+
* @param toCoin {Coin}
|
|
2672
|
+
* @param toAmount {string}
|
|
2673
|
+
* @param toTransactionId {string|null}
|
|
2674
|
+
* @param toAddress {string}
|
|
2675
|
+
* @param partner {string}
|
|
2676
|
+
* @param fromAmountFiat {number}
|
|
2677
|
+
* @param toAmountFiat {number}
|
|
2678
|
+
* @param fiatCurrencyCode {string}
|
|
2679
|
+
* @param fiatCurrencyDecimals {number}
|
|
2680
|
+
*/
|
|
2681
|
+
function ExistingSwapWithFiatData(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
|
|
2682
|
+
var _this;
|
|
2683
|
+
_this = _ExistingSwap.call(this, swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner) || this;
|
|
2684
|
+
_this.fromAmountFiat = fromAmountFiat;
|
|
2685
|
+
_this.toAmountFiat = toAmountFiat;
|
|
2686
|
+
_this.fiatCurrencyCode = fiatCurrencyCode;
|
|
2687
|
+
_this.fiatCurrencyDecimals = fiatCurrencyDecimals;
|
|
2688
|
+
return _this;
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
/**
|
|
2692
|
+
* @param existingSwap {ExistingSwap}
|
|
2693
|
+
* @param fromAmountFiat {number}
|
|
2694
|
+
* @param toAmountFiat {number}
|
|
2695
|
+
* @param fiatCurrencyCode {string}
|
|
2696
|
+
* @param fiatCurrencyDecimals {number}
|
|
2697
|
+
* @return {ExistingSwapWithFiatData}
|
|
2698
|
+
*/
|
|
2699
|
+
ExistingSwapWithFiatData.fromExistingSwap = function fromExistingSwap(existingSwap, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
|
|
2700
|
+
return new ExistingSwapWithFiatData(existingSwap.swapId, existingSwap.status, existingSwap.createdAt, existingSwap.expiresAt, existingSwap.confirmations, existingSwap.rate, existingSwap.refundAddress, existingSwap.payToAddress, existingSwap.fromCoin, existingSwap.fromAmount, existingSwap.fromTransactionId, existingSwap.fromTransactionLink, existingSwap.toCoin, existingSwap.toAmount, existingSwap.toTransactionId, existingSwap.toTransactionLink, existingSwap.toAddress, existingSwap.partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals);
|
|
2701
|
+
};
|
|
2702
|
+
return ExistingSwapWithFiatData;
|
|
2703
|
+
}(ExistingSwap);
|
|
2704
|
+
|
|
2705
|
+
var BaseSwapCreationInfo =
|
|
2706
|
+
/**
|
|
2707
|
+
* @param fromCoin {Coin}
|
|
2708
|
+
* @param toCoin {Coin}
|
|
2709
|
+
* @param fromAmountCoins {string}
|
|
2710
|
+
* @param toAmountCoins {string}
|
|
2711
|
+
* @param rate {string}
|
|
2712
|
+
* @param rawSwapData {Object}
|
|
2713
|
+
* @param min {string}
|
|
2714
|
+
* @param fiatMin {number}
|
|
2715
|
+
* @param max {string}
|
|
2716
|
+
* @param fiatMax {number}
|
|
2717
|
+
* @param durationMinutesRange {string}
|
|
2718
|
+
*/
|
|
2719
|
+
function BaseSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, rate, rawSwapData, min, fiatMin, max, fiatMax, durationMinutesRange) {
|
|
2720
|
+
this.fromCoin = fromCoin;
|
|
2721
|
+
this.toCoin = toCoin;
|
|
2722
|
+
this.fromAmountCoins = fromAmountCoins;
|
|
2723
|
+
this.toAmountCoins = toAmountCoins;
|
|
2724
|
+
this.rate = rate;
|
|
2725
|
+
this.rawSwapData = rawSwapData;
|
|
2726
|
+
this.min = min;
|
|
2727
|
+
this.fiatMin = fiatMin;
|
|
2728
|
+
this.max = max;
|
|
2729
|
+
this.fiatMax = fiatMax;
|
|
2730
|
+
this.durationMinutesRange = durationMinutesRange;
|
|
2731
|
+
};
|
|
2732
|
+
|
|
2733
|
+
var SwapProvider = /*#__PURE__*/function () {
|
|
2734
|
+
function SwapProvider() {}
|
|
2735
|
+
var _proto = SwapProvider.prototype;
|
|
2736
|
+
/**
|
|
2737
|
+
* @return {Promise<void>}
|
|
2738
|
+
*/
|
|
2739
|
+
_proto.initialize = function initialize() {
|
|
2740
|
+
try {
|
|
2741
|
+
throw new Error("Not implemented in base");
|
|
2742
|
+
} catch (e) {
|
|
2743
|
+
return Promise.reject(e);
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
/**
|
|
2747
|
+
* @return {number} milliseconds TTL
|
|
2748
|
+
*/
|
|
2749
|
+
;
|
|
2750
|
+
_proto.getSwapCreationInfoTtlMs = function getSwapCreationInfoTtlMs() {
|
|
2751
|
+
throw new Error("Not implemented in base");
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
/**
|
|
2755
|
+
* Retrieves all currencies supported by this swap provider.
|
|
2756
|
+
* Returns one of SwapProvider.COMMON_ERRORS in case of processable fail.
|
|
2757
|
+
*
|
|
2758
|
+
* @return {Promise<({ result: true, coins: Coin[] }|{ result: false, reason: string })>}
|
|
2759
|
+
*/;
|
|
2760
|
+
_proto.getAllSupportedCurrencies = function getAllSupportedCurrencies() {
|
|
2761
|
+
try {
|
|
2762
|
+
throw new Error("Not implemented in base");
|
|
2763
|
+
} catch (e) {
|
|
2764
|
+
return Promise.reject(e);
|
|
2765
|
+
}
|
|
2766
|
+
}
|
|
2767
|
+
/**
|
|
2768
|
+
* Retrieves all deposit currencies supported by this swap provider.
|
|
2769
|
+
* Returns one of SwapProvider.COMMON_ERRORS in case of processable fail.
|
|
2770
|
+
*
|
|
2771
|
+
* @return {Promise<({ result: true, coins: Coin[] }|{ result: false, reason: string })>}
|
|
2772
|
+
*/
|
|
2773
|
+
;
|
|
2774
|
+
_proto.getDepositCurrencies = function getDepositCurrencies() {
|
|
2775
|
+
try {
|
|
2776
|
+
throw new Error("Not implemented in base");
|
|
2777
|
+
} catch (e) {
|
|
2778
|
+
return Promise.reject(e);
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
/**
|
|
2782
|
+
* Retrieves all withdrawable currencies supported by this swap provider.
|
|
2783
|
+
* Returns one of SwapProvider.COMMON_ERRORS in case of processable fail.
|
|
2784
|
+
*
|
|
2785
|
+
* @param [exceptCurrency=null] {Coin|null}
|
|
2786
|
+
* @return {Promise<({ result: true, coins: Coin[] }|{ result: false, reason: string })>}
|
|
2787
|
+
*/
|
|
2788
|
+
;
|
|
2789
|
+
_proto.getWithdrawalCurrencies = function getWithdrawalCurrencies(exceptCurrency) {
|
|
2790
|
+
try {
|
|
2791
|
+
throw new Error("Not implemented in base");
|
|
2792
|
+
} catch (e) {
|
|
2793
|
+
return Promise.reject(e);
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
/**
|
|
2797
|
+
* Retrieves URL for coin icon or fallback if not found.
|
|
2798
|
+
*
|
|
2799
|
+
* @param coin {Coin|string} coin or rabbit-format of coin ticker
|
|
2800
|
+
* @return {string}
|
|
2801
|
+
*/
|
|
2802
|
+
;
|
|
2803
|
+
_proto.getIconUrl = function getIconUrl(coin) {
|
|
2804
|
+
throw new Error("Not implemented in base");
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
/**
|
|
2808
|
+
* Retrieves coin to USDT rate.
|
|
2809
|
+
*
|
|
2810
|
+
* @param coin {Coin}
|
|
2811
|
+
* @return {{result: true, rate: string}|{result: false}}
|
|
2812
|
+
*/;
|
|
2813
|
+
_proto.getCoinToUSDTRate = function getCoinToUSDTRate(coin) {
|
|
2814
|
+
try {
|
|
2815
|
+
throw new Error("Not implemented in base");
|
|
2816
|
+
} catch (e) {
|
|
2817
|
+
return Promise.reject(e);
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
/**
|
|
2821
|
+
* Retrieves estimation for swapping giving coins amount.
|
|
2822
|
+
* null min or max signals there is no corresponding limitation. undefined means that the limits were not retrieved.
|
|
2823
|
+
* For fail result on of SwapProvider.NO_SWAPS_REASONS or SwapProvider.COMMON_ERRORS reasons will be returned.
|
|
2824
|
+
*
|
|
2825
|
+
* WARNING: MUST return NOT_SUPPORTED error code for any case when pair is not available/supported (Should not throw random errors for this case)
|
|
2826
|
+
* @param fromCoin {Coin}
|
|
2827
|
+
* @param toCoin {Coin}
|
|
2828
|
+
* @param amountCoins {string}
|
|
2829
|
+
* @param [fromCoinToUsdRate=null] pass if you want to increase the min amount returned
|
|
2830
|
+
* by provider with some fixed "insurance" amount to cover min amount fluctuations.
|
|
2831
|
+
* @return {Promise<({
|
|
2832
|
+
* result: false,
|
|
2833
|
+
* reason: string,
|
|
2834
|
+
* smallestMin: (string|null|undefined),
|
|
2835
|
+
* greatestMax: (string|null|undefined),
|
|
2836
|
+
* }|{
|
|
2837
|
+
* result: true,
|
|
2838
|
+
* min: (string|null),
|
|
2839
|
+
* max: (string|null),
|
|
2840
|
+
* smallestMin: (string|null),
|
|
2841
|
+
* greatestMax: (string|null),
|
|
2842
|
+
* rate: (string|null),
|
|
2843
|
+
* durationMinutesRange: string,
|
|
2844
|
+
* [rawSwapData]: Object
|
|
2845
|
+
* })>}
|
|
2846
|
+
*/
|
|
2847
|
+
;
|
|
2848
|
+
_proto.getSwapInfo = function getSwapInfo(fromCoin, toCoin, amountCoins, fromCoinToUsdRate) {
|
|
2849
|
+
try {
|
|
2850
|
+
throw new Error("Not implemented in base");
|
|
2851
|
+
} catch (e) {
|
|
2852
|
+
return Promise.reject(e);
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
/**
|
|
2856
|
+
* For fail result we return one of SwapProvider.CREATION_FAIL_REASONS or SwapProvider.COMMON_ERRORS.
|
|
2857
|
+
*
|
|
2858
|
+
* @param fromCoin {Coin}
|
|
2859
|
+
* @param toCoin {Coin}
|
|
2860
|
+
* @param amount {string}
|
|
2861
|
+
* @param toAddress {string}
|
|
2862
|
+
* @param refundAddress {string}
|
|
2863
|
+
* @param rawSwapData {Object|null}
|
|
2864
|
+
* @param clientIpAddress {string}
|
|
2865
|
+
* @return {Promise<({
|
|
2866
|
+
* result: true,
|
|
2867
|
+
* swapId: string,
|
|
2868
|
+
* fromCoin: Coin,
|
|
2869
|
+
* fromAmount: string,
|
|
2870
|
+
* fromAddress: string,
|
|
2871
|
+
* toCoin: Coin,
|
|
2872
|
+
* toAmount: string,
|
|
2873
|
+
* toAddress: string,
|
|
2874
|
+
* rate: string
|
|
2875
|
+
* }|{
|
|
2876
|
+
* result: false,
|
|
2877
|
+
* reason: string,
|
|
2878
|
+
* partner: string
|
|
2879
|
+
* })>}
|
|
2880
|
+
*/
|
|
2881
|
+
;
|
|
2882
|
+
_proto.createSwap = function createSwap(fromCoin, toCoin, amount, toAddress, refundAddress, rawSwapData, clientIpAddress) {
|
|
2883
|
+
try {
|
|
2884
|
+
throw new Error("Not implemented in base");
|
|
2885
|
+
} catch (e) {
|
|
2886
|
+
return Promise.reject(e);
|
|
2887
|
+
}
|
|
2888
|
+
}
|
|
2889
|
+
/**
|
|
2890
|
+
* Retrieves details and status for swaps by given ids.
|
|
2891
|
+
* If some swap is not found by id then there is no item in return list.
|
|
2892
|
+
*
|
|
2893
|
+
* @param swapIds {string[]}
|
|
2894
|
+
* @return {Promise<{result: false, reason: string}|{result:true, swaps: ExistingSwap[]}>}
|
|
2895
|
+
*/
|
|
2896
|
+
;
|
|
2897
|
+
_proto.getExistingSwapsDetailsAndStatus = function getExistingSwapsDetailsAndStatus(swapIds) {
|
|
2898
|
+
try {
|
|
2899
|
+
throw new Error("Not implemented in base");
|
|
2900
|
+
} catch (e) {
|
|
2901
|
+
return Promise.reject(e);
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
/**
|
|
2905
|
+
* @param ticker {string}
|
|
2906
|
+
* @return {Coin|null}
|
|
2907
|
+
*/
|
|
2908
|
+
;
|
|
2909
|
+
_proto.getCoinByTickerIfPresent = function getCoinByTickerIfPresent(ticker) {
|
|
2910
|
+
throw new Error("Not implemented in base");
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2913
|
+
/**
|
|
2914
|
+
* @param asset {Coin}
|
|
2915
|
+
* @param address {string}
|
|
2916
|
+
* @return {boolean}
|
|
2917
|
+
*/;
|
|
2918
|
+
_proto.isAddressValidForAsset = function isAddressValidForAsset(asset, address) {
|
|
2919
|
+
throw new Error("Not implemented in base");
|
|
2920
|
+
};
|
|
2921
|
+
return SwapProvider;
|
|
2922
|
+
}();
|
|
2923
|
+
SwapProvider.COMMON_ERRORS = {
|
|
2924
|
+
REQUESTS_LIMIT_EXCEEDED: "requestsLimitExceeded"
|
|
2925
|
+
};
|
|
2926
|
+
SwapProvider.NO_SWAPS_REASONS = {
|
|
2927
|
+
TOO_LOW: "tooLow",
|
|
2928
|
+
TOO_HIGH: "tooHigh",
|
|
2929
|
+
NOT_SUPPORTED: "notSupported"
|
|
2930
|
+
};
|
|
2931
|
+
SwapProvider.CREATION_FAIL_REASONS = {
|
|
2932
|
+
RETRIABLE_FAIL: "retriableFail"
|
|
2933
|
+
};
|
|
2934
|
+
SwapProvider.SWAP_STATUSES = {
|
|
2935
|
+
WAITING_FOR_PAYMENT: "waiting_for_payment",
|
|
2936
|
+
// public +
|
|
2937
|
+
CONFIRMING: "confirming",
|
|
2938
|
+
PAYMENT_RECEIVED: "payment_received",
|
|
2939
|
+
// public +
|
|
2940
|
+
EXCHANGING: "exchanging",
|
|
2941
|
+
// session full // public +
|
|
2942
|
+
COMPLETED: "completed",
|
|
2943
|
+
// session full // public +
|
|
2944
|
+
REFUNDED: "refunded",
|
|
2945
|
+
// session full // public +
|
|
2946
|
+
EXPIRED: "expired",
|
|
2947
|
+
// public +
|
|
2948
|
+
FAILED: "failed" // public +
|
|
2949
|
+
};
|
|
2950
|
+
|
|
2951
|
+
function _catch$2(body, recover) {
|
|
2952
|
+
try {
|
|
2953
|
+
var result = body();
|
|
2954
|
+
} catch (e) {
|
|
2955
|
+
return recover(e);
|
|
2956
|
+
}
|
|
2957
|
+
if (result && result.then) {
|
|
2958
|
+
return result.then(void 0, recover);
|
|
2959
|
+
}
|
|
2960
|
+
return result;
|
|
2961
|
+
}
|
|
2962
|
+
var BANNED_PARTNERS = ["stealthex", "changee", "coincraddle"];
|
|
2963
|
+
var FALLBACK_ICON_URL = "https://rabbit.io/asset-icons/fallback.svg";
|
|
2964
|
+
var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
2965
|
+
_inheritsLoose(SwapspaceSwapProvider, _SwapProvider);
|
|
2966
|
+
function SwapspaceSwapProvider(apiKeysProxyUrl, cache, customCoinBuilder, useRestrictedCoinsSet) {
|
|
2967
|
+
var _this;
|
|
2968
|
+
if (customCoinBuilder === void 0) {
|
|
2969
|
+
customCoinBuilder = function customCoinBuilder(coin, network) {
|
|
2970
|
+
return null;
|
|
2971
|
+
};
|
|
2972
|
+
}
|
|
2973
|
+
if (useRestrictedCoinsSet === void 0) {
|
|
2974
|
+
useRestrictedCoinsSet = true;
|
|
2975
|
+
}
|
|
2976
|
+
_this = _SwapProvider.call(this) || this;
|
|
2977
|
+
_this._supportedCoins = [];
|
|
2978
|
+
_this._URL = apiKeysProxyUrl + "/swapspace";
|
|
2979
|
+
_this._maxRateDigits = 20;
|
|
2980
|
+
_this.useRestrictedCoinsSet = useRestrictedCoinsSet;
|
|
2981
|
+
_this._customCoinBuilder = customCoinBuilder;
|
|
2982
|
+
_this._cache = cache;
|
|
2983
|
+
return _this;
|
|
2984
|
+
}
|
|
2985
|
+
var _proto = SwapspaceSwapProvider.prototype;
|
|
2986
|
+
_proto.getSwapCreationInfoTtlMs = function getSwapCreationInfoTtlMs() {
|
|
2987
|
+
/* Actually 2 minutes and only relevant for some partners, but we use it
|
|
2988
|
+
* (and even a bit smaller value) for better consistency */
|
|
2989
|
+
return 110000;
|
|
2990
|
+
};
|
|
2991
|
+
_proto.getDepositCurrencies = function getDepositCurrencies() {
|
|
2992
|
+
try {
|
|
2993
|
+
var _this2 = this;
|
|
2994
|
+
var loggerSource = "getDepositCurrencies";
|
|
2995
|
+
return Promise.resolve(_catch$2(function () {
|
|
2996
|
+
return Promise.resolve(_this2._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
2997
|
+
var _this2$_supportedCoin;
|
|
2998
|
+
Logger.log("We have " + ((_this2$_supportedCoin = _this2._supportedCoins) == null ? void 0 : _this2$_supportedCoin.length) + " supported coins, getting depositable", loggerSource);
|
|
2999
|
+
return {
|
|
3000
|
+
result: true,
|
|
3001
|
+
coins: _this2._supportedCoins.filter(function (item) {
|
|
3002
|
+
return item.deposit;
|
|
3003
|
+
}).map(function (item) {
|
|
3004
|
+
return item.coin;
|
|
3005
|
+
})
|
|
3006
|
+
};
|
|
3007
|
+
});
|
|
3008
|
+
}, function (e) {
|
|
3009
|
+
var _e$response;
|
|
3010
|
+
if ((e == null || (_e$response = e.response) == null ? void 0 : _e$response.status) === 429) {
|
|
3011
|
+
return {
|
|
3012
|
+
result: false,
|
|
3013
|
+
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3014
|
+
};
|
|
3015
|
+
}
|
|
3016
|
+
improveAndRethrow(e, loggerSource);
|
|
3017
|
+
}));
|
|
3018
|
+
} catch (e) {
|
|
3019
|
+
return Promise.reject(e);
|
|
3020
|
+
}
|
|
3021
|
+
};
|
|
3022
|
+
_proto.getAllSupportedCurrencies = function getAllSupportedCurrencies() {
|
|
3023
|
+
try {
|
|
3024
|
+
var _this3 = this;
|
|
3025
|
+
var loggerSource = "getAllSupportedCurrencies";
|
|
3026
|
+
return Promise.resolve(_catch$2(function () {
|
|
3027
|
+
return Promise.resolve(_this3._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
3028
|
+
var _this3$_supportedCoin;
|
|
3029
|
+
Logger.log("We have " + ((_this3$_supportedCoin = _this3._supportedCoins) == null ? void 0 : _this3$_supportedCoin.length) + " supported coins returning", loggerSource);
|
|
3030
|
+
return {
|
|
3031
|
+
result: true,
|
|
3032
|
+
coins: _this3._supportedCoins.map(function (item) {
|
|
3033
|
+
return item.coin;
|
|
3034
|
+
})
|
|
3035
|
+
};
|
|
3036
|
+
});
|
|
3037
|
+
}, function (e) {
|
|
3038
|
+
var _e$response2;
|
|
3039
|
+
if ((e == null || (_e$response2 = e.response) == null ? void 0 : _e$response2.status) === 429) {
|
|
3040
|
+
return {
|
|
3041
|
+
result: false,
|
|
3042
|
+
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3043
|
+
};
|
|
3044
|
+
}
|
|
3045
|
+
improveAndRethrow(e, loggerSource);
|
|
3046
|
+
}));
|
|
3047
|
+
} catch (e) {
|
|
3048
|
+
return Promise.reject(e);
|
|
3049
|
+
}
|
|
3050
|
+
};
|
|
3051
|
+
_proto.getWithdrawalCurrencies = function getWithdrawalCurrencies(exceptCurrency) {
|
|
3052
|
+
if (exceptCurrency === void 0) {
|
|
3053
|
+
exceptCurrency = null;
|
|
3054
|
+
}
|
|
3055
|
+
try {
|
|
3056
|
+
var _this4 = this;
|
|
3057
|
+
var loggerSource = "getWithdrawalCurrencies";
|
|
3058
|
+
return Promise.resolve(_catch$2(function () {
|
|
3059
|
+
return Promise.resolve(_this4._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
3060
|
+
var _this4$_supportedCoin;
|
|
3061
|
+
Logger.log("We have " + ((_this4$_supportedCoin = _this4._supportedCoins) == null ? void 0 : _this4$_supportedCoin.length) + " supported coins, getting withdrawable", loggerSource);
|
|
3062
|
+
return {
|
|
3063
|
+
result: true,
|
|
3064
|
+
coins: _this4._supportedCoins.filter(function (item) {
|
|
3065
|
+
var _item$coin, _exceptCurrency;
|
|
3066
|
+
return item.withdrawal && (!exceptCurrency || ((_item$coin = item.coin) == null ? void 0 : _item$coin.ticker) !== ((_exceptCurrency = exceptCurrency) == null ? void 0 : _exceptCurrency.ticker));
|
|
3067
|
+
}).map(function (item) {
|
|
3068
|
+
return item.coin;
|
|
3069
|
+
})
|
|
3070
|
+
};
|
|
3071
|
+
});
|
|
3072
|
+
}, function (e) {
|
|
3073
|
+
var _e$response3;
|
|
3074
|
+
if ((e == null || (_e$response3 = e.response) == null ? void 0 : _e$response3.status) === 429) {
|
|
3075
|
+
return {
|
|
3076
|
+
result: false,
|
|
3077
|
+
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3078
|
+
};
|
|
3079
|
+
}
|
|
3080
|
+
improveAndRethrow(e, loggerSource);
|
|
3081
|
+
}));
|
|
3082
|
+
} catch (e) {
|
|
3083
|
+
return Promise.reject(e);
|
|
3084
|
+
}
|
|
3085
|
+
};
|
|
3086
|
+
_proto.initialize = function initialize() {
|
|
3087
|
+
try {
|
|
3088
|
+
var _this5 = this;
|
|
3089
|
+
return Promise.resolve(_this5._fetchSupportedCurrenciesIfNeeded()).then(function () {});
|
|
3090
|
+
} catch (e) {
|
|
3091
|
+
return Promise.reject(e);
|
|
3092
|
+
}
|
|
3093
|
+
};
|
|
3094
|
+
_proto.getIconUrl = function getIconUrl(coinOrTicker) {
|
|
3095
|
+
var loggerSource = "getIconUrl";
|
|
3096
|
+
try {
|
|
3097
|
+
var _this$_supportedCoins2, _this$_supportedCoins3;
|
|
3098
|
+
var coin = coinOrTicker;
|
|
3099
|
+
if (!(coinOrTicker instanceof Coin)) {
|
|
3100
|
+
var _this$_supportedCoins;
|
|
3101
|
+
coin = (_this$_supportedCoins = this._supportedCoins.find(function (i) {
|
|
3102
|
+
return i.coin.ticker === coinOrTicker;
|
|
3103
|
+
})) == null ? void 0 : _this$_supportedCoins.coin;
|
|
3104
|
+
}
|
|
3105
|
+
return (_this$_supportedCoins2 = (_this$_supportedCoins3 = this._supportedCoins.find(function (item) {
|
|
3106
|
+
var _item$coin2, _coin;
|
|
3107
|
+
return ((_item$coin2 = item.coin) == null ? void 0 : _item$coin2.ticker) === ((_coin = coin) == null ? void 0 : _coin.ticker);
|
|
3108
|
+
})) == null ? void 0 : _this$_supportedCoins3.iconURL) != null ? _this$_supportedCoins2 : FALLBACK_ICON_URL;
|
|
3109
|
+
} catch (e) {
|
|
3110
|
+
improveAndRethrow(e, loggerSource);
|
|
3111
|
+
}
|
|
3112
|
+
};
|
|
3113
|
+
_proto._fetchSupportedCurrenciesIfNeeded = function _fetchSupportedCurrenciesIfNeeded() {
|
|
3114
|
+
try {
|
|
3115
|
+
var _this6 = this;
|
|
3116
|
+
var loggerSource = "_fetchSupportedCurrenciesIfNeeded";
|
|
3117
|
+
return Promise.resolve(_catch$2(function () {
|
|
3118
|
+
var _temp = function (_this6$_supportedCoin) {
|
|
3119
|
+
if (!((_this6$_supportedCoin = _this6._supportedCoins) != null && _this6$_supportedCoin.length)) {
|
|
3120
|
+
return Promise.resolve(axios__default["default"].get(_this6._URL + "/api/v2/currencies")).then(function (rawResponse) {
|
|
3121
|
+
var _rawResponse$data, _rawResponse$data2;
|
|
3122
|
+
Logger.log("Retrieved " + (rawResponse == null || (_rawResponse$data = rawResponse.data) == null ? void 0 : _rawResponse$data.length), loggerSource);
|
|
3123
|
+
var allowedCoins = (_rawResponse$data2 = rawResponse == null ? void 0 : rawResponse.data) != null ? _rawResponse$data2 : [];
|
|
3124
|
+
// TODO: [feature, critical] add support for extra ID. task_id=7219d65d41c242a292dfa47479b8d63f
|
|
3125
|
+
allowedCoins = allowedCoins.filter(function (c) {
|
|
3126
|
+
return c.hasExtraId !== true && c.hasExtraId !== "true";
|
|
3127
|
+
});
|
|
3128
|
+
Logger.log("Allowed cnt " + allowedCoins.length, loggerSource);
|
|
3129
|
+
_this6._supportedCoins = allowedCoins.map(function (item) {
|
|
3130
|
+
var coin = _this6._customCoinBuilder(item.code, item.network);
|
|
3131
|
+
if (!coin && !_this6.useRestrictedCoinsSet) {
|
|
3132
|
+
/** Building coin object for coin that isn't supported OOB in Rabbit.
|
|
3133
|
+
* We are doing this way to be able to use extended coins set for swaps.
|
|
3134
|
+
* These temporary built coins are only for in-swap use, and we omit some usual
|
|
3135
|
+
* coin details here.
|
|
3136
|
+
* Ideally we should add some new abstractions e.g. BaseCoin:
|
|
3137
|
+
* Coin will extend BaseCoin, SwapCoin will extend BaseCoin etc.
|
|
3138
|
+
* But for now it is reasonable to use this simpler approach.
|
|
3139
|
+
*/
|
|
3140
|
+
var code = item.code.toUpperCase();
|
|
3141
|
+
var network = item.network.toUpperCase();
|
|
3142
|
+
var ticker = "" + code + (code === network ? "" : network);
|
|
3143
|
+
var defaultDecimalPlacesForCoinNotSupportedOOB = 8;
|
|
3144
|
+
var defaultMinConfirmationsForCoinNotSupportedOOB = 1;
|
|
3145
|
+
// TODO: [dev] maybe we should recognize standard protocols?
|
|
3146
|
+
coin = new Coin(item.name, ticker, code, defaultDecimalPlacesForCoinNotSupportedOOB, null, "", null, null, defaultMinConfirmationsForCoinNotSupportedOOB, null, [], 60000, null,
|
|
3147
|
+
// We cannot recognize blockchain from swapspace data
|
|
3148
|
+
code !== network ? new Protocol(network) : null, item.contractAddress || null, false);
|
|
3149
|
+
}
|
|
3150
|
+
if (coin) {
|
|
3151
|
+
var _item$deposit, _item$withdrawal, _item$validationRegex;
|
|
3152
|
+
return {
|
|
3153
|
+
coin: coin,
|
|
3154
|
+
code: item.code,
|
|
3155
|
+
network: item.network,
|
|
3156
|
+
extraId: item.extraIdName,
|
|
3157
|
+
isPopular: !!(item != null && item.popular),
|
|
3158
|
+
iconURL: item.icon ? "https://storage.swapspace.co" + item.icon : FALLBACK_ICON_URL,
|
|
3159
|
+
deposit: (_item$deposit = item.deposit) != null ? _item$deposit : false,
|
|
3160
|
+
withdrawal: (_item$withdrawal = item.withdrawal) != null ? _item$withdrawal : false,
|
|
3161
|
+
validationRegexp: (_item$validationRegex = item.validationRegexp) != null ? _item$validationRegex : null
|
|
3162
|
+
};
|
|
3163
|
+
}
|
|
3164
|
+
return [];
|
|
3165
|
+
}).flat();
|
|
3166
|
+
_this6._putPopularCoinsFirst();
|
|
3167
|
+
});
|
|
3168
|
+
}
|
|
3169
|
+
}();
|
|
3170
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
3171
|
+
}, function (e) {
|
|
3172
|
+
improveAndRethrow(e, loggerSource);
|
|
3173
|
+
}));
|
|
3174
|
+
} catch (e) {
|
|
3175
|
+
return Promise.reject(e);
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
/**
|
|
3179
|
+
* This method sort internal list putting popular (as swapspace thinks) coins to the top.
|
|
3180
|
+
* This is just for users of this API if they don't care about the sorting - we just improve a list a bit this way.
|
|
3181
|
+
* @private
|
|
3182
|
+
*/
|
|
3183
|
+
;
|
|
3184
|
+
_proto._putPopularCoinsFirst = function _putPopularCoinsFirst() {
|
|
3185
|
+
this._supportedCoins.sort(function (i1, i2) {
|
|
3186
|
+
if (i1.isPopular && !i2.isPopular) return -1;
|
|
3187
|
+
if (i2.isPopular && !i1.isPopular) return 1;
|
|
3188
|
+
return i1.coin.ticker > i2.coin.ticker ? 1 : i1.coin.ticker < i2.coin.ticker ? -1 : 0;
|
|
3189
|
+
});
|
|
3190
|
+
};
|
|
3191
|
+
_proto.getCoinToUSDTRate = function getCoinToUSDTRate(coin) {
|
|
3192
|
+
try {
|
|
3193
|
+
var _this7 = this;
|
|
3194
|
+
var loggerSource = "getCoinToUSDTRate";
|
|
3195
|
+
return Promise.resolve(_catch$2(function () {
|
|
3196
|
+
return coin ? Promise.resolve(_this7._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
3197
|
+
var _this7$_supportedCoin;
|
|
3198
|
+
// Using USDT TRC20 as usually fee in this network is smaller than ERC20 and this network is widely used for USDT
|
|
3199
|
+
var usdtTrc20 = (_this7$_supportedCoin = _this7._supportedCoins.find(function (i) {
|
|
3200
|
+
return i.coin.ticker === "USDTTRC20";
|
|
3201
|
+
})) == null ? void 0 : _this7$_supportedCoin.coin;
|
|
3202
|
+
if (!usdtTrc20) {
|
|
3203
|
+
return {
|
|
3204
|
+
result: false
|
|
3205
|
+
};
|
|
3206
|
+
}
|
|
3207
|
+
var cached = _this7._cache.get("swapspace_usdt_rate_" + coin.ticker);
|
|
3208
|
+
if (cached != null) {
|
|
3209
|
+
return {
|
|
3210
|
+
result: true,
|
|
3211
|
+
rate: cached
|
|
3212
|
+
};
|
|
3213
|
+
}
|
|
3214
|
+
Logger.log("Loading USDT->coin rate as not found in cache:", coin == null ? void 0 : coin.ticker);
|
|
3215
|
+
return Promise.resolve(_this7.getSwapInfo(usdtTrc20, coin, "5000")).then(function (result) {
|
|
3216
|
+
if (!result.result) {
|
|
3217
|
+
return {
|
|
3218
|
+
result: false
|
|
3219
|
+
};
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
// This calculation is not precise as we cannot recognize the actual fee and network fee. Just approximate.
|
|
3223
|
+
var standardSwapspaceFeeMultiplier = 1.004; // usually 0.2%
|
|
3224
|
+
var rate = bignumber_js.BigNumber(1).div(bignumber_js.BigNumber(result.rate).times(standardSwapspaceFeeMultiplier)).toString();
|
|
3225
|
+
_this7._cache.put("swapspace_usdt_rate_" + coin.ticker, rate, 15 * 60000 // 15 minutes
|
|
3226
|
+
);
|
|
3227
|
+
return {
|
|
3228
|
+
result: true,
|
|
3229
|
+
rate: rate
|
|
3230
|
+
};
|
|
3231
|
+
});
|
|
3232
|
+
}) : null;
|
|
3233
|
+
}, function (e) {
|
|
3234
|
+
improveAndRethrow(e, loggerSource);
|
|
3235
|
+
}));
|
|
3236
|
+
} catch (e) {
|
|
3237
|
+
return Promise.reject(e);
|
|
3238
|
+
}
|
|
3239
|
+
};
|
|
3240
|
+
_proto.getCoinByTickerIfPresent = function getCoinByTickerIfPresent(ticker) {
|
|
3241
|
+
try {
|
|
3242
|
+
var _item$coin3;
|
|
3243
|
+
var item = this._supportedCoins.find(function (i) {
|
|
3244
|
+
return i.coin.ticker === ticker;
|
|
3245
|
+
});
|
|
3246
|
+
return (_item$coin3 = item == null ? void 0 : item.coin) != null ? _item$coin3 : null;
|
|
3247
|
+
} catch (e) {
|
|
3248
|
+
improveAndRethrow(e, "getCoinByTickerIfPresent");
|
|
3249
|
+
}
|
|
3250
|
+
};
|
|
3251
|
+
_proto.getSwapInfo = function getSwapInfo(fromCoin, toCoin, amountCoins, fromCoinToUsdRate) {
|
|
3252
|
+
if (fromCoinToUsdRate === void 0) {
|
|
3253
|
+
fromCoinToUsdRate = null;
|
|
3254
|
+
}
|
|
3255
|
+
try {
|
|
3256
|
+
var _this8 = this;
|
|
3257
|
+
var loggerSource = "getSwapInfo";
|
|
3258
|
+
return Promise.resolve(_catch$2(function () {
|
|
3259
|
+
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof amountCoins !== "string" || bignumber_js.BigNumber(amountCoins).lt("0")) {
|
|
3260
|
+
throw new Error("Wrong input params: " + amountCoins + " " + fromCoin.ticker + " -> " + toCoin.ticker + (fromCoin instanceof Coin) + (toCoin instanceof Coin));
|
|
3261
|
+
}
|
|
3262
|
+
var fromCoinSwapspaceDetails = _this8._supportedCoins.find(function (i) {
|
|
3263
|
+
var _i$coin;
|
|
3264
|
+
return ((_i$coin = i.coin) == null ? void 0 : _i$coin.ticker) === (fromCoin == null ? void 0 : fromCoin.ticker);
|
|
3265
|
+
});
|
|
3266
|
+
var toCoinSwapspaceDetails = _this8._supportedCoins.find(function (i) {
|
|
3267
|
+
var _i$coin2;
|
|
3268
|
+
return ((_i$coin2 = i.coin) == null ? void 0 : _i$coin2.ticker) === (toCoin == null ? void 0 : toCoin.ticker);
|
|
3269
|
+
});
|
|
3270
|
+
if (!fromCoinSwapspaceDetails || !toCoinSwapspaceDetails) {
|
|
3271
|
+
throw new Error("Failed to find swapspace coin details for: " + fromCoin.ticker + " -> " + toCoin.ticker);
|
|
3272
|
+
}
|
|
3273
|
+
return !fromCoinSwapspaceDetails.deposit || !toCoinSwapspaceDetails.withdrawal ? {
|
|
3274
|
+
result: false,
|
|
3275
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
3276
|
+
} : Promise.resolve(axios__default["default"].get(_this8._URL + "/api/v2/amounts?fromCurrency=" + fromCoinSwapspaceDetails.code + "&fromNetwork=" + fromCoinSwapspaceDetails.network + "&toNetwork=" + toCoinSwapspaceDetails.network + "&toCurrency=" + toCoinSwapspaceDetails.code + "&amount=" + amountCoins + "&float=true&estimated=false")).then(function (response) {
|
|
3277
|
+
var _response$data;
|
|
3278
|
+
Logger.log("Retrieved " + (response == null || (_response$data = response.data) == null ? void 0 : _response$data.length) + " options", loggerSource);
|
|
3279
|
+
var options = Array.isArray(response.data) ? response.data : [];
|
|
3280
|
+
var exchangesSupportingThePair = options.filter(function (exchange) {
|
|
3281
|
+
return (exchange == null ? void 0 : exchange.exists) && !BANNED_PARTNERS.find(function (bannedPartner) {
|
|
3282
|
+
return bannedPartner === (exchange == null ? void 0 : exchange.partner);
|
|
3283
|
+
}) && (exchange == null ? void 0 : exchange.fixed) === false && (exchange.min === 0 || exchange.max === 0 || exchange.max > exchange.min || (typeof exchange.min !== "number" || typeof exchange.max !== "number") && exchange.toAmount > 0);
|
|
3284
|
+
});
|
|
3285
|
+
Logger.log((exchangesSupportingThePair == null ? void 0 : exchangesSupportingThePair.length) + " of them have exist=true", loggerSource);
|
|
3286
|
+
if (!exchangesSupportingThePair.length) {
|
|
3287
|
+
return {
|
|
3288
|
+
result: false,
|
|
3289
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
3290
|
+
};
|
|
3291
|
+
}
|
|
3292
|
+
var availableExchanges = exchangesSupportingThePair.filter(function (exchange) {
|
|
3293
|
+
return typeof (exchange == null ? void 0 : exchange.toAmount) === "number" && exchange.toAmount > 0;
|
|
3294
|
+
});
|
|
3295
|
+
Logger.log("Available (having amountTo): " + safeStringify(availableExchanges), loggerSource);
|
|
3296
|
+
// min=0 or max=0 means there is no limit for the partner
|
|
3297
|
+
var smallestMin = null;
|
|
3298
|
+
if (exchangesSupportingThePair.find(function (ex) {
|
|
3299
|
+
return bignumber_js.BigNumber(ex.min).isZero();
|
|
3300
|
+
}) == null) {
|
|
3301
|
+
smallestMin = exchangesSupportingThePair.reduce(function (prev, cur) {
|
|
3302
|
+
if (typeof cur.min === "number" && (prev === null || bignumber_js.BigNumber(cur.min).lt(prev))) return bignumber_js.BigNumber(cur.min);
|
|
3303
|
+
return prev;
|
|
3304
|
+
}, null);
|
|
3305
|
+
}
|
|
3306
|
+
var greatestMax = null;
|
|
3307
|
+
if (exchangesSupportingThePair.find(function (ex) {
|
|
3308
|
+
return bignumber_js.BigNumber(ex.max).isZero();
|
|
3309
|
+
}) == null) {
|
|
3310
|
+
greatestMax = exchangesSupportingThePair.reduce(function (prev, cur) {
|
|
3311
|
+
if (typeof cur.max === "number" && (prev === null || bignumber_js.BigNumber(cur.max).gt(prev))) return bignumber_js.BigNumber(cur.max);
|
|
3312
|
+
return prev;
|
|
3313
|
+
}, null);
|
|
3314
|
+
}
|
|
3315
|
+
var extraCoinsToFitMinMax = "0";
|
|
3316
|
+
if (typeof fromCoinToUsdRate === "string" && bignumber_js.BigNumber(fromCoinToUsdRate).gt("0")) {
|
|
3317
|
+
var extraUsdToFitMinMax = bignumber_js.BigNumber("1"); // We correct the limits as the exact limit can fluctuate and cause failed swap creation
|
|
3318
|
+
extraCoinsToFitMinMax = AmountUtils.trim(extraUsdToFitMinMax.div(fromCoinToUsdRate), fromCoin.digits);
|
|
3319
|
+
}
|
|
3320
|
+
if (smallestMin instanceof bignumber_js.BigNumber) {
|
|
3321
|
+
smallestMin = AmountUtils.trim(smallestMin.plus(extraCoinsToFitMinMax), fromCoin.digits);
|
|
3322
|
+
}
|
|
3323
|
+
if (greatestMax instanceof bignumber_js.BigNumber) {
|
|
3324
|
+
if (greatestMax > extraCoinsToFitMinMax) {
|
|
3325
|
+
greatestMax = AmountUtils.trim(greatestMax.minus(extraCoinsToFitMinMax), fromCoin.digits);
|
|
3326
|
+
} else {
|
|
3327
|
+
greatestMax = "0";
|
|
3328
|
+
}
|
|
3329
|
+
}
|
|
3330
|
+
if (availableExchanges.length) {
|
|
3331
|
+
var _bestOpt$duration;
|
|
3332
|
+
var sorted = availableExchanges.sort(function (op1, op2) {
|
|
3333
|
+
return op2.toAmount - op1.toAmount;
|
|
3334
|
+
});
|
|
3335
|
+
var bestOpt = sorted[0];
|
|
3336
|
+
Logger.log("Returning first option after sorting: " + safeStringify(bestOpt), loggerSource);
|
|
3337
|
+
var max = null;
|
|
3338
|
+
var min = null;
|
|
3339
|
+
if (extraCoinsToFitMinMax != null) {
|
|
3340
|
+
if (typeof bestOpt.max === "number" && bestOpt.max !== 0) {
|
|
3341
|
+
max = bignumber_js.BigNumber(bestOpt.max).minus(extraCoinsToFitMinMax);
|
|
3342
|
+
max = AmountUtils.trim(max.lt(0) ? "0" : max, fromCoin.digits);
|
|
3343
|
+
}
|
|
3344
|
+
if (typeof bestOpt.min === "number" && bestOpt.min !== 0) {
|
|
3345
|
+
min = AmountUtils.trim(bignumber_js.BigNumber(bestOpt.min).plus(extraCoinsToFitMinMax), fromCoin.digits);
|
|
3346
|
+
}
|
|
3347
|
+
}
|
|
3348
|
+
var rate = bestOpt.toAmount && bestOpt.fromAmount ? bignumber_js.BigNumber(bestOpt.toAmount).div(bestOpt.fromAmount) : null;
|
|
3349
|
+
return {
|
|
3350
|
+
result: true,
|
|
3351
|
+
min: min,
|
|
3352
|
+
max: max,
|
|
3353
|
+
smallestMin: smallestMin,
|
|
3354
|
+
greatestMax: greatestMax,
|
|
3355
|
+
rate: rate != null ? AmountUtils.trim(rate, _this8._maxRateDigits) : null,
|
|
3356
|
+
durationMinutesRange: (_bestOpt$duration = bestOpt.duration) != null ? _bestOpt$duration : null,
|
|
3357
|
+
rawSwapData: bestOpt
|
|
3358
|
+
};
|
|
3359
|
+
}
|
|
3360
|
+
var result = {
|
|
3361
|
+
result: false,
|
|
3362
|
+
reason: smallestMin && bignumber_js.BigNumber(amountCoins).lt(smallestMin) ? SwapProvider.NO_SWAPS_REASONS.TOO_LOW : greatestMax && bignumber_js.BigNumber(amountCoins).gt(greatestMax) ? SwapProvider.NO_SWAPS_REASONS.TOO_HIGH : SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED,
|
|
3363
|
+
smallestMin: smallestMin,
|
|
3364
|
+
greatestMax: greatestMax
|
|
3365
|
+
};
|
|
3366
|
+
Logger.log("Returning result " + safeStringify(result), loggerSource);
|
|
3367
|
+
return result;
|
|
3368
|
+
});
|
|
3369
|
+
}, function (e) {
|
|
3370
|
+
var _e$response4;
|
|
3371
|
+
if ((e == null || (_e$response4 = e.response) == null ? void 0 : _e$response4.status) === 429) {
|
|
3372
|
+
return {
|
|
3373
|
+
result: false,
|
|
3374
|
+
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3375
|
+
};
|
|
3376
|
+
}
|
|
3377
|
+
Logger.log("Internal swapspace/rabbit error when getting swap options " + safeStringify(e), loggerSource);
|
|
3378
|
+
improveAndRethrow(e, loggerSource);
|
|
3379
|
+
}));
|
|
3380
|
+
} catch (e) {
|
|
3381
|
+
return Promise.reject(e);
|
|
3382
|
+
}
|
|
3383
|
+
};
|
|
3384
|
+
_proto.createSwap = function createSwap(fromCoin, toCoin, amount, toAddress, refundAddress, rawSwapData, clientIpAddress) {
|
|
3385
|
+
try {
|
|
3386
|
+
var _this9 = this;
|
|
3387
|
+
var loggerSource = "createSwap";
|
|
3388
|
+
var partner = rawSwapData == null ? void 0 : rawSwapData.partner;
|
|
3389
|
+
return Promise.resolve(_catch$2(function () {
|
|
3390
|
+
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof amount !== "string" || typeof toAddress !== "string" || typeof refundAddress !== "string") {
|
|
3391
|
+
throw new Error("Invalid input: " + fromCoin + " " + toCoin + " " + amount + " " + toAddress + " " + refundAddress);
|
|
3392
|
+
}
|
|
3393
|
+
if (typeof partner !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.fromCurrency) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.fromNetwork) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.toCurrency) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.toNetwork) !== "string" || typeof (rawSwapData == null ? void 0 : rawSwapData.id) !== "string" // can be just empty
|
|
3394
|
+
) {
|
|
3395
|
+
throw new Error("Invalid raw swap data: " + safeStringify(rawSwapData));
|
|
3396
|
+
}
|
|
3397
|
+
return Promise.resolve(_this9._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
3398
|
+
var _this9$_supportedCoin, _this9$_supportedCoin2;
|
|
3399
|
+
var toCurrencyExtraId = (_this9$_supportedCoin = (_this9$_supportedCoin2 = _this9._supportedCoins.find(function (item) {
|
|
3400
|
+
var _item$coin4;
|
|
3401
|
+
return ((_item$coin4 = item.coin) == null ? void 0 : _item$coin4.ticker) === (toCoin == null ? void 0 : toCoin.ticker);
|
|
3402
|
+
})) == null ? void 0 : _this9$_supportedCoin2.extraId) != null ? _this9$_supportedCoin : "";
|
|
3403
|
+
var requestData = {
|
|
3404
|
+
partner: partner,
|
|
3405
|
+
fromCurrency: rawSwapData == null ? void 0 : rawSwapData.fromCurrency,
|
|
3406
|
+
fromNetwork: rawSwapData == null ? void 0 : rawSwapData.fromNetwork,
|
|
3407
|
+
toCurrency: rawSwapData == null ? void 0 : rawSwapData.toCurrency,
|
|
3408
|
+
toNetwork: rawSwapData == null ? void 0 : rawSwapData.toNetwork,
|
|
3409
|
+
address: toAddress,
|
|
3410
|
+
amount: amount,
|
|
3411
|
+
fixed: false,
|
|
3412
|
+
extraId: toCurrencyExtraId != null ? toCurrencyExtraId : "",
|
|
3413
|
+
rateId: rawSwapData == null ? void 0 : rawSwapData.id,
|
|
3414
|
+
userIp: clientIpAddress,
|
|
3415
|
+
refund: refundAddress
|
|
3416
|
+
};
|
|
3417
|
+
Logger.log("Sending create request: " + safeStringify(requestData), loggerSource);
|
|
3418
|
+
return Promise.resolve(axios__default["default"].post(_this9._URL + "/api/v2/exchange", requestData)).then(function (response) {
|
|
3419
|
+
var result = response.data;
|
|
3420
|
+
Logger.log("Creation result " + safeStringify(result), loggerSource);
|
|
3421
|
+
if (result != null && result.id) {
|
|
3422
|
+
var _result$from, _result$from2, _result$to, _result$to2, _result$from4, _result$from5, _result$to4, _result$to5;
|
|
3423
|
+
if (typeof (result == null || (_result$from = result.from) == null ? void 0 : _result$from.amount) !== "number" || typeof (result == null || (_result$from2 = result.from) == null ? void 0 : _result$from2.address) !== "string" || typeof (result == null || (_result$to = result.to) == null ? void 0 : _result$to.amount) !== "number" || typeof (result == null || (_result$to2 = result.to) == null ? void 0 : _result$to2.address) !== "string") throw new Error("Wrong swap creation result " + result);
|
|
3424
|
+
/* We use the returned rate preferably but if the retrieved
|
|
3425
|
+
* rate 0/null/undefined we calculate it manually */
|
|
3426
|
+
var rate = result.rate;
|
|
3427
|
+
if (typeof rate !== "number" || bignumber_js.BigNumber(rate).isZero()) {
|
|
3428
|
+
var _result$to3, _result$from3;
|
|
3429
|
+
rate = bignumber_js.BigNumber(result == null || (_result$to3 = result.to) == null ? void 0 : _result$to3.amount).div(result == null || (_result$from3 = result.from) == null ? void 0 : _result$from3.amount);
|
|
3430
|
+
} else {
|
|
3431
|
+
rate = bignumber_js.BigNumber(rate);
|
|
3432
|
+
}
|
|
3433
|
+
return {
|
|
3434
|
+
result: true,
|
|
3435
|
+
swapId: result == null ? void 0 : result.id,
|
|
3436
|
+
fromCoin: fromCoin,
|
|
3437
|
+
fromAmount: AmountUtils.trim(result == null || (_result$from4 = result.from) == null ? void 0 : _result$from4.amount, fromCoin.digits),
|
|
3438
|
+
fromAddress: result == null || (_result$from5 = result.from) == null ? void 0 : _result$from5.address,
|
|
3439
|
+
toCoin: toCoin,
|
|
3440
|
+
toAmount: AmountUtils.trim(result == null || (_result$to4 = result.to) == null ? void 0 : _result$to4.amount, toCoin.digits),
|
|
3441
|
+
toAddress: result == null || (_result$to5 = result.to) == null ? void 0 : _result$to5.address,
|
|
3442
|
+
rate: AmountUtils.trim(rate, _this9._maxRateDigits)
|
|
3443
|
+
};
|
|
3444
|
+
}
|
|
3445
|
+
var errorMessage = "Swap creation succeeded but the response is wrong: " + safeStringify(response);
|
|
3446
|
+
Logger.log(errorMessage, loggerSource);
|
|
3447
|
+
throw new Error(errorMessage);
|
|
3448
|
+
});
|
|
3449
|
+
});
|
|
3450
|
+
}, function (e) {
|
|
3451
|
+
var _e$response5, _e$response6;
|
|
3452
|
+
Logger.logError(e, loggerSource, "Failed to create swap. Error is: " + safeStringify(e));
|
|
3453
|
+
var composeFailResult = function composeFailResult(reason) {
|
|
3454
|
+
return {
|
|
3455
|
+
result: false,
|
|
3456
|
+
reason: reason,
|
|
3457
|
+
partner: partner
|
|
3458
|
+
};
|
|
3459
|
+
};
|
|
3460
|
+
var status = e == null || (_e$response5 = e.response) == null ? void 0 : _e$response5.status;
|
|
3461
|
+
var data = e == null || (_e$response6 = e.response) == null ? void 0 : _e$response6.data;
|
|
3462
|
+
if (status === 429) {
|
|
3463
|
+
Logger.log("Returning fail - RPS limit exceeded " + data, loggerSource);
|
|
3464
|
+
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
3465
|
+
}
|
|
3466
|
+
var texts422 = ["Pair cannot be processed by", "Currency not found", "Amount maximum is", "Amount minimum is"];
|
|
3467
|
+
var text403 = "IP address is forbidden";
|
|
3468
|
+
if (typeof data === "string" && (status === 403 && data.includes(text403) || status === 422 && texts422.find(function (text) {
|
|
3469
|
+
return data.includes(text);
|
|
3470
|
+
}))) {
|
|
3471
|
+
Logger.log("Returning retriable fail: " + status + " - " + data + ", " + partner, loggerSource);
|
|
3472
|
+
return composeFailResult(SwapProvider.CREATION_FAIL_REASONS.RETRIABLE_FAIL);
|
|
3473
|
+
}
|
|
3474
|
+
Logger.log("Internal swapspace/rabbit error for " + partner + ": " + safeStringify(e), loggerSource);
|
|
3475
|
+
improveAndRethrow(e, loggerSource);
|
|
3476
|
+
}));
|
|
3477
|
+
} catch (e) {
|
|
3478
|
+
return Promise.reject(e);
|
|
3479
|
+
}
|
|
3480
|
+
};
|
|
3481
|
+
_proto._mapSwapspaceStatusToRabbitStatus = function _mapSwapspaceStatusToRabbitStatus(status, isExpiredByTime) {
|
|
3482
|
+
switch (status) {
|
|
3483
|
+
case "waiting":
|
|
3484
|
+
if (isExpiredByTime) {
|
|
3485
|
+
return SwapProvider.SWAP_STATUSES.EXPIRED;
|
|
3486
|
+
}
|
|
3487
|
+
return SwapProvider.SWAP_STATUSES.WAITING_FOR_PAYMENT;
|
|
3488
|
+
case "confirming":
|
|
3489
|
+
return SwapProvider.SWAP_STATUSES.CONFIRMING;
|
|
3490
|
+
case "exchanging":
|
|
3491
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
3492
|
+
case "sending":
|
|
3493
|
+
return SwapProvider.SWAP_STATUSES.PAYMENT_RECEIVED;
|
|
3494
|
+
case "finished":
|
|
3495
|
+
return SwapProvider.SWAP_STATUSES.COMPLETED;
|
|
3496
|
+
case "verifying":
|
|
3497
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
3498
|
+
case "refunded":
|
|
3499
|
+
return SwapProvider.SWAP_STATUSES.REFUNDED;
|
|
3500
|
+
case "expired":
|
|
3501
|
+
return SwapProvider.SWAP_STATUSES.EXPIRED;
|
|
3502
|
+
case "failed":
|
|
3503
|
+
return SwapProvider.SWAP_STATUSES.FAILED;
|
|
3504
|
+
default:
|
|
3505
|
+
throw new Error("Unknown swapspace status: " + status);
|
|
3506
|
+
}
|
|
3507
|
+
};
|
|
3508
|
+
_proto.getExistingSwapsDetailsAndStatus = function getExistingSwapsDetailsAndStatus(swapIds) {
|
|
3509
|
+
try {
|
|
3510
|
+
var _this10 = this;
|
|
3511
|
+
var loggerSource = "getExistingSwapsDetailsAndStatus";
|
|
3512
|
+
return Promise.resolve(_catch$2(function () {
|
|
3513
|
+
if (swapIds.find(function (id) {
|
|
3514
|
+
return typeof id !== "string";
|
|
3515
|
+
})) {
|
|
3516
|
+
throw new Error("Swap id is not string: " + safeStringify(swapIds));
|
|
3517
|
+
}
|
|
3518
|
+
var getNotFailingOn404 = function getNotFailingOn404(swapId) {
|
|
3519
|
+
try {
|
|
3520
|
+
return Promise.resolve(_catch$2(function () {
|
|
3521
|
+
return Promise.resolve(axios__default["default"].get(_this10._URL + "/api/v2/exchange/" + swapId));
|
|
3522
|
+
}, function (error) {
|
|
3523
|
+
var _error$response;
|
|
3524
|
+
if ((error == null || (_error$response = error.response) == null ? void 0 : _error$response.status) === 404) return [];
|
|
3525
|
+
throw error;
|
|
3526
|
+
}));
|
|
3527
|
+
} catch (e) {
|
|
3528
|
+
return Promise.reject(e);
|
|
3529
|
+
}
|
|
3530
|
+
};
|
|
3531
|
+
return Promise.resolve(Promise.all(swapIds.map(function (swapId) {
|
|
3532
|
+
return getNotFailingOn404(swapId);
|
|
3533
|
+
}))).then(function (responses) {
|
|
3534
|
+
var wo404 = responses.flat();
|
|
3535
|
+
Logger.log("All swaps RAW: " + JSON.stringify(wo404.map(function (r) {
|
|
3536
|
+
return r.data;
|
|
3537
|
+
})), loggerSource);
|
|
3538
|
+
var swaps = wo404.map(function (r) {
|
|
3539
|
+
return r.data;
|
|
3540
|
+
}).map(function (swap, index) {
|
|
3541
|
+
var _this10$_supportedCoi, _this10$_supportedCoi2;
|
|
3542
|
+
var fromCoin = (_this10$_supportedCoi = _this10._supportedCoins.find(function (i) {
|
|
3543
|
+
return i.code === swap.from.code && i.network === swap.from.network;
|
|
3544
|
+
})) == null ? void 0 : _this10$_supportedCoi.coin;
|
|
3545
|
+
var toCoin = (_this10$_supportedCoi2 = _this10._supportedCoins.find(function (i) {
|
|
3546
|
+
return i.code === swap.to.code && i.network === swap.to.network;
|
|
3547
|
+
})) == null ? void 0 : _this10$_supportedCoi2.coin;
|
|
3548
|
+
if (!fromCoin || !toCoin) {
|
|
3549
|
+
return []; // We skip swaps with not supported coins for now
|
|
3550
|
+
}
|
|
3551
|
+
var toUtcTimestamp = function toUtcTimestamp(timeStr) {
|
|
3552
|
+
return Date.parse(timeStr.match(/.+[Zz]$/) ? timeStr : timeStr + "Z");
|
|
3553
|
+
};
|
|
3554
|
+
var expiresAt = toUtcTimestamp(swap.timestamps.expiresAt);
|
|
3555
|
+
var isExpiredByTime = expiresAt < Date.now();
|
|
3556
|
+
var status = _this10._mapSwapspaceStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
3557
|
+
var toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
3558
|
+
var addressToSendCoinsToSwapspace = swap.from.address;
|
|
3559
|
+
return new ExistingSwap(swapIds[index], status, toUtcTimestamp(swap.timestamps.createdAt), expiresAt, swap.confirmations, AmountUtils.trim(swap.rate, _this10._maxRateDigits), swap.refundAddress, addressToSendCoinsToSwapspace, fromCoin, AmountUtils.trim(swap.from.amount, fromCoin.digits), swap.from.transactionHash, swap.blockExplorerTransactionUrl.from, toCoin, AmountUtils.trim(swap.to.amount, toDigits), swap.to.transactionHash, swap.blockExplorerTransactionUrl.to, swap.to.address, swap.partner);
|
|
3560
|
+
}).flat();
|
|
3561
|
+
Logger.log("Swap details result " + safeStringify(swaps), loggerSource);
|
|
3562
|
+
return {
|
|
3563
|
+
result: true,
|
|
3564
|
+
swaps: swaps
|
|
3565
|
+
};
|
|
3566
|
+
});
|
|
3567
|
+
}, function (e) {
|
|
3568
|
+
var _e$response7, _e$response8;
|
|
3569
|
+
Logger.logError(e, loggerSource, "Failed to get swap details. Error is: " + safeStringify(e));
|
|
3570
|
+
var composeFailResult = function composeFailResult(reason) {
|
|
3571
|
+
return {
|
|
3572
|
+
result: false,
|
|
3573
|
+
reason: reason
|
|
3574
|
+
};
|
|
3575
|
+
};
|
|
3576
|
+
var status = e == null || (_e$response7 = e.response) == null ? void 0 : _e$response7.status;
|
|
3577
|
+
var data = e == null || (_e$response8 = e.response) == null ? void 0 : _e$response8.data;
|
|
3578
|
+
if (status === 429) {
|
|
3579
|
+
Logger.log("Returning fail - RPS limit exceeded " + data, loggerSource);
|
|
3580
|
+
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
3581
|
+
}
|
|
3582
|
+
improveAndRethrow(e, loggerSource);
|
|
3583
|
+
}));
|
|
3584
|
+
} catch (e) {
|
|
3585
|
+
return Promise.reject(e);
|
|
3586
|
+
}
|
|
3587
|
+
};
|
|
3588
|
+
_proto.isAddressValidForAsset = function isAddressValidForAsset(asset, address) {
|
|
3589
|
+
try {
|
|
3590
|
+
var assetData = this._supportedCoins.find(function (i) {
|
|
3591
|
+
var _i$coin3;
|
|
3592
|
+
return ((_i$coin3 = i.coin) == null ? void 0 : _i$coin3.ticker) === (asset == null ? void 0 : asset.ticker);
|
|
3593
|
+
});
|
|
3594
|
+
if (assetData) {
|
|
3595
|
+
var corrected = assetData.validationRegexp.trim();
|
|
3596
|
+
corrected = corrected[0] === "/" ? corrected.slice(1) : corrected;
|
|
3597
|
+
corrected = corrected[corrected.length - 1] === "/" ? corrected.slice(0, corrected.length - 1) : corrected;
|
|
3598
|
+
return address.match(corrected) != null;
|
|
3599
|
+
}
|
|
3600
|
+
} catch (e) {
|
|
3601
|
+
Logger.logError(e, "isAddressValidForAsset");
|
|
3602
|
+
}
|
|
3603
|
+
return false;
|
|
3604
|
+
};
|
|
3605
|
+
return SwapspaceSwapProvider;
|
|
3606
|
+
}(SwapProvider);
|
|
3607
|
+
|
|
3608
|
+
function _catch$1(body, recover) {
|
|
3609
|
+
try {
|
|
3610
|
+
var result = body();
|
|
3611
|
+
} catch (e) {
|
|
3612
|
+
return recover(e);
|
|
3613
|
+
}
|
|
3614
|
+
if (result && result.then) {
|
|
3615
|
+
return result.then(void 0, recover);
|
|
3616
|
+
}
|
|
3617
|
+
return result;
|
|
3618
|
+
}
|
|
3619
|
+
var _iteratorSymbol = typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
3620
|
+
function _settle(pact, state, value) {
|
|
3621
|
+
if (!pact.s) {
|
|
3622
|
+
if (value instanceof _Pact) {
|
|
3623
|
+
if (value.s) {
|
|
3624
|
+
if (state & 1) {
|
|
3625
|
+
state = value.s;
|
|
3626
|
+
}
|
|
3627
|
+
value = value.v;
|
|
3628
|
+
} else {
|
|
3629
|
+
value.o = _settle.bind(null, pact, state);
|
|
3630
|
+
return;
|
|
3631
|
+
}
|
|
3632
|
+
}
|
|
3633
|
+
if (value && value.then) {
|
|
3634
|
+
value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
|
|
3635
|
+
return;
|
|
3636
|
+
}
|
|
3637
|
+
pact.s = state;
|
|
3638
|
+
pact.v = value;
|
|
3639
|
+
var observer = pact.o;
|
|
3640
|
+
if (observer) {
|
|
3641
|
+
observer(pact);
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
var _Pact = /*#__PURE__*/function () {
|
|
3646
|
+
function _Pact() {}
|
|
3647
|
+
_Pact.prototype.then = function (onFulfilled, onRejected) {
|
|
3648
|
+
var result = new _Pact();
|
|
3649
|
+
var state = this.s;
|
|
3650
|
+
if (state) {
|
|
3651
|
+
var callback = state & 1 ? onFulfilled : onRejected;
|
|
3652
|
+
if (callback) {
|
|
3653
|
+
try {
|
|
3654
|
+
_settle(result, 1, callback(this.v));
|
|
3655
|
+
} catch (e) {
|
|
3656
|
+
_settle(result, 2, e);
|
|
3657
|
+
}
|
|
3658
|
+
return result;
|
|
3659
|
+
} else {
|
|
3660
|
+
return this;
|
|
3661
|
+
}
|
|
3662
|
+
}
|
|
3663
|
+
this.o = function (_this) {
|
|
3664
|
+
try {
|
|
3665
|
+
var value = _this.v;
|
|
3666
|
+
if (_this.s & 1) {
|
|
3667
|
+
_settle(result, 1, onFulfilled ? onFulfilled(value) : value);
|
|
3668
|
+
} else if (onRejected) {
|
|
3669
|
+
_settle(result, 1, onRejected(value));
|
|
3670
|
+
} else {
|
|
3671
|
+
_settle(result, 2, value);
|
|
3672
|
+
}
|
|
3673
|
+
} catch (e) {
|
|
3674
|
+
_settle(result, 2, e);
|
|
3675
|
+
}
|
|
3676
|
+
};
|
|
3677
|
+
return result;
|
|
3678
|
+
};
|
|
3679
|
+
return _Pact;
|
|
3680
|
+
}();
|
|
3681
|
+
function _isSettledPact(thenable) {
|
|
3682
|
+
return thenable instanceof _Pact && thenable.s & 1;
|
|
3683
|
+
}
|
|
3684
|
+
function _forTo(array, body, check) {
|
|
3685
|
+
var i = -1,
|
|
3686
|
+
pact,
|
|
3687
|
+
reject;
|
|
3688
|
+
function _cycle(result) {
|
|
3689
|
+
try {
|
|
3690
|
+
while (++i < array.length && (!check || !check())) {
|
|
3691
|
+
result = body(i);
|
|
3692
|
+
if (result && result.then) {
|
|
3693
|
+
if (_isSettledPact(result)) {
|
|
3694
|
+
result = result.v;
|
|
3695
|
+
} else {
|
|
3696
|
+
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
|
3697
|
+
return;
|
|
3698
|
+
}
|
|
3699
|
+
}
|
|
3700
|
+
}
|
|
3701
|
+
if (pact) {
|
|
3702
|
+
_settle(pact, 1, result);
|
|
3703
|
+
} else {
|
|
3704
|
+
pact = result;
|
|
3705
|
+
}
|
|
3706
|
+
} catch (e) {
|
|
3707
|
+
_settle(pact || (pact = new _Pact()), 2, e);
|
|
3708
|
+
}
|
|
3709
|
+
}
|
|
3710
|
+
_cycle();
|
|
3711
|
+
return pact;
|
|
3712
|
+
}
|
|
3713
|
+
function _forOf(target, body, check) {
|
|
3714
|
+
if (typeof target[_iteratorSymbol] === "function") {
|
|
3715
|
+
var _cycle = function _cycle(result) {
|
|
3716
|
+
try {
|
|
3717
|
+
while (!(step = iterator.next()).done && (!check || !check())) {
|
|
3718
|
+
result = body(step.value);
|
|
3719
|
+
if (result && result.then) {
|
|
3720
|
+
if (_isSettledPact(result)) {
|
|
3721
|
+
result = result.v;
|
|
3722
|
+
} else {
|
|
3723
|
+
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
|
3724
|
+
return;
|
|
3725
|
+
}
|
|
3726
|
+
}
|
|
3727
|
+
}
|
|
3728
|
+
if (pact) {
|
|
3729
|
+
_settle(pact, 1, result);
|
|
3730
|
+
} else {
|
|
3731
|
+
pact = result;
|
|
3732
|
+
}
|
|
3733
|
+
} catch (e) {
|
|
3734
|
+
_settle(pact || (pact = new _Pact()), 2, e);
|
|
3735
|
+
}
|
|
3736
|
+
};
|
|
3737
|
+
var iterator = target[_iteratorSymbol](),
|
|
3738
|
+
step,
|
|
3739
|
+
pact,
|
|
3740
|
+
reject;
|
|
3741
|
+
_cycle();
|
|
3742
|
+
if (iterator["return"]) {
|
|
3743
|
+
var _fixup = function _fixup(value) {
|
|
3744
|
+
try {
|
|
3745
|
+
if (!step.done) {
|
|
3746
|
+
iterator["return"]();
|
|
3747
|
+
}
|
|
3748
|
+
} catch (e) {}
|
|
3749
|
+
return value;
|
|
3750
|
+
};
|
|
3751
|
+
if (pact && pact.then) {
|
|
3752
|
+
return pact.then(_fixup, function (e) {
|
|
3753
|
+
throw _fixup(e);
|
|
3754
|
+
});
|
|
3755
|
+
}
|
|
3756
|
+
_fixup();
|
|
3757
|
+
}
|
|
3758
|
+
return pact;
|
|
3759
|
+
}
|
|
3760
|
+
// No support for Symbol.iterator
|
|
3761
|
+
if (!("length" in target)) {
|
|
3762
|
+
throw new TypeError("Object is not iterable");
|
|
3763
|
+
}
|
|
3764
|
+
// Handle live collections properly
|
|
3765
|
+
var values = [];
|
|
3766
|
+
for (var i = 0; i < target.length; i++) {
|
|
3767
|
+
values.push(target[i]);
|
|
3768
|
+
}
|
|
3769
|
+
return _forTo(values, function (i) {
|
|
3770
|
+
return body(values[i]);
|
|
3771
|
+
}, check);
|
|
3772
|
+
}
|
|
3773
|
+
var SwapUtils = /*#__PURE__*/function () {
|
|
3774
|
+
function SwapUtils() {}
|
|
3775
|
+
/**
|
|
3776
|
+
* Retrieves min and max limits for swapping giving currencies.
|
|
3777
|
+
* Returns also conversion rate if possible with predefined amount logic.
|
|
3778
|
+
* Rate is how many "to" coins does 1 "from" coin contain.
|
|
3779
|
+
*
|
|
3780
|
+
* In case of errors returns one of reasons
|
|
3781
|
+
* - SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
3782
|
+
* - one of SwapProvider.COMMON_ERRORS.*
|
|
3783
|
+
*
|
|
3784
|
+
* @param swapProvider {SwapProvider}
|
|
3785
|
+
* @param fromCoin {Coin} enabled coin (to swap amount from)
|
|
3786
|
+
* @param toCoin {Coin}
|
|
3787
|
+
* @param coinToCurrentFiatRate {string|null}
|
|
3788
|
+
* @param fiatCurrencyDecimals {number|null}
|
|
3789
|
+
* @return {Promise<{
|
|
3790
|
+
* result: true,
|
|
3791
|
+
* min: string,
|
|
3792
|
+
* fiatMin: (number|null),
|
|
3793
|
+
* max: string,
|
|
3794
|
+
* fiatMax: (number|null),
|
|
3795
|
+
* rate: (string|null),
|
|
3796
|
+
* }|{
|
|
3797
|
+
* result: false,
|
|
3798
|
+
* reason: string
|
|
3799
|
+
* }>}
|
|
3800
|
+
*/
|
|
3801
|
+
SwapUtils.getInitialSwapData = function getInitialSwapData(swapProvider, fromCoin, toCoin, coinToCurrentFiatRate, fiatCurrencyDecimals) {
|
|
3802
|
+
if (coinToCurrentFiatRate === void 0) {
|
|
3803
|
+
coinToCurrentFiatRate = null;
|
|
3804
|
+
}
|
|
3805
|
+
if (fiatCurrencyDecimals === void 0) {
|
|
3806
|
+
fiatCurrencyDecimals = null;
|
|
3807
|
+
}
|
|
3808
|
+
try {
|
|
3809
|
+
var loggerSource = "getInitialSwapData";
|
|
3810
|
+
return Promise.resolve(_catch$1(function () {
|
|
3811
|
+
/* We use some amount here that should fit at least some of the limits of the swap providers.
|
|
3812
|
+
* So we are going to get some rate to be used as the default for the on-flight calculations before we get
|
|
3813
|
+
* the exact rate (that should be retrieved by getSwapCreationInfo method) for a specific amount.
|
|
3814
|
+
*/
|
|
3815
|
+
var defaultAmountUsd = bignumber_js.BigNumber("300");
|
|
3816
|
+
return Promise.resolve(swapProvider.getCoinToUSDTRate(fromCoin)).then(function (coinUsdRate) {
|
|
3817
|
+
var coinAmountForDefaultUsdAmount = AmountUtils.trim(coinUsdRate.result ? defaultAmountUsd.div(coinUsdRate == null ? void 0 : coinUsdRate.rate) : defaultAmountUsd, fromCoin.digits);
|
|
3818
|
+
Logger.log("Init: " + coinAmountForDefaultUsdAmount + " " + fromCoin.ticker + "->" + toCoin.ticker, loggerSource);
|
|
3819
|
+
return Promise.resolve(swapProvider.getSwapInfo(fromCoin, toCoin, coinAmountForDefaultUsdAmount)).then(function (details) {
|
|
3820
|
+
var _coinToCurrentFiatRat, _fiatCurrencyDecimals;
|
|
3821
|
+
if (!details) {
|
|
3822
|
+
throw new Error("The details are empty: " + safeStringify(details));
|
|
3823
|
+
}
|
|
3824
|
+
if (!details.result) {
|
|
3825
|
+
Logger.log("Failed with reason: " + details.reason + ". " + fromCoin.ticker + "->" + toCoin.ticker, loggerSource);
|
|
3826
|
+
if ((details == null ? void 0 : details.reason) === SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED || (details == null ? void 0 : details.reason) === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
3827
|
+
return {
|
|
3828
|
+
result: false,
|
|
3829
|
+
reason: details.reason
|
|
3830
|
+
};
|
|
3831
|
+
} else {
|
|
3832
|
+
throw new Error("Unhandled error case: " + (details == null ? void 0 : details.reason));
|
|
3833
|
+
}
|
|
3834
|
+
}
|
|
3835
|
+
var fiatMin = null;
|
|
3836
|
+
var fiatMax = null;
|
|
3837
|
+
var fiatRate = (_coinToCurrentFiatRat = coinToCurrentFiatRate) != null ? _coinToCurrentFiatRat : coinUsdRate == null ? void 0 : coinUsdRate.rate;
|
|
3838
|
+
var fiatDecimals = (_fiatCurrencyDecimals = fiatCurrencyDecimals) != null ? _fiatCurrencyDecimals : FiatCurrenciesService.getCurrencyDecimalCountByCode("USD");
|
|
3839
|
+
if (fiatRate != null) {
|
|
3840
|
+
fiatMin = bignumber_js.BigNumber(details == null ? void 0 : details.smallestMin).times(fiatRate).toFixed(fiatDecimals);
|
|
3841
|
+
fiatMax = bignumber_js.BigNumber(details == null ? void 0 : details.greatestMax).times(fiatRate).toFixed(fiatDecimals);
|
|
3842
|
+
}
|
|
3843
|
+
var result = {
|
|
3844
|
+
result: true,
|
|
3845
|
+
min: details == null ? void 0 : details.smallestMin,
|
|
3846
|
+
fiatMin: fiatMin,
|
|
3847
|
+
max: details == null ? void 0 : details.greatestMax,
|
|
3848
|
+
fiatMax: fiatMax,
|
|
3849
|
+
rate: AmountUtils.trim(details.rate, 30)
|
|
3850
|
+
};
|
|
3851
|
+
Logger.log("Returning: " + safeStringify(result), loggerSource);
|
|
3852
|
+
return result;
|
|
3853
|
+
});
|
|
3854
|
+
});
|
|
3855
|
+
}, function (e) {
|
|
3856
|
+
Logger.logError(e, loggerSource, "Failed to init swap: " + safeStringify(e));
|
|
3857
|
+
improveAndRethrow(e, loggerSource);
|
|
3858
|
+
}));
|
|
3859
|
+
} catch (e) {
|
|
3860
|
+
return Promise.reject(e);
|
|
3861
|
+
}
|
|
3862
|
+
};
|
|
3863
|
+
SwapUtils.safeHandleRequestsLimitExceeding = function safeHandleRequestsLimitExceeding() {
|
|
3864
|
+
(function () {
|
|
3865
|
+
try {
|
|
3866
|
+
var _temp = _catch$1(function () {
|
|
3867
|
+
return Promise.resolve(EmailsApi.sendEmail("AUTOMATIC EMAIL - SWAPSPACE REQUESTS LIMIT EXCEEDED", "Requests limit exceeded. Urgently ask swaps provider support for limit increasing")).then(function () {});
|
|
3868
|
+
}, function (e) {
|
|
3869
|
+
Logger.log("Failed to handle limit exceeding " + safeStringify(e), "_safeHandleRequestsLimitExceeding");
|
|
3870
|
+
});
|
|
3871
|
+
return _temp && _temp.then ? _temp.then(function () {}) : void 0;
|
|
3872
|
+
} catch (e) {
|
|
3873
|
+
Promise.reject(e);
|
|
3874
|
+
}
|
|
3875
|
+
})();
|
|
3876
|
+
}
|
|
3877
|
+
|
|
3878
|
+
/**
|
|
3879
|
+
* If some swap is not found by id then there is no item in return list.
|
|
3880
|
+
*
|
|
3881
|
+
* @param swapProvider {SwapProvider}
|
|
3882
|
+
* @param swapIds {string[]}
|
|
3883
|
+
* @return {Promise<{
|
|
3884
|
+
* result: true,
|
|
3885
|
+
* swaps: ExistingSwapWithFiatData[]
|
|
3886
|
+
* }|{
|
|
3887
|
+
* result: false,
|
|
3888
|
+
* reason: string
|
|
3889
|
+
* }>}
|
|
3890
|
+
*/;
|
|
3891
|
+
SwapUtils.getExistingSwapsDetailsWithFiatAmounts = function getExistingSwapsDetailsWithFiatAmounts(swapProvider, swapIds) {
|
|
3892
|
+
try {
|
|
3893
|
+
return Promise.resolve(_catch$1(function () {
|
|
3894
|
+
return Promise.resolve(swapProvider.getExistingSwapsDetailsAndStatus(swapIds)).then(function (result) {
|
|
3895
|
+
var _temp5 = function () {
|
|
3896
|
+
if (result.result) {
|
|
3897
|
+
var _temp4 = function _temp4() {
|
|
3898
|
+
result.swaps = _extendedSwaps;
|
|
3899
|
+
};
|
|
3900
|
+
var _extendedSwaps = [];
|
|
3901
|
+
var _temp3 = _forOf(result.swaps, function (swap) {
|
|
3902
|
+
var _temp2 = function () {
|
|
3903
|
+
if (swap.status === SwapProvider.SWAP_STATUSES.REFUNDED) {
|
|
3904
|
+
return Promise.resolve(swapProvider.getCoinToUSDTRate(swap.fromCoin)).then(function (rate) {
|
|
3905
|
+
_extendedSwaps.push(ExistingSwapWithFiatData.fromExistingSwap(swap, (rate == null ? void 0 : rate.rate) != null ? bignumber_js.BigNumber(swap.fromAmount).times(rate.rate).toNumber() : null, (rate == null ? void 0 : rate.rate) != null ? bignumber_js.BigNumber(swap.toAmount).times(rate.rate).toNumber() : null, "USD", FiatCurrenciesService.getCurrencyDecimalCountByCode("USD")));
|
|
3906
|
+
});
|
|
3907
|
+
} else {
|
|
3908
|
+
return Promise.resolve(Promise.all([swapProvider.getCoinToUSDTRate(swap.fromCoin), swapProvider.getCoinToUSDTRate(swap.toCoin)])).then(function (_ref) {
|
|
3909
|
+
var fromCoinFiatRate = _ref[0],
|
|
3910
|
+
toConFiatRate = _ref[1];
|
|
3911
|
+
_extendedSwaps.push(ExistingSwapWithFiatData.fromExistingSwap(swap, (fromCoinFiatRate == null ? void 0 : fromCoinFiatRate.rate) != null ? bignumber_js.BigNumber(swap.fromAmount).times(fromCoinFiatRate.rate).toNumber() : null, (toConFiatRate == null ? void 0 : toConFiatRate.rate) != null ? bignumber_js.BigNumber(swap.toAmount).times(toConFiatRate.rate).toNumber() : null, "USD", FiatCurrenciesService.getCurrencyDecimalCountByCode("USD")));
|
|
3912
|
+
});
|
|
3913
|
+
}
|
|
3914
|
+
}();
|
|
3915
|
+
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
3916
|
+
});
|
|
3917
|
+
return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
|
|
3918
|
+
}
|
|
3919
|
+
}();
|
|
3920
|
+
return _temp5 && _temp5.then ? _temp5.then(function () {
|
|
3921
|
+
return result;
|
|
3922
|
+
}) : result;
|
|
3923
|
+
});
|
|
3924
|
+
}, function (e) {
|
|
3925
|
+
improveAndRethrow(e, "getExistingSwapsDetailsWithFiatAmounts");
|
|
3926
|
+
}));
|
|
3927
|
+
} catch (e) {
|
|
3928
|
+
return Promise.reject(e);
|
|
3929
|
+
}
|
|
3930
|
+
};
|
|
3931
|
+
return SwapUtils;
|
|
3932
|
+
}();
|
|
3933
|
+
|
|
3934
|
+
function _catch(body, recover) {
|
|
3935
|
+
try {
|
|
3936
|
+
var result = body();
|
|
3937
|
+
} catch (e) {
|
|
3938
|
+
return recover(e);
|
|
3939
|
+
}
|
|
3940
|
+
if (result && result.then) {
|
|
3941
|
+
return result.then(void 0, recover);
|
|
3942
|
+
}
|
|
3943
|
+
return result;
|
|
3944
|
+
}
|
|
3945
|
+
var PublicSwapService = /*#__PURE__*/function () {
|
|
3946
|
+
function PublicSwapService(apiKeysProxyUrl, cache) {
|
|
3947
|
+
this._swapProvider = new SwapspaceSwapProvider(apiKeysProxyUrl, cache, function () {
|
|
3948
|
+
return null;
|
|
3949
|
+
}, false);
|
|
3950
|
+
}
|
|
3951
|
+
var _proto = PublicSwapService.prototype;
|
|
3952
|
+
_proto.initialize = function initialize() {
|
|
3953
|
+
try {
|
|
3954
|
+
var _this = this;
|
|
3955
|
+
var _temp = _catch(function () {
|
|
3956
|
+
return Promise.resolve(_this._swapProvider.initialize()).then(function () {});
|
|
3957
|
+
}, function (e) {
|
|
3958
|
+
Logger.logError(e, "PublicSwapService.initialize");
|
|
3959
|
+
});
|
|
3960
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
3961
|
+
} catch (e) {
|
|
3962
|
+
return Promise.reject(e);
|
|
3963
|
+
}
|
|
3964
|
+
};
|
|
3965
|
+
_proto.getAllSupportedCurrenciesListForPublicSwap = function getAllSupportedCurrenciesListForPublicSwap() {
|
|
3966
|
+
try {
|
|
3967
|
+
var _this2 = this;
|
|
3968
|
+
var loggerSource = "getAllSupportedCurrenciesListForPublicSwap";
|
|
3969
|
+
return Promise.resolve(_catch(function () {
|
|
3970
|
+
return Promise.resolve(_this2._swapProvider.getAllSupportedCurrencies()).then(function (result) {
|
|
3971
|
+
var _result$coins;
|
|
3972
|
+
if (result.reason === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
3973
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
3974
|
+
return {
|
|
3975
|
+
result: false,
|
|
3976
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
3977
|
+
};
|
|
3978
|
+
}
|
|
3979
|
+
Logger.log("Retrieved " + (result == null || (_result$coins = result.coins) == null ? void 0 : _result$coins.length) + " supported currencies for swap", loggerSource);
|
|
3980
|
+
return {
|
|
3981
|
+
result: true,
|
|
3982
|
+
coins: result.coins
|
|
3983
|
+
};
|
|
3984
|
+
});
|
|
3985
|
+
}, function (e) {
|
|
3986
|
+
improveAndRethrow(e, "getDepositCurrenciesListForPublicSwap");
|
|
3987
|
+
}));
|
|
3988
|
+
} catch (e) {
|
|
3989
|
+
return Promise.reject(e);
|
|
3990
|
+
}
|
|
3991
|
+
};
|
|
3992
|
+
_proto.getDepositCurrenciesListForPublicSwap = function getDepositCurrenciesListForPublicSwap() {
|
|
3993
|
+
try {
|
|
3994
|
+
var _this3 = this;
|
|
3995
|
+
return Promise.resolve(_catch(function () {
|
|
3996
|
+
return Promise.resolve(_this3._getCurrenciesListForPublicSwap(false));
|
|
3997
|
+
}, function (e) {
|
|
3998
|
+
improveAndRethrow(e, "getDepositCurrenciesListForPublicSwap");
|
|
3999
|
+
}));
|
|
4000
|
+
} catch (e) {
|
|
4001
|
+
return Promise.reject(e);
|
|
4002
|
+
}
|
|
4003
|
+
};
|
|
4004
|
+
_proto.getWithdrawCurrenciesListForPublicSwap = function getWithdrawCurrenciesListForPublicSwap() {
|
|
4005
|
+
try {
|
|
4006
|
+
var _this4 = this;
|
|
4007
|
+
return Promise.resolve(_catch(function () {
|
|
4008
|
+
return Promise.resolve(_this4._getCurrenciesListForPublicSwap(true));
|
|
4009
|
+
}, function (e) {
|
|
4010
|
+
improveAndRethrow(e, "getWithdrawCurrenciesListForPublicSwap");
|
|
4011
|
+
}));
|
|
4012
|
+
} catch (e) {
|
|
4013
|
+
return Promise.reject(e);
|
|
4014
|
+
}
|
|
4015
|
+
};
|
|
4016
|
+
_proto._getCurrenciesListForPublicSwap = function _getCurrenciesListForPublicSwap(withdraw) {
|
|
4017
|
+
if (withdraw === void 0) {
|
|
4018
|
+
withdraw = false;
|
|
4019
|
+
}
|
|
4020
|
+
try {
|
|
4021
|
+
var _this5 = this;
|
|
4022
|
+
var loggerSource = "getCurrenciesListForPublicSwap";
|
|
4023
|
+
return Promise.resolve(_catch(function () {
|
|
4024
|
+
return Promise.resolve(withdraw ? _this5._swapProvider.getWithdrawalCurrencies() : _this5._swapProvider.getDepositCurrencies()).then(function (result) {
|
|
4025
|
+
var _result$coins2;
|
|
4026
|
+
if (result.reason === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
4027
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
4028
|
+
return {
|
|
4029
|
+
result: false,
|
|
4030
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
4031
|
+
};
|
|
4032
|
+
}
|
|
4033
|
+
Logger.log("Retrieved " + (result == null || (_result$coins2 = result.coins) == null ? void 0 : _result$coins2.length) + " supported currencies for swap (withdraw=" + withdraw + ")", loggerSource);
|
|
4034
|
+
return {
|
|
4035
|
+
result: true,
|
|
4036
|
+
coins: result.coins
|
|
4037
|
+
};
|
|
4038
|
+
});
|
|
4039
|
+
}, function (e) {
|
|
4040
|
+
improveAndRethrow(e, loggerSource);
|
|
4041
|
+
}));
|
|
4042
|
+
} catch (e) {
|
|
4043
|
+
return Promise.reject(e);
|
|
4044
|
+
}
|
|
4045
|
+
}
|
|
4046
|
+
/**
|
|
4047
|
+
* Retrieves initial data for swapping two coins.
|
|
4048
|
+
*
|
|
4049
|
+
* @param fromCoin {Coin}
|
|
4050
|
+
* @param toCoin {Coin}
|
|
4051
|
+
* @return {Promise<{
|
|
4052
|
+
* result: true,
|
|
4053
|
+
* min: string,
|
|
4054
|
+
* fiatMin: (number|null),
|
|
4055
|
+
* max: string,
|
|
4056
|
+
* fiatMax: (number|null),
|
|
4057
|
+
* rate: (string|null)
|
|
4058
|
+
* }|{
|
|
4059
|
+
* result: false,
|
|
4060
|
+
* reason: string
|
|
4061
|
+
* }>}
|
|
4062
|
+
*/
|
|
4063
|
+
;
|
|
4064
|
+
_proto.getInitialPublicSwapData = function getInitialPublicSwapData(fromCoin, toCoin) {
|
|
4065
|
+
try {
|
|
4066
|
+
var _this6 = this;
|
|
4067
|
+
return Promise.resolve(_catch(function () {
|
|
4068
|
+
return Promise.resolve(SwapUtils.getInitialSwapData(_this6._swapProvider, fromCoin, toCoin)).then(function (result) {
|
|
4069
|
+
if (!result.result) {
|
|
4070
|
+
if (result.reason === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
4071
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
4072
|
+
return {
|
|
4073
|
+
result: false,
|
|
4074
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
4075
|
+
};
|
|
4076
|
+
}
|
|
4077
|
+
if (result.reason === SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED) {
|
|
4078
|
+
return {
|
|
4079
|
+
result: false,
|
|
4080
|
+
reason: PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.PAIR_NOT_SUPPORTED
|
|
4081
|
+
};
|
|
4082
|
+
}
|
|
4083
|
+
}
|
|
4084
|
+
return result;
|
|
4085
|
+
});
|
|
4086
|
+
}, function (e) {
|
|
4087
|
+
improveAndRethrow(e, "getInitialPublicSwapData");
|
|
4088
|
+
}));
|
|
4089
|
+
} catch (e) {
|
|
4090
|
+
return Promise.reject(e);
|
|
4091
|
+
}
|
|
4092
|
+
}
|
|
4093
|
+
/**
|
|
4094
|
+
* Retrieves swap details that can be used to create swap.
|
|
4095
|
+
*
|
|
4096
|
+
* @param fromCoin {Coin}
|
|
4097
|
+
* @param toCoin {Coin}
|
|
4098
|
+
* @param fromAmountCoins {string}
|
|
4099
|
+
* @return {Promise<{
|
|
4100
|
+
* result: false,
|
|
4101
|
+
* reason: string,
|
|
4102
|
+
* min: (string|null),
|
|
4103
|
+
* max: (string|null),
|
|
4104
|
+
* rate: (string|undefined),
|
|
4105
|
+
* fiatMin: (number|null),
|
|
4106
|
+
* fiatMax: (number|null)
|
|
4107
|
+
* }|{
|
|
4108
|
+
* result: true,
|
|
4109
|
+
* swapCreationInfo: BaseSwapCreationInfo
|
|
4110
|
+
* }>}
|
|
4111
|
+
*/
|
|
4112
|
+
;
|
|
4113
|
+
_proto.getPublicSwapDetails = function getPublicSwapDetails(fromCoin, toCoin, fromAmountCoins) {
|
|
4114
|
+
try {
|
|
4115
|
+
var _this7 = this;
|
|
4116
|
+
var loggerSource = "getPublicSwapDetails";
|
|
4117
|
+
return Promise.resolve(_catch(function () {
|
|
4118
|
+
return Promise.resolve(_this7._swapProvider.getCoinToUSDTRate(fromCoin)).then(function (_this7$_swapProvider$) {
|
|
4119
|
+
var _this7$_swapProvider$2;
|
|
4120
|
+
var coinUsdtRate = (_this7$_swapProvider$2 = _this7$_swapProvider$ == null ? void 0 : _this7$_swapProvider$.rate) != null ? _this7$_swapProvider$2 : null;
|
|
4121
|
+
return Promise.resolve(_this7._swapProvider.getSwapInfo(fromCoin, toCoin, fromAmountCoins, coinUsdtRate)).then(function (details) {
|
|
4122
|
+
var _result$swapCreationI, _result$swapCreationI2;
|
|
4123
|
+
var min = details.result ? details.min : details.smallestMin;
|
|
4124
|
+
var max = details.result ? details.max : details.greatestMax;
|
|
4125
|
+
var fiatMin = null,
|
|
4126
|
+
fiatMax = null;
|
|
4127
|
+
if (coinUsdtRate != null) {
|
|
4128
|
+
if (min != null) {
|
|
4129
|
+
fiatMin = bignumber_js.BigNumber(min).times(coinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
4130
|
+
}
|
|
4131
|
+
if (max != null) {
|
|
4132
|
+
fiatMax = bignumber_js.BigNumber(max).times(coinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4135
|
+
var composeFailResult = function composeFailResult(reason) {
|
|
4136
|
+
var _details$rate;
|
|
4137
|
+
return {
|
|
4138
|
+
result: false,
|
|
4139
|
+
reason: reason,
|
|
4140
|
+
min: min != null ? min : null,
|
|
4141
|
+
fiatMin: fiatMin,
|
|
4142
|
+
max: max != null ? max : null,
|
|
4143
|
+
fiatMax: fiatMax,
|
|
4144
|
+
rate: (_details$rate = details.rate) != null ? _details$rate : null
|
|
4145
|
+
};
|
|
4146
|
+
};
|
|
4147
|
+
if (!details.result) {
|
|
4148
|
+
if ((details == null ? void 0 : details.reason) === SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED) return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.PAIR_NOT_SUPPORTED);else if ((details == null ? void 0 : details.reason) === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
4149
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
4150
|
+
return composeFailResult(PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
var fromAmountBigNumber = bignumber_js.BigNumber(fromAmountCoins);
|
|
4154
|
+
if (typeof min === "string" && fromAmountBigNumber.lt(min)) {
|
|
4155
|
+
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_LESS_THAN_MIN_SWAPPABLE);
|
|
4156
|
+
} else if (typeof max === "string" && fromAmountBigNumber.gt(max)) {
|
|
4157
|
+
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_HIGHER_THAN_MAX_SWAPPABLE);
|
|
4158
|
+
}
|
|
4159
|
+
var toAmountCoins = AmountUtils.trim(fromAmountBigNumber.times(details.rate), fromCoin.digits);
|
|
4160
|
+
var result = {
|
|
4161
|
+
result: true,
|
|
4162
|
+
swapCreationInfo: new BaseSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, details.rate, details.rawSwapData, min, fiatMin, max, fiatMax, details.durationMinutesRange)
|
|
4163
|
+
};
|
|
4164
|
+
Logger.log("Result: " + safeStringify({
|
|
4165
|
+
result: result.result,
|
|
4166
|
+
swapCreationInfo: _extends({}, result.swapCreationInfo, {
|
|
4167
|
+
fromCoin: result == null || (_result$swapCreationI = result.swapCreationInfo) == null || (_result$swapCreationI = _result$swapCreationI.fromCoin) == null ? void 0 : _result$swapCreationI.ticker,
|
|
4168
|
+
toCoin: result == null || (_result$swapCreationI2 = result.swapCreationInfo) == null || (_result$swapCreationI2 = _result$swapCreationI2.toCoin) == null ? void 0 : _result$swapCreationI2.ticker
|
|
4169
|
+
})
|
|
4170
|
+
}), loggerSource);
|
|
4171
|
+
return result;
|
|
4172
|
+
});
|
|
4173
|
+
});
|
|
4174
|
+
}, function (e) {
|
|
4175
|
+
improveAndRethrow(e, loggerSource);
|
|
4176
|
+
}));
|
|
4177
|
+
} catch (e) {
|
|
4178
|
+
return Promise.reject(e);
|
|
4179
|
+
}
|
|
4180
|
+
}
|
|
4181
|
+
/**
|
|
4182
|
+
* Creates swap by given params.
|
|
4183
|
+
*
|
|
4184
|
+
* @param fromCoin {Coin}
|
|
4185
|
+
* @param toCoin {Coin}
|
|
4186
|
+
* @param fromAmount {string}
|
|
4187
|
+
* @param swapCreationInfo {BaseSwapCreationInfo}
|
|
4188
|
+
* @param toAddress {string}
|
|
4189
|
+
* @param refundAddress {string}
|
|
4190
|
+
* @param clientIp {string}
|
|
4191
|
+
* @return {Promise<{
|
|
4192
|
+
* result: true,
|
|
4193
|
+
* fiatCurrencyCode: string,
|
|
4194
|
+
* toCoin: Coin,
|
|
4195
|
+
* fromAmountFiat: (number|null),
|
|
4196
|
+
* address: string,
|
|
4197
|
+
* durationMinutesRange: string,
|
|
4198
|
+
* fromAmount: string,
|
|
4199
|
+
* toAmount: string,
|
|
4200
|
+
* toAmountFiat: (number|null),
|
|
4201
|
+
* fiatCurrencyDecimals: number,
|
|
4202
|
+
* fromCoin: Coin,
|
|
4203
|
+
* rate: string,
|
|
4204
|
+
* swapId: string
|
|
4205
|
+
* }|{
|
|
4206
|
+
* result: false,
|
|
4207
|
+
* reason: string
|
|
4208
|
+
* }>}
|
|
4209
|
+
*/
|
|
4210
|
+
;
|
|
4211
|
+
_proto.createPublicSwap = function createPublicSwap(fromCoin, toCoin, fromAmount, swapCreationInfo, toAddress, refundAddress, clientIp) {
|
|
4212
|
+
try {
|
|
4213
|
+
var _this8 = this;
|
|
4214
|
+
var loggerSource = "createPublicSwap";
|
|
4215
|
+
return Promise.resolve(_catch(function () {
|
|
4216
|
+
var _swapCreationInfo$fro, _swapCreationInfo$toC;
|
|
4217
|
+
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof fromAmount !== "string" || typeof toAddress !== "string" || typeof refundAddress !== "string" || !(swapCreationInfo instanceof BaseSwapCreationInfo)) {
|
|
4218
|
+
throw new Error("Wrong input: " + fromCoin.ticker + " " + toCoin.ticker + " " + fromAmount + " " + swapCreationInfo);
|
|
4219
|
+
}
|
|
4220
|
+
Logger.log("Start: " + fromAmount + " " + fromCoin.ticker + " -> " + toCoin.ticker + ". Details: " + safeStringify(_extends({}, swapCreationInfo, {
|
|
4221
|
+
fromCoin: swapCreationInfo == null || (_swapCreationInfo$fro = swapCreationInfo.fromCoin) == null ? void 0 : _swapCreationInfo$fro.ticker,
|
|
4222
|
+
toCoin: swapCreationInfo == null || (_swapCreationInfo$toC = swapCreationInfo.toCoin) == null ? void 0 : _swapCreationInfo$toC.ticker
|
|
4223
|
+
})), loggerSource);
|
|
4224
|
+
return Promise.resolve(_this8._swapProvider.createSwap(fromCoin, toCoin, fromAmount, toAddress, refundAddress, swapCreationInfo.rawSwapData, clientIp)).then(function (result) {
|
|
4225
|
+
var _exit;
|
|
4226
|
+
function _temp5(_result8) {
|
|
4227
|
+
if (_exit) return _result8;
|
|
4228
|
+
throw new Error("Unexpected result from provider " + safeStringify(result));
|
|
4229
|
+
}
|
|
4230
|
+
Logger.log("Created:" + safeStringify(_extends({}, result, {
|
|
4231
|
+
fromCoin: fromCoin == null ? void 0 : fromCoin.ticker,
|
|
4232
|
+
toCoin: toCoin == null ? void 0 : toCoin.ticker
|
|
4233
|
+
})), loggerSource);
|
|
4234
|
+
if (!(result != null && result.result)) {
|
|
4235
|
+
if ((result == null ? void 0 : result.reason) === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
4236
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
4237
|
+
return {
|
|
4238
|
+
result: false,
|
|
4239
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
4240
|
+
};
|
|
4241
|
+
}
|
|
4242
|
+
if ((result == null ? void 0 : result.reason) === SwapProvider.CREATION_FAIL_REASONS.RETRIABLE_FAIL) {
|
|
4243
|
+
// TODO: [feature, high] implement retrying if one partner fail and we have another partners task_id=a07e367e488f4a4899613ac9056fa359
|
|
4244
|
+
// return {
|
|
4245
|
+
// result: false,
|
|
4246
|
+
// reason: PublicSwapService.SWAP_CREATION_FAIL_REASONS.RETRIABLE_FAIL,
|
|
4247
|
+
// };
|
|
4248
|
+
}
|
|
4249
|
+
}
|
|
4250
|
+
var _temp4 = function () {
|
|
4251
|
+
if (result.result && result != null && result.swapId) {
|
|
4252
|
+
var _temp3 = function _temp3() {
|
|
4253
|
+
EventBusInstance__default["default"].dispatch(PublicSwapService.PUBLIC_SWAP_CREATED_EVENT, null, fromCoin.ticker, toCoin.ticker, _fromAmountFiat);
|
|
4254
|
+
var toReturn = {
|
|
4255
|
+
result: true,
|
|
4256
|
+
swapId: result.swapId,
|
|
4257
|
+
fromCoin: fromCoin,
|
|
4258
|
+
toCoin: toCoin,
|
|
4259
|
+
fromAmount: result.fromAmount,
|
|
4260
|
+
toAmount: result.toAmount,
|
|
4261
|
+
fromAmountFiat: _fromAmountFiat,
|
|
4262
|
+
toAmountFiat: _toAmountFiat,
|
|
4263
|
+
fiatCurrencyCode: "USD",
|
|
4264
|
+
fiatCurrencyDecimals: PublicSwapService._fiatDecimalsCount,
|
|
4265
|
+
rate: result.rate,
|
|
4266
|
+
durationMinutesRange: swapCreationInfo.durationMinutesRange,
|
|
4267
|
+
address: result.fromAddress // CRITICAL: this is the address to send coins to swaps provider
|
|
4268
|
+
};
|
|
4269
|
+
_this8._savePublicSwapIdLocally(result.swapId);
|
|
4270
|
+
Logger.log("Returning: " + safeStringify(_extends({}, toReturn, {
|
|
4271
|
+
fromCoin: fromCoin == null ? void 0 : fromCoin.ticker,
|
|
4272
|
+
toCoin: toCoin == null ? void 0 : toCoin.ticker
|
|
4273
|
+
})), loggerSource);
|
|
4274
|
+
_exit = 1;
|
|
4275
|
+
return toReturn;
|
|
4276
|
+
};
|
|
4277
|
+
var _fromAmountFiat = null,
|
|
4278
|
+
_toAmountFiat = null;
|
|
4279
|
+
var _temp2 = _catch(function () {
|
|
4280
|
+
return Promise.resolve(_this8._swapProvider.getCoinToUSDTRate(fromCoin)).then(function (_this8$_swapProvider$) {
|
|
4281
|
+
var _this8$_swapProvider$3;
|
|
4282
|
+
var fromCoinUsdtRate = (_this8$_swapProvider$3 = _this8$_swapProvider$ == null ? void 0 : _this8$_swapProvider$.rate) != null ? _this8$_swapProvider$3 : null;
|
|
4283
|
+
return Promise.resolve(_this8._swapProvider.getCoinToUSDTRate(fromCoin)).then(function (_this8$_swapProvider$2) {
|
|
4284
|
+
var _this8$_swapProvider$4;
|
|
4285
|
+
var toCoinUsdtRate = (_this8$_swapProvider$4 = _this8$_swapProvider$2 == null ? void 0 : _this8$_swapProvider$2.rate) != null ? _this8$_swapProvider$4 : null;
|
|
4286
|
+
if (fromCoinUsdtRate != null && result.fromAmount != null) {
|
|
4287
|
+
_fromAmountFiat = bignumber_js.BigNumber(result.fromAmount).times(fromCoinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
4288
|
+
}
|
|
4289
|
+
if (toCoinUsdtRate != null && result.toAmount != null) {
|
|
4290
|
+
_toAmountFiat = bignumber_js.BigNumber(result.toAmount).times(toCoinUsdtRate).toFixed(PublicSwapService._fiatDecimalsCount);
|
|
4291
|
+
}
|
|
4292
|
+
});
|
|
4293
|
+
});
|
|
4294
|
+
}, function (e) {
|
|
4295
|
+
Logger.logError(e, loggerSource, "Failed to calculate fiat amounts for result");
|
|
4296
|
+
});
|
|
4297
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
4298
|
+
}
|
|
4299
|
+
}();
|
|
4300
|
+
return _temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4);
|
|
4301
|
+
});
|
|
4302
|
+
}, function (e) {
|
|
4303
|
+
improveAndRethrow(e, loggerSource);
|
|
4304
|
+
}));
|
|
4305
|
+
} catch (e) {
|
|
4306
|
+
return Promise.reject(e);
|
|
4307
|
+
}
|
|
4308
|
+
}
|
|
4309
|
+
/**
|
|
4310
|
+
* Retrieves swap details and status for existing swaps by their ids.
|
|
4311
|
+
*
|
|
4312
|
+
* @param swapIds {string[]}
|
|
4313
|
+
* @return {Promise<{
|
|
4314
|
+
* result: true,
|
|
4315
|
+
* swaps: ExistingSwapWithFiatData[]
|
|
4316
|
+
* }|{
|
|
4317
|
+
* result: false,
|
|
4318
|
+
* reason: string
|
|
4319
|
+
* }>}
|
|
4320
|
+
* error reason is one of PUBLIC_SWAPS_COMMON_ERRORS
|
|
4321
|
+
*/
|
|
4322
|
+
;
|
|
4323
|
+
_proto.getPublicExistingSwapDetailsAndStatus = function getPublicExistingSwapDetailsAndStatus(swapIds) {
|
|
4324
|
+
try {
|
|
4325
|
+
var _this9 = this;
|
|
4326
|
+
var loggerSource = "getPublicExistingSwapDetailsAndStatus";
|
|
4327
|
+
return Promise.resolve(_catch(function () {
|
|
4328
|
+
return Promise.resolve(SwapUtils.getExistingSwapsDetailsWithFiatAmounts(_this9._swapProvider, swapIds)).then(function (result) {
|
|
4329
|
+
if (!(result != null && result.result)) {
|
|
4330
|
+
if (result.reason === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED) {
|
|
4331
|
+
SwapUtils.safeHandleRequestsLimitExceeding();
|
|
4332
|
+
return {
|
|
4333
|
+
result: false,
|
|
4334
|
+
reason: PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
4335
|
+
};
|
|
4336
|
+
}
|
|
4337
|
+
throw new Error("Unknown reason: " + (result == null ? void 0 : result.reason));
|
|
4338
|
+
}
|
|
4339
|
+
return result;
|
|
4340
|
+
});
|
|
4341
|
+
}, function (e) {
|
|
4342
|
+
improveAndRethrow(e, loggerSource);
|
|
4343
|
+
}));
|
|
4344
|
+
} catch (e) {
|
|
4345
|
+
return Promise.reject(e);
|
|
4346
|
+
}
|
|
4347
|
+
}
|
|
4348
|
+
/**
|
|
4349
|
+
* Retrieves the whole available swaps history by ids saved locally.
|
|
4350
|
+
*
|
|
4351
|
+
* @return {Promise<{
|
|
4352
|
+
* result: true,
|
|
4353
|
+
* swaps: ExistingSwapWithFiatData[]
|
|
4354
|
+
* }|{
|
|
4355
|
+
* result: false,
|
|
4356
|
+
* reason: string
|
|
4357
|
+
* }>}
|
|
4358
|
+
*/
|
|
4359
|
+
;
|
|
4360
|
+
_proto.getPublicSwapsHistory = function getPublicSwapsHistory() {
|
|
4361
|
+
try {
|
|
4362
|
+
var _exit2;
|
|
4363
|
+
var _this10 = this;
|
|
4364
|
+
return Promise.resolve(_catch(function () {
|
|
4365
|
+
function _temp7(_result10) {
|
|
4366
|
+
return _exit2 ? _result10 : {
|
|
4367
|
+
result: true,
|
|
4368
|
+
swaps: []
|
|
4369
|
+
};
|
|
4370
|
+
}
|
|
4371
|
+
var swapIds = _this10._getPublicSwapIdsSavedLocally();
|
|
4372
|
+
var _temp6 = function () {
|
|
4373
|
+
if (swapIds.length) {
|
|
4374
|
+
return Promise.resolve(_this10.getPublicExistingSwapDetailsAndStatus(swapIds)).then(function (_await$_this10$getPub) {
|
|
4375
|
+
_exit2 = 1;
|
|
4376
|
+
return _await$_this10$getPub;
|
|
4377
|
+
});
|
|
4378
|
+
}
|
|
4379
|
+
}();
|
|
4380
|
+
return _temp6 && _temp6.then ? _temp6.then(_temp7) : _temp7(_temp6);
|
|
4381
|
+
}, function (e) {
|
|
4382
|
+
improveAndRethrow(e, "getPublicSwapsHistory");
|
|
4383
|
+
}));
|
|
4384
|
+
} catch (e) {
|
|
4385
|
+
return Promise.reject(e);
|
|
4386
|
+
}
|
|
4387
|
+
}
|
|
4388
|
+
/**
|
|
4389
|
+
* @param swapId {string}
|
|
4390
|
+
* @private
|
|
4391
|
+
*/
|
|
4392
|
+
;
|
|
4393
|
+
_proto._savePublicSwapIdLocally = function _savePublicSwapIdLocally(swapId) {
|
|
4394
|
+
if (typeof window !== "undefined") {
|
|
4395
|
+
try {
|
|
4396
|
+
var saved = localStorage.getItem("publicSwapIds");
|
|
4397
|
+
var ids = typeof saved === "string" && saved.length > 0 ? saved.split(",") : [];
|
|
4398
|
+
ids.push(swapId);
|
|
4399
|
+
localStorage.setItem("publicSwapIds", ids.join(","));
|
|
4400
|
+
} catch (e) {
|
|
4401
|
+
improveAndRethrow(e, "_savePublicSwapIdLocally");
|
|
4402
|
+
}
|
|
4403
|
+
}
|
|
4404
|
+
}
|
|
4405
|
+
|
|
4406
|
+
/**
|
|
4407
|
+
* @private
|
|
4408
|
+
* @return {string[]}
|
|
4409
|
+
*/;
|
|
4410
|
+
_proto._getPublicSwapIdsSavedLocally = function _getPublicSwapIdsSavedLocally() {
|
|
4411
|
+
if (typeof window !== "undefined") {
|
|
4412
|
+
try {
|
|
4413
|
+
var saved = localStorage.getItem("publicSwapIds");
|
|
4414
|
+
return typeof saved === "string" && saved.length > 0 ? saved.split(",") : [];
|
|
4415
|
+
} catch (e) {
|
|
4416
|
+
improveAndRethrow(e, "_getPublicSwapIdsSavedLocally");
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4419
|
+
}
|
|
4420
|
+
|
|
4421
|
+
/**
|
|
4422
|
+
* @param coinOrTicker {Coin|string}
|
|
4423
|
+
* @return {string} icon URL (ready to use)
|
|
4424
|
+
*/;
|
|
4425
|
+
_proto.getAssetIconUrl = function getAssetIconUrl(coinOrTicker) {
|
|
4426
|
+
return this._swapProvider.getIconUrl(coinOrTicker);
|
|
4427
|
+
}
|
|
4428
|
+
|
|
4429
|
+
/**
|
|
4430
|
+
* @param ticker {string}
|
|
4431
|
+
* @return {Coin|null}
|
|
4432
|
+
*/;
|
|
4433
|
+
_proto.getCoinByTickerIfPresent = function getCoinByTickerIfPresent(ticker) {
|
|
4434
|
+
return this._swapProvider.getCoinByTickerIfPresent(ticker);
|
|
4435
|
+
}
|
|
4436
|
+
|
|
4437
|
+
/**
|
|
4438
|
+
* TODO: [feature, moderate] add other fiat currencies support. task_id=5490e21b8b9c4f89a2247b28db3c9e0a
|
|
4439
|
+
* @param asset {Coin}
|
|
4440
|
+
* @return {Promise<string|null>}
|
|
4441
|
+
*/;
|
|
4442
|
+
_proto.getAssetToUsdtRate = function getAssetToUsdtRate(asset) {
|
|
4443
|
+
try {
|
|
4444
|
+
var _this11 = this;
|
|
4445
|
+
return Promise.resolve(_catch(function () {
|
|
4446
|
+
return Promise.resolve(_this11._swapProvider.getCoinToUSDTRate(asset)).then(function (result) {
|
|
4447
|
+
var _result$rate;
|
|
4448
|
+
return (_result$rate = result == null ? void 0 : result.rate) != null ? _result$rate : null;
|
|
4449
|
+
});
|
|
4450
|
+
}, function (e) {
|
|
4451
|
+
improveAndRethrow(e, "getAssetToUsdtRate");
|
|
4452
|
+
}));
|
|
4453
|
+
} catch (e) {
|
|
4454
|
+
return Promise.reject(e);
|
|
4455
|
+
}
|
|
4456
|
+
}
|
|
4457
|
+
/**
|
|
4458
|
+
* @param asset {Coin}
|
|
4459
|
+
* @param address {string}
|
|
4460
|
+
* @return {boolean}
|
|
4461
|
+
*/
|
|
4462
|
+
;
|
|
4463
|
+
_proto.isAddressValidForAsset = function isAddressValidForAsset(asset, address) {
|
|
4464
|
+
try {
|
|
4465
|
+
return this._swapProvider.isAddressValidForAsset(asset, address);
|
|
4466
|
+
} catch (e) {
|
|
4467
|
+
improveAndRethrow(e, "isAddressValidForAsset");
|
|
4468
|
+
}
|
|
4469
|
+
}
|
|
4470
|
+
|
|
4471
|
+
/**
|
|
4472
|
+
* Retrieves token by contract address.
|
|
4473
|
+
*
|
|
4474
|
+
* @param addressString {string}
|
|
4475
|
+
* @return {Promise<Coin|null>}
|
|
4476
|
+
*/;
|
|
4477
|
+
_proto.getTokenByContractAddress = function getTokenByContractAddress(addressString) {
|
|
4478
|
+
try {
|
|
4479
|
+
var _exit3;
|
|
4480
|
+
var _this12 = this;
|
|
4481
|
+
var _temp9 = _catch(function () {
|
|
4482
|
+
if (!addressString) {
|
|
4483
|
+
var _temp8 = null;
|
|
4484
|
+
_exit3 = 1;
|
|
4485
|
+
return _temp8;
|
|
4486
|
+
}
|
|
4487
|
+
var addressLowerCase = addressString.toLowerCase();
|
|
4488
|
+
return Promise.resolve(_this12._swapProvider.getAllSupportedCurrencies()).then(function (allCoins) {
|
|
4489
|
+
if (allCoins.result) {
|
|
4490
|
+
var _allCoins$coins$find = allCoins.coins.find(function (coin) {
|
|
4491
|
+
return coin.tokenAddress && coin.tokenAddress.toLowerCase() === addressLowerCase;
|
|
4492
|
+
});
|
|
4493
|
+
_exit3 = 1;
|
|
4494
|
+
return _allCoins$coins$find;
|
|
4495
|
+
}
|
|
4496
|
+
});
|
|
4497
|
+
}, function (e) {
|
|
4498
|
+
Logger.logError(e, "getTokenByContractAddress");
|
|
4499
|
+
});
|
|
4500
|
+
return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function (_result13) {
|
|
4501
|
+
return _exit3 ? _result13 : null;
|
|
4502
|
+
}) : _exit3 ? _temp9 : null);
|
|
4503
|
+
} catch (e) {
|
|
4504
|
+
return Promise.reject(e);
|
|
4505
|
+
}
|
|
4506
|
+
};
|
|
4507
|
+
return PublicSwapService;
|
|
4508
|
+
}();
|
|
4509
|
+
PublicSwapService.PUBLIC_SWAP_CREATED_EVENT = "publicSwapCreatedEvent";
|
|
4510
|
+
PublicSwapService.PUBLIC_SWAPS_COMMON_ERRORS = {
|
|
4511
|
+
REQUESTS_LIMIT_EXCEEDED: "requestsLimitExceeded"
|
|
4512
|
+
};
|
|
4513
|
+
PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS = {
|
|
4514
|
+
AMOUNT_LESS_THAN_MIN_SWAPPABLE: "amountLessThanMinSwappable",
|
|
4515
|
+
AMOUNT_HIGHER_THAN_MAX_SWAPPABLE: "amountHigherThanMaxSwappable",
|
|
4516
|
+
PAIR_NOT_SUPPORTED: "pairNotSupported"
|
|
4517
|
+
};
|
|
4518
|
+
PublicSwapService._fiatDecimalsCount = FiatCurrenciesService.getCurrencyDecimalCountByCode("USD");
|
|
4519
|
+
|
|
4520
|
+
exports.AmountUtils = AmountUtils;
|
|
4521
|
+
exports.AssetIcon = AssetIcon;
|
|
4522
|
+
exports.BaseSwapCreationInfo = BaseSwapCreationInfo;
|
|
4523
|
+
exports.Blockchain = Blockchain;
|
|
1401
4524
|
exports.Button = Button;
|
|
4525
|
+
exports.Cache = Cache;
|
|
4526
|
+
exports.Coin = Coin;
|
|
4527
|
+
exports.EmailsApi = EmailsApi;
|
|
4528
|
+
exports.ExistingSwap = ExistingSwap;
|
|
4529
|
+
exports.ExistingSwapWithFiatData = ExistingSwapWithFiatData;
|
|
4530
|
+
exports.FiatCurrenciesService = FiatCurrenciesService;
|
|
1402
4531
|
exports.LoadingDots = LoadingDots;
|
|
4532
|
+
exports.Logger = Logger;
|
|
4533
|
+
exports.LogsStorage = LogsStorage;
|
|
4534
|
+
exports.Protocol = Protocol;
|
|
4535
|
+
exports.PublicSwapService = PublicSwapService;
|
|
4536
|
+
exports.SupportChat = SupportChat;
|
|
4537
|
+
exports.SwapProvider = SwapProvider;
|
|
4538
|
+
exports.SwapUtils = SwapUtils;
|
|
4539
|
+
exports.SwapspaceSwapProvider = SwapspaceSwapProvider;
|
|
4540
|
+
exports.improveAndRethrow = improveAndRethrow;
|
|
4541
|
+
exports.safeStringify = safeStringify;
|
|
4542
|
+
exports.useCallHandlingErrors = useCallHandlingErrors;
|
|
4543
|
+
exports.useReferredState = useReferredState;
|
|
1403
4544
|
//# sourceMappingURL=index.cjs.map
|