"use strict";function dealParamsAndResult(e,n){return __awaiter(this,void 0,void 0,function(){var t,r,i,a,s,o,u,c,l,f=this;return __generator(this,function(d){switch(d.label){case 0:return t=e.method,r=e.params,i=e.apiConfig,a=this.devConfig.forceEnableDealApiFnMap&&this.devConfig.forceEnableDealApiFnMap[t]&&!0===this.devConfig.forceEnableDealApiFnMap[t](r),s=!a&&(!0===this.devConfig.isDisableDeal||this.devConfig.disbaleDealApiWhiteList&&-1!==this.devConfig.disbaleDealApiWhiteList.indexOf(t)),o={},!s&&i&&i.paramsDeal&&sdkLib_1.isFunction(i.paramsDeal)?[4,i.paramsDeal(r)]:[3,2];case 1:return o=d.sent(),[3,3];case 2:o=Object.assign({},r),d.label=3;case 3:return u=function(e){return __awaiter(f,void 0,void 0,function(){return __generator(this,function(n){return!s&&i&&i.resultDeal&&sdkLib_1.isFunction(i.resultDeal)?[2,i.resultDeal(e)]:[2,e]})})},sdkLib_1.isFunction(o.onSuccess)&&(c=o.onSuccess,o.onSuccess=function(e){return __awaiter(f,void 0,void 0,function(){var n;return __generator(this,function(t){switch(t.label){case 0:return n=c,[4,u(e)];case 1:return n.apply(void 0,[t.sent()]),[2]}})})}),sdkLib_1.isFunction(o.success)&&(l=o.success,o.success=function(e){return __awaiter(f,void 0,void 0,function(){var n;return __generator(this,function(t){switch(t.label){case 0:return n=l,[4,u(e)];case 1:return n.apply(void 0,[t.sent()]),[2]}})})}),Object.assign(e,{callParams:o,invokeName:null===i||void 0===i?void 0:i.invokeName}),[2,n().then(u)]}})})}var __awaiter=this&&this.__awaiter||function(e,n,t,r){function i(e){return e instanceof t?e:new t(function(n){n(e)})}return new(t||(t=Promise))(function(t,a){function s(e){try{u(r.next(e))}catch(e){a(e)}}function o(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){e.done?t(e.value):i(e.value).then(s,o)}u((r=r.apply(e,n||[])).next())})},__generator=this&&this.__generator||function(e,n){function t(e){return function(n){return r([e,n])}}function r(t){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,a&&(s=2&t[0]?a.return:t[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,s&&(t=[2&t[0],s.value]),t[0]){case 0:case 1:s=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,a=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(s=u.trys,!(s=s.length>0&&s[s.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){u.label=t[1];break}if(6===t[0]&&u.label<s[1]){u.label=s[1],s=t;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(t);break}s[2]&&u.ops.pop(),u.trys.pop();continue}t=n.call(e,u)}catch(e){t=[6,e],a=0}finally{i=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}var i,a,s,o,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o};Object.defineProperty(exports,"__esModule",{value:!0}),exports.dealParamsAndResult=void 0;var sdkLib_1=require("../sdkLib");exports.dealParamsAndResult=dealParamsAndResult;