PageSourceSearch

https://alleviatefoundation.org/_next/static/chunks/882.3ed21cd25188ba98.js

js alleviatefoundation.org collected 2026-10-05 22:10:31 UTC 7,844 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[882],{882:function(e,s,i){i.r(s);var a=i(57437),n=i(2265),t=i(79373),l=i(42264),r=i(3810),d=i(5945),c=i(61778),o=i(16836),m=i(71134),h=i(65319),x=i(33866),u=i(72495),g=i(22116),p=i(91870),v=i(15424),j=i(56531),f=i(3632),y=i(23907),N=i(48614),b=i(32004),w=i(29595),Z=i(44175);let{Title:E,Text:P}=t.default;s.default=e=>{let{suiteId:s,programData:i,onRefresh:t,isEditMode:I}=e,{role:S}=(0,Z.l)(),D="admin"===S||"editor"===S,[k,C]=(0,n.useState)([]),[A,z]=(0,n.useState)(""),[R,T]=(0,n.useState)(!1),[_,F]=(0,n.useState)(!1),[U,B]=(0,n.useState)(!1),[L,Y]=(0,n.useState)([]),[q,H]=(0,n.useState)(!1),M=(0,n.useRef)(null);(0,n.useEffect)(()=>{O()},[s,i]),(0,n.useEffect)(()=>{if(R){var e;null===(e=M.current)||void 0===e||e.focus()}},[R]);let O=async()=>{try{(null==i?void 0:i.invitedEmails)&&i.invitedEmails.length>0&&Y(i.invitedEmails.map((e,s)=>({key:s,email:e,status:"invited",invitedAt:new Date().toISOString()})))}catch(e){console.error("Error loading invited people:",e),Y([])}},W=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),$=()=>{A&&_&&!k.includes(A)&&C([...k,A]),T(!1),z(""),F(!1)},G=e=>{C(k.filter(s=>s!==e))},J=async()=>{if(!D){l.ZP.warning("You do not have permission to send invitations.");return}if(0===k.length){l.ZP.warning("Please add at least one email address");return}try{B(!0),await w.Z.sendEnhancedInvitations({suiteId:s,emails:k,programData:i}),l.ZP.success("Invitations sent to ".concat(k.length," recipients")),C([]),t(),O()}catch(e){console.error("Error sending invitations:",e),l.ZP.error("Failed to send invitations")}finally{B(!1)}},K=[{title:"Email Address",dataIndex:"email",key:"email",render:e=>(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(p.Z,{className:"text-gray-400"}),(0,a.jsx)(P,{children:e})]})},{title:"Status",dataIndex:"status",key:"status",render:e=>(0,a.jsx)(r.Z,{color:"registered"===e?"green":"orange",children:"registered"===e?"✅ Registered":"\uD83D\uDCE7 Invited"})},{title:"Invited Date",dataIndex:"invitedAt",key:"invitedAt",render:e=>new Date(e).toLocaleDateString("en-US")}];return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)(d.default,{title:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 sm:w-10 sm:h-10 bg-gradient-to-r from-blue-500 to-indigo-600 rounded-lg flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(p.Z,{className:"text-white text-base sm:text-lg"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)(E,{level:4,className:"mb-0 text-base sm:text-lg",children:"Email Invitations"}),(0,a.jsx)(P,{type:"secondary",className:"text-xs sm:text-sm hidden sm:block",children:"Invite beneficiaries to join your Program"})]})]}),className:"border-l-4 border-l-blue-500",children:[(0,a.jsx)(c.Z,{message:"Program Invitations",description:"Invited beneficiaries will receive a personalized email with direct access to your  Program enrollment form. They can apply immediately without needing to search for your program.",type:"info",icon:(0,a.jsx)(v.Z,{}),className:"mb-4"}),(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(P,{strong:!0,children:"Add Email Addresses"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"mb-3 min-h-[40px] p-2 border border-dashed border-gray-300 rounded-lg",children:[(0,a.jsx)(N.M,{children:k.map((e,s)=>(0,a.jsx)(b.E.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},className:"inline-block mr-2 mb-2",children:(0,a.jsxs)(r.Z,{closable:!0,onClose:()=>G(e),className:"px-3 py-1",children:[(0,a.jsx)(p.Z,{className:"mr-1"}),e]})},e))}),0===k.length&&(0,a.jsx)(P,{type:"secondary",className:"italic",children:"Email addresses will appear here..."})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row flex-wrap items-stretch sm:items-center gap-2 sm:gap-3",children:[R?(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)(o.default,{ref:M,type:"email",value:A,onChange:e=>{let s=e.target.value;z(s),F(W(s))},onPressEnter:$,onBlur:$,placeholder:"Enter email address",status:A&&!_?"error":"",className:"rounded-full",disabled:!D}),A&&!_&&(0,a.jsx)(P,{type:"danger",className:"text-xs sm:text-sm",children:"Please enter a valid email address"})]}):(0,a.jsx)(m.ZP,{type:"dashed",icon:(0,a.jsx)(j.Z,{}),onClick:()=>T(!0),className:"rounded-full w-full sm:w-auto",disabled:!D,children:(0,a.jsx)("span",{className:"sm:inline",children:"Add Email"})}),(0,a.jsx)(h.default,{accept:".txt,.csv",beforeUpload:e=>{let s=new FileReader;return s.onload=e=>{try{var s;let i=(null===(s=e.target)||void 0===s?void 0:s.result).split("\n"),a=[];
1i.forEach(e=>{let s=e.trim();W(s)&&!k.includes(s)&&a.push(s)}),a.length>0?(C([...k,...a]),l.ZP.success("Added ".concat(a.length," valid emails"))):l.ZP.warning("No valid new emails found in file")}catch(e){l.ZP.error("Error reading file")}},s.readAsText(e),!1},showUploadList:!1,disabled:!D,children:(0,a.jsxs)(m.ZP,{icon:(0,a.jsx)(f.Z,{}),className:"rounded-full w-full sm:w-auto",disabled:!D,children:[(0,a.jsx)("span",{className:"hidden sm:inline",children:"Import from File"}),(0,a.jsx)("span",{className:"sm:hidden",children:"Import"})]})}),(0,a.jsxs)(m.ZP,{type:"primary",icon:(0,a.jsx)(y.Z,{}),onClick:()=>H(!0),disabled:!D||0===k.length,className:"bg-gradient-to-r from-blue-500 to-indigo-600 border-0 rounded-full w-full sm:w-auto",children:[(0,a.jsx)("span",{className:"hidden sm:inline",children:"Send Invitations"}),(0,a.jsx)("span",{className:"sm:hidden",children:"Send"}),k.length>0&&(0,a.jsx)(x.Z,{count:k.length,className:"ml-2"})]})]})]})]})})]}),(0,a.jsx)(d.default,{title:"\uD83D\uDCCB Invitation History",extra:(0,a.jsx)(x.Z,{count:L.length,showZero:!0,children:(0,a.jsx)(P,{type:"secondary",children:"Total Invitations"})}),children:0===L.length?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"text-6xl mb-4",children:"\uD83D\uDCE7"}),(0,a.jsx)(E,{level:4,type:"secondary",children:"No invitations sent yet"}),(0,a.jsx)(P,{type:"secondary",children:"Invitation history will appear here once you start inviting beneficiaries"})]}):(0,a.jsx)(u.Z,{dataSource:L,columns:K,scroll:{x:500},pagination:{pageSize:10,showSizeChanger:!0,showTotal:(e,s)=>"".concat(s[0],"-").concat(s[1]," of ").concat(e)},className:"invitations-table"})}),(0,a.jsx)(g.default,{title:"\uD83D\uDCE7 Preview Invitation",open:q,onCancel:()=>H(!1),width:600,footer:[(0,a.jsx)(m.ZP,{onClick:()=>H(!1),children:"Cancel"},"cancel"),(0,a.jsxs)(m.ZP,{type:"primary",icon:(0,a.jsx)(y.Z,{}),loading:U,onClick:async()=>{await J(),H(!1)},className:"bg-gradient-to-r from-blue-500 to-indigo-600 border-0",disabled:!D,children:["Send ",k.length," Invitation",1!==k.length?"s":""]},"send")],children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(c.Z,{message:"Email Preview",description:"You're about to send invitations to ".concat(k.length," recipient").concat(1!==k.length?"s":"",' for "').concat((null==i?void 0:i.name)||"Enhanced Program",'"'),type:"info"}),(0,a.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,a.jsx)(P,{strong:!0,children:"Recipients:"}),(0,a.jsx)("div",{className:"mt-2 max-h-32 overflow-y-auto",children:k.map(e=>(0,a.jsx)(r.Z,{className:"mb-1",children:e},e))})]}),(0,a.jsxs)("div",{className:"bg-blue-50 p-4 rounded-lg",children:[(0,a.jsx)(P,{strong:!0,children:"What recipients will receive:"}),(0,a.jsxs)("ul",{className:"mt-2 space-y-1 text-sm",children:[(0,a.jsx)("li",{children:"• Personalized invitation email"}),(0,a.jsx)("li",{children:"• Direct link to Enhanced Program enrollment"}),(0,a.jsx)("li",{children:"• Program information and requirements"}),(0,a.jsx)("li",{children:"• Instructions for getting started"})]})]})]})})]})}}}]);

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.