import{assert}from"./assert.js";export class Dialog{constructor(a,e,t,s=""){this._handled=!1,this._client=a,this._type=e,this._message=t,this._defaultValue=s}type(){return this._type}message(){return this._message}defaultValue(){return this._defaultValue}async accept(a){assert(!this._handled,"Cannot accept dialog which is already handled!"),this._handled=!0,await this._client.send("Page.handleJavaScriptDialog",{accept:!0,promptText:a})}async dismiss(){assert(!this._handled,"Cannot dismiss dialog which is already handled!"),this._handled=!0,await this._client.send("Page.handleJavaScriptDialog",{accept:!1})}}