PageSourceSearch

https://bankstatementconverters.ai/_next/static/chunks/3112-0bebcb69b66e0d48.js

js bankstatementconverters.ai collected 2026-10-05 11:49:20 UTC 46,858 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3112,8436],{63:(e,t,r)=>{"use strict";var s=r(7260);r.o(s,"useParams")&&r.d(t,{useParams:function(){return s.useParams}}),r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},938:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(5155),a=r(2115);function n(e){let{fileName:t,error:r,onSubmit:n,onCancel:o}=e,[l,i]=(0,a.useState)(""),[c,d]=(0,a.useState)(!1),u=()=>{let e=l.trim();e&&n(e)};return(0,s.jsx)("div",{className:"flex-1 flex flex-col justify-center px-4 sm:px-6",children:(0,s.jsxs)("div",{className:"max-w-md mx-auto w-full bg-white dark:bg-gray-900 border-2 border-orange-300 rounded-2xl p-6 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex items-start gap-4 mb-6",children:[(0,s.jsx)("div",{className:"p-2 bg-orange-100 rounded-full flex-shrink-0",children:(0,s.jsx)("svg",{className:"w-6 h-6 text-orange-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-1",children:"Password Protected PDF"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 truncate",children:t})]})]}),(0,s.jsx)("div",{className:"mb-6 p-4 bg-blue-50 rounded-lg",children:(0,s.jsx)("p",{className:"text-sm text-blue-800",children:"This PDF is password protected. Please enter the password to continue processing."})}),r&&(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-2 text-red-600",children:[(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,s.jsx)("p",{className:"text-sm font-medium",children:"string"==typeof r?r:"Incorrect password. Please try again."})]}),(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"PDF Password"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{type:c?"text":"password",value:l,onChange:e=>i(e.target.value),placeholder:"Enter PDF password",className:"w-full px-4 py-3 border-2 border-gray-300 dark:border-gray-600 rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 placeholder-gray-400 pr-12",onKeyDown:e=>{"Enter"===e.key&&u()},autoFocus:!0}),(0,s.jsx)("button",{type:"button",onClick:()=>d(!c),className:"absolute right-4 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",children:c?(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.878L21 21"})}):(0,s.jsxs)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})]})]}),(0,s.jsxs)("div",{className:"flex gap-4 mb-4",children:[(0,s.jsx)("button",{onClick:u,className:"flex-1 py-3 px-6 text-white font-semibold rounded-xl transition-all duration-200",style:{backgroundColor:"#584fe3"},onMouseEnter:e=>e.target.style.backgroundColor="#4338ca",onMouseLeave:e=>e.target.style.backgroundColor="#584fe3",children:"Submit Password"}),(0,s.jsx)("button",{onClick:o,className:"px-6 py-3 border-2 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 font-semibold rounded-xl hover:bg-gray-50 dark:bg-gray-800 transition-colors",children:"Cancel"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-600",children:[(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),(0,s.jsx)("p",{children:"Your password is encrypted and automatically deleted after processing."})]})]})})}},2112:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(5155),a=r(63);function n(e){var t,r,n,o,l,i,c,d,u,m,x;let{isOpen:p,onClose:g,quotaData:h,user:f,userPlan:b,partialData:y}=e,v=(0,a.useRouter)(),w=(0,a.usePathname)(),k=f&&f.email?b||"free":"anonymous",j=!!y,N=null==h||null==(t=h.quota)?void 0:t.limit,C=null==h||null==(r=h.quota)?void 0:r.signup_limit;if(!p)return null;let P={title:"Daily Limit Reached",subtitle:N?"You've used all ".concat(N," free pages for today.").concat(C?" Sign up for ".concat(C," pages daily!"):" Sign up for more daily pages — free!"):"You've used today's free pages. Sign up for more daily pages — free!",icon:(0,s.jsx)("svg",{className:"w-12 h-12 text-blue-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}
1),benefits:[{icon:"\uD83D\uDCC4",text:C?"".concat(C," free pages every day"):"More free pages every day"},{icon:"\uD83D\uDCBE",text:"Save your processing history"},{icon:"\uD83D\uDCCA",text:"Advanced export options"},{icon:"⚡",text:"Priority processing speed"},{icon:"\uD83D\uDD10",text:"Secure account dashboard"}],primaryAction:{text:"Sign Up Free",color:"blue",onClick:()=>v.push("/signup?redirect=".concat(encodeURIComponent(w)))},subscribeAction:{text:"Subscribe to process all pages",onClick:()=>v.push("/pricing")},secondaryAction:{text:"Already have an account? Login",onClick:()=>v.push("/login?redirect=".concat(encodeURIComponent(w)))}},L={title:"Daily Limit Reached",subtitle:N?"You've used all ".concat(N," free pages for today"):"You've used all your free pages for today",icon:(0,s.jsx)("svg",{className:"w-12 h-12 text-purple-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),benefits:[{icon:"\uD83D\uDE80",text:"500-60,000 pages per month"},{icon:"\uD83D\uDD11",text:"Full REST API access"},{icon:"⚡",text:"10x faster processing"},{icon:"\uD83D\uDCC8",text:"Usage analytics dashboard"},{icon:"\uD83D\uDCAC",text:"Priority email support"}],primaryAction:{text:"Upgrade Now - From $15/mo",color:"purple",onClick:()=>v.push("/pricing?redirect=".concat(encodeURIComponent(w)))},secondaryAction:{text:N?"Come back tomorrow for ".concat(N," more free pages"):"Come back tomorrow for more free pages",onClick:g}},S="starter_yearly"===k,M={title:S?"Annual Starter Limit Reached":"Monthly Starter Limit Reached",subtitle:S?"You've reached your annual Starter limit of ".concat((null==h||null==(n=h.quota)?void 0:n.limit)||"all"," pages. Upgrade or wait for reset."):"You've reached your monthly Starter limit of ".concat((null==h||null==(o=h.quota)?void 0:o.limit)||"all"," pages. Upgrade or wait for reset."),icon:(0,s.jsx)("svg",{className:"w-12 h-12 text-orange-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),benefits:[{icon:"\uD83D\uDE80",text:"Professional: 1,200-15,000 pages/period"},{icon:"⚡",text:"2.4x more processing power"},{icon:"\uD83D\uDCCA",text:"Advanced analytics dashboard"},{icon:"\uD83C\uDFAF",text:"Better value per page"},{icon:"\uD83D\uDCAC",text:"Priority email support"}],primaryAction:{text:"Upgrade to Professional",color:"orange",onClick:()=>v.push(S?"/pricing?plan=yearly&redirect=".concat(encodeURIComponent(w)):"/pricing?redirect=".concat(encodeURIComponent(w)))},secondaryAction:{text:"Resets on ".concat((null==h||null==(l=h.quota)?void 0:l.resets_at)?new Date(h.quota.resets_at).toLocaleDateString():"next billing cycle"),onClick:g}},A="professional_yearly"===k,F={title:A?"Annual Professional Limit Reached":"Monthly Professional Limit Reached",subtitle:A?"You've reached your annual Professional limit of ".concat((null==h||null==(i=h.quota)?void 0:i.limit)||"all"," pages. Upgrade or wait for reset."):"You've reached your monthly Professional limit of ".concat((null==h||null==(c=h.quota)?void 0:c.limit)||"all"," pages. Upgrade or wait for reset."),icon:(0,s.jsx)("svg",{className:"w-12 h-12 text-purple-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),benefits:[{icon:"\uD83C\uDFE2",text:"Business: 5,000-60,000 pages/period"},{icon:"⚡",text:"4x more processing power"},{icon:"\uD83C\uDFAF",text:"Highest value per page"},{icon:"\uD83D\uDC65",text:"Team collaboration features"},{icon:"\uD83C\uDFC6",text:"VIP dedicated support"}],primaryAction:{text:"Upgrade to Business",color:"purple",onClick:()=>v.push(A?"/pricing?plan=yearly&redirect=".concat(encodeURIComponent(w)):"/pricing?redirect=".concat(encodeURIComponent(w)))},secondaryAction:{text:"Resets on ".concat((null==h||null==(d=h.quota)?void 0:d.resets_at)?new Date(h.quota.resets_at).toLocaleDateString():"next billing cycle"),onClick:g}},R="business_monthly"===k,D="business_yearly"===k,I={title:D?"Annual Business Limit Reached":"Monthly Business Limit Reached",subtitle:D?"You've reached your annual Bu
1siness limit of ".concat((null==h||null==(u=h.quota)?void 0:u.limit)||"all"," pages. Upgrade or wait for reset."):"You've reached your monthly Business limit of ".concat((null==h||null==(m=h.quota)?void 0:m.limit)||"all"," pages. Upgrade or wait for reset."),icon:(0,s.jsx)("svg",{className:"w-12 h-12 text-blue-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"})}),benefits:R?[{icon:"\uD83C\uDFC6",text:"You're on our highest monthly tier!"},{icon:"\uD83D\uDCC8",text:"Consider yearly plans for better value"},{icon:"\uD83D\uDCDE",text:"Need more? Contact us for Enterprise"},{icon:"\uD83C\uDFAF",text:"Custom quota arrangements available"},{icon:"⚡",text:"Dedicated account manager"}]:[{icon:"\uD83D\uDCBC",text:"You're on our highest tier!"},{icon:"\uD83D\uDCDE",text:"Need more? Contact us for Enterprise"},{icon:"\uD83C\uDFAF",text:"Custom quota arrangements available"},{icon:"\uD83C\uDFC6",text:"Dedicated account manager"},{icon:"⚡",text:"Custom API rate limits"}],primaryAction:R?{text:"View Yearly Plans",color:"blue",onClick:()=>v.push("/pricing?plan=yearly&redirect=".concat(encodeURIComponent(w)))}:{text:"Contact Sales for Enterprise",color:"blue",onClick:()=>window.location.href="mailto:[email protected]?subject=Enterprise Plan Inquiry"},secondaryAction:R?{text:"Contact Sales for Enterprise",onClick:()=>window.location.href="mailto:[email protected]?subject=Enterprise Plan Inquiry"}:{text:"Resets on ".concat((null==h||null==(x=h.quota)?void 0:x.resets_at)?new Date(h.quota.resets_at).toLocaleDateString():"next billing cycle"),onClick:g}},B="anonymous"===k?P:"free"===k?L:k.includes("starter")?M:k.includes("professional")?F:k.includes("business")?I:M;console.log("QuotaModal userType:",k,"quotaData:",h,"partialData:",y);let z=(0,s.jsx)("svg",{className:"w-12 h-12 text-yellow-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),T=j?"Partial Processing":B.title,E=j?"Processed ".concat(y.pagesProcessed," of ").concat(y.totalPagesInFile," pages due to quota limits"):B.subtitle,U=j?z:B.icon,_=j?"View partial results below":B.secondaryAction.text;return(0,s.jsxs)("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[(0,s.jsx)("div",{className:"fixed inset-0 bg-gray-500/50 dark:bg-gray-900/60 transition-opacity"}),(0,s.jsx)("div",{className:"relative flex min-h-full items-center justify-center p-4",children:(0,s.jsxs)("div",{className:"relative bg-white dark:bg-gray-800 rounded-2xl shadow-2xl max-w-md w-full p-6 transform transition-all border-2 border-gray-200 dark:border-gray-600",children:[(0,s.jsx)("button",{onClick:g,className:"absolute top-3 right-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,s.jsx)("div",{className:"flex justify-center mb-4",children:U}),(0,s.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white text-center mb-1",children:T}),(0,s.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 text-center mb-5",children:E}),(0,s.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-900/50 rounded-xl p-4 mb-5",children:[(0,s.jsx)("h3",{className:"text-xs font-semibold text-gray-700 dark:text-gray-300 mb-3 text-center",children:"anonymous"===k?"✨ Sign up to unlock:":"free"===k?"✨ Upgrade to unlock:":"✨ Higher plans include:"}),(0,s.jsx)("div",{className:"space-y-2",children:B.benefits.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-lg",children:e.icon}),(0,s.jsx)("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e.text})]},t))})]}),j?(0,s.jsx)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-3 mb-5",children:(0,s.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,s.jsx)("span",{className:"text-yellow-700 dark:text-yellow-400",children:"Pages Processed:"}),(0,s.jsxs)("span",{className:"font-semibold text-yellow-900 dark:text-yellow-300",children:[y.pagesProcessed," / ",y.totalPagesInFile," pages"]})]})}):(null==h?void 0:h.quota)&&(0,s.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-3 mb-5",children:(0,s.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,s.jsx)("span",{className:"text-blue-700 dark:text-blue-400",children:"Used:"}),(0,s.jsxs)("span",{className:"font-semibold text-blue-900 dark:text-blue-300",children:[h.quota.used," / ",h.quota.limit," pages"]})]})}),(0,s.jsx)("button",{onClick:B.primaryAction.onClick,className:"w-full ".concat((e=>{let t={blue:"bg-blue-600 hover:bg-blue-700",purple:"bg-purple-600 hover:bg-purple-700",orange:"bg-orange-600 hover:bg-orange-700"};return t[e]||t.blue})(B.primaryAction.color)," text-white font-semibold py-3 px-6 rounded-xl transition-all transform hover:scale-105 shadow-lg mb-3"),children:B.primaryAction.text}),B.subscribeAction&&!j&&(0,s.jsxs)("button",{onClick:B.subscribeAction.onClick,className:"w-full inline-flex items-center justify-center gap-1 bg-amber-600 hover:bg-amber-700 text-white font-semibold py-3 px-6 rounded-xl transition-all transform hover:scale-105 shadow-lg mb-3",children:[B.subscribeAction.text,(0,s.jsx)("span",{"aria-hidden":"true",children:"→"})]}),(0,s.jsx)("button",{onClick:j?g:B.secondaryAction.onClick,className:"w-full text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 text-xs font-medium",children:_})]})})]})}},2383:()=>{},3686:()=>{},5068:(e,t,r)=>{"use strict";function s(e){let t=String(null!=e?e:"");return t.startsWith("\uFEFF")?t:"\uFEFF"+t}r.d(t,{m:()=>s})},5557:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let s=/^(\()?\s*(-)?\s*(\$)?\s*(-)?\s*(\d{1,3}(?:,\d{3})+|\d+)(\.\d+)?\s*(\))?$/;function a(e,t){let r=[],a=t.map((e,t)=>e.map((e,a)=>{let n=function(e){if("string"!=typeof e)return null;let t=e.trim().match(s);if(!t)return null;let[,r,a,n,o,l,i,c]=t;if(!!r!=!!c||a&&o||r&&(a||o))return null;let d=l.replace(/,/g,"");if(d.length>1&&"0"===d[0]||d.length>15)return null;let u=Number(d+(i||""));(r||a||o)&&(u=-u);let m=i?i.length-1:0,x=l.includes(",")?"#,##0":"0",p=m>0?x+"."+"0".repeat(m):x,g=n?'"$"'.concat(p):p;return{value:u,format:r?"".concat(g,";(").concat(g,")"):g}}(e);return n?(r.push({r:t,c:a,z:n.format}),n.value):e})),n=e.utils.aoa_to_sheet(a);for(let{r:e,c:t,z:s}of r){let r=n[function(e,t){let r="";for(let e=t+1;e>0;e=Math.floor((e-1)/26))r=String.fromCharCode(65+(e-1)%26)+r;return r+(e+1)}(e,t)];r&&(r.z=s)}return n["!cols"]=function(e){let t=e.reduce((e,t)=>
1Array.isArray(t)?Math.max(e,t.length):e,0),r=[];for(let s of e)Array.isArray(s)&&(t>1&&1===s.length||s.forEach((e,t)=>{let s=null==e?0:String(e).length;s>(r[t]||0)&&(r[t]=s)}));return Array.from({length:t},(e,t)=>({wch:Math.min(60,Math.max(8,(r[t]||0)+2))}))}(t),n}},5576:(e,t,r)=>{"use strict";r.d(t,{N:()=>n});var s=r(2373);let a=r(5704).env.NEXT_PUBLIC_SUPABASE_URL||"https://tdnevnqwkftudljcpuqa.supabase.co",n=(0,s.UU)(a,"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InRkbmV2bnF3a2Z0dWRsamNwdXFhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjAwODkxODcsImV4cCI6MjA3NTY2NTE4N30.IiTQeMKzJ5vCEv738R9ulHkI9jX8mvXtDyeuXMKf1fk")},6149:(e,t,r)=>{"use strict";r.d(t,{A:()=>g});var s=r(5155),a=r(2115),n=r(2619),o=r.n(n),l=r(4246),i=r(2112),c=r(5576),d=r(5068),u=r(5557),m=r(938),x=r(6430);let p=e=>{let{isPasswordFlow:t=!1}=e,[r,n]=(0,a.useState)(0),[o,l]=(0,a.useState)("Initializing...");return(0,a.useEffect)(()=>{let e=[],r=0;(t?[{progress:15,message:"Unlocking PDF...",time:500},{progress:35,message:"Analyzing document structure...",time:1500},{progress:55,message:"Detecting tables...",time:1500},{progress:75,message:"Extracting data...",time:2e3},{progress:90,message:"Processing tables...",time:1500},{progress:95,message:"Finalizing...",time:1e3}]:[{progress:15,message:"Reading document...",time:1e3},{progress:35,message:"Analyzing document structure...",time:2e3},{progress:55,message:"Detecting tables...",time:1500},{progress:75,message:"Extracting data...",time:2e3},{progress:90,message:"Processing tables...",time:1500},{progress:95,message:"Finalizing...",time:1e3}]).forEach(t=>{let s=setTimeout(()=>{n(t.progress),l(t.message)},r+=t.time);e.push(s)});let s=setTimeout(()=>{let t=95,r=setInterval(()=>{(t+=.1*Math.random()+.05)>=98.5&&(t=Math.min(t+.01,98.8)),n(Math.min(t,98.8));let e=["Still extracting data...","Processing complex tables...","Analyzing document structure...","Optimizing table detection...","Almost finished..."],r=Math.floor(Date.now()/3e3)%e.length;l(e[r])},2e3);e.push(r)},r+1e3);return e.push(s),()=>{e.forEach(e=>clearTimeout(e)||clearInterval(e))}},[t]),(0,s.jsx)("div",{className:"w-full max-w-md mx-auto mt-4",children:(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("div",{className:"w-full mb-2",children:(0,s.jsx)("div",{className:"h-2 relative w-full bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:"h-full transition-all duration-500 ease-out rounded-full",style:{width:"".concat(r,"%"),backgroundColor:"#584fe3"}})})}),(0,s.jsxs)("div",{className:"w-full flex justify-between items-center mb-2",children:[(0,s.jsx)("span",{className:"text-gray-900 dark:text-white text-sm",children:o}),(0,s.jsxs)("span",{className:"text-gray-900 dark:text-white text-sm",children:[Math.round(r),"%"]})]}),(0,s.jsx)("div",{className:"text-center",children:(0,s.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:"Processing your document. This may take few seconds to a minute"})})]})})};function g(e){let{compact:t=!1,bankName:r="",className:n="",onHasResults:g}=e,h=(0,a.useId)(),f="file-upload-".concat(h),b=t?"max-w-[60rem]":"max-w-5xl",[y,v]=(0,a.useState)(null),[w,k]=(0,a.useState)(!1),[j,N]=(0,a.useState)(null),[C,P]=(0,a.useState)(null),[L,S]=(0,a.useState)(!1),[M,A]=(0,a.useState)(null),[F,R]=(0,a.useState)(null),[D,I]=(0,a.useState)(!1),[B,z]=(0,a.useState)(null),[T,E]=(0,a.useState)(!0),[U,_]=(0,a.useState)(!1),[q,V]=(0,a.useState)(null),[W,H]=(0,a.useState)(null),[O,J]=(0,a.useState)(null),[Y,G]=(0,a.useState)(null);(0,a.useEffect)(()=>{g&&g(!!j&&!w),j&&!w&&window.dispatchEvent(new CustomEvent("quota-updated"))},[j,w,g]),(0,a.useEffect)(()=>{let e=async e=>{if(e&&e.email){let{data:t}=await c.N.from("users").select("plan_tier").eq("id",e.id).single();G((null==t?void 0:t.plan_tier)||"free")}else G(null)};c.N.auth.getSession().then(t=>{var r;let{data:{session:s}}=t,a=null!=(r=null==s?void 0:s.user)?r:null;J(a),e(a)});let{data:{subscription:t}}=c.N.auth.onAuthStateChange((t,r)=>{var s;let a=null!=(s=null==r?void 0:r.user)?s:null;J(a),e(a)});return()=>t.unsubscribe()},[]);let X=()=>y?y.name.replace(/\.[^/.]+$/,"")+"_converted":"bank_transactions",Z=()=>{v(null),N(null),H(null),P(null),k(!1),z(null),A(null),R(null),I(!1)},$=async e=>{let t=e||y;if(!t)return;if(H(null),T)return Q(t);k(!0),P(null);let r=new FormData;r.append("pdf",t);try{let e="localhost"===window.location.hostname?"http://localhost:3001/api/process-pdf":"/api/process-pdf",{data:{session:t}}=await c.N.auth.getSession(),s={};(null==t?void 0:t.access_token)&&(s.Authorization="Bearer ".concat(t.access_token));let a=await fetch(e,{method:"POST",headers:s,body:r}),n=await a.json();if(!a.ok){if(429===a.status)if(n.rateLimit){alert("Rate limit exceeded: ".concat(n.message,"\n\nPlease wait ").concat(n.retryAfter||60," seconds before trying again.")),k(!1);return}else if(n.abuse){alert("".concat(n.message||"Too many requests detected.","\n\nPlease wait a few minutes before trying again.")),k(!1);return}else{V(n),_(!0),k(!1);return}throw Error(n.error||"HTTP error! status: ".concat(a.status))}if(n.success)N(n),n.partialProcessing&&H({pagesProcessed:n.pagesProcessed,totalPagesInFile:n.totalPagesInFile});else if(n.requiresPassword){A({tempId:n.tempId,fileName:n.fileName}),k(!1);return}else P(n.error||"Processing failed")}catch(e){console.error("API call error:",e),P(e instanceof TypeError?"The connection dropped before the conversion finished. Please check your internet connection and try again.":e.message||"Something went wrong. Please try again.")}finally{k(!1)}},K=async(e,t)=>{if(!e)return null;let r="localhost"===window.location.hostname?"http://localhost:3001":"",s=Date.now();for(;Date.now()-s<6e5;){let a,n,o=Date.now()-s;o<3e4?(a="Still processing...",n=2e3):o<12e4?(a="Still working — large files can take a minute or two",n=5e3):o<3e5?(a="Still working — feel free to close this tab; results will appear in your Documents shortly",n=1e4):(a="Taking longer than usual — your result will land in Documents when ready",n=15e3),z(e=>({...e||{},message:a}));try{let s=await fetch("".concat(r,"/api/documents/").concat(e),{headers:t?{Authorization:"Bearer ".concat(t)}:{}});if(s.ok){let e=await s.json();if(e.success&&e.document)return{success:!0,headers:e.document.headers,transactions:e.document.transactions,count:(e.document.transactions||[]).length,fileType:e.document.file_type||"PDF",originalName:e.document.filename,totalPages:e.document.page_count,pagesDeducted:e.document.page_count||1}}}catch(e){}await new Promise(e=>setTimeout(e,n))}return null},Q=async e=>{let t=e||y;if(!t)return;k(!0),P(null),z(null);let r=new FormData;r.append("pdf",t);let s=null,a=!1,n=null;try{let e="localhost"===window.location.hostname?"http://localhost:3001/api/process-pdf-stream":"/api/process-pdf-stream",{data:{session:t}}=await c.N.auth.getSession(),l={};(null==t?void 0:t.access_token)&&(l.Authorization="Bearer ".concat(t.access_token));let i=await fetch(e,{method:"POST",headers:l,body:r});if(!i.ok){if(429===i.status){let e=await i.json();if(e.rateLimit){alert("Rate limit exceeded: ".concat(e.message,"\n\nPlease wait ").concat(e.retryAfter||60," seconds before trying again.")),k(!1);return}if(e.abuse){alert("".concat(e.message||"Too many requests detected.","\n\nPlease wait a few minutes before trying again.")),k(!1);return}V(e),_(!0),k(!1);return}let e=await i.json().catch(()=>({}));throw Error(e.error||e.message||"Something went wrong (error ".concat(i.status,"). Please try again."))}let d=i.body.getReader(),u=new TextDecoder,m="";for(;;){let{done:e,value:t}=await d.read();if(e)break;let r=(m+=u.decode(t,{stream:!0})).split("\n");for(let e of(m=r.pop(),r))if(e.trim().startsWith("data: "))try{let t=JSON.parse(e.substring(6));if("start"===t.type)s=t.jobId;else if("progress"===t.type)z({currentTransactions:t.currentTransactions||0,totalPages:t.totalPages,message:t.message,progress:t.progress||0,partialResults:t.partialResults||null}),t.partialResults&&t.partialResults.headers&&N(t.partialResults);else if("complete"===t.type){var o;a=!0,z({currentTransactions:t.currentTransactions||0,totalPages:t.totalPages,message:t.message,progress:t.progress,partialResults:null}),N(t.results),k(!1),(null==(o=t.results)?void 0:o.partialProcessing)&&H({pagesProcessed:t.results.pagesProcessed,totalPagesInFile:t.results.totalPagesInFile})}else if("password_required"===t.type){A({tempId:t.tempId,fileName:t.fileName}),k(!1);return}else"error"===t.type&&(n=t.message)}catch(t){console.log("Failed to parse SSE data:",t,e)}}if(a)return;if(n){P(n),k(!1);return}if(s){let e=await K(s,null==t?void 0:t.access_token);if(e){N(e),z(t=>({...t||{},message:"✅ Found ".concat(e.count," transactions"),progress:100})),k(!1);return}P("Didn't complete within 10 minutes — check your Documents page in a few minutes")}else P("Conversion didn't complete — please try again");k(!1)}catch(e){if(console.error("Streaming API call error:",e),s){let{data:{session:e}}=await c.N.auth.getSession(),t=await K(s,null==e?void 0:e.access_token);if(t){N(t),z(e=>({...e||{},message:"✅ Found ".concat(t.count," transactions"),progress:100})),k(!1);return}}P(e instanceof TypeError?"The connection dropped before the conversion finished. Please check your internet connection and try again.":e.message||"Something went wrong. Please try again."),k(!1)}},ee=async e=>{if(!M)return;k(!0),R(null),z(null);let t=null;try{let s="localhost"===window.location.hostname?"http://localhost:3001/api/submit-password":"/api/submit-password",{data:{session:a}}=await c.N.auth.getSession(),n={"Content-Type":"application/json"};(null==a?void 0:a.access_token)&&(n.Authorization="Bearer ".concat(a.access_token));let o=await fetch(s,{method:"POST",headers:n,body:JSON.stringify({tempId:M.tempId,password:e})}),l=o.headers.get("content-type");if(l&&(l.includes("text/event-stream")||l.includes("text/plain"))){let e=o.body.getReader(),s=new TextDecoder,n="",l=!1,i=null;for(;;){let{done:a,value:o}=await e.read();if(a){z(null);break}let c=(n+=s.decode(o,{stream:!0})).split("\n");for(let e of(n=c.pop(),c))if(e.trim().startsWith("data: "))try{let s=JSON.parse(e.substring(6));if("start"===s.type)t=s.jobId;else if("progress"===s.type)z({currentTransactions:s.currentTransactions||0,totalPages:s.totalPages,message:s.message,progress:s.progress||0,partialResults:s.partialResults||null}),s.partialResults&&s.partialResults.headers&&N(s.partialResults);else if("complete"===s.type){var r;l=!0,z({currentTransactions:s.currentTransactions||0,totalPages:s.totalPages,message:s.message,progress:s.progress,partialResults:null}),N(s.results),A(null),R(null),I(!1),k(!1),(null==(r=s.results)?void 0:r.partialProcessing)&&H({pagesProcessed:s.results.pagesProcessed,totalPagesInFile:s.results.totalPagesInFile});return}else"error"===s.type&&(i=s.message||"Failed to process password-protected PDF")}catch(t){console.log("Failed to parse SSE data:",t,e)}}if(!l){if(i){R(i),k(!1);return}if(t){let e=await K(t,null==a?void 0:a.access_token);if(e){N(e),A(null),R(null),I(!1),z(t=>({...t||{},message:"✅ Found ".concat(e.count," transactions"),progress:100})),k(!1);return}A(null),R(null),I(!1),P("Didn't complete within 10 minutes — check your Documents page in a few minutes")}else A(null),R(null),I(!1),P("Conversion didn't complete — please try again");k(!1);return}}else{let e=await o.json();e.success?(N(e),A(null),R(null),I(!1)):R(e.error||"Failed to process password"),k(!1)}}catch(e){if(console.error("Password submission error:",e),t){let{data:{session:e}}=await c.N.auth.getSession(),r=await K(t,null==e?void 0:e.access_token);if(r){N(r),A(null),R(null),I(!1),z(e=>({...e||{},message:"✅ Found ".concat(r.count," transactions"),progress:100})),k(!1);return}}R("Failed to submit password. Please try again."),z(null),k(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:n,children:[(0,s.jsxs)("div",{className:"".concat(b," mx-auto mb-6 sm:mb-8 px-2"),children:[(0,s.jsxs)("div",{className:"border-2 border-dashed rounded-2xl sm:rounded-3xl transition-all duration-300 relative flex flex-col justify-center ".concat(y&&!w?"py-3 sm:py-4 px-4 sm:px-8 min-h-[60
1px] sm:min-h-[80px]":t?"py-7 sm:py-11 px-6 sm:px-15 min-h-[220px] sm:min-h-[260px]":"py-8 sm:py-12 px-6 sm:px-16 min-h-[240px] sm:min-h-[280px]"," ").concat(L?"bg-purple-50 dark:bg-blue-800/50 border-purple-400 dark:border-blue-400 shadow-xl sm:shadow-2xl scale-[1.01] sm:scale-[1.02]":"bg-gray-50 dark:bg-[#1e2946] hover:shadow-xl hover:scale-[1.008]"),style:{borderColor:L?"#4338ca":"#584fe3"},onMouseEnter:e=>!L&&(e.target.style.borderColor="#4338ca"),onMouseLeave:e=>!L&&(e.target.style.borderColor="#584fe3"),onDrop:e=>{e.preventDefault(),S(!1);let t=e.dataTransfer.files[0];return t?["application/pdf","image/png","image/jpeg","image/jpg"].includes(t.type)?t.size>0xa00000?void P("File too large: ".concat((t.size/1048576).toFixed(2),"MB. Maximum size: 10MB")):void(v(t),N(null),P(null),$(t)):void P("Unsupported file format: ".concat(t.type||"unknown",". Supported formats: PDF, PNG, JPG, JPEG")):void 0},onDragOver:e=>{e.preventDefault()},onDragEnter:e=>{e.preventDefault(),S(!0)},onDragLeave:e=>{e.preventDefault(),e.currentTarget.contains(e.relatedTarget)||S(!1)},children:[!w&&!M&&!y&&(0,s.jsx)("div",{className:"absolute top-3 right-3 sm:top-4 sm:right-4 z-10",children:(0,s.jsxs)("div",{className:"inline-flex items-center bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-full p-1 shadow-sm",children:[(0,s.jsx)("span",{className:"px-3 py-1 text-xs sm:text-sm font-medium rounded-full text-white cursor-default",style:{backgroundColor:"#584fe3"},children:"Single"}),(0,s.jsx)(o(),{href:"/batch-convert",className:"px-3 py-1 text-xs sm:text-sm font-medium rounded-full text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white transition-colors",children:"Bulk"})]})}),(0,s.jsx)("input",{type:"file",accept:".pdf,.png,.jpg,.jpeg",onChange:e=>{let t=e.target.files[0];return t?["application/pdf","image/png","image/jpeg","image/jpg"].includes(t.type)?t.size>0xa00000?void P("File too large: ".concat((t.size/1048576).toFixed(2),"MB. Maximum size: 10MB")):void(v(t),N(null),P(null),$(t)):void P("Unsupported file format: ".concat(t.type||"unknown",". Supported formats: PDF, PNG, JPG, JPEG")):void 0},className:"hidden",id:f}),w?(0,s.jsx)("div",{className:"text-center flex-1 flex flex-col justify-center",children:(0,s.jsx)(p,{isPasswordFlow:null!==M})}):M?(0,s.jsx)(m.A,{fileName:M.fileName,error:F,onSubmit:ee,onCancel:()=>{A(null),R(null),Z()}}):y?(0,s.jsxs)("div",{className:"bg-gray-600 rounded-lg p-2 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-white font-medium text-sm truncate",children:y.name}),(0,s.jsxs)("p",{className:"text-gray-300 text-xs",children:[(y.size/1024).toFixed(0)," KB"]})]}),(0,s.jsx)("button",{onClick:Z,className:"ml-3 w-5 h-5 bg-gray-500 hover:bg-gray-400 rounded-full flex items-center justify-center transition-colors flex-shrink-0",children:(0,s.jsx)("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}):(0,s.jsx)("label",{htmlFor:f,className:"cursor-pointer text-center flex-1 flex flex-col justify-center",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mx-auto rounded-full flex items-center justify-center bg-blue-100/80 dark:bg-blue-100/90 transition-all duration-300 hover:scale-110 w-20 h-20 sm:w-24 sm:h-24 mb-4 sm:mb-6",children:(0,s.jsx)("svg",{className:"animate-bounce w-10 h-10 sm:w-12 sm:h-12",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",style:{color:"#584fe3"},children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})})}),(0,s.jsxs)("div",{className:"mb-4 sm:mb-6",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-900 dark:text-white text-lg sm:text-xl mb-3 sm:mb-4",children:r?"Upload your ".concat(r," bank statement"):"Click to upload or drag and drop"}),(0,s.jsxs)("button",{type:"button",onClick:()=>document.getElementById(f).click(),className:"text-white font-semibold rounded-lg sm:rounded-xl transition-all duration-300 shadow-lg hover:shadow-2xl hover:scale-105 hover:brightness-110 inline-flex items-center py-2.5 px-6 sm:py-3 sm:px-8 text-base sm:text-lg",style:{backgroundColor:"#584fe3"},onMouseEnter:e=>e.target.style.backgroundColor="#4338ca",onMouseLeave:e=>e.target.style.backgroundColor="#584fe3",children:[(0,s.jsx)("svg",{className:"mr-1.5 sm:mr-2 w-4 h-4 sm:w-5 sm:h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})}),"Select Files"]})]}),(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("p",{className:"text-gray-600 dark:text-gray-400 font-medium mb-3 text-sm",children:"Supported formats:"}),(0,s.jsxs)("div",{className:"flex items-center justify-center space-x-6 mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("svg",{className:"w-4 h-4 text-red-500 mr-2",fill:"
1currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"})}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"PDF"})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("svg",{className:"w-4 h-4 text-green-500 mr-2",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z"})}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"JPG"})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("svg",{className:"w-4 h-4 text-blue-500 mr-2",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z"})}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"PNG"})]})]}),(0,s.jsx)("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"Up to 50MB (including password-protected PDFs)"})]})]})})]}),(0,s.jsx)(x.h,{})]}),B&&w&&(0,s.jsx)("div",{className:"".concat(b," mx-auto mb-6"),children:(0,s.jsxs)("div",{className:"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-3",children:(0,s.jsx)("span",{className:"text-sm font-semibold text-green-800 dark:text-green-300",children:B.message?B.message.replace(/✅ /g,""):B.currentTransactions>0?"Found ".concat(B.currentTransactions," transactions"):"Processing document..."})}),(0,s.jsx)("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2 overflow-hidden",children:(0,s.jsx)("div",{className:"h-2 bg-green-500 rounded-full animate-pulse",style:{width:"100%"}})})]})}),W&&!w&&(0,s.jsx)("div",{className:"".concat(b," mx-auto mb-6"),children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-200 dark:border-amber-800 border-l-4 border-l-amber-500 bg-amber-50 dark:bg-amber-900/20 p-4",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("svg",{className:"w-5 h-5 flex-shrink-0 text-amber-500 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:["Partial results — ",W.pagesProcessed," of ",W.totalPagesInFile," pages processed"]}),(0,s.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"You ran out of credits before the full file could be processed."})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(!O||(null==O?void 0:O.is_anonymous))&&(0,s.jsx)("a",{href:"/signup",className:"text-sm font-semibold text-amber-700 dark:text-amber-400 hover:underline whitespace-nowrap",children:"Sign up free for more pages"}),(0,s.jsxs)("a",{href:"/pricing",className:"inline-flex items-center gap-1 rounded-lg bg-amber-600 hover:bg-amber-700 px-4 py-2 text-sm font-semibold text-white shadow-sm transition-colors whitespace-nowrap",children:[Y&&"free"!==Y?"Upgrade":"Subscribe"," to process all pages",(0,s.jsx)("span",{"aria-hidden":"true",children:"→"})]})]})]})}),j&&!w&&(0,s.jsx)("div",{className:"".concat(b," mx-auto mb-6 text-center"),children:(0,s.jsxs)("div",{className:"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-center mb-4",children:[(0,s.jsx)("svg",{className:"w-8 h-8 text-green-600 dark:text-green-400 mr-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,s.jsx)("h3",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Conversion Complete!"})]}),(0,s.jsxs)("div",{className:"flex justify-center space-x-3",children:[(0,s.jsxs)("button",{onClick:()=>
1{if(!j||!j.transactions)return;let e=[j.headers.map(e=>'"'.concat(e,'"')).join(","),...j.transactions.map(e=>e.map(e=>'"'.concat((null!=e?e:"").toString().replace(/"/g,'""'),'"')).join(","))].join("\n"),t=new Blob([(0,d.m)(e)],{type:"text/csv"}),r=URL.createObjectURL(t),s=document.createElement("a");s.href=r,s.download="".concat(X(),".csv"),s.click(),URL.revokeObjectURL(r)},className:"px-5 py-2 bg-white dark:bg-gray-900 border-2 rounded-md font-medium text-sm transition-colors hover:bg-gray-50 dark:bg-gray-800 flex items-center",style:{borderColor:"#584fe3",color:"#584fe3"},children:[(0,s.jsx)("svg",{className:"w-4 h-4 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})}),"CSV"]}),(0,s.jsxs)("button",{onClick:()=>{if(!j||!j.transactions)return;let e=[j.headers,...j.transactions],t=l.utils.book_new(),r=(0,u.A)(l,e);l.utils.book_append_sheet(t,r,"Transactions"),l.writeFile(t,"".concat(X(),".xlsx"))},className:"px-5 py-2 bg-white dark:bg-gray-900 border-2 rounded-md font-medium text-sm transition-colors hover:bg-green-50 flex items-center",style:{borderColor:"#16a34a",color:"#16a34a"},children:[(0,s.jsx)("svg",{className:"w-4 h-4 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM6.293 6.707a1 1 0 010-1.414l3-3a1 1 0 011.414 0l3 3a1 1 0 11-1.414 1.414L11 5.414V13a1 1 0 11-2 0V5.414L7.707 6.707a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),"Excel"]}),(0,s.jsxs)("button",{onClick:()=>{if(!j||!j.transactions)return;let e=new Blob([JSON.stringify({headers:j.headers,transactions:j.transactions.map(e=>{let t={};return j.headers.forEach((r,s)=>{t[r]=e[s]||""}),t}),totalTransactions:j.count,exportedAt:new Date().toISOString()},null,2)],{type:"application/json"}),t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download="".concat(X(),".json"),r.click(),URL.revokeObjectURL(t)},className:"px-5 py-2 bg-white dark:bg-gray-900 border-2 rounded-md font-medium text-sm transition-colors hover:bg-orange-50 flex items-center",style:{borderColor:"#ea580c",color:"#ea580c"},children:[(0,s.jsx)("svg",{className:"w-4 h-4 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})}),"JSON"]})]})]})}),C&&(0,s.jsx)("div",{className:"max-w-2xl mx-auto mb-8 bg-red-50 border border-red-200 rounded-xl p-6",children:(0,s.jsxs)("div",{className:"flex items-start justify-center gap-2",children:[(0,s.jsx)("svg",{className:"w-5 h-5 shrink-0 mt-0.5 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,s.jsx)("span",{className:"text-red-800 font-medium text-left",children:C.includes("Documents")?(0,s.jsxs)(s.Fragment,{children:["Didn't complete within 10 minutes — check"," ",(0,s.jsx)("a",{href:"/dashboard/documents",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-red-900",children:"your Documents page"})," ","in a few minutes."]}):C})]})}),C&&!j&&(0,s.jsx)(x.U,{variant:"upload",className:"max-w-2xl mx-auto -mt-4 mb-8"}),j&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"max-w-7xl mx-auto bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-2xl shadow-sm",children:(0,s.jsx)("div",{className:"overflow-auto rounded-xl border border-gray-200 dark:border-gray-700 max-h-[700px]",children:(0,s.jsxs)("table",{className:"w-full",children:[(0,s.jsx)("thead",{className:"bg-gray-50 dark:bg-gray-800 sticky top-0",children:(0,s.jsx)("tr",{children:j.headers.map((e,t)=>(0,s.jsx)("th",{className:"px-6 py-4 text-left text-sm font-semibold text-gray-900 dark:text-white",children:e},t))})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-200 bg-white dark:bg-gray-900",children:j.transactions.map((e,t)=>(0,s.jsx)("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-800",children:e.map((e,t)=>(0,s.jsx)("td",{className:"px-6 py-4 text-sm text-gray-900 dark:text-white",children:e||"-"},t))},t))})]})})}),!w&&(0,s.jsx)(x.U,{variant:"results",className:"mt-4"}),!w&&(0,s.jsx)("div",{className:"mx-auto mt-6",style:{maxWidth:"fit-content"},children:(0,s.jsxs)("div",{className:"bg-gradient-to-r from-indigo-50 to-purple-50 dark:from-indigo-900/20 dark:to-purple-900/20 rounded-xl border border-indigo-200 dark:border-indigo-800 p-4 flex items-center gap-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center flex-shrink-0",style:{backgroundColor:"#584fe3"}
1,children:(0,s.jsx)("svg",{className:"w-4.5 h-4.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,s.jsx)("p",{className:"text-sm text-gray-700 dark:text-gray-300 font-medium",children:"Got more statements? Batch convert them all in one go"})]}),(0,s.jsx)("a",{href:"/batch-convert",className:"text-white px-4 py-2 rounded-lg text-sm font-medium transition-colors whitespace-nowrap flex-shrink-0",style:{backgroundColor:"#584fe3"},children:"Try Batch Convert"})]})})]})]}),(0,s.jsx)(i.A,{isOpen:U,onClose:()=>_(!1),quotaData:q,user:O,userPlan:Y})]})}},6430:(e,t,r)=>{"use strict";r.d(t,{U:()=>l,h:()=>o});var s=r(5155),a=r(2619),n=r.n(a);function o(e){let{className:t="mt-6",browserOnly:r=!1}=e;return(0,s.jsxs)("div",{className:"".concat(t," flex items-start justify-center text-sm text-gray-500 dark:text-gray-400 text-center"),children:[(0,s.jsx)("svg",{className:"w-4 h-4 text-green-500 dark:text-green-400 mr-2 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),r?"Converted entirely in your browser - your file is never uploaded":"Bank-grade security - Files processed securely and deleted immediately"]})}function l(e){let{variant:t="upload",className:r="mt-3"}=e;return(0,s.jsxs)("div",{className:"".concat(r," flex items-start justify-center text-sm text-gray-500 dark:text-gray-400 text-center"),children:[(0,s.jsx)("svg",{className:"w-4 h-4 mr-2 mt-0.5 flex-shrink-0 text-[#584fe3] dark:text-[#8b84ff]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.86 9.86 0 01-4-.8L3 20l1.3-3.9A7.96 7.96 0 013 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),(0,s.jsxs)("span",{children:["results"===t?"Result not quite right? Tell us — we fix conversion issues fast.":"Trouble converting a file? Tell us — we fix issues fast."," ",(0,s.jsx)(n(),{href:"/support",className:"font-medium hover:underline text-[#584fe3] dark:text-[#8b84ff]",children:"Report it"})]})]})}}}]);

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.