"use strict";(this.webpackChunk_tsmesolutions_cubes_initiatives=this.webpackChunk_tsmesolutions_cubes_initiatives||[]).push([[5380],{55380:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var i=n(24590),o=n(90726),r=n(16464),s=n(19244);function a(e,t,n,i,o,r,s){try{var a=e[r](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(i,o)}function l(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var r=e.apply(t,n);function s(e){a(r,i,o,s,l,"next",e)}function l(e){a(r,i,o,s,l,"throw",e)}s(void 0)})}}const u={class:"form-actions justify-content-end form-actions-justified pt-0"},c=(0,i.defineComponent)({__name:"threshold-setup",setup(e){const t=o.IoC.DI().resolve(r.Ow.appContext),a=t.services[s.St.AppService.key],c=t.translation.global,d=(0,i.inject)(r.Ow.initiativeSettings),f=d?.translation.tSettings,h=d.hasSettingsPrivilege,v=(0,i.ref)({}),p=function(){var e=l(function*(){try{v.value.validate()&&(yield(0,i.nextTick)(),yield d?.api.updateThresholdSettings(),d?.thresholdSettingDC.commit())}catch(e){console.log("error",e)}});return function(){return e.apply(this,arguments)}}(),y=function(){var e=l(function*(){"yes"==(yield a.confirm({i18n:{title:f.value.confirmCancel.title(f.value.steps["threshold-setup"]),body:f.value.confirmCancel.body},yesButton:{accent:"danger",modifier:"outline",title:c.value.yes},noButton:{accent:"none",title:c.value.no},cancelButton:void 0})).type&&(d?.thresholdSettingDC.rollback(),v.value.resetStates())});return function(){return e.apply(this,arguments)}}(),m=(0,i.defineAsyncComponent)(()=>n.e(457).then(n.bind(n,457)));return(e,t)=>{const n=(0,i.resolveComponent)("v-button");return(0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,[(0,i.createVNode)((0,i.unref)(m),{ref_key:"thresholdSetupFormRef",ref:v},null,512),(0,i.createElementVNode)("div",u,[(0,i.createVNode)(n,{modifier:"outline",disabled:!(0,i.unref)(d)?.thresholdSettingDC.isDirty.value||!(0,i.unref)(h),onClick:y},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(c).discard),1)]),_:1},8,["disabled"]),(0,i.createVNode)(n,{disabled:!(0,i.unref)(d)?.thresholdSettingDC.isDirty.value||!(0,i.unref)(h),onClick:p},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(c).save),1)]),_:1},8,["disabled"])])],64)}}})}}]);
//# sourceMappingURL=2ad1fae107a4c06850ad.js.map