import{t as e}from"./defineProperty-BbfpZ9Tg.js";import{a as t}from"./jsx-runtime-DHSfUA5-.js";import{F as n,I as r,K as i,P as a}from"./test.id-DxQrYxPk.js";import{r as o,t as s}from"./WorkbenchOverlayService-D9CSrozm.js";var c,l=c=class{static create(e,n){return n.invokeFunction(e=>e.get(s)).createOverlay(`dialog`,o.dialog,t.dialog,t=>n.createInstance(c,e,t))}constructor(t,n,r){e(this,`options`,void 0),e(this,`workbenchOverlayService`,void 0),e(this,`zIndex`,void 0),e(this,`instanceId`,void 0),e(this,`disposed`,!1),this.options=t,this.workbenchOverlayService=r,this.zIndex=n.zIndex,this.instanceId=n.instanceId}get title(){return this.options.title}get message(){return this.options.message}get rootTestId(){return this.options.rootTestId}get dialogTestId(){return this.options.dialogTestId}get confirmLabel(){return this.options.confirmLabel}get cancelLabel(){return this.options.cancelLabel}get tone(){return this.options.tone??`danger`}get confirmTestId(){return this.options.confirmTestId}get cancelTestId(){return this.options.cancelTestId}cancel(){this.options.onCancel?.(),this.dispose()}confirm(){Promise.resolve(this.options.onConfirm()).finally(()=>this.dispose())}dispose(){this.disposed||(this.disposed=!0,this.workbenchOverlayService.removeOverlay(this.instanceId))}};l=c=n([r(2,s)],l);function u(){let e=a(i);return t=>l.create(t,e)}export{u as t};
//# sourceMappingURL=useDialog-CjsjDZgz.js.map