import{r as e}from"./chunk-QTnfLwEv.js";import{n as t}from"./index-7yDgay5u.js";import{t as n}from"./defineProperty-BbfpZ9Tg.js";import{a as r,o as i}from"./jsx-runtime-DHSfUA5-.js";import{F as a,I as o,K as s,P as c,U as l}from"./test.id-DxQrYxPk.js";import{r as u,t as d}from"./WorkbenchOverlayService-D9CSrozm.js";var f=e(i(),1),p,m=p=class{static create(e,t){let n=t.invokeFunction(e=>e.get(d));return n.removeOverlayById(u.topTips),n.createOverlay(`toast`,u.successToast,r.toast,n=>t.createInstance(p,e,n))}constructor(e,t,r){n(this,`options`,void 0),n(this,`workbenchOverlayService`,void 0),n(this,`_onStatusChange`,new l),n(this,`onStatusChange`,this._onStatusChange.event),n(this,`zIndex`,void 0),n(this,`instanceId`,void 0),n(this,`timer`,void 0),n(this,`disposed`,!1),this.options=e,this.workbenchOverlayService=r,this.zIndex=t.zIndex,this.instanceId=t.instanceId,this.timer=setTimeout(()=>this.dispose(),this.durationMs)}get message(){return this.options.message||t(`common.done`,`Done`)}get icon(){return this.options.icon??`check`}get durationMs(){return this.options.durationMs??1500}get testId(){return this.options.testId}dispose(){this.disposed||(this.disposed=!0,clearTimeout(this.timer),this.options.onDone?.(),this.workbenchOverlayService.removeOverlay(this.instanceId))}};m=p=a([o(2,d)],m);function h(){let e=c(s);return(0,f.useCallback)(t=>m.create(t,e),[e])}export{h as t};
//# sourceMappingURL=useSuccessToast-CW8oLO3e.js.map