"use strict";exports.__esModule=!0,exports.default=confirm;var _invoker=_interopRequireWildcard(require("./invoker"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var n=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(e){return e?r:n})(e)}function _interopRequireWildcard(e,n){if(!n&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=_getRequireWildcardCache(n);if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(t,i,a):t[i]=e[i]}return t.default=e,r&&r.set(e,t),t}function confirm(e){return _invoker.default.invoke("confirm",e)}_invoker.default.registerAPI("confirm",{mini:function(e,n){var r=n.resolve,t=n.reject,o=n.context,i=n.containerType,a={message:e.message,title:e.title,okButton:e.buttonLabels[0],cancelButton:e.buttonLabels[1]};i===_invoker.Container_Type_Enum.isDingTalk?o({m:"taurus.common.confirm",args:a,onSuccess:function(e){var n={errorCode:_invoker.BRIDGE_ERROR_CODE.SUCCESS,result:{buttonIndex:e.ok?0:1}};_invoker.default.handleBridgeResponse(n,r,t)},onFail:function(e){_invoker.default.handleBridgeResponse(e,r,t)}}):o&&o.call("confirm",a,(function(e){var n={errorCode:_invoker.BRIDGE_ERROR_CODE.SUCCESS,result:{buttonIndex:e.ok?0:1}};_invoker.default.handleBridgeResponse(n,r,t)}))},mobile:function(e,n){var r=n.resolve,t=n.reject,o=n.context,i=n.containerType,a=n.platformType,u={message:e.message,title:e.title,okButton:e.buttonLabels[0],cancelButton:e.buttonLabels[1]};if(i){a===_invoker.PLATFORM_TYPE_ENUM.ANDROID?o&&o((function(e){var n={errorCode:_invoker.BRIDGE_ERROR_CODE.SUCCESS,result:{buttonIndex:e.ok?0:1}};_invoker.default.handleBridgeResponse(n,r,t)}),(function(e){_invoker.default.handleBridgeResponse(e,r,t)}),"taurus.common","confirm",u):a===_invoker.PLATFORM_TYPE_ENUM.IOS&&o.callHandler("taurus.common.confirm",Object.assign({},u),(function(e){_invoker.default.handleBridgeResponse(e,r,t)}))}else o&&o.call("confirm",u,(function(e){var n={errorCode:_invoker.BRIDGE_ERROR_CODE.SUCCESS,result:{buttonIndex:e.ok?0:1}};_invoker.default.handleBridgeResponse(n,r,t)}))},pc:function(e,n){window.dingtalk.platform.invokeAPI(n.msgId,"device.notification.confirm",e)}}),confirm.version={android:"1.3.2",ios:"1.3.2",pc:"1.3.2"},module.exports=exports.default,module.exports.default=exports.default;