1"use strict";(self.webpackChunkmy_app=self.webpackChunkmy_app||[]).push([[2933],{49:(O,y,u)=>{u.d(y,{V:()=>n,X:()=>c});const n={amount:0,cartAmount:0,sipAmount:0,sipCartAmount:0,currency:"INR",isSip:!1,loading:!1,disableAction:!1,donateBtnLabel:"",tipAmount:0,tipPerc:0,sipTipAmount:0,SipTipPerc:0,gCaptchaToken:""},c={enable_sip_switch:!1,is_sip:!1}},2933:(O,y,u)=>{u.d(y,{t:()=>R});var n=u(1222),c=u(8987),_=u(2560),g=u(2340),P=u(635),A=u(9337),E=u(253),m=u(6317),v=u(49),r=u(5313),I=u(7837),C=u(3328),S=u(1349),b=u(1322);let R=(()=>{class a{constructor(){(0,n.Z)(this,"http",(0,_.f3M)(c.eN)),(0,n.Z)(this,"httpBackend",(0,_.f3M)(c.jN)),(0,n.Z)(this,"events",(0,_.f3M)(I.n)),(0,n.Z)(this,"storage",(0,_.f3M)(C.V)),(0,n.Z)(this,"util",(0,_.f3M)(S.f)),(0,n.Z)(this,"vars",(0,_.f3M)(b.a)),(0,n.Z)(this,"subsCountApiCalled",!1),(0,n.Z)(this,"APIURL",this.vars.domainData.apiUrl),(0,n.Z)(this,"httpOptions",{headers:new c.WM({"Content-Type":"application/json"})}),(0,n.Z)(this,"httpOptionsHideError",{headers:new c.WM({"Content-Type":"application/json"}),params:{showError:"false"}}),(0,n.Z)(this,"juspayToken",new E.x),(0,n.Z)(this,"config",v.V),(0,n.Z)(this,"updateConfig$",new m.X(v.V)),(0,n.Z)(this,"onConfigChange$",this.updateConfig$.asObservable()),(0,n.Z)(this,"selectedMode",""),(0,n.Z)(this,"selectedModeValue",""),(0,n.Z)(this,"selectedPaymentModeLabel",""),(0,n.Z)(this,"useSeletedMode",!0)}getConfig(){return{...this.config}}setConfig(t,e=!1){if(e)return this.config={...this.config,...t},void this.updateConfig$.next(t);const i={};for(const s in t){const o=s;void 0!==t[o]&&t[o]!==this.config[o]&&(i[o]=t[o],this.config[o]=t[o])}Object.keys(i).length>0&&this.updateConfig$.next(i)}getContributeDetails(t,e){const i=this.APIURL+r.c.CONTRIBUTE_DETAILS_PAYMENT_FORM(t);return this.http.get(i+e,this.httpOptions)}getPaymentOptions(t,e){let i=`?currency=${t}`;return e&&(i=i.concat(`${e}`)),this.http.get(this.APIURL+r.c.GET_PAYMENT_OPTIONS+i,this.httpOptions)}sendAmount(t,e){const i=this.APIURL+r.c.POST_AMOUNT_DETAILS(e);return this.http.post(i,JSON.stringify(t),this.httpOptions)}placeOrder(t,e){const i=this.APIURL+r.c.PLACE_ORDER(e);return this.http.post(i,JSON.stringify(t),this.httpOptions)}getOrderStatusAfterPayment(t){const e=this.APIURL+r.c.GATEWAY_RESPONSE(t.oi);return this.http.post(e,JSON.stringify(t),this.httpOptions)}sendOrder(t){return this.http.post(this.APIURL+r.c.SEND_ORDER,JSON.stringify(t),this.httpOptions)}juspayTokenGenerate(t){return this.http.jsonp(g.N.juspay+"card/tokenize?"+t,"callback").pipe((0,P.U)(i=>i.results.map(s=>(console.log("asdasdasdasdasd",s),s))),(0,A.b)(i=>console.log("fetched sellers")))}submitToPaymentGateway(t,e,i){const s=t,o=s.url,d=s.method,l=document.createElement("form");if(l.setAttribute("method",d),l.setAttribute("action",o),l.setAttribute("id","payment_form"),l.setAttribute("class","juspay_inline_form"),s.params){const p=s.params;for(const h of Object.keys(p)){const L=p[h],f=document.createElement("input");f.setAttribute("type","hidden"),f.setAttribute("name",h),f.setAttribute("class",h),f.setAttribute("value",L),l.appendChild(f)}}document.body.appendChild(l),"juspay"===e&&"CARD"===i&&(console.log("Juspay submit setup"),this.juspayFormSubmit(),$("#payment_form").submit()),l.submit()}juspayFormSubmit(){Juspay.Setup({payment_form:"#payment_form",success_handler:function(t){console.log("success"),console.log("status",t)},error_handler:function(t,e,i,s,o){console.log("failure"),console.log("error_message",e),console.log("error_code",t),console.log("bank_error_code",i),console.log("bank_error_message",s),console.log("gateway_id",o)}})}getInsurancePremium(t){return this.http.post(this.APIURL+r.c.GET_INSURANCE_PREMIUM,JSON.stringify(t),this.httpOptions)}addInsurance(t){return this.http.post(this.APIURL+r.c.ADD_INSURANCE,JSON.stringify(t),this.httpOptions)}checkPaymentInsurance(t){return this.http.post(this.APIURL+r.c.UPDATE_PAYMENT_INSURANCE,JSON.stringify(t),this.httpOptions)}initiatePayment(t){return this.http.post(this.APIURL+r.c.PAYMENT_INSURANCE,JSON.stringify(t),this.httpOptions)}getInsuranceInfo(t){const e=this.APIURL+r.c.GET_INSURANCE_INFO(t);return this.http.get(e,this.httpOptions)}vpaIdValidation(t){return this.http.post(this.APIURL+r.c.VPA_VALIDATION,JSON.stringify(t),this.httpOptions)}vpaTxnStatus(t){return this.http.post(this.APIURL+r.c.VPA_TXN_STATUS,JSON.stringify(t),this.httpOptions)}isPaytmReady(t){window.JSBridge&&t?t():document.addEventListener("JSBridgeReady",t,!1)}paytmAuthFetch(){const t=g.N.production?"merchant-ketto-prod":"merchant-ketto-uat";return new Promise((e,i)=>{try{this.isPaytmReady(()=>{window.JSBridge.call("paytmFetchAuthCode",{clientId:t},s=>{s.hasOwnProperty("error")?i(s.error):this.paytmLogin(`?code=${s.data.authId}`).subscribe(d=>e(d),d=>i(d))})})}catch{i(!1)}})}paytmLogin(t){const e=this.APIURL+r.c.SOCIAL_LOGIN("paytm");return this.http.get(e+t,this.httpOptions)}getSubscriptions(t){return this.http.get(this.APIURL+r.c.GET_SUBSCRIPTIONS+t,this.httpOptions)}getUserSubscriptions(t){const e=this.APIURL+r.c.GET_LATEST_SUBS+(t||""),i={headers:new c.WM({"Content-Type":"application/json"}),params:{showError:"false"}};return this.http.get(e,i)}simplEligibilityCheck(t){const e={headers:new c.WM({"Content-Type":"application/json"}),params:{showError:"false"}};return this.http.post(this.APIURL+r.c.SIMPL_ELIGIBILITY_CHECK,JSON.stringify(t),e)}sendCriticalIllness(t,e){const i=this.APIURL+r.c.ADD_CRITICAL_ILLNESS(t);return this.http.put(i,JSON.stringify(e),this.httpOptions)}
1addCriticalIllness(t,e,i){const s={info_1:JSON.stringify({person:i?.person,cover:i?.cover,add_on_price:i?.illnessAmount}),info_2:e,info_type:"critical_illness"};this.sendCriticalIllness(t,s).subscribe({next:o=>{}})}createStripeToken(t){const e=new c.eN(this.httpBackend),i={headers:new c.WM({"Content-Type":"application/x-www-form-urlencoded"})},s=new URLSearchParams;for(const o in t)t.hasOwnProperty(o)&&s.set(o,t[o]);return e.post("https://api.stripe.com/v1/tokens",s.toString(),i)}getSubsCount(t){if(!this.subsCountApiCalled||t){this.subsCountApiCalled=!0;let e="";t&&(e="?cause="+t),this.getSubscriptions(e).subscribe(i=>{this.vars.countSubsCause=e.split("=")[1],this.vars.impactData=i.data.data,this.vars.subsCount.next(i.data.data)})}}redirectAfterPayment(t,e){const s=this.storage.getFromSession("cartData")?.showKCart?"/new/kettokart/thankyou":"/new/thankyou",o=this.util.getUserData();if(t?.plan&&t?.cover&&t?.cover_amount&&t?.person&&this.addCriticalIllness(o?.id,t?.oi,{person:+t?.person,cover:t?.cover+" lakh",illnessAmount:+t?.cover_amount}),"success"===e){t?.pledge_more&&this.events.sendSystemEvent({eventName:"pledge_more_confirmed",event_type:"impact",info_1:"position",info_2:`1,${o?.listsubscriptions[t?.sip_cause||"medical"]?.id},${t?.amt}`,info_3:"impact"}).subscribe(h=>h);const d=["amt","info_1","dnr","currency","payment_v","url","st"];let l;return"v2"===t?.payment_v&&t?.k_params?(l=JSON.parse(t.k_params),"f"===t?.st&&t?.tip_amount&&0!=+t?.tip_amount||delete l?.last_success_campaign_id,d.forEach(p=>{delete l[p]})):l={id:t.id,oi:t.oi,or:t.or,social:t.social,payops:t.payops,utm_source:t.utm_source,eventPage:t.eventPage,dnr:t.dnr,tus:t.tus,cause:t.cause,lpm:t.lpm,offer:t.offer,sip_story:t.sip_story,ministoryquiz:t.ministoryquiz,person:t?.person,cover:t?.cover,cover_amount:t?.cover_amount,coupon_code:t?.coupon_code||null,sub_campaign_id:t?.sub_campaign_id||null,otd_sip:t?.otd_sip||null,frtip:t.frtip,coupon:t?.coupon,vendor:t?.vendor,plan:t?.plan,pledge_more:t?.pledge_more||null,...this.vars.utmsObj},l.entity_type=t?.entity_type||null,this.vars.router.navigate([s],{queryParams:l}),this.storage.deleteFromSession(t.oi),void this.storage.delete("abandonedCartOtd")}"failed"===e&&this.failedRedirection(t,o)}failedRedirection(t,e){if("v2"===t.payment_v&&t.k_params){const i={st:"f",...JSON.parse(t.k_params)};return("tp"===t.or||"rfd"===t.or)&&(i.last_success_order_id=e?.latestorder?.order_id||null,i.last_success_campaign_id=e?.latestorder?.campaign_id||null,i.pre_sip_cause=i?.sip_cause||null,i.sip_cause=null),t.u_or&&(i.or=t.u_or),"tp"!==t.or&&(i.ct=null),t?.sip_wallet&&(i.amt=+t.amt/(+t.wallet_tenure||6)),void this.vars.router.navigate([t.url],{queryParams:i})}switch(t.or){case"f":this.vars.router.navigate(["/fundraiser",t.ct],{queryParams:{st:"f",oi:t.oi,id:t.id,social:t.social,payops:t.payops,min_donation:t?.min_donation||null,multi_patient_opted:t?.multi_patient_opted||null,otd_sip:t?.otd_sip||null,...this.vars.utmsObj}});break;case"s":this.vars.router.navigate(["/stories",t.ct],{queryParams:{st:"f",oi:t.oi,id:t.id,social:t.social,payops:t.payops,min_donation:t?.min_donation||null,mini_story:t?.mini_story||null,multi_patient_opted:t?.multi_patient_opted||null,otd_sip:t?.otd_sip||null,...this.vars.utmsObj}});break;case"tp":this.vars.router.navigate(["/new/thankyou",t.ct],{queryParams:{st:"f",oi:t.oi,id:t.id,or:t.typOr,social:t.social,payops:t.payops,last_success_campaign_id:e?.latestorder?.campaign_id||null,last_success_order_id:e?.latestorder?.order_id||null,tip_amount:t?.tip_amount||null,frtip:t?.frtip,multi_patient_opted:t?.multi_patient_opted||null,entity_type:t?.entity_type||null,otd_sip:t?.otd_sip||null,...this.vars.utmsObj}});break;case"up":this.vars.router.navigate(["/new/campaign/campaign_update"],{queryParams:{st:"f",oi:t.oi,id:t.id,or:"up",fmd_id:t.fmd_id,update_id:t.update_id,type:"onetime",action_date:t.action_date,donated_amount:t.donated_amount,donated_currency:t.donated_currency,is_donor:t.is_donor,multi_patient_opted:t?.multi_patient_opted||null,otd_sip:t?.otd_sip||null,...this.vars.utmsObj}});break;case"tann":this.vars.router.navigate(["/new/anniversary"],{queryParams:{st:"f",...this.vars.utmsObj}});break;case"tip":this.vars.router.navigate(["/new/standalonetip"],{queryParams:{st:"f",...this.vars.utmsObj}});break;case"ps":this.vars.router.navigate(["/new/payment"],{queryParams:{ct:t.ct,id:t.
1id,currency:t.pcurrency,st:"f",type:"full",vendor:t.vendor||null,plan:t.plan||null,person:t?.person||null,cover:t?.cover||null,pledge_more:t.pledge_more||null,multi_patient_opted:t?.multi_patient_opted||null,coupon_code:t?.coupon_code||null,otd_sip:t?.otd_sip||null,...this.vars.utmsObj}});break;default:this.vars.router.navigate(["/payment-failed"],{queryParams:{oi:t.oi,id:t.id,reason:t.reason,...this.vars.utmsObj}})}}}return(0,n.Z)(a,"\u0275fac",function(t){return new(t||a)}),(0,n.Z)(a,"\u0275prov",_.Yz7({token:a,factory:a.\u0275fac,providedIn:"root"})),a})()}}]); 2//# sourceMappingURL=2933.d14e4db118cee053.js.map
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.