"use strict";exports.__esModule=!0,exports.default=subscribe;var _invoker=_interopRequireWildcard(require("./invoker"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(_getRequireWildcardCache=function(e){return e?n:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_getRequireWildcardCache(r);if(n&&n.has(e))return n.get(e);var o={},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=t?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(o,i,s):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o}function subscribe(e){return _invoker.default.invoke("subscribe",e)}_invoker.default.registerAPI("subscribe",{mobile:function(e,r){var n=r.resolve,o=r.reject,t=r.context,i=r.containerType,s=r.platformType,u=!1;if(i){s===_invoker.PLATFORM_TYPE_ENUM.ANDROID?t&&t((function(r){u?(e.onSuccess||e.onFail)&&("0"!==r.errorCode?e.onFail&&e.onFail(r):e.onSuccess&&e.onSuccess(r.result)):(u=!0,_invoker.default.handleBridgeResponse(r,n,o))}),(function(r){u?e.onFail&&e.onFail(r):(u=!0,_invoker.default.handleBridgeResponse(r,n,o))}),"taurus.common","subscribe",e):s===_invoker.PLATFORM_TYPE_ENUM.IOS&&t.callHandler("taurus.common.subscribe",Object.assign({},e),(function(r){u?(e.onSuccess||e.onFail)&&("0"!==r.errorCode?e.onFail&&e.onFail(r):e.onSuccess&&e.onSuccess(r.result)):(u=!0,_invoker.default.handleBridgeResponse(r,n,o))}))}else t&&t.call("subscribe",e,(function(r){u?(e.onSuccess||e.onFail)&&("0"!==r.errorCode?e.onFail&&e.onFail(r):e.onSuccess&&e.onSuccess(r.result)):(u=!0,_invoker.default.handleBridgeResponse(r,n,o))}))}}),subscribe.version={android:"1.6.0",ios:"1.6.0"},module.exports=exports.default,module.exports.default=exports.default;