(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5795],{62347:function(e,t,a){"use strict";a.d(t,{$T:function(){return G},GM:function(){return B},GR:function(){return M},Iw:function(){return U},LV:function(){return K},Lq:function(){return Q},Mo:function(){return F},TR:function(){return V},VV:function(){return P},_0:function(){return D},_Q:function(){return O},aB:function(){return A},c_:function(){return T},dd:function(){return Z},ds:function(){return L},iw:function(){return N},r6:function(){return j},sO:function(){return b},se:function(){return x},tl:function(){return C},tq:function(){return k},u2:function(){return H},uP:function(){return W},uV:function(){return E},w2:function(){return $},y_:function(){return w},zq:function(){return _}});var o=a(5121),n=a(63465),r=a.n(n),s=a(52153),i=a.n(s),d=a(36808),c=a.n(d),l=a(86455),m=a.n(l),u=a(77630),g=a.n(u),p=a(57632),h=a(58003),I=a(34511);a(19755),a(39332);var y=a(23123),f=a(35121);let v=()=>window.location.pathname.includes("ar"),S={3:{name:"Misr-ElKheir",merchantid:"MID-1978-894",endpoint:h.Q9,mode:"live",IsAbroad:!1},178:{name:"FFNCI",merchantid:"MID-28556-307",endpoint:h.Q9,mode:"live",IsAbroad:!1},9:{EGP:{name:"magdy",merchantid:"MID-4578-75",endpoint:h.Q9,mode:"live",IsAbroad:!1},USD:{name:"magdy",merchantid:"MID-4578-75",endpoint:h.Q9,mode:"live",IsAbroad:!0}},164:{name:"gozam",merchantid:"MID-22592-76",endpoint:h.Q9,mode:"live",IsAbroad:!1},147:{name:"dyarna",merchantid:"MID-23552-762",endpoint:h.Q9,mode:"live",IsAbroad:!1},136:{name:"relief",merchantid:"MID-15091-110",endpoint:h.Q9,mode:"live",IsAbroad:!1},132:{name:"Ola",merchantid:"MID-20323-560",endpoint:h.Q9,mode:"live",IsAbroad:!1},114:{name:"Attaa-El-Samaa",merchantid:"MID-19018-343",endpoint:h.Q9,mode:"live",IsAbroad:!1},209:{name:"Al-Assem",merchantid:"MID-27889-442",endpoint:h.Q9,mode:"live",IsAbroad:!1},201:{name:"Sabat",merchantid:"MID-37072-901",endpoint:h.Q9,mode:"live",IsAbroad:!1},253:{name:"Share-Khier-for-orphans",merchantid:"MID-16158-421",endpoint:h.Q9,mode:"live",IsAbroad:!1}},D=e=>async t=>{let a=g()(m()),n={headers:{"Content-Type":"application/json"}};return new Promise((r,s)=>{t({type:I.k1}),o.Z.post(h.pS,e,n).then(o=>{1==o.data.Status?(t({type:I.hk,payload:o.data.Data}),sessionStorage.setItem("Email",e.Email),sessionStorage.setItem("Mobile",e.Mobile),sessionStorage.setItem("Password",e.Password),sessionStorage.setItem("userId",o.data.Data.UserId),r(o.data.Message)):(t({type:I.K_,payload:o.data.Message}),a.fire({icon:"error",title:"حدث خطأ...",text:o.data.Message}),s(),setTimeout(()=>{t({type:I.I4})},1e4))}).catch(e=>{var o,n;t({type:I.K_,payload:e.response&&e.response.data.Message?e.response.data.Message:e.message}),a.fire({icon:"error",title:"حدث خطأ...",text:null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(o=n.data)||void 0===o?void 0:o.Message}),s(),setTimeout(()=>{t({type:I.I4})},1e4)})})},_=(e,t)=>async a=>{let n={headers:{method:"get","Content-Type":"application/json"},url:h.k4+"userId=".concat(e,"&code=").concat(t)};(0,o.Z)(n).then(e=>{1===e.data.Status?a({type:I.nn,payload:"done"}):(a({type:I.kF}),console.log(e))}).catch(e=>{a({type:I.kF}),console.log(e.response)})},b=e=>async t=>{t({type:I.mA}),o.Z.post(h.bc,e,{headers:{method:"Post","Content-Type":"application/json"}}).then(a=>{if(1===a.data.Status){var o,n,r,s,i,d,l,m,u,g,p,h;c().set("user",a.data.Data.Token),c().set("userData",a.data.Data),c().set("userID",a.data.Data.User_Id),localStorage.setItem("email",null==a?void 0:null===(r=a.data)||void 0===r?void 0:null===(n=r.Data)||void 0===n?void 0:null===(o=n.User)||void 0===o?void 0:o.Email),localStorage.setItem("mobile",null==a?void 0:null===(d=a.data)||void 0===d?void 0:null===(i=d.Data)||void 0===i?void 0:null===(s=i.User)||void 0===s?void 0:s.Mobile),localStorage.setItem("name",null==a?void 0:null===(u=a.data)||void 0===u?void 0:null===(m=u.Data)||void 0===m?void 0:null===(l=m.User)||void 0===l?void 0:l.UserName),localStorage.setItem("img",null==a?void 0:null===(h=a.data)||void 0===h?void 0:null===(p=h.Data)||void 0===p?void 0:null===(g=p.User)||void 0===g?void 0:g.ProfilePic),t({type:I.wW,payload:a.data.Data})}0===a.data.Status&&"تم ارسال رسالة تأكيد حسابك علي رقم هاتفك والبريد الالكتروني برجاء تفعيل الحساب اولا"==a.data.Message?(t({type:I.P,payload:a.data.Message}),sessionStorage.setItem("Email",e.Username),sessionStorage.setItem("Password",e.Password),sessionStorage.setItem("userId",a.data.Data.User_Id),sessionStorage.setItem("mobile",a.data.Data.Mobile),sessionStorage.setItem("fromLogin",!0),setTimeout(()=>{window.location.replace("/CheckOtp")},3e3)):t({type:I.P,payload:a.data.Message})}).catch(e=>{var a,o;console.log("error ",e),t({type:I.P,payload:null==e?void 0:null===(o=e.response)||void 0===o?void 0:null===(a=o.data)||void 0===a?void 0:a.Message})})},k=e=>async t=>{let a={headers:{method:"get","Content-Type":"application/json"},url:h.bk+e};return new Promise((e,n)=>{t({type:I.A0}),(0,o.Z)(a).then(a=>{1===a.data.Status&&(t({type:I.sS}),e())}).catch(e=>{t({type:I.jT}),console.log(e.response),n()})})},M=e=>async t=>{let a={method:"post",headers:{"Content-Type":"application/json"},url:h.$u,data:e};return new Promise((e,t)=>{(0,o.Z)(a).then(a=>{1===a.data.Status?e(a.data):t(a)}).catch(e=>{console.log(e.response),t(e.response)})})},w=e=>async t=>{t({type:I.ab});let a={method:"post",headers:{method:"Post","Content-Type":"application/json"},url:"/api/donate",data:e};return new Promise((e,n)=>{(0,o.Z)(a).then(a=>{t({type:I.ZB}),e()}).catch(e=>{console.log(e),console.log(e.response),t({type:I.I9}),n()})})},C=e=>async t=>{let a={method:"post",headers:{method:"Post","Content-Type":"application/json"},url:"/api/donate",data:e};return new Promise((e,n)=>{t({type:I.hp}),(0,o.Z)(a).then(()=>{t({type:I.FT}),e()}).catch(e=>{console.log(e),console.log(e.response),t({type:I.l8}),n()})})},P=e=>async t=>{let a={method:"get",headers:{"Content-Type":"application/json"},url:h.Q$+e};return new Promise((e,n)=>{t({type:I.iP}),(0,o.Z)(a).then(e=>{1==e.data.Success?t({type:I.kL,payload:e.data.Message}):(t({type:I.OK,payload:e.data.Message}),t({type:I.OK,payload:""}),setTimeout(()=>{t({type:I.OK,payload:e.data.Message})},2500))}).catch(e=>{console.log(e),console.log(e.response),t({type:I.OK}),n()})})},T=(e,t)=>async a=>{let n={method:"get",headers:{"Content-Type":"application/json"},url:h.pR+e+"&token="+t};return new Promise((e,t)=>{a({type:I.fw}),(0,o.Z)(n).then(t=>{1==t.data.Success?(a({type:I.fo,payload:t.data.Message}),a({type:I.Ht,payload:""}),e(!0)):(a({type:I.Ht,payload:t.data.Message}),e(!1),setTimeout(()=>{a({type:I.Ht,payload:""})},2500))}).catch(e=>{console.log(e),console.log(e.response),a({type:I.Ht}),t()})})},A=(e,t,a)=>async a=>{let n=g()(m()),r={method:"post",headers:{method:"Post","Content-Type":"application/json"},url:"/api/donate",data:e};return new Promise((s,i)=>{a({type:I.j2}),(0,o.Z)(r).then(e=>{localStorage.setItem("DonationID",e.data.Id),a({type:I.N5}),s(e)}).then(a=>{let r={method:"get",headers:{method:"Post","Content-Type":"application/json"},url:h.zN+t+"&amount="+e.Amount+"&donationId="+localStorage.getItem("DonationID")};return new Promise((e,t)=>{(0,o.Z)(r).then(t=>{e(t.data.Message),1==t.data.Success?n.fire({icon:"success",title:v()?"Successful Donation":"تم التبرع بنجاح"}).then(()=>{setTimeout(()=>{window.location.assign("https://megakheir.com/payment-success")},2500),localStorage.removeItem("DonationID")}):n.fire({icon:"error",title:"حدث خطأ...",text:t.data.Message})})})}).catch(e=>{console.log(e),console.log(e.response),a({type:I.ze}),i()})})},N=(e,t,a)=>async n=>{console.log(t);let r=g()(m()),s={method:"post",headers:{method:"Post","Content-Type":"application/json"},url:"/api/donate",data:{...e,msisdn:t||e.msisdn}};(0,o.Z)(s).then(s=>{n({type:I.rJ});let i="";i=e.msisdn.startsWith("+20")?e.msisdn.slice(2):e.msisd,s.data;let d=Date.now()+""+Math.floor(62*Math.random());localStorage.setItem("DonationID",s.data.Id.toString());var l={};l.amount=e.Amount,l.campaign_id=null==s?void 0:s.data.Id,l.TransactionNumber=d,l.PaymentTypeId=e.PaymentType_Id,l.Program_Id=e.Program_Id,l.msisdn="yes"==a?i:t,l.email=e.email?e.email:c().get("email"),l.address="",l.area=null,l.city=null,l.channel=1,l.comment="",l.hide_data=!0,l.user_id=s.data.User_Id,l.user_name=c().get("user_name")?c().get("user_name"):"default";var m={method:"post",url:h.c$,data:l};(0,o.Z)(m).then(e=>{var t;n({type:I.Yp}),window.location.replace(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.Message)}).catch(e=>{var t,a;let o=window.location.pathname.includes("/ar");r.fire({icon:"error",title:o?"عذراً":"Sorry !",text:o?null==e?void 0:null===(a=e.response)||void 0===a?void 0:null===(t=a.data)||void 0===t?void 0:t.Message:"Please enter an Egyptian Vodafone number with a Vodafone Cash wallet"})})})},Z=(e,t)=>async a=>{var n={method:"post",url:h.zk+localStorage.getItem("DonationID")+"&transactionId="+e+"&tel="+t,headers:{"Content-Type":"application/json",Cookie:"__cfduid=d8f12f871542e9bf7974ed43bd6280f411612724962"}};return new Promise((e,t)=>{(0,o.Z)(n).then(function(a){"Success"==a.data.Message?(localStorage.removeItem("DonationID"),e("done")):(localStorage.removeItem("DonationID"),t(a.data.Message),console.log("error"))}).then(async()=>{if(localStorage.getItem("gym_userName")){let e=await o.Z.post(h.r_,{Name:localStorage.getItem("gym_userName"),Email:localStorage.getItem("gym_userEmail")?localStorage.getItem("gym_userEmail"):c().get("email"),Mobile:localStorage.getItem("gym_userPhoneNumber"),Ngo:localStorage.getItem("gym_NGO"),WillAttend:localStorage.getItem("Time_Slot")&&"true",TimeSlot:localStorage.getItem("gym_timeSlot")||null});console.log(await e.data)}}).catch(function(e){sessionStorage.removeItem("vCashNum"),localStorage.removeItem("DonationID"),t(e.response)})})},E=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"EGP",a=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0;return async i=>{g()(m()),e.isAbroad="EGP"!=t,i({type:I.ab}),(0,o.Z)({method:"post",headers:{method:"Post","Content-Type":"application/json"},url:"/api/donate",data:e}).then(d=>{let c=d.data,l=Date.now()+""+Math.floor(62*Math.random());var m,u,g={};if(g.amount=a,g.CampaignId=e.CampaignId?e.CampaignId:"",g.donationId=null==d?void 0:d.data.Id,localStorage.setItem("DonationID",null==d?void 0:null===(u=d.data)||void 0===u?void 0:null===(m=u.Id)||void 0===m?void 0:m.toString()),g.TransactionNumber=l,g.PaymentTypeId=e.PaymentType_Id,e.campaignId=r&&e.CampaignId,g.Program_Id=e.Program_Id,54==n)R(e,c,r,s);else if(1==n)return new Promise((t,a)=>{let n={method:"post",url:"https://ngos.megakheir.com:8080/MK_OnlinePayment/api/PayMob/StartPaymobTransation",headers:{"Content-Type":"application/json"},data:{...g,customerFirstName:e.firstName,customerLastName:e.lastName,customerEmail:e.email,msisdn:e.msisdn,currency:"EGP"}};(0,o.Z)(n).then(async e=>{window.location.href=e.data.Data.URL})});else if(92==n||23==n)return new Promise((t,a)=>{let n={method:"post",url:h.K7,headers:{"Content-Type":"application/json",Cookie:"__cfduid=d0e6041367c5b0d0d11a8edac693ed6101618134710"},data:{...g,address1:e.helalAddress,address2:"",city:e.helalCountry,customerEmail:e.email,name:e.firstName+" "+e.lastName,msisdn:e.msisdn,customerFirstName:e.firstName,customerLastName:e.lastName,customerSurName:e.firstName+" "+e.lastName,currency:"EGP",countryISOCode:e.isoCountry}};(0,o.Z)(n).then(async e=>{(0,p.Z)(),new Date().toISOString().replace(/T/," ").replace(/\..+/,"");let t=e.data.Data.formData,a=document.createElement("form");a.setAttribute("method","post"),a.setAttribute("id","payment_confirmation"),a.setAttribute("action","https://secureacceptance.cybersource.com/pay"),a.setAttribute("accept-charset","utf-8"),Object.keys(t).forEach(e=>{if("submit"!==t[e]){let o=document.createElement("input");o.setAttribute("type","hidden"),o.setAttribute("name",e),o.setAttribute("id",e),o.setAttribute("value",t[e]),a.appendChild(o)}});let o=document.createElement("input");o.setAttribute("type","submit"),a.appendChild(o),document.body.appendChild(a),a.submit()})});else if(25==n)return new Promise((e,t)=>{let a={method:"post",url:h.K7,headers:{"Content-Type":"application/json",Cookie:"__cfduid=d0e6041367c5b0d0d11a8edac693ed6101618134710"},data:g};i({type:I.kj}),(0,o.Z)(a).then(e=>{let t={};t.access_key="6bf78705eed53b0d94f1933c168b75ce",t.device_fingerprint_id="23111d6293df3ch98939638f14af169",t.profile_id="7FE24F3E-F94F-479E-98A3-7C158784B64B",t.locale="en",t.transaction_type="sale",t.currency="EGP",t.reference_number=g.TransactionNumber,t.amount=g.amount,t.transaction_uuid=e.data.Data.transaction_uuid,t.signed_date_time=e.data.Data.signed_date_time,t.signature=e.data.Data.signature,t.unsigned_field_names="",t.signed_field_names=t.profile_id+t.access_key+t.unsigned_field_names+t.locale+t.transaction_type+t.currency+t.reference_number+t.signed_field_names+t.transaction_uuid+t.signed_date_time+t.amount,i({type:I.M2,payload:t})})});else if(S[n]){let e=9===n&&S[n][t]||S[n];var y={};y.name="test",y.IsAbroad=e.IsAbroad,y.Program_Id=r?"":d.data.Program_Id,y.msisdn=localStorage.getItem("mobile")?localStorage.getItem("mobile"):"01099466529",y.amount=g.amount,y.TransactionNumber=Date.now()+""+Math.floor(62*Math.random()),y.donationID=d.data.Id,y.CampaignId=g.CampaignId;var f={method:"post",url:e.endpoint,headers:{method:"Post","Content-Type":"application/json"},data:y};return new Promise((a,s)=>{(0,o.Z)(f).then(o=>{if(r){let a=g.CampaignId.trim();if(void 0!=r)var s=' ')}else s='\n ');i({type:I.ay,payload:s}),a(s)}).catch(e=>{console.log(e),s(e)})})}else if(135==n||156==n||115==n||205==n||206==n||220==n){let t={};t.Program_Id=r?"":d.data.Program_Id,t.msisdn=localStorage.getItem("mobile")?localStorage.getItem("mobile"):"01099466529",t.amount=d.data.Amount,t.donationID=d.data.Id,t.CampaignId=g.CampaignId,t.PaymentTypeId=e.PaymentType_Id,t.customerFirstName=e.firstName,t.customerLastName=e.lastName,t.Email=e.email;let a={method:"post",url:h.Dn,headers:{"Content-Type":"application/json"},data:t};(0,o.Z)(a).then(e=>{window.location.href="".concat(e.data.Data.payment_data.redirectTo)})}else{g.name="",g.msisdn=localStorage.getItem("mobile"),g.isAbroad=!1;let e={method:"post",headers:{method:"Post","Content-Type":"application/json"},url:h.lU,data:g};(0,o.Z)(e).then(e=>{1===e.data.Success&&(49==n?(localStorage.setItem("ngoId",n),window.Checkout.configure({session:{id:e.data.Message}}),document.getElementById("showLightbox").click()):4==n?(localStorage.setItem("ngoId",n),window.Checkout.configure({session:{id:e.data.Message}}),document.getElementById("showLightbox").click()):217==n?(localStorage.setItem("ngoId",n),window.Checkout.configure({session:{id:e.data.Message}}),document.getElementById("showLightbox").click()):150==n?(localStorage.setItem("ngoId",n),window.Checkout.configure({session:{id:e.data.Message}}),document.getElementById("showLightbox").click()):29==n?(localStorage.setItem("ngoId",n),window.Checkout.configure({session:{id:e.data.Message}}),document.getElementById("showPaymentPage").click()):7==n?(localStorage.setItem("ngoId",n),window.Checkout.configure({session:{id:e.data.Message}}),document.getElementById("showPaymentPage").click()):117==n&&(localStorage.setItem("ngoId",n),window.Checkout.configure({session:{id:e.data.Message}}),document.getElementById("showLightbox").click()))})}}).catch(e=>{var t;console.log(e),console.log(e.response),m().fire({icon:"error",text:e.response.message}),(null==e?void 0:null===(t=e.response)||void 0===t?void 0:t.status)==401&&(c().remove("user"),c().remove("userID"),localStorage.clear())})}},j=(e,t)=>async a=>{g()(m()).fire({title:" هل تريد التبرع من داخل مصر ".concat(e.Amount," ج.م ام من خارج مصر ").concat(e.Amount," دولار؟"),showDenyButton:!0,confirmButtonText:"من الخارج",confirmButtonColor:"#00b964",denyButtonText:"من مصر"}).then(function(n){n.isConfirmed?(e.isAbroad=!0,(0,o.Z)({method:"post",headers:{method:"Post","Content-Type":"application/json"},url:"/api/donate",data:e}).then(n=>{var r={};r.CampaignId=t&&e.CampaignId?e.CampaignId:"",localStorage.setItem("DonationID",n.data.Id.toString()),r.Program_Id=t?"":e.Program_Id;var s={};s.name="test",s.Program_Id=t?"":n.data.Program_Id,s.msisdn=localStorage.getItem("mobile")?localStorage.getItem("mobile"):"01099466529",s.amount=n.data.Amount,s.TransactionNumber=Date.now()+""+Math.floor(62*Math.random()),s.donationID=n.data.Id,s.CampaignId=r.CampaignId,s.isAbroad=!0;var i={method:"post",url:h.Q9,headers:{method:"Post","Content-Type":"application/json"},data:s};return new Promise((n,r)=>{(0,o.Z)(i).then(o=>{if(t){let a=e.CampaignId.trim();if(void 0!=t)var r='\n ')}else r='\n ');a({type:I.ay,payload:r}),n(r)}).catch(e=>{console.log(e),r(e)})})})):(e.isAbroad=!1,(0,o.Z)({method:"post",headers:{method:"Post","Content-Type":"application/json"},url:"/api/donate",data:e}).then(n=>{var r={};r.CampaignId=t&&e.CampaignId?e.CampaignId:"",localStorage.setItem("DonationID",n.data.Id.toString()),r.Program_Id=t?"":e.Program_Id;var s={};s.name="test",s.Program_Id=t?"":n.data.Program_Id,s.msisdn=localStorage.getItem("mobile")?localStorage.getItem("mobile"):"01099466529",s.amount=n.data.Amount,s.TransactionNumber=Date.now()+""+Math.floor(62*Math.random()),s.donationID=n.data.Id,s.CampaignId=r.CampaignId,s.isAbroad=!1;var i={method:"post",url:h.Q9,headers:{method:"Post","Content-Type":"application/json"},data:s};return new Promise((e,n)=>{(0,o.Z)(i).then(o=>{if(t){let e=r.CampaignId.trim();if(void 0!=t)var n='\n ')}else n='\n ');a({type:I.ay,payload:n}),e(n)}).catch(e=>{console.log(e),n(e)})})}))})},B=(e,t)=>async a=>{g()(m()).fire({title:" هل تريد التبرع من داخل مصر ".concat(e.Amount," ج.م ام من خارج مصر ").concat(e.Amount," دولار؟"),showDenyButton:!0,confirmButtonText:"من الخارج",confirmButtonColor:"#00b964",denyButtonText:"من مصر"}).then(function(n){e.IsAbroad=n.isConfirmed,a({type:I.ab}),(0,o.Z)({method:"post",headers:{method:"Post","Content-Type":"application/json"},url:"/api/donate",data:e}).then(a=>{a.data;let r=Date.now()+""+Math.floor(62*Math.random());var s={};s.amount=e.Amount,s.isAbroad=n.isConfirmed,console.log(e,"form222"),s.CampaignId=e.CampaignId?e.CampaignId:"",s.donationId=null==a?void 0:a.data.Id,localStorage.setItem("DonationID",a.data.Id.toString()),s.TransactionNumber=r,s.PaymentTypeId=e.PaymentType_Id,s.Program_Id=t?"":e.Program_Id,s.name="",s.msisdn=localStorage.getItem("mobile");let i={method:"post",headers:{method:"Post","Content-Type":"application/json"},url:h.lU,data:s};(0,o.Z)(i).then(e=>{1===e.data.Success&&(localStorage.setItem("ngoId",13),window.Checkout.configure({session:{id:e.data.Message}}),document.getElementById("showLightbox").click())})}).catch(e=>{var t;console.log(e),console.log(e.response),m().fire({icon:"error",text:"error"}),(null==e?void 0:null===(t=e.response)||void 0===t?void 0:t.status)==401&&(c().remove("user"),c().remove("userID"),localStorage.clear(),window.location.href="https://ngos.megakheir.com/")})})},R=(e,t,a,n)=>{let s=Math.floor(1e10*Math.random()),d="jlFEdJIDrj1xQ7j/p1JSgQ==",c=t.User_Id,l=(Math.round((null==t?void 0:t.Amount)*100)/100).toFixed(2),m=a?"https://ngos.megakheir.com/Transaction?vendor=MERSAL&success=True&campaignId="+t.CampaignId:"https://ngos.megakheir.com/Transaction?vendor=MERSAL&success=True&ngoId=54",u=i()(d+s+c+m+s+l+"5b4548d6d1ad409e8f842473a978cbd4").toString(r()),g={name:"",amount:t.Amount,msisdn:e.msisdn,donationID:t.Id,Program_Id:"",TransactionNumber:s,isAbroad:!1};o.Z.post(h.AE,g).then(t=>{let a={merchantCode:d,merchantRefNum:s,customerMobile:e.msisdn,customerEmail:e.email,customerName:n,customerProfileId:c,paymentMethod:"CARD",chargeItems:[{itemId:s,price:l,quantity:1}],returnUrl:m,authCaptureModePayment:!1,signature:u};var r={method:"post",url:h.M9,data:a};return new Promise((e,t)=>{(0,o.Z)(r).then(e=>{console.log("ressss",e),window.location.replace(e.data)}).catch(e=>{console.log("error",e)})})})},O=(e,t)=>async a=>{var n=localStorage.getItem("DonationID");let r={method:"post",url:h.LE,headers:{"Content-Type":"application/json"},data:n};return g()(m()),new Promise((a,n)=>{(0,o.Z)(r).then(n=>{let r={method:"post",url:h.BB,headers:{"Content-Type":"application/json",Cookie:"__cfduid=d8f12f871542e9bf7974ed43bd6280f411612724962"},data:e};console.log(r,"configggggggggggg"),(0,o.Z)(r).then(e=>{a(),t?console.log("thank you",e):a()}).then(async()=>{if(localStorage.getItem("gym_userName")){let e=await o.Z.post(h.r_,{Name:localStorage.getItem("gym_userName"),Email:localStorage.getItem("gym_userEmail")?localStorage.getItem("gym_userEmail"):c().get("email"),Mobile:localStorage.getItem("gym_userPhoneNumber"),Ngo:localStorage.getItem("gym_NGO"),WillAttend:localStorage.getItem("Time_Slot")&&"true",TimeSlot:localStorage.getItem("gym_timeSlot")||null});await e.data}})})})},F=(e,t)=>async a=>{let n=g()(m()),r={type:e.type,referenceNumber:"",merchantRefNumber:"",orderAmount:"",paymentAmount:"",fawryFees:"",expirationTime:"",customerName:"",customerMobile:"",customerMail:"",customerProfileId:"",signature:"",statusCode:e.statusCode,statusDescription:e.statusDescription};var s={method:"post",url:h.BB,headers:{"Content-Type":"application/json"},data:r};return new Promise((a,r)=>{(0,o.Z)(s).then(a=>{t?console.log("thank you",a):n.fire({icon:"error",title:"حدث خطأ...",text:e.statusDescription}).then(()=>{window.location.reload(!0),history.back()})})})},x=(e,t)=>async e=>{let t=y.Z.getItem("_gtm"),a=g()(m()),n=(null==t?void 0:t.ngoId)||localStorage.getItem("ngoId"),r=29==n||7==n?"CIB":"BMISR";(0,f.I0)("donation_done",{...t,vendor:r,paymentStatus:"success"}),a.fire({icon:"success",title:v()?"Successful Donation":"تم التبرع بنجاح"});let s=localStorage.getItem("DonationID");if(!s){console.error("DonationID not found in localStorage"),y.Z.removeItem("_gtm"),localStorage.removeItem("ngoId"),setTimeout(()=>{window.location.assign("https://megakheir.com/payment-success")},2500);return}let i={method:"post",url:h.pj,headers:{"Content-Type":"application/json",Cookie:"__cfduid=d15f2def964b33adc6817667ed6ca9c0b1603792459"},data:s};(0,o.Z)(i).then(function(t){console.log("API Response:",t.data),e({type:I.ZB}),y.Z.removeItem("_gtm"),localStorage.removeItem("DonationID"),localStorage.removeItem("ngoId"),setTimeout(()=>{window.location.assign("https://megakheir.com/payment-success")},2500)}).catch(function(a){console.error("API Error:",a),(0,f.I0)("donation_failed",{...t,vendor:r,paymentStatus:"failed"}),y.Z.removeItem("_gtm"),e({type:I.ZB}),localStorage.removeItem("DonationID"),localStorage.removeItem("ngoId"),setTimeout(()=>{window.location.assign("https://megakheir.com/payment-success")},2500)})},G=()=>async e=>{let t=y.Z.getItem("_gtm"),a=(null==t?void 0:t.ngoId)||localStorage.getItem("ngoId");alert("You have cancelled your donation. Feel free to try again when you're ready."),(0,f.I0)("donation_canceled",{...t,vendor:29==a||7==a?"CIB":"BMISR",paymentStatus:"canceled"}),y.Z.removeItem("_gtm"),localStorage.removeItem("DonationID"),localStorage.removeItem("ngoId"),e({type:I.ZB})},K=()=>async e=>{let t=y.Z.getItem("_gtm"),a=(null==t?void 0:t.ngoId)||localStorage.getItem("ngoId");alert("Sorry, there was an error processing your donation. Please try again or contact support if the issue persists."),(0,f.I0)("donation_failed",{...t,vendor:29==a||7==a?"CIB":"BMISR",paymentStatus:"failed"}),y.Z.removeItem("_gtm"),localStorage.removeItem("DonationID"),localStorage.removeItem("ngoId"),e({type:I.ZB}),window.location.replace("/")},L=e=>async t=>{t({type:I.Qj});let a={method:"post",url:h.Ub,data:e};return new Promise((e,n)=>{(0,o.Z)(a).then(a=>{t({type:I.m3}),e(a)}).catch(e=>{t({type:I.m3}),n(e),console.log(e.response)})})},U=()=>async e=>{var t={method:"post",url:h.Mx,headers:{"Content-Type":"application/json",Cookie:"__cfduid=d8f12f871542e9bf7974ed43bd6280f411612724962"},data:localStorage.getItem("DonationID")};let a=y.Z.getItem("_gtm");return new Promise((e,n)=>{(0,o.Z)(t).then(function(t){"Success"==t.data.Message?(localStorage.removeItem("DonationID"),(0,f.I0)("donation_done",{gtm_data:a,vendor:"Kashier",paymentStatus:"Success"}),y.Z.removeItem("_gtm"),e("done")):(localStorage.removeItem("DonationID"),(0,f.I0)("donation_failed",{gtm_data:a,vendor:"Kashier",paymentStatus:"failed"}),y.Z.removeItem("_gtm"),n(t.data.Message),console.log("error"))}).catch(function(e){console.log("error res",e),localStorage.removeItem("DonationID"),n(e.response)})})},Q=e=>async t=>{var a={method:"post",url:h.P5,headers:{"Content-Type":"application/json",Cookie:"__cfduid=d8f12f871542e9bf7974ed43bd6280f411612724962"},data:e};return(0,o.Z)(a).then(e=>e).catch(e=>(console.log("SavekashierUrlRespone error:",e),e))},V=e=>async e=>{var t={method:"post",url:FAILDKASHIR,headers:{"Content-Type":"application/json",Cookie:"__cfduid=d8f12f871542e9bf7974ed43bd6280f411612724962"},data:localStorage.getItem("DonationID")};return new Promise((e,a)=>{(0,o.Z)(t).then(function(t){"Success"==t.data.Message?(localStorage.removeItem("DonationID"),e("done")):(localStorage.removeItem("DonationID"),a(t.data.Message),console.log("error"))}).catch(function(e){console.log("error res",e),localStorage.removeItem("DonationID"),a(e.response)})})},W=e=>async t=>{var a={method:"post",url:h.oX,headers:{"Content-Type":"application/json"},data:e};return new Promise((e,t)=>{(0,o.Z)(a).then(function(a){"Success"==a.data.Message?(localStorage.removeItem("DonationID"),e("done")):(localStorage.removeItem("DonationID"),t(a.data.Message),console.log("error"))}).catch(function(e){console.log("error res",e),localStorage.removeItem("DonationID"),t(e.response)})})},H=e=>async()=>{var t={method:"post",url:h.JE,headers:{"Content-Type":"application/json"},data:e};return new Promise((e,a)=>{(0,o.Z)(t).then(function(t){"Success"==t.data.Message?(localStorage.removeItem("DonationID"),e("done")):(localStorage.removeItem("DonationID"),a(t.data.Message),console.log("error"))}).catch(function(e){console.log("error res",e),localStorage.removeItem("DonationID"),a(e.response)})})},$=()=>async e=>{e({type:I.ZB})}},58003:function(e,t,a){"use strict";a.d(t,{$u:function(){return I},AE:function(){return D},BB:function(){return b},Df:function(){return G},Dn:function(){return f},Dy:function(){return $},Hg:function(){return y},Ie:function(){return F},JE:function(){return S},K7:function(){return P},LE:function(){return _},M9:function(){return U},MH:function(){return Q},Mx:function(){return w},O2:function(){return L},O4:function(){return R},OZ:function(){return V},Ot:function(){return m},P5:function(){return C},Q$:function(){return T},Q9:function(){return M},Ub:function(){return k},Uz:function(){return s},Xg:function(){return o},b$:function(){return i},bc:function(){return c},bk:function(){return p},c$:function(){return Z},e3:function(){return x},fN:function(){return j},g$:function(){return O},gV:function(){return n},gd:function(){return l},hw:function(){return B},jJ:function(){return W},k4:function(){return h},lU:function(){return u},oF:function(){return K},oX:function(){return v},pR:function(){return A},pS:function(){return d},pj:function(){return g},r_:function(){return H},zN:function(){return N},zk:function(){return E}});let o="https://ngos.megakheir.com:8080/MK_Landingpage/Api",n="https://ngos.megakheir.com:8080/MK_Landingpage/Images",r="https://ngos.megakheir.com:8080/MK_OnlinePayment/api",s=o+"/ngoes/GetNGOes",i=o+"/ngoes/GetNGO/",d=o+"/Account/Register",c=o+"/user/Login",l=o+"/DonationPrograms/GetDonationProgramsById?id=",m=o+"/Lookups/GetPaymentTypes?ngoId=",u=r+"/hostedcheckout/GetSessionId",g=r+"/hostedcheckout/Save",p=o+"/Account/resetpassword?email=",h=o+"/Account/ConfirmEmail?",I=o+"/account/resetpasswordconfirmation",y=o+"/DonationPrograms/GetDonationProgramsbyid?id=",f=r+"/Fawaterak/GetPaymentUrl",v=r+"/Fawaterak/Save",S=r+"/Fawaterak/Reject",D=r+"/Fawry/AddTransaction",_=r+"/Fawry/save",b=r+"/Fawry/LogResponse",k=o+"/ContactUs/Contact",M=r+"/kashier/CreateHash",w=r+"/Kashier/Save",C=r+"/kashier/LogkashierResponse",P=r+"/AAIB/GetSignature",T=r+"/OTP/Send?msisdn=",A=r+"/OTP/verify?msisdn=",N=r+"/orange/charging?msisdn=",Z=r+"/VCash/CreateDonation",E=r+"/VCash/Save?id=",j=o+"/campaigns/GetCampaignTypes",B=o+"/campaigns/SendOtp?msisdn=2",R=o+"/Account/VerifyAcountOTP?UserId=",O=o+"/campaigns/CreateCampaign",F=o+"/campaigns/GetCampaigns",x=o+"/user/Campaigns",G=o+"/user/donations",K=o+"/campaigns/GetCampaigns?campid=",L=o+"/Donations/AllDonated?CampaignId=",U="https://atfawry.com/fawrypay-api/api/payments/init",Q=o+"/project/GetProjectCategories",V=o+"/project/GetProjectsByCategoryId?CategoryId=",W=o+"/users/me/campaigns",H="https://ngos.megakheir.com:8080/MK_Landingpage/Api/Donations/AddHonorDonation_fitness",$="https://ngos.megakheir.com:8080/MK_Landingpage/Api/Donations/GetAvailableTimeSlots"},42480:function(){}}]);