import{t as j,bd as ee,be as te,G as P,H as _,aQ as N,aK as O,ax as L,aS as I,z as c,l as m,P as R,v as oe,ad as x,M as z,L as U,ae as re,bf as H,D as W,Q as ne,T as F,U as se,E as ae,bg as ie,av as le,aD as de,a5 as ce,a4 as $}from"./index-CEmnTf-r.js";var pe=function(T){j(a,T);function a(t){var e=T.call(this,t)||this;e.isDead=!1,e.$$id=ee(),t.store.setEntered(!!t.show),e.handleSelfClose=e.handleSelfClose.bind(e),e.handleAction=e.handleAction.bind(e),e.handleActionSensor=e.handleActionSensor.bind(e),e.handleDialogConfirm=e.handleDialogConfirm.bind(e),e.handleDialogClose=e.handleDialogClose.bind(e),e.handleDrawerConfirm=e.handleDrawerConfirm.bind(e),e.handleDrawerClose=e.handleDrawerClose.bind(e),e.handleEntered=e.handleEntered.bind(e),e.handleExited=e.handleExited.bind(e),e.handleFormInit=e.handleFormInit.bind(e),e.handleFormSaved=e.handleFormSaved.bind(e),e.handleFormChange=e.handleFormChange.bind(e),e.handleChildFinished=e.handleChildFinished.bind(e);var o=t.store;return e.reaction=te(function(){return"".concat(o.loading).concat(o.error)},function(){return e.forceUpdate()}),e}return a.prototype.componentWillUnmount=function(){this.reaction&&this.reaction(),this.isDead=!0},a.prototype.buildActions=function(){var t=this.props,e=t.actions,o=t.confirm,r=t.translate,n=t.testIdBuilder;if(typeof e<"u")return e;var s=[];return s.push({type:"button",testIdBuilder:n==null?void 0:n.getChild("cancel"),actionType:"cancel",label:r("cancel")}),o&&s.push({type:"button",testIdBuilder:n==null?void 0:n.getChild("confirm"),actionType:"confirm",label:r("confirm"),primary:!0}),s},a.prototype.handleSelfClose=function(t,e){return P(this,void 0,void 0,function(){var o,r,n,s,l;return _(this,function(d){switch(d.label){case 0:return o=this.props,r=o.onClose,n=o.store,s=o.dispatchEvent,[4,s("cancel",this.props.data)];case 1:return l=d.sent(),l!=null&&l.prevented?[2]:l!=null&&l.pendingPromise.length?[4,l.allDone()]:[3,3];case 2:d.sent(),d.label=3;case 3:return n.updateMessage(),r(e),[2]}})})},a.prototype.handleActionSensor=function(t){var e=this,o=this.props.store,r=o.busying;o.markBusying(!0),o.updateMessage(),t.then(function(){o.markBusying(r)}).catch(function(n){e.isDead||(o.updateMessage(n.message,!0),o.markBusying(r))})},a.prototype.handleAction=function(t,e,o){var r=this.props,n=r.store,s=r.onAction;e.type==="reset"?n.reset():e.actionType==="cancel"?this.handleSelfClose():s&&s(t,e,o)},a.prototype.handleDialogConfirm=function(t,e){for(var o=[],r=2;r