1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1549],{11457:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/PlanDetails/[id]",function(){return s(81859)}])},14762:function(e,t,s){"use strict";var a=s(85893),n=s(67294),r=s(43495),o=s(8193);let l=e=>{let{isOpen:t,type:s,title:l,subText:i,onConfirm:c,onClose:d,autoClose:u,confirmLabel:m="Confirm",cancelLabel:h="Cancel",showConfirmButton:p=!0,showCancelButton:x=!0,showCloseIcon:g=!0}=e,y=(0,n.useRef)(),[b,v]=(0,n.useState)(!0);(0,n.useEffect)(()=>{let e;return t&&u&&(e=setTimeout(d,1e3*u)),()=>clearTimeout(e)},[t,u,d]),(0,n.useEffect)(()=>{let e=e=>{y.current&&!y.current.contains(e.target)&&d()};return t?document.addEventListener("mousedown",e):document.removeEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t,d]),(0,n.useEffect)(()=>{t&&v(!0)},[t]);let f=async()=>{await c(),v(!1)};return t?(0,a.jsxs)("div",{className:"fixed inset-0 flex items-center justify-center z-[9999] px-4 py-6 sm:px-0 ",children:[(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity"}),(0,a.jsxs)(r.E.div,{ref:y,className:"bg-white p-6 rounded-xl font-primary shadow-2xl relative z-10 w-full max-w-md ",initial:{opacity:0,y:-50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.5,ease:"easeInOut"},children:[(0,a.jsx)(r.E.div,{className:"absolute inset-x-0 -top-8 flex justify-center",initial:{y:-20,opacity:0},animate:{y:0,opacity:1},transition:{duration:.7,ease:"easeInOut"},children:(0,a.jsx)("div",{className:"bg-white w-20 h-20 rounded-full flex items-center justify-center",children:(()=>{switch(s){case"success":return(0,a.jsx)(o.KP3,{className:"text-green-600 h-10 w-10"});case"error":return(0,a.jsx)(o.SV5,{className:"text-red-600 h-10 w-10"});case"warning":return(0,a.jsx)(o.SR5,{className:"text-yellow-600 h-10 w-10"});case"info":return(0,a.jsx)(o.ocf,{className:"text-blue-600 h-10 w-10"});default:return null}})()})}),g&&(0,a.jsx)("button",{onClick:d,className:"absolute top-3 right-3 text-gray-500 hover:text-gray-700",children:(0,a.jsx)(o.SV5,{className:"h-6 w-6"})}),(0,a.jsxs)("div",{className:"text-center mt-10",children:[(0,a.jsx)("h2",{className:"text-xl md:text-2xl font-semibold",children:l}),(0,a.jsx)("p",{className:"text-gray-600 mt-2",children:i})]}),b&&(x||p)&&(0,a.jsxs)("div",{className:"flex justify-center space-x-4 mt-6",children:[x&&(0,a.jsx)("button",{className:"bg-gray-500 hover:bg-gray-600 text-white px-4 py-2 rounded-full transition-all duration-200 ease-in-out",onClick:d,children:h}),p&&(0,a.jsx)("button",{className:"bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-full transition-all duration-200 ease-in-out",onClick:f,children:m})]}),u&&(0,a.jsx)("div",{className:"mt-6 h-1 w-full bg-gray-100 rounded overflow-hidden relative",children:(0,a.jsx)(r.E.div,{className:"h-full bg-primary absolute left-0 top-0",initial:{width:"0%"},animate:{width:"100%"},transition:{ease:"linear",duration:u}})})]})]}):null};t.Z=l},31738:function(e,t,s){"use strict";var a=s(85893),n=s(67294);let r=e=>{let{paymentIframe:t,onClose:s}=e,[r,o]=(0,n.useState)("600px");return(0,n.useEffect)(()=>{let e=e=>{if("https://secure.ccavenue.com"===e.origin){var t;let s=null===(t=e.data)||void 0===t?void 0:t.newHeight;s&&o("".concat(s,"px"))}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[]),t&&(0,a.jsx)("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"relative bg-white rounded-lg shadow-lg w-full max-w-4xl mx-auto",children:[(0,a.jsx)("div",{className:"flex justify-end p-2",children:(0,a.jsx)("button",{onClick:s,className:"text-gray-500 hover:text-gray-800",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})}),(0,a.jsx)("div",{className:"p-4",children:(0,a.jsx)("iframe",{style:{border:"2px s
1olid black",borderRadius:"10px",width:"100%",height:r},scrolling:"yes",frameBorder:"0",id:"paymentFrame",src:t})})]})})};t.Z=r},15268:function(e,t,s){"use strict";var a=s(87066),n=s(43812);let r=n.BUILDER_URL,o=e=>{let{job_id:t,endpoint:s,payload:o,responseData:l,errorMsg:i}=e,c=JSON.stringify(o),d=JSON.stringify(i),u={responseData:JSON.stringify({job_id:t,endpoint:s,payLoad:c,responseData:l,error:d})};(0,n.isDevelopment)()||a.Z.post("".concat(r,"/error-log"),u).then(e=>{200===e.status&&console.log("Success response",e.data)}).catch(e=>{})};t.Z=o},73658:function(e,t,s){"use strict";var a=s(85893),n=s(67294),r=s(733),o=s.n(r),l=s(37351),i=s(25675),c=s.n(i);let d=()=>{let e=(0,n.useContext)(l.ThemeContext),[t,s]=(0,n.useState)("");return((0,n.useEffect)(()=>{e.splashLogo&&""!==e.splashLogo&&s(e.splashLogo)},[e]),t)?(0,a.jsx)("div",{className:"flex justify-center items-center py-40",children:(0,a.jsx)(c(),{width:144,height:144,src:t,alt:"Loading",className:"w-36 h-36 object-contain"})}):(0,a.jsx)("div",{className:"w-full h-full flex justify-center items-center py-40",children:(0,a.jsx)(o(),{type:"spinningBubbles",color:"#000000",height:"10%",width:"10%"})})};t.Z=d},88776:function(e,t,s){"use strict";var a=s(85893);s(67294);var n=s(50657),r=s(33090),o=s(6514),l=s(93946),i=s(50594);let c=e=>{let{open:t,handleClose:s,title:c,content:d,actions:u,fullWidth:m=!0,maxWidth:h="sm"}=e;return(0,a.jsxs)(n.Z,{open:t,maxWidth:h,fullWidth:m,onClose:(e,t)=>{"backdropClick"!==t&&s()},children:[(0,a.jsx)(r.Z,{children:(0,a.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,a.jsxs)("b",{className:"text-primary",children:[" ",c]}),(0,a.jsx)(l.Z,{onClick:s,color:"error","aria-label":"Close",size:"small",children:(0,a.jsx)(i.Z,{})})]})}),(0,a.jsx)(o.Z,{children:(0,a.jsx)("div",{children:d})})]})};t.Z=c},68481:function(e,t,s){"use strict";var a=s(85893),n=s(67294),r=s(89583),o=s(82940),l=s(14762);let i=e=>{let{open:t,handleClose:s,handleSubmit:i,formData:c={}}
1=e,[d,u]=(0,n.useState)(Array(6).fill("")),[m,h]=(0,n.useState)(!1),p=(0,o.b)(),[x,g]=(0,n.useState)(!1),[y,b]=(0,n.useState)({}),v=e=>{b(e),g(!0)},f=()=>{g(!1),y.redirectOnClose&&router.push(y.redirectOnClose)};if(!t)return null;let _=(e,t)=>{let{value:s}=e.target;if(/^\d?$/.test(s)){let a=[...d];a[t]=s,u(a),s&&t<d.length-1&&document.getElementById("otp-input-".concat(t+1)).focus()}},w=(e,t)=>{"Backspace"===e.key&&t>0&&!d[t]&&document.getElementById("otp-input-".concat(t-1)).focus()},j=e=>{let t=e.clipboardData.getData("text").slice(0,6);/^\d{6}$/.test(t)&&u(t.split(""))},C=async()=>{let e=d.join("");if(!e||e.length<6){v({type:"error",title:"Invalid OTP",subText:"Please enter a valid 6-digit OTP.",autoClose:3,showCloseIcon:!1});return}try{h(!0);let t=await p.post("/savings_scheme/verifyNomineeOtp",{otp:e});if(1===t.data.status){var s;setTimeout(()=>{i()},2e3),v({type:"success",title:"Success",subText:(null==t?void 0:null===(s=t.data)||void 0===s?void 0:s.message)||"OTP Verified Successfully!",autoClose:1})}else v({type:"error",title:"Error",subText:t.data.message||"Invalid OTP. Please try again.",autoClose:2})}catch(a){v({type:"error",title:"API Error",subText:"Unable to verify OTP. Please try again later.",autoClose:3})}finally{h(!1)}},N=async()=>{try{let e=await p.post("/savings_scheme/sendNomineeOtp",{mobile_no:null==c?void 0:c.mobile});1===e.data.status?(u(Array(6).fill("")),v({type:"success",title:"Resend",subText:e.data.message||"OTP Resend Successfully!",autoClose:3})):v({type:"error",title:"Error",subText:e.data.message||"Unable to resend OTP.",autoClose:3})}catch(t){v({type:"error",title:"API Error",subText:"Unable to resend OTP. Please try again later.",autoClose:3})}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{onPaste:j,className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full p-6 relative",children:[(0,a.jsx)("button",{onClick:()=>{s(),u(Array(6).fill(""))},className:"absolute top-3 right-3 text-red-500 focus:outline-none",children:(0,a.jsx)(r.aHS,{className:"text-lg"})}),(0,a.jsx)("h2",{className:"text-lg font-bold text-center",children:"Verify OTP"}),(0,a.jsx)("p",{className:"text-sm text-gray-600 text-center",children:"Enter the OTP sent to your registered Email or Mobile number."}),(0,a.jsx)("div",{className:"flex justify-center space-x-2 mt-4",children:d.map((e,t)=>(0,a.jsx)("input",{id:"otp-input-".concat(t),type:"text",maxLength:"1",className:"w-10 h-10 border border-gray-300 rounded-md text-center text-lg font-semibold focus:ring-2 focus:ring-primary",value:e,onChange:e=>_(e,t),onKeyDown:e=>w(e,t)},t))}),(0,a.jsx)("button",{type:"button",onClick:C,disabled:m,className:"w-full mt-4 bg-primary text-white p-2 rounded-md hover:bg-primary-dark transition disabled:opacity-50",children:m?"Verifying...":"Verify OTP"}),(0,a.jsxs)("div",{className:"text-center mt-3",children:[(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"Didnât receive the OTP?"}),(0,a.jsx)("button",{onClick:N,className:"mt-2 text-primary font-semibold hover:underline",children:"Resend OTP"})]})]})}),(0,a.jsx)(l.Z,{isOpen:x,type:y.type,title:y.title,subText:y.subText,onConfirm:f,onClose:f,autoClose:y.autoClose,confirmLabel:"Ok",cancelLabel:"Close",showConfirmButton:y.showConfirmButton,showCancelButton:y.showCancelButton,showCloseIcon:!0})]})};t.Z=i},4422:function(e,t,s){"use strict";var a=s(67294),n=s(82940),r=s(87066),o=s(37351);let l=()=>{let e="#";for(let t=0;t<6;t++)e+="0123456789ABCDEF"[Math.floor(16*Math.random())];return e},i=()=>{let e=new Date,t="".concat(e.getFullYear()).concat((e.getMonth()+1).toString().padStart(2,"0")).concat(e.getDate().toString().padStart(2,"0")).concat(e.getHours().toString().padStart(2,"0")).concat(e.getMinutes().toString().padStart(2,"0")).concat(e.getSeconds().toString().padStart(2,"0"));return t+l()},c=e=>{let t=(0,n.b)(),s=(0,a.useContext)(o.ThemeContext),l=async()=>{if(1===s.siteStatus){let a={};try{let n=await r.Z.get("https://api.ipify.org?format=json"),o=await r.Z.get("https://ipapi.co/".concat(n.data.ip,"/json/"));a=o.data}catch(d){console.warn("Failed to fetch IP details from ipapi.co. Trying fallback...");try{let l=await r.Z.get("https://ipwhois.app/json/");a=l.data}catch(c){console.warn("Failed to fetch IP details from fallback service. Proceeding without IP data.")}}let u={ipDetails:JSON.stringify(a),reference:window.location.hostname,track:"track",page:window.location.href,method:"open",page_type:e,UID:"",scode:i()};try{await t.post("user/tracking",u)}catch(m){console.error("Error sending tracking data:",m)}}else console.error("Tracking not enabled due to site status.")};return l};t.Z=c},81859:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return C}});var a=s(85893),n=s(67294);
1s(25675);var r=s(11163),o=s(41664),l=s.n(o),i=s(60017),c=s(85574),d=s(43495),u=s(82940),m=s(14762),h=s(47516),p=s(73658),x=s(68015),g=s(15268),y=s(4422),b=s(89583),v=s(31738),f=s(88776),_=s(68481);let w=()=>{var e,t;let s=(0,r.useRouter)(),{id:o}=s.query,w=(0,y.Z)("User Gold Plan Details Page"),[C,N]=(0,n.useState)({}),[S,P]=(0,n.useState)({}),[T,k]=(0,n.useState)({}),{formatCurrency:E}=(0,n.useContext)(i.CurrencyContext),{clearUser:O,token:D,userDetails:B}=(0,n.useContext)(c.UserContext),[I,Z]=(0,n.useState)(null),[L,A]=(0,n.useState)(null),[R,M]=(0,n.useState)(!1),[z,F]=(0,n.useState)({}),[G,U]=(0,n.useState)(!0),[H,W]=(0,n.useState)(!1),V=(0,u.b)(),{jboId:J}=(0,x.useJobId)(),K=(0,u.b)(),[q,X]=(0,n.useState)(""),[Y,$]=(0,n.useState)(""),[Q,ee]=(0,n.useState)(!1),[et,es]=(0,n.useState)((null==S?void 0:S.nominee_name)||""),[ea,en]=(0,n.useState)(!1),[er,eo]=(0,n.useState)(!1),el=2===Number(null==S?void 0:S.amount_paid_type),ei=(null==S?void 0:S.start_date)||(null==S?void 0:null===(e=S.payment_data)||void 0===e?void 0:null===(t=e[0])||void 0===t?void 0:t.start_date)||"-",ec=()=>ee(!0),ed=()=>ee(!1),eu=()=>{$("")},em=e=>{F(e),M(!0)},eh=()=>{M(!1),z.redirectOnClose&&s.push(z.redirectOnClose)},ep=async()=>{let e={user_id:null==B?void 0:B.user_id,savings_scheme_subscriber_id:o};try{let t=await V.post("savings_scheme/savingsSchemeDetailsReport",e),s=t.data.savings_scheme_data,a=t.data.savings_scheme_total;k(a),P(s),U(!1),s&&s.payment_data&&s.payment_data.length>0&&A(s.payment_data[0].over_due_status),U(!1)}catch(l){var n;let r=(null==l?void 0:null===(n=l.response)||void 0===n?void 0:n.data)?l.response.data:"";(0,g.Z)({job_id:J,endpoint:"savings_scheme/savingsSchemeDetailsReport",payload:e,responseData:r,errorMsg:l}),U(!1)}},ex=async()=>{var e,t,s;try{let a=await V.post("settings/goldPaymentList",{});if(1==a.data.status){let n=null==a?void 0:null===(e=a.data)||void 0===e?void 0:null===(t=e.data)||void 0===t?void 0:t.jbo_payment_gateway_id;X(n)}else X("")}catch(o){let r=(null==o?void 0:null===(s=o.response)||void 0===s?void 0:s.data)?o.response.data:"";(0,g.Z)({job_id:J,endpoint:"settings/goldPaymentList",payload:{},responseData:r,errorMsg:o}),U(!1)}};(0,n.useEffect)(()=>{ex(),ep(),w()},[]);let eg=(e,t)=>{let s=()=>{try{let t=window.Cashfree({mode:"production"});t.checkout({paymentSessionId:e,redirectTarget:"_self"})}catch(s){console.error("Cashfree checkout error",s),em({type:"error",title:"Payment Error",subText:"Failed to launch Cashfree payment. Please try again.",autoClose:3,showConfirmButton:!1,showCancelButton:!1,onClose:eh})}};if(window.Cashfree)s();else{let a=document.createElement("script");a.src="https://sdk.cashfree.com/js/v3/cashfree.js",a.onload=s,a.onerror=()=>{em({type:"error",title:"Payment Error",subText:"Could not load Cashfree SDK. Please check your connection.",autoClose:3,showConfirmButton:!1,showCancelButton:!1,onClose:eh})},document.body.appendChild(a)}},ey=async e=>{Object.values(C)[0];let t={savings_scheme_subscriber_id:S.savings_scheme_subscriber_id,amount:S.amount,savings_scheme_ledger_id:e,over_due_status:L,jbo_payment_gateway_id:q};if(!er){eo(!0);try{let s=await V.post("savings_scheme/makePaymentSavingsScheme",t);if(s.data&&s.data&&1==s.data.status){if(localStorage.setItem("savings_scheme_ledger_id",e),localStorage.setItem("subscriber_id",S.savings_scheme_subscriber_id),s.data.message,"ccavenue"==s.data.payment_type){let a=s.data.formbody.match(/src="([^"]+)"/);a&&a[1]&&$(a[1])}else"cashfree"==s.data.payment_type?eg(s.data.payment_session_id,s.data.order_id):"stripe"==s.data.payment_type?setTimeout(()=>{window.location.href=s.data.stripe_session_url},1e3):eb(s.data,e);U(!1)}""==q&&em({type:"error",title:"Error!",subText:"Payment Gateway is Not Available!",autoClose:3,showConfirmButton:!1,showCancelButton:!1,onClose:eh}),U(!1)}catch(o){var n;let r=(null==o?void 0:null===(n=o.response)||void 0===n?void 0:n.data)?o.response.data:"";(0,g.Z)({job_id:J,endpoint:"savings_scheme/makePaymentSavingsScheme",payload:t,responseData:r,errorMsg:o}),U(!1)}finally{eo(!1)}}},eb=(e,t)=>{let a=100*S.amount,n=document.createElement("script");
1n.src="https://checkout.razorpay.com/v1/checkout.js",n.onload=()=>{var n;let r=null==e?void 0:null===(n=e.payment_gateway)||void 0===n?void 0:n.find(e=>"Razorpay"===e.display_label);if(r){let o={key:r.value,amount:a,currency:"INR",order_id:e.razorpayOrderId,name:e.customer_name,description:"Payment Transaction",notes:{savings_scheme_subscriber_id:S.savings_scheme_subscriber_id,savings_scheme_ledger_id:t},handler:async function(e){let a=e.razorpay_payment_id;try{let n=await K.post("savings_scheme/makePaymentResponse",{razorpay_payment_id:a,savings_scheme_ledger_id:t});1==n.data.status?s.push("/profile/GoldSuccess"):s.push("/profile/GoldPlans")}catch(l){var r;console.error("Payment failed",l),window.location.href="/profile/GoldPlans";let o=(null==l?void 0:null===(r=l.response)||void 0===r?void 0:r.data)?l.response.data:"";(0,g.Z)({job_id:J,endpoint:"savings_scheme/makePaymentResponse",payload:{razorpay_payment_id:a,savings_scheme_ledger_id:t},responseData:o,errorMsg:l})}},modal:{ondismiss:async function(){try{let e=await K.post("savings_scheme/makePaymentResponse",{savings_scheme_ledger_id:t});e&&window.location.reload()}catch(s){console.error(s)}}},prefill:{name:e.customer_name,email:e.customer_email,contact:e.customer_phoneno},theme:{color:"#3399cc"}},l=new Razorpay(o);l.open(),l.on("payment.failed",async function(e){try{let s=await K.post("savings_scheme/makePaymentResponse",{savings_scheme_ledger_id:t});s&&(window.location.href="/profile/GoldPlans")}catch(a){console.error(a)}console.error(e.error.code),console.error(e.error.description),console.error(e.error.source),console.error(e.error.step),console.error(e.error.reason),console.error(e.error.metadata.order_id),console.error(e.error.metadata.payment_id)})}},document.body.appendChild(n)};if(G)return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(p.Z,{})});let ev={hidden:{y:20,opacity:0},visible:{y:0,opacity:1,transition:{duration:.5}}};function ef(e){let t="grid-cols-2";switch(e){case 1:return"".concat(t," md:grid-cols-1");case 2:default:return"".concat(t," md:grid-cols-2");case 3:return"".concat(t," md:grid-cols-3");case 4:return"".concat(t," md:grid-cols-4");case 5:return"".concat(t," md:grid-cols-5");case 6:return"".concat(t," md:grid-cols-6");case 7:return"".concat(t," md:grid-cols-7");case 8:return"".concat(t," md:grid-cols-8");case 9:return"".concat(t," md:grid-cols-9")}}let e_=async()=>{em({type:"error",title:"Are you sure?",subText:"Do you want to close the plan midway?",onClose:eh,confirmLabel:"Yes, close it!",cancelLabel:"No, cancel",showConfirmButton:!0,showCancelButton:!0,onConfirm:async()=>{ew()}})},ew=async()=>{let e={savings_scheme_subscriber_id:S.savings_scheme_subscriber_id};try{let t=await V.post("savings_scheme/prematureSavingsScheme",e);"1"==t.data.status?em({type:"success",title:"Closed!",subText:"Scheme Plan Closed Successfully",autoClose:2,showConfirmButton:!1,showCancelButton:!1,onClose:eh,redirectOnClose:"/profile/GoldPlans"}):em({type:"error",title:"Error!",subText:"Something went wrong!",autoClose:3,showConfirmButton:!1,showCancelButton:!1,onClose:eh})}catch(n){var s;let a=(null==n?void 0:null===(s=n.response)||void 0===s?void 0:s.data)?n.response.data:"";(0,g.Z)({job_id:J,endpoint:"savings_scheme/prematureSavingsScheme",payload:e,responseData:a,errorMsg:n}),em({type:"error",title:"Error!",subText:"Failed to end plan midway!",autoClose:3,showConfirmButton:!1,showCancelButton:!1,onClose:eh})}},ej=async e=>{try{e.preventDefault(),ed();let t=await V.post("/savings_scheme/sendNomineeOtp",{});1===t.data.status?(setTimeout(()=>{en(!0)},2e3),em({type:"success",title:"OTP send",subText:t.data.message||"OTP Send Successfully!",autoClose:2,onConfirm:eh,onClose:eh})):em({type:"error",title:"Error",subText:t.data.message||"Unable to send OTP.",autoClose:3,onConfirm:eh,onClose:eh})}catch(s){en(!1),em({type:"error",title:"API Error",subText:"Unable to send OTP. Please try again later.",autoClose:3})}},eC=async()=>{try{en(!1);let e=await V.post("savings_scheme/updateNominee",{subscriber_id:o,nominee_name:et||""});"1"==e.data.status?(setTimeout(()=>{window.location.reload()},2e3),setTimeout(()=>{W(!1)},1e3),em({type:"success",title:"Success!",subText:e.data.message||"Nominee Name Update Successfully",autoClose:2,showConfirmButton:!1,showCancelButton:!1,onClose:eh})):(W(!0),en(!1),em({type:"error",title:"Error!",subText:e.data.message||"Something went wrong!",autoClose:3,showConfirmButton:!1,showCancelButton:!1,onClose:eh}))}catch(t){console.error(t)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"xl:container px-4 py-4 flex justify-between ",children:(0,a.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,a.jsx)(l(),{href:"/profile/GoldPlans",className:"text-primary text-base",children:(0,a.jsx)("i",{className:"fas fa-home"})}),(0,a.jsxs)("div",{className:"flex gap-3 items-center mt-1",children:[(0,a.jsx)("span",{className:"text-sm text-gray-500",children:(0,a.jsx)("i",{className:"fas fa-chevron-right "})}),(0,a.jsx)("p",{className:"text-gray-500 font-medium uppercase ",children:" GoldPlans / Detail Report "})]})]})}),(0,a.jsxs)("div",{className:"xl:container px-4 lg:grid grid-cols-12 items-start gap-6 pt-4 pb-16",children:[(0,a.jsxs)("div",{className:"col-span-12 mt-6 lg:mt-0 space-y-4 scrollbar-thin scrollbar-thumb-purple-500 scrollbar-track-gray-100",children:[S&&(0,a.jsxs)(d.E.div,{initial:"hidden",animate:"visible",variants:{hidden:{opacity:0}
1,visible:{opacity:1,transition:{staggerChildren:.5}}},className:"bg-white shadow-lg rounded-lg p-4 md:p-6 lg:p-8",children:[(0,a.jsx)(d.E.div,{variants:ev,className:"border-b border-gray-200 pb-4 mb-4",children:(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("h1",{className:"font-bold text-xl md:text-2xl text-gray-800 capitalize",children:S.savings_scheme_name}),"Premature Closure"===S.subscriber_status_name&&(0,a.jsx)("span",{className:"bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded",children:S.subscriber_status_name})]})}),(0,a.jsxs)(d.E.div,{variants:ev,className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(j,{label:"Subscriber ID",value:S.savings_scheme_subscriber_id}),(0,a.jsx)(j,{label:"Scheme ID",value:S.savings_scheme_id}),(0,a.jsx)(j,{label:"Plan Duration",value:"".concat(S.savings_scheme_plan_duration," Months")})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(j,{label:"Nominee Name",value:null==S?void 0:S.nominee_name}),(0,a.jsx)("button",{onClick:ec,className:"px-3 py-1 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 transition",children:"Edit"})]}),(0,a.jsx)(j,{label:"Subscribed On",value:S.subscribed_date}),el?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j,{label:"Start Date",value:ei}),(0,a.jsx)(j,{label:"Due Date",value:S.end_at||"-"})]}):(0,a.jsx)(j,{label:"Scheme Ends At",value:S.end_at})]})]}),"Waiting for Approval"!==S.subscriber_status_name&&"Rejected"!==S.subscriber_status_name?(0,a.jsx)(d.E.div,{variants:ev,className:"mt-6",children:(()=>{let e="Amount"===S.savings_scheme_type;S.show_weight;let t=["Count","Payment Date"];return el&&S.payment_data.some(e=>e.start_date)&&t.push("Start Date"),el&&S.payment_data.some(e=>e.due_date)&&t.push("Due Date"),!el&&S.payment_data.some(e=>e.start_date)&&t.push("Due Date"),!e&&S.payment_data.some(e=>e.weight)&&t.push("Weight"),S.payment_data.some(e=>e.amount)&&t.push("Amount"),S.payment_data.some(e=>e.payment_status)&&t.push("Status"),t.push("Payment"),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"bg-gray-50 px-4 py-2 text-gray-700 uppercase border-b border-gray-200",children:(0,a.jsx)("div",{className:"grid ".concat(ef(t.length)," gap-4"),children:t.map(e=>(0,a.jsx)("div",{className:"font-semibold",children:e},e))})}),(0,a.jsx)("div",{className:"space-y-4",children:S.payment_data.map((e,s)=>e&&(0,a.jsx)(d.E.div,{variants:ev,className:"bg-white shadow rounded-lg",children:(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)("div",{className:"grid ".concat(ef(t.length)," gap-4 text-gray-800"),children:[(0,a.jsxs)("div",{children:["# Instalment ",s+1||"-"]})," ",(0,a.jsx)("div",{children:e.payment_date||"-"}),t.includes("Start Date")&&(0,a.jsx)("div",{children:e.start_date||"-"}),t.includes("Due Date")&&(0,a.jsx)("div",{children:el?e.due_date||"-":e.start_date||"-"}),t.includes("Weight")&&(0,a.jsx)("div",{children:e.weight?"".concat(e.weight," ").concat(1===e.weight?"Gm":"Gms"):"-"}),t.includes("Amount")&&(0,a.jsx)("div",{children:e.amount?E(e.amount):"-"}),t.includes("Status")&&(0,a.jsx)("div",{children:e.payment_status||"-"}),(0,a.jsxs)("div",{children:["Approved"===S.subscriber_status_name&&(0,a.jsxs)(a.Fragment,{children:[1===e.over_due_status&&(0,a.jsx)("button",{onClick:()=>ey(e.savings_scheme_ledger_id),className:"bg-red-500 text-white text-md font-bold py-2 px-4 rounded",children:"Over Due"}),1===e.status&&1!==e.over_due_status&&(0,a.jsx)("button",{disabled:er,onClick:()=>ey(e.savings_scheme_ledger_id),className:"bg-primary text-white text-md font-bold py-2 px-4 rounded ".concat(er?"opacity-50 cursor-not-allowed":""),children:"Make Pay"})]}),"Approved"!==S.subscriber_status_name&&(0,a.jsx)("div",{children:"-"})," "]})]})})},e.savings_scheme_ledger_id))}),(0,a.jsxs)("div",{className:"flex justify-end gap-5",children:[null!=T&&!!T.total_weight&&(0,a.jsx)("div",{className:"flex justify-between my-4",children:(0,a.jsxs)("span",{className:"text-gray-800 font-semibold",children:["Total weight (Paid) : ",(null==T?void 0:T.total_weight)?null==T?void 0:T.total_weight:""," gms"]})}),(0,a.jsx)("div",{className:"flex justify-beetween my-4",children:(0,a.jsxs)("span",{className:"text-gray-800 font-semibold",children:["Total Amount (Paid) : ",(null==T?void 0:T.total_amount)?E(null==T?void 0:T.total_amount):""]})})]})]})})()}):null,(0,a.jsx)(d.E.div,{variants:ev,className:"flex items-center justify-between border-t border-gray-200 pt-4",children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:["Waiting for Approval"===S.subscriber_status_name&&(0,a.jsx)(h.s3B,{className:"text-yellow-500",size:"1.5em"}),"Waiting for Approval"===S.subscriber_status_name&&(0,a.jsx)("span",{className:"text-lg font-medium",children:S.subscriber_status_name})]})}),(0,a.jsx)(d.E.div,{variants:ev,className:"prose prose-indigo mt-6",dangerouslySetInnerHTML:{__html:S.savings_scheme_main_description}}),S.disclaimer&&(0,a.jsx)(d.E.div,{variants:ev,className:"mt-6 p-4 bg-gray-100 rounded",children:(0,a.jsx)("a",{href:S.disclaimer,target:"_blank",className:"text-primary underline text-lg sm:text-md break-words",children:"Terms & Conditions"})})]}),"Approved"===S.subscriber_status_name&&(0,a.jsx)("button",{onClick:e_,className:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 roun
1ded transition duration-150 ease-in-out text-sm sm:text-base",children:"End Plan Midway"})]}),H&&I&&(0,a.jsx)("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 overflow-y-auto h-full w-full z-50",id:"my-modal",children:(0,a.jsxs)("div",{className:"relative top-20 mx-auto p-5 border shadow-lg rounded-md bg-white w-full max-w-4xl",children:[(0,a.jsx)("button",{className:"absolute top-2 right-2 p-2",onClick:()=>W(!1),"aria-label":"Close modal",children:(0,a.jsx)(b.aHS,{className:"h-6 w-6 text-gray-700"})}),(0,a.jsx)("div",{className:"responsive-container w-full h-full",dangerouslySetInnerHTML:{__html:null==I?void 0:I.formbody},style:{minHeight:"400px",maxHeight:"90vh",overflow:"auto"}})]})}),(0,a.jsx)(v.Z,{paymentIframe:Y,onClose:eu})]}),(0,a.jsx)(m.Z,{isOpen:R,type:z.type,title:z.title,subText:z.subText,onConfirm:z.onConfirm,onClose:eh,autoClose:z.autoClose,confirmLabel:z.confirmLabel,cancelLabel:z.cancelLabel,showConfirmButton:z.showConfirmButton,showCancelButton:z.showCancelButton,showCloseIcon:!0,redirectOnClose:z.redirectOnClose}),(0,a.jsx)(f.Z,{open:Q,handleClose:ed,title:"Edit Nominee Name",content:(0,a.jsxs)("form",{onSubmit:ej,className:"space-y-4",children:[(0,a.jsxs)("label",{className:"block text-sm md:text-base font-medium text-gray-700",children:["Nominee Name ",(0,a.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,a.jsx)("input",{type:"text",value:et,onChange:e=>es(e.target.value),onBlur:e=>es(e.target.value.trim()),placeholder:"Enter nominee name",className:"w-full border px-3 py-2 text-sm md:text-base rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:!0}),(0,a.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row justify-end gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:ed,className:"w-full sm:w-auto px-4 py-2 text-sm md:text-base rounded-md border border-gray-300 text-gray-600 hover:bg-gray-100",children:"Cancel"}),(0,a.jsx)("button",{type:"submit",className:"w-full sm:w-auto px-4 py-2 text-sm md:text-base rounded-md bg-blue-600 text-white hover:bg-blue-700",children:"Save"})]})]})}),(0,a.jsx)(_.Z,{open:ea,handleClose:()=>en(!1),handleSubmit:eC})]})},j=e=>{let{label:t,value:s}=e;return(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsxs)("h4",{className:"font-medium text-gray-600",children:[t,":"]}),(0,a.jsx)("span",{className:"ml-2 text-gray-800",children:s})]})};var C=!0;t.default=w}},function(e){e.O(0,[4617,5445,3874,7066,3495,5675,1664,733,9395,7681,6664,4300,5685,17,2940,9774,2888,179],function(){return e(e.s=11457)}),_N_E=e.O()}]);
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.