PageSourceSearch

https://www.kindora.co/_next/static/chunks/18532-f4803bcebe104161.js

js kindora.co collected 2026-10-03 20:59:34 UTC 47,504 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="d66594ac-0691-4e37-9677-3c9c39fb6f3e",e._sentryDebugIdIdentifier="sentry-dbid-d66594ac-0691-4e37-9677-3c9c39fb6f3e")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[18532],{14908:(e,r,t)=>{t.d(r,{u:()=>w});var a=t(95155),n=t(12115),s=t(50910),i=t(29202),l=t(87616),o=t(34657),d=t(46611),c=t(48458),u=t(88172),m=t(12651),x=t(13545),h=t(50049),p=t(9921),f=t(66088),g=t(61878),y=t(24538),v=t(40980),j=t(77967);function w(e){let{parsedInput:r,selectedFunderId:t,onSelect:y,onSearchOther:w,isConfirmed:N=!1,idPrefix:F,className:k}=e,C=(0,s.c)("currentFundersList.matchReview"),_=(0,s.c)("currentFunders.funderTypeLabels"),[D,A]=(0,n.useState)(!0),[E,S]=(0,n.useState)(""),{input_name:I,candidates:z,best_match:q}=r,L=z.length>0,T=null!==q,M=(F||I).replace(/[^a-zA-Z0-9_-]/g,"_"),R=t?z.find(e=>e.funder_id===t):null;return(0,a.jsx)(i.Zp,{className:(0,v.cn)("border transition-all",N?"border-green-200 bg-green-50/30":T?"border-kindora-gray-200":"border-amber-200 bg-amber-50/30",k),"data-sentry-element":"Card","data-sentry-component":"FunderMatchReviewCard","data-sentry-source-file":"FunderMatchReviewCard.tsx",children:(0,a.jsxs)(i.Wu,{className:"p-4","data-sentry-element":"CardContent","data-sentry-source-file":"FunderMatchReviewCard.tsx",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[N?(0,a.jsx)(m.A,{className:"h-4 w-4 text-green-600 flex-shrink-0"}):L?(0,a.jsx)(h.A,{className:"h-4 w-4 text-kindora-gray-500 flex-shrink-0"}):(0,a.jsx)(x.A,{className:"h-4 w-4 text-amber-600 flex-shrink-0"}),(0,a.jsx)("span",{className:"font-medium text-kindora-gray-900 truncate",children:I})]}),!D&&R&&(0,a.jsxs)("p",{className:"text-sm text-kindora-gray-600 mt-1 ml-6",children:["→ ",R.funder_name,(0,a.jsx)(o.E,{variant:(0,j.ht)(R.match_confidence),className:"ml-2 text-xs",children:(0,j.Me)(R.match_confidence)})]})]}),(0,a.jsx)(l.$,{variant:"ghost",size:"sm",onClick:()=>A(!D),className:"flex-shrink-0","data-sentry-element":"Button","data-sentry-source-file":"FunderMatchReviewCard.tsx",children:D?(0,a.jsx)(p.A,{className:"h-4 w-4"}):(0,a.jsx)(f.A,{className:"h-4 w-4"})})]}),D&&(0,a.jsx)("div",{className:"mt-4 space-y-4",children:L?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(d.z,{value:t||"",onValueChange:e=>y(e||null),className:"space-y-2",children:[z.map(e=>{var r;let n="us_foundation"===(r=e.funder_type)||"non_990"===r?r:null;return(0,a.jsx)(b,{candidate:e,idPrefix:M,isSelected:t===e.funder_id,isBestMatch:(null==q?void 0:q.funder_id)===e.funder_id,bestMatchLabel:C("bestMatchBadge"),funderTypeLabel:n?_(n):e.funder_type},e.funder_id)}),(0,a.jsxs)("div",{className:(0,v.cn)("flex items-center space-x-3 rounded-lg border p-3 cursor-pointer transition-colors",null===t?"border-kindora-primary-500 bg-kindora-primary-50":"border-kindora-gray-200 hover:border-kindora-gray-300"),onClick:()=>y(null),children:[(0,a.jsx)(d.C,{value:"",id:"".concat(M,"-none")}),(0,a.jsx)(c.J,{htmlFor:"".concat(M,"-none"),className:"flex-1 cursor-pointer text-kindora-gray-700",children:C("noMatchInDatabase")})]})]}),w&&(0,a.jsx)("div",{className:"pt-2 border-t border-kindora-gray-100",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(g.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-kindora-gray-400"}),(0,a.jsx)(u.p,{placeholder:C("searchPlaceholder"),value:E,onChange:e=>S(e.target.value),className:"pl-9 text-sm"})]}),(0,a.jsx)(l.$,{variant:"outline",size:"sm",onClick:w,disabled:!E.trim(),children:C("searchButton")})]})})]}):(0,a.jsxs)("div",{className:"text-center py-4",children:[(0,a.jsx)(x.A,{className:"h-8 w-8 text-amber-500 mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-sm text-kindora-gray-600",children:C("noMatchesFoundTitle")}),(0,a.jsx)("p",{className:"text-xs text-kindora-gray-500 mt-1",children:C("noMatchesFoundBody")}),w&&(0,a.jsxs)(l.$,{variant:"outline",size:"sm",onClick:w,className:"mt-3",children:[(0,a.jsx)(g.A,{className:"h-4 w-4 mr-2"}),C("searchDatabaseButton")]})]})})]})})}function b(e){let{candidate:r,idPrefix:t,isSelected:n,isBestMatch:s,bestMatchLabel:i,funderTypeLabel:l}=e,u="".concat(t,"-").concat(r.funder_id).replace(/[^a-zA-Z0-9_-]/g,"_");return(0,a.jsxs)("div",{className:(0,v.cn)("flex items-start space-x-3 rounded-lg border p-3 cursor-pointer transition-colors",n?"border-kindora-primary-500 bg-kindora-primary-50":"border-kindora-gray-200 hover:border-kindora-gray-300",s&&!n&&"border-green-200 bg-green-50/50"),"data-sentry-component":"CandidateOption","data-sentry-source-file":"FunderMatchReviewCard.tsx",children:[(0,a.jsx)(d.C,{value:r.funder_id,id:u,className:"mt-0.5","data-sentry-element":"RadioGroupItem","data-sentry-source-file":"FunderMatchReviewCard.tsx"}),(0,a.jsxs)(c.J,{htmlFor:u,className:"flex-1 cursor-pointer space-y-1","data-sentry-element":"Label","data-sentry-source-file":"FunderMatchReviewCard.tsx",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"font-medium text-kindora-gray-900",children:r.funder_name}),s&&(0,a.jsx)(o.E,{variant:"success",className:"text-xs",children:i}),(0,a.jsx)(o.E,{variant:(0,j.ht)(r.match_confidence),className:"text-xs","data-sentry-element":"Badge","data-sentry-source-file":"FunderMatchReviewCard.tsx",children:(0,j.Me)(r.match_confidence)})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs text-kindora-gray-500",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(h.A,{className:"h-3 w-3","data-sentry-element":"Building2","data-sentry-source-file":"FunderMatchReviewCard.tsx"}),l]}),(r.city||r.state)&&(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(y.A,{className:"h-3 w-3"}
1),[r.city,r.state].filter(Boolean).join(", ")]})]})]})]})}},27106:(e,r,t)=>{t.d(r,{A:()=>s});var a=t(68001);let n="".concat("https://api.kindora.co".replace(/\/$/,""),"/api"),s={associateFunder:async(e,r,t)=>{try{if(!e||!r)throw Error("Organization ID and User ID are required");return(await a.vg.post("".concat(n,"/client/").concat(e,"/funders/associate"),t,{headers:{"x-user-id":r}})).data}catch(e){throw console.error("Error associating funder:",e),e}},analyzeImportFile:async(e,r,t)=>{try{let s=new FormData;return s.append("file",t),(await a.vg.post("".concat(n,"/client/").concat(e,"/funders/import/analyze"),s,{headers:{"x-user-id":r,"Content-Type":"multipart/form-data"},timeout:3e4})).data}catch(e){throw console.error("Error analyzing import file:",e),e}},bulkImportFundersCSV:async(e,r,t,s,i,l,o,d,c)=>{try{if(!e||!r)throw Error("Organization ID and User ID are required");let u=new FormData;return u.append("file",t),s&&u.append("relationship_status",s),i&&u.append("program_id",i),"number"==typeof l&&u.append("name_column_index",String(l)),"number"==typeof o&&u.append("url_column_index",String(o)),"number"==typeof d&&u.append("ein_column_index",String(d)),"number"==typeof c&&u.append("header_row_index",String(c)),(await a.vg.post("".concat(n,"/client/").concat(e,"/funders/import-file"),u,{headers:{"x-user-id":r,"Content-Type":"multipart/form-data"},timeout:12e4})).data}catch(e){throw console.error("Error bulk importing funders:",e),e}},removeFunder:async(e,r,t,s)=>{try{if(!e||!r||!t)throw Error("Organization ID, User ID, and Funder ID are required");let i=s?"".concat(n,"/client/").concat(e,"/funders/").concat(t,"?program_id=").concat(encodeURIComponent(s)):"".concat(n,"/client/").concat(e,"/funders/").concat(t);return(await a.vg.delete(i,{headers:{"x-user-id":r}})).data}catch(e){throw console.error("Error removing funder:",e),e}}}},31776:(e,r,t)=>{t.d(r,{mU:()=>f,oA:()=>p,KY:()=>v,Zu:()=>y,al:()=>h,c:()=>g});var a=t(26708),n=t(35625),s=t(48934),i=t(68001),l=t(17610);let o="".concat("https://api.kindora.co".replace(/\/$/,""),"/api");async function d(){var e;let r=await (0,l.createClient)(),{data:t}=await r.auth.getUser(),a=null==(e=t.user)?void 0:e.id;if(!a)throw Error("User not authenticated");return{"x-user-id":a}}function c(e){return e.replace(/^(usf|nf|n9f|non990|non_990|unresearched|gov|fed):/i,"")}let u={setRelationship:async(e,r,t)=>{let a=await d();return!!(await i.vg.post("".concat(o,"/client/").concat(e,"/funders/").concat(encodeURIComponent(c(r)),"/relationship"),{relationship_status:t},{headers:a})).data},getRelationshipKeys:async e=>{var r;let t=await d(),a=null!=(r=(await i.vg.get("".concat(o,"/client/").concat(e,"/funders/relationship-keys"),{headers:t})).data)?r:{};return{existing:Array.isArray(a.existing)?a.existing:[],past:Array.isArray(a.past)?a.past:[]}},listDetected:async e=>{let r=await i.vg.get("".concat(o,"/organizations/").concat(e,"/current-funders/detected"));return Array.isArray(r.data)?r.data:[]},decideDetected:async(e,r,t)=>(await i.vg.post("".concat(o,"/organizations/").concat(e,"/current-funders/detected/").concat(r,"/").concat(t))).data},m={keys:e=>["funder-relationship-keys",e],detected:e=>["funder-relationship-detected",e]},x=["funders","unidentifiedFunders","funderDetails","hiddenFunders","current-funders","funder"];function h(e){return(0,a.I)({queryKey:m.keys(e||""),queryFn:()=>u.getRelationshipKeys(e),enabled:!!e,staleTime:6e4,refetchOnWindowFocus:!1})}function p(e,r){if(!e||!r)return null;let t=c(r).replace(/-/g,"");return e.existing.some(e=>e.replace(/-/g,"")===t)?"existing":e.past.some(e=>e.replace(/-/g,"")===t)?"past":null}function f(e,r){for(let t of(e.invalidateQueries({queryKey:m.keys(r)}),e.invalidateQueries({queryKey:m.detected(r)}),e.invalidateQueries({queryKey:["open-questions",r]}),x))e.invalidateQueries({queryKey:[t]})}function g(e){let r=(0,n.jE)();return(0,s.n)({mutationFn:r=>{let{funderId:t,relationshipStatus:a}=r;return u.setRelationship(e,t,a)},onSuccess:()=>{e&&f(r,e)}})}function y(e){return(0,a.I)({queryKey:m.detected(e||""),queryFn:()=>u.listDetected(e),enabled:!!e,staleTime:3e4,refetchOnWindowFocus:!1})}function v(e){let r=(0,n.jE)();return(0,s.n)({mutationFn:r=>{let{evaluationId:t,decision:a}=r;return u.decideDetected(e,t,a)},onSuccess:()=>{e&&f(r,e)}})}},39611:(e,r,t)=>{t.d(r,{Rh:()=>a,gq:()=>n,sK:()=>s});let a=(e,r)=>
1{e.invalidateQueries({queryKey:["applications",r]})},n=(e,r)=>{e.invalidateQueries({queryKey:["credits",r]})},s=(e,r)=>{e.invalidateQueries({queryKey:["application",r]})}},46677:(e,r,t)=>{t.d(r,{x:()=>_});var a=t(95155),n=t(12115),s=t(50910),i=t(84440),l=t(29202),o=t(87616),d=t(34657),c=t(38921),u=t(67501),m=t(62143),x=t(50049),h=t(51914),p=t(86901),f=t(8195),g=t(5872),y=t(6296),v=t(12651),j=t(13545),w=t(24538),b=t(56018),N=t(49387),F=t(68459),k=t(40980),C=t(77967);function _(e){var r;let{funders:t,isLoading:_,onAddFunders:D,onEditFunder:A,onDeleteFunder:E,onSubmitToDatabase:S,onFindSimilar:I,isSubmittingToDatabase:z=!1,className:q}=e,L=(0,s.c)("currentFundersList"),T=(0,s.c)("currentFunders.funderTypeLabels"),{canSpend:M,isConsultantPoolOrg:R}=(0,i.d)(),[O,P]=(0,n.useState)(null),[K,B]=(0,n.useState)(null),Q=t.filter(e=>e.user_confirmed),$=t.filter(e=>!e.user_confirmed);if(_)return(0,a.jsxs)(l.Zp,{className:q,children:[(0,a.jsx)(l.aR,{children:(0,a.jsxs)(l.ZB,{className:"flex items-center gap-2",children:[(0,a.jsx)(x.A,{className:"h-5 w-5"}),L("header.title")]})}),(0,a.jsx)(l.Wu,{className:"space-y-3",children:[1,2,3].map(e=>(0,a.jsx)(c.EA,{className:"h-16 w-full"},e))})]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l.Zp,{className:q,"data-sentry-element":"Card","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsxs)(l.aR,{className:"pb-3","data-sentry-element":"CardHeader","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)(l.ZB,{className:"flex items-center gap-2 text-lg","data-sentry-element":"CardTitle","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsx)(x.A,{className:"h-5 w-5 text-kindora-primary-600","data-sentry-element":"Building2","data-sentry-source-file":"CurrentFundersList.tsx"}),L("header.title"),t.length>0&&(0,a.jsx)(d.E,{variant:"secondary",className:"ml-2",children:t.length})]}),(0,a.jsxs)(o.$,{variant:"outline",size:"sm",onClick:D,"data-sentry-element":"Button","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsx)(h.A,{className:"h-4 w-4 mr-1","data-sentry-element":"Plus","data-sentry-source-file":"CurrentFundersList.tsx"}),L("header.addFunders")]})]}),Q.length>0&&(0,a.jsx)("p",{className:"text-sm text-kindora-gray-600 mt-1",children:L("header.confirmedSummary",{count:Q.length})})]}),(0,a.jsx)(l.Wu,{className:"space-y-3","data-sentry-element":"CardContent","data-sentry-source-file":"CurrentFundersList.tsx",children:0===t.length?(0,a.jsx)(function(e){let{onAddFunders:r}=e;return(0,a.jsxs)("div",{className:"text-center py-8","data-sentry-component":"EmptyState","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsx)(x.A,{className:"h-12 w-12 text-kindora-gray-300 mx-auto mb-4","data-sentry-element":"Building2","data-sentry-source-file":"CurrentFundersList.tsx"}),(0,a.jsx)("h3",{className:"font-medium text-kindora-gray-900 mb-2",children:L("empty.title")}),(0,a.jsx)("p",{className:"text-sm text-kindora-gray-600 mb-4 max-w-sm mx-auto",children:L("empty.body")}),(0,a.jsxs)(o.$,{onClick:r,"data-sentry-element":"Button","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsx)(h.A,{className:"h-4 w-4 mr-2","data-sentry-element":"Plus","data-sentry-source-file":"CurrentFundersList.tsx"}),L("empty.button")]})]})},{onAddFunders:D}):(0,a.jsxs)(a.Fragment,{children:[Q.length>0&&(0,a.jsx)("div",{className:"space-y-2",children:Q.map(e=>(0,a.jsx)(U,{funder:e,onEdit:()=>A(e),onDelete:()=>P(e.id),onSubmitToDatabase:()=>B(e)},e.id))}),$.length>0&&(0,a.jsxs)(a.Fragment,{children:[Q.length>0&&(0,a.jsx)("div",{className:"py-2",children:(0,a.jsx)("p",{className:"text-xs text-kindora-gray-500 font-medium uppercase tracking-wider",children:L("sections.unconfirmed")})}),(0,a.jsx)("div",{className:"space-y-2",children:$.map(e=>(0,a.jsx)(U,{funder:e,onEdit:()=>A(e),onDelete:()=>P(e.id),onSubmitToDatabase:()=>B(e)},e.id))})]}),Q.length>=1&&(0,a.jsxs)("div",{className:"pt-4 border-t border-kindora-gray-100",children:[(0,a.jsxs)(o.$,{onClick:I,className:"w-full",size:"lg",children:[(0,a.jsx)(p.A,{className:"h-4 w-4 mr-2"}),L("findSimilar.button")]}),(0,a.jsx)("p",{className:"text-xs text-kindora-gray-500 text-center mt-2",children:L("findSimilar.helper")})]})]})})]}),(0,a.jsx)(m.Lt,{open:null!==O,onOpenChange:e=>!e&&P(null),"data-sentry-element":"AlertDialog","data-sentry-source-file":"CurrentFundersList.tsx",children:(0,a.jsxs)(m.EO,{"data-sentry-element":"AlertDialogContent","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsxs)(m.wd,{"data-sentry-element":"AlertDialogHeader","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsx)(m.r7,{"data-sentry-element":"AlertDialogTitle","data-sentry-source-file":"CurrentFundersList.tsx",children:L("removeDialog.title")}),(0,a.jsx)(m.$v,{"data-sentry-element":"AlertDialogDescription","data-sentry-source-file":"CurrentFundersList.tsx",children:L("removeDialog.description")})]}),(0,a.jsxs)(m.ck,{"data-sentry-element":"AlertDialogFooter","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsx)(m.Zr,{"data-sentry-element":"AlertDialogCancel","data-sentry-source-file":"CurrentFundersList.tsx",children:L("removeDialog.cancel")}),(0,a.jsx)(m.Rx,{onClick:()=>{O&&(E(O),P(null))},className:"bg-red-600 hover:bg-red-700","data-sentry-element":"AlertDialogAction","data-sentry-source-file":"CurrentFundersList.tsx",children:L("removeDialog.confirm")})]})]})}),(0,a.jsx)(m.Lt,{open:null!==K,onOpenChange:e=>!e&&B(null),"data-sentry-element":"AlertDialog","data-sentry-source-file":"CurrentFundersList.tsx",children:(0,a.jsxs)(m.EO,{"data-sentry-element":"AlertDialogContent","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsxs)(m.wd,{"data-sentry-element":"AlertDialogHeader","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsxs)(m.r7,{className:"flex items-center gap-2","data-sentry-element":"AlertDialogTitle","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsx)(f.A,{className:"h-5 w-5 text-kindora-teal","data-sentry-element":"DatabaseIcon","data-sentry-source-file":"CurrentFundersList.tsx"}),L("submitDialog.title")]}),(0,a.jsx)(m.$v,{asChild:!0,"data-sentry-element":"AlertDialogDescription","data-sentry-source-file":"CurrentFundersList.tsx",children:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("p",{children:L.rich("submitDialog.introTemplate",{name:null!=(r=null==K?void 0:K.input_name)?r:"",bold:e=>(0,a.jsx)("span",{className:"font-medium text-kindora-gray-800",children:e})})}),(0,a.jsxs)("div",{className:"bg-kindora-gray-50 rounded-lg p-3 space-y-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-kindora-gray-800",children:L("submitDialog.whatHappensNext")}),(0,a.jsxs)("ul",{className:"text-sm text-kindora-gray-600 space-y-1 list-disc list-inside",children:[(0,a.jsx)("li",{children:L("submitDialog.steps.createRecord")}),(0,a.jsx)("li",{children:L("submitDialog.steps.enrichProfile")}),(0,a.jsx)("li",{children:L("submitDialog.steps.matchAvailable")})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm bg-amber-50 border border-amber-200 rounded-lg p-3",children:[(0,a.jsx)(g.A,{className:"h-4 w-4 text-amber-600 flex-shrink-0","data-sentry-element":"Coins","data-sentry-source-file":"CurrentFundersList.tsx"}),(0,a.jsxs)("span",{className:"text-amber-800",children:[(0,a.jsx)("span",{className:"font-medium",children:L("submitDialog.costLabel")}),L("submitDialog.costDescription")]})]})]})})]}),R&&!M&&(0,a.jsx)("p",{className:"text-sm text-amber-600",children:L("submitDialog.noSpendAuthority")}),(0,a.jsxs)(m.ck,{"data-sentry-element":"AlertDialogFooter","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsx)(m.Zr,{disabled:z,"data-sentry-element":"AlertDialogCancel","data-sentry-source-file":"CurrentFundersList.tsx",children:L("submitDialog.cancel")}),(0,a.jsx)(m.Rx,{onClick:()=>{K&&(S(K),B(null))},disabled:z||!M,className:"bg-kindora-teal hover:bg-kindora-teal-dark","data-sentry-element":"AlertDialogAction","data-sentry-source-file":"CurrentFundersList.tsx",children:z?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.A,{className:"h-4 w-4 mr-2 animate-spin"}),L("submitDialog.adding")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.A,{className:"h-4 w-4 mr-2"}),L("submitDialog.confirm")]})})]})]})})]});function U(e){var r,t;let{funder:n,onEdit:s,onDelete:i,onSubmitToDatabase:l}=e,c=null!==n.matched_funder_id,m="us_foundation"===(t=n.matched_funder_type)||"non_990"===t?t:null,h=m?T(m):null!=(r=n.matched_funder_type)?r:"";return(0,a.jsxs)("div",{className:(0,k.cn)("flex items-center justify-between gap-3 p-3 rounded-lg border transition-colors",n.user_confirmed?"border-green-200 bg-green-50/30":"border-kindora-gray-200 bg-kindora-gray-50/30"),"data-sentry-component":"FunderRow","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n.user_confirmed?(0,a.jsx)(v.A,{className:"h-4 w-4 text-green-600 flex-shrink-0"}):(0,a.jsx)(j.A,{className:"h-4 w-4 text-amber-500 flex-shrink-0"}),(0,a.jsx)("span",{className:"font-medium text-kindora-gray-900 truncate",children:n.matched_funder_name||n.input_name}),n.user_corrected&&(0,a.jsx)(d.E,{variant:"outline",className:"text-xs",children:L("row.correctedBadge")})]}),(0,a.jsx)("div",{className:"flex items-center gap-3 text-xs text-kindora-gray-500 mt-1 ml-6",children:c?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(x.A,{className:"h-3 w-3"}),h]}),(n.city||n.state)&&(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(w.A,{className:"h-3 w-3"}
1),[n.city,n.state].filter(Boolean).join(", ")]}),null!=n.match_confidence&&(0,a.jsx)("span",{children:L("row.confidenceTemplate",{confidence:(0,C.Me)(n.match_confidence)})})]}):(0,a.jsx)("span",{className:"text-amber-600",children:L("row.noDatabaseMatch")})}),n.input_name!==n.matched_funder_name&&c&&(0,a.jsx)("p",{className:"text-xs text-kindora-gray-400 mt-1 ml-6 italic",children:L("row.originallyEnteredAsTemplate",{name:n.input_name})})]}),(0,a.jsxs)(u.rI,{"data-sentry-element":"DropdownMenu","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsx)(u.ty,{asChild:!0,"data-sentry-element":"DropdownMenuTrigger","data-sentry-source-file":"CurrentFundersList.tsx",children:(0,a.jsx)(o.$,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","data-sentry-element":"Button","data-sentry-source-file":"CurrentFundersList.tsx",children:(0,a.jsx)(b.A,{className:"h-4 w-4","data-sentry-element":"MoreVertical","data-sentry-source-file":"CurrentFundersList.tsx"})})}),(0,a.jsxs)(u.SQ,{align:"end","data-sentry-element":"DropdownMenuContent","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsxs)(u._2,{onClick:s,"data-sentry-element":"DropdownMenuItem","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 mr-2","data-sentry-element":"Pencil","data-sentry-source-file":"CurrentFundersList.tsx"}),L("row.menu.editMatch")]}),!c&&(0,a.jsxs)(u._2,{onClick:l,children:[(0,a.jsx)(f.A,{className:"h-4 w-4 mr-2"}),L("row.menu.addToDatabase")]}),(0,a.jsxs)(u._2,{onClick:i,className:"text-red-600 focus:text-red-600","data-sentry-element":"DropdownMenuItem","data-sentry-source-file":"CurrentFundersList.tsx",children:[(0,a.jsx)(F.A,{className:"h-4 w-4 mr-2","data-sentry-element":"Trash2","data-sentry-source-file":"CurrentFundersList.tsx"}),L("row.menu.remove")]})]})]})]})}}},69176:(e,r,t)=>{t.d(r,{gm:()=>x,mG:()=>v,sC:()=>p,yh:()=>b,t9:()=>f,fq:()=>g,Ei:()=>w,ZE:()=>h,AR:()=>j,gO:()=>y});var a=t(12115),n=t(26708),s=t(48934),i=t(35625),l=t(68001);let o="".concat("https://api.kindora.co".replace(/\/$/,""),"/api"),d={extractFundersFromDocument:async(e,r,t,a)=>{try{if(!e)throw Error("Organization ID is required");return(await l.vg.post("".concat(o,"/organizations/").concat(e,"/current-funders/extract"),{file_content:r,file_name:t,file_type:a},{timeout:12e4})).data}catch(e){throw console.error("Error extracting funders from document:",e),e}},matchFunderNames:async(e,r)=>{try{if(!e)throw Error("Organization ID is required");if(!r||0===r.length)throw Error("At least one funder name is required");let t=function(e){let r=new Set,t=[];for(let a of e){let e=a.trim();if(!e)continue;let n=e.toLowerCase();r.has(n)||(r.add(n),t.push(e))}return t}(r);if(0===t.length)throw Error("At least one funder name is required");let a=[];for(let r of function(e,r){let t=[];for(let r=0;r<e.length;r+=100)t.push(e.slice(r,r+100));return t}(t,100)){let t=await l.vg.post("".concat(o,"/organizations/").concat(e,"/current-funders/match"),{names:r},{timeout:12e4});a.push(...t.data)}return a}catch(e){throw console.error("Error matching funder names:",e),e}},saveCurrentFunders:async(e,r)=>{try{if(!e)throw Error("Organization ID is required");if(!r||0===r.length)throw Error("At least one funder is required");if(r.length>500)throw Error("A maximum of 500 current funders can be saved at once");return(await l.vg.post("".concat(o,"/organizations/").concat(e,"/current-funders"),{funders:r})).data}catch(e){throw console.error("Error saving current funders:",e),e}},getCurrentFunders:async function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{if(!e)throw Error("Organization ID is required");return(await l.vg.get("".concat(o,"/organizations/").concat(e,"/current-funders"),{params:{confirmed_only:r}})).data}catch(e){throw console.error("Error getting current funders:",e),e}},updateCurrentFunder:async(e,r,t)=>{try{if(!e||!r)throw Error("Organization ID and Funder ID are required");return(await l.vg.patch("".concat(o,"/organizations/").concat(e,"/current-funders/").concat(r),t)).data}catch(e){throw console.error("Error updating current funder:",e),e}},deleteCurrentFunder:async(e,r)=>{try{if(!e||!r)throw Error("Organization ID and Funder ID are required");return(await l.vg.delete("".concat(o,"/organizations/").concat(e,"/current-funders/").concat(r))).data}catch(e){throw console.error("Error deleting current funder:",e),e}},getSimilaritySearchStatus:async e=>{try{if(!e)throw Error("Organization ID is required");return(await l.vg.get("".concat(o,"/organizations/").concat(e,"/current-funders/similarity-status"))).data}catch(e){throw console.error("Error getting similarity search status:",e),e}},getSimilarProspects:async function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{var t,a,n,s,i;if(!e)throw Error("Organization ID is required");return(await l.vg.post("".concat(o,"/organizations/").concat(e,"/current-funders/similar-prospects"),{source_funder_ids:null!=(t=r.source_funder_ids)?t:void 0,program_id:null!=(a=r.program_id)?a:void 0,exclude_pipeline_funders:null==(n=r.exclude_pipeline_funders)||n,limit:null!=(s=r.limit)?s:20,min_confidence:null!=(i=r.min_confidence)?i:.3})).data}catch(e){throw console.error("Error getting similar prospects:",e),e}},submitFunderToDatabase:async(e,r,t)=>{try{var a;if(!e||!r)throw Error("Organization ID and Funder ID are required");if(!(null==(a=t.funder_name)?void 0:a.trim()))throw Error("Funder name is required");return(await l.vg.post("".concat(o,"/organizations/").concat(e,"/current-funders/").concat(r,"/submit-to-database"),t)).data}catch(e){throw console.error("Error submitting funder to database:",e),e}},fileToBase64:async e=>new Promise((r,t)=>{let a=new FileReader;a.readAsDataURL(e),a.onload=()=>{r(a.result.split(",")[1])},a.onerror=e=>t(e)}),getFileType:e=>{let r=e.type,t=e.name.toLowerCase();return"application/pdf"===r||t.endsWith(".pdf")?"pdf":"application/vnd.openxmlformats-officedocument.wordprocessingml.document"===r||t.endsWith(".docx")?"docx":"text/plain"===r||t.endsWith(".txt")?"txt":null}};var c=t(31776),u=t(39611);let m={all:["current-funders"],list:(e,r)=>[...m.all,"list",e,r],similarProspects:e=>[...m.all,"similar-prospects",e],similarityStatus:e=>[...m.all,"similarity-status",e]};function x(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,n.I)({queryKey:m.list(e||"",r),queryFn:async()=>e?d.getCurrentFunders(e,r):[],enabled:!!e,staleTime:3e4,refetchOnWindowFocus:!1})}function h(e){return(0,n.I)({queryKey:m.similarityStatus(e||""),queryFn:async()=>e?d.getSimilaritySearchStatus(e):null,enabled:!!e,staleTime:3e4,refetchOnWindowFocus:!1})}function p(e){let[r,t]=(0,a.useState)({status:"idle"}),n=(0,s.n)({mutationFn:async r=>{if(!e)throw Error("Organization ID is required");let a=d.getFileType(r);if(!a)throw Error("Unsupported file type. Please upload PDF, DOCX, or TXT files.");t({status:"uploading",message:"Uploading document..."});let n=await d.fileToBase64(r);t({status:"extracting",message:"Extracting funder names..."});let s=await d.extractFundersFromDocument(e,n,r.name,a);return t({status:"matching",message:"Matching to database..."}),await new Promise(e=>setTimeout(e,500)),t({status:"done",message:"Found ".concat(s.funders.length," funders")}),s},onError:e=>{t({status:"error",message:e.message||"Failed to extract funders"})}}),i=(0,a.useCallback)(()=>{t({status:"idle"}),n.reset()},[n]);return{...n,extractionProgress:r,reset:i,extractFunders:n.mutate,extractFundersAsync:n.mutateAsync}}function f(e){return(0,s.n)({mutationFn:async r=>{if(!e)throw Error("Organization ID is required");return d.matchFunderNames(e,r)}})}function g(e){let r=(0,i.jE)();return(0,s.n)({mutationFn:async r=>{if(!e)throw Error("Organization ID is required");return d.saveCurrentFunders(e,r)},onSuccess:()=>
1{e&&(r.invalidateQueries({queryKey:m.all}),(0,c.mU)(r,e))}})}function y(e){let r=(0,i.jE)();return(0,s.n)({mutationFn:async r=>{let{funderId:t,update:a}=r;if(!e)throw Error("Organization ID is required");return d.updateCurrentFunder(e,t,a)},onSuccess:()=>{e&&(r.invalidateQueries({queryKey:m.all}),(0,c.mU)(r,e),(0,u.gq)(r,e))}})}function v(e){let r=(0,i.jE)();return(0,s.n)({mutationFn:async r=>{if(!e)throw Error("Organization ID is required");return d.deleteCurrentFunder(e,r)},onSuccess:()=>{e&&(r.invalidateQueries({queryKey:m.all}),(0,c.mU)(r,e))}})}function j(e){let r=(0,i.jE)();return(0,s.n)({mutationFn:async r=>{let{funderId:t,request:a}=r;if(!e)throw Error("Organization ID is required");return d.submitFunderToDatabase(e,t,a)},onSuccess:()=>{e&&(r.invalidateQueries({queryKey:m.all}),(0,c.mU)(r,e))}})}function w(e){let r=(0,i.jE)();return(0,s.n)({mutationFn:async function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e)throw Error("Organization ID is required");return d.getSimilarProspects(e,r)},onSuccess:t=>{e&&r.invalidateQueries({queryKey:m.similarityStatus(e)}),t.imported_count&&t.imported_count>
10&&(r.invalidateQueries({queryKey:["unidentifiedFunders",e]}),r.invalidateQueries({queryKey:["funderCounts",e]}),r.invalidateQueries({queryKey:["funders","relationship-status",e]}),r.invalidateQueries({queryKey:["dashboardState",e]}))}})}function b(e){var r,t;let{data:a,isLoading:n}=x(e,!0);return{hasConfirmedFunders:(null!=(r=null==a?void 0:a.length)?r:0)>0,confirmedCount:null!=(t=null==a?void 0:a.length)?t:0,isLoading:n}}},77967:(e,r,t)=>{function a(e){return e>=.85?"success":e>=.7?"warning":"secondary"}function n(e){return"".concat(Math.round(100*e),"%")}t.d(r,{Me:()=>n,ht:()=>a})},82240:(e,r,t)=>{t.d(r,{I:()=>A});var a=t(95155),n=t(12115),s=t(50910),i=t(84144),l=t(87616),o=t(1412),d=t(41058),c=t(47397),u=t(85778),m=t(48458),x=t(86901),h=t(13545),p=t(37618),f=t(47339),g=t(21975),y=t(6296),v=t(33210),j=t(48368),w=t(12651),b=t(40980),N=t(86989),F=t(66609),k=t(14908),C=t(69176),_=t(90596),D=t(26153);function A(e){let{open:r,onOpenChange:t,organizationId:A,onComplete:S}=e,I=(0,s.c)("currentFundersModal"),z=(0,s.k)(),{currentUser:q}=(0,D.Jd)(),L=(0,C.t9)(A),T=(0,C.sC)(A),M=(0,C.fq)(A),R=(0,_.X)(),O=L.isPending,P=T.isPending,K=M.isPending,B=R.isPending,Q=T.extractionProgress,[$,U]=(0,n.useState)("input"),[W,Z]=(0,n.useState)("manual"),[H,V]=(0,n.useState)(""),[X,J]=(0,n.use
1State)(null),[G,Y]=(0,n.useState)([]),[ee,er]=(0,n.useState)({}),[et,ea]=(0,n.useState)(0),[en,es]=(0,n.useState)(null),[ei,el]=(0,n.useState)(null),[eo,ed]=(0,n.useState)(null),[ec,eu]=(0,n.useState)(null),em=(0,n.useCallback)(e=>{e||(U("input"),V(""),J(null),Y([]),er({}),ea(0),es(null),el(null),ed(null),eu(null),T.reset(),R.reset()),t(e)},[T,R,t]),ex=(0,N.VB)({accept:{"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"text/plain":[".txt"]},maxFiles:1,maxSize:0xa00000,onDrop:e=>{e.length>0&&(J(e[0]),es(null))},onDropRejected:e=>{var r,t;let a=e[0];(null==(r=a.errors[0])?void 0:r.code)==="file-too-large"?es(I("errors.fileTooLarge10MB")):(null==(t=a.errors[0])?void 0:t.code)==="file-invalid-type"?es(I("errors.invalidFileTypeDocument")):es(I("errors.uploadFailed"))}}),eh=(0,N.VB)({accept:{"text/csv":[".csv"],"application/csv":[".csv"],"text/plain":[".csv"],"application/vnd.ms-excel":[".csv",".xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx"]},maxFiles:1,maxSize:5242880,onDrop:async e=>{if(e.length>0){let r=e[0];if(el(r),ed(null),eu(null),es(null),!(null==q?void 0:q.id))return void es(I("errors.userSessionMissing"));try{let e=await R.mutateAsync({organizationId:A,userId:q.id,file:r});ed(e);let t=e.column_mappings.find(e=>"funder_name"===e.canonical_field);t&&eu(t.column_index)}catch(e){es(e instanceof Error?e.message:I("errors.analyzeFailed"))}}},onDropRejected:e=>{var r,t;let a=e[0];(null==(r=a.errors[0])?void 0:r.code)==="file-too-large"?es(I("errors.fileTooLarge5MB")):(null==(t=a.errors[0])?void 0:t.code)==="file-invalid-type"?es(I("errors.invalidFileTypeSpreadsheet")):es(I("errors.uploadFailed"))}}),ep=(0,n.useCallback)(e=>e.split(/[\n,;]+/).map(e=>e.trim()).filter(e=>e.length>0),[]),ef=(0,n.useMemo)(()=>ep(H),[H,ep]),eg=(0,n.useCallback)(e=>e.map((e,r)=>({...e,_key:"".concat(r,"-").concat(e.input_name)})),[]),ey=(0,n.useCallback)(e=>{Y(e);let r={};e.forEach(e=>{var t;r[e._key]=(null==(t=e.best_match)?void 0:t.funder_id)||null}),er(r),U("review")},[]),ev=async()=>{if(0===ef.length)return void es(I("errors.manualEmpty"));if(ef.length>100)return void es(I("errors.manualMax100"));try{es(null);let e=await L.mutateAsync(ef);ey(eg(e))}catch(e){es(e instanceof Error?e.message:I("errors.matchFailed"))}},ej=async()=>{if(!X)return void es(I("errors.documentEmpty"));try{es(null);let e=await T.mutateAsync(X);ea(e.extraction_cost),ey(eg(e.funders))}catch(e){es(e instanceof Error?e.message:I("errors.extractFailed"))}},ew=async()=>{var e,r;if(!eo||null===ec)return void es(I("errors.columnRequired"));let t=null!=(e=eo.data_rows)?e:[];0===t.length&&(t=null!=(r=null==ei?void 0:ei.name.toLowerCase().endsWith(".csv"))&&r&&ei?await E(ei,eo.header_row_index):eo.preview_rows);let a=[...new Set(t.map(e=>{var r,t;return null!=(t=null==(r=e[ec])?void 0:r.trim())?t:""}).filter(e=>e.length>0))].filter(e=>e.length>0);if(0===a.length)return void es(I("errors.noNamesInColumn"));if(a.length>500)return void es(I("errors.spreadsheetMax500"));try{es(null);let e=await L.mutateAsync(a);ey(eg(e))}catch(e){es(e instanceof Error?e.message:I("errors.matchFailed"))}},eb=(0,n.useCallback)((e,r)=>{er(t=>({...t,[e]:r}))},[]),eN=async()=>{try{es(null);let e="manual"===W?"manual":"spreadsheet"===W?"csv_import":"document_upload",r="document"===W?null==X?void 0:X.name:"spreadsheet"===W?null==ei?void 0:ei.name:void 0,t=G.map(t=>{let a=ee[t._key],n=a?t.candidates.find(e=>e.funder_id===a):null;return{input_name:t.input_name,input_source:e,source_document_name:r,selected_funder_id:a||void 0,match_confidence:null==n?void 0:n.match_confidence,match_method:null==n?void 0:n.match_method}}),a=await M.mutateAsync(t);U("complete"),F.o.success(I("toasts.savedTemplate",{count:t.length}));let n=a.filter(e=>!1===e.relationship_applied).length;n>0&&F.o.warning(I("toasts.relationshipNotApplied",{count:n})),S&&S(),setTimeout(()=>{em(!1)},1500)}catch(e){es(e instanceof Error?e.message:I("errors.saveFailed"))}},eF=Object.values(ee).filter(e=>null!=e).length,ek=O||P||K||B,eC="manual"===W?ef.length>0&&ef.length<=100:"spreadsheet"===W?null!==eo&&null!==ec:null!==X;return(0,a.jsx)(i.lG,{open:r,onOpenChange:em,"data-sentry-element":"Dialog","data-sentry-component":"CurrentFundersModal","data-sentry-source-file":"CurrentFundersModal.tsx",children:(0,a.jsxs)(i.Cf,{className:"max-w-2xl max-h-[90vh] flex flex-col overflow-hidden","data-sentry-element":"DialogContent","data-sentry-source-file":"CurrentFundersModal.tsx",children:[(0,a.jsxs)(i.c7,{"data-sentry-element":"DialogHeader","data-sentry-source-file":"CurrentFundersModal.tsx",children:[(0,a.jsxs)(i.L3,{className:"flex items-center gap-2","data-sentry-element":"DialogTitle","data-sentry-source-file":"CurrentFundersModal.tsx",children:[(0,a.jsx)(x.A,{className:"h-5 w-5 text-kindora-primary-600","data-sentry-element":"Sparkles","data-sentry-source-file":"CurrentFundersModal.tsx"}),"input"===$&&I("header.titleInput"),"review"===$&&I("header.titleReview"),"complete"===$&&I("header.titleComplete")]}),(0,a.jsxs)(i.rr,{"data-sentry-element":"DialogDescription","data-sentry-source-file":"CurrentFundersModal.tsx",children:["input"===$&&I("header.descriptionInput"),"review"===$&&I("header.descriptionReviewTemplate",{count:G.length}),"complete"===$&&I("header.descriptionComplete")]})]}),en&&(0,a.jsxs)(u.Fc,{variant:"destructive",className:"mx-6",children:[(0,a.jsx)(h.A,{className:"h-4 w-4"}),(0,a.jsx)(u.TN,{children:en})]}),"input"===$&&(0,a.jsx)("div",{className:"flex-1 overflow-hidden flex flex-col px-6",children:(0,a.jsxs)(o.tU,{value:W,onValueChange:e=>Z(e),className:"flex-1 flex flex-col",children:[(0,a.jsxs)(o.j7,{className:"grid w-full grid-cols-3",children:[(0,a.jsxs)(o.Xi,{value:"manual",className:"gap-2",children:[(0,a.jsx)(p.A,{className:"h-4 w-4"}),I("tabs.manual")]}),(0,a.jsxs)(o.Xi,{value:"spreadsheet",className:"gap-2",children:[(0,a.jsx)(f.A,{className:"h-4 w-4"}),I("tabs.spreadsheet")]}),(0,a.jsxs)(o.Xi,{value:"document",className:"gap-2",children:[(0,a.jsx)(g.A,{className:"h-4 w-4"}
1),I("tabs.document")]})]}),(0,a.jsxs)(o.av,{value:"manual",className:"flex-1 flex flex-col mt-4",children:[(0,a.jsx)(m.J,{htmlFor:"funder-names",className:"text-sm font-medium mb-2",children:I("manual.label")}),(0,a.jsx)(d.T,{id:"funder-names",placeholder:I("manual.placeholder"),value:H,onChange:e=>V(e.target.value),className:"flex-1 min-h-[200px] resize-none font-mono text-sm"}),(0,a.jsxs)("p",{className:"text-xs text-kindora-gray-500 mt-2",children:[I("manual.enteredCount",{count:ef.length}),ef.length>100&&(0,a.jsx)("span",{className:"text-red-500 ml-1",children:I("manual.maxNote")})]})]}),(0,a.jsx)(o.av,{value:"spreadsheet",className:"flex-1 flex flex-col mt-4 overflow-hidden",children:eo?(0,a.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(f.A,{className:"h-4 w-4 text-green-600"}),(0,a.jsx)("span",{className:"text-sm font-medium",children:null==ei?void 0:ei.name}),(0,a.jsx)("span",{className:"text-xs text-kindora-gray-500",children:I("spreadsheet.rowsCount",{count:eo.total_rows})}),eo.ai_detected&&(0,a.jsx)("span",{className:"text-xs bg-kindora-primary-100 text-kindora-primary-700 px-1.5 py-0.5 rounded",children:I("spreadsheet.aiMappedBadge")})]}),(0,a.jsxs)(l.$,{variant:"ghost",size:"sm",onClick:()=>{el(null),ed(null),eu(null)},children:[(0,a.jsx)(v.A,{className:"h-3.5 w-3.5 mr-1"}),I("spreadsheet.removeButton")]})]}),(0,a.jsx)(m.J,{className:"text-sm font-medium mb-2",children:I("spreadsheet.selectColumnLabel")}),(0,a.jsx)("div",{className:"flex gap-2 flex-wrap mb-3",children:eo.headers.map((e,r)=>(0,a.jsx)("button",{onClick:()=>eu(r),className:(0,b.cn)("px-3 py-1.5 text-sm rounded-md border transition-colors",ec===r?"border-kindora-primary-500 bg-kindora-primary-50 text-kindora-primary-700 font-medium":"border-kindora-gray-200 hover:border-kindora-gray-400 text-kindora-gray-700"),children:e||I("spreadsheet.columnPlaceholderTemplate",{index:r+1})},r))}),(0,a.jsx)("div",{className:"flex-1 overflow-auto rounded border border-kindora-gray-200",children:(0,a.jsxs)("table",{className:"w-full text-xs",children:[(0,a.jsx)("thead",{className:"bg-kindora-gray-50 sticky top-0",children:(0,a.jsx)("tr",{children:eo.headers.map((e,r)=>(0,a.jsx)("th",{className:(0,b.cn)("px-3 py-2 text-left font-medium whitespace-nowrap",ec===r?"bg-kindora-primary-50 text-kindora-primary-700":"text-kindora-gray-600"),children:e||I("spreadsheet.columnHeaderShortTemplate",{index:r+1})},r))})}),(0,a.jsx)("tbody",{children:eo.preview_rows.slice(0,5).map((e,r)=>(0,a.jsx)("tr",{className:"border-t border-kindora-gray-100",children:e.map((e,r)=>(0,a.jsx)("td",{className:(0,b.cn)("px-3 py-1.5 whitespace-nowrap max-w-[200px] truncate",ec===r?"bg-kindora-primary-50/50 font-medium":"text-kindora-gray-700"),children:e},r))},r))})]})}),eo.total_rows>5&&(0,a.jsx)("p",{className:"text-xs text-kindora-gray-500 mt-1",children:I("spreadsheet.showingPreviewTemplate",{total:eo.total_rows})})]}):(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{...eh.getRootProps(),className:(0,b.cn)("flex-1 min-h-[180px] border-2 border-dashed rounded-lg flex flex-col items-center justify-center cursor-pointer transition-colors",eh.isDragActive?"border-kindora-primary-500 bg-kindora-primary-50":ei?"border-green-500 bg-green-50":"border-kindora-gray-300 hover:border-kindora-gray-400"),children:[(0,a.jsx)("input",{...eh.getInputProps()}),B?(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(y.A,{className:"h-10 w-10 animate-spin text-kindora-primary-600 mx-auto mb-3"}),(0,a.jsx)("p",{className:"font-medium text-kindora-gray-900",children:I("spreadsheet.analyzing")}),(0,a.jsx)("p",{className:"text-sm text-kindora-gray-500 mt-1",children:I("spreadsheet.analyzingHelper")})]}):(0,a.jsxs)("div",{className:"text-center px-4",children:[(0,a.jsx)(f.A,{className:"h-12 w-12 text-kindora-gray-400 mx-auto mb-3"}),(0,a.jsx)("p",{className:"font-medium text-kindora-gray-900",children:eh.isDragActive?I("spreadsheet.dropActive"):I("spreadsheet.dropPrompt")}),(0,a.jsx)("p",{className:"text-sm text-kindora-gray-500 mt-1",children:I("spreadsheet.dropHelper")})]})]})})}),(0,a.jsxs)(o.av,{value:"document",className:"flex-1 flex flex-col mt-4",children:[(0,a.jsxs)("div",{...ex.getRootProps(),className:(0,b.cn)("flex-1 min-h-[200px] border-2 border-dashed rounded-lg flex flex-col items-center justify-center cursor-pointer transition-colors",ex.isDragActive?"border-kindora-primary-500 bg-kindora-primary-50":X?"border-green-500 bg-green-50":"border-kindora-gray-300 hover:border-kindora-gray-400"),children:[(0,a.jsx)("input",{...ex.getInputProps()}),X?(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(j.A,{className:"h-12 w-12 text-green-600 mx-auto mb-3"}),(0,a.jsx)("p",{className:"font-medium text-kindora-gray-900",children:X.name}),(0,a.jsx)("p",{className:"text-sm text-kindora-gray-500 mt-1",children:I("document.fileSizeKbTemplate",{size:z.number(X.size/1024,{minimumFractionDigits:1,maximumFractionDigits:1})})}),(0,a.jsxs)(l.$,{variant:"ghost",size:"sm",className:"mt-2",onClick:e=>{e.stopPropagation(),J(null)},children:[(0,a.jsx)(v.A,{className:"h-4 w-4 mr-1"}),I("document.removeButton")]})]}):(0,a.jsxs)("div",{className:"text-center px-4",children:[(0,a.jsx)(g.A,{className:"h-12 w-12 text-kindora-gray-400 mx-auto mb-3"}),(0,a.jsx)("p",{className:"font-medium text-kindora-gray-900",children:ex.isDragActive?I("document.dropActive"):I("document.dropPrompt")}),(0,a.jsx)("p",{className:"text-sm text-kindora-gray-500 mt-1",children:I("document.dropHelper")})]})]}),P&&Q&&(0,a.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(y.A,{className:"h-4 w-4 animate-spin text-kindora-primary-600"}),(0,a.jsx)("span",{className:"text-sm text-kindora-gray-700",children:Q.message||I("document.extractionFallback")})]}),(0,a.jsx)(c.k,{value:33,className:"h-1"})]})]})]})}),"review"===$&&(0,a.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0",children:(0,a.jsx)("div",{className:"space-y-3 px-6 py-2",children:G.map(e=>{var r;return(0,a.jsx)(k.u,{parsedInput:e,idPrefix:e._key,selectedFunderId:null!=(r=ee[e._key])?r:null,onSelect:r=>eb(e._key,r),isConfirmed:null!=ee[e._key]},e._key)})})}),"complete"===$&&(0,a.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center px-6 py-8",children:[(0,a.jsx)(w.A,{className:"h-16 w-16 text-green-600 mb-4"}),(0,a.jsx)("p",{className:"text-lg font-medium text-kindora-gray-900",children:I("complete.savedCountTemplate",{count:G.length})}),(0,a.jsx)("p",{className:"text-sm text-kindora-gray-600 mt-1",children:I("complete.savedHelper")})]}),(0,a.jsxs)(i.Es,{className:"px-6 pt-4 border-t sm:flex-col sm:space-x-0 gap-3","data-sentry-element":"DialogFooter","data-sentry-source-file":"CurrentFundersModal.tsx",children:["input"===$&&(0,a.jsx)("p",{className:"text-xs text-kindora-gray-500 w-full text-left",children:I("privacyNote")}),(0,a.jsxs)("div",{className:"flex justify-end gap-2 w-full",children:["input"===$&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.$,{variant:"outline",onClick:()=>em(!1),children:I("footer.cancel")}),(0,a.jsx)(l.$,{onClick:"manual"===W?ev:"spreadsheet"===W?ew:ej,disabled:!eC||ek,children:ek&&!B?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.A,{className:"h-4 w-4 mr-2 animate-spin"}),I("footer.processing")]}):I("footer.findMatches")})]}),"review"===$&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex-1 text-sm text-kindora-gray-600",children:I("footer.matchedSummaryTemplate",{confirmed:eF,total:G.length})}),(0,a.jsx)(l.$,{variant:"outline",onClick:()=>U("input"),children:I("footer.back")}),(0,a.jsx)(l.$,{onClick:eN,disabled:K,children:K?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.A,{className:"h-4 w-4 mr-2 animate-spin"}),I("footer.saving")]}):(0,a.jsxs)(a.Fragment,{children:[I("footer.saveTemplate",{count:G.length}),eF<G.length&&I("footer.saveUnmatchedSuffixTemplate",{count:G.length-eF})]})})]}),"complete"===$&&(0,a.jsx)(l.$,{onClick:()=>em(!1),className:"w-full",children:I("complete.doneButton")})]})]})]})})}async function E(e,r){let t=(await e.text()).split(/\r?\n/).filter(e=>e.trim().length>0),a=[];for(let e=r+1;e<t.length;e++)a.push(function(e){let r=[],t="",a=!1;for(let n=0;n<e.length;n++){let s=e[n];'"'===s?a&&'"'===e[n+1]?(t+='"',n++):a=!a:","!==s||a?t+=s:(r.push(t),t="")}return r.push(t),r}(t[e]));return a}},84440:(e,r,t)=>{t.d(r,{d:()=>s});var a=t(12115),n=t(26153);function s(){let{multiTenant:e,currentUser:r}=(0,n.Jd)();return(0,a.useMemo)(()=>{var t,a;let{accounts:n,organizations:s,activeOrganizationId:i}=e;if(!(e.hasFetchedAccounts||e.error))return{canSpend:!1,isConsultantPoolOrg:!1,isResolved:!1};let l=s.find(e=>e.organization_id===i),o=(null==l?void 0:l.account_id)?n.find(e=>e.id===l.account_id):void 0;if("consultant"!==(null!=(a=null==o?void 0:o.account_type)?a:null==l?void 0:l.account_type))return{canSpend:!0,isConsultantPoolOrg:!1,isResolved:!0};let d=null==l?void 0:l.organization_role;if("owner"===d||"admin"===d)return{canSpend:!0,isConsultantPoolOrg:!0,isResolved:!0};let c=null==o||null==(t=o.memberships)?void 0:t.find(e=>e.profile_id===(null==r?void 0:r.id));return c&&("owner"===c.account_role||"admin"===c.account_role||c.can_manage_billing)?{canSpend:!0,isConsultantPoolOrg:!0,isResolved:!0}:{canSpend:!1,isConsultantPoolOrg:!0,isResolved:!0}},[e,null==r?void 0:r.id])}},90596:(e,r,t)=>{t.d(r,{A:()=>
1o,X:()=>l});var a=t(35625),n=t(48934),s=t(6695),i=t(27106);let l=()=>(0,n.n)({mutationFn:e=>{let{organizationId:r,userId:t,file:a}=e;return i.A.analyzeImportFile(r,t,a)}}),o=()=>{let{toast:e}=(0,s.dj)(),r=(0,a.jE)();return(0,n.n)({mutationFn:e=>{let{organizationId:r,userId:t,file:a,relationshipStatus:n,programId:s,nameColumnIndex:l,urlColumnIndex:o,einColumnIndex:d,headerRowIndex:c}=e;return i.A.bulkImportFundersCSV(r,t,a,n,s,l,o,d,c)},onSuccess:(t,a)=>{r.invalidateQueries({queryKey:["unidentifiedFunders",a.organizationId]}),r.invalidateQueries({queryKey:["dashboardState",a.organizationId]}),r.invalidateQueries({queryKey:["funderCounts",a.organizationId]}),r.invalidateQueries({queryKey:["funders","relationship-status",a.organizationId]});let n=[];t.created>0&&n.push("".concat(t.created," imported")),t.already_associated>0&&n.push("".concat(t.already_associated," already existed")),t.failed>0&&n.push("".concat(t.failed," failed")),e({title:"Import Complete",description:n.join(", ")||"No funders processed",variant:t.failed>0&&0===t.created?"destructive":"success"})},onError:r=>{e({title:"Import failed",description:r.message||"Failed to import funders",variant:"destructive"}),console.error("Error bulk importing funders:",r)}})}}}]);
2//# sourceMappingURL=18532-f4803bcebe104161.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.