1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14008],{1243:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/sponsor/sponsorList",function(){return n(87988)}])},29093:function(e,t,n){"use strict";var r=n(9669),i=n.n(r),a=n(65885);let o=new a.Z,s=i().create({baseURL:"https://backend-v2.tradewing.com",timeout:3e4});s.interceptors.request.use(e=>{e.headers["x-api-key"]="aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ",e.headers["x-user-id"]="hardik";let t=o.get("accounts%3AaccessToken"),n=o.get("accounts%3ArefreshToken");return t&&(e.headers.Authorization="Bearer ".concat(t)),n&&(e.headers["x-refresh-token"]=n),e},e=>Promise.reject(e)),s.interceptors.response.use(e=>e,e=>{var t;return null===(t=e.response)||void 0===t||t.status,Promise.reject(e)}),t.Z=s},29173:function(e,t,n){"use strict";n.d(t,{Hr:function(){return reorderSponsorTiers},J2:function(){return fetchSponsorTiersByName},Uq:function(){return fetchSponsorTierNameByIds},V9:function(){return fetchActiveBenefitCatalogsByTenant},al:function(){return updateBenefitCatalogVisibility},bZ:function(){return updateSponsorTierVisibility},fF:function(){return createSponsorTier},iE:function(){return fetchSponsorTiers},ik:function(){return fetchBenefitCatalogs},qs:function(){return updateSponsorTier}});var r=n(29093);async function fetchSponsorTiers(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{tenantId:t,search:n,limit:i,offset:a,userId:o}=e,s=await r.Z.get("/api/v1/sponsor/sponsor-tiers",{headers:{"x-tenant-id":t,...o?{"x-user-id":o}:{}},params:{search:n,sort:"asc",limit:i,offset:a}});return s.data}async function fetchSponsorTiersByName(e){let{tenantId:t,name:n}=e,i=await r.Z.get("/api/v1/sponsor/sponsor-tiers-by-name",{headers:{"x-tenant-id":t},params:{names:n}});return i.data}async function fetchSponsorTierNameByIds(e){let{tenantId:t,ids:n}=e,i=await r.Z.get("/api/v1/sponsor/sponsor-tiers-by-ids",{headers:{"x-tenant-id":t},params:{ids:n}});return i.data}async function fetchBenefitCatalogs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{tenantId:t,search:n,userId:i}=e,a=await r.Z.get("/api/v1/sponsor/benefit-catelog-by-tenant",{headers:{"x-tenant-id":t,...i?{"x-user-id":i}:{}},params:{search:n}});return a.data}async function fetchActiveBenefitCatalogsByTenant(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{tenantId:t,userId:n}=e,i=await r.Z.get("/api/v1/sponsor/active-benefit-catelog-by-tenant",{headers:{"x-tenant-id":t,...n?{"x-user-id":n}:{}}});return i.data}async function updateSponsorTierVisibility(e){let t=await r.Z.put("/api/v1/sponsor/update-tier-visibility",{id:e.id,visibility:e.visibility},{headers:{"x-tenant-id":e.tenantId,...e.userId?{"x-user-id":e.userId}:{}}});return t.data}async function updateBenefitCatalogVisibility(e){let t=await r.Z.put("/api/v1/sponsor/update-benefit-catalog-visibility",{id:e.id,visibility:e.visibility},{headers:{"x-tenant-id":e.tenantId,...e.userId?{"x-user-id":e.userId}:{}}});return t.data}async function createSponsorTier(e){let t=await r.Z.post("/api/v1/sponsor/create",{...e},{headers:{"x-tenant-id":e.tenantId,...e.userId?{"x-user-id":e.userId}:{}}});return t.data}async function updateSponsorTier(e){let t=await r.Z.put("/api/v1/sponsor/update",{...e},{headers:{"x-tenant-id":e.tenantId,...e.userId?{"x-user-id":e.userId}:{}}});return t.data}async function reorderSponsorTiers(e){let t=await r.Z.post("/api/v1/sponsor/reorder-sponsor-tiers",e.tiers,{headers:{"x-tenant-id":e.tenantId,...e.userId?{"x-user-id":e.userId}:{}}});return t.data}},93340:function(e,t,n){"use strict";n.d(t,{K:function(){return getValidateCsvFileHeaders},T:function(){return normalizeHeader}});let normalizeHeader=e=>e.replace(/[^\w\s\-]/g,"").trim().toLowerCase(),validateFile=async(e,t)=>{let n=t.stream().getReader(),r=new TextDecoder("utf-8"),{value:i}=await n.read();if(!i)return null;let a=r.decode(i,{stream:!0}).split("\n")[0],o=a.split(",").map(e=>normalizeHeader(e));return e(o)},getValidateCsvFileHeaders=e=>async t=>{let n=await validateFile(e.validateHeaders,t);n?e.onErrors(n):e.onSuccess(t)}},85200:function(e,t,n){"use strict";n.d(t,{DY:function(){return AdminPage},hb:function(){return o},lm:function(){return AdminPageHeading},yG:function(){return AdminPageHeader}});var r=n(85893),i=n(48641),a=n(38655);n(67294);let AdminPage=e=>{let{children:t,...n}=e;return(0,r.jsx)(i.xu,{...n,children:t})},AdminPageHeader=e=>{let{children:t,...n}=e;return(0,r.jsx)(i.Kq,{direction:"row",spacing:"4",alignItems:"flex-start",...n,children:t})},AdminPageHeading=e=>{let{children:t,...n}=e;return(0,r.jsx)(i.X6,{size:"md",...n,children:t})},o=(0,a.Gp)((e,t)=>{let{children:n,...a}=e;return(0,r.jsx)(i.xu,{marginY:"5",...a,ref:t,children:n})})},61437:function(e,t,n){"use strict";n.d(t,{Mt:function(){return DatePicker},SB:function(){return DateOnlyPicker}});var r=n(85893),i=n(83234),a=n(48641);n(67294);var o=n(9198),s=n.n(o);n(35890);let l={".react-datepicker-popper":{zIndex:"docked"}},DatePicker=e=>{let t=(0,i.NJ)(),n=e.disabled||(null==t?void 0:t.isDisabled);return(0,r.jsx)(a.xu,{sx:l,w:"full",children:(0,r.jsx)(s(),{...e,disabled:n})})};DatePicker.defaultProps={dateFormat:"h:mm a EEEE, MMMM d yyyy"};let DateOnlyPicker=e=>{let t=(0,i.NJ)(),n=e.disabled||(null==t?void 0:t.isDisabled);return(0,r.jsx)(a.xu,{sx:l,w:"full",children:(0,r.jsx)(s(),{...e,disabled:n,dateFormat:"MM/dd/yyyy",placeholderText:"mm/dd/yyyy",showPopperArrow:!1})})}},39174:function(e,t,n){"use strict";n.d(t,{A:function(){return NoMatchPage}});var r=n(85893),i=n(48641),a=n(23887),o=n(47741),s=n(11163);n(67294);let NoMatchPage=()=>{let e=(0,s.useRouter)();return(0,r.jsxs)(i.gC,{p:"12",spacing:"4",textAlign:"center",children:[(0,r.jsx)(a.Ee,{src:"https://tradewing-public.s3.us-east-2.amazonaws.com/tradewing-logo.png",alt:"Tradewing",width:"50px",height:"50px"}),(0,r.jsx)(i.xv,{textStyle:"xlBodyStrong",children:"Page Not Found"}),(0,r.jsx)(i.xv,{children:"Please check that you have the correct URL and try again. If you need help finding and accessing your community, please contact [email protected]."}),(0,r.jsx)(o.zx,{onClick:()=>
1e.push("/"),children:"Return to Site"})]})}},14056:function(e,t,n){"use strict";n.d(t,{t:function(){return Pagination}});var r=n(85893),i=n(48641),a=n(47741);n(67294);var o=n(6491);let Pagination=e=>{let{currentPage:t,numberOfPages:n,onChange:s}=e,l=Math.ceil(2.5),d=Math.min(t-l>0?t-l:0,n-5>0?n-5:0),c=d+5;return n<2?null:(0,r.jsx)(i.M5,{mt:"6",children:(0,r.jsxs)(a.hE,{colorScheme:"gray",children:[(0,r.jsx)(a.hU,{isDisabled:1===t,icon:(0,r.jsx)(o.wyc,{}),"aria-label":"Next Page",onClick:()=>s(t-1),variant:"outline"}),Array.from({length:n},(e,t)=>t+1).slice(d,c).map(e=>(0,r.jsx)(a.zx,{variant:t===e?"solid":"ghost",onClick:()=>s(e),children:e},e)),(0,r.jsx)(a.hU,{isDisabled:t===n,icon:(0,r.jsx)(o.XCv,{}),"aria-label":"Previous Page",onClick:()=>s(t+1),variant:"outline"})]})})}},76722:function(e,t,n){"use strict";n.d(t,{t:function(){return r.t}});var r=n(14056)},89845:function(e,t,n){"use strict";n.d(t,{$r:function(){return d},KI:function(){return PopoverMenuGroup},Sl:function(){return c},l9:function(){return PopoverMenuDivider}});var r=n(85893),i=n(48641),a=n(47741),o=n(38655),s=n(67294),l=n(6491);let d=s.forwardRef((e,t)=>{let{children:n,...a}=e;return(0,r.jsx)(i.Kq,{padding:"2",borderRadius:"lg",ref:t,...a,children:n})});d.displayName="PopoverMenuList";let c=s.forwardRef((e,t)=>{let{isChecked:n,children:i,...s}=e;return(0,r.jsx)(a.zx,{variant:"ghost",colorScheme:"gray",leftIcon:n?(0,r.jsx)(l.nQG,{}):void 0,fontWeight:"normal",whiteSpace:"normal",...s,ref:t,borderRadius:"xl",children:(0,r.jsx)(o.m$.span,{textAlign:"left",noOfLines:1,flex:"1",wordBreak:"break-all",children:i})})});c.displayName="PopoverMenuItem";let PopoverMenuDivider=e=>(0,r.jsx)(i.iz,{my:"2",...e}),PopoverMenuGroup=e=>(0,r.jsxs)(i.Kq,{children:[e.title&&(0,r.jsx)(i.xv,{color:"gray.500",fontSize:"sm",fontWeight:"semibold",mx:"2",textTransform:"uppercase",children:e.title}),e.children]})},9162:function(e,t,n){"use strict";n.d(t,{N:function(){return y},z:function(){return S}});var r=n(82729),i=n(85893),a=n(50456),o=n(37887),s=n(1644),l=n(82415),d=n(20979),c=n(35610),u=n(47741),p=n(48641),C=n(67294),h=n(14314),v=n(96445),x=n(89845),m=n(82475),g=n(6491),f=n(51992);function _templateObject(){let e=(0,r._)(["\n query SearchableOrganizationSelect_OrganizationSearch(\n $input: OrganizationSearchInput!\n ) {\n organizationSearch(input: $input) {\n results {\n _id\n displayName\n isSponsor\n ...OrganizationProfileImage_OrganizationFragment\n }\n }\n }\n ","\n"]);return _templateObject=function(){return e},e}let j=(0,a.Ps)(_templateObject(),v.t.organizationFragment),S=C.forwardRef((e,t)=>{var n,r,a,S;let{value:w,onChange:b,organizationSearchFilters:D,allowNewOrganizationCreation:T}=e,I=C.useRef(null),[M,z]=C.useState(""),O=(0,f.c)(M,500),E=(0,o.a)(j,{variables:{input:{limit:4,offset:0,filter:{...D,searchText:O}}},notifyOnNetworkStatusChange:!0}),L=E.networkStatus===s.I.setVariables?null===(r=E.previousData)||void 0===r?void 0:null===(n=r.organizationSearch)||void 0===n?void 0:n.results:null===(S=E.data)||void 0===S?void 0:null===(a=S.organizationSearch)||void 0===a?void 0:a.results;return(0,i.jsx)(l.J2,{initialFocusRef:I,matchWidth:!0,children:e=>{let{onClose:n}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.xo,{children:(0,i.jsx)(m.U,{ref:t,w:"full",children:w?w.name:"Choose a Organization"})}),(0,i.jsx)(l.yk,{width:"full",shadow:"lg",children:(0,i.jsx)(h.ZP,{returnFocus:!0,persistentFocus:!1,children:(0,i.jsxs)(x.$r,{children:[(0,i.jsxs)(d.BZ,{children:[(0,i.jsx)(d.II,{ref:I,value:M,onChange:e=>z(e.target.value),placeholder:"Search Companies",autoComplete:"off"}),E.networkStatus===s.I.setVariables?(0,i.jsx)(d.xH,{children:(0,i.jsx)(c.$,{color:"gray.600",size:"sm"})}):M?(0,i.jsx)(d.xH,{children:(0,i.jsx)(u.hU,{"aria-label":"clear search",icon:(0,i.jsx)(g.b0D,{}),onClick:()=>z(""),size:"sm",variant:"ghost",colorScheme:"gray"})}):null]}),null==L?void 0:L.map(e=>(0,i.jsx)(x.Sl,{onClick:()=>{b(w&&w.id===e._id?void 0:{id:e._id,name:e.displayName,isSponsor:e.isSponsor}),n()},isChecked:w&&w.id===e._id,children:(0,i.jsxs)(p.Kq,{direction:"row",alignItems:"center",children:[(0,i.jsx)(v.t,{organization:e,boxSize:8,p:1}),(0,i.jsx)(p.xv,{children:e.displayName})]})},e._id)),(null==L?void 0:L.length)===0&&(0,i.jsx)(p.xv,{color:"gray.500",padding:"2",textStyle:"compact",textAlign:"center",children:"No matching search results"}),T&&!(null==L?void 0:L.length)&&M&&(0,i.jsx)(u.zx,{variant:"outline",colorScheme:"gray",leftIcon:(0,i.jsx)(g.wl8,{}),onClick:()=>{b({id:y,name:M,isSponsor:!1}),n()},children:'Create "'.concat(M,'"')})]})})})]})}})});S.displayName="SearchableOrganizationSelect";let y="new-organization-placeholder-id"},82475:function(e,t,n){"use strict";n.d(t,{U:function(){return d}});var r=n(85893),i=n(83234),a=n(47741),o=n(38655),s=n(67294),l=n(6491);let d=s.forwardRef((e,t)=>
1{let{children:n,...s}=e,d=(0,i.NJ)(),c=(null==d?void 0:d.isDisabled)||s.isDisabled;return(0,r.jsx)(a.zx,{variant:"outline",colorScheme:"gray",backgroundColor:"white",fontWeight:"normal",rightIcon:(0,r.jsx)(l.v4q,{}),justifyContent:"space-between",borderColor:(null==d?void 0:d.isInvalid)?"red.500":void 0,border:(null==d?void 0:d.isInvalid)?"2px":void 0,_hover:{backgroundColor:"white"},w:"full",isDisabled:c,_expanded:{bg:"gray.200"},...s,ref:t,whiteSpace:"normal",textAlign:"left",children:(0,r.jsx)(o.m$.span,{noOfLines:1,wordBreak:"break-all",flex:"1",children:n})})});d.displayName="SelectMenuButton"},32683:function(e,t,n){"use strict";n.d(t,{MH:function(){return TableNone},Uc:function(){return l},fQ:function(){return TableEmpty}});var r=n(85893),i=n(48641),a=n(36696),o=n(36158),s=n(67294);let TableNone=e=>{let{children:t,...n}=e;return(0,r.jsx)(i.M5,{p:"10",h:"xs",...n,children:(0,r.jsx)(i.xu,{children:t})})},l=(0,s.memo)(e=>{let{columns:t,rows:n=5}=e;return(0,r.jsx)(a.p3,{children:[...Array(n)].map((e,n)=>(0,r.jsx)(a.Tr,{children:[...Array(t)].map((e,t)=>(0,r.jsx)(a.Td,{children:(0,r.jsx)(o.Od,{h:"4",borderRadius:"lg"})},t))},n))})});l.displayName="TableLoading";let TableEmpty=e=>(0,r.jsx)(a.p3,{children:(0,r.jsx)(a.Tr,{children:(0,r.jsx)(a.Td,{colSpan:100,children:(0,r.jsx)(TableNone,{children:e.children})})})})},5146:function(e,t,n){"use strict";var r=n(9669),i=n.n(r),a=n(67294);t.Z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,[n,r]=(0,a.useState)(null),[o,s]=(0,a.useState)(!1),[l,d]=(0,a.useState)(null),c=(0,a.useCallback)(async function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;s(!0),d(null);try{let t=i().CancelToken.source(),a=await e(n,{cancelToken:t.token});return r(a),s(!1),a}catch(e){throw i().isCancel(e)?console.log("Request canceled",e.message):d(e),s(!1),e}},[e,t]);return{data:n,loading:o,error:l,execute:c}}},45070:function(e,t,n){"use strict";n.r(t),n.d(t,{exportExcel:function(){return exportExcel},useExportExcel:function(){return useExportExcel}});var r=n(74295),i=n.n(r),a=n(93162),o=n(67294);function useExportExcel(e){let{data:t,headers:n,filename:r="export.xlsx",sheetName:s="Sheet1"}=e;return(0,o.useCallback)(async()=>{let e=new(i()).Workbook,o=e.addWorksheet(s);o.addRow(n),t.forEach(e=>o.addRow(e));let l=await e.xlsx.writeBuffer();(0,a.saveAs)(new Blob([l]),r)},[t,n,r,s])}async function exportExcel(e){let{data:t,headers:n,filename:r="export.xlsx",sheetName:o="Sheet1"}=e,s=new(i()).Workbook,l=s.addWorksheet(o);l.addRow(n),t.forEach(e=>l.addRow(e));let d=await s.xlsx.writeBuffer();(0,a.saveAs)(new Blob([d]),r)}},19598:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(38655);let i=(0,r.m$)("div",{baseStyle:{borderRadius:"8px",backgroundColor:"white",shadow:"base"}})},52670:function(e,t,n){"use strict";n.d(t,{Z:function(){return r.Z}});var r=n(19598)},95126:function(e,t,n){"use strict";n.d(t,{d:function(){return EditIcon}});var r=n(85893),i=n(52494);n(67294);let EditIcon=e=>(0,r.jsxs)(i.JO,{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",...e,xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M5.01143 0.859655C5.11444 0.859599 5.21744 0.859518 5.32045 0.859414C5.53497 0.859292 5.74948 0.859467 5.964 0.859858C6.23879 0.860335 6.51357 0.860058 6.78836 0.859561C7.00047 0.85926 7.21257 0.859356 7.42468 0.859571C7.52604 0.859627 7.62741 0.859559 7.72877 0.859365C7.87005 0.859153 8.01132 0.859476 8.1526 0.85994C8.19426 0.859771 8.23592 0.859603 8.27884 0.859429C8.54876 0.86107 8.75551 0.871511 8.96541 1.05809C9.10594 1.21869 9.11023 1.31935 9.10691 1.52651C9.08963 1.71088 9.0083 1.79771 8.87292 1.9161C8.68199 2.03913 8.47121 2.01736 8.25142 2.01503C8.18057 2.01527 8.18057 2.01527 8.1083 2.01552C8.00586 2.01577 7.90342 2.01564 7.80098 2.01517C7.63827 2.01445 7.47559 2.01476 7.31288 2.01535C6.93755 2.01655 6.56222 2.01611 6.18689 2.01565C5.8164 2.01521 5.44593 2.01544 5.07545 2.01676C4.9162 2.01705 4.75697 2.01636 4.59772 2.01563C3.58195 2.01568 2.73209 2.18734 1.97805 2.91097C1.3825 3.52259 1.13857 4.33625 1.13944 5.17276C1.13932 5.21049 1.13919 5.24822 1.13907 5.28709C1.13871 5.41282 1.13864 5.53855 1.13858 5.66428C1.13839 5.75473 1.13818 5.84517 1.13795 5.93562C1.13741 6.18091 1.13714 6.42619 1.13695 6.67148C1.13683 6.82496 1.13666 6.97844 1.13647 7.13192C1.
113591 7.61279 1.1355 8.09367 1.13534 8.57455C1.13516 9.12838 1.13443 9.6822 1.13322 10.236C1.13232 10.6649 1.1319 11.0938 1.13184 11.5228C1.1318 11.7785 1.13156 12.0343 1.13081 12.2901C1.13012 12.531 1.13004 12.7718 1.1304 13.0127C1.13043 13.1007 1.13025 13.1886 1.12984 13.2765C1.12536 14.2884 1.27755 15.1999 1.99724 15.9666C2.76228 16.7045 3.5772 16.8371 4.59308 16.8349C4.68902 16.8351 4.78496 16.8354 4.8809 16.8357C5.14037 16.8365 5.39983 16.8364 5.65929 16.8362C5.87637 16.8361 6.09345 16.8363 6.31053 16.8366C6.85213 16.8372 7.39373 16.837 7.93532 16.8365C8.40448 16.8361 8.87362 16.8367 9.34278 16.8376C9.82583 16.8387 10.3089 16.839 10.7919 16.8388C11.0626 16.8386 11.3332 16.8387 11.6039 16.8395C11.8585 16.8401 12.1131 16.8399 12.3678 16.8392C12.4608 16.839 12.5539 16.8391 12.647 16.8396C13.6319 16.8438 14.415 16.629 15.1495 15.9352C15.774 15.2926 15.9747 14.4668 15.9743 13.5927C15.9744 13.5459 15.9746 13.4992 15.9747 13.451C15.975 13.35 15.9753 13.2489 15.9754 13.1479C15.9757 12.9879 15.9764 12.8279 15.9771 12.668C15.9774 12.6136 15.9777 12.5592 15.9779 12.5032C15.9781 12.4757 15.9782 12.4482 15.9783 12.4199C15.9801 12.0479 15.9814 11.676 15.982 11.3041C15.9823 11.0256 15.9836 10.7472 15.9853 10.4687C15.9859 10.3627 15.9861 10.2567 15.986 10.1507C15.9859 10.0026 15.9868 9.85449 15.988 9.70639C15.9877 9.66265 15.9874 9.61891 15.9871 9.57384C15.9903 9.32494 16.009 9.17872 16.1766 8.99011C16.3659 8.8639 16.5238 8.85348 16.7465 8.89122C16.9278 8.96646 17.0062 9.06716 17.0926 9.23994C17.0968 9.30683 17.0984 9.37389 17.0987 9.44092C17.0992 9.50463 17.0992 9.50463 17.0996 9.56963C17.0998 9.61643 17.0999 9.66323 17.1 9.71145C17.1003 9.76062 17.1005 9.80979 17.1008 9.86044C17.1016 10.024 17.1021 10.1876 17.1025 10.3511C17.1027 10.4077 17.1029 10.4642 17.103 10.5207C17.1038 10.7868 17.1044 11.0529 17.1048 11.319C17.1052 11.6247 17.1063 11.9303 17.108 12.2359C17.1092 12.4729 17.1098 12.7099 17.11 12.9469C17.1101 13.088 17.1104 13.2291 17.1115 13.3702C17.1204 14.752 16.8325 15.8279 15.8617 16.8597C14.914 17.7841 13.7209 17.997 12.4499 17.9953C12.3558 17.9955 12.2617 17.9957 12.1676 17.996C11.9132 17.9965 11.6589 17.9966 11.4046 17.9965C11.1917 17.9964 10.9788 17.9966 10.7658 17.9968C10.2344 17.9973 9.70304 17.9973 9.17164 17.997C8.71172 17.9968 8.25182 17.9972 7.79191 17.998C7.31803 17.9989 6.84416 17.9992 6.37028 17.999C6.1049 17.999 5.83951 17.9991 5.57413 17.9996C5.32436 18.0002 5.0746 18.0001 4.82484 17.9995C4.73369 17.9995 4.64253 17.9996 4.55138 17.9999C3.23656 18.0045 2.12318 17.6977 1.1531 16.7582C0.433591 16.0119 0.00629746 15.0141 0.00993054 13.9752C0.00974188 13.9347 0.00955311 13.8942 0.00935873 13.8525C0.00883581 13.7181 0.00889959 13.5838 0.00896863 13.4494C0.00871919 13.3525 0.00843577 13.2556 0.00812108 13.1587C0.00738764 12.8964 0.00719046 12.6341 0.00713725 12.3718C0.00707792 12.2076 0.00689957 12.0434 0.00667917 11.8792C0.00594907 11.335 0.00556159 10.7908 0.00562418 10.2466C0.00562751 10.2174 0.00563092 10.1881 0.00563434 10.1579C0.00563775 10.1286 0.00564
11 10.0993 0.00564451 10.0691C0.00567831 9.59483 0.00488232 9.12054 0.00370735 8.64625C0.00250684 8.15775 0.00193641 7.66924 0.00200812 7.18074C0.00202926 6.90708 0.00179691 6.63344 0.000910878 6.35979C9.93509e-05 6.10213 0.00010139 5.84448 0.000703756 5.58682C0.000790198 5.4928 0.000598157 5.39877 9.09667e-05 5.30475C-0.00641041 4.01496 0.334869 2.95251 1.25199 2.01023C2.32019 0.994815 3.61265 0.85695 5.01143 0.859655Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M16.2278 0.258673C16.5338 0.465522 16.7901 0.714236 17.0494 0.975392C17.1238 1.05021 17.199 1.12421 17.2743 1.19819C17.7597 1.68066 18.0986 2.16613 18.105 2.87192C18.1056 3.53155 17.8219 3.98407 17.3663 4.44449C17.3162 4.4941 17.3162 4.4941 17.2652 4.54472C17.229 4.58106 17.1929 4.61741 17.1556 4.65485C17.0563 4.75462 16.9567 4.85411 16.8569 4.95348C16.749 5.06111 16.6414 5.16909 16.5338 5.27703C16.3235 5.48796 16.1128 5.69854 15.9019 5.90901C15.7306 6.08004 15.5594 6.25119 15.3883 6.42243C15.3639 6.44684 15.3395 6.47126 15.3144 6.49642C15.2648 6.54603 15.2153 6.59564 15.1657 6.64525C14.7016 7.10965 14.2372 7.57367 13.7727 8.03755C13.3741 8.43557 12.9758 8.83393 12.5778 9.23252C12.1152 9.69579 11.6524 10.1589 11.1893 10.6216C11.1399 10.6709 11.0905 10.7203 11.0412 10.7696C11.0169 10.7938 10.9926 10.8181 10.9676 10.8431C10.7965 11.0141 10.6255 11.1853 10.4546 11.3565C10.2465 11.565 10.0381 11.7732 9.82946 11.9812C9.72302 12.0873 9.61669 12.1935 9.51062 12.3C9.39572 12.4153 9.28034 12.5302 9.1649 12.645C9.13136 12.6788 9.09782 12.7126 9.06326 12.7475C9.03228 12.7781 9.0013 12.8088 8.96937 12.8404C8.9428 12.8669 8.91622 12.8935 8.88883 12.9209C8.71164 13.0643 8.50776 13.0914 8.28784 13.1221C8.242 13.1288 8.242 13.1288 8.19522 13.1357C8.0945 13.1504 7.99373 13.1647 7.89295 13.1789C7.82247 13.1891 7.75198 13.1992 7.68149 13.2094C7.53374 13.2306 7.38597 13.2517 7.23817 13.2726C7.04983 13.2992 6.86156 13.3264 6.67331 13.3538C6.52767 13.3749 6.38198 13.3957 6.23628 13.4164C6.16691 13.4263 6.09756 13.4362 6.02823 13.4463C5.05635 13.5874 5.05635 13.5874 4.78865 13.4584C4.67985 13.3577 4.61578 13.2911 4.55964 13.1539C4.55163 12.9295 4.56781 12.7154 4.60037 12.4933C4.6047 12.4624 4.60904 12.4316 4.6135 12.3998C4.62774 12.2989 4.6423
11 12.198 4.65691 12.0972C4.66699 12.0265 4.67706 11.9557 4.68712 11.885C4.70818 11.7373 4.72941 11.5896 4.75076 11.4419C4.77803 11.2531 4.80491 11.0643 4.83167 10.8754C4.85238 10.7295 4.87329 10.5837 4.89426 10.4379C4.90424 10.3683 4.91417 10.2987 4.92403 10.2291C4.93788 10.1316 4.95199 10.0342 4.96616 9.93677C4.97015 9.90836 4.97413 9.87996 4.97823 9.85069C4.98988 9.77178 5.00373 9.6932 5.01766 9.61466C5.02827 9.54544 5.02827 9.54544 5.0391 9.47482C5.18867 9.1081 5.55849 8.81787 5.83623 8.5407C5.87049 8.50634 5.90475 8.47198 5.94005 8.43659C6.05367 8.32271 6.16744 8.20897 6.2812 8.09524C6.36319 8.01315 6.44515 7.93103 6.52711 7.84891C6.72588 7.64979 6.92477 7.45079 7.1237 7.25183C7.28544 7.09008 7.44715 6.92828 7.60883 6.76647C8.06796 6.30697 8.52719 5.84755 8.98652 5.38825C9.01122 5.36355 9.03592 5.33886 9.06137 5.31341C9.0861 5.28868 9.11083 5.26395 9.13631 5.23848C9.53755 4.83725 9.93858 4.43582 10.3395 4.03429C10.7519 3.62129 11.1645 3.20845 11.5772 2.79576C11.8086 2.56435 12.04 2.33287 12.2712 2.10123C12.4679 1.90416 12.6647 1.70723 12.8617 1.5105C12.9621 1.41022 13.0625 1.30987 13.1627 1.20934C13.2715 1.10022 13.3805 0.991363 13.4896 0.882564C13.5366 0.835235 13.5366 0.835235 13.5846 0.78695C14.2873 0.0887698 15.301 -0.282403 16.2278 0.258673ZM14.5362 1.45802C14.5162 1.47818 14.4962 1.49833 14.4756 1.5191C14.4125 1.58286 14.3499 1.64705 14.2873 1.71126C14.2443 1.75485 14.2013 1.79842 14.1583 1.84195C14.0535 1.94813 13.9491 2.05469 13.8449 2.16147C13.909 2.31382 14.0007 2.41059 14.1173 2.52658C14.1364 2.54569 14.1555 2.5648 14.1752 2.58449C14.238 2.64732 14.3012 2.70985 14.3
1644 2.77238C14.4082 2.816 14.4519 2.85964 14.4957 2.90329C14.6106 3.01793 14.7258 3.13231 14.8411 3.24664C14.9587 3.36344 15.0761 3.48048 15.1936 3.59749C15.4239 3.8269 15.6544 4.05603 15.8852 4.28501C16.1116 4.09284 16.3289 3.89448 16.541 3.68646C16.5724 3.65662 16.6038 3.62678 16.6361 3.59603C16.8524 3.38315 16.9915 3.20253 17.0183 2.88997C17.0145 2.86169 17.0107 2.8334 17.0068 2.80426C17.0037 2.77586 17.0007 2.74747 16.9975 2.71822C16.9189 2.45747 16.758 2.26567 16.5689 2.07771C16.5469 2.05541 16.5248 2.03311 16.502 2.01014C16.4556 1.96342 16.409 1.91686 16.3622 1.87044C16.2914 1.79999 16.2214 1.7288 16.1514 1.65751C15.7886 1.28557 15.7886 1.28557 15.3123 1.09987C15.2798 1.10067 15.2473 1.10148 15.2137 1.10231C15.1646 1.10239 15.1646 1.10239 15.1145 1.10247C14.8683 1.14531 14.707 1.28415 14.5362 1.45802ZM12.928 3.0734C12.8907 3.11079 12.8534 3.14818 12.8149 3.1867C12.7942 3.20741 12.7735 3.22812 12.7522 3.24945C12.6822 3.31945 12.6124 3.3896 12.5426 3.45974C12.4927 3.50973 12.4427 3.55972 12.3928 3.60969C12.285 3.71767 12.1772 3.82571 12.0694 3.9338C11.8989 4.10487 11.7283 4.27579 11.5576 4.44668C11.164 4.84073 10.7707 5.23498 10.3773 5.62924C10.0177 5.98972 9.65802 6.35016 9.29817 6.71043C9.12869 6.88011 8.95932 7.0499 8.79002 7.21976C8.68425 7.32584 8.5784 7.43183 8.47252 7.5378C8.42368 7.58672 8.37487 7.63568 8.3261 7.68467C8.02723 7.9849 7.72688 8.2775 7.39127 8.53702C6.57469 9.16847 6.03411 9.74496 5.87937 10.7942C5.81721 11.3003 5.76714 11.8107 5.76714 12.3211C6.20997 12.2966 6.64632 12.2373 7.085 12.1742C7.20453 12.157 7.32412 12.1404 7.44372 12.1237C7.52028 12.1129 7.59683 12.1019 7.67338 12.091C7.70886 12.0861 7.74434 12.0812 7.7809 12.0761C7.81414 12.0713 7.84739 12.0664 7.88165 12.0614C7.91062 12.0573 7.93959 12.0531 7.96944 12.0489C8.2298 11.9919 8.36746 11.8619 8.5497 11.6771C8.57776 11.6492 8.60582 11.6212 8.63473 11.5924C8.72876 11.4986 8.82232 11.4043 8.9159 11.3101C8.98318 11.2428 9.05049 11.1755 9.11782 11.1082C9.30064 10.9254 9.48306 10.7423 9.66542 10.559C9.85603 10.3677 10.047 10.1766 10.2379 9.98555C10.5584 9.66477 10.8786 9.34377 11.1986 9.0226C11.5283 8.69182 11.858 8.36117 12.188 8.03069C12.2083 8.01031 12.2287 7.98994 12.2496 7.96895C12.3517 7.86673 12.4537 7.76452 12.5558 7.6623C13.4023 6.81452 14.2483 5.96629 15.094 5.11776C15.0234 4.96761 14.9403 4.87046 14.8223 4.75266C14.8033 4.73355 14.7843 4.71444 14.7646 4.69475C14.702 4.63191 14.639 4.56938 14.576 4.50686C14.5323 4.46324 14.4887 4.4196 14.445 4.37594C14.3537 4.28468 14.2622 4.19355 14.1707 4.10254C14.053 3.9856 13.9356 3.86839 13.8184 3.75108C13.7283 3.66105 13.6382 3.57114 13.548 3.48126C13.5047 3.43806 13.4613 3.39482 13.4181 3.35157C13.3578 3.29135 13.2973 3.23129 13.2368 3.17123C13.2024 3.13697 13.168 3.10271 13.1325 3.0674C13.0307 2.96849 13.0307 2.96849 12.928 3.0734Z",fill:"currentColor"})]})},10362:function(e,t,n){"use strict";n.d(t,{F:function(){return HistoryIcon}});var r=n(85893),i=n(52494);n(67294);let HistoryIcon=e=>(0,r.jsxs)(i.JO,{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",...e,xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M10.812 0.0502014L11.1636 0.0570374C11.9777 0.0875102 12.7556 0.217348 13.5474 0.456451C13.596 0.471059 13.5962 0.471774 13.646 0.486725L13.8843 0.563873C15.0711 0.969319 16.1599 1.64272 17.0757 2.49551L17.2388 2.63614L17.2397 2.63712C17.4955 2.86121 17.716 3.10036 17.9282 3.36465C17.9861 3.43647 18.0445 3.5082 18.104 3.57852C18.5249 4.07743 18.8535 4.62736 19.1548 5.20059C19.1683 5.22595 19.1818 5.25161 19.1958 5.27774L19.353 5.59512C19.702 6.34699 19.9305 7.17862 20.0571 7.98575L20.0786 8.12247V8.12344C20.1415 8.56645 20.1508 9.00478 20.1499 9.44864C20.1499 9.50506 20.1499 9.50554 20.1499 9.5629C20.1475 10.5065 20.0169 11.3934 19.7437 12.2982C19.7339 12.3307 19.7234 12.3634 19.7134 12.3969V12.3979C19.3193 13.6772 18.6131 14.8499 17.7036 15.8266L17.7046 15.8275C17.6574 15.8817 17.6107 15.9362 17.564 15.9906H17.563C17.3386 16.2468 17.0993 16.4678 16.8345 16.6801C16.7651 16.736 16.6966 16.7929 16.6294 16.851C15.171 18.1011 13.1054 18.8787 11.1841 18.8949L11.1851 18.8959C11.1478 18.8963 11.1101 18.8975 11.0718 18.8979C8.81706 18.9162 6.69716 18.3929 4.91943 16.9252C4.88634 16.898 4.88601 16.8975 4.85205 16.8695C4.2467 16.3688 3.55333 15.7613 3.19092 15.0365L3.18604 15.0287V15.019C3.16632 14.803 3.15519
114.6007 3.25342 14.3891L3.25635 14.3813L3.26221 14.3754C3.35241 14.2804 3.43223 14.21 3.5249 14.1625C3.61858 14.1146 3.72269 14.0923 3.85791 14.0873H3.85889C3.96508 14.0862 4.04913 14.0983 4.12842 14.1293C4.16776 14.1447 4.20511 14.1649 4.24268 14.1889L4.35889 14.2738L4.36475 14.2777L4.36377 14.2787C4.45085 14.3729 4.52924 14.4722 4.60596 14.5717L4.84326 14.8578C6.05948 16.2531 7.67256 17.1307 9.52295 17.4223L9.6499 17.4428H9.64893C11.7909 17.71 13.9533 17.1069 15.6646 15.8031C15.8003 15.6952 15.9273 15.5776 16.0552 15.4574C16.1379 15.3798 16.2226 15.307 16.3091 15.2348C17.791 13.9323 18.5914 11.8884 18.7329 9.94962C18.8632 7.71697 18.0435 5.6375 16.5688 3.97891C15.2562 2.52986 13.3969 1.69769 11.4692 1.49356L11.0835 1.46133C9.03009 1.36242 6.96279 2.08691 5.43311 3.46036C5.40341 3.48802 5.37385 3.51585 5.34326 3.54434C5.26348 3.6185 5.18065 3.6878 5.09814 3.75723C4.59983 4.1937 4.20577 4.75844 3.86279 5.32852C3.84705 5.35466 3.83116 5.3807 3.81494 5.40762C3.36847 6.15815 3.01056 7.01094 2.87939 7.87833C3.05236 7.69609 3.22203 7.54469 3.50342 7.51505L3.51025 7.51407L3.5083 7.56192L3.51025 7.51505C3.64086 7.52089 3.75068 7.54611 3.85107 7.59415C3.90122 7.61816 3.94884 7.64716 3.99463 7.68204L4.12939 7.80313L4.13623 7.80997L4.09326 7.83731L4.13525 7.81094C4.22367 7.95071 4.23386 8.06859 4.23584 8.2211C4.23694 8.26033 4.23861 8.29983 4.23975 8.34024V8.34903L4.18896 8.34219L4.23877 8.34903C4.21368 8.51618 4.12346 8.65594 4.01709 8.77774C3.91232 8.89771 3.78287 9.00853 3.68213 9.1088L3.68311 9.10977C3.64739 9.14556 3.6115 9.1813 3.57471 9.21817C3.49925 9.29374 3.42285 9.36942 3.34717 9.44473L2.78076 10.0111L2.67627 10.1166C2.64401 10.1486 2.61087 10.1803 2.57764 10.2133L2.57861 10.2143C2.55038 10.2424 2.52176 10.2702 2.49268 10.2992L2.48975 10.3012C2.39056 10.3881 2.29588 10.4343 2.19287 10.4565C2.09186 10.4781 1.98454 10.4761 1.86475 10.4731H1.86084C1.77703 10.4646 1.71309 10.4504 1.65381 10.4213C1.59481 10.3923 1.54373 10.3499 1.48389 10.2914L1.47998 10.2875L1.51904 10.2563L1.47998 10.2865C1.19205 9.92328 0.945198 9.52621 0.693848 9.14297C0.621015 9.03194 0.548137 8.92092 0.475098 8.80997C0.428641 8.7393 0.381887 8.66776 0.335449 8.59708C0.302847 8.5475 0.302425 8.54725 0.269043 8.49649C0.249012 8.46593 0.229133 8.4352 0.208496 8.40372C0.182079 8.36346 0.181648 8.3636 0.154785 8.32266L0.153809 8.32169V8.32071C0.0236442 8.11451 0.044867 7.89316 0.0649414 7.67715L0.065918 7.66837L0.0698242 7.66055C0.164499 7.45667 0.289241 7.34948 0.481934 7.24747L0.490723 7.24258L0.505371 7.29141L0.491699 7.24356C0.673483 7.19216 0.832946 7.19862 0.992676 7.2543L1.15283 7.32559L1.16357 7.33145L1.1626 7.33243C1.2552 7.4176 1.32689 7.51184 1.39893 7.60782L1.44971 7.6586C1.78261 6.14427 2.38416 4.71232 3.39209 3.51505L3.44873 3.44669C3.84687 2.96525 4.26923 2.52915 4.76416 2.14297L4.82178 2.09708C4.8411 2.08157 4.86061 2.06508 4.88037 2.04922C6.01687 1.14528 7.35285 0.532204 8.771 0.231842C8.80741 0.224117 8.84384 0.216362 8.88135 0.208405H8.88232C9.49009 0.0860466 10.0818 0.0488924 10.6978 0.0502014H10.812Z",fill:"currentColor",stroke:"currentColor","stroke-width":"0.1"}),(0,r.jsx)("path",{d:"M10.6523 3.49727L10.6602 3.49825L10.667 3.50215C10.8328 3.57912 10.9655 3.68522 11.0498 3.8459L11.083 3.91817L11.0869 3.93086H11.0859C11.1092 4.11322 11.1055 4.29425 11.1035 4.47285C11.1035 4.52718 11.1034 4.58162 11.1035 4.63594C11.1036 4.78381 11.1027 4.93161 11.1016 5.0793C11.1006 5.23375 11.1008 5.3885 11.1006 5.54317C11.1001 5.83582 11.0992 6.1285 11.0977 6.4211C11.0959 6.75407 11.0945 7.08706 11.0938 7.42012C11.0921 8.09452 11.0893 8.76918 11.0859 9.44356L11.1318 9.467C11.2208 9.51236 11.297 9.56376 11.375 9.62129H11.374C11.4032 9.64279 11.4328 9.66457 11.4629 9.68672H11.4639C11.5107 9.72151 11.5108 9.72151 11.5586 9.75703C11.5914 9.78132 11.6244 9.80623 11.6582 9.83125C11.9093 10.0178 12.1566 10.2088 12.4023 10.4016C12.6104 10.5642 12.8216 10.7221 13.0352 10.8781C13.3151 11.0828 13.5906 11.293 13.8633 11.507L14.374 11.8928C14.472 11.9668 14.5474 12.0234 14.6045 12.0705C14.6614 12.1175 14.7035 12.1573 14.7344 12.1984C14.7978 12.2832 14.8093 12.3685 14.8301 12.508L14.8311 12.5129C14.8439 12.765 14.7665 12.9296 14.623 13.1252L14.6191 13.1311L14.6133 13.1359C14.4476 13.2594 14.2849 13.311 14.0781 13.3088H14.0684V13.3078C13.8537 13.2637 13.6881 13.1761 13.5283 13.0598L13.3691 12.9348C13.3076 12.8853 13.2463 12.8356 13.1846 12.7863L13.0889 12.7102C12.94 12.5926 12.7871 12.4807 12.6328 12.3684C12.3677 12.1745 12.1054 11.9771 11.8447 11.7775C11.5869 11.5802 11.3273 11.3854 11.
10654 11.1936C10.9745 11.1266 10.8829 11.0594 10.792 10.9924C10.723 10.9416 10.6541 10.8907 10.585 10.84C10.4716 10.7568 10.3587 10.672 10.2461 10.5881C10.211 10.5625 10.1758 10.5373 10.1396 10.5109H10.1387C10.1061 10.4865 10.0736 10.4619 10.04 10.4367C10.0111 10.4153 9.98198 10.3934 9.95215 10.3713L9.94629 10.3674L9.98145 10.3313L9.94629 10.3664C9.81071 10.2334 9.74612 10.0912 9.72363 9.9045L9.72266 9.89864H9.72363C9.72354 9.85448 9.72275 9.81033 9.72266 9.76485C9.72227 9.71367 9.72208 9.6623 9.72168 9.60957V9.6086C9.72184 9.55261 9.72247 9.49662 9.72266 9.44063C9.72243 9.38106 9.722 9.32148 9.72168 9.26192C9.72098 9.10043 9.72048 8.93891 9.7207 8.77754V7.41719C9.72115 7.0891 9.72077 6.76096 9.71973 6.43282C9.71886 6.15072 9.71852 5.86822 9.71875 5.58614C9.71888 5.41813 9.71844 5.25017 9.71777 5.08223V4.43282C9.71726 4.35323 9.71816 4.2737 9.71875 4.19453V4.05196L9.73535 3.97676C9.78106 3.80797 9.88165 3.69337 10.0068 3.57442L10.0127 3.56856L10.0205 3.56465C10.181 3.49019 10.3314 3.47316 10.4902 3.48164L10.6523 3.49727Z",fill:"currentColor",stroke:"currentColor","stroke-width":"0.1"})]})},20756:function(e,t,n){"use strict";n.d(t,{c:function(){return CsvImportConfiguration}});var r=n(85893),i=n(48641),a=n(57026),o=n(47741);n(67294);let CsvImportConfiguration=e=>{let t=e.foreignKeyConfig,n=void 0!==t?(0,r.jsxs)(i.Kq,{children:[(0,r.jsx)(i.xv,{textStyle:"compactStrong",children:"Choose Match Field"}),(0,r.jsx)(a.Ph,{w:280,mt:"2",mb:"6",value:t.foreignKey,onChange:e=>{t.onForeignKeyChange(e.target.value)},children:t.foreignKeyOptions.map(e=>{let{label:t,value:n}=e;return(0,r.jsx)("option",{value:n,children:t},n)})})]}):null,s=e.importTypeOptions.map(t=>(0,r.jsx)(o.zx,{isActive:e.importType===t.value,onClick:()=>e.onImportTypeChange(t.value),variant:e.importType===t.value?"solid":"outline",colorScheme:e.importType===t.value?"primary":"gray",children:t.label},t.value));return(0,r.jsxs)(i.Kq,{spacing:"4",children:[!e.hideImportType&&(0,r.jsxs)(i.Kq,{children:[(0,r.jsx)(i.xv,{textStyle:"compactStrong",children:"Operation"}),(0,r.jsx)(o.hE,{isAttached:!0,children:s})]}),n]})}},53046:function(e,t,n){"use strict";n.d(t,{k:function(){return CsvImportModalFrameImportContent}});var r=n(85893),i=n(48641);n(67294);var a=n(32512),o=n(35610),s=n(47741),l=n(6491),d=n(96255);let CsvFileDropTextContent=e=>{switch(!0){case e.showLoader:return(0,r.jsx)(i.kC,{justifyContent:"center",p:"4",children:(0,r.jsx)(o.$,{color:"primary.500"})});case!!e.uploadedFileName:return(0,r.jsxs)(i.kC,{align:"center",bg:"white",p:"4",borderRadius:"base",border:"1px",borderColor:"gray.100",m:"2",w:"full",onClick:e=>{e.stopPropagation()},children:[(0,r.jsx)(d.a,{boxSize:8,color:"gray.600"}),(0,r.jsx)(i.xv,{pl:"4",fontWeight:"semibold",color:"gray.600",children:e.uploadedFileName}),(0,r.jsx)(i.LZ,{}),(0,r.jsx)(s.hU,{"aria-label":"Remove uploaded file",icon:(0,r.jsx)(l.b0D,{}),variant:"ghost",colorScheme:"gray",onClick:e.onRemoveFile})]});case e.isDragActive:return(0,r.jsx)(i.X6,{as:"h4",size:"md",children:"Drop the File Here ..."});default:return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.X6,{as:"h4",size:"md",color:"gray.500",children:"Drag and Drop a File"}),(0,r.jsx)(i.xv,{color:"gray.500",my:"2",children:"Or"}),(0,r.jsx)(s.zx,{variant:"outline",colorScheme:"gray",children:"Upload CSV File"})]})}},CsvFileDrop=e=>{var t;let{getRootProps:n,getInputProps:o,isDragActive:s}=(0,a.u)({onDrop:t=>{let n=t&&t.length>0&&t[0];if(!n){e.onFileChange(null);return}e.onFileChange(n)},accept:".csv"}),{ref:l,...d}=n();return(0,r.jsxs)(i.kC,{h:"3xs",align:"center",direction:"column",justify:e.file?"flex-start":"center",bg:"gray.100",borderRadius:"xl",p:"2",...d,children:[(0,r.jsx)(CsvFileDropTextContent,{showLoader:e.hasLoadingSideEffect,isDragActive:s,uploadedFileName:null==e?void 0:null===(t=e.file)||void 0===t?void 0:t.name,onRemoveFile:e.onRemoveFile}),(0,r.jsx)("input",{...o({multiple:!1})})]})};var c=n(20756),u=n(64738);let CsvImportModalFrameImportContent=e=>(0,r.jsxs)(i.Kq,{spacing:"6",children:[e.validationErrors&&(0,r.jsx)(u.q,{validationErrors:e.validationErrors}),!!e.importConfig&&(0,r.jsx)(i.xu,{children:(0,r.jsx)(c.c,{...e.importConfig})}),(0,r.jsxs)(i.Kq,{children:[(0,r.jsx)(CsvFileDrop,{file:e.file,onFileChange:e.onFileChange,hasLoadingSideEffect:e.hasLoadingSideEffect,onRemoveFile:e.onRemoveFile}),e.note&&(0,r.jsx)(i.xv,{textStyle:"compact",color:"gray.600",children:e.note})]})]})},15302:function(e,t,n){"use strict";n.d(t,{R:function(){return CsvImportTemplate}});var r=n(85893);n(67294);var i=n(83461);function CsvImportTemplate(e){if(0===e.rows.length)return null;let t=Object.keys(e.rows[0]).map(e=>({label:e,key:e}));return(0,r.jsx)(i.CSVLink,{uFEFF:!1,headers:t,data:e.rows,filename:e.filename,className:e.className,children:e.children})}},64738:function(e,t,n){"use strict";n.d(t,{q:function(){return ValidationErrors}});var r=n(85893),i=n(48641),a=n(3038);n(67294);let ValidationErrors=e=>{let{validationErrors:t}=e,n=t.errors;return(0,r.jsxs)(a.bZ,{status:"error",children:[(0,r.jsx)(a.zM,{}),(0,r.jsxs)(i.kC,{direction:"column",ml:"2",children:[(0,r.jsx)(a.Cd,{children:"There ".concat(n.length>1?"are ".concat(n.length," errors"):"is 1 error")}),(0,r.jsx)(i.QI,{children:n.map(e=>(0,r.jsx)(i.HC,{children:e},e))})]})]})}},96255:function(e,t,n){"use strict";n.d(t,{a:function(){return FileIcon}});var r=n(85893),i=n(52494);n(67294);let FileIcon=e=>(0,r.jsx)(i.JO,{"aria-label":"file icon",role:"img",viewBox:"0 0 25 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,r.jsx)("path",{d:"M23.948 6.1238L18.7052 0.881078C18.1429 0.318688 17.3805 0 16.5869 0H3.83315C2.17723 0.00624878 0.83374 1.34974 0.83374 3.00566V29.0006C0.83374 30.6565 2.17723 32 3.83315 32H21.8296C23.4856 32 24.8291 30.6565 24.8291 29.0006V8.24839C24.8291 7.45479 24.5104 6.68619 23.948 6.1238ZM21.5859 8.00469H16.8306V3.24937L21.5859 8.00469ZM3.83315 29.0006V3.00566H13.8312V9.50439C13.8312 10.3355 14.4998 11.0041 15.3309 11.0041H21.8296V29.0006H3.83315ZM17.0806 14.0035H15.2809C15.006 14.0035 14.756 14.1535 14.6248 14.3972C13.5 16.4655 13.2376 17.0467 12.8376 18.0027C11.9691 16.1843 12.4065 16.9217 11.0505 14.3972C10.9193 14.1535 10.6631 14.0035 10.3881 14.0035H8.58223C8.00109 14.0035 7.64491 14.6284 7.93235 15.1283L10.8255 20.0023L7.93235 24.8764C7.63866 25.3763 8.00109 26.0012 8.58223 26.0012H10.3881C10.6631 26.0012 10.913 25.8512 11.0442 25.6075C12.4002 23.108 12.4815 22.7955 12.8314 22.002C13.7625 23.8891 13.2001 22.9955 14.6185 25.
16075C14.7498 25.8512 15.006 26.0012 15.2809 26.0012H17.0806C17.6617 26.0012 18.0179 25.3763 17.7304 24.8764L14.831 20.0023C14.8747 19.9336 16.7244 16.8467 17.7242 15.1283C18.0179 14.6284 17.6555 14.0035 17.0806 14.0035Z",fill:"currentColor"})})},87988:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Q}});var r,i,a=n(82729),o=n(85893),s=n(50456),l=n(73359),d=n(50319),c=n(80419),u=n(90195),p=n(48641),C=n(47741),h=n(20979),v=n(36696),x=n(99052),m=n(57174),g=n(35610),f=n(2821),j=n(83234),S=n(68185),y=n(30381),w=n.n(y),b=n(67294),D=n(29093);async function fetchSponsorContracts(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{tenantId:t,search:n,limit:r,offset:i,userId:a}=e,o=await D.Z.get("/api/v1/sponsor/get-sponsor-contracts",{headers:{"x-tenant-id":t,...a?{"x-user-id":a}:{}},params:{search:n,sort:"asc",limit:r,offset:i}});return o.data}async function manageSponsorContract(e){let{tenantId:t,userId:n,...r}=e,i=await D.Z.post("/api/v1/sponsor/manage-sponsor-contract",{...r},{headers:{"x-tenant-id":t,"x-user-id":n}});return i.data}async function manageBulkSponsorContract(e){let{tenantId:t,userId:n,sponsorContracts:r}=e,i=await D.Z.post("/api/v1/sponsor/manage-bulk-sponsor-contract",{sponsorContracts:r},{headers:{"x-tenant-id":t,"x-user-id":n}});return i.data}async function fetchSponsorContractHistory(e){let{companyId:t,tenantId:n,search:r,limit:i,offset:a,userId:o}=e,s=await D.Z.get("/api/v1/sponsor/get-sponsor-contract-history",{headers:{"x-tenant-id":n,...o?{"x-user-id":o}:{}},params:{companyId:t,search:r,sort:"asc",limit:i,offset:a}});return s.data}var T=n(29173),I=n(85200),M=n(61437),z=n(76722),O=n(9162),E=n(82475),L=n(32683),k=n(5146),_=n(45893),A=n(45070),N=n(52670),P=n(95126),R=n(10362),F=n(6491),H=n(96317),Y=n(93340),B=n(49517),U=n(53046),Z=n(15302);(r=i||(i={})).SPONSORSHIP_NAME="Sponsorship Name",r.SPONSORSHIP_TIER="Sponsorship Tier",r.START_DATE="Start Date",r.END_DATE="End Date";let V=["Sponsorship Name","Sponsorship Tier","Start Date","End Date"],q={filename:"sponsor-contracts-template.csv",rows:[{"Sponsorship Name":"Acme Corporation","Sponsorship Tier":"Platinum","Start Date":"01/01/2025","End Date":"12/31/2025"},{"Sponsorship Name":"Tradewing Angels","Sponsorship Tier":"Gold","Start Date":"03/15/2025","End Date":"03/15/2026"}]},getSponsorUploadTemplate=()=>q;function _templateObject(){let e=(0,a._)(["\n query SponsorList_OrganizationsByName($name: [String!]!) {\n organizationsByName(input: { name: $name }) {\n results {\n _id\n name\n isSponsor\n }\n }\n }\n"]);return _templateObject=function(){return e},e}function _templateObject1(){let e=(0,a._)(["\n mutation SponsorList_LinkV2BulkSponsorTierToOrganization(\n $input: [LinkV2SponsorTierToOrganizationInput!]!\n ) {\n linkV2BulkSponsorTierToOrganization(input: $input) {\n success\n }\n }\n"]);return _templateObject1=function(){return e},e}let G=(0,s.Ps)(_templateObject()),$=(0,s.Ps)(_templateObject1()),X=/^\d{1,2}\/\d{1,2}\/\d{4}$/,parseCsvDate=e=>{let t=e.split("/");if(3!==t.length)return null;let[n,r,i]=t.map(e=>Number(e));if(!n||!r||!i)return null;let a=new Date(i,n-1,r);return a.getFullYear()!==i||a.getMonth()!==n-1||a.getDate()!==r?null:a},SponsorContractsCsvImportModal=e=>{var t,n,r,a;let{open:s,onClose:u,onImportSuccess:h}=e,v=(0,c.pm)(),[x,m]=b.useState(null),[g,j]=b.useState(null),[S,y]=b.useState([]),[w,D]=b.useState([]),[I,M]=b.useState(!1),[z,O]=b.useState(!1),E=(0,_.x)(),[L]=(0,d.D)($),k=null==E?void 0:null===(t=E.tenant)||void 0===t?void 0:t._id,A=null==E?void 0:null===(n=E.user)||void 0===n?void 0:n._id,[N]=(0,l.t)(G,{fetchPolicy:"network-only"}),P=b.useCallback(e=>{let t=[],n="",r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=e[i+1];'"'===a?r&&'"'===o?(n+='"',i++):r=!r:","!==a||r?n+=a:(t.push(n.trim()),n="")}return t.push(n.trim()),t},[]),R=b.useCallback(e=>{let t=V.map(e=>(0,Y.T)(e)),n=t.filter(t=>!e.includes(t));if(n.length>0){let e=n.map(e=>{let n=V[t.indexOf(e)];return"Missing required field: ".concat(n)});return{errors:e}}let r={sponsorshipName:e.indexOf((0,Y.T)(i.SPONSORSHIP_NAME)),sponsorshipTier:e.indexOf((0,Y.T)(i.SPONSORSHIP_TIER)),startDate:e.indexOf((0,Y.T)(i.START_DATE)),endDate:e.indexOf((0,Y.T)(i.END_DATE))};return r},[]),F=b.useCallback(async(e,t)=>{M(!0);let n=await e.text(),r=n.split(/\r?\n/).map(e=>e.trim()).filter(e=>e.length>0);if(r.length<=1)return j({errors:["CSV file must contain at least one data row."]}),!1;let i=r.slice(1),a=[],o=[],failValidation=e=>(M(!1),j({errors:e}),m(null),y([]),!1);
1i.forEach((e,n)=>{var r,i,s,l;let d=P(e),c=n+2,u=null!==(r=d[t.sponsorshipName])&&void 0!==r?r:"",p=null!==(i=d[t.sponsorshipTier])&&void 0!==i?i:"",C=null!==(s=d[t.startDate])&&void 0!==s?s:"",h=null!==(l=d[t.endDate])&&void 0!==l?l:"";u||a.push("Row ".concat(c,": Sponsorship Name is required.")),p||a.push("Row ".concat(c,": Sponsorship Tier is required.")),X.test(C)||a.push("Row ".concat(c,": Start Date must be in MM/DD/YYYY format.")),X.test(h)||a.push("Row ".concat(c,": End Date must be in MM/DD/YYYY format."));let v=parseCsvDate(C),x=parseCsvDate(h);if(v&&x){let e=new Date;(x.getTime()<v.getTime()||x.getTime()<e.getTime())&&a.push("Row ".concat(c,": Please select a valid date range for ").concat(u||"this sponsor","."))}o.push({sponsorshipName:u,sponsorshipTier:p,startDate:C,endDate:h,startDateObj:v,endDateObj:x})});let s=[...a],l=[...new Set(o.map(e=>e.sponsorshipName))],d=[...new Set(o.map(e=>e.sponsorshipTier))];if(!l.length)return M(!1),!1;y([]);try{var c,u,p;let t=await N({variables:{name:l}}),n=null!==(u=null===(c=t.data)||void 0===c?void 0:c.organizationsByName.results)&&void 0!==u?u:[],r=new Set(n.filter(e=>!e.isSponsor).map(e=>e.name)),i=new Map(n.filter(e=>e.isSponsor).map(e=>[e.name,e._id])),a=l.filter(e=>!i.has(e)),C=a.filter(e=>!r.has(e)),h=a.filter(e=>r.has(e));C.length&&s.push("These are the invalid sponsor names: ".concat(C.join(", "))),h.length&&s.push("These organizations are not sponsors: ".concat(h.join(", ")));let v=o.map(e=>{var t;return{...e,organizationId:null!==(t=i.get(e.sponsorshipName))&&void 0!==t?t:null}});if(!v.length)return s.push("Sponsor lookup returned no matches."),failValidation(s);let x=v;if(d.length){if(!k)return j({errors:["Unable to verify sponsor tiers (tenant missing)."]}),m(null),y([]),M(!1),!1;try{let e=await (0,T.J2)({tenantId:k,name:d.join(",")}),t=null!==(p=e.data)&&void 0!==p?p:[],n=new Map(t.filter(e=>e.name).map(e=>[e.name.toLowerCase(),e.id])),r=d.filter(e=>!n.has(e.toLowerCase()));r.length&&s.push("These are the invalid sponsor tiers: ".concat(r.join(", "))),x=v.map(e=>{var t;return{...e,sponsorTierId:null!==(t=n.get(e.sponsorshipTier.toLowerCase()))&&void 0!==t?t:null}})}catch(e){return console.error("Failed to fetch sponsor tiers",e),j({errors:["Failed to verify sponsor tiers. Please try again."]}),m(null),y([]),M(!1),!1}}if(s.length)return failValidation(s);let g=x.filter(e=>e.organizationId&&e.sponsorTierId).map(e=>{var t,n;return{organizationId:e.organizationId,sponsorTierId:e.sponsorTierId,startDate:new Date(e.startDate),endDate:e.endDate?new Date(e.endDate):void 0,createdBy:null!==(n=null==E?void 0:null===(t=E.user)||void 0===t?void 0:t._id)&&void 0!==n?n:void 0}});return j(null),m(e),y(x),D(g),M(!1),!0}catch(e){return console.error("Failed to fetch organizations by names",e),j({errors:["Failed to verify sponsor names. Please try again."]}),m(null),y([]),M(!1),!1}},[P,N,k,null==E?void 0:null===(r=E.user)||void 0===r?void 0:r._id]),H=b.useCallback(async e=>{let t=e.stream().getReader(),n=new TextDecoder("utf-8"),{value:r}=await t.read();if(!r)return j({errors:["CSV file is empty or unreadable."]}),!1;let i=n.decode(r,{stream:!0}).split("\n")[0],a=i.split(",").map(e=>(0,Y.T)(e)),o=R(a);return!!o&&("errors"in o?(m(null),j(o),!1):F(e,o))},[R,F]),q=b.useCallback(async e=>{if(j(null),m(null),y([]),e)try{await H(e)}catch(e){(0,B.H)(e),M(!1),v({title:"Validation failed",description:e instanceof Error?e.message:"Failed to validate CSV file",status:"error"})}},[H,v]),K=b.useCallback(e=>{e.stopPropagation(),j(null),m(null),y([])},[]),W=b.useCallback(()=>{j(null),m(null),y([]),u()},[u]),J=b.useCallback(async()=>{if(!w.length){v({title:"No valid data",description:"Upload a valid CSV file before starting the import.",status:"error"});return}if(!k||!A){v({title:"Missing context",description:"Tenant or user information is unavailable.",status:"error"});return}O(!0);try{let e=new Map;w.forEach(t=>{t.organizationId&&e.set(t.organizationId,t)});let t=Array.from(e.values());await manageBulkSponsorContract({tenantId:k,userId:A,sponsorContracts:t}),v({title:"Import queued",description:"Submitted ".concat(t.length," sponsor contracts."),status:"success",duration:2e3,isClosable:!0});let n=t.filter(e=>!!(e.organizationId&&e.sponsorTierId)).map(e=>{var t,n;return{organizationId:e.organizationId,sponsorTierId:e.sponsorTierId,disabled:null!==(t=e.disabled)&&void 0!==t&&t,tierStartDate:e.startDate.toISOString(),tierEndDate:(null!==(n=e.endDate)&&void 0!==n?n:e.startDate).toISOString()}});if(n.length)try{await L({variables:{input:n}})}catch(e){(0,B.H)(e),v({title:"Failed to link sponsor tiers",description:e instanceof Error?e.message:"Unable to link sponsor tiers",status:"error"})}await h(),W()}catch(e){(0,B.H)(e),v({title:"Import failed",description:e instanceof Error?e.message:"Failed to import sponsor contracts.",status:"error"})}finally{O(!1)}},[W,L,h,w,k,v,A]),Q=I||z,ee=!!(null==g?void 0:null===(a=g.errors)||void 0===a?void 0:a.length)||!x||0===S.length||I||z,et=getSponsorUploadTemplate();return(0,o.jsxs)(f.u_,{isOpen:s,onClose:W,size:"xl",closeOnOverlayClick:!1,children:[(0,o.jsx)(f.ZA,{}),(0,o.jsxs)(f.hz,{children:[(0,o.jsx)(f.xB,{as:"h3",py:"4",px:"6",children:"Bulk Import Sponsor Contracts"}),(0,o.jsx)(p.iz,{}),(0,o.jsx)(f.ol,{}),(0,o.jsx)(f.fe,{p:"6",children:(0,o.jsx)(U.k,{validationErrors:g,file:x,onFileChange:q,onRemoveFile:K,hasLoadingSideEffect:Q,note:"Dates must be in MM/DD/YYYY format."})}),(0,o.jsx)(p.iz,{}),(0,o.jsxs)(p.Ug,{justify:"space-between",m:"6",children:[et&&(0,o.jsx)(p.rU,{...et,as:Z.R,children:"Download CSV Template"}),(0,o.jsx)(C.zx,{isLoading:Q,isDisabled:ee,onClick:J,children:"Start Import"})]})]})]})}
1,SponsorBulkImportButton=e=>{let{onImportSuccess:t}=e,{isOpen:n,onOpen:r,onClose:i}=(0,u.qY)();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(C.zx,{variant:"outline",colorScheme:"gray",onClick:r,children:"Bulk Import"}),(0,o.jsx)(SponsorContractsCsvImportModal,{open:n,onClose:i,onImportSuccess:t})]})};function SponsorListPage_templateObject(){let e=(0,a._)(["\n query SponsorList_SponsorOrganizations($organizationIds: [String!]!) {\n sponsorsByIds(input: { organizationIds: $organizationIds }) {\n results {\n _id\n name\n }\n }\n }\n"]);return SponsorListPage_templateObject=function(){return e},e}function SponsorListPage_templateObject1(){let e=(0,a._)(["\n mutation SponsorList_LinkV2SponsorTierToOrganization(\n $input: LinkV2SponsorTierToOrganizationInput!\n ) {\n linkV2SponsorTierToOrganization(input: $input) {\n success\n }\n }\n"]);return SponsorListPage_templateObject1=function(){return e},e}let K=(0,s.Ps)(SponsorListPage_templateObject()),W=(0,s.Ps)(SponsorListPage_templateObject1());function formatSponsorContractDateUtc(e){return w().utc(e).format("MM/DD/YYYY")}var J=n(93064),Q=(0,n(52609).z)(()=>{var e,t,n,r,i,a,s,y;let D=(0,_.x)(),Y=(0,c.pm)(),B=null!==(y=null==D?void 0:null===(e=D.tenant)||void 0===e?void 0:e._id)&&void 0!==y?y:"",U=null==D?void 0:null===(t=D.user)||void 0===t?void 0:t._id,[Z,{data:V,loading:q}]=(0,l.t)(K,{fetchPolicy:"network-only"}),{isOpen:G,onOpen:$,onClose:X}=(0,u.qY)(),{isOpen:J,onOpen:Q,onClose:ee}=(0,u.qY)(),[et,en]=b.useState(""),[er,ei]=b.useState(null),[ea,eo]=b.useState(null),[es,el]=b.useState(!1),closeManageModal=()=>{en(""),ei(null),eo(null),ef(void 0),ek(!1),el(!1),ee()},ed=b.useRef(null),[ec,eu]=b.useState(""),[ep,eC]=b.useState(0),[eh,ev]=b.useState(null),[ex,em]=b.useState(""),[eg,ef]=b.useState(),[ej,eS]=b.useState(null),[ey,ew]=b.useState(null),[eb,eD]=b.useState([]),[eT,eI]=b.useState([]),[eM,ez]=b.useState([]),[eO,eE]=b.useState([]),[eL,ek]=b.useState(!1),[e_,eA]=b.useState(!1),eN=b.useMemo(()=>25*ep,[ep]),eP=ep+1,{isOpen:eR,onOpen:eF,onClose:eH}=(0,u.qY)(),{data:eY,loading:eB,execute:eU}=(0,k.Z)(T.iE),{data:eZ,loading:eV,execute:eq}=(0,k.Z)(fetchSponsorContracts),{data:eG,loading:e$,execute:eX}=(0,k.Z)(manageSponsorContract),{data:eK,loading:eW,execute:eJ}=(0,k.Z)(fetchSponsorContractHistory),[eQ]=(0,d.D)(W),e1=b.useMemo(()=>{var e,t,n,r;let i=null!==(e=null==ej?void 0:ej.getTime())&&void 0!==e?e:null,a=null!==(t=null==er?void 0:er.getTime())&&void 0!==t?t:null,o=null!==(n=null==ey?void 0:ey.getTime())&&void 0!==n?n:null,s=null!==(r=null==ea?void 0:ea.getTime())&&void 0!==r?r:null;return ex!==et||i!==a||o!==s||eL!==es},[ex,et,ej,er,ey,ea,eL,es]);b.useEffect(()=>{B&&(eU({tenantId:B,userId:U}),eC(0),eI([]),eE([]))},[B,U,eU]);let e0=ec.trim();b.useEffect(()=>{B&&eq({tenantId:B,userId:U})},[B,U,eq]),b.useEffect(()=>{var e;let t=null==eZ?void 0:null===(e=eZ.data)||void 0===e?void 0:e.total;if("number"!=typeof t)return;let n=t>0?Math.max(0,Math.ceil(t/25)-1):0;ep>n&&eC(n)},[ep,null==eZ?void 0:null===(n=eZ.data)||void 0===n?void 0:n.total]),b.useEffect(()=>{if((null==eY?void 0:eY.data)&&eY.data.length>0){let e=eY.data.filter(e=>e.visibility).map(e=>({id:e.id,name:e.name}));eD(e)}},[eY]),b.useEffect(()=>{let loadOrganizationsAndMapContracts=async()=>{var e,t,n;let r=null!==(n=null==eZ?void 0:null===(e=eZ.data)||void 0===e?void 0:e.results)&&void 0!==n?n:[];if(!r.length){eI([]),eE([]);return}let i=r.map(e=>e.organizationId),a=[...new Set(i)],o=i.length?await Z({variables:{organizationIds:a}}):null,s=null==o?void 0:null===(t=o.data)||void 0===t?void 0:t.sponsorsByIds.results,l=r.map(e=>{var t,n;return{id:e.id,organizationId:e.organizationId,sponsorTierId:e.sponsorTierId,startDate:formatSponsorContractDateUtc(e.startDate),endDate:formatSponsorContractDateUtc(e.endDate),isActive:e.isActive,disabled:e.disabled,sponsorTierName:null===(t=e.sponsorTier)||void 0===t?void 0:t.name,companyName:null==s?void 0:null===(n=s.find(t=>t._id===e.organizationId))||void 0===n?void 0:n.name}}).filter(e=>!!e.companyName);eI(l);let d=s&&(null==s?void 0:s.length)>0?null==s?void 0:s.map(e=>({id:e._id,name:e.name})):[];eE(d)};loadOrganizationsAndMapContracts()},[null==eZ?void 0:null===(r=eZ.data)||void 0===r?void 0:r.results,Z]),b.useEffect(()=>{let sponsorContractHistory=async()=>{var e;if(!(null==eK?void 0:null===(e=eK.data)||void 0===e?void 0:e.length))return;let t=eK.data.map(e=>({id:e.id,organizationId:e.organizationId,sponsorTierId:e.sponsorTierId,startDate:formatSponsorContractDateUtc(e.startDate),endDate:formatSponsorContractDateUtc(e.endDate),createdAt:w()(e.createdAt).format("MM/DD/YYYY"),disabled:e.disabled,isFutureContract:e.isFutureContract,sponsorTier:e.sponsorTier}));ez(t)};sponsorContractHistory()},[eK]);let e2=b.useCallback(async()=>{B&&await eq({tenantId:B,userId:U})},[B,U,eq]),handleHistory=async e=>{var t;await eJ({tenantId:B,companyId:e,userId:U});let n=null!==(t=eO.find(t=>
1t.id===e))&&void 0!==t?t:null;ev(n),eF()},e3=b.useCallback(async()=>{var e,t,n,r,i,a;if(!B)return;let o=null!==(t=null==eZ?void 0:null===(e=eZ.data)||void 0===e?void 0:e.total)&&void 0!==t?t:0;eA(!0);try{let e=await fetchSponsorContracts({tenantId:B,userId:U,limit:o>0?o:25,offset:0}),t=null!==(i=null===(n=e.data)||void 0===n?void 0:n.results)&&void 0!==i?i:[];if(!t.length){Y({title:"No sponsors to export",status:"info"});return}let s=[...new Set(t.map(e=>e.organizationId).filter(Boolean))],l=s.length?await Z({variables:{organizationIds:s}}):null,d=null!==(a=null==l?void 0:null===(r=l.data)||void 0===r?void 0:r.sponsorsByIds.results)&&void 0!==a?a:[],c=t.map(e=>{var t,n,r,i;return{companyName:null!==(r=null===(t=d.find(t=>t._id===e.organizationId))||void 0===t?void 0:t.name)&&void 0!==r?r:"Unknown company",sponsorTierName:null!==(i=null===(n=e.sponsorTier)||void 0===n?void 0:n.name)&&void 0!==i?i:"",startDate:formatSponsorContractDateUtc(e.startDate),endDate:formatSponsorContractDateUtc(e.endDate)}}).filter(e=>!!e.companyName);if(!c.length){Y({title:"No sponsors to export",status:"info"});return}let u=c.map(e=>[e.companyName,e.sponsorTierName,e.startDate,e.endDate]);await (0,A.exportExcel)({data:u,headers:["Company Name","Sponsor Tier","Start Date","End Date"],filename:"sponsor-contracts.xlsx",sheetName:"Sponsor Contracts"})}catch(e){Y({title:"Failed to export sponsors",description:e.message,status:"error"})}finally{eA(!1)}},[B,U,null==eZ?void 0:null===(i=eZ.data)||void 0===i?void 0:i.total,Z,Y]),handleCloseCreateSponsor=()=>{em(""),eS(null),ew(null),ef(void 0),ek(!1),X()};b.useMemo(()=>w()().startOf("day").toDate(),[]);let handleStartDateChange=e=>{eS(e)},handleOpenManageContract=e=>{var t;let n=null!==(t=e.sponsorTierId)&&void 0!==t?t:"",r=e.startDate?w()(e.startDate,"MM/DD/YYYY").toDate():null,i=e.endDate?w()(e.endDate,"MM/DD/YYYY").toDate():null;em(n),eS(r),en(n),ei(r),ew(i),eo(i);let a=eO.find(t=>t.id===e.organizationId);a?ef({id:a.id,name:a.name,isSponsor:!0}):ef(void 0),ek(!!e.disabled),el(!!e.disabled),Q()},handleSubmitManageContract=async()=>{var e,t,n,r,i,a,o,s,l,d,c,u,p,C;if(!(null==eg?void 0:eg.id)){Y({title:"Please select a company",status:"error",duration:2e3,isClosable:!0});return}if(!ex){Y({title:"Please select a tier",status:"error",duration:2e3,isClosable:!0});return}if(!ej){Y({title:"Please select a start date",status:"error",duration:2e3,isClosable:!0});return}if(!ey){Y({title:"Please select an end date",status:"error",duration:2e3,isClosable:!0});return}let h={tenantId:null!==(c=null===(e=D.tenant)||void 0===e?void 0:e._id)&&void 0!==c?c:"",userId:null!==(u=null===(t=D.user)||void 0===t?void 0:t._id)&&void 0!==u?u:"",organizationId:null!==(p=null==eg?void 0:eg.id)&&void 0!==p?p:"",sponsorTierId:ex,startDate:new Date(Date.UTC(ej.getFullYear(),ej.getMonth(),ej.getDate(),0,0,0,0)),endDate:new Date(Date.UTC(ey.getFullYear(),ey.getMonth(),ey.getDate(),23,59,59,0)),createdBy:null!==(C=null===(n=D.user)||void 0===n?void 0:n._id)&&void 0!==C?C:"",disabled:eL},v=await eX(h);if(!v.status){Y({title:null==v?void 0:v.message,status:"error",duration:2e3,isClosable:!0});return}closeManageModal(),handleCloseCreateSponsor(),Y({title:null==v?void 0:v.message,status:"success",duration:2e3,isClosable:!0});let x=(null===(r=v.data)||void 0===r?void 0:r.organizationId)&&(null===(i=v.data)||void 0===i?void 0:i.id)?{organizationId:null===(a=v.data)||void 0===a?void 0:a.organizationId,sponsorTierId:null===(o=v.data)||void 0===o?void 0:o.id,disabled:!(null===(s=v.data)||void 0===s?void 0:s.disabled),tierStartDate:null===(l=v.data)||void 0===l?void 0:l.startDate,tierEndDate:null===(d=v.data)||void 0===d?void 0:d.endDate}:null;if(x)try{await eQ({variables:{input:x}})}catch(e){Y({title:"Failed to link sponsor tier",description:e.message,status:"error",duration:2e3,isClosable:!0})}await eq({tenantId:B,userId:U})},e9=b.useMemo(()=>{if(!e0)return eT;let e=e0.toLowerCase();return eT.filter(t=>{var n,r;let i=null!==(r=null===(n=t.companyName)||void 0===n?void 0:n.toLowerCase())&&void 0!==r?r:"";return i.includes(e)})},[e0,eT]),e4=e9.length,e8=b.useMemo(()=>{let e=eN+25;return e9.slice(eN,e)},[e9,eN]);return(0,o.jsx)(H.C,{children:(0,o.jsxs)(I.DY,{maxWidth:"full",mx:"auto",children:[(0,o.jsx)(I.yG,{mb:"4",children:(0,o.jsxs)(p.Ug,{w:"full",justifyContent:"space-between",alignItems:"center",children:[(0,o.jsx)(I.lm,{size:"md",children:"Sponsors"}),(0,o.jsxs)(p.Ug,{spacing:"2",children:[(0,o.jsx)(C.hU,{colorScheme:"gray",variant:"outline","aria-label":"download",icon:(0,o.jsx)(F._8t,{}),onClick:e3,isLoading:e_,isDisabled:!B||e_}),(0,o.jsx)(SponsorBulkImportButton,{onImportSuccess:e2}),(0,o.jsx)(C.zx,{onClick:()=>{em("");let e=w()().toDate();eS(e),ew(w()(e).add(1,"year").toDate()),ek(!1),$()},children:"Assign Sponsorship Tier"})]})]})}),(0,o.jsxs)(p.gC,{spacing:"4",children:[(0,o.jsx)(N.Z,{p:"4",w:"full",children:(0,o.jsxs)(h.BZ,{children:[(0,o.jsx)(h.Z8,{pointerEvents:"none",children:(0,o.jsx)(F.W1M,{color:"primary.500"})}),(0,o.jsx)(h.II,{variant:"outline",borderRadius:"6px",placeholder:"Search sponsor...",value:ec,onChange:e=>{eu(e.target.value),eC(0)}})]})}
1),(0,o.jsx)(N.Z,{overflow:"hidden",w:"full",position:"relative",children:(0,o.jsxs)(v.xJ,{position:"relative",minH:q&&!e_?"280px":void 0,children:[(0,o.jsxs)(v.iA,{children:[(0,o.jsx)(v.hr,{children:(0,o.jsxs)(v.Tr,{children:[(0,o.jsx)(v.Th,{children:"Name"}),(0,o.jsx)(v.Th,{children:"Sponsor Tier"}),(0,o.jsx)(v.Th,{children:"Start Date"}),(0,o.jsx)(v.Th,{children:"End Date"}),(0,o.jsx)(v.Th,{width:"80px",children:"Actions"})]})}),(0,o.jsx)(v.p3,{children:e8.map(e=>(0,o.jsxs)(v.Tr,{children:[(0,o.jsx)(v.Td,{children:(0,o.jsx)(p.xv,{as:"p",children:e.companyName})}),(0,o.jsx)(v.Td,{children:(0,o.jsxs)(p.Ug,{spacing:2,children:[(0,o.jsx)(p.xv,{children:e.sponsorTierName}),e.disabled&&(0,o.jsx)(p.Ct,{variant:"solid",colorScheme:"red",children:"Disabled"})]})}),(0,o.jsx)(v.Td,{children:e.startDate}),(0,o.jsx)(v.Td,{children:e.endDate}),(0,o.jsx)(v.Td,{children:(0,o.jsxs)(x.v2,{placement:"bottom-end",children:[(0,o.jsx)(x.j2,{as:C.hU,"aria-label":"Actions",icon:(0,o.jsx)(F.xhG,{}),size:"sm",variant:"ghost",colorScheme:"gray"}),(0,o.jsx)(m.h_,{children:(0,o.jsxs)(x.qy,{children:[(0,o.jsx)(x.sN,{onClick:()=>handleOpenManageContract(e),icon:(0,o.jsx)(P.d,{color:"primary.500",boxSize:4}),children:"Manage contract"}),(0,o.jsx)(x.sN,{onClick:()=>{var t;return handleHistory(null!==(t=e.organizationId)&&void 0!==t?t:"")},icon:(0,o.jsx)(R.F,{color:"primary.500",boxSize:4}),children:"History"})]})})]})})]},e.organizationId))}),!q&&0===e9.length&&(0,o.jsx)(L.fQ,{children:"No sponsors found"})]}),q&&!e_&&(0,o.jsx)(p.M5,{position:"absolute",inset:0,zIndex:2,bg:"whiteAlpha.700",children:(0,o.jsx)(g.$,{size:"xl"})})]})}),(0,o.jsx)(z.t,{currentPage:eP,numberOfPages:e4>0?Math.ceil(e4/25):0,onChange:e=>eC(e-1)})]}),(0,o.jsxs)(f.u_,{isOpen:G,onClose:handleCloseCreateSponsor,size:"4xl",initialFocusRef:ed,closeOnOverlayClick:!1,closeOnEsc:!1,children:[(0,o.jsx)(f.ZA,{}),(0,o.jsxs)(f.hz,{children:[(0,o.jsx)(f.xB,{borderBottom:"1px solid",borderColor:"gray.200",fontSize:24,children:"Assign Sponsorship Tier"}),(0,o.jsx)(f.ol,{px:6,py:6}),(0,o.jsx)(f.fe,{px:6,py:5,children:(0,o.jsxs)(p.gC,{spacing:8,children:[(0,o.jsxs)(p.Ug,{w:"full",spacing:8,children:[(0,o.jsxs)(j.NI,{children:[(0,o.jsx)(j.lX,{fontSize:16,children:"Select Company"}),(0,o.jsx)(O.z,{value:eg,onChange:ef,organizationSearchFilters:{isSponsor:!0}})]}),(0,o.jsxs)(j.NI,{children:[(0,o.jsx)(j.lX,{fontSize:16,children:"Select Tier Type"}),(0,o.jsxs)(x.v2,{children:[(0,o.jsx)(x.j2,{as:E.U,children:(null===(a=eb.find(e=>e.id===ex))||void 0===a?void 0:a.name)||"Select tier"}),(0,o.jsx)(x.qy,{maxH:"320px",overflowY:"auto",children:eb.map(e=>(0,o.jsx)(x.sN,{onClick:()=>em(e.id),children:e.name},e.id))})]})]})]}),(0,o.jsxs)(p.Ug,{w:"full",spacing:8,children:[(0,o.jsxs)(j.NI,{children:[(0,o.jsx)(j.lX,{fontSize:16,children:"Select Start Date"}),(0,o.jsx)(M.Mt,{selected:ej,onChange:e=>{handleStartDateChange(e)},onChangeRaw:e=>e.preventDefault(),placeholderText:"MM/DD/YYYY",customInput:(0,o.jsx)(h.II,{variant:"outline",borderRadius:"6px",placeholder:"Select start date",readOnly:!0}),dateFormat:"MM/dd/yyyy",showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"})]}),(0,o.jsxs)(j.NI,{children:[(0,o.jsx)(j.lX,{fontSize:16,children:"Select End Date"}),(0,o.jsx)(M.Mt,{selected:ey,onChange:e=>ew(e),onChangeRaw:e=>e.preventDefault(),placeholderText:"MM/DD/YYYY",customInput:(0,o.jsx)(h.II,{variant:"outline",borderRadius:"6px",placeholder:"Select end date",readOnly:!0}),dateFormat:"MM/dd/yyyy",showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"})]})]})]})}),(0,o.jsx)(f.mz,{children:(0,o.jsxs)(p.Ug,{spacing:3,children:[(0,o.jsx)(C.zx,{variant:"outline",onClick:handleCloseCreateSponsor,isDisabled:e$,children:"Cancel"}),(0,o.jsx)(C.zx,{colorScheme:"blue",onClick:handleSubmitManageContract,isLoading:e$,isDisabled:e$||!(null==eg?void 0:eg.id)||!ex||!ej||!ey,loadingText:"Creating...",children:"Create"})]})})]})]}),(0,o.jsxs)(f.u_,{isOpen:J,onClose:closeManageModal,size:"3xl",closeOnOverlayClick:!1,closeOnEsc:!1,children:[(0,o.jsx)(f.ZA,{}),(0,o.jsxs)(f.hz,{children:[(0,o.jsx)(f.xB,{borderBottom:"1px solid",borderColor:"gray.200",fontSize:24,children:"Manage Contract"}),(0,o.jsx)(f.ol,{px:6,py:6}),(0,o.jsx)(f.fe,{px:6,py:5,children:(0,o.jsxs)(p.gC,{spacing:5,children:[(0,o.jsxs)(p.Ug,{w:"full",spacing:"4",align:"start",children:[(0,o.jsx)(p.gC,{spacing:"4",align:"stretch",flex:"1",children:(0,o.jsxs)(j.NI,{children:[(0,o.jsx)(j.lX,{fontSize:16,children:"Select Tier Type"}),(0,o.jsxs)(x.v2,{children:[(0,o.jsx)(x.j2,{as:E.U,children:(null===(s=eb.find(e=>e.id===ex))||void 0===s?void 0:s.name)||"Select tier"}),(0,o.jsx)(x.qy,{maxH:"320px",overflowY:"auto",children:eb.map(e=>(0,o.jsx)(x.sN,{onClick:()=>em(e.id),children:e.name},e.id))})]})]})}),(0,o.jsxs)(j.NI,{flex:"1",children:[(0,o.jsx)(j.lX,{fontSize:16,children:"Select Start Date"}),(0,o.jsx)(M.Mt,{selected:ej,onChange:handleStartDateChange,onChangeRaw:e=>e.preventDefault(),placeholderText:"MM/DD/YYYY",customInput:(0,o.jsx)(h.II,{variant:"outline",borderRadius:"6px",placeholder:"Select start date",readOnly:!0}),dateFormat:"MM/dd/yyyy",showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"})]}),(0,o.jsxs)(j.NI,{flex:"1",children:[(0,o.jsx)(j.lX,{fontSize:16,children:"Select End Date"}),(0,o.jsx)(M.Mt,{selected:ey,onChange:e=>ew(e),onChangeRaw:e=>e.preventDefault(),placeholderText:"MM/DD/YYYY",customInput:(0,o.jsx)(h.II,{variant:"outline",borderRadius:"6px",placeholder:"Select end date",readOnly:!0}),dateFormat:"MM/dd/yyyy",showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select"})]})]}),(0,o.jsx)(p.Ug,{w:"full",spacing:"4",align:"start",children:(0,o.jsx)(p.gC,{spacing:"4",align:"stretch",flex:"1",children:(0,o.jsxs)(j.NI,{display:"flex",alignItems:"center",gap:"3",mt:"2",children:[(0,o.jsx)(j.lX,{fontSize:16,mb:"0",children:"Cancel Sponsorship Contract"}),(0,o.jsx)(S.r,{colorScheme:"blue",isChecked:eL,onChange:e=>ek(e.target.checked)})]})})})]})}),(0,o.jsx)(f.mz,{children:(0,o.jsxs)(p.Ug,{spacing:3,children:[(0,o.jsx)(C.zx,{variant:"outline",onClick:closeManageModal,isDisabled:e$,children:"Cancel"}),(0,o.jsx)(C.zx,{colorScheme:"blue",onClick:handleSubmitManageContract,isLoading:e$,isDisabled:e$||!ex||!ej||!ey||!e1,loadingText:"Updating...",children:"Update"})]})})]})]}),(0,o.jsxs)(f.u_,{isOpen:eR,onClose:eH,size:"3xl",closeOnOverlayClick:!1,closeOnEsc:!1,children:[(0,o.jsx)(f.ZA,{}),(0,o.jsxs)(f.hz,{children:[(0,o.jsx)(f.xB,{borderBottom:"1px solid",borderColor:"gray.200",fontSize:24,children:"Contract History"}),(0,o.jsx)(f.ol,{px:6,py:6}),(0,o.jsx)(f.fe,{px:6,py:5,children:(0,o.jsx)(v.xJ,{border:"1px solid",borderColor:"gray.200",borderRadius:"md",overflow:"hidden",maxH:eM.length>10?"55vh":void 0,overflowY:eM.length>10?"auto":void 0,children:(0,o.jsxs)(v.iA,{size:"sm",children:[(0,o.jsx)(v.hr,{children:(0,o.jsxs)(v.Tr,{children:[(0,o.jsx)(v.Th,{children:"Sponsorship Tier"}),(0,o.jsx)(v.Th,{children:"Start Date"}),(0,o.jsx)(v.Th,{children:"End Date"}),(0,o.jsx)(v.Th,{children:"Created At"})]})}),(0,o.jsx)(v.p3,{children:eM.map(e=>{var t;return(0,o.jsxs)(v.Tr,{children:[(0,o.jsx)(v.Td,{children:null===(t=e.sponsorTier)||void 0===t?void 0:t.name}),(0,o.jsx)(v.Td,{children:e.startDate}),(0,o.jsx)(v.Td,{children:e.endDate}),(0,o.jsx)(v.Td,{children:e.createdAt})]},e.id)})})]})})})]})]})]})})},{requiresEvery:[J.lj.ADMIN_ROLE]})},52609:function(e,t,n){"use strict";n.d(t,{z:function(){return restrictedRoute}});var r=n(85893),i=n(11163),a=n(67294),o=n(39174),s=n(63205),l=n(62893),d=n(69171),c=n(47503),u=n(45893),p=n(93064);let C=new Map([[p.lj.AUTHENTICATION,e=>{var t;return!!(null===(t=e.user)||void 0===t?void 0:t._id)}],[p.lj.ADMIN_ROLE,e=>{var t,n;return(null===(t=e.user)||void 0===t?void 0:t.role)===c.uA.ADMIN||(null===(n=e.user)||void 0===n?void 0:n.role)===c.uA.MORGOTH}],[p.lj.MORGOTH_ROLE,e=>{var t;return(null===(t=e.user)||void 0===t?void 0:t.role)===c.uA.MORGOTH}],[p.lj.COMMUNITY_ACCESS,e=>{var t;return(null==e?void 0:null===(t=e.tenant)||void 0===t?void 0:t.communityAccessConfig)===c.iX.PUBLIC?!e.user||e.user.canAccessCommunity:!!e.user&&e.user.canAccessCommunity}],[p.lj.COMMUNITY_READ_ONLY_ACCESS,e=>{var t;return!!(null===(t=e.user)||void 0===t?void 0:t.canAccessCommunityReadOnly)}],[p.lj.SPONSOR_DASHBOARD_ACCESS,e=>{var t,n;return!!(null===(n=e.user)||void 0===n?void 0:null===(t=n.rosterOrganization)||void 0===t?void 0:t.currentUserOrganizationPermission.canManageOrganizationSponsorship)}],[p.lj.SPONSOR_DIRECTORY_ACCESS,e=>{var t,n,r;switch(null===(t=e.tenant)||void 0===t?void 0:t.sponsorDirectoryAccessConfig){case c.pZ.PUBLIC:return!0;case c.pZ.LOGGED_IN_USERS:return!!(null===(n=e.user)||void 0===n?void 0:n._id);case c.pZ.HIDDEN:return!1;default:throw Error("unknown sponsorDirectoryAccessConfig: ".concat(null===(r=e.tenant)||void 0===r?void 0:r.sponsorDirectoryAccessConfig))}}],[p.lj.MEMBER_DIRECTORY_ACCESS,e=>{var t;return!!(null===(t=e.tenant)||void 0===t?void 0:t.currentUserPermissions.canAccessMemberDirectory)}],[p.lj.EVENTS_FEED_ACCESS,e=>{var t;return!!(null===(t=e.tenant)||void 0===t?void 0:t.currentUserPermissions.canAccessEventsFeed)}],[p.lj.ORGANIZATION_DASHBOARD_ACCESS,e=>{var t,n;return!!(null===(n=e.user)||void 0===n?void 0:null===(t=n.rosterOrganization)||void 0===t?void 0:t.currentUserOrganizationPermission.canManageOrganizationProfile)}],[p.lj.DM_PAGE_ACCESS,e=>{var t;return!!(null===(t=e.user)||void 0===t?void 0:t.canAccessDMPage)}],[p.lj.ORGANIZATION_MEMBERSHIP_ACCESS,e=>{var t,n;return!!(null===(n=e.user)||void 0===n?void 0:null===(t=n.rosterOrganization)||void 0===t?void 0:t.currentUserOrganizationPermission.canManageOrganizationMembership)}],[p.lj.FEATURE_FLAG_CMS,e=>{var t,n;return!!(null===(n=e.tenant)||void 0===n?void 0:null===(t=n.featureFlags)||void 0===t?void 0:t.cms)}],[p.lj.FEATURE_FLAG_CONFERENCES,e=>{var t,n;return!!(null===(n=e.tenant)||void 0===n?void 0:null===(t=n.featureFlags)||void 0===t?void 0:t.conferences)}],[p.lj.FEATURE_FLAG_WEBFLOW,e=>{var t,n;return!!(null===(n=e.tenant)||void 0===n?void 0:null===(t=n.featureFlags)||void 0===t?void 0:t.webflow)}],[p.lj.PAID_MODULE_WEBSITE_BUILDER,e=>{var t,n;return!!(null===(n=e.tenant)||void 0===n?void 0:null===(t=n.paidModules)||void 0===t?void 0:t.websiteBuilder)}]]),useRequiredPermission=e=>{let t=(0,u.x)();if(!e.requiresEvery&&!e.requiresSome)return{hasPermission:!0,loading:!1};if(t.loading)return{hasPermission:!1,loading:!0};let n=null==e||!e.requiresEvery||(null==e?void 0:e.requiresEvery.map(e=>C.get(e)).every(e=>!e||e(t))),r=null==e||!e.requiresSome||(null==e?void 0:e.requiresSome.map(e=>C.get(e)).some(e=>!!e&&e(t)));return{hasPermission:n&&r,loading:!1}}
1,restrictedRoute=(e,t,n)=>c=>{let u=(0,i.useRouter)(),p=useRequiredPermission(t),C=(0,l.T)(),h=(0,s.U)(),v=p.loading||C.isLoading||h.loading,x=!!n&&!!n.requiresMemberManagement&&!h.isActive;return(a.useEffect(()=>{v||p.hasPermission&&!x||C.isAuthenticated||!u.isReady||u.replace({pathname:"/login",query:{redirect:u.asPath}})},[v,u,x,C.isAuthenticated,p.hasPermission]),v)?(0,r.jsx)(d.g,{}):!p.hasPermission||x?C.isAuthenticated?(0,r.jsx)(o.A,{}):(0,r.jsx)(d.g,{}):(0,r.jsx)(e,{...c})}}},function(e){e.O(0,[74885,28869,9669,69741,32512,42790,64986,96317,49774,92888,40179],function(){return e(e.s=1243)}),_N_E=e.O()}]); 2//# sourceMappingURL=sponsorList-03e603f0a191c334.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.