const TAG_NAME="RTC-MODAL",stat={init:"init",waiting:"waiting",success:"success"};Component({properties:{visible:{type:Boolean,value:!1,observer(t){}},status:{type:String,value:"init",observer(t){this.statusChange(t)}}},data:{dialogShow:!1,tips:"",confimBtn:"",cancelBtn:""},lifetimes:{attached(){}},methods:{show(){this.setData({dialogShow:!0})},hide(){this.setData({dialogShow:!1})},tapDialogButton(t){this.setData({dialogShow:!1})},statusChange(t){this.hide(),this.setData({status:t})},buttonTap(){const{status:t}=this.data;switch(t){case stat.init:this.setData({status:stat.waiting}),this.connect();break;case stat.waiting:this.setData({tips:"正在申请连线中，请确认是否需要「取消申请」",confimBtn:"取消申请",cancelBtn:"继续申请"}),this.show();break;case stat.success:this.setData({tips:"当前处于连线状态，请确认是否需要「断开连线」",confimBtn:"断开连线",cancelBtn:"我再想想"}),this.show()}},onConfim(){const{status:t}=this.data;switch(t){case stat.waiting:this.cancelConnect();break;case stat.success:this.hangUp()}this.hide()},onCancel(){this.hide()},connect(){this.triggerEvent("rtcRequestConnect")},cancelConnect(){this.triggerEvent("rtcCancelConnect")},hangUp(){this.triggerEvent("rtcHangUp")}}});