PageSourceSearch

https://formed.org/_next/static/chunks/242.218646a3cfaf90ab.js

js formed.org collected 2026-10-01 11:24:46 UTC 64,484 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[242],{96196:function(e,s,r){r.r(s),r.d(s,{default:function(){return sr}});var i,n,a,t,l=r(85893),o=r(67294),d=r(9008),c=r.n(d),u=r(11215),h=r(34051),m=r(83270),x=r(82729),j=r(11163),g=r(42563),p=r(12960);r(30238);var v=r(32117),f=r(22793);function N(e){let{isAuthenticated:s,user:r}=(0,u.aC)();return function(e,s){let[r,i]=(0,o.useState)({isLoading:!1,data:void 0,error:void 0}),n=(0,o.useCallback)(async()=>{i(e=>({...e,isLoading:!0,error:void 0}));try{let r=await e(...s);i(e=>({...e,isLoading:!1,data:r}))}catch(e){i(s=>({...s,isLoading:!1,error:e}))}},[i,...s]);return(0,o.useEffect)(()=>void n(),[n]),{...r,reload:n}}(async e=>e?(await f.x.get(e)).data:void 0,[e,s&&(null==r?void 0:r.profile.sub)])}var b=r(31555),y=r(35005),Z=r(31328),S=r(62318),w=r(82175),C=r(67814),k=r(97275),E=r(37169),A=r(14794);r(90090);let I=e=>{let{group:s,onFormSubmit:r}=e,i=(0,o.useMemo)(()=>{var e,r,i,n,a,t,l,o,d;let c=s.attributes||{},u=(null===(r=s.attributes)||void 0===r?void 0:null===(e=r["address.placeId"])||void 0===e?void 0:e[0])||void 0;return{shortName:s.name.split(" - ")[0],phone:(null===(i=c.phone)||void 0===i?void 0:i[0])||void 0,orgAddress:u,usingManualAddress:!u,manualAddress:{country:(null===(n=c["address.country"])||void 0===n?void 0:n[0])||"US",region:(null===(a=c["address.region"])||void 0===a?void 0:a[0])||"",streetAddress1:(null===(t=c["address.streetAddress"])||void 0===t?void 0:t[0])||"",streetAddress2:(null===(l=c["address.streetAddress"])||void 0===l?void 0:l[1])||"",locality:(null===(o=c["address.locality"])||void 0===o?void 0:o[0])||"",postalCode:(null===(d=c["address.postalCode"])||void 0===d?void 0:d[0])||""}}},[s]);return(0,l.jsx)(w.J9,{validationSchema:E.fO,initialValues:i,onSubmit:r,children:e=>(0,l.jsx)(Z.Z,{onSubmit:e.handleSubmit,className:"group-info-form admin-form",id:"updateForm",children:(0,l.jsx)(U,{group:s,...e})})})},U=e=>{var s,r;let{group:i,handleChange:n,handleBlur:a,values:t,errors:o,touched:d,setFieldValue:c,setFieldTouched:u}=e;return(0,l.jsx)(h.Z,{children:(0,l.jsxs)(b.Z,{xs:12,children:[(0,l.jsx)("div",{className:"form-label",children:"Name"}),(0,l.jsxs)(Z.Z.Group,{children:[(0,l.jsxs)(S.Z,{className:o.shortName&&d.shortName?"error":"",children:[(0,l.jsx)(Z.Z.Control,{type:"text",name:"shortName",value:t.shortName,onChange:n,onBlur:a,placeholder:"Organization Name"}),(0,l.jsx)(S.Z.Append,{children:(0,l.jsx)(S.Z.Text,{children:(0,l.jsx)("img",{src:"/static/images/icons/edit.svg"})})})]}),o.shortName&&d.shortName?(0,l.jsx)("div",{className:"error-message",children:String(o.shortName)}):null]}),(0,l.jsx)("div",{className:"form-label",children:"Phone"}),(0,l.jsxs)(Z.Z.Group,{children:[(0,l.jsxs)(S.Z,{className:(0,w.u9)(o,"phone")&&(0,w.u9)(d,"phone")?"error":"",children:[(0,l.jsx)(k.ZP,{id:"phone",placeholder:"Enter phone number",country:"US",className:"form-control",name:"phone",value:t.phone,onBlur:()=>u("phone",!0),onChange:e=>c("phone",e)}),(0,l.jsx)(S.Z.Append,{children:(0,l.jsx)(S.Z.Text,{children:(0,l.jsx)("img",{src:"/static/images/icons/phone.svg"})})})]}),(0,w.u9)(o,"phone")&&(0,w.u9)(d,"phone")?(0,l.jsx)("div",{className:"error-message",children:(0,w.u9)(o,"phone")}):null]}),(0,l.jsx)("div",{className:"form-label",children:"Physical Address"}),(0,l.jsx)(Z.Z.Group,{id:"address-lookup-group",className:"text-right",children:(0,l.jsx)(A.Z,{formValues:t,onAddressSelect:async(e,s)=>{s.orgAddress=e?e.place_id:null},handleBlur:a,handleChange:n,defaultValue:(null===(r=i.attributes)||void 0===r?void 0:null===(s=r["address.formattedAddress"])||void 0===s?void 0:s[0])||"",setFieldValue:c})})]})})};var M=e=>{let s=(0,u.aC)(),{group:r}=e;async function i(e,s){try{let r=(await f.x.get("/place/".concat(e))).data;return delete r.formattedAddress,s&&r.streetAddress.push(s),r.placeId=e,r}catch(e){throw Error("Unable to get valid address object",{cause:e})}}async function n(n,a){try{var t,l;let a=n.orgAddress&&!n.usingManualAddress?await i(n.orgAddress,n.address_line_2):{country:(l=n.manualAddress).country,region:l.region,streetAddress:[l.streetAddress1,...l.streetAddress2?[l.streetAddress2]:[]],locality:l.locality,postalCode:l.postalCode},o=await f.x.request({url:"/groups/".concat(r.id),method:"put",headers:{Authorization:"Bearer ".concat(e.token)}
1,data:{name:n.shortName,address:a,phone:n.phone}}),d=o.data;sessionStorage.setItem("userGroup",JSON.stringify(o.data)),await s.signinSilent(),null===(t=e.afterSave)||void 0===t||t.call(e,d)}catch(s){console.error("Error updating group",s),e.setError(!0),e.setShow(!1)}a.setSubmitting(!1)}return(0,l.jsxs)(g.Z,{show:e.show,backdropClassName:"admin-modal-backdrop",onHide:e.handleClose,dialogClassName:"update-profile-modal",size:"lg",centered:!0,children:[(0,l.jsxs)(g.Z.Header,{children:[(0,l.jsx)(g.Z.Title,{children:"Update Profile"}),(0,l.jsx)("button",{type:"button",className:"close",onClick:e.handleClose,children:(0,l.jsx)("span",{children:(0,l.jsx)(C.G,{icon:"times"})})})]}),(0,l.jsx)(g.Z.Body,{children:(0,l.jsx)(I,{group:r,onFormSubmit:n})}),(0,l.jsxs)(g.Z.Footer,{children:[(0,l.jsx)(y.Z,{type:"submit",variant:"primary",form:"updateForm",children:"SAVE"}),(0,l.jsx)(y.Z,{variant:"secondary",onClick:e.handleClose,children:"CANCEL"})]})]})},O=e=>{let{group:s,user:r,reloadGroup:i}=e,[n,a]=(0,o.useState)(!1),[t,d]=(0,o.useState)(!1),c=()=>a(!1),u=()=>a(!0),m=s.name.split(" - ")[0];return(0,l.jsxs)(h.Z,{children:[t&&(0,l.jsx)(b.Z,{xs:12,children:(0,l.jsx)("div",{className:"error-message",children:"There was an error updating your information. ALL fields must be filled out. No changes were made."})}),(0,l.jsxs)(b.Z,{children:[(0,l.jsx)("div",{className:"col-heading",children:"General"}),(0,l.jsxs)("div",{className:"profile-detail",children:[(0,l.jsx)("div",{className:"label",children:"Name"}),(0,l.jsx)("div",{className:"info",children:m})]}),(0,l.jsxs)("div",{className:"profile-detail",children:[(0,l.jsx)("div",{className:"label",children:"Phone"}),(0,l.jsx)("div",{className:"info",children:s.attributes.phone?(0,k.un)(s.attributes.phone[0]):"N/A"})]}),(0,l.jsxs)("div",{className:"profile-detail",children:[(0,l.jsx)("div",{className:"label",children:"Physical Address"}),(0,l.jsx)("div",{className:"info",children:s.attributes["address.formattedAddress"]})]}),(0,l.jsx)("div",{className:"profile-detail",children:(0,l.jsx)(y.Z,{variant:"primary",type:"button",className:"update-profile-button",onClick:u,children:"Update Profile"})})]}),(0,l.jsx)(M,{show:n,setShow:a,handleClose:c,handleShow:u,user:r,token:r.access_token,group:s,setError:d,afterSave:async()=>{c(),await i()}})]})},_=r(27977),X=r(9171),R=r(94716);function T(){let e=(0,x._)(["/groups/","/members"]);return T=function(){return e},e}function G(){let e=(0,x._)(["/groups/","/members/","/",""]);return G=function(){return e},e}function L(){let e=(0,x._)(["/invitations/",""]);return L=function(){return e},e}let D="__invite__",F={"primary-admin":"Primary Formed Admin","billing-admin":"Billing Contact"},P={"primary-admin":"primaryAdmin","billing-admin":"billingAdmin"};var B=e=>{let{group:s,user:r}=e,[i,n]=(0,o.useState)([]),[a,t]=(0,o.useState)(!0),[d,c]=(0,o.useState)(""),[u,m]=(0,o.useState)(!1),[x,j]=(0,o.useState)(!1),[g,p]=(0,o.useState)(""),[N,Z]=(0,o.useState)(""),[S,w]=(0,o.useState)(""),[C,k]=(0,o.useState)(!1),[E,A]=(0,o.useState)({});async function I(){t(!0);try{let e=await f.x.get((0,v.Z)(T(),s.id),{params:{max:200}});n(e.data.list),m(!1),j(!1)}catch(s){var e;(null==s?void 0:null===(e=s.response)||void 0===e?void 0:e.status)===403?j(!0):m(!0)}finally{t(!1)}}(0,o.useEffect)(()=>{I()},[s.id]);let U=i.find(e=>e.isPrimaryAdmin),M=i.find(e=>e.isBillingAdmin),O=i.filter(e=>"Group Admin"===e.formedRole||"Formed Admin"===e.formedRole);async function B(e,i){c(e);try{await f.x.request({method:"put",url:(0,v.Z)(G(),s.id,i,e),headers:{Authorization:"Bearer ".concat(r.access_token)}}),m(!1),A(s=>({...s,[e]:void 0})),await I()}catch(e){var n;(null==e?void 0:null===(n=e.response)||void 0===n?void 0:n.status)===403?j(!0):m(!0)}finally{c("")}}function K(){p(""),Z(""),w("")}async function V(e){k(!0);try{let i=await f.x.request({method:"post",url:(0,v.Z)(L(),s.id),headers:{Authorization:"Bearer ".concat(r.access_token)},data:{name:N,email:S,role:P[e]}});m(!1),A(s=>{var r,n,a;return{...s,[e]:{name:N,email:S,delivered:!!(null===(r=i.data)||void 0===r?void 0:r.delivered),url:(null===(n=i.data)||void 0===n?void 0:n.delivered)?void 0:null===(a=i.data)||void 0===a?void 0:a.url}}}),K(),await I()}catch(e){var i;(null==e?void 0:null===(i=e.response)||void 0===i?void 0:i.status)===403?j(!0):m(!0)}finally{k(!1)}}function q(e){return e?"".concat(e.firstName," ").concat(e.lastName," <").concat(e.email,">"):"Not assigned"}if(x)return(0,l.jsx)(h.Z,{children:(0,l.jsxs)(b.Z,{children:[(0,l.jsx)("div",{className:"col-heading",children:"Contact Roles"}),(0,l.jsx)("div",{className:"profile-detail",children:"You do not have permission to view or manage contact roles for this group."})]})});function z(e,s){let r=!!E[e]||"primary-admin"===e&&!!(null==U?void 0:U.isPrimaryAdminPending),i=E[e];return(0,l.jsxs)("div",{className:"profile-detail",children:[(0,l.jsxs)("div",{className:"label",children:[F[e],"primary-admin"===e&&(null==U?void 0:U.isPrimaryAdminPending)&&(0,l.jsx)(_.Z,{variant:"warning",className:"ml-2",children:"Pending confirmation"})]}),(0,l.jsxs)("div",{className:"info",children:[(0,l.jsxs)(X.Z,{onSelect:s=>{s&&(s===D?(Z(""),w(""),p(e)):B(e,s))},children:[(0,l.jsx)(X.Z.Toggle,{variant:"outline-secondary",id:"".concat(e,"-dropdown"),disabled:a||r,children:d===e?"Updating...":q(s)}),(0,l.jsxs)(X.Z.Menu,{children:[O.map(e=>(0,l.jsx)(X.Z.Item,{eventKey:e.id,children:q(e)},e.id)),(0,l.jsx)(X.Z.Divider,{}),(0,l.jsx)(X.Z.Item,{eventKey:D,children:"Invite a new admin…"})]})]}),i&&(0,l.jsxs)("div",{className:"alert ".concat(i.delivered?"alert-success":"alert-warning"," mt-2"),children:["Invitation sent to ",i.name," <",i.email,">.",!i.delivered&&i.url&&(0,l.jsxs)(l.Fragment,{children:[" ","We couldn’t email it — share this link with them directly:",(0,l.jsx)("br",{}),(0,l.jsx)("a",{href:i.url,target:"_blank",rel:"noreferrer",children:i.url})]})," ",(0,l.jsx)(y.Z,{variant:"link",className:"p-0 align-baseline",onClick:()=>A(s=>({...s,[e]:void 0})),children:"Invite someone else instead"})]}),g===e&&(0,l.jsxs)("div",{className:"mt-2 p-3 border rounded bg-light",children:[(0,l.jsxs)("p",{className:"text-muted small mb-2",children:["Invite a new ",F[e],". We’ll send them a secure link to confirm their role."]}),(0,l.jsx)("div",{className:"label",children:"Full Name"}),(0,l.jsx)(R.Z,{type:"text",value:N,onChange:e=>Z(e.target.value),placeholder:"Full Name",className:"mb-2"}),(0,l.jsx)("div",{className:"label",children:"Email Address"}),(0,l.jsx)(R.Z,{type:"email",value:S,onChange:e=>w(e.target.value),placeholder:"Email",className:"mb-2"}),(0,l.jsx)(y.Z,{variant:"primary",size:"sm",className:"mr-2",disabled:C||!N||!S,onClick:()=>V(e),children:C?"Sending...":"Send Invite"}),(0,l.jsx)(y.Z,{variant:"secondary",size:"sm",disabled:C,onClick:K,children:"Cancel"})]})]})]})}return(0,l.jsx)(h.Z,{children:(0,l.jsxs)(b.Z,{children:[(0,l.jsx)("div",{className:"col-heading",children:"Contact Roles"}),u&&(0,l.jsx)("div",{className:"error-message",children:"There was an error loading or updating contact roles."}),z("primary-admin",U),z("billing-admin",M)]})})};let K=Object.assign(e=>(0,l.jsxs)("div",{id:"account-page",children:[(0,l.jsx)(h.Z,{id:"heading",children:(0,l.jsx)(b.Z,{children:(0,l.jsx)("div",{className:"text",children:"Account"})})}),(0,l.jsx)(h.Z,{children:(0,l.jsx)(b.Z,{children:(0,l.jsx)(O,{group:e.group,user:e.user,reloadGroup:e.reloadGroup})})}),(0,l.jsx)(h.Z,{className:"section-spacing",children:(0,l.jsx)(b.Z,{children:(0,l.jsx)(B,{group:e.group,user:e.user})})})]}),{key:"account"});function V(){let e=(0,x._)(["/groups/","/domo"]);return V=function(){return e},e}let q=Object.assign(e=>{let{groupId:s}=e,{data:r}=N((0,v.Z)(V(),s));return(0,l.jsx)("div",{id:"home-page",children:(0,l.jsx)(h.Z,{id:"heading",children:(0,l.jsx)(b.Z,{className:"text-center",children:(0,l.jsx)("iframe",{width:"1248",height:"1620",srcDoc:r})})})})},{key:"analytics"}),z=e=>{let s=e=>new Date(e).toLocaleDateString(void 0,{hour:"numeric",minute:"2-digit"});return(0,l.jsx)("div",{className:"admin-table-container",children:(0,l.jsx)("div",{className:"admin-table-list-container",children:(0,l.jsxs)("table",{className:"admin-table-list",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"group-list-header",children:[(0,l.jsx)("th",{children:(0,l.jsx)("div",{className:"th-text",children:"Date"})}),(0,l.jsx)("th",{children:(0,l.jsx)("div",{className:"th-text",children:"Change"})}),(0,l.jsx)("th",{children:(0,l.jsx)("div",{className:"th-text",children:"Made By"})}),(0,l.jsx)("th",{children:(0,l.jsx)("div",{className:"th-text",children:"Via"})})]})}),(0,l.jsx)("tbody",{children:e.logs.map(e=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:s(e.createdAt)}),(0,l.jsx)("td",{children:e.action}),(0,l.jsx)("td",{children:e.user&&e.user.name}),(0,l.jsx)("td",{children:e.via})]},e.id))})]})})})},H=e=>{let{logType:s="groups",id:r,user:i}=e,[n,a]=(0,o.useState)({loading:!0,logs:[],error:null});async function t(){try{let e=await f.x.request({url:"/".concat(s,"/").concat(r,"/logs"),method:"get",headers:{Authorization:"Bearer ".concat(i.access_token)}});a(()=>({logs:e.data,loading:!1,error:null}))}catch(e){console.warn("Could not load audit logs",{logType:s,id:r,exception:e}),a(()=>({logs:[],loading:!1,error:"Temporarily unavailable"}))}}return(0,o.useEffect)(()=>{t()},[]),(0,l.jsx)(l.Fragment,{children:!n.loading&&(n.error||(0,l.jsx)(z,{logs:n.logs}))})},W=Object.assign(e=>(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{id:"heading",children:(0,l.jsx)(b.Z,{children:(0,l.jsx)("div",{className:"text",children:"Group Audit Log"})})}),(0,l.jsx)(h.Z,{children:(0,l.jsx)(b.Z,{children:(0,l.jsx)(H,{logType:"groups",id:e.group.id,user:e.user})})})]}),{key:"audit-log"});var J=r(38538),Q=r(56841),Y=()=>(0,l.jsxs)("div",{className:"news-card card",children:[(0,l.jsx)(h.Z,{children:(0,l.jsx)(b.Z,{children:(0,l.jsx)("div",{className:"title",children:"Welcome"})})}),(0,l.jsx)(h.Z,{children:(0,l.jsx)(b.Z,{xs:12,children:(0,l.jsxs)("div",{className:"story-blurb",children:[(0,l.jsx)("p",{children:"Welcome to the Formed Admin panel. Here you can update your payment method, add coupons, view your Billing History, reactivate a canceled subscription, and upgrade from monthly to annual subscription."}),(0,l.jsx)("p",{children:"Be sure to visit our Leader’s Resource Site here:"}),(0,l.jsx)("p",{children:(0,l.jsx)("a",{href:"https://leaders.formed.org/",children:"https://leaders.formed.org/"})}
1),(0,l.jsx)("p",{children:"Thank you for using Formed!"})]})})})]}),$=e=>{let{group:s,subscriptionUrl:r,changeView:i}=e,n=s.name.split(" - ")[0];return(0,l.jsxs)("div",{className:"profile-card card",children:[(0,l.jsx)(h.Z,{className:"profile-row",children:(0,l.jsx)(b.Z,{children:(0,l.jsx)("div",{className:"group-name",children:n})})}),(0,l.jsx)(h.Z,{className:"button-row",children:(0,l.jsx)(b.Z,{children:(0,l.jsx)("div",{className:"button-container",children:(0,l.jsxs)(y.Z,{variant:"link",onClick:()=>i("account"),children:[(0,l.jsx)("img",{src:"/static/images/icons/profile-dark.svg"}),"My Account"]})})})}),r&&(0,l.jsx)(h.Z,{className:"button-row",children:(0,l.jsx)(b.Z,{children:(0,l.jsx)("div",{className:"button-container",children:r.includes("newSubscription")?(0,l.jsx)("a",{className:"subscriptionLink",href:"/subscribe?groupId=".concat((null==s?void 0:s.id)||""),children:"New Subscription"}):(0,l.jsx)("a",{className:"subscriptionLink",href:r,children:"Manage Subscription"})})})})]})},ee=e=>(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(h.Z,{className:"home-tab",children:(0,l.jsx)(b.Z,{children:(0,l.jsxs)(h.Z,{children:[(0,l.jsx)(b.Z,{md:4,children:(0,l.jsx)($,{group:e.group,changeView:e.changeView,subscriptionUrl:e.subscriptionUrl,toggleSubscriptionNewModal:e.toggleSubscriptionNewModal})}),(0,l.jsx)(b.Z,{md:8,children:(0,l.jsx)(Y,{})})]})})})});let es=Object.assign(e=>{var s,r,i,n,a,t;function o(e,s){localStorage.setItem("redirectInfo",JSON.stringify({location:e,groupId:s}))}let d=e.user.profile.given_name||"";return(0,l.jsxs)("div",{id:"home-page",children:[(0,l.jsxs)(h.Z,{id:"heading",children:[(0,l.jsxs)(b.Z,{children:[(0,l.jsx)("div",{className:"text",children:"Welcome back,"}),(0,l.jsxs)("div",{className:"text",children:[d.charAt(0).toUpperCase()+d.slice(1),"."]})]}),((null===(r=e.user)||void 0===r?void 0:null===(s=r.profile.roles)||void 0===s?void 0:s.includes("FORMED_SUPER_ADMIN"))||(null===(t=e.user)||void 0===t?void 0:null===(a=t.profile.resource_access)||void 0===a?void 0:null===(n=a.formed)||void 0===n?void 0:null===(i=n.roles)||void 0===i?void 0:i.includes("CUSTOMER_SERVICE")))&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b.Z,{className:"text-center m-auto",children:(0,l.jsx)("a",{href:"/admin",target:"_blank",onClick:()=>o("chargebeeUrl",e.group.id),className:"chargebee button",children:"Chargebee Account"})}),(0,l.jsx)(b.Z,{className:"text-center m-auto",children:(0,l.jsx)("a",{href:"/admin",target:"_blank",onClick:()=>o("netsuiteUrl",e.group.id),className:"keycloak button",children:"Netsuite Account"})})]})]}),(0,l.jsx)(h.Z,{children:(0,l.jsx)(b.Z,{children:(0,l.jsx)(J.Z,{activeKey:e.activeTab,onSelect:s=>s?e.changeTab(s):null,id:"home-tabs",mountOnEnter:!0,unmountOnExit:!0,children:(0,l.jsx)(Q.Z,{eventKey:"home",title:"HOME",children:(0,l.jsx)(ee,{group:e.group,changeView:e.changeView,subscriptionUrl:e.subscriptionUrl,toggleSubscriptionNewModal:e.toggleSubscriptionNewModal})})})})})]})},{key:"home"});function er(e){let{locality:s,region:r}=e.address||{};return[s,r].filter(Boolean).join(", ")}var ei=e=>{let[s,r]=(0,o.useState)(""),[i,n]=(0,o.useState)([]),[a,t]=(0,o.useState)(!1),[d,c]=(0,o.useState)(!1),[u,h]=(0,o.useState)(!1);async function m(e){if(null==e||e.preventDefault(),s){t(!0),c(!1);try{let{data:e}=await f.x.get("/search/users",{params:{q:s,page_size:25}});n(e.results||[]),h(!0),t(!1)}catch(e){c(!0),t(!1)}}}return(0,l.jsxs)("div",{className:"admin-table-container card user-search-list",children:[(0,l.jsx)("div",{className:"admin-table-heading",children:(0,l.jsxs)("div",{className:"admin-table-search-container",children:[(0,l.jsx)("img",{src:"/static/images/icons/search-light.svg"}),(0,l.jsx)("form",{onSubmit:m,children:(0,l.jsx)("input",{id:"admin-table-search",type:"text",placeholder:"Search by name, email, or phone",onChange:function(e){r(e.target.value)},value:s})})]})}),a&&(0,l.jsx)("div",{className:"text-center",style:{padding:"40px"},children:(0,l.jsx)(p.Z,{color:"#1c8eec"})}),d&&(0,l.jsx)("div",{className:"error-message",children:"There was an error searching for users."}),!a&&(0,l.jsxs)("div",{className:"user-search-results-list",children:[i.map(s=>(0,l.jsxs)("div",{className:"user-search-result".concat(s.id===e.selectedUserId?" selected":""),onClick:()=>e.onSelect(s.id),style:{cursor:"pointer"},children:[(0,l.jsx)("div",{className:"name",children:(0,l.jsxs)("b",{children:[s.firstName," ",s.lastName]})}),(0,l.jsx)("div",{className:"email",children:s.email}),s.phone&&(0,l.jsx)("div",{className:"phone",children:s.phone}),er(s)&&(0,l.jsx)("div",{className:"city-state",children:er(s)})]},s.id)),u&&!i.length&&(0,l.jsx)("div",{className:"text-center",children:"No users found."})]})]})},en=r(88375),ea=r(11752),et=r.n(ea),el=e=>{let[s,r]=(0,o.useState)(!1),[i,n]=(0,o.useState)("");async function a(){r(!0),n("");try{await e.onConfirm(),r(!1),e.onClose()}catch(e){var s,i;n((null==e?void 0:null===(i=e.response)||void 0===i?void 0:null===(s=i.data)||void 0===s?void 0:s.message)||(null==e?void 0:e.message)||"Internal error"),r(!1)}}return(0,l.jsxs)(g.Z,{show:e.show,backdropClassName:"admin-modal-backdrop",onHide:e.onClose,dialogClassName:"update-profile-modal",size:"lg",centered:!0,children:[(0,l.jsxs)(g.Z.Header,{children:[(0,l.jsx)(g.Z.Title,{children:e.title}),(0,l.jsx)("button",{type:"button",className:"close",onClick:e.onClose,children:(0,l.jsx)("span",{children:(0,l.jsx)(C.G,{icon:"times"})})})]}),(0,l.jsxs)(g.Z.Body,{children:[i&&(0,l.jsx)(en.Z,{variant:"danger",children:i}),e.body]}),(0,l.jsx)(g.Z.Footer,{children:s?(0,l.jsx)(p.Z,{color:"#1c8eec"}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(y.Z,{variant:"primary",onClick:a,children:e.confirmLabel||"Confirm"}),(0,l.jsx)(y.Z,{variant:"secondary",onClick:e.onClose,children:"CANCEL"})]})})]})};function eo(){let e=(0,x._)(["/users/",""]);return eo=function(){return e},e}var ed=e=>{let[s,r]=(0,o.useState)(e.currentEmail),[i,n]=(0,o.useState)(!1),[a,t]=(0,o.useState)("");async function d(r){r.preventDefault(),n(!0),t("");try{await f.x.patch((0,v.Z)(eo(),e.userId),{email:s}),n(!1),e.onSaved(),e.onClose()}catch(e){var i,a;t((null==e?void 0:null===(a=e.response)||void 0===a?void 0:null===(i=a.data)||void 0===i?void 0:i.message)||(null==e?void 0:e.message)||"Internal error"),n(!1)}}return(0,l.jsxs)(g.Z,{show:e.show,backdropClassName:"admin-modal-backdrop",onHide:e.onClose,dialogClassName:"update-profile-modal",size:"lg",centered:!0,children:[(0,l.jsxs)(g.Z.Header,{children:[(0,l.jsx)(g.Z.Title,{children:"Update Email Address"}),(0,l.jsx)("button",{type:"button",className:"close",onClick:e.onClose,children:(0,l.jsx)("span",{children:(0,l.jsx)(C.G,{icon:"times"})})})]}),(0,l.jsxs)(Z.Z,{onSubmit:d,children:[(0,l.jsxs)(g.Z.Body,{children:[a&&(0,l.jsx)(en.Z,{variant:"danger",children:a}),(0,l.jsxs)(Z.Z.Group,{children:[(0,l.jsx)(Z.Z.Label,{children:"Email Address"}),(0,l.jsx)(Z.Z.Control,{type:"email",value:s,onChange:e=>r(e.target.value),required:!0})]})]}),(0,l.jsx)(g.Z.Footer,{children:i?(0,l.jsx)(p.Z,{color:"#1c8eec"}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(y.Z,{type:"submit",variant:"primary",children:"Save"}),(0,l.jsx)(y.Z,{variant:"secondary",onClick:e.onClose,children:"CANCEL"})]})})]})]})};function ec(){let e=(0,x._)(["/users/","/detail"]);return ec=function(){return e},e}function eu(){let e=(0,x._)(["/users/","/credentials"]);return eu=function(){return e},e}function eh(){let e=(0,x._)(["/users/","/reset-password-email"]);return eh=function(){return e},e}function em(){let e=(0,x._)(["/users/","/credentials/",""]);return em=function(){return e},e}function ex(){let e=(0,x._)(["/users/","/logout"]);return ex=function(){return e},e}function ej(){let e=(0,x._)(["/groups/","/members/",""]);return ej=function(){return e},e}var eg=e=>{var s,r,i,n;let[a,t]=(0,o.useState)(null),[d,c]=(0,o.useState)(!1),[u,h]=(0,o.useState)(""),[m,x]=(0,o.useState)(null),[j,g]=(0,o.useState)(!1),[N,b]=(0,o.useState)(!1),[Z,S]=(0,o.useState)(!1),[w,C]=(0,o.useState)(null),[k,E]=(0,o.useState)(!1);async function A(){c(!0),h("");try{let[{data:s},{data:r}
1]=await Promise.all([f.x.get((0,v.Z)(ec(),e.userId)),f.x.get((0,v.Z)(eu(),e.userId))]);t(s),x(r.find(e=>"password"===e.type)||null),c(!1)}catch(e){var s,r;h((null==e?void 0:null===(r=e.response)||void 0===r?void 0:null===(s=r.data)||void 0===s?void 0:s.message)||(null==e?void 0:e.message)||"Failed to load user"),c(!1)}}async function I(){await f.x.post((0,v.Z)(eh(),e.userId),{redirectUri:window.location.origin}),E(!0)}if((0,o.useEffect)(()=>{t(null),E(!1),A()},[e.userId]),d)return(0,l.jsx)("div",{className:"text-center",style:{padding:"40px"},children:(0,l.jsx)(p.Z,{color:"#1c8eec"})});if(u)return(0,l.jsx)(en.Z,{variant:"danger",children:u});if(!a)return(0,l.jsx)(l.Fragment,{});let U=(null===(r=e.currentUser)||void 0===r?void 0:null===(s=r.profile.roles)||void 0===s?void 0:s.includes("FORMED_SUPER_ADMIN"))?function(e){let{publicRuntimeConfig:s}=et()(),r=s.KEYCLOAK_ADMIN_SIGNIN_URL;if(r)return r.replace("/auth/realms/","/auth/admin/master/console/#/")+"/users/".concat(e,"/settings")}(a.id):void 0;return(0,l.jsxs)("div",{id:"user-detail-panel",className:"admin-table-container card",children:[(0,l.jsxs)("div",{className:"detail-section detail-header",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("h3",{children:[a.firstName," ",a.lastName]}),(0,l.jsxs)("div",{className:"detail-email",children:[(0,l.jsx)("a",{href:"mailto:".concat(a.email),children:a.email})," ",(0,l.jsx)(y.Z,{variant:"secondary",size:"sm",onClick:()=>g(!0),children:"Edit"})]})]}),U?(0,l.jsx)("a",{href:U,target:"_blank",rel:"noreferrer",children:a.id}):(0,l.jsx)("span",{children:a.id})]}),(0,l.jsx)("div",{className:"detail-section",children:(0,l.jsx)("table",{className:"admin-table-list",children:(0,l.jsxs)("tbody",{children:[(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsx)("b",{children:"Enabled"})}),(0,l.jsx)("td",{children:a.enabled?"Yes":"No"})]}),(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsx)("b",{children:"Email Verified"})}),(0,l.jsx)("td",{children:a.emailVerified?"Yes":"No"})]}),(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsx)("b",{children:"Created"})}),(0,l.jsx)("td",{children:new Date(a.createdTimestamp).toLocaleString()})]}),(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsx)("b",{children:"Realm Roles"})}),(0,l.jsx)("td",{children:null===(i=a.realmRoles)||void 0===i?void 0:i.join(", ")})]}),Object.entries(a.attributes||{}).sort((e,s)=>{let[r]=e,[i]=s;return r.localeCompare(i)}).map(e=>{let[s,r]=e;return(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:(0,l.jsx)("b",{children:s})}),(0,l.jsx)("td",{children:r.join(", ")})]},s)})]})})}),!!(null===(n=a.externalLinks)||void 0===n?void 0:n.length)&&(0,l.jsxs)("div",{className:"detail-section",children:[(0,l.jsx)("h4",{className:"detail-section-heading",children:"External Accounts"}),(0,l.jsx)("div",{className:"external-accounts-list",children:a.externalLinks.map(e=>(0,l.jsxs)("div",{className:"external-account",children:[(0,l.jsx)("a",{href:e.adminUrl,target:"_blank",rel:"noreferrer",children:e.label}),e.details&&(0,l.jsx)("ul",{className:"external-account-details",children:Object.entries(e.details).map(e=>{let[s,r]=e;return(0,l.jsxs)("li",{children:[(0,l.jsxs)("b",{children:[s,":"]})," ",r]},s)})})]},e.label))})]}),(0,l.jsxs)("div",{className:"detail-section",children:[(0,l.jsx)("h4",{className:"detail-section-heading",children:"Groups"}),(0,l.jsx)("table",{className:"admin-table-list",children:(0,l.jsxs)("tbody",{children:[a.groups.map(e=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{children:e.name}),(0,l.jsx)("td",{className:"control-td",children:(0,l.jsx)(y.Z,{variant:"link",onClick:()=>C(e),children:"Remove"})})]},e.id)),!a.groups.length&&(0,l.jsx)("tr",{children:(0,l.jsx)("td",{children:"No groups"})})]})})]}),(0,l.jsxs)("div",{className:"detail-section",children:[(0,l.jsx)("h4",{className:"detail-section-heading",children:"Credentials & Sessions"}),k&&(0,l.jsx)(en.Z,{variant:"success",children:"Password reset email sent."}),(0,l.jsxs)("div",{className:"detail-actions",children:[(0,l.jsx)(y.Z,{variant:"primary",onClick:I,children:"Send Password Reset Email"}),m&&(0,l.jsx)(y.Z,{variant:"primary",onClick:()=>b(!0),children:"Remove Password"}),(0,l.jsx)(y.Z,{variant:"primary",onClick:()=>S(!0),children:"Clear Active Sessions"})]})]}),j&&(0,l.jsx)(ed,{show:j,userId:a.id,currentEmail:a.email,onClose:()=>g(!1),onSaved:A}),N&&m&&(0,l.jsx)(el,{show:N,title:"Remove Password",body:(0,l.jsxs)("p",{children:["This will remove ",a.firstName,"'s existing password. They will need to reset it before they can sign in with a password again."]}),confirmLabel:"Remove Password",onClose:()=>b(!1),onConfirm:async()=>{await f.x.delete((0,v.Z)(em(),a.id,m.id)),await A()}}),Z&&(0,l.jsx)(el,{show:Z,title:"Clear Active Sessions",body:(0,l.jsxs)("p",{children:["This will log ",a.firstName," out of all active sessions."]}),confirmLabel:"Clear Sessions",onClose:()=>S(!1),onConfirm:async()=>{await f.x.post((0,v.Z)(ex(),a.id))}}),w&&(0,l.jsx)(el,{show:!!w,title:"Remove from Group",body:(0,l.jsxs)("p",{children:["Remove ",a.firstName," from ",(0,l.jsx)("b",{children:w.name}),"?"]}),confirmLabel:"Remove",onClose:()=>C(null),onConfirm:async()=>{await f.x.delete((0,v.Z)(ej(),w.id,a.id)),await A()}})]})};let ep=Object.assign(e=>{let[s,r]=(0,o.useState)(void 0);return(0,l.jsxs)("div",{id:"manage-users",children:[(0,l.jsx)(h.Z,{id:"heading",children:(0,l.jsx)(b.Z,{children:(0,l.jsx)("div",{className:"text",children:"Manage Users"})})}),(0,l.jsxs)(h.Z,{children:[(0,l.jsx)(b.Z,{xs:5,children:(0,l.jsx)(ei,{selectedUserId:s,onSelect:r})}),(0,l.jsx)(b.Z,{xs:7,children:s&&(0,l.jsx)(eg,{userId:s,currentUser:e.user})})]})]})},{key:"manage users"}),ev=Object.assign(()=>{let[e,s]=(0,o.useState)({primaryId:"",otherIds:""}),[r,i]=(0,o.useState)(!1),[n,a]=(0,o.useState)(!1),[t,d]=(0,o.useState)(""),c=async s=>{s.preventDefault();let r=[e.primaryId,...e.otherIds.split(",").map(e=>e.trim())];try{i(!0),a(!1),await f.x.post("users/mergeUsers",{ids:r}),i(!1),d(""),a(!0)}catch(e){console.log({error:e}),d((null==e?void 0:e.message)||"Internal error"),i(!1)}};return(0,l.jsxs)("div",{id:"merge-keycloak-users",children:[(0,l.jsx)(h.Z,{id:"heading",children:(0,l.jsx)(b.Z,{children:(0,l.jsx)("div",{className:"text",children:"Merge Keycloak Users"})})}),(0,l.jsx)(h.Z,{children:(0,l.jsxs)(b.Z,{xs:3,children:[n&&(0,l.jsx)(en.Z,{variant:"success",children:"The users have been merged successfully"}),t&&(0,l.jsx)(en.Z,{variant:"danger",children:t})]})}),(0,l.jsxs)(Z.Z,{onSubmit:c,children:[(0,l.jsxs)(h.Z,{className:"mb-3",children:[(0,l.jsx)(b.Z,{xs:2,className:"d-flex align-items-center",children:(0,l.jsx)(Z.Z.Label,{children:"Primary ID: "})}),(0,l.jsx)(b.Z,{xs:5,children:(0,l.jsx)(Z.Z.Control,{type:"text",value:e.primaryId,onChange:e=>{s(s=>({...s,primaryId:e.target.value}))},pattern:"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",required:!0,placeholder:"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"})})]}),(0,l.jsxs)(h.Z,{className:"mb-3",children:[(0,l.jsx)(b.Z,{xs:2,className:"d-flex align-items-center",children:(0,l.jsx)(Z.Z.Label,{children:"IDs to be Merged: "})}),(0,l.jsx)(b.Z,{xs:5,children:(0,l.jsx)(Z.Z.Control,{type:"text",value:e.otherIds,onChange:e=>{s(s=>({...s,otherIds:e.target.value}))},required:!0,placeholder:"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX, XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX, ..."})})]}),(0,l.jsx)(h.Z,{children:(0,l.jsx)(b.Z,{children:r?(0,l.jsx)(p.Z,{color:"#1c8eec"}):(0,l.jsx)(y.Z,{type:"submit",variant:"primary",children:"SUBMIT"})})})]})]})},{key:"merge keycloak users"});var ef=r(5003),eN=r.n(ef),eb=r(65172),ey=r(62255);(i=a||(a={})).Bigcommerce="BIGCOMMERCE",i.Vimeo="VIMEO",i.NetSuite="NETSUITE",i["Thought Industries"]="THOUGHT_INDUSTRIES",i.ChargeBee="CHARGEBEE",i.Stripe="STRIPE",i.Segment="SEGMENT",i.Zapier="ZAPIER";var eZ=a;(n=t||(t={}))[n.OK=0]="OK",n[n.NOT_OK=1]="NOT_OK",n[n.UNKNOWN=2]="UNKNOWN",n[n.LOADING=3]="LOADING";var eS=t,ew=e=>{let{title:s,status:r,children:i}=e;return(0,l.jsxs)(ey.Z,{children:[(0,l.jsx)(ey.Z.Header,{children:(0,l.jsx)(eb.Z.Toggle,{as:"div",className:"toggle",eventKe
1y:s,children:(0,l.jsxs)("div",{className:"toggle-text-container",children:[(0,l.jsxs)("span",{children:[s,"\xa0"]}),{[eS.OK]:(0,l.jsx)("span",{style:{color:"green"},children:" OK"}),[eS.NOT_OK]:(0,l.jsx)("span",{style:{color:"red"},children:" OUTAGE"}),[eS.UNKNOWN]:(0,l.jsx)("span",{style:{color:"orange"},children:" SEE STATUS PAGE"}),[eS.LOADING]:(0,l.jsx)(p.Z,{color:"#1c8eec"})}[r]]})})}),(0,l.jsx)(eb.Z.Collapse,{eventKey:s,children:(0,l.jsx)(ey.Z.Body,{children:i})})]})},eC=e=>{let{service:s,data:r}=e;return(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"rss-date",children:["Last Published: ",r.pubDate?new Date(r.pubDate).toDateString():new Date(r.lastBuildDate).toDateString()]}),(0,l.jsx)("div",{className:"rss-title",children:r.title}),(0,l.jsx)("div",{className:"rss-item-list",children:r.items.map((e,r)=>{let{title:i,link:n,content:a,summary:t,pubDate:o}=e;return(0,l.jsxs)("div",{className:"rss-item",children:[(0,l.jsx)("div",{className:"rss-item-title",children:i}),(0,l.jsx)("div",{className:"rss-item-link",children:(0,l.jsx)("a",{target:"_blank",href:n,children:n})}),a&&(0,l.jsx)("div",{className:"rss-item-content",dangerouslySetInnerHTML:{__html:a}}),o&&(0,l.jsx)("div",{className:"rss-item-date",children:(0,l.jsx)("i",{children:new Date(o).toDateString()})}),t&&(0,l.jsx)("div",{className:"rss-item-content",children:t})]},"".concat(s,"-").concat(r))})})]})},ek=e=>{var s;let{title:r,data:i}=e;return(0,l.jsxs)(ew,{title:r,status:i.status,children:[(0,l.jsx)("div",{className:"status-url",children:i.statusUrl?(0,l.jsx)("a",{target:"_blank",href:(s=i.statusUrl,"Stripe"===r?s.slice(0,-7):s),children:"Status Page"}):(0,l.jsx)("span",{children:"Coming Soon"})}),!i.justUrl&&(0,l.jsx)(eC,{service:r,data:i})]})};let{publicRuntimeConfig:eE}=et()(),eA=e=>{let{children:s}=e;return(0,l.jsx)("span",{style:{color:"up"===s?"green":"red"},children:s})},eI=e=>{let{health:s}=e,r={};if(s)for(let[e,i]of Object.entries(s.details.clients))"string"!=typeof i&&(r[e]=i);return(0,l.jsx)("ul",{children:r&&Object.entries(r).map(e=>{let[s,{error:r,latency:i}]=e;return(0,l.jsxs)("li",{children:[s,": ",r&&(0,l.jsx)("span",{style:{color:"red"},children:r.message})||(0,l.jsx)("span",{style:{color:i&&i.length>5?"orange":"green"},children:i})]},s)})})};var eU=e=>{let{}=e,[s,r]=(0,o.useState)(),[i,n]=(0,o.useState)();return(0,o.useEffect)(()=>{(async()=>{try{let e=await fetch("".concat(eE.API_HOST,"/health/all")),s=await e.json();r(s)}catch(e){console.error("Could not load Core API health",e),n(e)}})()},[]),(0,l.jsx)(ew,{title:"Internal APIs",status:i?eS.NOT_OK:s?Object.values(s.info).some(e=>{let{status:s}=e;return"up"!==s})?eS.NOT_OK:eS.OK:eS.LOADING,children:s&&(0,l.jsxs)("ul",{children:[(0,l.jsxs)("li",{children:["Core API: ",(0,l.jsx)(eA,{children:s.details.app.status})]}),(0,l.jsxs)("li",{children:["Microservices: ",(0,l.jsx)(eA,{children:s.details.clients.status}),(0,l.jsx)(eI,{health:s})]})]})})},eM=()=>{var e,s;let[r,i]=(0,o.useState)(),[n,a]=(0,o.useState)();return(0,o.useEffect)(()=>{(async()=>{try{let e=await fetch("https://status.hubspot.com/api/v2/summary.json"),s=await e.json();i(s)}catch(e){console.error("Could not load HubSpot status api",e),a(e)}})()},[]),(0,l.jsxs)(ew,{title:"HubSpot",status:n?eS.NOT_OK:r?"none"===r.status.indicator?eS.OK:eS.NOT_OK:eS.LOADING,children:[(0,l.jsx)("div",{className:"status-url",children:(0,l.jsx)("a",{target:"_blank",href:"https://status.hubspot.com",children:(null==r?void 0:null===(e=r.status)||void 0===e?void 0:e.description)||"Status Page"})}),(null==r?void 0:null===(s=r.components)||void 0===s?void 0:s.length)&&(0,l.jsx)("ul",{children:r.components.map(e=>{let{id:s,name:r,status:i}=e;return(0,l.jsxs)("li",{children:[r,": ",(0,l.jsx)("span",{style:{color:"operational"===i?"green":"red"},children:i})]},s)})})]})},eO={"Thought Industries":"https://status.thoughtindustries.com/history.rss",Vimeo:"https://status.vhx.tv/history.rss",Bigcommerce:"https://status.bigcommerce.com/history.rss",ChargeBee:"https://status.chargebee.com/history.rss",Stripe:"https://status.stripe.com/current/atom.xml",Segment:"https://status.segment.com/history.rss",Zapier:"https://status.zapier.com/history.rss"},e_={Bigcommerce:"https://status.bigcommerce.com/",Vimeo:"https://status.vhx.tv/","Thought Industries":"https://status.thoughtindustries.com/",NetSuite:"https://status.netsuite.com/",ChargeBee:"https://status.chargebee.com/",Stripe:"https://status.stripe.com/current",Segment:"https://status.segment.com/",Zapier:"https://status.zapier.com/"};async function eX(e){try{let s=await fetch(e),r=await s.text();if(/netsuite/i.test(e)){if(/tool icon-indicator fa (fa-minus-square|fa-times|fa-exclamation-triangle)/.test(r))return eS.UNKNOWN;return eS.OK}if(/(All Systems Operational|All services are online)/.test(r))return eS.OK;return eS.NOT_OK}catch(e){return console.log("STATUS ERROR: ",{error:e}),eS.UNKNOWN}}async function eR(e,s){try{return await e.parseURL(eO[s])}catch(e){return console.log("RSS FAIL: ",{error:e}),{justUrl:!0}}}var eT=e=>{let{rss:s}=e,[r,i]=(0,o.useState)({}),[n,a]=(0,o.useState)(!0),[t,d]=(0,o.useState)(Date.now()),c=async()=>{a(!0);let e={};for(let s in eZ)e_[s]&&(e[s]={justUrl:!0,statusUrl:e_[s],status:await eX(e_[s])});i(e),a(!1)},u=async()=>{a(!0);let e=new(eN()),s={};for(let r in eZ)eO[r]?s[r]=await eR(e,r):s[r]={justUrl:!0},e_[r]&&(s[r].statusUrl=e_[r],s[r].status=await eX(e_[r]));i(s),a(!1)},h=s?u:c;return(0,o.useEffect)(()=>{h()},[]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(y.Z,{variant:"link",onClick:()=>{d(Date.now()),h()},children:"Refresh"}),(0,l.jsx)("br",{}),(0,l.jsx)("div",{id:"service-table",children:(0,l.jsxs)(eb.Z,{children:[n?(0,l.jsx)(ew,{title:"External Services",status:eS.LOADING}):Object.keys(eZ).map(e=>r[e]&&(0,l.jsx)(ek,{title:e,data:r[e]},e)),(0,l.jsx)(eM,{},"hubspot-".concat(t)),(0,l.jsx)(eU,{},"apis-".concat(t))]})})]})};let eG=Object.assign(()=>(0,l.jsxs)("div",{id:"service-statuses",children:[(0,l.jsx)(h.Z,{id:"heading",children:(0,l.jsx)(b.Z,{children:(0,l.jsx)("div",{className:"text",children:"Platform Status"})})}),(0,l.jsx)(h.Z,{children:(0,l.jsx)(b.Z,{children:(0,l.jsx)(eT,{})})})]}),{key:"service statuses"});var eL=r(19302);let eD=e=>{let{children:s}=e,[r,i]=s.split(" - ");return(0,l.jsxs)(l.Fragment,{children:[r,(0,l.jsx)("br",{}),(0,l.jsx)("small",{children:i})]})};var eF=e=>{var s,r,i,n,a,t;let d={url:"/groups",method:"get",headers:{Authorization:"Bearer ".concat(e.user.access_token)}},[c,u]=(0,o.useState)({groups:[],chosenGroup:"",query:"",searchInput:"",reverse:!1,loading:!1,error:!1,haveAllGroups:!1,loadingGroupError:!1,loadingMoreGroups:!1}),m=(0,eL.Z)(e=>{u(s=>({...s,query:e}))},1e3);async function x(){u(e=>({...e,loading:!0}));let e={...d,params:{max:25,search:c.query}};try{let s=await f.x.request(e);u(e=>({...e,groups:s.data,loading:!1}))}catch(e){u(e=>({...e,loading:!1,error:!0}))}}async function j(){u(e=>({...e,loadingMoreGroups:!0}));let e={...d,params:{first:c.groups.length,max:25}};c.query&&(e.params.search=c.query);try{let s=await f.x.request(e);
1if(s.data&&0!==s.data.length){let e=c.groups.concat(s.data);u(s=>({...s,groups:e,loadingMoreGroups:!1,loadingGroupError:!1,haveAllGroups:e.length%25!=0}))}else u(e=>({...e,loadingMoreGroups:!1,haveAllGroups:!0,loadingGroupError:!1}))}catch(e){u(e=>({...e,loadingMoreGroups:!1,loadingGroupError:!0}))}}function g(e,s){localStorage.setItem("redirectInfo",JSON.stringify({location:e,groupId:s}))}return((0,o.useEffect)(()=>{sessionStorage.removeItem("adminState"),sessionStorage.removeItem("groupSubscription"),sessionStorage.removeItem("userGroup"),x()},[]),(0,o.useEffect)(()=>{x()},[c.query]),c.error)?(0,l.jsx)("div",{className:"text-center",children:"There was a problem loading the groups."}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(h.Z,{id:"heading",children:(0,l.jsx)(b.Z,{children:(0,l.jsx)("div",{className:"text",children:"Groups"})})}),(0,l.jsx)(h.Z,{children:(0,l.jsx)(b.Z,{children:(0,l.jsxs)("div",{className:"admin-table-container",children:[(0,l.jsx)("div",{className:"admin-table-heading",children:(0,l.jsxs)("div",{className:"admin-table-search-container",children:[(0,l.jsx)("img",{src:"/static/images/icons/search-light.svg"}),(0,l.jsx)("input",{id:"admin-table-search",type:"text",onChange:function(e){e.persist(),u(s=>({...s,searchInput:e.target.value})),m.callback(e.target.value)},value:c.searchInput})]})}),(0,l.jsx)("div",{className:"admin-table-list-container",children:(0,l.jsxs)("table",{className:"admin-table-list",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{className:"group-list-header",children:[(0,l.jsx)("th",{children:(0,l.jsx)("div",{className:"th-text",children:"Name"})}),(0,l.jsx)("th",{children:(0,l.jsx)("div",{className:"th-text",children:"Diocese"})}),((null===(r=e.user)||void 0===r?void 0:null===(s=r.profile.roles)||void 0===s?void 0:s.includes("FORMED_SUPER_ADMIN"))||(null===(t=e.user)||void 0===t?void 0:null===(a=t.profile.resource_access)||void 0===a?void 0:null===(n=a.formed)||void 0===n?void 0:null===(i=n.roles)||void 0===i?void 0:i.includes("CUSTOMER_SERVICE")))&&(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("th",{})})]})}),!c.loading&&(0,l.jsx)("tbody",{children:c.groups.map(s=>{var r,i,n,a,t,o;return(0,l.jsxs)("tr",{children:[(0,l.jsxs)("td",{children:[!e.selectGroup&&(0,l.jsx)("a",{className:"group-link",href:"/admin?group=".concat(s.id),children:(0,l.jsx)(eD,{children:s.groupName})}),e.selectGroup&&(0,l.jsx)("a",{className:"group-link",onClick:()=>e.selectGroup(s.id),children:(0,l.jsx)(eD,{children:s.groupName})})]}),(0,l.jsx)("td",{children:s.diocese}),((null===(i=e.user)||void 0===i?void 0:null===(r=i.profile.roles)||void 0===r?void 0:r.includes("FORMED_SUPER_ADMIN"))||(null===(o=e.user)||void 0===o?void 0:null===(t=o.profile.resource_access)||void 0===t?void 0:null===(a=t.formed)||void 0===a?void 0:null===(n=a.roles)||void 0===n?void 0:n.includes("CUSTOMER_SERVICE")))&&(0,l.jsxs)("td",{className:"buttons",children:[(0,l.jsx)("a",{className:"button d-inline-block my-1 mr-2",href:"/admin",target:"_blank",onClick:()=>g("chargebeeUrl",s.id),children:"Chargebee Account"}),(0,l.jsx)("a",{className:"button d-inline-block my-1",href:"/admin",target:"_blank",onClick:()=>g("netsuiteUrl",s.id),children:"Netsuite Account"})]})]},s.id)})})]})}),!c.haveAllGroups&&!c.loadingGroupError&&c.groups.length>0&&!c.loading&&(0,l.jsx)("div",{className:"text-center",children:(0,l.jsx)(y.Z,{variant:"link",className:"load-more",onClick:j,children:"Load more"})}),(c.loading||c.loadingMoreGroups)&&(0,l.jsx)("div",{className:"text-center load-more",children:(0,l.jsx)(p.Z,{color:"#1c8eec"})}),c.loadingGroupError&&(0,l.jsx)("div",{className:"text-center load-more",children:"There was an error loading more groups."})]})})})]})},eP=e=>{let[s,r]=(0,o.useState)(void 0),[i,n]=(0,o.useState)(void 0);async function a(s){if(r(s),s){let r={url:"/groups/".concat(s),method:"get",headers:{Authorization:"Bearer ".concat(e.user.access_token)}},i=await e.apiClient.request(r);i.data&&i.data.name&&n(i.data.name)}}async function t(){let r={url:"/groups/".concat(e.group.id,"/members:move"),method:"post",headers:{Authorization:"Bearer ".concat(e.user.access_token)},data:{newGroupId:s}};await e.apiClient.request(r),e.handleClose()}return(0,l.jsxs)(g.Z,{show:e.show,backdropClassName:"admin-modal-backdrop",onHide:e.handleClose,dialogClassName:"update-profile-modal",size:"lg",centered:!0,children:[(0,l.jsxs)(g.Z.Header,{children:[(0,l.jsx)(g.Z.Title,{children:"Move Users to Another Group"}),(0,l.jsx)("button",{type:"button",className:"close",onClick:e.handleClose,children:(0,l.jsx)("span",{children:(0,l.jsx)(C.G,{icon:"times"})})})]}),(0,l.jsx)(g.Z.Body,{children:(0,l.jsxs)(l.Fragment,{children:[i&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("p",{children:[(0,l.jsx)("b",{children:"Selected Group:"})," ",i]}),(0,l.jsx)("a",{onClick:()=>a(void 0),children:"Select another group"})]}),s&&!i&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("p",{children:[(0,l.jsx)("b",{children:"Selected Group:"})," ",s]}),(0,l.jsx)("a",{onClick:()=>a(void 0),children:"Select another group"})]}),!s&&(0,l.jsx)(eF,{user:e.user,selectGroup:a})]})}),(0,l.jsxs)(g.Z.Footer,{children:[(0,l.jsx)(y.Z,{variant:"primary",onClick:t,children:"Move users"}),(0,l.jsx)(y.Z,{variant:"secondary",onClick:e.handleClose,children:"CANCEL"})]})]})},eB=e=>(0,l.jsx)("div",{className:"admin-table-list-container",children:(0,l.jsxs)("table",{className:"admin-table-list",children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"".concat("name"===e.sort?"sorting":""," ").concat(e.reverse?"reverse":""),children:(0,l.jsxs)(y.Z,{variant:"link",className:"load-more",onClick:()=>e.getUsers({sort:"name"}),children:[(0,l.jsx)("div",{className:"th-text",children:"Name"}),(0,l.jsx)("img",{className:"sort-arrow",src:"/static/images/icons/solid-down-arrow.svg"})]})}),(0,l.jsx)("th",{className:"".concat("email"===e.sort?"sorting":"","  ").concat(e.reverse?"reverse":""),children:(0,l.jsxs)(y.Z,{variant:"link",className:"load-more",onClick:()=>e.getUsers({sort:"email"}),children:[(0,l.jsx)("div",{className:"th-text",children:"Email"}),(0,l.jsx)("img",{className:"sort-arrow",src:"/static/images/icons/solid-down-arrow.svg"})]})}),(0,l.jsx)("th",{children:(0,l.jsx)(y.Z,{variant:"link",className:"load-more disabled",children:(0,l.jsx)("div",{className:"th-text",children:"Role"})})})]})}),!e.loading&&(0,l.jsx)("tbody",{children:e.users.map(s=>(0,l.jsxs)("tr",{children:[(0,l.jsxs)("td",{children:[s.firstName," ",s.lastName]}),(0,l.jsx)("td",{children:s.email}),(0,l.jsxs)("td",{className:"control-td",children:[s.id===e.adminUser.profile.sub?s.formedRole:e.updatingRole===s.id?(0,l.jsx)(p.Z,{color:"#1c8eec"}):(0,l.jsxs)(X.Z,{onSelect:r=>{null!==r&&e.handleRoleChange(r,s)},children:[(0,l.jsx)(X.Z.Toggle,{variant:"primary",id:"role-change",children:s.formedRole}),(0,l.jsxs)(X.Z.Menu,{className:"role-change-menu",children:[(0,l.jsx)(X.Z.Item,{eventKey:"User",children:"User"}),(0,l.jsx)(X.Z.Item,{eventKey:"Formed Admin",children:"Formed Admin"}),(0,l.jsx)(X.Z.Item,{eventKey:"Group Admin",children:"Group Admin"})]})]}),s.email===e.adminUser.profile.email?"":e.deletingMember===s.id?(0,l.jsx)(p.Z,{color:"#1c8eec"}):(0,l.jsxs)(X.Z,{className:"user-actions",children:[(0,l.jsx)(X.Z.Toggle,{variant:"primary",id:"user-actions-control",children:(0,l.jsx)("img",{src:"/static/images/icons/ellipses.svg"})}),(0,l.jsx)(X.Z.Menu,{className:"user-actions-menu",children:(0,l.jsx)(X.Z.Item,{onClick:()=>{e.handleRemoveMember(s)},children:"Delete"})})]})]})]},s.id))})]})});function eK(){let e=(0,x._)(["/groups/","/members/","/roles"]);return eK=function(){return e},e}function eV(){let e=(0,x._)(["/groups/","/members/",""]);return eV=function(){return e},e}function eq(){let e=(0,x._)(["/groups/","/members/csv"]);return eq=function(){return e},e}function ez(){let e=(0,x._)(["/groups/","/members"]);return ez=function(){return e},e}async function eH(e,s){return(await f.x.get((0,v.Z)(ez(),e),{params:s})).data}var eW=e=>{var s,r,i,n,a,t,d,c,u,h;let[m,x]=(0,o.useState)(!1),j=()=>x(!0),[g,N]=(0,o.useState)({users:[],loading:!1,loadingMoreUsers:!1,error:!1,query:"",haveAllUsers:!1,loadingUserError:!1,initialized:!1,reverse:!1,sort:"",role:"All Members",updatingRole:"",deletingMember:"",roleError:"",memberDeleteError:"",downloading:!1,downloadingError:!1,totalUsers:0,next:0,forbidden:!1});async function b(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{event:r,sort:i="name",reverseOverride:n=!1,role:a=g.role}=s,t=g.query;r&&(r.persist(),r.preventDefault(),a!==g.role?t="":r.target instanceof HTMLInputElement&&(t=r.target.value)),N(e=>({...e,loading:!0,initialized:!0,query:t}));let l=n?g.reverse:g.sort===i&&!g.reverse;try{let s=await eH(e.group.id,{max:25,sort:i,reverse:l,role:a,search:t||void 0});
1N(e=>({...e,users:s.list,sort:i,reverse:l,role:a,loading:!1,error:!1,next:s.first+s.max,haveAllUsers:s.first+s.max>=s.total,totalUsers:s.total}))}catch(s){var o;let e=(null==s?void 0:null===(o=s.response)||void 0===o?void 0:o.status)===403;N(s=>({...s,loading:!1,error:!e,forbidden:e}))}}async function Z(){N(e=>({...e,loadingMoreUsers:!0}));try{let s=await eH(e.group.id,{first:g.next,sort:g.sort,reverse:g.reverse,role:g.role,max:25,search:g.query?g.query:void 0});if(s.list&&0!==s.list.length){let e=g.users.concat(s.list);N(r=>({...r,users:e,loadingMoreUsers:!1,loadingUserError:!1,next:s.first+s.max,haveAllUsers:s.first+s.max>=s.total,totalUsers:s.total}))}else N(e=>({...e,loadingMoreUsers:!1,haveAllUsers:!0,loadingUserError:!1}))}catch(e){N(e=>({...e,loadingMoreUsers:!1,loadingUserError:!0}))}}async function S(s,r){if(s!==r.formedRole){N(e=>({...e,updatingRole:r.id}));try{await f.x.request({method:"put",url:(0,v.Z)(eK(),e.group.id,r.id),headers:{Authorization:"Bearer ".concat(e.user.access_token)},data:{roles:"User"===s?[]:[s.toUpperCase().replace(" ","_")]}}),r.formedRole=s,N(e=>({...e,users:g.users,roleError:"",updatingRole:""}))}catch(e){N(s=>({...s,roleError:"No input"!==e.message?r.email:"",updatingRole:""}))}}}async function w(s){N(e=>({...e,deletingMember:s.id}));try{await f.x.delete((0,v.Z)(eV(),e.group.id,s.id)),N(e=>({...e,users:e.users.filter(e=>
1e.id!==s.id),memberDeleteError:"",deletingMember:""}))}catch(e){N(e=>({...e,memberDeleteError:s.email,deletingMember:""}))}}async function k(){N(e=>({...e,downloading:!0}));try{let s=await f.x.get((0,v.Z)(eq(),e.group.id)),r=window.URL.createObjectURL(new Blob([s.data],{type:"text/csv"})),i=document.createElement("a");i.href=r,i.download="groupMembers-".concat(new Date().toISOString().substring(0,10),".csv"),i.click(),i.remove(),window.URL.revokeObjectURL(r),N(e=>({...e,downloading:!1,downloadError:!1}))}catch(e){N(e=>({...e,downloading:!1,downloadError:!0}))}}return(g.initialized||b(),g.loading)?(0,l.jsx)("div",{className:"text-center",style:{padding:"100px"},children:(0,l.jsx)(p.Z,{color:"#1c8eec"})}):g.forbidden?(0,l.jsxs)("div",{className:"text-center",style:{padding:"40px"},children:[(0,l.jsx)(C.G,{icon:"lock",size:"4x",style:{marginBottom:"20px"}}),(0,l.jsx)("h4",{children:"You do not have permission to view group members."}),(0,l.jsxs)("p",{children:["If you believe you should have access, please contact your group administrator or"," ",(0,l.jsx)("a",{href:"mailto:[email protected]",children:"[email protected]"})]})]}):g.error?(0,l.jsx)("div",{className:"text-center",children:"There was a problem loading the users for your group"}):(0,l.jsxs)("div",{className:"admin-table-container card",children:[g.roleError&&(0,l.jsxs)("div",{className:"error-message",children:["There was an error updating the role for ",g.roleError]}),g.memberDeleteError&&(0,l.jsxs)("div",{className:"error-message",children:["There was an error removing member ",g.memberDeleteError]}),(0,l.jsxs)("div",{className:"admin-table-heading",children:[(0,l.jsxs)("div",{className:"role-sort-container",children:[(0,l.jsx)("span",{className:"sort-role-selection",children:g.role}),(0,l.jsx)("span",{children:(0,l.jsxs)(X.Z,{onSelect:e=>{e&&e!==g.role&&b({role:e,reverseOverride:!0,sort:g.sort})},children:[(0,l.jsx)(X.Z.Toggle,{variant:"primary",id:"role-sort",children:(0,l.jsx)("img",{src:"/static/images/icons/angle-down.svg"})}),(0,l.jsxs)(X.Z.Menu,{className:"role-sort-menu",children:[(0,l.jsx)(X.Z.Item,{eventKey:"All Members",children:"All Members"}),(0,l.jsx)(X.Z.Item,{eventKey:"Users",children:"Users"}),(0,l.jsx)(X.Z.Item,{eventKey:"Admins",children:"Admins"})]})]})})]}),((null===(r=e.user)||void 0===r?void 0:null===(s=r.profile.roles)||void 0===s?void 0:s.includes("FORMED_SUPER_ADMIN"))||(null===(t=e.user)||void 0===t?void 0:null===(a=t.profile.resource_access)||void 0===a?void 0:null===(n=a.formed)||void 0===n?void 0:null===(i=n.roles)||void 0===i?void 0:i.includes("CUSTOMER_SERVICE")))&&(0,l.jsx)(y.Z,{variant:"primary",type:"button",className:"move-users-button",onClick:j,children:"Move Users"}),!g.downloadingError&&(0,l.jsx)(l.Fragment,{children:g.downloading?(0,l.jsx)(p.Z,{color:"#1c8eec"}):(0,l.jsx)(y.Z,{id:"download-csv",variant:"primary",onClick:k,children:"Download CSV"})}),g.downloadingError&&(0,l.jsx)("div",{className:"error-message",children:"There was an error downloading the CSV."}),(0,l.jsxs)("div",{className:"admin-table-search-container",children:[(0,l.jsx)("img",{src:"/static/images/icons/search-light.svg"}),(0,l.jsx)("form",{onSubmit:e=>{b({event:e,reverseOverride:!0,sort:g.sort})},children:(0,l.jsx)("input",{id:"admin-table-search",type:"text",onChange:e=>{e.persist(),N(s=>({...s,query:e.target.value})),e.target.value||b({event:e,reverseOverride:!0,sort:g.sort})},value:g.query})})]})]}),(0,l.jsx)(eB,{loading:g.loading,getUsers:b,reverse:g.reverse,sort:g.sort,adminUser:e.user,users:g.users,updatingRole:g.updatingRole,deletingMember:g.deletingMember,handleRoleChange:S,handleRemoveMember:w}),!g.haveAllUsers&&!g.loadingUserError&&g.users.length>0&&!g.loading&&(0,l.jsx)("div",{className:"text-center",children:(0,l.jsxs)(y.Z,{variant:"link",className:"load-more",onClick:Z,children:["Load more (page ",Math.floor(g.next/25)," of ",Math.
1ceil(g.totalUsers/25),")"]})}),(g.loading||g.loadingMoreUsers)&&(0,l.jsx)("div",{className:"text-center load-more",children:(0,l.jsx)(p.Z,{color:"#1c8eec"})}),g.loadingUserError&&(0,l.jsx)("div",{className:"text-center load-more",children:"There was an error loading more users."}),((null===(d=e.user.profile.roles)||void 0===d?void 0:d.includes("FORMED_SUPER_ADMIN"))||(null===(h=e.user.profile.resource_access)||void 0===h?void 0:null===(u=h.formed)||void 0===u?void 0:null===(c=u.roles)||void 0===c?void 0:c.includes("CUSTOMER_SERVICE")))&&(0,l.jsx)(eP,{show:m,setShow:x,handleClose:()=>{b(),x(!1)},handleShow:j,apiClient:f.x,user:e.user,group:e.group})]})};let eJ=Object.assign(e=>(0,l.jsxs)("div",{id:"user-page",children:[(0,l.jsx)(h.Z,{id:"heading",children:(0,l.jsx)(b.Z,{children:(0,l.jsx)("div",{className:"text",children:"Users"})})}),(0,l.jsx)(h.Z,{children:(0,l.jsx)(b.Z,{children:(0,l.jsx)(eW,{group:e.group,user:e.user})})})]}),{key:"users"}),eQ={[es.key]:es,[K.key]:K,[eJ.key]:eJ,[W.key]:W},eY={[es.key]:"home",[K.key]:"profile"};var e$=r(89894),e0=e=>(0,l.jsxs)(g.Z,{show:e.show,backdropClassName:"admin-modal-backdrop",onHide:e.handleClose,dialogClassName:"update-subscription-modal",size:"lg",centered:!0,children:[(0,l.jsxs)(g.Z.Header,{children:[(0,l.jsx)(g.Z.Title,{children:"New Subscription"}),(0,l.jsx)("button",{type:"button",className:"close",onClick:e.handleClose,children:(0,l.jsx)("span",{children:(0,l.jsx)(C.G,{icon:"times"})})})]}),(0,l.jsx)(g.Z.Body,{className:"admin-subscribe",children:(0,l.jsx)(e$.Z,{embed:!1,clientName:"formed",validating:!1,group:e.group,user:e.user})})]}),e1=r(74108),e2=r(58027),e8=e=>{let s=(e.user.profile.given_name.charAt(0)+e.user.profile.family_name.charAt(0)).toUpperCase(),r=(0,u.aC)();async function i(){await r.signoutRedirect()}return(0,l.jsxs)(e1.Z,{id:"nav-bar",children:[!e.hideSideMenuButton&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("img",{id:"hamburger-menu-button",src:"/static/images/icons/hamburger.svg",onClick:()=>e.toggleMenu()}),(0,l.jsx)("span",{className:"vertical-rule"})]}),(0,l.jsx)("img",{id:"home-icon",src:"/static/images/icons/home.svg",onClick:()=>e.changeView(es.key,es.key)}),(0,l.jsx)(e1.Z.Brand,{children:(0,l.jsx)("img",{src:"/static/images/icons/formed-logo-admin.svg",id:"formed-icon"})}),e.showChangeGroupButton&&(0,l.jsx)(e2.Z.Link,{href:"/admin",children:"Change Group"}),e.showPlatformStatusLink&&(0,l.jsx)(e2.Z.Link,{onClick:()=>e.changeView(eG.key),children:"Platform Status"}),e.showMergeKeycloakUsersLink&&(0,l.jsx)(e2.Z.Link,{onClick:()=>e.changeView(ev.key),children:"Merge Keycloak Users"}),e.showManageUsersLink&&(0,l.jsx)(e2.Z.Link,{onClick:()=>e.changeView(ep.key),children:"Manage Users"}),(0,l.jsxs)(e1.Z.Collapse,{className:"justify-content-end",children:[(0,l.jsx)("span",{className:"vertical-rule"}),(0,l.jsx)(e1.Z.Text,{children:(0,l.jsxs)(X.Z,{children:[(0,l.jsx)(X.Z.Toggle,{id:"user-initials",children:(0,l.jsx)("span",{children:s})}),(0,l.jsx)(X.Z.Menu,{children:(0,l.jsx)(X.Z.Item,{onClick:i,children:"Logout"})})]})})]})]})},e3=r(73190);let{publicRuntimeConfig:e5}=et()(),{FORMED_APP_ORIGIN:e9}=e5;var e4=e=>{var s;return(0,l.jsxs)(e3.push,{disableAutoFocus:!0,isOpen:e.menuOpen,pageWrapId:"admin",outerContainerId:"admin-container",customBurgerIcon:!1,customCrossIcon:!1,onStateChange:s=>e.handleMenuStateChange(s),width:"226px",children:[Object.keys(eQ).map(s=>(0,l.jsx)("a",{className:e.currentView===s?"active":"",onClick:()=>e.changeView(s),children:s},s)),e.subscriptionUrl&&(0,l.jsx)("div",{children:e.subscriptionUrl.includes("newSubscription")?(0,l.jsx)("a",{href:"/subscribe?groupId=".concat((null===(s=e.group)||void 0===s?void 0:s.id)||""),children:"New Subscription"},"subscription"):(0,l.jsx)("a",{href:e.subscriptionUrl,children:"Subscription"},"subscription")}),(0,l.jsx)("a",{className:"small-grey first",href:e9,children:"Formed"}),(0,l.jsx)("a",{className:"small-grey",href:"https://help.formed.org/support/home",children:"Help"}),(0,l.jsx)("a",{className:"small-grey",href:"https://leaders.formed.org/",children:"Leaders"})]})},e7=e=>{let{message:s,children:r}=e;return(0,l.jsxs)("div",{className:"error-message",children:[s,(0,l.jsx)("br",{}),(0,l.jsx)("br",{}),r&&(0,l.jsxs)(l.Fragment,{children:[r,(0,l.jsx)("br",{}),(0,l.jsx)("br",{})]}),"Please contact ",(0,l.jsx)("a",{href:"mailto:[email protected]",children:"Parish Care"})," if this issue persists."]})};function e6(){let e=(0,x._)(["/groups/",""]);return e6=function(){return e},e}var se=()=>{var e,s,r,i;let n;let a=(0,j.useRouter)(),{query:t}=a,d=Array.isArray(t.page)?t.page[0]:t.page||"home",{publicRuntimeConfig:c}=et()(),h=c.PERMISSION_TO_MERGE?JSON.parse(c.PERMISSION_TO_MERGE):[],m=(0,u.aC)(),x=m.user,b=null==x?void 0:x.profile.roles,y=null==x?void 0:null===(r=x.profile)||void 0===r?void 0:null===(s=r.resource_access)||void 0===s?void 0:null===(e=s.formed)||void 0===e?void 0:e.roles,Z=(null==b?void 0:b.includes("FORMED_SUPER_ADMIN"))||(null==y?void 0:y.includes("CUSTOMER_SERVICE")),{data:S,...w}=N(m.isAuthenticated&&"/groups"),C=(Array.isArray(t.group)?t.group[0]:t.group)||!Z&&(null==S?void 0:null===(i=S[0])||void 0===i?void 0:i.id)||void 0,{data:k,reload:E}=N(m.isAuthenticated&&(0,v.Z)(e6(),C)),[A,I]=(0,o.useState)({menuOpen:!1,currentTab:Object.keys(eY)[0],expiredModalShow:!1,subscriptionErrorShow:!1,subscriptionNewShow:!1,connectionErrorShow:!1,hasQueryId:!!t.group}
1),[U,M]=(0,o.useState)();async function O(e,s){_(e,s).then(e=>{e?M(e):M("newSubscription")}).catch(()=>{R()})}async function _(e,s){let r={url:"/groups/".concat(e.id,"/subscription/chargebee"),method:"get",headers:{Authorization:"Bearer ".concat(s.access_token)}};return(await f.x.request(r)).data}async function X(e,s){if(x){let r={url:"/groups/".concat(e,"/").concat(s),method:"get",headers:{Authorization:"Bearer ".concat(x.access_token)}};try{let e=await f.x.request(r);localStorage.clear(),window.location.href=e.data}catch(e){localStorage.clear(),I(e=>({...e,connectionErrorShow:!0}))}}}function R(){I(e=>({...e,subscriptionErrorShow:!A.subscriptionErrorShow}))}function T(){k&&x&&O(k,x).then(()=>{U&&U.includes("newSubscription")?I(e=>({...e,subscriptionNewShow:!A.subscriptionNewShow})):window.location.href="/admin?group=".concat(k.id)})}function G(){sessionStorage.removeItem("groupSubscription")}function L(){I(e=>({...e,menuOpen:!1}))}function D(e){I(s=>({...s,currentTab:e}))}function F(e,s){e!==d?(I(r=>({...r,currentTab:s||eY[e],menuOpen:!1})),a.push({pathname:"/admin/".concat(e),query:{...t,page:void 0}})):L()}async function P(){await m.removeUser()}async function B(e){return e.preventDefault(),await m.removeUser(),!0}function K(){return(null==b?void 0:b.includes("GROUP_ADMIN"))||(null==y?void 0:y.includes("ADMIN"))||!1}function V(){return!!x&&(!!Z||!!S&&!!(S.length>1))}async function z(){await m.removeUser(),await m.signoutRedirect()}return(0,o.useEffect)(()=>{let e=eY[d];e&&I(s=>({...s,currentTab:e}))},[d,I]),(0,o.useEffect)(()=>{n=f.x.interceptors.response.use(e=>e,e=>(e.response&&401===e.response.status&&I(e=>({...e,expiredModalShow:!0})),Promise.reject(e)));var e=localStorage.getItem("redirectInfo");e&&X((e=JSON.parse(e)).groupId,e.location),window.addEventListener("beforeunload",G)},[]),(0,o.useEffect)(()=>{k&&x&&O(k,x)},[k,x]),(0,o.useEffect)(()=>()=>{f.x.interceptors.response.eject(n),n=null,window.removeEventListener("beforeunload",G)},[]),w.error?(0,l.jsxs)(e7,{message:"Error Loading Groups",children:["Please log out to retry:"," ",(0,l.jsx)("a",{className:"button",onClick:z,children:"Log Out"})]}):(0,l.jsxs)(l.Fragment,{children:[!x||!K()&&!V()&&(0,l.jsxs)("div",{id:"admin",className:"not-an-admin",children:[(0,l.jsx)("nav",{id:"nav-bar",className:"navbar navbar-expand navbar-light",children:(0,l.jsx)("span",{className:"navbar-brand",children:(0,l.jsx)("img",{src:"/static/images/icons/formed-logo-admin.svg",id:"formed-icon"})})}),(0,l.jsx)("div",{className:"no-admin-title",children:(0,l.jsx)("h2",{children:"Access Error"})}),(0,l.jsx)("div",{className:"no-admin-text",children:(0,l.jsx)("p",{children:"This tool is accessible only to Formed administrators."})}),(0,l.jsx)("div",{className:"no-admin-text",children:(0,l.jsx)("p",{children:"For assistance, please contact customer service at 866-767-3155."})}),(0,l.jsx)("div",{children:(0,l.jsx)("a",{onClick:P,children:"Return to Formed"})})]}),x&&(K()||V())&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(e4,{menuOpen:A.menuOpen,handleMenuStateChange:function(e){I(s=>({...s,menuOpen:e.isOpen}))},closeMenu:L,changeView:F,currentView:d,subscriptionUrl:U,toggleSubscriptionNewModal:T,user:x,group:k}),(0,l.jsxs)("div",{id:"admin",children:[(0,l.jsx)(e8,{user:x,toggleMenu:function(){I(e=>({...e,menuOpen:!A.menuOpen}))},changeView:F,hideSideMenuButton:V()&&!A.hasQueryId,showChangeGroupButton:V()&&(A.hasQueryId||[eG.key,ev.key,ep.key].includes(d)),showPlatformStatusLink:x&&!!(null==b?void 0:b.includes("FORMED_SUPER_ADMIN")),showMergeKeycloakUsersLink:h.includes(x.profile.sub),showManageUsersLink:!!Z}),(0,l.jsx)("div",{id:"below-header",children:(()=>{switch(d){case eG.key:return(0,l.jsx)(eG,{});case ev.key:return(0,l.jsx)(ev,{});case ep.key:return(0,l.jsx)(ep,{user:x});default:return(0,l.jsxs)("div",{children:[V()&&!A.hasQueryId&&!localStorage.getItem("redirectInfo")&&(0,l.jsx)(eF,{user:x}),k&&(K()&&!V()||V()&&A.hasQueryId)&&!localStorage.getItem("redirectInfo")&&function(e,s,r){if(e===q.key)return(0,l.jsx)(q,{groupId:r.id});let i={user:s,group:r,changeTab:D,activeTab:A.currentTab,changeView:F,subscriptionUrl:U,toggleSubscriptionNewModal:T,reloadGroup:E},n=eQ[e];return n?(0,l.jsx)(n,{...i}):(0,l.jsx)(e7,{message:"Admin View Not Found"})}(d,x,k),localStorage.getItem("redirectInfo")&&(0,l.jsx)("div",{className:"text-center load-more",children:(0,l.jsx)(p.Z,{color:"#1c8eec"})})]})}})()})]}),(0,l.jsxs)(g.Z,{id:"expired-modal",show:A.expiredModalShow,backdropClassName:"admin-modal-backdrop",dialogClassName:"session-expired-modal",size:"sm",centered:!0,children:[(0,l.jsx)(g.Z.Header,{children:(0,l.jsx)(g.Z.Title,{children:"Session Expired"})}),(0,l.jsx)(g.Z.Body,{children:(0,l.jsx)("a",{href:"/admin",onClick:B,children:"Click here to login"})})]}),(0,l.jsxs)(g.Z,{show:A.subscriptionErrorShow&&!A.expiredModalShow,onHide:R,backdropClassName:"admin-modal-backdrop",dialogClassName:"session-expired-modal",size:"lg",centered:!0,children:[(0,l.jsx)(g.Z.Header,{children:(0,l.jsx)(g.Z.Title,{children:"Group Subscription 
1Error"})}),(0,l.jsx)(g.Z.Body,{children:(0,l.jsxs)("div",{children:["There was a problem accessing your subscription. Please contact ",(0,l.jsx)("a",{href:"help.formed.org",children:"Parish Care"}),"."]})})]}),(0,l.jsxs)(g.Z,{show:A.connectionErrorShow&&!A.expiredModalShow,onHide:function(){I(e=>({...e,connectionErrorShow:!A.connectionErrorShow}))},backdropClassName:"admin-modal-backdrop",dialogClassName:"session-expired-modal",size:"lg",centered:!0,children:[(0,l.jsx)(g.Z.Header,{children:(0,l.jsx)(g.Z.Title,{children:"Connection Error 404"})}),(0,l.jsx)(g.Z.Body,{children:(0,l.jsx)("div",{children:"Group Not Found in Backend."})})]}),!!k&&(0,l.jsx)(e0,{show:A.subscriptionNewShow,handleClose:T,user:x,group:k})]})]})},ss=r(89678),sr=()=>{let e=(0,u.aC)(),[s,r]=(0,o.useState)(!0),i=(0,o.useRef)(!1);return(0,o.useEffect)(()=>{(0,u.ir)()||e.isAuthenticated||e.activeNavigator||e.isLoading||e.signinRedirect({redirect_uri:window.location.href})},[e.isAuthenticated,e.activeNavigator,e.isLoading,e.signinRedirect]),(0,o.useEffect)(()=>{if(!e.isAuthenticated||e.isLoading||e.activeNavigator||i.current)return;i.current=!0;let s=setTimeout(()=>{console.warn("Silent token refresh timed out on /admin, proceeding anyway"),r(!1)},5e3);return e.signinSilent().catch(e=>{console.warn("Silent token refresh failed on /admin",e)}).finally(()=>{clearTimeout(s),r(!1)}),()=>{clearTimeout(s)}},[e.isAuthenticated,e.isLoading,e.activeNavigator,e.signinSilent]),(0,l.jsxs)(m.Z,{children:[(0,l.jsx)(c(),{children:(0,l.jsx)("title",{children:"Formed Admin"})}),(0,l.jsx)(h.Z,{id:"admin-container",children:e.isAuthenticated?s?(0,l.jsx)(ss.Z,{}):(0,l.jsx)(se,{}):e.error&&(0,l.jsx)(e7,{message:e.error.message})})]})}},32117:function(e,s,r){r.d(s,{Z:function(){return i}});function i(e){for(var s=arguments.length,r=Array(s>1?s-1:0),i=1;i<s;i++)r[i-1]=arguments[i];let n="";for(let s=0;s<r.length;s++){let i=r[s];if(null==i)return;n+=e[s]+encodeURIComponent(String(i))}return n+e[r.length]}}}]);

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.