import invoker,{Container_Type_Enum,PLATFORM_TYPE_ENUM,BRIDGE_ERROR_CODE}from"./invoker";invoker.registerAPI("confirm",{mini:function(e,n){var o=n.resolve,r=n.reject,t=n.context,i=n.containerType,s={message:e.message,title:e.title,okButton:e.buttonLabels[0],cancelButton:e.buttonLabels[1]};i===Container_Type_Enum.isDingTalk?t({m:"taurus.common.confirm",args:s,onSuccess:function(e){var n={errorCode:BRIDGE_ERROR_CODE.SUCCESS,result:{buttonIndex:e.ok?0:1}};invoker.handleBridgeResponse(n,o,r)},onFail:function(e){invoker.handleBridgeResponse(e,o,r)}}):t&&t.call("confirm",s,(function(e){var n={errorCode:BRIDGE_ERROR_CODE.SUCCESS,result:{buttonIndex:e.ok?0:1}};invoker.handleBridgeResponse(n,o,r)}))},mobile:function(e,n){var o=n.resolve,r=n.reject,t=n.context,i=n.containerType,s=n.platformType,a={message:e.message,title:e.title,okButton:e.buttonLabels[0],cancelButton:e.buttonLabels[1]};if(i){s===PLATFORM_TYPE_ENUM.ANDROID?t&&t((function(e){var n={errorCode:BRIDGE_ERROR_CODE.SUCCESS,result:{buttonIndex:e.ok?0:1}};invoker.handleBridgeResponse(n,o,r)}),(function(e){invoker.handleBridgeResponse(e,o,r)}),"taurus.common","confirm",a):s===PLATFORM_TYPE_ENUM.IOS&&t.callHandler("taurus.common.confirm",Object.assign({},a),(function(e){invoker.handleBridgeResponse(e,o,r)}))}else t&&t.call("confirm",a,(function(e){var n={errorCode:BRIDGE_ERROR_CODE.SUCCESS,result:{buttonIndex:e.ok?0:1}};invoker.handleBridgeResponse(n,o,r)}))},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"};export default function confirm(e){return invoker.invoke("confirm",e)}