1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1889],{51889:function(e,t,n){var s=n(36874),a=n(92594),o=n(54741),i=n(97037),r=n(69690),l=n(23855),c=n(49546),_=n(49151),u=n(99024),d=n(67294),m=n(1866),N=n(67999),E=n(50213),O=n(22531),T=n(55678),x=n(7725),f=n(38210),v=n(40005),p=n(71673),h=n(11163),j=n(65010),A=n(85893);t.Z=function(e){var t,n,R,M,C,P,g,b,S,I,y,L,U,Z,k,F,B,G,w,D,K,Y,q,V,H=e.appointment,W=e.doneCallback,z=(0,d.useState)(0),Q=z[0],X=z[1],$=(0,d.useState)(0),J=$[0],ee=$[1],te=(0,d.useState)(!1),ne=te[0],se=te[1],ae=(0,d.useState)(!1),oe=ae[0],ie=ae[1],re=(0,d.useState)(!1),le=re[0],ce=re[1],_e=(0,d.useState)(!1),ue=_e[0],de=_e[1],me=(0,d.useState)(!1),Ne=me[0],Ee=me[1],Oe=(0,d.useState)(!1),Te=Oe[0],xe=Oe[1],fe=(0,d.useState)(!1),ve=fe[0],pe=fe[1],he=(0,d.useState)(!1),je=he[0],Ae=he[1],Re=(0,d.useState)(!1),Me=Re[0],Ce=Re[1],Pe=(0,d.useState)(0),ge=Pe[0],be=Pe[1],Se=(0,d.useState)(0),Ie=Se[0],ye=Se[1],Le=(0,d.useState)(),Ue=Le[0],Ze=Le[1],ke=(0,O.CG)((function(e){return e.professional.jwt})),Fe=(0,h.useRouter)(),Be=(0,O.CG)((function(e){return e.professional.infos||{}}));return(0,d.useEffect)((function(){X((0,r.Z)((0,l.default)(H.start),(0,l.default)(H.start_pro))),ee((0,r.Z)((0,l.default)(H.end_pro),(0,l.default)(H.end))),se((0,i.iC)(H)),ie((0,i.kA)(H))}),[H]),(0,d.useEffect)((function(){Ze(Be.team.find((function(e){return e.id===H.member_id})))}),[Be]),(0,A.jsxs)("div",{className:"md:mt-4",children:[ne&&(0,A.jsxs)("div",{children:["\ud83d\udeab ",o.oc.t(H.status===v.g.CANCELED_BY_CUSTOMER?"CUSTOMER_APPOINTMENTS_CANCELED_BY_CUSTOMER":"CUSTOMER_APPOINTMENTS_CANCELED_BY_PRO")]}),Be.team.length>1&&Ue&&(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_MEMBER_INFO"),value:"".concat(Ue.firstname," ").concat(Ue.lastname)}),(0,A.jsx)(a.Z,{label:o.oc.t("GLOBAL_BEGIN"),value:(0,i.VI)((0,c.default)((0,l.default)(H.start),"eeee d MMMM HH:mm",{locale:_.Z}))}),(0,A.jsx)(u.Z,{height:1}),(0,A.jsx)(a.Z,{label:o.oc.t("GLOBAL_END"),value:(0,i.VI)((0,c.default)((0,l.default)(H.end),"eeee d MMMM HH:mm",{locale:_.Z}))}),(0,A.jsx)(u.Z,{height:1}),(Q>0||J>0)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{children:o.oc.t("PRO_CALENDAR_APP_SLOT_LABEL")}),(0,A.jsxs)("div",{children:[o.oc.t("GLOBAL_BEGIN")," : ",(0,c.default)((0,l.default)(H.start_pro),"eeee d MMMM HH:mm",{locale:_.Z})," (-",Q," min)"]}),(0,A.jsxs)("div",{children:[o.oc.t("GLOBAL_END")," : ",(0,c.default)((0,l.default)(H.end_pro),"eeee d MMMM HH:mm",{locale:_.Z})," (+",J," min)"]})]}),(0,A.jsx)(a.Z,{label:H.list_presta_cat.length>1?o.oc.t("CUSTOMER_APPOINTMENTS_DETAILS_PRESTA_MANY"):o.oc.t("CUSTOMER_APPOINTMENTS_DETAILS_PRESTA_ONE"),value:H.list_presta_cat.map((function(e,t){return(0,A.jsxs)("div",{children:[e.cat_name&&(0,A.jsxs)("span",{className:"font-bold",children:[e.cat_name," - "]}),e.name]},t)}))}),(0,A.jsx)(u.Z,{height:1}),H.quantity>1&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_QUANTITY"),value:H.quantity+""}),(0,A.jsx)(u.Z,{height:1})]}),H.appointment_type===s.m2.VTC&&!(0,i.xb)(H.appointment_infos_vtc)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_LOCATION_PICK_UP"),value:[(0,A.jsxs)("div",{className:"flex flex-row items-center justify-start",children:[(0,A.jsx)("div",{children:null===(t=H.appointment_infos_vtc)||void 0===t?void 0:t.src_address.formatted_address}),(0,A.jsx)("a",{href:"https://www.google.com/maps/dir/?api=1&destination="+encodeURIComponent(null===(n=H.appointment_infos_vtc)||void 0===n?void 0:n.src_address.formatted_address),target:"_blank",rel:"noreferrer",className:"bg-blue-xLight p-2 rounded-xl ml-3",children:(0,A.jsx)(x.SyZ,{viewBox:"0 0 25 25",className:"text-blue-dark h-5 w-5"})})]},"link")]}),!(0,i.xb)(H.appointment_infos_vtc.dest_address)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(u.Z,{height:1}),(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_LOCATION_DROP"),value:[(0,A.jsxs)("div",{className:"flex flex-row items-center justify-start",children:[(0,A.jsx)("div",{children:H.appointment_infos_vtc.dest_address.formatted_address}),(0,A.jsx)("a",{href:"https://www.google.com/maps/dir/?api=1&destination="+encodeURIComponent(H.appointment_infos_vtc.dest_address.formatted_address),target:"_blank",rel:"noreferrer",className:"bg-blue-xLight p-2 rounded-xl ml-3",children:(0,A.jsx)(x.SyZ,{viewBox:"0 0 25 25",className:"text-blue-dark h-5 w-5"})})]},"link")]})]}),(0,A.jsx)(u.Z,{height:1}),!(0,i.xb)(H.appointment_infos_vtc.invoice_address)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_NAME_INVOICE"),value:[(0,A.jsx)("div",{children:H.appointment_infos_vtc.invoice_address.invoice_name})]}),(0,A.jsx)(u.Z,{height:1}),(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_LOCATION_INVOICE"),value:[(0,A.jsxs)("div",{className:"flex flex-row items-center justify-start",children:[(0,A.jsx)("div",{children:H.appointment_infos_vtc.invoice_address.formatted_address}),(0,A.jsx)("a",{href:"https://www.google.com/maps/dir/?api=1&destination="+encodeURIComponent(H.appointment_infos_vtc.invoice_address.formatted_address),target:"_blank",rel:"noreferrer",className:"bg-blue-xLight p-2 rounded-xl ml-3",children:(0,A.jsx)(x.SyZ,{viewBox:"0 0 25 25",className:"text-blue-dark h-5 w-5"})})]},"link")]}),(0,A.jsx)(u.Z,{height:1})]}),!(0,i.xb)(null===(R=H.appointment_infos_vtc)||void 0===R?void 0:R.nb_luggage)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(u.Z,{height:1}),(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_LUGGAGE"),value:(null===(M=H.appointment_infos_vtc)||void 0===M?void 0:M.nb_luggage)+""})]}),(null===(C=H.appointment_infos_vtc)||void 0===C?void 0:C.vec_name)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(u.Z,{height:1}),(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_VEHICLE"),value:null===(P=H.appointment_infos_vtc)||void 0===P?void 0:P.vec_name})]})]}),(null===(g=H.address)||void 0===g?void 0:g.location_type)&&H.appointment_type===s.m2.STANDARD&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_LOCATION"),value:[(0,A.jsx)("div",{children:null===(b=H.address)||void 0===b?void 0:b.label}),(0,A.jsxs)("div",{className:"flex flew-row items-center",children:[(0,A.jsx)("div",{children:(0,i.eX)({data:null===(S=H.address)||void 0===S?void 0:S.data,location_type:null===(I=H.address)||void 0===I?void 0:I.location_type,location_id:0},null===(y=H.booked_for)||void 0===y?void 0:y.address)}),!(0,i.xb)(null===(L=H.booked_for)||void 0===L?void 0:L.address)&&(0,A.jsx)("a",{href:"https://www.google.com/maps/dir/?api=1&destination="+encodeURIComponent((null===(U=H.booked_for.address)||void 0===U?void 0:U.formatted_address)||""),target:"_blank",rel:"noreferrer",className:"bg-blue-xLight p-2 rounded-xl ml-3",children:(0,A.jsx)(x.SyZ,{viewBox:"0 0 25 25",className:"text-blue-dark h-5 w-5"})})]})]}),(0,A.jsx)(u.Z,{height:1})]}),H.booker.customer_base_id&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a.Z,{label:o.oc.t("PRO_APPOINTMENT_BOOKER_INFO"),value:[(0,A.jsx)("div",{className:"cursor-pointer underline",onClick:function(){return Fe.push("/my-account/pro/customers/"+H.booker.customer_base_id)},children:"".concat(H.booker.lastname||""," ").concat(H.booker.firstname||"")}),(0,A.jsx)("a",{href:"tel:"+H.booker.phone_number,children:(0,i.p0)(H.booker.phone_number)})]}),(0,A.jsx)(u.Z,{height:1})]}),H.comment&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a.Z,{label:o.oc.t("COMMENT_LABEL"),value:[(0,A.jsx)("div",{children:H.comment})]}),(0,A.jsx)(u.Z,{height:1})]}),H.pro_comment&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a.Z,{label:o.oc.t("PRO_COMMENT_LABEL"),value:[(0,A.jsx)("div",{dangerouslySetInnerHTML:{__html:H.pro_comment.replaceAll("\n","<br/><br/>")}},"comment")]}),(0,A.jsx)(u.Z,{height:1})]}),(H.booked_for.lastname||H.booked_for.lastname)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_DETAILS_FOR_WHO"),value:[(0,A.jsx)("div",{children:"".concat(H.booked_for.lastname||""," ").concat(H.booked_for.firstname||"")}),(0,A.jsx)("a",{href:"tel:"+H.booked_for.phone_number,children:(0,i.p0)(H.booked_for.phone_number)})]}),(0,A.jsx)(u.Z,{height:1})]}),!(0,i.xb)(H.full_amount)&&H.full_amount_string&&(0,A.jsxs)("div",{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_PRESTA_PRICE"),value:[(0,A.jsx)("div",{children:H.full_amount_string})]}),(0,A.jsx)(u.Z,{height:1})]}),(null===H||void 0===H||null===(Z=H.payment)||void 0===Z?void 0:Z.status)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"relative cursor-pointer",onClick:function(){return Fe.push("/my-account/pro/payment/".concat(H.payment.payment_id))},children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_PAYMENT"),value:(0,i.tq)(null===H||void 0===H?void 0:H.payment).map((function(e,t){return(0,A.jsx)("div",{className:"my-3",children:e},t)}))}),(0,A.jsx)(x.e0j,{viewBox:"0 0 52.828 52.828",className:"absolute right-0 bottom-0 w-12 h-12 -ml-1.5 rotate-180"})]}),(0,A.jsx)(u.Z,{height:1})]}),!(0,i.xb)(H.payment)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a.Z,{label:o.oc.t("PAYMENT_METHOD_LABEL"),value:o.oc.t(H.payment.payment_method_type.toUpperCase())}),H.payment.status===s.bG.IMPRINT&&!(0,i.xb)(H.payment.imprint_expiration_date)&&(0,A.jsx)(a.Z,{label:o.oc.t("PAYMENT_EXPIRATION_IMPRINT_LABEL"),value:H.payment.imprint_expiration_date})]}),(null===(k=H.payment)||void 0===k?void 0:k.live_left_amount_pay_string)&&(0,A.jsxs)("div",{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_PRICE_LEFT"),value:[(0,A.jsx)("div",{children:H.payment.live_left_amount_pay_string})]}),(0,A.jsx)(u.Z,{height:1})]}),null!=(null===H||void 0===H||null===(F=H.payment)||void 0===F?void 0:F.path_qr_code)&&H.payment.status===s.bG.CREATED&&(0,A.jsxs)("div",{children:[(0,A.jsx)(a.Z,{label:o.oc.t("PAYMENT_QR_CORE"),value:[(0,A.jsx)("img",{src:H.payment.path_qr_code,alt:o.oc.t("PAYMENT_QR_CORE"),className:"w-40 h-40"})]}),(0,A.jsx)(u.Z,{height:1})]}),null!=(null===H||void 0===H||null===(B=H.payment)||void 0===B?void 0:B.path_qr_code)&&H.payment.status===s.bG.CREATED&&(0,A.jsxs)("div",{children:[(0,A.jsx)(a.Z,{label:o.oc.t("PAYMENT_LINK_PAYMENT_LABEL"),value:H.payment.short_payment_url}),(0,A.jsx)(u.Z,{height:1})]}),!(0,i.xb)(H.coupon)&&void 0!=H.coupon&&!(0===H.coupon.coupon_amount&&0===H.coupon.list_prestation.length)&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("div",{className:"relative cursor-pointer",onClick:function(){var e;return Fe.push("/my-account/pro/coupon/".concat(null===(e=H.coupon)||void 0===e?void 0:e.coupon_id))},children:[H.coupon.coupon_amount>0&&(0,A.jsxs)("div",{className:"my-3 text-blue-light",children:[H.coupon.coupon_amount_string," ",o.oc.t("CUSTOMER_APPOINTMENTS_COUPON")]}),H.coupon.list_prestation.length>0&&(0,A.jsxs)("div",{children:[(0,A.jsx)("div",{className:"text-gray-dark font-bold",children:o.oc.t("CUSTOMER_APPOINTMENTS_COUPON")}),(0,A.jsx)("div",{children:H.coupon.list_prestation.map((function(e){return(0,A.jsxs)("div",{className:"my-3 text-blue-light",children:["x",e.quantity_usage," ",e.name]})}))})]}),(0,A.jsx)(x.e0j,{viewBox:"0 0 52.828 52.828",className:"absolute right-0 bottom-0 w-12 h-12 -ml-1.5 rotate-180"})]}),(0,A.jsx)(u.Z,{height:1})]}),(0,A.jsxs)("div",{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_DATE_BOOKING_CREATION"),value:H.created_at}),(0,A.jsx)(u.Z,{height:1})]}),!(0,i.xb)(null===H||void 0===H||null===(G=H.payment)||void 0===G?void 0:G.payment_date)&&(0,A.jsxs)("div",{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_DATE_PAYMENT"),value:H.payment.payment_date}),(0,A.jsx)(u.Z,{height:1})]}),!H.read_only&&(0,A.jsxs)("div",{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_DATE_MAX_CANCEL"),value:H.cancel_date_string}),(0,A.jsx)(u.Z,{height:1})]}),!H.read_only&&ne&&(0,A.jsxs)("div",{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_DATE_CANCELED"),value:H.canceled_date_string}),(0,A.jsx)(u.Z,{height:1})]}),!H.read_only&&ne&&(0,A.jsxs)("div",{children:[(0,A.jsx)(a.Z,{label:o.oc.t("CUSTOMER_APPOINTMENTS_CANCEL_INPUT_MOTIVATION_CANCEL"),value:H.cancel_motivation}),(0,A.jsx)(u.Z,{height:1})]}),!(0,i.xb)(H.extra)&&!(0,i.xb)(H.extra.link)&&!(0,i.xb)(H.extra.source)&&(0,A.jsxs)("div",{children:[(0,A.jsx)(a.Z,{label:"Source",value:[(0,A.jsx)("a",{href:H.extra.link,target:"_blank",className:"capitalize",rel:"noreferrer",children:H.extra.source},"link")]}),(0,A.jsx)(u.Z,{height:1})]}),!H.is_busy&&(0,A.jsxs)("div",{children:[(0,A.jsx)(a.Z,{label:o.oc.t("PRO_CALENDAR_APP_ADD_BUSY_LABEL"),value:"Non : toujours r\xe9servable en ligne"}),(0,A.jsx)(u.Z,{height:1})]}),!H.read_only&&(0,A.jsx)("div",{className:"flex flex-row gap-2",children:(0,A.jsxs)("div",{className:"flex flex-col w-full",children:[!
1oe&&(0,A.jsx)("div",{className:"mt-7 flex-1",children:(0,A.jsx)(m.Z,{title:o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_BUTTON"),loading:!1,type:"green",size:"small",onPress:function(){return de(!0)}})}),(0,i.xb)(null===(w=H.payment)||void 0===w?void 0:w.payment_id)&&(0,A.jsx)("div",{className:"mt-7 flex-1",children:(0,A.jsx)(m.Z,{title:o.oc.t("CREATE_PAYMENT_LABEL"),loading:!1,type:"green",size:"small",onPress:function(){be(H.full_amount/100),pe(!0)}})}),(0,i.xb)(Be.vtc_config)&&(0,A.jsx)("div",{className:"mt-7 flex-1",children:(0,A.jsx)(m.Z,{title:o.oc.t("USE_COUPON_LABEL_APPOINTMENT"),loading:!1,type:"green",size:"small",onPress:function(){return Ce(!0)}})}),oe&&(null===(D=H.payment)||void 0===D?void 0:D.can_withdraw_imprint)&&(0,A.jsx)("div",{className:"mt-7 flex-1",children:(0,A.jsx)(m.Z,{title:o.oc.t("CUSTOMER_APPOINTMENTS_IMPRINT_BUTTON"),loading:!1,type:"green",size:"small",onPress:function(){ye(H.payment.amount_imprint_payment/100),Ee(!0)}})}),(null===H||void 0===H||null===(K=H.payment)||void 0===K?void 0:K.status)===s.bG.PAID&&H.payment.amount_refundable>0&&(0,A.jsx)("div",{className:"mt-7 flex-1",children:(0,A.jsx)(m.Z,{title:o.oc.t("PRO_APPOINTMENTS_PAYMENT_REFUND"),loading:!1,type:"green",size:"small",onPress:function(){xe(!0)}})}),!ne&&(0,A.jsx)("div",{className:"mt-7",children:(0,A.jsx)(m.Z,{title:o.oc.t("CUSTOMER_APPOINTMENTS_CANCEL_BUTTON"),loading:!1,type:"red",size:"small",onPress:function(){return ce(!0)}})}),ne&&(0,A.jsx)("div",{className:"mt-7",children:(0,A.jsx)(m.Z,{title:o.oc.t("CUSTOMER_APPOINTMENTS_DELETE_BUTTON"),loading:je,type:"red",size:"small",onPress:function(){Ae(!0),(0,E.MCL)(H.booking_id,ke).then((function(e){T.Am.success(o.oc.t("CUSTOMER_APPOINTMENTS_DELETE_SUCCESS")),W((0,l.default)(H.start),(0,l.default)(H.end),!1)})).catch((function(e){T.Am.error(o.oc.t("GLOBAL_UNKNOWN_ERROR"))})).finally((function(){return Ae(!1)}))}})})]})}),le&&(0,A.jsx)(N.Z,{title:o.oc.t("CUSTOMER_APPOINTMENTS_CANCEL_ALERT_TITLE"),content:o.oc.t("CUSTOMER_APPOINTMENTS_CANCEL_ALERT_DESCR"),saveLabel:o.oc.t("GLOBAL_CONFIRM"),cancelLabel:o.oc.t("GLOBAL_RETURN"),destructiveModal:!0,action:function(){return(0,E.zEb)(H.booking_id,ke).then((function(e){T.Am.success(o.oc.t("CUSTOMER_APPOINTMENTS_CANCEL_SUCCESS")),se(!0),ce(!1),W((0,l.default)(H.start),(0,l.default)(H.end),!0)})).catch((function(e){T.Am.error(o.oc.t("GLOBAL_UNKNOWN_ERROR"))}))},close:function(){return ce(!1)}}),ue&&(0,A.jsx)(N.Z,{title:o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_ALERT_TITLE"),content:o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_ALERT_DESCR"),saveLabel:o.oc.t("GLOBAL_CONFIRM"),cancelLabel:o.oc.t("GLOBAL_RETURN"),destructiveModal:!1,action:function(){return(0,E.QcG)(H.booking_id,!0,ke).then((function(e){T.Am.success(o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_SUCCESS")),ie(!0),de(!1),W((0,l.default)(H.start),(0,l.default)(H.end),!0)})).catch((function(e){T.Am.error(o.oc.t("GLOBAL_UNKNOWN_ERROR"))}))},close:function(){return de(!1)}}),Ne&&(0,A.jsx)(N.Z,{title:o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_IMPRINT_ALERT_TITLE"),content:(0,A.jsxs)("div",{children:[o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_IMPRINT_ALERT_DESCR"),(0,A.jsx)("br",{}),o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_IMPRINT_ALERT_CONSENT"),(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_IMPRINT_CONSENTED_BEFORE")," ",null===(Y=H.payment)||void 0===Y?void 0:Y.refund_amount_out_time_string," ",o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_IMPRINT_CONSENTED_AFTER"),(0,A.jsx)("br",{}),(0,A.jsx)("br",{}),"Max : ",null===(q=H.payment)||void 0===q?void 0:q.amount_imprint_payment_string,(0,A.jsx)("input",{name:"price",className:f.h,type:"number",value:Ie,onChange:function(e){ye(+e.target.value)},min:.5,max:(null===(V=H.payment)||void 0===V?void 0:V.amount_imprint_payment)/100,step:.01})]}),saveLabel:o.oc.t("GLOBAL_CONFIRM"),cancelLabel:o.oc.t("GLOBAL_RETURN"),destructiveModal:!1,action:function(){var e;return(0,E.TkV)(ke,null===(e=H.payment)||void 0===e?void 0:e.payment_id,{amount:Math.trunc(100*Ie)}).then((function(e){T.Am.success(o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_IMPRINT_SUCCESS")),Ee(!1),W((0,l.default)(H.start),(0,l.default)(H.end),!0)})).catch((function(e){var t="GLOBAL_UNKNOWN_ERROR";(0,i.xb)(e.response.data.error)||(t="CUSTOMER_APPOINTMENTS_WITHDRAW_ERROR_".concat(e.response.data.error)),T.Am.error(o.oc.t(t))}))},close:function(){return Ee(!1)}}),ve&&(0,A.jsx)(N.Z,{title:o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_CREATE_PAYMENT_ALERT_TITLE"),content:(0,A.jsx)("div",{children:Be.stripe_connect_status===s.k9.ACTIVE?(0,A.jsxs)("div",{children:[o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_CREATE_PAYMENT_ALERT_DESCR"),(0,A.jsx)("input",{name:"price",className:f.h,type:"number",value:ge,onChange:function(e){be(+e.target.value)},step:.01})]}):(0,A.jsx)("div",{children:o.oc.t("PAYMENT_ACTIVATION_REQUIRED")}
1)}),saveLabel:Be.stripe_connect_status===s.k9.ACTIVE?o.oc.t("GLOBAL_CONFIRM"):o.oc.t("PAYMENT_ACTIVATE_REQUEST_BUTTON"),cancelLabel:o.oc.t("GLOBAL_RETURN"),destructiveModal:!1,action:function(){var e;return Be.stripe_connect_status!==s.k9.ACTIVE?Fe.push("/my-account/pro/payment"):isNaN(ge)||ge<.5?(T.Am.error(o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_CREATE_PAYMENT_ERROR_AMOUNT")),new Promise((function(e){return e({})}))):(null!==(e=H.payment)&&void 0!==e&&e.payment_id,(0,E.kme)(ke,H.booking_id,{full_amount:ge})).then((function(e){T.Am.success(o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_CREATE_PAYMENT_SUCCESS")),pe(!1),W((0,l.default)(H.start),(0,l.default)(H.end),!0)})).catch((function(e){console.log(e),T.Am.error(o.oc.t("GLOBAL_UNKNOWN_ERROR"))}))},close:function(){return pe(!1)}}),Me&&(0,A.jsx)(j.ZP,{booking_id:H.booking_id,onClose:function(){Ce(!1),W((0,l.default)(H.start),(0,l.default)(H.end),!0)}}),Te&&(0,A.jsx)(p.Z,{payment:H.payment,onConfirm:function(){xe(!1),W((0,l.default)(H.start),(0,l.default)(H.end),!0)},onClose:function(){return xe(!1)}})]})}},65010:function(e,t,n){var s=n(92809),a=n(67294),o=n(54741),i=n(36874),r=n(97037),l=n(67999),c=n(38210),_=n(55678),u=n(50213),d=n(22531),m=n(20076),N=n(96486),E=n(56767),O=n(38109),T=n(72260),x=n(85893);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,s.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=v({},T.GD),h=function(e,t){return(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:"text-gray-dark font-bold my-2",children:e}),t.map((function(e){return(0,x.jsx)("div",{className:"my-5",children:(0,x.jsx)(m.Z,{text:"".concat(e.quantity_left,"/").concat(e.quantity," - ").concat(e.name),color:e.color,size:"small"},e.name)},e.name)}))]})},j=function(e,t){return(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:"text-gray-dark font-bold my-2",children:e}),(0,x.jsx)("div",{className:"ml-6 text-gray-dark font-bold my-2",children:t})]})};t.ZP=function(e){var t,n,s=e.booking_id,T=e.onClose,f=e.coupon_key,A=(0,d.CG)((function(e){return e.professional.jwt})),R=(0,a.useState)(""),M=R[0],C=R[1],P=(0,a.useState)(),g=P[0],b=P[1],S=(0,a.useState)(),I=S[0],y=S[1];(0,a.useEffect)((function(){f&&L()}),[f]);var L=function(){y(!0);var e=(0,r.xb)(f)?{booking_id:s}:{},t=(0,r.xb)(f)?{unique_key:M}:{unique_key:f};return(0,u.Efw)(A,v(v({},t),e)).then((function(e){return b(e.data)})).catch((function(e){var t=o.oc.t("TUNNEL_COUPON_".concat(e.response.data.error));t.startsWith("[missing")?_.Am.error(o.oc.t("GLOBAL_UNKNOWN_ERROR")):_.Am.error(t),T(!1)})).finally((function(){return y(!1)}))};return(0,x.jsx)(l.Z,{title:o.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_USE_COUPON_ALERT_TITLE"),content:(0,x.jsxs)(x.Fragment,{children:[I&&(0,x.jsx)(E.Z,{className:"w-10 h-10 animate-spin block"}),!I&&(0,x.jsxs)("div",{children:[(0,r.xb)(g)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"text-gray-dark font-bold",children:o.oc.t("COUPON_BOOKING_LABEL")}),(0,x.jsx)("div",{children:(0,x.jsx)(O.Z,{placeholder:"04628-9NFFS-2YQED-MVWJ8-JAM3J",styles:p,noOptionsMessage:function(e){return o.oc.t("GLOBAL_NO_RESULT_FOR")+e.inputValue},isClearable:!0,isMulti:!1,cacheOptions:!0,defaultOptions:!0,loadOptions:function(e){return new Promise((function(t,n){e.length<7&&t([]),(0,u.DEX)(A,{coupon_key:e,page:0,page_size:2}).then((function(e){t(e.data.map((function(e){return{label:"".concat(e.unique_key," - ").concat(e.pro_customer.firstname," ").concat(e.pro_customer.lastname),value:e.unique_key}})))})).catch((function(e){return n(e)}))}))},value:M,onChange:function(e){return C(null===e||void 0===e?void 0:e.value)}})})]}),!(0,r.xb)(g)&&(0,x.jsxs)(x.Fragment,{children:[(null===g||void 0===g?void 0:g.before_usage.list_prestation)&&(null===g||void 0===g?void 0:g.after_usage.list_prestation)&&((null===g||void 0===g?void 0:g.before_usage.coupon_type)===i.$i.PACK||(null===g||void 0===g?void 0:g.before_usage.coupon_type)===i.$i.PRESTATION)&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{children:h(o.oc.t("COUPON_BOOKING_BEFORE_USAGE"),null===g||void 0===g?void 0:g.before_usage.list_prestation)}),(0,r.xb)(f)&&(0,x.jsx)("div",{children:h(o.oc.t("COUPON_BOOKING_AFTER_USAGE"),null===g||void 0===g?void 0:g.after_usage.list_prestation)}),(0,x.jsx)("div",{className:"text-gray-dark font-bold my-2",children:o.oc.t("COUPON_BOOKING_PRESTATION_USAGE")}),g&&void 0!=g.usage_infos.list_presta_usage&&(0,x.jsx)("div",{children:g.usage_infos.list_presta_usage.map((function(e,t){var n,s,a;return(0,x.jsxs)("div",{className:"flex flex-row items-center",children:[(0,x.jsx)("div",{className:"max-w-14",children:(0,x.jsx)("input",{className:c.h,type:"number",value:(null===(n=g.usage_infos)||void 0===n||null===(s=n.list_presta_usage)||void 0===s||null===(a=s[t])||void 0===a?void 0:a.quantity)||0,onChange:function(e){var n=(0,N.cloneDeep)(g.usage_infos.list_presta_usage);n&&(n[t].quantity=Number(e.target.value),b(v(v({},g),{},{usage_infos:v(v({},g.usage_infos),{},{list_presta_usage:n})}
1)))},min:0,max:e.before_quantity_left})}),(0,x.jsx)("div",{children:(0,x.jsx)(m.Z,{text:"".concat(e.name),color:e.color,size:"small"},e.name)})]})}))})]}),!(0,r.xb)(g)&&(null===g||void 0===g?void 0:g.before_usage.coupon_type)===i.$i.AMOUNT&&(0,x.jsxs)(x.Fragment,{children:[j(o.oc.t("COUPON_BOOKING_BEFORE_USAGE"),(null===g||void 0===g||null===(t=g.before_usage)||void 0===t?void 0:t.amount_left_string)||""),(0,r.xb)(f)&&(0,x.jsx)("div",{children:j(o.oc.t("COUPON_BOOKING_AFTER_USAGE"),(null===g||void 0===g||null===(n=g.after_usage)||void 0===n?void 0:n.amount_left_string)||"")}),(0,x.jsxs)("div",{className:"text-gray-dark font-bold my-2",children:[o.oc.t("COUPON_BOOKING_AMOUNT_USAGE")," Max: ",g.before_usage.amount_left_string]}),(0,x.jsx)("input",{className:c.h,type:"number",value:g.usage_infos.amount_usage,onChange:function(e){(0,N.cloneDeep)(g.usage_infos)&&(g.usage_infos.amount_usage=Number(e.target.value),b(v(v({},g),{},{usage_infos:g.usage_infos})))},min:1})]})]})]})]}),saveLabel:o.oc.t("GLOBAL_CONFIRM"),cancelLabel:o.oc.t("GLOBAL_RETURN"),destructiveModal:!1,action:function(){if(!(0,r.xb)(g)){var e={};if(null!==g&&void 0!==g&&g.usage_infos.list_presta_usage&&(g.after_usage.coupon_type===i.$i.PACK||g.after_usage.coupon_type===i.$i.PRESTATION))if((e={list_presta_usage:null===g||void 0===g?void 0:g.usage_infos.list_presta_usage.map((function(e){return{quantity:e.quantity,presta_detail_id:e.presta_detail_id}}))}).list_presta_usage.every((function(e){return 0===e.quantity})))return _.Am.error(o.oc.t("COUPON_BOOKING_EMPTY_PRESTA_USAGE")),Promise.resolve();g&&g.after_usage.coupon_type===i.$i.AMOUNT&&null!==g&&void 0!==g&&g.usage_infos.amount_usage&&(e={amount_to_use:100*(null===g||void 0===g?void 0:g.usage_infos.amount_usage)});var t=s?{booking_id:s}:{},n=f?{unique_key:f}:{unique_key:M};return(0,u.e_Y)(A,v(v(v({},n),t),e)).then((function(){_.Am.success(o.oc.t("COUPON_BOOKING_APPLIED_OK")),T(!1)})).catch((function(e){var t=o.oc.t("TUNNEL_COUPON_".concat(e.response.data.error));t.startsWith("[missing")?_.Am.error(o.oc.t("GLOBAL_UNKNOWN_ERROR")):_.Am.error(t)}))}return(0,r.xb)(M)||void 0==M?(_.Am.error(o.oc.t("COUPON_BOOKING_NO_CODE")),Promise.resolve()):s?L():Promise.resolve()},close:function(){return T(!1)}})}},71673:function(e,t,n){var s=n(54741),a=n(38210),o=n(55678),i=n(50213),r=n(67999),l=n(67294),c=n(22531),_=n(85893);t.Z=function(e){var t=e.payment,n=e.onConfirm,u=e.onClose,d=(0,c.CG)((function(e){return e.professional.jwt})),m=(0,l.useState)(t.amount_refundable_no_stripe_fees/100),N=m[0],E=m[1],O=(0,l.useState)("excl_stripe"),T=O[0],x=O[1];return(0,l.useEffect)((function(){t.amount!==t.amount_refundable&&(E(t.amount_refundable/100),x("free"))}),[]),(0,_.jsx)(r.Z,{title:s.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_REFUND_ALERT_TITLE"),content:(0,_.jsxs)("div",{children:[s.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_REFUND_ALERT_DESCR"),(0,_.jsxs)("div",{children:[t.amount===t.amount_refundable&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{className:"flex items-center mx-2",onClick:function(){x("excl_stripe"),E(t.amount_refundable_no_stripe_fees/100)},children:[(0,_.jsx)("input",{type:"radio",name:"refund_type",className:"accent-blue-dark h-4 w-4 cursor-pointer",checked:"excl_stripe"===T}),(0,_.jsxs)("div",{className:"ml-2",children:[(0,_.jsx)("span",{className:"font-bold",children:t.amount_refundable_no_stripe_fees_string})," "+s.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_REFUND_EXCL_STRIPE").replace("%COST%",t.stripe_fees_string)]})]}),(0,_.jsxs)("div",{className:"flex items-center mx-2",onClick:function(){x("incl_stripe"),E(t.amount_refundable/100)},children:[(0,_.jsx)("input",{type:"radio",name:"refund_type",className:"accent-blue-dark h-4 w-4 cursor-pointer",checked:"incl_stripe"===T}),(0,_.jsxs)("div",{className:"ml-2",children:[(0,_.jsx)("span",{className:"font-bold",children:t.amount_refundable_string})," "+s.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_REFUND_INCL_STRIPE").replace("%COST%",t.stripe_fees_string)]})]})]}),(0,_.jsxs)("div",{className:"flex items-center mx-2",onClick:function(){return x("free")},children:[(0,_.jsx)("input",{type:"radio",name:"refund_type",className:"accent-blue-dark h-4 w-4 cursor-pointer",checked:"free"===T}),(0,_.jsx)("div",{className:"ml-2",children:s.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_REFUND_FREE_AMOUNT").replace("%COST%",t.amount_refundable_str
1ing)})]})]}),"free"===T&&(0,_.jsx)("input",{name:"price",className:a.h,type:"number",value:N,onChange:function(e){E(+e.target.value)},min:.5,max:t.amount_refundable/100,step:.01})]}),saveLabel:s.oc.t("GLOBAL_CONFIRM"),cancelLabel:s.oc.t("GLOBAL_RETURN"),destructiveModal:!1,action:function(){return N<.01?(o.Am.error(s.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_REFUND_ERROR_MINIMAL")+" 0.01"+t.currency),new Promise((function(e){return e({})}))):N>t.amount_refundable/100?(o.Am.error(s.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_REFUND_ERROR_MAXIMAL")),new Promise((function(e){return e({})}))):(0,i.wIH)(d,t.payment_id,{amount:Math.round(100*N)}).then((function(e){o.Am.success(s.oc.t("CUSTOMER_APPOINTMENTS_CONFIRM_REFUND_SUCCESS")),n(e.data)})).catch((function(e){console.log(e),o.Am.error(s.oc.t("GLOBAL_UNKNOWN_ERROR"))}))},close:u})}},92594:function(e,t,n){var s=n(85893);t.Z=function(e){var t=e.label,n=e.value,a=e.cy_name;return(0,s.jsxs)("div",{className:"my-2","data-cy":a,children:[(0,s.jsx)("div",{className:"text-gray-dark font-bold",children:t}),(0,s.jsx)("div",{className:"text-blue-light",children:n})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.