1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[768],{51916:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/file-itr/start-with-ais",function(){return a(77453)}])},77453:function(e,s,a){"use strict";a.r(s),a.d(s,{default:function(){return O}});var l=a(85893),i=a(67294),n=a(18508),d=a(75157),t=a(32599),r=a(30080),c=a(80902),o=a(45007),u=a(34051),m=a(31555),h=a(91444),v=a(46655),x=a(5152),p=a.n(x),j=a(24803),N=a.n(j),f=a(25675),_=a.n(f),y=a(653),b=a(23151);let g=p()(()=>Promise.all([a.e(296),a.e(9260)]).then(a.t.bind(a,69260,23)),{loadableGenerated:{webpack:()=>[69260]},ssr:!1}),S={AIS_0001_INVALID_EMAIL:"The email provided is invalid.",AIS_0002_INVALID_DOB:"The date of birth provided is invalid.",AIS_0003_INVALID_PASSWORD:"Incorrect password. Please re-enter the PDF password and try again.",AIS_0004_ERROR_PARSING:"We couldn't read this AIS file, please contact support.",AIS_0005_INVALID_FORMAT:"Please upload a PDF file.",AIS_0006_INVALID_FILE:"Please select a valid file.",AIS_0009_INTERNAL_SERVER_ERROR:"Something went wrong, please retry."},I=[{key:"salary",label:"Salary"},{key:"rent",label:"Rent"},{key:"savings_interest",label:"Savings Interest"},{key:"fd_interest",label:"FD Interest"},{key:"securities_sale",label:"Sale of Securities"},{key:"dividend_tds",label:"Dividend"},{key:"land_building_tds",label:"Sale of Land/Building"}],w=e=>{var s,a,n,d,x;let{handleNext:p}=e,j=(0,o.v9)(e=>null==e?void 0:e.profile),[f,w]=(0,i.useState)(null),[A,k]=(0,i.useState)(""),[D,F]=(0,i.useState)("pending"),[Z,T]=(0,i.useState)(0),[P,R]=(0,i.useState)(""),[C,E]=(0,i.useState)(null),[O,U]=(0,i.useState)(null),[L,M]=(0,i.useState)(null),B=e=>{let{target:s}=e,a=Array.from(s.files);a[0]&&(w(a[0]),F("pending"),T(0),R("")),s.value=""},V=()=>{w(null),F("pending"),T(0),R(""),k("")},z=async()=>{let e;if(f)try{var s,a,l;F("uploading"),T(0),R(""),e=setInterval(()=>{T(e=>Math.min(e+20,90))},300);let i=new FormData;i.append("pdf_file",f),A&&i.append("password",A),(null==j?void 0:null===(s=j.data)||void 0===s?void 0:s.email)&&i.append("email",null==j?void 0:null===(a=j.data)||void 0===a?void 0:a.email);let n=await (0,t.Kz)(i);clearInterval(e),F("success"),T(100);let d=(null==n?void 0:n.email)||(null==j?void 0:null===(l=j.data)||void 0===l?void 0:l.email),r=await (0,t.Rb)(d);E({ais_id:null==n?void 0:n.ais_id,email:d}),U(r),h.Am.success((null==n?void 0:n.message)||"AIS uploaded successfully",{position:"top-center"})}catch(i){clearInterval(e);let{data:s}=(null==i?void 0:i.response)||{},a=null==s?void 0:s.error_code,l=a&&S[a]||(null==s?void 0:s.message)||"Upload failed";F("error"),T(0),R(l)}},W=(null==O?void 0:O.find(e=>(null==e?void 0:e.id)===(null==C?void 0:C.ais_id)))||(null==O?void 0:O[0]),Y=null==W?void 0:null===(s=W.parsed_data)||void 0===s?void 0:s.parta,G=async()=>{if(W)try{let e=await (0,b.rM)({pan:null==W?void 0:W.pan});p({step:1,ais:C,result:O,panData:e})}catch(l){var e;let s=null==l?void 0:null===(e=l.response)||void 0===e?void 0:e.data,a=null==s?void 0:s[Object.keys(s||{})[0]];M(a)}},H=()=>{E(null),U(null),M(null),V()};return(0,l.jsx)(u.Z,{style:{maxHeight:"100%",overflowY:"auto"},className:"pb-3",children:(0,l.jsx)(m.Z,{lg:8,md:12,sm:12,xs:12,children:(0,l.jsx)(l.Fragment,{children:O?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"d-flex justify-content-center",style:{width:"100%",height:"150px",transitionDuration:"0s"},children:(0,l.jsx)(g,{animationData:v,style:{width:"150px",height:"100%",transitionDuration:"0s"},loop:!1,autoplay:!0})}),(0,l.jsx)("div",{className:"".concat(N().descriptionText," text-center"),children:"AIS successfully read"}),(0,l.jsx)(u.Z,{children:(0,l.jsx)(m.Z,{md:12,children:(0,l.jsxs)("div",{className:N().form16_table,children:[(0,l.jsx)("div",{className:N().head,children:(0,l.jsx)("div",{className:N().title,children:"Personal Info Summary"})}),(0,l.jsxs)("div",{className:N().body,children:[(0,l.jsxs)("div",{className:N().tr,children:[(0,l.jsx)("div",{className:N().td,children:"Name"}),(0,l.jsx)("div",{className:N().td,children:(null==Y?void 0:Y.name)||""})]}),(0,l.jsxs)("div",{className:N().tr,children:[(0,l.jsx)("div",{className:N().td,children:"PAN"}),(0,l.jsx)("div",{className:N().td,children:(null==W?void 0:W.pan)||""})]}),(0,l.jsxs)("div",{className:N().tr,children:[(0,l.jsx)("div",{className:N().td,children:"Financial Year"}),(0,l.jsx)("div",{className:N().td,children:(null==W?void 0:W.fy_str)||""})]}),(0,l.jsxs)("div",{className:N().tr,children:[(0,l.jsx)("div",{className:N().td,children:"Date of Birth"}),(0,l.jsx)("div",{className:N().td,children:(null==Y?void 0:Y.dob)||""})]}),(0,l.jsxs)("div",{className:N().tr,children:[(0,l.jsx)("div",{className:N().td,children:"Mobile"}),(0,l.jsx)("div",{className:N().td,children:(null==Y?void 0:Y.mobile)||""})]})]})]})})}),I.map(e=>{var s;let a=(null==W?void 0:null===(s=W.parsed_data)||void 0===s?void 0:s[e.key])||[];return a.length?(0,l.jsx)(u.Z,{className:"mt-3",children:(0,l.jsx)(m.Z,{md:12,children:(0,l.jsxs)("div",{className:N().form16_table,children:[(0,l.jsx)("div",{className:N().head,children:(0,l.jsx)("div",{className:N().title,children:e.label})}),(0,l.jsx)("div",{className:N().body,children:a.map((e,s)=>(0,l.jsxs)("div",{className:N().tr,children:[(0,l.jsx)("div",{className:N().td,children:(null==e?void 0:e.info_source)||""}),(0,l.jsxs)("div",{className:N().td,children:["â¹",(null==e?void 0:e.amount)||0]})]},s))})]})})},e.key):null}),(null==W?void 0:null===(a=W.parsed_data)||void 0===a?void 0:null===(n=a.tax_payment)||void 0===n?void 0:n.length)>0&&(0,l.jsx)(u.Z,{className:"mt-3",children:(0,l.jsx)(m.Z,{md:12,children:(0,l.jsxs)("div",{className:N().form16_table,children:[(0,l.jsx)("div",{className:N().head,children:(0,l.jsx)("div",{className:N().title,children:"Tax Payment"})}),(0,l.jsx)("div",{className:N().body,children:null==W?void 0:null===(d=W.parsed_data)||void 0===d?void 0:null===(x=d.tax_payment)||void 0===x?void 0:x.map((e,s)=>(0,l.jsxs)("div",{className:N().tr,children:[(0,l.jsxs)("div",{className:N().td,children:[(null==e?void 0:e.minor_head)||"",(null==e?void 0:e.fy)?" (".concat(e.fy,")"):""]}),(0,l.jsxs)("div",{className:N().td,children:["â¹",(null==e?void 0:e.total)||0]})]},s))})]})})}),(0,l.jsx)("div",{className:"".concat(N().descriptionText," text-center mt-3"),children:"and there's more⦠the complete breakup will be available inside your ITR."}),(0,l.jsxs)("div",{className:"".concat(N().title," my-2"),children:["Data seems incorrect? ",(0,l.jsx)("span",{className:"text-danger",style:{cursor:"pointer"},onClick:H,children:"Upload AIS again"})]}),(0,l.jsx)("div",{className:"error mt-3",children:L}),(0,l.jsx)("div",{className:"mt-4 pt-2",children:(0,l.jsx)("button",{className:"btn btn-danger px-5 py-2",onClick:G,children:"Continue"})})]}):(0,l.jsx)(l.Fragment,{children:f?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:N().form16Container,children:(0,l.jsxs)("div",{className:"".concat(N().form16File," ").concat("success"===D?N().success:""," ").concat("error"===D?N().error:""),children:[(0,l.jsxs)("div",{className:"d-flex align-items-center w-50 ".concat(N().form_files),children:[(0,l.jsx)("div",{className:N().pdfIcon,children:(0,l.jsx)(_(),{width:100,height:100,alt:"ais",src:"/itr-2/pdf.svg"})}),(0,l.jsxs)("div",{className:"".concat(N().fileName," w-75 ellipsis"),children:[null==f?void 0:f.name,(0,l.jsxs)("div",{className:N().fileStatus,children:["uploading"===D&&(0,l.jsxs)("span",{className:N().uploading,children:[(0,l.jsx)("span",{className:"spinner-border spinner-border-sm me-1",role:"status","aria-hidden":"true"}),"Uploading ",Z,"%"]}),"success"===D&&(0,l.jsxs)("span",{className:N().successText,children:[(0,l.jsx)(r.ZSR,{size:14})," Uploaded"]}),"error"===D&&(0,l.jsxs)("span",{className:N().errorText,children:[(0,l.jsx)(r.vVM,{size:14})," ",P||"Failed"]}),"pending"===D&&(0,l.jsx)("span",{className:N().pendingText,children:"Ready to upload"})]})]})]}),(0,l.jsxs)("div",{className:"d-flex justify-content-end align-items-center",children:["uploading"===D&&(0,l.jsx)("div",{className:N().individualProgress,children:(0,l.jsx)("div",{className:N().miniProgressBar,children:(0,l.jsx)("div",{className:N().miniProgressFill,style:{width:"".concat(Z,"%")}})})}),(0,l.jsx)("div",{className:"".concat(N().fileName," w-75"),children:(0,l.jsx)(c.uq,{value:A,id:"ais-password",name:"password",onChange:e=>{let{target:s}=e;k(s.value),R("")},placeholder:"Password (if any)",disabled:"uploading"===D||"success"===D})}),"error"===D&&(0,l.jsx)("button",{className:N().retryBtn,onClick:z,title:"Retry upload",children:(0,l.jsx)(r.la_,{})}),"uploading"!==D&&(0,l.jsx)("button",{className:N().deleteBtn,onClick:V,children:(0,l.jsx)(r.ZkW,{})})]})]})}),(0,l.jsx)("div",{className:"mt-4 pt-2",children:"uploading"===D?(0,l.jsxs)("button",{className:"btn btn-danger px-5 py-2",disabled:!0,children:["Uploading...",(0,l.jsx)("span",{className:"spinner-border spinner-border-sm ms-2",role:"status","aria-hidden":"true"})]}):(0,l.jsx)("button",{className:"btn btn-danger px-5 py-2",onClick:z,disabled:"success"===D,children:"success"===D?"Uploaded":"error"===D?"Retry":"Upload"})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"py-2",children:[(0,l.jsx)("input",{type:"file",onChange:B,name:"ais",id:"ais",accept:".pdf",className:"d-none"}),(0,l.jsxs)("label",{htmlFor:"ais",className:N().form16Container,children:[(0,l.jsx)("span",{className:N().uploadIcon,children:(0,l.jsx)(r.YFT,{})}),(0,l.jsxs)("span",{className:"".concat(N().title," text-center w-100 mt-3"),children:["Drag your AIS PDF or ",(0,l.jsx)("span",{className:"text-danger fw-bold",children:"click to upload"})]}),(0,l.jsx)("span",{className:N().descriptionText,children:"Only support .pdf files"})]})]}),(0,l.jsx)("div",{className:"py-2",children:(0,l.jsx)(y.Z,{description:"Download your AIS from the Income Tax e-filing portal (Compliance > AIS). If it's password protected, keep the password handy."})})]})})})})})};var A=a(8335),k=a(12490),D=a(54884),F=a(79503),Z=a(1211),T=a(64998),P=a(32471),R=a.n(P);let C=e=>{var s;let a=null==e?void 0:null===(s=e.response)||void 0===s?void 0:s.data;if(Array.isArray(a)&&a.length)return a[0];if(null==a?void 0:a.detail)return a.detail;if(a&&"object"==typeof a){let s=Object.keys(a)[0],l=s?a[s]:null;return Array.isArray(l)?l[0]:l||(null==e?void 0:e.message)||"Something went wrong"}return"string"==typeof a?a:(null==e?void 0:e.message)||"Something went wrong"},E=()=>{let e=(0,o.v9)(e=>e.profile),[s,a]=(0,i.useState)(1),[r,c]=(0,i.useState)(null),[u,m]=(0,i.useState)({}),[h,v]=(0,i.useState)(null),[x,p]=(0,i.useState)(null),[j,N]=(0,i.useState)(!1),f=l=>{if((null==l?void 0:l.step)==1&&l.result){var i;v(l.result),p(null==l?void 0:l.ais),c(null==l?void 0:l.panData),(0,D.o2)(null==l?void 0:l.panData,null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.is_staff)?a((null==l?void 0:l.step)+2):a((null==l?void 0:l.step)+1);return}a(s+1)};(0,i.useEffect)(()=>{(null==r?void 0:r.pan)&&3===s&&_(r.pan)},[s,r]);let _=async e=>{try{await (0,b.s)(e),N(!0)}catch(e){var s;(null==e?void 0:null===(s=e.response)||void 0===s?void 0:s.status)===404?N(!1):N(!0)}},y=()=>{s>=1&&a(s-1)},g=async e=>{try{let a={source:"ais",parsed_f16:[Number(null==x?void 0:x.ais_id)],email:null==x?void 0:x.email},l="".concat(null===k.Z||void 0===k.Z?void 0:k.Z.baseImageURL).c
1oncat(null===k.Z||void 0===k.Z?void 0:k.Z.autoCreateItr).concat(e?"?itr=".concat(e):""),i=await (0,t.vZ)(l,a),n=Array.isArray(i)?i[0]:i;if(!(null==n?void 0:n.itr_uuid)&&(null==n?void 0:n.err)&&Object.keys(null==n?void 0:n.err).length>0){var s;throw Error((null==n?void 0:null===(s=n.err)||void 0===s?void 0:s.detail)||"Failed to create ITR from AIS data.")}return i}catch(s){let e=C(s);throw m(s=>({...s,comman:e})),s}},S=()=>(0,l.jsxs)("div",{className:"mb-5",children:[(0,l.jsx)("div",{className:R().step_count,children:"STEP 1 OF 3"}),(0,l.jsx)("h1",{children:"Start with AIS"}),(0,l.jsx)("p",{className:R().subtitle,children:"Upload your Annual Information Statement (AIS) to automatically extract income and tax details."})]});return(0,l.jsx)(n.Z,{page:[{label:"Dashboard",link:"/dashboard/itr-tax-returns"},{label:"File New Return",link:"/dashboard/file-itr"},"Upload AIS"],children:(0,l.jsx)("div",{className:R().file_itr_page,children:(0,l.jsxs)("div",{className:R().layout_grid,children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:R().segmented_stepper,children:[1,2,3,4].map(e=>(0,l.jsx)("div",{className:"".concat(R().segment," ").concat(e<=s?R().active:"")},e))}),(0,l.jsxs)("div",{className:R().form_card,children:[(0,l.jsxs)("div",{className:"px-1",children:[1===s&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(S,{}),(0,l.jsx)(w,{handleNext:f})]}),2===s&&(0,l.jsx)(A.Z,{panData:r,result:h,handleNext:f,handleBack:y}),3===s&&(0,l.jsx)(d.Z,{handleBack:y,handleUpdateItr:g,isAlreadyClient:j})]}),u.comman&&(0,l.jsx)("div",{className:"alert alert-danger mt-3",children:u.comman})]})]}),(0,l.jsxs)("div",{className:R().sidebar_wrapper,children:[(0,l.jsxs)("div",{className:R().card_tips,children:[(0,l.jsxs)("div",{className:R().card_header,children:[(0,l.jsx)("div",{className:"".concat(R().icon_box," ").concat(R().red),children:(0,l.jsx)(F.Z,{size:20})}),(0,l.jsxs)("div",{className:R().title_box,children:[(0,l.jsx)("h3",{children:"Quick Tips"}),(0,l.jsx)("p",{children:"Uploading AIS"})]})]}),(0,l.jsxs)("ul",{className:R().tips_list,children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:R().num,children:"1"}),(0,l.jsx)("span",{children:"Download the AIS PDF from the Income Tax e-filing portal under Services > Annual Information Statement."})]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:R().num,children:"2"}),(0,l.jsx)("span",{children:"The AIS PDF can be password protected â keep the password ready if prompted."})]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{className:R().num,children:"3"}),(0,l.jsx)("span",{children:"We'll extract salary, interest, dividend, TDS and tax payment details automatically."})]})]})]}),(0,l.jsxs)("div",{className:R().card_help,children:[(0,l.jsxs)("div",{className:R().card_header,children:[(0,l.jsx)("div",{className:"".concat(R().icon_box," ").concat(R().blue),children:(0,l.jsx)(Z.Z,{size:20})}),(0,l.jsxs)("div",{className:R().title_box,children:[(0,l.jsx)("h3",{children:"Need Help?"}),(0,l.jsx)("p",{children:"Talk to a tax expert"})]})]}),(0,l.jsx)("p",{className:R().help_text,children:"Our CAs are available MonâSat, 9 AM to 7 PM to guide you through the filing process."}),(0,l.jsxs)("button",{className:R().chat_expert_btn,children:["Chat with Expert ",(0,l.jsx)(T.Z,{size:14})]})]})]})]})})})};var O=E}},function(e){e.O(0,[6947,8316,318,8508,8946,5114,9774,2888,179],function(){return e(e.s=51916)}),_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.