(()=>{varn,a,e,r={12306:(n,a,e)=>{"use strict";varr=e(85471),s=e(53334),i=e(88837),o=e(54576),d=e(82182),l=e(11100),f=e(65386),c=e(99498),A=e(92457),u=e(26287);functionm(t){constn=t.getFullYear(),a=(t.getMonth()+1).toString().padStart(2,"0"),e=t.getDate().toString().padStart(2,"0");return"".concat(n,"-").concat(a,"-").concat(e)}varp=e(38613),T=e(85168),S=e(53529);consth=(0,S.YK)().setApp("dav").detectUser().build(),v={name:"AbsenceForm",components:{NcButton:o.A,NcTextField:d.A,NcTextArea:l.A,NcDateTimePickerNative:f.A},data(){const{firstDay:t,lastDay:n,status:a,message:e}=(0,p.C)("dav","absence",{});return{loading:!1,status:null!=a?a:"",message:null!=e?e:"",firstDay:t?newDate(t):newDate,lastDay:n?newDate(n):null}},computed:{valid(){vart,n;consta=newDate(null===(t=this.firstDay)||void0===t?void0:t.getTime()),e=newDate(null===(n=this.lastDay)||void0===n?void0:n.getTime());returnnull==a||a.setHours(0,0,0,0),null==e||e.setHours(0,0,0,0),!!this.firstDay&&!!this.lastDay&&!!this.status&&!!this.message&&e>=a}},methods:{resetForm(){this.status="",this.message="",this.firstDay=newDate,this.lastDay=null},asyncsaveForm(){if(this.valid){this.loading=!0;try{awaitu.A.post((0,c.KT)("/apps/dav/api/v1/outOfOffice/{userId}",{userId:(0,A.HW)().uid}),{firstDay:m(this.firstDay),lastDay:m(this.lastDay),status:this.status,message:this.message}),(0,T.Te)(this.$t("dav","Absence saved"))}catch(t){(0,T.Qg)(this.$t("dav","Failed to save your absence settings")),h.error("Could not save absence",{error:t})}finally{this.loading=!1}}},asyncclearAbsence(){this.loading=!0;try{awaitu.A.delete((0,c.KT)("/apps/dav/api/v1/outOfOffice/{userId}",{userId:(0,A.HW)().uid})),this.resetForm(),(0,T.Te)(this.$t("dav","Absence cleared"))}catch(t){(0,T.Qg)(this.$t("dav","Failed to clear your absence settings")),h.error("Could not clear absence",{error:t})}finally{this.loading=!1}}}};varg=e(85072),y=e.n(g),E=e(97825),C=e.n(E),b=e(77659),x=e.n(b),U=e(55056),_=e.n(U),D=e(10540),k=e.n(D),B=e(41113),M=e.n(B),w=e(55095),W={};W.styleTagTransform=M(),W.setAttributes=_(),W.insert=x().bind(null,"head"),W.domAPI=C(),W.insertStyleElement=k(),y()(w.A,W),w.A&&w.A.locals&&w.A.locals;varP=e(14486);constI=(0,P.A)(v,(function(){vart=this,n=t._self._c;returnn("form",{staticClass:"absence",on:{submit:function(n){returnn.preventDefault(),t.saveForm.apply(null,arguments)}}},[n("div",{staticClass:"absence__dates"},[n("NcDateTimePickerNative",{staticClass:"absence__dates__picker",attrs:{id:"absence-first-day",label:t.$t("dav","First day"),required:!0},model:{value:t.firstDay,callback:function(n){t.firstDay=n},expression:"firstDay"}}),t._v(" "),n("NcDateTimePickerNative",{staticClass:"absence__dates__picker",attrs:{id:"absence-last-day",label:t.$t("dav","Last day (inclusive)"),required:!0},model:{value:t.lastDay,callback:function(n){t.lastDay=n},expression:"lastDay"}})],1),t._v(" "),n("NcTextField",{attrs:{value:t.status,label:t.$t("dav","Short absence status"),required:!0},on:{"update:value":function(n){t.status=n}}}),t._v(" "),n("NcTextArea",{attrs:{value:t.message,label:t.$t("dav","Long absence Message"),required:!0},on:{"update:value":function(n){t.message=n}}}),t._v(" "),n("div",{staticClass:"absence__buttons"},[n("NcButton",{attrs:{disabled:t.loading||!t.valid,type:"primary","native-type":"submit"}},[t._v("\n\t\t\t"+t._s(t.$t("dav","Save"))+"\n\t\t")]),t._v(" "),n("NcButton",{attrs:{disabled:t.loading||!t.valid,type:"error"},on:{click:t.clearAbsence}},[t._v("\n\t\t\t"+t._s(t.$t("dav","Disable absence"))+"\n\t\t")])],1)],1)}),[],!1,null,"716172ba",null).exports;varN=e(50506),R={};R.styleTagTransform=M(),R.setAttributes=_(),R.insert=x().bind(null,"head"),R.domAPI=C(),R.insertStyleElement=k(),y()(N.A,R),N.A&&N.A.locals&&N.A.locals;varO=e(11037),F=e(27577),G=e(46447),j=e(76225),z=e(18562),K=e(76225);functionL(t,n,a,e,r,s,i,o){vard,l="function"==typeoft?t.options:t;if(n&&(l.render=n,l.staticRenderFns=a,l._compiled=!0),e&&(l.functional=!0),s&&(l._scopeId="data-v-"+s),i?(d=function(t){!(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&