1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/styles-mpRU3QBU.js","assets/index-ClmBgQw8.js","assets/eventRegistration-CpAlICDT.css"])))=>i.map(i=>d[i]); 2var Es=Object.defineProperty;var ks=(a,r,t)=>r in a?Es(a,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[r]=t;var i=(a,r,t)=>ks(a,typeof r!="symbol"?r+"":r,t);import{R as I,j as e,bZ as Ts,b_ as Ht,r as F,g as Is,b$ as As,af as ye,aF as h,c0 as Pt,c1 as X,c2 as We,az as R,c3 as ke,c4 as Le,c5 as Vt,c6 as Ue,c7 as Nt,c8 as me,H as Y,n as j,c9 as Ms,ca as Ee,cb as Et,a_ as we,a$ as Se,bJ as kt,J as C,K as v,bf as Ds,bg as Rs,bC as fe,cc as ue,b6 as O,cd as Tt,aL as le,bu as G,bb as ce,b2 as K,z as ge,bq as Fs,bd as Ae,bs as Ke,ba as D,b7 as A,b9 as pe,ce as Ze,cf as et,cg as _s,ch as Ls,L as J,ci as Os,M as Me,cj as tt,ck as ze,cl as Bs,cm as ot,cn as qs,co as $s,cp as Wt,cq as Us,I as xe,cr as be,cs as Pe,au as zs,ct as Hs,cu as Vs,cv as Kt,a3 as lt,a2 as dt,a0 as ct,a1 as mt,Z as ht,bQ as Ne,cw as Ws,as as ve,b1 as st,cx as Ks,cy as Gt,aX as at,cz as Gs,cA as Ys,cB as Qs,cC as Xs,cD as ut,cE as Js,cF as Zs,b8 as Ce,cG as ea,a7 as He,cH as ta,cI as It,cJ as Ve,b0 as Yt,aM as ne,bz as Qt,cK as Te,cL as At,cM as Ge,cN as Xt,cO as Ye,cP as Jt,cQ as Mt,cR as sa,cS as aa,cT as Zt,cU as na,O as ra,cV as ia,Q as oa,P as la,cW as da,aK as es,cX as ts,cY as Qe,bM as ca,cZ as ma,c_ as ha,c$ as ua,d0 as pa,d1 as ga,d2 as xa,d3 as fa,d4 as ya,d5 as je,bY as ss,d6 as ba,d7 as va,bE as as,b5 as ns,d8 as ja,d9 as Ca,da as Sa,db as rs,dc as wa,dd as is,de,bW as Pa,df as Dt,dg as Na,dh as Ea,aY as os,W as ka,di as Ta,dj as Ia,dk as Aa,dl as Ma,dm as Da,dn as Ra,dp as Fa,dq as _a,dr as La,S as pt,ds as gt,a as $,dt as nt,du as ls,dv as Re,dw as Oa,aH as Ba,aG as qa,dx as Oe,dy as $a,dz as Ua,dA as za,dB as ds,bP as xt,dC as Ha,dD as Va,dE as Wa,dF as Ka,aJ as Ga,aN as Ya,dG as Qa,_ as ft,dH as Rt,dI as cs,dJ as ms,bU as Xa,dK as yt,dL as bt,dM as Ie,dN as qe,dO as Ja,dP as Za,dQ as en,dR as tn,dS as sn,dT as an,dU as nn,dV as rn,ag as $e,dW as on,dX as ln,dY as dn,dZ as cn,d_ as mn,d$ as hs,D as hn,G as us,e0 as un,ad as pn,e1 as gn,e2 as xn,e3 as fn,e4 as yn,ah as bn,e5 as vn,e6 as jn,e7 as Cn,e8 as Sn,e9 as wn}from"./index-ClmBgQw8.js";import{R as Pn,A as Nn,l as En}from"./loadWebsiteStyles-BHJM90_g.js";import{H as kn,N as rt,g as Tn,a as In,b as An,e as ps,B as Mn,M as Dn,O as Rn,S as Fn,c as Ft,d as _n,R as Ln,f as De,A as On,U as Bn,C as qn,P as $n,q as Un,Q as zn,h as oe,i as _t,j as Hn,T as Lt,t as Vn,k as Wn,l as Fe,m as Kn,n as Gn,o as Yn,p as Qn,E as Xn,r as Jn,s as Ot,u as Zn,v as er,F as tr}from"./RobotsRedirect-CIU1CAsc.js";import"./getDayName-BlYa9-_H.js";let gs=class extends I.Component{constructor(t){super(t);i(this,"initialState",()=>({expanded:!1}));i(this,"handleToggleMenu",()=>{this.setState(t=>({expanded:!t.expanded}))});i(this,"handleOpenCustomerPortal",t=>{t==null||t.preventDefault(),this.context.openPortal()});this.state=this.initialState()}render(){if(!this.props.routes)return null;const t=this.props.defaults.headerDesign||"version1",s=kn.find(n=>n.value===t);return e.jsx(rt,{expanded:this.state.expanded,className:`fixed-top ${t}`,expand:"lg",children:e.jsx(s.comp,{routes:this.props.routes,defaults:this.props.defaults,membershipEnabled:this.props.membershipEnabled,sponsorshipEnabled:this.props.sponsorshipEnabled,eventsEnabled:this.props.eventsEnabled,history:this.props.history,onToggleMenu:this.handleToggleMenu,onOpenCustomerPortal:this.handleOpenCustomerPortal})})}};gs.contextType=Ts;const sr=()=>{const{pathname:a}=Ht();return F.useEffect(()=>{window.scrollTo(0,0)},[a]),null};var xs={},fs={},ys={};(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var r=function(){for(var n=arguments.length,d=new Array(n),o=0;o<n;o++)d[o]=arguments[o];if(typeof window<"u"){var l;typeof window.gtag>"u"&&(window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)}),(l=window).gtag.apply(l,d)}},t=r;a.default=t})(ys);var bs={};(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=o;var r=/^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;function t(l){return l.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g,function(c,b,g){return b>0&&b+c.length!==g.length&&c.search(r)>-1&&g.charAt(b-2)!==":"&&(g.charAt(b+c.length)!=="-"||g.charAt(b-1)==="-")&&g.charAt(b-1).search(/[^\s-]/)<0?c.toLowerCase():c.substr(1).search(/[A-Z]|\../)>-1?c:c.charAt(0).toUpperCase()+c.substr(1)})}function s(l){return typeof l=="string"&&l.indexOf("@")!==-1}var n="REDACTED (Potential Email Address)";function d(l){return s(l)?(console.warn("This arg looks like an email address, redacting."),n):l}function o(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,g=l||"";return c&&(g=t(l)),b&&(g=d(g)),g}})(bs);(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.default=a.GA4=void 0;var r=o(ys),t=o(bs),s=["eventCategory","eventAction","eventLabel","eventValue","hitType"],n=["title","location"],d=["page","hitType"];function o(x){return x&&x.__esModule?x:{default:x}}function l(x,m){if(x==null)return{};var u=c(x,m),p,y;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(x);for(y=0;y<w.length;y++)p=w[y],!(m.indexOf(p)>=0)&&Object.prototype.propertyIsEnumerable.call(x,p)&&(u[p]=x[p])}return u}function c(x,m){if(x==null)return{};var u={},p=Object.keys(x),y,w;for(w=0;w<p.length;w++)y=p[w],!(m.indexOf(y)>=0)&&(u[y]=x[y]);return u}function b(x){"@babel/helpers - typeof";return b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},b(x)}function g(x){return E(x)||S(x)||_(x)||N()}function N(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 3In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S(x){if(typeof Symbol<"u"&&x[Symbol.iterator]!=null||x["@@iterator"]!=null)return Array.from(x)}function E(x){if(Array.isArray(x))return V(x)}function T(x,m){var u=Object.keys(x);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(x);m&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),u.push.apply(u,p)}return u}function k(x){for(var m=1;m<arguments.length;m++){var u=arguments[m]!=null?arguments[m]:{};
3m%2?T(Object(u),!0).forEach(function(p){f(x,p,u[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(u)):T(Object(u)).forEach(function(p){Object.defineProperty(x,p,Object.getOwnPropertyDescriptor(u,p))})}return x}function P(x,m){return ae(x)||H(x,m)||_(x,m)||M()}function M(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _(x,m){if(x){if(typeof x=="string")return V(x,m);var u=Object.prototype.toString.call(x).slice(8,-1);if(u==="Object"&&x.constructor&&(u=x.constructor.name),u==="Map"||u==="Set")return Array.from(x);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return V(x,m)}}function V(x,m){(m==null||m>x.length)&&(m=x.length);for(var u=0,p=new Array(m);u<m;u++)p[u]=x[u];return p}function H(x,m){var u=x==null?null:typeof Symbol<"u"&&x[Symbol.iterator]||x["@@iterator"];if(u!=null){var p,y,w,z,W=[],q=!0,L=!1;try{if(w=(u=u.call(x)).next,m!==0)for(;!(q=(p=w.call(u)).done)&&(W.push(p.value),W.length!==m);q=!0);}catch(Z){L=!0,y=Z}finally{try{if(!q&&u.return!=null&&(z=u.return(),Object(z)!==z))return}finally{if(L)throw y}}return W}}function ae(x){if(Array.isArray(x))return x}function re(x,m){if(!(x instanceof m))throw new TypeError("Cannot call a class as a function")}function ee(x,m){for(var u=0;u<m.length;u++){var p=m[u];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(x,B(p.key),p)}}function he(x,m,u){return m&&ee(x.prototype,m),Object.defineProperty(x,"prototype",{writable:!1}),x}function f(x,m,u){return m=B(m),m in x?Object.defineProperty(x,m,{value:u,enumerable:!0,configurable:!0,writable:!0}):x[m]=u,x}function B(x){var m=U(x,"string");return b(m)==="symbol"?m:String(m)}function U(x,m){if(b(x)!=="object"||x===null)return x;var u=x[Symbol.toPrimitive];if(u!==void 0){var p=u.call(x,m||"default");if(b(p)!=="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(x)}var Q=function(){function x(){var m=this;re(this,x),f(this,"reset",function(){m.isInitialized=!1,m._testMode=!1,m._currentMeasurementId,m._hasLoadedGA=!1,m._isQueuing=!1,m._queueGtag=[]}),f(this,"_gtag",function(){for(var u=arguments.length,p=new Array(u),y=0;y<u;y++)p[y]=arguments[y];m._testMode||m._isQueuing?m._queueGtag.push(p):r.default.apply(void 0,p)}),f(this,"_loadGA",function(u,p){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"https://www.googletagmanager.com/gtag/js";if(!(typeof window>"u"||typeof document>"u")&&!m._hasLoadedGA){var w=document.createElement("script");w.async=!0,w.src="".concat(y,"?id=").concat(u),p&&w.setAttribute("nonce",p),document.body.appendChild(w),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},m._hasLoadedGA=!0}}),f(this,"_toGtagOptions",function(u){if(u){var p={cookieUpdate:"cookie_update",cookieExpires:"cookie_expires",cookieDomain:"cookie_domain",cookieFlags:"cookie_flags",userId:"user_id",clientId:"client_id",anonymizeIp:"anonymize_ip",contentGroup1:"content_group1",contentGroup2:"content_group2",contentGroup3:"content_group3",contentGroup4:"content_group4",contentGroup5:"content_group5",allowAdFeatures:"allow_google_signals",allowAdPersonalizationSignals:"allow_ad_personalization_signals",nonInteraction:"non_interaction",page:"page_path",hitCallback:"event_callback"},y=Object.entries(u).reduce(function(w,z){var W=P(z,2),q=W[0],L=W[1];return p[q]?w[p[q]]=L:w[q]=L,w},{});return y}}),f(this,"initialize",function(u){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!u)throw new Error("Require GA_MEASUREMENT_ID");var y=typeof u=="string"?[{trackingId:u}]:u;m._currentMeasurementId=y[0].trackingId;var w=p.gaOptions,z=p.gtagOptions,W=p.nonce,q=p.testMode,L=q===void 0?!1:q,Z=p.gtagUrl;if(m._testMode=L,L||m._loadGA(m._currentMeasurementId,W,Z),m.isInitialized||(m._gtag("js",new Date),y.forEac
4h(function(Be){var wt=k(k(k({},m._toGtagOptions(k(k({},w),Be.gaOptions))),z),Be.gtagOptions);Object.keys(wt).length?m._gtag("config",Be.trackingId,wt):m._gtag("config",Be.trackingId)})),m.isInitialized=!0,!L){var Ct=g(m._queueGtag);for(m._queueGtag=[],m._isQueuing=!1;Ct.length;){var St=Ct.shift();m._gtag.apply(m,g(St)),St[0]==="get"&&(m._isQueuing=!0)}}}),f(this,"set",function(u){if(!u){console.warn("`fieldsObject` is required in .set()");return}if(b(u)!=="object"){console.warn("Expected `fieldsObject` arg to be an Object");return}Object.keys(u).length===0&&console.warn("empty `fieldsObject` given to .set()"),m._gaCommand("set",u)}),f(this,"_gaCommandSendEvent",function(u,p,y,w,z){m._gtag("event",p,k(k({event_category:u,event_label:y,value:w},z&&{non_interaction:z.nonInteraction}),m._toGtagOptions(z)))}),f(this,"_gaCommandSendEventParameters",function(){for(var u=arguments.length,p=new Array(u),y=0;y<u;y++)p[y]=arguments[y];if(typeof p[0]=="string")m._gaCommandSendEvent.apply(m,g(p.slice(1)));else{var w=p[0],z=w.eventCategory,W=w.eventAction,q=w.eventLabel,L=w.eventValue;w.hitType;var Z=l(w,s);m._gaCommandSendEvent(z,W,q,L,Z)}}),f(this,"_gaCommandSendTiming",function(u,p,y,w){m._gtag("event","timing_complete",{name:p,value:y,event_category:u,event_label:w})}),f(this,"_gaCommandSendPageview",function(u,p){if(p&&Object.keys(p).length){var y=m._toGtagOptions(p),w=y.title,z=y.location,W=l(y,n);m._gtag("event","page_view",k(k(k(k({},u&&{page_path:u}),w&&{page_title:w}),z&&{page_location:z}),W))}else u?m._gtag("event","page_view",{page_path:u}):m._gtag("event","page_view")}),f(this,"_gaCommandSendPageviewParameters",function(){for(var u=arguments.length,p=new Array(u),y=0;y<u;y++)p[y]=arguments[y];if(typeof p[0]=="string")m._gaCommandSendPageview.apply(m,g(p.slice(1)));else{var w=p[0],z=w.page;w.hitType;var W=l(w,d);m._gaCommandSendPageview(z,W)}}),f(this,"_gaCommandSend",function(){for(var u=arguments.length,p=new Array(u),y=0;y<u;y++)p[y]=arguments[y];var w=typeof p[0]=="string"?p[0]:p[0].hitType;switch(w){case"event":m._gaCommandSendEventParameters.apply(m,p);break;case"pageview":m._gaCommandSendPageviewParameters.apply(m,p);break;case"timing":m._gaCommandSendTiming.apply(m,g(p.slice(1)));break;case"screenview":case"transaction":case"item":case"social":case"exception":console.warn("Unsupported send command: ".concat(w));break;default:console.warn("Send command doesn't exist: ".concat(w))}}),f(this,"_gaCommandSet",function(){for(var u=arguments.length,p=new Array(u),y=0;y<u;y++)p[y]=arguments[y];typeof p[0]=="string"&&(p[0]=f({},p[0],p[1])),m._gtag("set",m._toGtagOptions(p[0]))}),f(this,"_gaCommand",function(u){for(var p=arguments.length,y=new Array(p>1?p-1:0),w=1;w<p;w++)y[w-1]=arguments[w];switch(u){case"send":m._gaCommandSend.apply(m,y);break;case"set":m._gaCommandSet.apply(m,y);break;default:console.warn("Command doesn't exist: ".concat(u))}}),f(this,"ga",function(){for(var u=arguments.length,p=new Array(u),y=0;y<u;y++)p[y]=arguments[y];if(typeof p[0]=="string")m._gaCommand.apply(m,p);else{var w=p[0];m._gtag("get",m._currentMeasurementId,"client_id",function(z){m._isQueuing=!1;var W=m._queueGtag;for(w({get:function(Z){return Z==="clientId"?z:Z==="trackingId"?m._currentMeasurementId:Z==="apiVersion"?"1":void 0}});W.length;){var q=W.shift();m._gtag.apply(m,g(q))}}),m._isQueuing=!0}return m.ga}),f(this,"event",function(u,p){if(typeof u=="string")m._gtag("event",u,m._toGtagOptions(p));else{var y=u.action,w=u.category,z=u.label,W=u.value,q=u.nonInteraction,L=u.transport;if(!w||!y){console.warn("args.category AND args.action are required in event()");return}var Z={hitType:"event",eventCategory:(0,t.default)(w),eventAction:(0,t.default)(y)};z&&(Z.eventLabel=(0,t.default)(z)),typeof W<"u"&&(typeof W!="number"?console.warn("Expected `args.value` arg to be a Number."):Z.eventValue=W),typeof q<"u"&&(typeof q!="boolean"?console.warn("`args.nonInteraction` must be a boolean."):Z.nonInteraction=q),typeof L<"u"&&(typeof L!="string"?console.warn("`args.transport` must be a string."):(["beacon","xhr","image"].indexOf(L)===-1&&console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"),Z.transport=L)),m._gaCommand("send",Z)}}),f(this,"send",function(u){m._gaCommand("send",u)}),this.reset()}return he(x,[{key:"gtag",value:function(){this._gtag.apply(this,arguments)}}]),x}();a.GA4=Q;var te=new Q;a.default=te})(fs);(function(a){function r(l){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},r(l)}Object.defineProperty(a,"__esModule",{value:!0}),a.default=a.ReactGAImplementation=void 0;var t=n(fs);function s(l){if(typeof WeakMap!="function")return null;var c=new WeakMap,b=new WeakMap;return(s=function(N){return N?b:c})(l)}
4function n(l,c){if(l&&l.__esModule)return l;if(l===null||r(l)!=="object"&&typeof l!="function")return{default:l};var b=s(c);if(b&&b.has(l))return b.get(l);var g={},N=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in l)if(S!=="default"&&Object.prototype.hasOwnProperty.call(l,S)){var E=N?Object.getOwnPropertyDescriptor(l,S):null;E&&(E.get||E.set)?Object.defineProperty(g,S,E):g[S]=l[S]}return g.default=l,b&&b.set(l,g),g}var d=t.GA4;a.ReactGAImplementation=d;var o=t.default;a.default=o})(xs);const Bt=Is(xs);class it extends I.Component{render(){const r=this.props.small?{width:35,height:35}:this.props.style,t=As({entityKey:this.props.userKey,entityName:"Customer"});return e.jsx("img",{src:t,className:"img-circle c-user-card__avatar",role:"presentation",alt:"user avatar",style:r})}}class ar extends I.Component{constructor(t){super(t);i(this,"onOpen",()=>{this.setState({tries:0,form:{password:""}})});i(this,"onChangePassword",t=>{this.setState(s=>({form:{...s.form,password:t}}))});i(this,"onKeyDown",t=>{(t.keyCode||t.which)===13&&this.ok()});i(this,"ok",()=>{this.setState({processing:!0});const{websiteDomain:t,websiteShorthand:s}=ye(),n={email:h().email,impersonateUserId:h().impersonating?Pt("userId"):null,password:this.state.form.password,accountId:Pt("accountId"),websiteDomain:t,websiteShorthand:s};X.post("/authentication/login",n,{success:d=>{this.setState(o=>({...o,processing:!1,form:{...o.form,password:""}})),We(d.data),this.props.onRelogin()},error:d=>{this.setState(o=>({processing:!1,tries:o.tries+1}),()=>{this.state.tries>=3?this.cancel():R(d.error.errorMessage)})}},{sensitive:!0})});i(this,"cancel",()=>{ke(),window.location.href=Le});this.state={visible:!1,processing:!1,tries:0,form:{password:""}}}static getDerivedStateFromProps(t,s){return s==null||t.visible!==s.visible?{visible:t.visible}:null}render(){return this.state.visible?e.jsxs("div",{className:"lockscreen-wrapper",children:[e.jsx(Vt,{onTimeout:this.cancel,minutes:4}),e.jsx("div",{className:"lockscreen-logo",children:e.jsx("img",{src:Ue(),className:"w-50",alt:"Login"})}),e.jsx("div",{className:"lockscreen-name",children:h().auditUserName}),e.jsxs("div",{className:"lockscreen-item",children:[e.jsx("div",{className:"lockscreen-image",children:e.jsx(it,{userKey:h().customerKey})}),e.jsx("div",{className:"lockscreen-credentials",children:e.jsxs(Nt,{children:[e.jsx(me,{"data-testid":"input-cpLockScreen-password",name:"password",formControl:!1,forcePlaceholder:!0,placeholder:"Password",required:!0,onChange:this.onChangePassword,onKeyDown:this.onKeyDown}),e.jsx(Nt.Append,{children:e.jsx(Y,{variant:"default",disabled:this.state.processing,onClick:this.ok,"data-testid":"btn-portalLockScreen-unlock",children:e.jsx(j,{icon:Ms,className:"text-muted"})})})]})})]}),e.jsx("div",{className:"help-block text-center",children:"Enter your password to retrieve your session,"}),e.jsx("div",{className:"text-center",children:e.jsx("a",{href:"#",onClick:this.cancel,children:"or sign in as a different user."})}),e.jsxs("div",{className:"lockscreen-footer text-center",children:[`© ${new Date().getUTCFullYear()} - ${h().accountName} - Version ${Ee().version}`,window.env.PSX_ENV!=="production"&&` / ${window.env.PSX_ENV}`]})]}):null}}class vs extends I.Component{constructor(t){super(t);i(this,"open",t=>{this.setState({visible:!0,customer:this.props.customer??t.customer,entityId:t.entityId,entityType:t.entityType,entityEmails:t.entityEmails,contactType:t.contactType,showAllCommunications:t.showAllCommunications,showingTemplates:!1,preSettedEmail:t.preSettedEmail,preSettedRecipients:t.preSettedRecipients,onMessageSent:t.onMessageSent,onSave:t.onSave,emailTemplateType:t.preSettedEmail?null:Et.COMMHUB_EMAIL,mergeFieldsCategories:t.mergeFieldsCategories,sendEmail:!1,showEmailDetails:t.showEmailDetails,allDetails:t.allDetails,canEditEmailSettings:t.canEditEmailSettings??!0})});i(this,"close",()=>{this.setState({visible:!1})});i(this,"_initialState",()=>({params:{},callbacks:{},visible:!1,saving:!1,sendEmail:!1,userEmailAccounts:[],showEmailDetails:!1,canEditEmailSettings:!0}));i(this,"_toggleShowTemplates",t=>{this.setState({showingTemplates:t})});i(this,"_handleCancel",()=>{this.close()});i(this,"renderPhone",()=>{var s;let t=[];return this.state.customer.phone&&(t=[...t,this.state.customer.phone]),this.state.customer.companyPhone&&(t=[...t,this.state.customer.companyPhone]),this.state.customer.primaryPhone&&(t=[...t,this.state.customer.primaryPhone]),this.state.customer.secondaryPhone&&(t=[...t,this.state.customer.secondaryPhone]),t.length===0?e.jsxs("i",{children:["No phone number information for this"," ",(s=h().nomenclatures)==null?void 0:s.customers.singularTerm.toLowerCase(),"."]}):t.map(n=>e.jsx(I.Fragment,{children:e.jsxs("p",{className:"mb-2",children:[e.jsxs("b",{children:[n.phoneTypeName,":"," "]}),n.number,"  ",e.jsx(we,{placement:"right",delay:250,overlay:e.jsx(Se,{id:`${n.phoneId}-phone-tooltip`,children:"Copied!"}),trigger:"click",rootClose:!0,children:e.jsx("span",{style:{cursor:"pointer"},children:e.jsx(j,{icon:kt,color:"#0056B3",onClick:()=>navigator.clipboard.writeText(n.number)})})})]})},n.phoneId))});i(this,"renderAddress",()=>{var s;let t=[];return this.state.customer.primaryAddress&&(t=[...t,{...this.state.customer.primaryAddress,addressId:this.state.customer.primaryAddressId,title:this.state.customer.primaryAddress.nickname}]),this.state.customer.secondaryAddress&&(t=[...t,{...this.state.customer.secondaryAddress,addressId:this.state.customer.secondaryAddressId,title:this.state.customer.secondaryAddress.nickname?this.state.customer.secondaryAddress.nickname:"Secondary"}]),t.length===0?e.jsx("i",{children:`No address information for this ${(s=h().nomenclatures)==null?void 0:s.customers.singularTerm.toLowerCase()}.`}):t.map((n,d)=>{let o=n.city;return n.stateName?o=`${o}, ${n.stateName}`:n.province&&(o=`${o}, ${n.province}`),n.zip&&(o=`${o}, ${n.zip}`),e.jsxs(I.Fragment,{children:[t.length>1&&n.title&&e.jsx("p",{className:`m-0 ${d!==0?"mt-2":""}`,children:e.jsx("b",{children:n.title})}),e.jsx("p",{className:"m-0",children:n.street1}),n.street2&&e.jsx("p",{className:"m-0",children:n.street2}),e.jsx("p",{className:"m-0",children:o}),n.countryName!=="United States"&&e.jsx("p",{className:"m-0",children:n.countryName})]},n.addressId)})});i(this,"renderEmail",()=>e.jsxs(e.Fragment,{children:[e.jsxs(C,{children:[e.jsx(v,{className:"ml-3",children:this._renderEntityEmails()}),this.state.userEmailAccounts.length>0&&e.jsx(v,{children:e.jsx("a",{className:"float-right mr-3",href:"#",onClick:()=>this.setState({sendEmail:!0}),children:e.jsx("i",{children:e.jsx("u",{children:"Send Email directly"})})})})]}
4),e.jsx(C,{children:e.jsx(v,{md:12,children:e.jsx(Ds,{entityId:this.state.entityId,entityTypeCode:this.state.entityType,systemFieldCode:Rs.ES,formControl:!1,showInactive:!0,showRequired:!1,isPortal:!0,disabled:h().readOnlySession||h().previewSession||!this.state.canEditEmailSettings,autoSave:!0})})})]}));i(this,"_handleMessageSent",()=>{this._handleCancel(),this.state.onMessageSent&&this.state.onMessageSent()});i(this,"_handleOnEmailTemplateTypeChange",t=>{this.setState({emailTemplateType:t})});i(this,"_renderEntityEmails",()=>{var t;return this.state.entityEmails.length===0?e.jsx("i",{children:`No email information for this ${(t=h().nomenclatures)==null?void 0:t.customers.singularTerm.toLowerCase()}.`}):this.state.entityEmails.map((s,n)=>e.jsx(C,{children:e.jsxs("p",{children:[e.jsxs("b",{children:[this.state.entityType===fe.CONTACT&&this.state.entityEmails.length>1&&(n===0?"Primary ":"Secondary "),"Email:"," "]}),s.email,"  ",e.jsx(we,{placement:"right",delay:250,overlay:e.jsx(Se,{children:"Copied!"}),trigger:"click",rootClose:!0,children:e.jsx("span",{style:{cursor:"pointer"},children:e.jsx(j,{icon:kt,color:"#0056B3",onClick:()=>navigator.clipboard.writeText(s.email)})})})]})}))});this.state=this._initialState()}render(){var S,E,T,k,P,M;if(!this.state.visible)return null;const t=this.state.showAllCommunications,s=this.state.showingTemplates,n=this.state.contactType===ue.EMAIL,d=this.state.emailTemplateType===Et.BROADCAST_EMAIL,o=this.state.userEmailAccounts.length>0,l=this.state.sendEmail||this.state.showEmailDetails,c=this.state.entityType===fe.COMPANY;let b="md";(s||n&&o||t)&&(b="lg"),(d||s&&n&&l||s&&t)&&(b="xl");let g;switch(this.state.contactType){case ue.SMS:g="Direct Chat";break;case ue.EMAIL:g=c?`${(S=h().nomenclatures)==null?void 0:S.companies.singularTerm} Email details`:`${(E=h().nomenclatures)==null?void 0:E.contacts.singularTerm} Email details`;break;case ue.PHONE:g=c?`Call ${(T=h().nomenclatures)==null?void 0:T.companies.singularTerm}`:`Call ${(k=h().nomenclatures)==null?void 0:k.contacts.singularTerm}`;break;case ue.ADDRESS:g=`${(P=h().nomenclatures)==null?void 0:P.contacts.singularTerm} Address details`;break;default:g=`Contact ${(M=h().nomenclatures)==null?void 0:M.customers.singularTerm}`}const N={};return d?N.dialogClassName="modal-90w":N.size=b,e.jsxs(O,{show:this.state.visible,onHide:this._handleCancel,enforceFocus:!1,"data-testid":"modal-portalContact",...N,children:[e.jsx(O.Header,{closeButton:!0,children:e.jsx(O.Title,{children:this.state.allDetails?"Contact Details":g})}),e.jsx(O.Body,{className:n&&l||this.state.contactType===ue.SMS||t?"p-0 border-bottom rounded-bottom":"",children:e.jsx(C,{children:this.state.allDetails?e.jsxs(v,{md:12,children:[e.jsxs(le,{defaultActiveKey:this.state.contactType||null,children:[this.renderAddress()&&e.jsxs(G,{children:[e.jsx(le.Toggle,{as:ce,variant:"none",eventKey:"ADDRESS",className:"text-left text-bold",children:"ð Address"}),e.jsx(le.Collapse,{eventKey:"ADDRESS",children:e.jsx(G.Body,{className:"p-3 rounded-sm bg-whitesmoke shadow-sm",children:this.renderAddress()})})]}),this._renderEntityEmails()&&e.jsxs(G,{children:[e.jsx(le.Toggle,{as:ce,variant:"none",eventKey:"EMAIL",className:"text-left text-bold",children:"ð§ Email"}),e.jsx(le.Collapse,{eventKey:"EMAIL",children:e.jsx(G.Body,{className:"p-3 rounded-sm bg-whitesmoke shadow-sm",children:this.renderEmail()})})]}),this.renderPhone()&&e.jsxs(G,{children:[e.jsx(le.Toggle,{as:ce,variant:"none",eventKey:"PHONE",className:"text-left text-bold",children:"ð Phone Number"}),e.jsx(le.Collapse,{eventKey:"PHONE",children:e.jsx(G.Body,{className:"p-3 rounded-sm bg-whitesmoke shadow-sm",children:this.renderPhone()})})]})]}),(n&&l||this.state.contactType===ue.SMS||t)&&e.jsxs(e.Fragment,{children:[e.jsx("h5",{className:"mt-3 fst-16",children:"ð¬ Communication"}),e.jsx(Tt,{entityId:this.state.entityId,entityType:this.state.entityType,entityEmails:this.state.entityEmails,contactType:this.state.contactType,onMessageSent:this._handleMessageSent,onEmailTemplateTypeChange:this._handleOnEmailTemplateTypeChange,toggleShowTemplates:this._toggleShowTemplates,showAllCommunications:t,preSettedEmail
4:this.state.preSettedEmail,preSettedRecipients:this.state.preSettedRecipients,mergeFieldsCategories:this.state.mergeFieldsCategories,userEmailAccounts:this.state.userEmailAccounts,...this.props})]})]}):e.jsxs(v,{md:12,children:[this.state.contactType===ue.PHONE&&this.renderPhone(),this.state.contactType===ue.ADDRESS&&this.renderAddress(),n&&!l&&this.renderEmail(),(n&&l||this.state.contactType===ue.SMS||t)&&e.jsx(Tt,{entityId:this.state.entityId,entityType:this.state.entityType,entityEmails:this.state.entityEmails,contactType:this.state.contactType,onMessageSent:this._handleMessageSent,onEmailTemplateTypeChange:this._handleOnEmailTemplateTypeChange,toggleShowTemplates:this._toggleShowTemplates,showAllCommunications:t,preSettedEmail:this.state.preSettedEmail,preSettedRecipients:this.state.preSettedRecipients,mergeFieldsCategories:this.state.mergeFieldsCategories,userEmailAccounts:this.state.userEmailAccounts,...this.props})]})})})]})}}class nr extends I.Component{constructor(t){super(t);i(this,"open",t=>{const s=t.form??{};this.setState({visible:!0,onSave:t.onSave,form:s,prevForm:{...s}})});i(this,"close",()=>{this.setState({visible:!1,dirty:!1,saving:!1,form:{}})});i(this,"_initialState",()=>({params:{},visible:!1,dirty:!1,form:{},saving:!1}));i(this,"_initialForm",()=>({companies:[]}));i(this,"handleChange",(t,s)=>{this.setState({form:t},s)});i(this,"handleCancel",()=>{this.close()});i(this,"handleDirt",()=>{this.setState({dirty:!0})});i(this,"handleSave",()=>{this.state.saving||this.save()});i(this,"save",()=>{this.setState({saving:!0},()=>{K.post("/customers/company/saveCompanyInfo",this.saveCompanyRequest(),{success:t=>{this.state.onSave&&this.state.onSave(t.data.entityId),ge(t.message),this.close()},error:t=>{R(t.error.errorMessage),this.setState({saving:!1})}})})});i(this,"handlePrimaryAddressChange",t=>{this.setState(s=>({...s,dirty:!0,form:{...s.form,primaryAddress:t}}))});i(this,"handleExpandSecondaryAddress",()=>{this.setState({addSecondaryAddress:!0})});i(this,"handleSecondaryAddressChange",t=>{this.setState(s=>({...s,dirty:!0,form:{...s.form,secondaryAddress:t}}))});i(this,"handleSecondaryAddressRemove",()=>{this.setState(t=>({...t,dirty:!0,form:{...t.form,secondaryAddress:null},addSecondaryAddress:!1}))});i(this,"handleProportionsTypeChange",t=>{this.setState(s=>({dirty:!0,form:{...s.form,companyAvatarProportionsType:t}}))});i(this,"saveCompanyRequest",()=>({companyId:this.state.form.companyId,companyAvatarInfo:this.state.form.companyAvatarInfo,companyAvatarProportionsType:this.state.form.companyAvatarProportionsType,companyName:this.state.form.companyName,companyAddress:this.state.form.companyAddress,companyPhone:this.state.form.companyPhone,companyEmail:this.state.form.companyEmail,companyWebsite:this.state.form.companyWebsite,rowVersion:this.state.form.rowVersion}));this.state=this._initialState()}render(){var d,o,l,c;if(!this.state.visible)return null;const t=["Office"],s=["Work"],n=((d=this.state.form)==null?void 0:d.companyAvatarProportionsType)===Fs.HORIZONTALRECTANGLE;return e.jsxs(O,{show:this.state.visible,onHide:this.handleCancel,size:"md",centered:"false","data-testid":"modal-saveCompany",children:[e.jsx(O.Header,{closeButton:!0,children:e.jsxs(O.Title,{children:["Edit"," ",(l=(o=h().nomenclatures)==null?void 0:o.companies)==null?void 0:l.singularTerm]})}),e.jsxs(O.Body,{children:[e.jsxs(Ae,{onChange:this.handleChange,onDirt:this.handleDirt,values:this.state.form,disabled:this.state.saving,children:[e.jsxs(C,{className:"mb-2 d-flex",children:[e.jsx(v,{className:"pl-3 text-center flex-grow-0",children:e.jsx(Ke,{targetName:"avatar",name:"companyAvatarInfo",onProportionsTypeChange:this.handleProportionsTypeChange,formControl:!0,rectangle:n,size:"sm",folder:"CustomerPortalAvatars",setProportions:!0,customProportions:!0,forceCustomProportions:!0,disabledVerticalRectangle:!0,horizontalRectangleOptions:[{value:3/1,label:"3:1"}],customCanvasSize:!0,crop:{aspect:1,width:100,height:100},autoAdjustSize:{ratioWidth:300,ratioHeight:300},disabled:!this.props.canModifyLogo})}),e.jsxs(v,{className:"d-flex flex-column justify-content-center align-items-start",children:[e.jsx(D,{htmlFor:"companyAvatarInfo",className:"m-0",children:"Upload photo"}),e.jsx("em",{className:"small",children:"Click on the picture to upload."})]})]}),e.jsx(C,{children:e.jsx(v,{md:12,children:e.jsxs(A,{children:[e.jsx(pe,{name:"companyName",maxLength:70,"data-testid":"input-saveCompanyModal-companyName"}),e.jsxs(D,{htmlFor:"companyName",required:!0,children:[(c=h().nomenclatures)==null?void 0:c.companies.singularTerm," ","Name"]})]})})}),e.jsx(C,{children:e.jsx(v,{md:12,children:e.jsx(Ze,{name:"companyAddress",required:!0,forceAutoComplete:!0})})}),e.jsx(C,{children:e.jsx(v,{md:12,children:e.jsxs(A,{children:[e.jsx(et,{name:"companyPhone",types:t,"data-testid":"input-saveCompanyModal-companyPhone"}),e.jsx(D,{htmlFor:"companyPhone",children:"Phone"})]})})}),e.jsx(C,{children:e.jsx(v,{md:12,children:e.jsxs(A,{children:[e.jsx(_s,{"data-testid":"input-saveCompanyModal-companyEmail",name:"companyEmail",maxLength:255,types:s}),e.jsx(D,{htmlFor:"companyEmail",children:"Email"})]})})}),e.jsx(C,{children:e.jsx(v,{md:12,children:e.jsxs(A,{children:[e.jsx(Ls,{"data-testid":"input-saveCompanyModal-companyWebsite",name:"companyWebsite",maxLength:255}),e.jsx(D,{htmlFor:"companyWebsite",children:"Website"})]})})})]}),this.state.saving&&e.jsx(C,{className:"mt-3",children:e.jsx(v,{children:e.jsx(J,{})})})]}),!this.state.saving&&e.jsxs(O.Footer,{children:[e.jsx(Y,{variant:"danger",onClick:this.handleCancel,"data-testid":"btn-saveCompany-cancel",children:"Cancel"}),e.jsx(Y,{variant:"success",onClick:this.handleSave,disabled:!this.state.dirty,"data-testid":"btn-saveCompany-save",children:"Save"})]})]})}}const rr=a=>{let r=a;r=r.map((s,n)=>({...s,seq:n}));const t=new Map;return r.forEach(s=>{s.orderSalesItemId!==null&&t.set(s.orderSalesItemId,s.seq)}),r.forEach(s=>{s.bundleParentItemId!==null&&t.has(s.bundleParentItemId)?s.parentSeq=t.get(s.bundleParentItemId):s.redeemedPerkParentItemId!==null&&t.has(s.redeemedPerkParentItemId)?s.parentSeq=t.get(s.redeemedPerkParentItemId):s.parentSeq=null}),r};class ir extends I.Component{constructor(t){super(t);i(this,"open",t=>{this.setState({visible:!0,loading:!1,onSave:t.onSave,accountId:t.accountId,companyId:t.companyId,invoiceSingularTerm:t.invoiceSingularTerm,orders:t.orders,orderSelected:t.orders.length===1?t.orders[0]:null,isPrimaryOrBillingContact:t.isPrimaryOrBillingContact},()=>{this.state.orders.length===1&&this.handleBalanceDuePayment(this.state.orders[0].orderId)})});i(this,"close",()=>{this.setState(this.initialState())});i(this,"initialState",()=>({visible:!1,loading:!0,saving:!1,orders:null,orderSelected:null,companyId:null,accountId:null,accountName:null,orderNumber:null,paidAmount:0,stripePublishableKey:null,
4stripeAccountId:null,stripeConnectCustomerId:null,stripePaymentMethodId:null,stripePaymentIntentId:null,invoiceSingularTerm:null,discountAmt:0,taxAmt:0,salesTaxEnabled:!1,salesTaxPct:null,salesTax:0,prevConvenienceFee:0,showDonation:!1,showDonationInput:!1,donationSet:null,donationMessage:null,donations:null,donationId:null,donationName:null,donationLevelId:null,donationPrice:0,convenienceFeeSet:null,convenienceFeePct:0,convenienceFeeThreshold:0,convenienceFee:0,currency:null,total:0,salesItems:null,paymentMethods:[],defaultLogoTypeCode:null,accountLogoInfo:null,authClientSecret:null,newPaymentMethod:!1,setupForFuture:!1,errorMessage:null,orderSalesItemIdSelected:null,mode:"ORDERS"}));i(this,"handleCancel",()=>{this.close()});i(this,"handleBack",()=>{this.setState({mode:"ORDERS"})});i(this,"handleNewPaymentMethod",t=>{this.setState({newPaymentMethod:t})});i(this,"handleBalanceDuePayment",t=>{this.setState(s=>({orderSelected:s.orders.find(n=>n.orderId===t),mode:"PAYMENT",loading:!0}),()=>{const s={orderId:t,accountId:this.state.accountId};K.get("/salesOrders/salesOrder/createSalesOrderPayment",s,{success:n=>{const d=Tn(n.data.salesItems,n.data.salesTaxEnabled,n.data.salesTaxPct,n.data.taxAmt,n.data.discountAmt),o=In(n.data.convenienceFeeSet,n.data.convenienceFeePct,n.data.convenienceFeeThreshold,n.data.convenienceFee,n.data.salesItems,n.data.discountAmt,d,n.data.paidAmount,0),l=An(n.data.salesItems,o,n.data.convenienceFee,n.data.discountAmt,d,n.data.paidAmount,0);this.setState({loading:!1,orderId:t,accountName:n.data.accountName,orderNumber:n.data.orderNumber,paidAmount:n.data.paidAmount,stripePublishableKey:n.data.stripePublishableKey,stripeAccountId:n.data.stripeAccountId,stripeConnectCustomerId:n.data.stripeConnectCustomerId,stripePaymentIntentId:n.data.stripePaymentIntentId,invoiceSingularTerm:n.data.invoiceSingularTerm,discountAmt:n.data.discountAmt,taxAmt:n.data.taxAmt,salesTaxEnabled:n.data.salesTaxEnabled,salesTaxPct:n.data.salesTaxPct,salesTax:d,prevConvenienceFee:n.data.convenienceFee,donationSet:!1,donationMessage:n.data.donationMessage,donations:[],donationId:null,donationName:null,convenienceFeeSet:n.data.convenienceFeeSet,convenienceFeePct:n.data.convenienceFeePct,convenienceFeeThreshold:n.data.convenienceFeeThreshold,convenienceFee:o,currency:n.data.currency,total:l,salesItems:n.data.salesItems.map(c=>({...c,removed:!1})),paymentMethods:n.data.paymentMethods,newPaymentMethod:n.data.paymentMethods.length===0})},error:n=>{R(n.error.errorMessage),this.setState({loading:!1})}},{block:!1})})});i(this,"handleConfirm",t=>{this.setState({saving:!0},()=>{var d;let s=this.state.salesItems.filter(o=>!o.removed).map(o=>{const l=o.upgrades&&o.upgrades.find(c=>c.confirmed);return l?{...o,costAmt:l.costAmt,unitCostAmt:l.costAmt,membershipLevelId:l.membershipLevelId,sponsorshipLevelId:l.sponsorshipLevelId,membershipSubscriptionSale:o.membershipSubscriptionSale?{...o.membershipSubscriptionSale,membershipLevelId:l.membershipLevelId}:null,sponsorshipSubscriptionSale:o.sponsorshipSubscriptionSale?{...o.sponsorshipSubscriptionSale,sponsorshipLevelId:l.sponsorshipLevelId}:null}:o});if(this.state.donationLevelId){const o={orderSalesItemId:null,bundleParentItemId:null,productId:null,membershipId:null,sponsorshipId:null,donationId:this.state.donationId,orderSalesItemTypeCode:SalesItemTypeCode.DONATION,productOneTimeLevelId:null,membershipLevelId:null,sponsorshipLevelId:null,donationLevelId:this.state.donationLevelId,levelStartDate:null,description:this.state.donationName,qty:1,unitCostAmt:this.state.donationPrice,costAmt:this.state.donationPrice,isTaxable:((d=(this.state.donations||[]).find(l=>l.donationId===this.state.donationId))==null?void 0:d.isTaxable)??!1,seq:null,parentSeq:null,forced:!1};s=s.concat(o)}s=rr(s);const n={orderId:this.state.orderId,invoiceSingularTerm:this.state.invoiceSingularTerm,stripeAccountId:this.state.stripeAccountId,stripeConnectCustomerId:this.state.stripeConnectCustomerId,convenienceFee:this.state.convenienceFee.toFixed(2),total:this.state.total.toFixed(2),anyUpgrade:s.some(o=>o.upgrades&&o.upgrades.some(l=>l.confirmed)),salesTax:this.state.salesTax,salesItems:s,newPaymentMethod:this.state.newPaymentMethod,hasPaymentMethods:this.state.paymentMethods.length>0,setupForFuture:this.state.setupForFuture,stripePaymentMethodId:t,stripePaymentIntentId:this.state.stripePaymentIntentId};K.post("/salesOrders/salesOrder/confirmSalesOrderPayment",n,{success:()=>{ge("Your payment has been confirmed and we are processing the changes in the system. This may take a few seconds to be reflected. Try refreshing the page."),this.state.onSave&&this.state.onSave(),this.close()},error:o=>{if(this.setState({saving:!1}),o.error.errorCode==="AUTH"){const l=o.error.errorDetail,c=o.error.errorMessage;this.setState({stripePaymentIntentId:l,authClientSecret:c})}else R(o.error.errorMessage)}},{block:!1})})});i(this,"handleOpenPDF",t=>{ps("/reports/salesOrder",{orderKeys:[t.orderKey]})});i(this,"handleConfirmAuth",(t,s)=>{this.handleConfirm(s)});i(this,"handleErrorAuth",()=>{R("Error on authenticating Stripe payment.")});i(this,"paymentButtonFormatter",t=>t.row.hasPaymentPlan?e.jsx(we,{overlay:e.jsx(Se,{children:"Invoice on Payment Plan"}),children:e.jsx(j,{icon:Os,color:"green"})}):e.jsx(Y,{"data-testid":"btn-balanceDuePaymentModal-pay",variant:"link",onClick:()=>this.handleBalanceDuePayment(t.row.orderId),children:"Pay"}));i(this,"OrderContactNumberFormatter",t=>e.jsxs(e.Fragment,{children:[e.jsx("span",{children:t==null?void 0:t.orderNumber}),t.customerId?e.jsx(j,{className:"ml-2",icon:Me}):null]}));i(this,"OrderCompanyNumberFormatter",t=>e.jsxs(e.Fragment,{children:[e.jsx("span",{children:t.orderNumber}),t.hasAddressedCompany?e.jsx(j,{className:"ml-2",icon:tt}):null]}));i(this,"renderOrders",()=>{var s;const t=[{key:"orderDate",name:"Date",formatter:ze,width:150,cellClass:"text-center",sortable:!1},{key:"orderNumber",name:`${((s=h().nomenclatures)==null?void 0:s.invoices.singularTerm)||"Invoice"} #`,sortable:!1,width:150,cellClass:"text-center",formatter:({row:n})=>e.jsx("div",{style:{textDecoration:n.paymentStatus==="Voided"?"line-through":"none",color:"#0056B3"},className:"cursor-pointer",title:"Open PDF version",onClick:()=>this.handleOpenPDF(n),children:this.state.isPrimaryOrBillingContact?this.OrderContactNumberFormatter(n):this.OrderCompanyNumberFormatter(n)})},{key:"dueAmt",name:"Amount Due",width:150,formatter:Bs,cellClass:"text-right",sortable:!1},{key:"pay",name:"",width:149,cellClass:"text-center",formatter:this.paymentButtonFormatter}];return e.jsx(C,{children:e.jsx(v,{xs:12,children:e.jsx(ot,{columns:t,rowKey:"orderId",items:this.state.orders,disableSelect:!0,height:300})})})});i(this,"renderStripePayment",()=>this.state.loading?e.jsx(J,{}):e.jsx(qs,{accountName:this.state.accountName,orderNumber:this.state.orderNumber,paidAmount:this.state.paidAmount,stripePublishableKey:this.state.stripePublishableKey,stripeAccountId:this.state.stripeAccountId,authClientSecret:this.state.authClientSecret,invoiceSingularTerm:this.state.invoiceSingularTerm,discountAmt:this.state.discountAmt,salesTax:this.state.salesTax,salesTaxEnabled:this.state.salesTaxEnabled,salesTaxPct:this.state.salesTaxPct,showDonation:this.state.showDonation,showDonationInput:this.state.showDonationInput,donationSet:this.state.donationSet,donationMessage:this.state.donationMessage,donations:this.state.donations,donationId:this.state.donationId,donationLevelId:this.state.donationLevelId,donationPrice:this.state.donationPrice,convenienceFeeSet:this.state.convenienceFeeSet,convenienceFee:this.state.convenienceFee,currency:this.state.currency,total:this.state.total,salesItems:this.state.salesItems,paymentMethods:this.state.paymentMethods,disabled:this.state.saving,orderSalesItemIdSelected:this.state.orderSalesItemIdSelected,mode:this.state.mode,onShowDonation:this.handleShowDonation,onDonationChange:this.handleDonationChange,onDonationLevelChange:this.handleDonationLevelChange,onDonationAmountChange:this.handleDonationAmountChange,onNewPaymentMethod:this.handleNewPaymentMethod,onSetupForFuture:this.handleSetupForFuture,onRemove:this.handleRemove,onUpgradeMode:this.handleUpgradeMode,onUpgradeSelect:this.handleUpgradeSelect,onUpgradeContinue:this.handleUpgradeContinue,onAddonMode:this.handleAddonMode,onAddonSelect:this.handleAddonSelect,onAddonContinue:this.handleAddonContinue,onBack:this.handleBack,onConfirm:this.handleConfirm,onConfirmAuth:this.handleConfirmAuth,onErrorAuth:this.handleErrorAuth,invoiceDetailsDisabled:!0,storePaymentDisabled:!0,bottomMessage:this.state.salesTaxEnabled&&this.state.salesTax>0||this.state.convenienceFee>0?e.jsxs(e.Fragment,{children:[this.state.salesTaxEnabled&&this.state.salesTax>0&&e.jsx("div",{children:`Includes $${this.state.salesTax.toFixed(2)} of ${$s()}.`}),this.state.convenienceFee>0&&e.jsx("div",{className:"text-red",children:`A $${this.state.convenienceFee.toFixed(2)} convenience fee is being applied.`})]}):null,bottomMessageClassName:"mt-2 font-italic float-right text-right"}));this.state=this.initialState()}
4render(){if(!this.state.visible)return null;const t=this.state.mode==="ORDERS"?"Balance Due Payment":`Pay ${this.state.invoiceSingularTerm} #${this.state.orderSelected.orderNumber}`;return e.jsxs(O,{show:this.state.visible,onHide:this.handleCancel,size:"md",centered:"false","data-testid":"modal-balanceDuePayment",children:[e.jsx(O.Header,{closeButton:!0,children:e.jsxs(O.Title,{children:[this.state.mode==="PAYMENT"&&this.state.orders.length>1&&e.jsx(Y,{"data-testid":"btn-balanceDuePaymentModal-close",variant:"primary",className:"mr-3",onClick:this.handleBack,children:e.jsx(j,{icon:Wt})}),t]})}),e.jsxs(O.Body,{children:[this.state.loading&&e.jsx(J,{}),!this.state.loading&&this.state.mode==="ORDERS"&&this.renderOrders(),!this.state.loading&&this.state.mode==="PAYMENT"&&this.renderStripePayment()]})]})}}class vt extends I.Component{render(){return e.jsxs("div",{className:"text-center d-flex flex-column align-items-center pt-3",children:[e.jsx("img",{src:"/images/customer-portal/no-items-found.webp",width:"100px"}),e.jsxs("p",{children:["No"," ",h().nomenclatures.companies.singularTerm," ","associated to this"," ","Portal User."]})]})}}const qt=({loading:a,companyInfo:r,isCustomer:t,membershipDirectoryForm:s,isEditingDescription:n,editAllowed:d,onEditDescriptionClick:o,onCancelClick:l,onSaveClick:c,onDescriptionChange:b,onManageFullPageContentClick:g})=>{var S,E;const N=t||!!r;return a?e.jsx(G,{className:"p-4",children:e.jsx(J,{})}):e.jsxs(G,{className:"px-4 pt-3 pb-2",children:[e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"portal-card-header mb-3",children:[e.jsx(j,{icon:Us}),t&&(s!=null&&s.enableFullPage)?"Full Page Listing Description":"Membership Directory"]}),!t&&((E=(S=r==null?void 0:r.businessCategory)==null?void 0:S.businessCategories)==null?void 0:E.length)>
40&&e.jsx("span",{className:"d-flex",children:e.jsx(Mn,{entityId:r.companyId,businessCategory:r.businessCategory,readOnly:!0})})]}),e.jsx(C,{className:"w-100 mx-0",children:e.jsx(v,{className:xe("p-0",{"mt-3":N}),children:N?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"w-100 d-flex align-items-center justify-content-between mb-1",children:[e.jsx(D,{className:"bold mb-0",htmlFor:"websiteDescription",children:"Website Description"}),d&&e.jsx("span",{children:n?e.jsxs("div",{children:[e.jsx(Y,{"data-testid":"btn-membershipDirectory-1",className:"edit-selector outline px-2 mr-2",variant:"light",size:"xs",onClick:l,children:"Cancel"}),e.jsxs(Y,{"data-testid":"btn-membershipDirectory-2",className:"edit-selector outline px-2",variant:"success",size:"xs",onClick:c,children:[e.jsx(j,{icon:zs,color:"white",className:"mr-1"}),"Save"]})]}):e.jsxs(be,{className:"edit-selector text-primary",variant:"outline",size:"xs",disabled:h().readOnlySession||h().previewSession,"data-testid":"btn-membershipDirectory-editDescription",onClick:o,children:[e.jsx(j,{icon:Pe,className:"mr-1"}),"Edit description"]})})]}),n?e.jsx(Hs,{"data-testid":"input-membershipDirectoryCard-websiteDescription",name:"websiteDescription",id:"websiteDescription",style:{fontSize:"14px"},disabled:!d,maxLength:2e3,rows:4,onChange:b,formControl:!1,value:s==null?void 0:s.websiteDescription,onBlur:c}):e.jsx("div",{className:"text-muted",style:{whiteSpace:"pre-line"},children:(s==null?void 0:s.websiteDescription)||e.jsx("span",{className:"text-muted font-italic",children:"No description provided."})})]}):e.jsx(vt,{})})}),(t&&(s==null?void 0:s.hasMembershipSubscriptions)||!t&&(r==null?void 0:r.hasMembershipSubscriptions))&&e.jsxs(C,{className:"mt-3 mx-0",children:[e.jsx("strong",{className:"bold",children:s!=null&&s.enableFullPage?"Full Page Listing":"Manage SEO Tags"}),e.jsx("div",{className:"align-items-center mb-1",children:e.jsx("p",{className:"mb-0 pr-1 font-italic",children:s!=null&&s.enableFullPage?"You may choose to enhance your business directory listing by providing additional information about your business, resulting in a more complete business profile.":"By adding SEO tags to your member profile you will enhance your visibility in the member directory search results."})}),d&&e.jsx("div",{className:"d-flex w-100 justify-content-end pt-3",children:e.jsxs(be,{className:"edit-selector text-primary",variant:"outline",size:"xs",disabled:h().readOnlySession||h().previewSession,"data-testid":"btn-membershipDirectory-manageContent",onClick:g,children:[e.jsx(j,{icon:Vs,className:"mr-1"}),s!=null&&s.enableFullPage?"Manage Content":"Manage SEO"]})})]})]})},or=({companyInfo:a,editAllowed:r,renderCompanyActions:t,loadingBalanceDue:s,onEditCompany:n,onBalanceDuePayment:d,onEditSocials:o})=>{const l=(a==null?void 0:a.companyAvatarProportionsType)==="RC1"||(a==null?void 0:a.companyAvatarProportionsType)==="RC2",c=l?null:a==null?void 0:a.statusName,b=()=>{let P=null;return a.inactive&&(P=e.jsx(j,{icon:faTimes,className:"fa-sm"})),e.jsx("span",{children:a.inactive&&e.jsxs(ve,{variant:"secondary",className:"ml-1 mb-1",children:[P,e.jsx("span",{className:"ml-1",children:"Suppressed"})]})})},g=()=>e.jsxs("h6",{className:"",children:[a.companyName," ",b()]}),N=()=>a.parentCompanyName?e.jsx(Ne,{to:`${Ws}/${a.parentCompanyId}`,rel:"noopener noreferrer",children:a.parentCompanyName}):e.jsx("p",{className:"mt-4 pt-2"}),S=()=>{if(!a.companyAddress)return null;let P=a.companyAddress.city;return a.companyAddress.stateName?P=`${P}, ${a.companyAddress.stateName}`:a.companyAddress.province&&(P=`${P}, ${a.companyAddress.province}`),a.companyAddress.zip&&(P=`${P}, ${a.companyAddress.zip}`),e.jsxs(e.Fragment,{children:[e.jsx("span",{children:a.companyAddress.street1}),a.companyAddress.street2&&e.jsxs("span",{children:[","," ",a.companyAddress.street2]}),e.jsx("br",{}),e.jsx("span",{children:P}),e.jsx("br",{}),e.jsx("span",{children:a.companyAddress.countryName})]})},E=(P,M)=>{let _,V,H;return M?(_=P.totalBalanceDue,V=`Includes ${P.invoicePluralTerm} from ${h().nomenclatures.contacts.pluralTerm} of the ${h().nomenclatures.companies.singularTerm} 5 who have indicated these will be paid by the ${h().nomenclatures.companies.singularTerm}, as well as your personal ${P.invoicePluralTerm}.`,H=P.contactLevelBalanceDue>0):(_=P.contactLevelBalanceDue,V=`Includes ${P.invoiceSingularTerm} that you indicated will be paid by the ${h().nomenclatures.companies.singularTerm}`,H=P.hasCompanyPaidBalanceDue),e.jsxs(e.Fragment,{children:[_>0?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-weight-bold text-danger",title:"View balance",children:st(_)}),M&&e.jsx(ve,{variant:"success",className:"ml-2","data-testid":"badge-companyCard-payNow",children:"Pay Now"})]}):e.jsx("span",{className:"font-weight-bold",title:"View balance",children:st(_)}),H&&e.jsx(we,{trigger:["hover","focus"],placement:"top",overlay:e.jsx(Se,{children:V}),children:e.jsx(j,{className:"ml-2 font-weight-bold text-black",icon:M?Me:tt})})]})},T=()=>
5a.hasMembershipSubscriptions?e.jsx(Dn,{memberId:a.companyId,memberTypeCode:"COMPANY",isPortal:!0,refreshToken:a.rowVersion,containerClassName:"membership-badges-container mt-3 flex-wrap"}):null,k=()=>{const{accountInfo:P,balanceDueInfo:M,isPrimaryContact:_,isBillingContact:V}=a,H=_||V;return P.stripeAccountEnabled&&P.stripeIntegration&&(M.balanceDue>0||M.contactLevelBalanceDue>0)&&H?e.jsx(be,{className:"p-0",variant:"link","data-testid":"btn-companyCard-balanceDuePayNow",disabled:s||h().readOnlySession||h().previewSession,...H&&{onClick:()=>d(H)},children:E(M,H)}):E(M,H)};return a?e.jsxs(G,{className:"px-4 pt-3 pb-2",children:[e.jsxs("div",{className:"portal-card-header",children:[e.jsx(j,{icon:tt}),"MY"," ",h().nomenclatures.companies.singularTerm]}),e.jsxs(C,{className:"align-items-start row-gap-3 pt-3",children:[e.jsxs(v,{className:`customer-left-container flex-grow-0 ${l?"rectangle":""}`,sm:12,children:[e.jsx(Kt,{avatarRounded:!0,entityName:"Company",size:"medium",entityKey:a.entityKey,avatarStorageKey:a.avatarStorageKey,avatarProportionsType:a.companyAvatarProportionsType,statusName:c,statusColor:a.statusColor}),e.jsxs("div",{className:"d-flex mt-2 mb-3 contact-social-menu flex-wrap company-socials",children:[e.jsx("div",{children:e.jsx("a",{href:a.facebookSet?`https://www.facebook.com/${a.facebook}`:null,target:"_blank",rel:"noopener noreferrer",children:e.jsx(j,{icon:lt,className:`${a.facebookSet?"active-facebook":"inactive-icon"}${l?"-rectangle":""}`})})}),e.jsx("div",{children:e.jsx("a",{href:a.twitterSet?`https://www.twitter.com/${a.twitter}`:null,target:"_blank",rel:"noopener noreferrer",children:e.jsx(j,{icon:dt,className:`${a.twitterSet?"active-twitter":"inactive-icon"}${l?"-rectangle":""}`})})}),e.jsx("div",{children:e.jsx("a",{href:a.linkedInSet?`https://www.linkedin.com/${a.linkedIn}`:null,target:"_blank",rel:"noopener noreferrer",children:e.jsx(j,{icon:ct,className:`${a.linkedInSet?"active-linkedIn":"inactive-icon"}${l?"-rectangle":""}`})})}),e.jsx("div",{className:`${a.instagramSet?"icon-instagram":"inactive-instagram"}${l?"-rectangle":""}`,children:e.jsx("a",{href:a.instagramSet?`https://www.instagram.com/${a.instagram}`:null,target:"_blank",rel:"noopener noreferrer",children:e.jsx(j,{icon:mt})})}),e.jsx("div",{className:`${a.tikTokSet?"icon-tiktok":"inactive-tiktok"}${l?"-rectangle":""}`,children:e.jsx("a",{href:a.tikTokSet?`https://www.tiktok.com/@${a.tikTok}`:null,target:"_blank",rel:"noopener noreferrer",children:e.jsx(j,{icon:ht})})}),r&&e.jsx("div",{children:e.jsx(be,{variant:"default",title:"Edit Socials",className:"btn-social-menu-edit","data-testid":"btn-companyCard-editSocials",disabled:h().readOnlySession||h().previewSession,onClick:o,children:e.jsx(j,{className:"social-menu-edit-icon",icon:Pe})})})]})]}),e.jsx(v,{sm:12,md:8,children:e.jsxs(C,{className:"flex-column mx-0",children:[e.jsx("div",{className:"w-100",children:g()}),(a==null?void 0:a.parentCompanyName)&&e.jsx("div",{className:"text-muted small w-100",children:N()}),e.jsx("div",{className:"text-muted text-start",children:S()}),(a==null?void 0:a.balanceDueInfo)&&e.jsxs("div",{className:"mt-2 d-flex align-items-center w-100",children:[e.jsx("strong",{className:"mr-2",children:"Balance Due:"}),e.jsx("span",{children:k()})]}),e.jsx("div",{className:"mt-3 w-100",children:t()}),T()]})}),r&&e.jsx("div",{className:"text-right w-100",children:e.jsxs(be,{className:"edit-selector text-primary",variant:"outline",size:"sm","data-testid":"btn-companyCard-editCompany",disabled:h().readOnlySession||h().previewSession,onClick:n,children:[e.jsx(j,{icon:Pe,className:"mr-1"}),"Edit"," ",h().nomenclatures.companies.singularTerm]})})]})]}):null},lr=({loadingProfile:a,userInfo:r,editAllowed:t,onSaveAvatar:s,onEditSocials:n,renderContactActions:d})=>{const o=(r==null?void 0:r.companyAvatarProportionsType)==="RC1"||(r==null?void 0:r.companyAvatarProportionsType)==="RC2";return e.jsx(G,{className:"px-4 pt-3 pb-2",children:a?e.jsx(J,{}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"portal-card-header",children:[e.jsx(j,{icon:Me})," ","MY PROFILE"]}),e.jsxs(C,{className:"align-items-start row-gap-3 pt-3",children:[e.jsxs("div",{className:`customer-left-container pl-2 ${o?"rectangle":""}`,children:[e.jsx("div",{title:"Update Avatar",children:e.jsx(Ke,{targetName:"avatar",value:r==null?void 0:r.avatarInfo,formControl:!1,size:"sm",showAlt:!0,customCanvasSize:!0,folder:"CustomerPortalAvatars",disabled:h().readOnlySession||h().previewSession,onChange:l=>s(l)})}),e.jsxs("div",{className:"d-flex mt-2 mb-3 contact-social-menu flex-wrap pl-2",children:[e.jsx("div",{children:e.jsx("a",{href:r!=null&&r.facebookSet?`https://www.facebook.com/${r.facebook}`:null,target:"_blank",rel:"noopener noreferrer",children:e.jsx(j,{icon:lt,className:r!=null&&r.facebookSet?"active-facebook":"inactive-icon"})})}),e.jsx("div",{children:e.jsx("a",{href:r!=null&&r.twitterSet?`https://www.twitter.com/${r.twitter}`:null,target:"_blank",rel:"noopener noreferrer",children:e.jsx(j,{icon:dt,className:r!=null&&r.twitterSet?"active-twitter":"inactive-icon"})})}),e.jsx("div",{children:e.jsx("a",{href:r!=null&&r.linkedInSet?`https://www.linkedin.com/${r.linkedIn}`:null,target:"_blank",rel:"noopener noreferrer",children:e.jsx(j,{icon:ct,className:r!=null&&r.linkedInSet?"active-linkedIn":"inactive-icon"})})}),e.jsx("div",{className:r!=null&&r.instagramSet?"icon-instagram":"inactive-instagram",children:e.jsx("a",{href:r!=null&&r.instagramSet?`https://www.instagram.com/${r.instagram}`:null,target:"_blank",rel:"noopener noreferrer",children:e.jsx(j,{icon:mt})})}),e.jsx("div",{className:r!=null&&r.tikTokSet?"icon-tiktok":"inactive-tiktok",children:e.jsx("a",{href:r!=null&&r.tikTokSet?`https://www.tiktok.com/@${r.tikTok}`:null,target:"_blank",rel:"noopener noreferrer",children:e.jsx(j,{icon:ht})})}),e.jsx(be,{variant:"default",className:"btn-social-menu-edit d-flex justify-content-center",style:t?void 0:{visibility:"hidden"},disabled:!t||h().readOnlySession||h().previewSession,onClick:n,"data-testid":"btn-editContactSocials",children:e.jsx(j,{className:"social-menu-edit-icon",title:"Edit Socials",icon:Pe})})]})]}),e.jsxs("div",{className:"align-items-center pl-3 pt-2",children:[e.jsxs("div",{children:[e.jsx("h6",{className:"mb-0",children:h().userName}),e.jsx("div",{className:"text-muted text-break",children:h().email})]}),e.jsx("div",{className:"mt-3",children:d()})]}),t&&e.jsx("div",{className:"text-right w-100",children:e.jsx(Ne,{to:"/memberPortal/accounts/profile#ProfileTab",children:e.jsxs(ce,{"data-testid":"btn-profile",className:"edit-selector text-primary",variant:"outline",size:"sm",children:[e.jsx(j,{icon:Pe,className:"mr-1"}),"Update My Profile"]})})})]})]})})},dr=({show:a,event:r,onHide:t,onSaved:s})=>{const[n,d]=F.useState(!1),[o,l]=F.useState(!1),[c,b]=F.useState([]),[g,N]=F.useState(null),[S,E]=F.useState([]),[T,k]=F.useState(null);F.useEffect(()=>{d(!0),K.get("/EventRegistration/GetPortalEventRegistrations",{eventId:r.eventId},{success:f=>{d(!1);const B=f.data.items.map(U=>({...U,tbdAttendees:U.tbdAttendees.map(Q=>({...Q,firstName:"",lastName:"",email:""}))}));b(B),B.length===1&&(N(B[0]),E(B[0].tbdAttendees))},error:f=>{d(!1),R(f.error.errorMessage),t()}})},[r.eventId,t]);const P=()=>{N(null),E([])},M=()=>t(),_=f=>()=>{N(f),E(f.tbdAttendees)},V=F.useCallback((f,B)=>U=>{E(Q=>Q.map(te=>te.eventRegistrationAttendeeId!==f?te:{...te,[B]:U}))},[]),H=f=>{k(B=>B===f?null:f)},ae=()=>{o||(l(!0),K.post("/EventRegistration/SaveEventRegistrationAttendees",{eventRegistrationId:g.eventRegistrationId,attendees:S.filter(f=>{var B,U;return((B=f.firstName)==null?void 0:B.trim())&&((U=f.lastName)==null?void 0:U.trim())}).map(f=>({eventRegistrationAttendeeId:f.eventRegistrationAttendeeId,firstName:f.firstName,lastName:f.lastName,email:f.email}))},{success:f=>{ge(f.message),l(!1),s()},error:f=>{R(f.error.errorMessage),l(!1)}}))},re=()=>S.some(B=>{var te,x;const U=!!((te=B.firstName)!=null&&te.trim()),Q=!!((x=B.lastName)!=null&&x.trim());return U!==Q})?!0:!S.some(B=>{var U,Q;return((U=B.firstName)==null?void 0:U.trim())&&((Q=B.lastName)==null?void 0:Q.trim())}),ee=()=>c.map((f,B)=>e.jsxs(C,{className:"d-flex align-items-center justify-content-between w-100 mx-0 bg-light border-sm shadow-sm rounded px-3 py-2 mb-2 cursor-pointer",onClick:_(f),"data-testid":`btn-editAttendees-registration-${B}`,children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-weight-bold",children:`Registration # ${f.registrationNumber}`}),e.jsxs("div",{className:"mt-1",children:[e.jsx("span",{className:"badge badge-success mr-1",children:`Confirmed: ${f.confirmedCount}`}),e.jsx("span",{className:"badge badge-warning",children:`TBD: ${f.tbdCount}`})]})]}),e.jsx(j,{icon:Gt,className:"text-secondary"})]},f.eventRegistrationId)),he=()=>e.jsxs(e.Fragment,{children:[e.jsxs(C,{children:[g.filledAttendees.length>0&&e.jsxs(v,{xs:5,className:"editAttendees-info p-4",children:[e.jsx("h6",{className:"mb-3",children:`Registration #${g.registrationNumber}`}),e.jsx("h7",{className:"font-weight-bold text-center",children:"Confirmed Attendees"}),e.jsx("div",{className:"mt-2",children:e.jsx(at.Scrollbars,{autoHeight:!0,autoHeightMax:300,children:e.jsx(Gs,{as:"ol",numbered:!0,className:"bg-transparent",children:g.filledAttendees.map(f=>e.jsxs(Ys,{className:"d-flex align-items-center py-1 bg-transparent",children:[e.jsx("span",{className:"font-weight-bold flex-shrink-0 mr-1",children:`${f.order+1} -`}),e.jsx(we,{placement:"top",overlay:e.jsx(Se,{children:`${f.firstName} ${f.lastName}`}),children:e.jsx("span",{className:"text-truncate",children:`${f.firstName} ${f.lastName}`})})]},f.order))})})})]}),S.length>0&&e.jsxs(v,{xs:7,className:"",children:[e.jsx("h6",{className:"font-weight-bold text-center mb-2",children:"TBD Attendees"}),e.jsx("small",{className:"text-muted d-block text-start mb-3",children:"These attendees were registered without a name. Enter their first and last name below."}),e.jsx(at.Scrollbars,{autoHeight:!0,autoHeightMax:300,children:e.jsx("div",{className:"edit-attendees-accordion",children:S.map(f=>{const B=T===f.eventRegistrationAttendeeId;return e.jsxs(G,{className:"mb-1 border",children:[e.jsx(G.Header,{className:"p-0",children:e.jsxs("button",{type:"button",className:"edit-attendees-accordion-header",onClick:()=>H(f.eventRegistrationAttendeeId),disabled:o,"data-testid":`btn-editAttendees-attendee-${f.order}`,children:[e.jsx("span",{children:`Attendee #${f.order+1}`}),e.jsx(j,{icon:B?Qs:Xs})]})}),B&&e.jsx(G.Body,{className:"py-2",children:e.jsxs(C,{className:"px-3 pb-2",children:[e.jsx(v,{xs:6,children:e.jsxs(A,{children:[e.jsx(pe,{value:f.firstName,maxLength:100,disabled:o,"data-testid":`input-editAttendees-firstName-${f.eventRegistrationAttendeeId}
5`,onChange:V(f.eventRegistrationAttendeeId,"firstName")}),e.jsx(D,{htmlFor:"firstName",required:!0,children:"First Name"})]})}),e.jsx(v,{xs:6,children:e.jsxs(A,{children:[e.jsx(pe,{value:f.lastName,maxLength:100,disabled:o,"data-testid":`input-editAttendees-lastName-${f.eventRegistrationAttendeeId}`,onChange:V(f.eventRegistrationAttendeeId,"lastName")}),e.jsx(D,{htmlFor:"lastName",required:!0,children:"Last Name"})]})}),e.jsx(v,{xs:6,children:e.jsxs(A,{children:[e.jsx(ut,{value:f.email,maxLength:255,disabled:o,"data-testid":`input-editAttendees-email-${f.eventRegistrationAttendeeId}`,onChange:V(f.eventRegistrationAttendeeId,"email")}),e.jsx(D,{htmlFor:"email",children:"Email"})]})}),f.levelName&&e.jsx(v,{xs:6,children:e.jsxs(A,{children:[e.jsx(Js,{items:f.levelNames.map(U=>({value:U,label:U})),value:f.levelNames.map(U=>({value:U,label:U})),disabled:!0,useItemValues:!0,compact:!0,"data-testid":`combo-editAttendees-levelName-${f.eventRegistrationAttendeeId}`}),e.jsx(D,{children:"Item"})]})})]})})]},f.eventRegistrationAttendeeId)})})}),g&&!o&&!n&&S.length>0&&e.jsxs("div",{className:"p-2 d-flex justify-content-between",children:[e.jsx(Y,{variant:"danger",className:"mr-2 edit-attendees-button border-0",onClick:M,"data-testid":"btn-editAttendees-cancel",children:"Cancel"}),e.jsx(Y,{variant:"success",className:"edit-attendees-button border-0",onClick:ae,disabled:re(),"data-testid":"btn-editAttendees-save",children:"Save"})]})]})]}),o&&e.jsx(J,{})]});return e.jsxs(O,{show:a,onHide:t,centered:!0,scrollable:!0,"data-testid":"modal-editAttendees",className:"modal-editAttendees",size:"lg",children:[e.jsxs(O.Header,{closeButton:!0,className:"d-flex align-items-center border-bottom-0",children:[g&&c.length>1&&e.jsx(Y,{variant:"link",className:"p-0 mr-4",onClick:P,"data-testid":"btn-editAttendees-back",children:e.jsx(j,{icon:Ks})}),e.jsx(O.Title,{children:"Edit Attendees"})]}),e.jsxs(O.Body,{className:"p-0 px-2",children:[n&&e.jsx(J,{}),!n&&c.length===0&&e.jsx("div",{className:"p-4 text-center text-muted",children:e.jsx("small",{children:"All attendees have already been confirmed."})}),!n&&c.length>0&&(g?he():ee())]})]})},cr=()=>{const[a,r]=F.useState({loading:!1,events:[],showOnlyMyRegistrations:!1,showEditModal:!1,selectedEvent:null}),t=F.useCallback(()=>{const{accountId:o,customerId:l,currentCompanyInfo:c,previewSession:b}=h();if(!o||b)return;r(N=>({...N,loading:!0}));const g={customerId:l,companyId:(c==null?void 0:c.companyId)??null,accountId:o,rowCount:5,futureEvents:!0,showOnlyMyRegistrations:a.showOnlyMyRegistrations};K.get("/events/event/GetPortalEventsWithAttendees",g,{success:N=>{r(S=>({...S,loading:!1,events:N.data.items}))},error:N=>{r(S=>({...S,loading:!1,events:[]})),R(N.error.errorMessage)}},{block:!1})},[a.showOnlyMyRegistrations]);F.useEffect(()=>{t()},[t]);const s=F.useCallback((o=null,l=!1)=>{r(c=>({...c,showEditModal:l,selectedEvent:o}))},[]),n=()=>{s(),t()},d=(o,l)=>{const{eventName:c,eventStartDate:b,eventEndDate:g,registrations:N=[]}=o,S=He(b),E=g?He(g):"",T=E&&S!==E?`${S} - ${E}`:S,k=N.flatMap(M=>M.attendees),P=N.some(M=>M.allowRegistrantToModifyAttendees&&M.registrantCustomerId===h().customerId&&M.attendees.some(_=>_.toBeDetermined));return e.jsxs(C,{className:"d-flex flex-row justify-content-between w-100 mx-0 bg-light border-sm shadow-sm rounded px-2 py-1 flex-nowrap",children:[e.jsxs("span",{className:"d-flex flex-column pl-2 flex-nowrap",children:[e.jsx("strong",{children:c}),e.jsx("small",{className:"text-dark",children:T})]}),P&&e.jsxs(Y,{"data-testid":`btn-eventsAttendance-editAttendees-${l}`,size:"sm",variant:"outline",className:"edit-selector text-primary",onClick:()=>s(o,!0),children:[e.jsx(j,{icon:Pe,className:"mr-1"}),"Edit Attendees"]}),k.length>0?e.jsx(ta,{placement:"top",popoverClassName:"attendance-popover-dark",component:e.jsx(at.Scrollbars,{autoHeight:!0,autoHeightMax:150,renderTrackHorizontal:()=>e.jsx("div",{}),children:e.jsx("ol",{className:xe("pr-2 mb-0",k.length<10?"pl-3":"pl-4"),children:k.map((M,_)=>e.jsx("li",{children:e.jsx("strong",{children:M!=null&&M.firstName?`${M.firstName} ${M.lastName}`:"TBD"})},_))})}),children:e.jsxs("span",{className:"d-flex align-items-center pr-3 cursor-pointer",children:[e.jsx("small",{className:"mr-2 text-primary",children:"Who's going?"}),e.jsx("strong",{className:"text-underline mr-2",children:k.length}),e.jsx(j,{icon:It,color:"darkgoldenrod"})]})}):e.jsxs("span",{className:"d-flex align-items-center pr-3",children:[e.jsx(j,{icon:It,color:"darkgray",className:"mr-2"}),e.jsx("strong",{className:"text-secondary",children:k.length})]})]},l)};return a.loading?e.jsx(G,{className:"p-4","data-testid":"card-eventsAttend
5ance-loading",children:e.jsx(J,{})}):e.jsxs(G,{className:"px-4 pt-3 pb-2","data-testid":"card-eventsAttendance",children:[e.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[e.jsxs("div",{className:"portal-card-header",children:[e.jsx(j,{icon:Zs}),"Event Attendance"]}),e.jsx(Ce,{"data-testid":"switch-eventsAttendance",label:" Limit to those I'm attending",left:!0,value:a.showOnlyMyRegistrations,className:"mb-0",onChange:o=>{r(l=>({...l,showOnlyMyRegistrations:o}))}})]}),a.events.length>0&&h().accountTimeZoneName&&e.jsxs("small",{className:"text-muted font-italic",children:["All times displayed in"," ",h().accountTimeZoneName]}),e.jsxs(C,{className:"align-items-start row-gap-3 pt-3 attendee-row-container",children:[a.events.length>0?a.events.map((o,l)=>d(o,l)):e.jsxs("div",{className:"d-flex flex-column align-items-center w-100 mt-2",children:[e.jsx("img",{src:"/images/customer-portal/calendar_2.png",width:48}),e.jsx("small",{className:"mt-2",children:"No events found"})]}),e.jsx("div",{className:"text-right w-100",children:e.jsx(Ne,{to:"/memberPortal/eventsAttendance/",children:e.jsxs(Y,{"data-testid":"btn-eventsAttendance",className:"edit-selector text-primary",variant:"outline",size:"sm",children:[e.jsx(j,{icon:ea,className:"mr-1"}),"View Past Events"]})})})]}),a.selectedEvent&&e.jsx(dr,{show:a.showEditModal,event:a.selectedEvent,onHide:s,onSaved:n})]})},mr=({perks:a,loading:r})=>{if(r)return e.jsx(G,{className:"p-4 mb-3",children:e.jsx(J,{})});const t=a||[];return e.jsxs(G,{className:"px-4 pt-3 pb-2 mb-3",children:[e.jsxs("div",{className:"portal-card-header",children:[e.jsx(j,{icon:Ve}),"Available Perks"]}),t.length===0&&e.jsx("div",{className:"text-center text-muted py-2",children:e.jsx("small",{children:"No perks available"})}),t.slice(0,5).map((s,n)=>e.jsxs("div",{className:"d-flex align-items-center justify-content-between py-2",style:{borderBottom:n<Math.min(t.length,5)-1?"1px solid #f0f0f0":"none"},children:[e.jsxs("div",{className:"d-flex align-items-center",children:[e.jsx(j,{icon:Ve,className:"mr-2",style:{color:"#f0ad4e",fontSize:14,flexShrink:0}}),e.jsxs("div",{children:[e.jsx("div",{className:"font-weight-bold",style:{fontSize:13},children:s.perkName}),e.jsx("div",{style:{fontSize:11,color:"#888",marginTop:2},children:s.expirationDate?`Expires: ${Yt(s.expirationDate)}`:"No expiration"})]})]}),s.qty>1?e.jsx(ve,{variant:"primary",children:`Ã${s.qty}`}):e.jsx(ve,{variant:"success",children:"Available"})]},`${s.perkName}-${s.expirationDate||"none"}`)),e.jsx("div",{className:"text-right w-100",children:e.jsx(Ne,{to:"/memberPortal/perks",children:e.jsx(Y,{className:"edit-selector text-primary",variant:"outline",size:"sm","data-testid":"view-all-perks-button",children:"View all perks â"})})})]})},hr=({state:a,editAllowed:r,onEditDescriptionClick:t,handleSaveAvatar:s,handleEditCompany:n,handleBalanceDuePayment:d,handleDescriptionChange:o,handleDescriptionSave:l,handleDescriptionCancel:c,onManageFullPageContentClick:b,renderContactActions:g,renderCompanyActions:N,onCustomerEditDescriptionClick:S,handleCustomerDescriptionChange:E,handleCustomerDescriptionSave:T,handleCustomerDescriptionCancel:k,onCustomerManageFullPageContentClick:P,onEditCompanySocials:M,onEditContactSocials:_,perks:V,loadingPerks:H})=>{var ae;return e.jsx(ne,{className:"dashboard mb-3",children:e.jsxs(C,{children:[e.jsxs(v,{lg:6,sm:12,children:[e.jsx(lr,{loadingProfile:a.loadingProfile,userInfo:a.userInfo,editAllowed:r,onSaveAvatar:s,onEditSocials:_,renderContactActions:g}),e.jsx(or,{companyInfo:a.companyInfo,loadingBalanceDue:a.loadingBalanceDue,editAllowed:r,handleBalanceDuePayment:d,renderCompanyActions:N,onEditCompany:n,onEditSocials:M,onBalanceDuePayment:d}),a.companyInfo&&e.jsx(mr,{perks:V,loading:H})]}),e.jsxs(v,{lg:6,sm:12,children:[((ae=a.customerMembershipDirectoryForm)==null?void 0:ae.enableFullPage)&&e.jsx(qt,{loading:a.loadingCustomerMembershipDirectoryForm,isCustomer:!0,membershipDirectoryForm:a.customerMembershipDirectoryForm,isEditingDescription:a.isEditingCustomerDescription,editAllowed:r,onEditDescriptionClick:S,onCancelClick:k,onSaveClick:T,onDescriptionChange:E,onManageFullPageContentClick:P}),a.companyInfo&&e.jsx(qt,{loading:a.loadingMembershipDirectoryForm,companyInfo:a.companyInfo,membershipDirectoryForm:a.membershipDirectoryForm,isEditingDescription:a.isEditingDescription,editAllowed:r,onEditDescriptionClick:t,onCancelClick:c,onSaveClick:l,onDescriptionChange:o,onManageFullPageContentClick:b}),e.jsx(cr,{})]})]})})};if(!document.getElementById("dashboard-banner-styles")){const a=document.createElement("style");a.id="dashboard-banner-styles",a.textContent=` 6 @keyframes bannerShimmer { 7 0% { transform: translateX(-150%); } 8 100% { transform: translateX(250%); } 9 } 10 `,document.head.appendChild(a)}const ur=()=>{var E,T;const a=(E=h())==null?void 0:E.portalSettings;if(!(a!=null&&a.dashboardBannerColor1))return null;const{dashboardBannerType:r,dashboardBannerColor1:t,dashboardBannerColor2:s,dashboardBannerTitleTextColor:n,dashboardBannerSubtitleText:d,dashboardBannerSubtitleTextColor:o,portalName:l}=a,c=r==="Gradient"&&s,b=c?`linear-gradient(135deg, ${t} 0%, ${s} 72%, ${t} 100%)`:t,g=((T=h())==null?void 0:T.userName)||"",N=g.indexOf(" "),S=N>0?g.slice(0,N):g;return e.jsxs("div",{style:{background:b,position:"relative",overflow:"hidden",boxShadow:c?`0 4px 24px -4px ${s}88, rgba(0,0,0,0.3) 0px 1px 3px -1px`:"rgba(50, 50, 93, 0.72) 0p
10x 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px"},className:"p-4 pb-5 px-5 mb-3",children:[e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",background:"linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%)",animation:"bannerShimmer 3s linear forwards"}}),c&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",background:"radial-gradient(ellipse at 10% 50%, rgba(255,255,255,0.22) 0%, transparent 65%)"}}),e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",background:"radial-gradient(ellipse at 90% 120%, rgba(255,255,255,0.14) 0%, transparent 55%)"}}),e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",background:"radial-gradient(ellipse at 95% 0%, rgba(255,255,255,0.2) 0%, transparent 45%)"}}),e.jsx("div",{style:{position:"absolute",width:140,height:140,borderRadius:"50%",top:-50,right:"12%",background:`${s}55`,filter:"blur(38px)",pointerEvents:"none"}}),e.jsx("div",{style:{position:"absolute",width:90,height:90,borderRadius:"50%",bottom:-30,right:"30%",background:`${t}66`,filter:"blur(28px)",pointerEvents:"none"}})]}),e.jsxs("div",{style:{position:"relative",display:"flex",justifyContent:"space-between",alignItems:"flex-start"},className:"dashboard-banner",children:[e.jsxs("div",{children:[l&&e.jsx("div",{className:"mb-3",style:{backgroundColor:"#ffffff14",color:`color-mix(in srgb, ${n} 90%, black)`,fontSize:"0.7rem",width:"max-content",border:"1px solid rgba(255, 255, 255, 0.05)",borderRadius:"16px",padding:"2px 8px",backdropFilter:"blur(6px)"},children:l}),e.jsx("div",{className:"mb-0 font-weight-bold h5",style:{color:n||"#ffffff"},children:`Welcome back, ${S}`}),e.jsx("p",{className:"mt-2 mb-4",style:{color:o||"#ffffff"},children:d})]}),e.jsxs("button",{type:"button","data-testid":"dashboard-showMeAround",onClick:()=>Qt({params:{visible:!0,videoUrl:"https://app.screencast.com/4Rp8jPdecOuwz"}}),style:{flexShrink:0,marginTop:"4px",background:"rgba(255,255,255,0.12)",border:"1px solid rgba(255,255,255,0.25)",borderRadius:"20px",color:n,padding:"6px 16px",fontSize:"0.8rem",cursor:"pointer",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",gap:"6px",transition:"background 0.2s"},onMouseEnter:k=>{k.currentTarget.style.background="rgba(255,255,255,0.22)"},onMouseLeave:k=>{k.currentTarget.style.background="rgba(255,255,255,0.12)"},children:[e.jsx("span",{style:{fontSize:"0.85rem"},children:"â¶"}),"Show me around"]})]})]})};class pr extends I.Component{constructor(t){super(t);i(this,"getPortalPerks",()=>{const{currentCompanyInfo:t}=h();t&&this.setState({loadingPerks:!0},()=>{K.post("/perk/searchPortalPerks",{perkStatusCode:Rn},{success:s=>{var n;this.setState({perks:((n=s.data)==null?void 0:n.items)||[],loadingPerks:!1})},error:()=>{this.setState({perks:[],loadingPerks:!1})}},{block:!1})})});i(this,"refreshCompanyInfo",()=>{h().currentCompanyInfo&&this.setState({loading:!0},()=>{K.get("/customers/customer/getUserCompany",null,{success:t=>{this.setState({companyInfo:t.data,loading:!1,loadingMembershipDirectoryForm:!0},this.getMembershipDirectoryInfo)},error:()=>{this.setState({loading:!1})}})})});i(this,"getMembershipDirectoryInfo",()=>{this.setState({loadingMembershipDirectoryForm:!0},()=>{const t={companyId:this.state.companyInfo.companyId};K.get("/customers/company/getMembershipDirectoryInfo",t,{success:s=>{this.setState({membershipDirectoryForm:{websiteDescription:s.data.websiteDescription,enableFullPage:s.data.enableFullPage,rowVersion:s.data.rowVersion},loadingMembershipDirectoryForm:!1,dirty:!1})},error:s=>{R(s.error.errorMessage),this.setState({loadingMembershipDirectoryForm:!1})}})})});i(this,"getCustomerMembershipDirectoryInfo",()=>{h().previewSession||this.setState({loadingCustomerMembershipDirectoryForm:!0},()=>{K.get("/customers/company/getMembershipDirectoryInfo",null,{success:t=>{this.setState({customerMembershipDirectoryForm:{websiteDescription:t.data.websiteDescription,enableFullPage:t.data.enableFullPage,rowVersion:t.data.rowVersion,hasMembershipSubscriptions:t.data.hasMembershipSubscriptions},loadingCustomerMembershipDirectoryForm:!1})},error:t=>{R(t.error.errorMessage),this.setState({loadingCustomerMembershipDirectoryForm:!1})}})})});i(this,"getProfileInfo",()=>{if(h().previewSession){this.setState({loadingProfile:!1});return}this.setState({loadingProfile:!0},()=>{X.get("/profile/getProfile",null,{success:t=>{this.setState({userInfo:t.data,loadingProfile:!1})},error:t=>{R(t.error.errorMessage),this.setState({loadingProfile:!1})}})})});i(this,"handleEditCompanySocials",()=>{var t;this._companySocialsModal.open({modalTitle:`Edit ${(t=h().nomenclatures)==null?void 0:t.companies.singularTerm} Social Network's ID`,url:"/customers/company/saveCompanySocialInfo",isCompany:!0,isPortal:!0,onSave:this.refreshCompanyInfo})});i(this,"handleEditContactSocials",()=>{var t;this._contactSocialsModal.open({modalTitle:`Edit ${(t=h().nomenclatures)==null?void 0:t.contacts.singularTerm} Social Network's ID`,url:"/customers/customer/saveCustomerSocialInfo",isCompany:!1,isPortal:!0,onSave:this.getProfileInfo})});i(this,"handleEditCompany",()=>{this._saveCompanyModal.open({adding:!1,form:{...this.state.companyInfo},onSave:this.refreshCompanyInfo})});i(this,"saveMembershipDirectoryForm",()=>{this.setState({loadingMembershipDirectoryForm:!0},()=>{K.post("/customers/company/saveMembershipDirectoryInfo",{companyId:this.state.companyInfo.companyId,...this.state.membershipDirectoryForm},{success:t=>{this.setState({loadingMembershipDirectoryForm:!1}),ge(t.message),this.refreshCompanyInfo()},error:t=>{this.setState({loadingMembershipDirectoryForm:!1}),this.refreshCompanyInfo(),R(t.error.errorMessage)}},{block:!1})})});i(this,"saveCustomerMembershipDirectoryForm",()=>{this.setState({loadingCustomerMembershipDirectoryForm:!0},()=>{K.post("/customers/company/saveMembershipDirectoryInfo",{...this.state.customerMembershipDirectoryForm},{success:t=>{this.setState({loadingCustomerMembershipDirectoryForm:!1}),ge(t.message),this.getCustomerMembershipDirectoryInfo()},error:t=>{this.setState({loadingCustomerMembershipDirectoryForm:!1}),this.getCustomerMembershipDirectoryInfo(),R(t.error.errorMessage)}},{block:!1})})});i(this,"handleSaveAvatar",t=>{X.post("/profile/updateProfileAvatar",{customerId:h().customerId,avatarInfo:t},{success:s=>{this.setState(n=>({userInfo:{...n.userInfo,avatarInfo:t}})),ge(s.message)},error:s=>{R(s.error.errorMessage)}},{block:!1})});i(this,"onEditDescriptionClick",()=>{this.setState(t=>{var s;return{isEditingDescription:!0,originalDescription:((s=t.membershipDirectoryForm)==null?void 0:s.websiteDescription)||""}})});i(this,"handleDescriptionChange",t=>{this.setState(s=>({membershipDirectoryForm:{...s.membershipDirectoryForm,websiteDescription:t},dirty:!0}))});i(this,"handleDescriptionSave",()=>{this.saveMembershipDirectoryForm(this.state.membershipDirectoryForm),this.setState(()=>({isEditingDescription:!1,dirty:!0}))});i(this,"handleDescriptionCancel",()=>{this.setState(t=>({isEditingDescription:!1,membershipDirectoryForm:{...t.membershipDirectoryForm,websiteDescription:t.originalDescription},dirty:!1}))});i(this,"onCustomerEditDescriptionClick",()=>{this.setState(t=>{var s;return{isEditingCustomerDescription:!0,originalCustomerDescription:((s=t.customerMembershipDirectoryForm)==null?void 0:s.websiteDescription)||""}})});i(this,"handleCustomerDescriptionChange",t=>{this.setState(s=>({customerMembershipDirectoryForm:{...s.customerMembershipDirectoryForm,websiteDescription:t}}))});i(this,"handleCustomerDescriptionSave",()=>{this.saveCustomerMembershipDirectoryForm(),this.setState(()=>({isEditingCustomerDescription:!1}))});i(this,"handleCustomerDescriptionCancel",()=>{this.setState(t=>({isEditingCustomerDescription:!1,customerMembershipDirectoryForm:{...t.customerMembershipDirectoryForm,websiteDescription:t.originalCustomerDescription}}))});i(this,"handleCustomerManageFullPageContentClick",()=>{var t,s;this._manageFullPageContentModal.open({entityName:(t=this.state.userInfo)==null?void 0:t.t
10itle,customerId:h().customerId,companyId:null,enableFullPage:(s=this.state.customerMembershipDirectoryForm)==null?void 0:s.enableFullPage,onClose:()=>{}})});i(this,"getCompanyEmails",()=>{var s;const t=[];return(s=this.state.companyInfo.companyEmail)!=null&&s.email&&t.push(this.state.companyInfo.companyEmail),t});i(this,"getContactEmails",()=>{var s;const t=[];return(s=this.state.userInfo)!=null&&s.email&&t.push({email:this.state.userInfo.email}),t});i(this,"handleContactCompany",t=>{this._contactModalRef.open({entityId:this.state.companyInfo.companyId,entityType:fe.COMPANY,entityEmails:this.getCompanyEmails(),contactType:t})});i(this,"handleContactUser",t=>{this._contactModalRef.open({entityId:h().customerId,entityType:fe.CONTACT,entityEmails:this.getContactEmails(),contactType:t})});i(this,"handlePaymentMethodsContact",()=>{this._stripeModal.open({onClose:t=>{t&&this.refreshCompanyInfo()}})});i(this,"handleManageFullPageContentClick",()=>{var t;this._manageFullPageContentModal.open({entityName:this.state.companyInfo.companyName,customerId:null,companyId:this.state.companyInfo.companyId,enableFullPage:(t=this.state.membershipDirectoryForm)==null?void 0:t.enableFullPage,onClose:s=>{s.modifyLogo&&this.handleEditCompany()}})});i(this,"handleBalanceDuePayment",t=>{this.setState({loadingBalanceDue:!0},()=>{const s={companyId:this.state.companyInfo.companyId};K.get("/customers/customer/getUserBalance",s,{success:n=>{if(n.data.orders.length===0){R(`All ${this.state.companyInfo.balanceDueInfo.invoicePluralTerm} are paid.`);return}if(n.data.orders.every(d=>d.hasPaymentPlan)){R("Your balance due is currently associated to a payment plan. Please contact us for more information.");return}this.setState({loadingBalanceDue:!1},()=>{this._balanceDuePaymentModal.open({accountId:this.state.companyInfo.accountInfo.accountId,stripeAccountId:this.state.companyInfo.accountInfo.stripeAccountId,companyId:this.state.companyInfo.companyId,stripeConnectCustomerId:this.state.companyInfo.stripeConnectCustomerId,invoiceSingularTerm:this.state.companyInfo.balanceDueInfo.invoiceSingularTerm,orders:n.data.orders,isPrimaryOrBillingContact:t,onSave:this.refreshCompanyInfo})})},error:n=>{R(n.error.errorMessage),this.setState({loadingBalanceDue:!1})}},{block:!1})})});i(this,"handleEmailSegmentationChange",t=>{this.setState(s=>({companyInfo:{...s.companyInfo,emailSegmentation:t}}))});i(this,"renderCompanyActions",()=>{const{companyInfo:{companyPhone:t,companyEmail:s,companyWebsite:n,accountInfo:d}}=this.state;return e.jsx(At,{entityType:fe.COMPANY,accountInactive:!h().accountActive,hasPhone:t,hasEmail:s==null?void 0:s.email,hasWebsite:n,hasPaymentMethodsPermission:d.stripeAccountEnabled&&d.stripeIntegration,handlePaymentMethodsContact:this.handlePaymentMethodsContact,showAddress:!1,handleContact:this.handleContactCompany,isPortal:!0})});i(this,"renderContactActions",()=>{var t;return e.jsx(At,{entityType:fe.CONTACT,accountInactive:!h().accountActive,hasEmail:(t=this.state.userInfo)==null?void 0:t.email,handleContact:this.handleContactUser,isPortal:!0})});this.editAllowed=Te("ModifyCompanyDetails:Update"),this.canModifyLogo=Te("ModifyLogo"),this.state={companyInfo:null,originalCompanyInfo:null,membershipDirectoryForm:null,customerMembershipDirectoryForm:null,events:[],loading:!!h().currentCompanyInfo,loadingMembershipDirectoryForm:!1,loadingCustomerMembershipDirectoryForm:!1,loadingBalanceDue:!1,loadingProfile:!0,dirty:!1,perks:[],loadingPerks:!1}}componentDidMount(){this.refreshCompanyInfo(),this.getProfileInfo(),this.getCustomerMembershipDirectoryInfo(),this.getPortalPerks()}render(){var t;return e.jsxs(Ge,{className:"p-0",children:[e.jsx(ur,{}),this.state.loading&&e.jsx(J,{}),!this.state.loading&&e.jsxs(e.Fragment,{children:[e.jsx(hr,{state:this.state,editAllowed:this.editAllowed,perks:this.state.perks,loadingPerks:this.state.loadingPerks,handleSaveAvatar:this.handleSaveAvatar,handleEditCompany:this.handleEditCompany,handleBalanceDuePayment:this.handleBalanceDuePayment,renderContactActions:this.renderContactActions,renderCompanyActions:this.renderCompanyActions,onEditDescriptionClick:this.onEditDescriptionClick,handleDescriptionChange:this.handleDescriptionChange,handleDescriptionSave:this.handleDescriptionSave,handleDescriptionCancel:this.handleDescriptionCancel,onManageFullPageContentClick:this.handleManageFullPageContentClick,onCustomerEditDescriptionClick:this.onCustomerEditDescriptionClick,handleCustomerDescriptionChange:this.handleCustomerDescriptionChange,handleCustomerDescriptionSave:this.handleCustomerDescriptionSave,handleCustomerDescriptionCancel:this.handleCustomerDescriptionCancel,onCustomerManageFullPageContentClick:this.handleCustomerManageFullPageContentClick,onEditCompanySocials:this.handleEditCompanySocials,onEditContactSocials:this.handleEditContactSocials}),e.jsx(nr,{...this.props,canModifyLogo:this.canModifyLogo,ref:s=>{this._saveCompanyModal=s}}),e.jsx(ir,{...this.props,ref:s=>{this._balanceDuePaymentModal=s}}),e.jsx(vs,{customer:this.state.companyInfo,onEmailSegmentationChange:this.handleEmailSegmentationChange,ref:s=>this._contactModalRef=s}),e.jsx(Fn,{companyInfo:this.state.companyInfo,isPortal:!0,ref:s=>this._stripeModal=s}),e.jsx(Ft,{form:this.state.companyInfo,selectedId:(t=this.state.companyInfo)==null?void 0:t.companyId,isCompany:!0,ref:s=>{this._companySocialsModal=s}}),e.jsx(Ft,{form:this.state.userInfo,selectedId:h().customerId,ref:s=>{this._contactSocialsModal=s}}),e.jsx(_n,{ref:s=>this._manageFullPageContentModal=s,isPortal:!0,entityTypeCode:fe.COMPANY,editEntityAllowed:this.editAllowed})]})]})}}class gr extends Xt{constructor(){super(...arguments);i(this,"initialForm",()=>({oldPassword:"",newPassword:""}));i(this,"privileges",()=>({edit:!h().readOnlySession&&!h().previewSession}));i(this,"urls",()=>({get:X.url("/profile/getSecurity"),save:X.url("/profile/updateSecurity")}));i(this,"getRequest",()=>({}));i(this,"saveRequest",()=>{if(!this.validate())return null;const{form:t}=this.state;return t.oldPassword&&t.oldPassword!==""||t.newPassword&&t.newPassword!==""?{oldPassword:this.state.form.oldPassword,newPassword:this.state.form.newPassword}:null});i(this,"ready",()=>{this.focusControl&&this.focusControl.focus()});i(this,"validate",()=>{const{form:t}=this.state;return t.newPassword!==t.confirmPassword?(R("The password and confirmation password do not match."),!1):!0});i(this,"renderForm",()=>this.state.loading?null:e.jsxs(e.Fragment,{children:[e.jsxs(C,{children:[e.jsxs(v,{md:7,children:[e.jsxs(A,{children:[e.jsx(me,{"data-testid":"input-cpSecurityTab-oldPassword",name:"oldPassword",validate:!1,required:this.state.changingPassword}),e.jsx(D,{htmlFor:"oldPassword",required:this.state.changingPassword,children:"Current password"})]}),e.jsxs(A,{children:[e.jsx(me,{"data-testid":"input-cpSecurityTab-newPassword",name:"newPassword",required:this.state.changingPassword}),e.jsx(D,{htmlFor:"newPassword",required:this.state.changingPassword,children:"New password"})]}),e.jsxs(A,{children:[e.jsx(me,{"data-testid":"input-cpSecurityTab-confirmPassword",name:"confirmPassword",required:this.state.changingPassword}),e.jsx(D,{htmlFor:"confirmPassword",required:this.state.changingPassword,children:"Confirm new password"})]})]}),e.jsx(v,{md:5,children:e.jsx(Ye,{maxPasswordLength:128})})]}),e.jsx("hr",{})]}))}}class xr extends Xt{constructor(){super(...arguments);i(this,"initialForm",()=>({email:"",firstName:"",lastName:"",primaryPhone:"",secondaryPhone:"",landingPage:"",avatarInfo:""}));i(this,"privileges",()=>({edit:!h().readOnlySession&&!h().previewSession}));i(this,"urls",()=>({get:X.url("/profile/getProfile"),save:X.url("/profile/updateProfile")}));i(this,"getRequest",()=>({}));i(this,"saveRequest",()=>({firstName:this.state.form.firstName,lastName:this.state.form.lastName,primaryPhone:this.state.form.primaryPhone,secondaryPhone:this.state.form.secondaryPhone,email:this.state.form.email,avatarInfo:this.state.form.avatarInfo,landingPage:this.state.form.landingPage}));i(this,"ready",()=>{this.focusControl&&this.focusControl.focus()});i(this,"afterSave",()=>{const t=this.state.form.email,s=`${this.state.form.firstName} ${this.state.form.lastName}`;Jt(t,s,s)});i(this,"renderForm",()=>{if(this.state.loading)return null;const t=this.state.form.pendingEmail&&!this.state.form.isPendingEmailTokenExpired,{primaryPhone:s,secondaryPhone:n}=this.state.form;let d=null;s&&s.phoneTypeCode&&s.phoneTypeCode.toUpperCase()==="MOBILE"?d=s:n&&n.phoneTypeCode&&n.phoneTypeCode.toUpperCase()==="MOBILE"&&(d=n);const o=e.jsxs(Se,{id:"emailTooltip",children:[!t&&e.jsxs(e.Fragment,{children:[e.jsx(j,{icon:Mt})," ",e.jsx("span",{className:"ml-1",children:"Changing the email changes your login."})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx(j,{icon:Mt})," ",e.jsxs("span",{className:"ml-1",children:["Pending Change: From"," ",this.state.form.email," ","to"," ",this.state.form.pendingEmail]})]})]});return e.jsxs(e.Fragment,{children:[e.jsxs(C,{children:[e.jsxs(v,{md:7,children:[e.jsx(we,{placement:"bottom",trigger:t?"hover":"focus",overlay:o,children:e.jsxs(A,{children:[e.jsx(ut,{"data-testid":"input-cpProfileTab-email",name:"email",maxLength:255,required:!0,disabled:t,className:t?"profile-email-disabled":""}),e.jsx(D,{required:!0,children:"Email"})]})}),e.jsxs(A,{children:[e.jsx(pe,{name:"firstName",maxLength:"30",required:!0,"data-testid":"input-portalProfileTab-firstName"}),e.jsx(D,{htmlFor:"firstName",required:!0,children:"First name"})]}),e.jsxs(A,{children:[e.jsx(pe,{name:"lastName",maxLength:"30",required:!0,"data-testid":"input-portalProfileTab-lastName"}),e.jsx(D,{htmlFor:"lastName",required:!0,children:"Last name"})]}),e.jsx(C,{className:"mb-2",children:e.jsx(v,{xs:12,md:12,lg:8,xl:8,children:e.jsxs(A,{children:[e.jsx(et,{name:"primaryPhone","data-testid":"input-portalProfileTab-primaryPhone"}),e.jsx(D,{htmlFor:"primaryPhone",required:!0,children:"Primary phone"}),e.jsxs(A,{children:[e.jsx(et,{name:"secondaryPhone","data-testid":"input-portalProfileTab-secondaryPhone"}),e.jsx(D,{htmlFor:"secondaryPhone",children:"Secondary phone"})]})]})})})]}),e.jsx(v,{md:5,children:e.jsxs(C,{className:"mt-2 flex-wrap",children:[e.jsx("div",{className:"pl-3",children:e.jsx(Ke,{targetName:"avatar",name:"avatarInfo",formControl:!0,size:"sm",folder:"CustomerPortalAvatars"})}),e.jsxs("div",{className:"d-flex flex-column justify-content-center align-items-start pl-2",children:[e.jsx(D,{htmlFor:"avatarInfo",className:"m-0",children:"Choose your avatar"}),e.jsx("p",{className:"small font-italic",children:"Click on the picture to browse a different one."})]})]})})]}),!d&&h().twoFactorAuthentication&&e.jsx(C,{children:e.jsx(v,{md:10,children:e.jsx(Ln,{message:"(*) Please setup a mobile phone for multi-factor authentication."})})})]})})}}class fr extends I.Component{render(){const r={title:"My Profile",icon:{comp:Me,color:"#3c8dbc"},fullscreen:!1,tabs:[{key:"profileTab",title:"Profile",comp:xr,helpKey:sa.key},{key:"securityTab",title:"Security",comp:gr,helpKey:aa.key}]};return e.jsx(ne,{children:e.jsx(Zt,{...r})})}}
10const yr=({hasEmail:a,hasPhone:r,emails:t,entityType:s,entityId:n,accountActive:d,handleContact:o,showAddress:l,hasWebsite:c,handlePaymentMethodsContact:b,hasPaymentMethodsPermission:g})=>e.jsxs("div",{className:"d-flex flex-column row-gap-1 w-auto",style:{fontSize:"12px"},children:[e.jsx("div",{className:"d-flex flex-wrap",style:{columnGap:"12px"},title:"View details",children:a&&e.jsxs("span",{className:"d-flex align-items-center cursor-pointer custom-contact-action",onClick:()=>!d&&o("EMAIL",s,n),children:[e.jsx(j,{icon:na,className:"mr-2"}),t[0].email,e.jsx("div",{className:"ml-2",children:e.jsx("img",{src:"/images/customer-portal/opt-out-icon.png",height:"22px"})})]})}),e.jsx("div",{className:"d-flex flex-wrap",style:{columnGap:"12px"},title:"View details",children:r&&e.jsxs("span",{className:"d-flex align-items-center cursor-pointer custom-contact-action",onClick:()=>!d&&o("PHONE",s,n),children:[e.jsx(j,{icon:ra,className:"mr-2"}),r.number]})}),l&&e.jsxs("div",{className:"d-flex align-items-center cursor-pointer custom-contact-action flex-nowrap",title:"View details",onClick:()=>!d&&o("ADDRESS",s,n),children:[e.jsx(j,{icon:ia,className:"mr-2"}),e.jsx("span",{children:[l.city,l.stateCode,l.zip,l.countryCode].filter(Boolean).join(", ")})]}),c&&e.jsx("a",{className:"mr-1",href:oa(c),target:"_blank",rel:"noopener noreferrer",title:"View website",children:e.jsxs("div",{className:"d-flex align-items-center cursor-pointer custom-contact-action",children:[e.jsx(j,{icon:la,className:"mr-2"}),e.jsx("span",{className:"text-primary",children:"Website"})]})}),g&&e.jsxs("div",{className:"d-flex align-items-center cursor-pointer custom-contact-action",title:"View payment info",onClick:d?void 0:b,children:[e.jsx(j,{icon:da,className:"mr-2"}),e.jsx("span",{children:"Payment Info"})]})]}),br=({facebook:a,twitter:r,linkedIn:t,instagram:s,tikTok:n})=>{const d=a||r||t||s||n;return e.jsx("div",{className:"d-flex contact-social-menu",children:d?e.jsxs(e.Fragment,{children:[a&&e.jsx("a",{className:"mr-1",href:`https://www.facebook.com/${a}`,target:"_blank",title:"Go to Facebook",rel:"noopener noreferrer",children:e.jsx(j,{icon:lt,className:"active-facebook"})}),r&&e.jsx("a",{className:"mr-1",href:`https://www.twitter.com/${r}`,target:"_blank",title:"Go to Twitter",rel:"noopener noreferrer",children:e.jsx(j,{icon:dt,className:"active-twitter"})}),t&&e.jsx("a",{className:"mr-1",href:`https://www.linkedin.com/in/${t}`,target:"_blank",title:"Go to LinkedIn",rel:"noopener noreferrer",children:e.jsx(j,{icon:ct,className:"active-linkedIn"})}),s&&e.jsx("div",{className:"icon-instagram",children:e.jsx("a",{href:`https://www.instagram.com/${s}`,target:"_blank",title:"Go to Instagram",rel:"noopener noreferrer",children:e.jsx(j,{icon:mt})})}),n&&e.jsx("div",{className:"icon-tiktok",children:e.jsx("a",{href:`https://www.tiktok.com/@${n}`,target:"_blank",title:"Go to TikTok",rel:"noopener noreferrer",children:e.jsx(j,{icon:ht})})})]}):e.jsx("small",{className:"no-social-message font-italic",children:"No social media links available."})})},vr="_fullContainer_cfatr_1",jr="_wrapperClassname_cfatr_10",Cr="_containerAccordion_cfatr_16",Sr="_wrapperClassnameMobile_cfatr_16",wr="_nameColumn_cfatr_22",Pr="_rowAvatar_cfatr_30",Nr="_column_cfatr_36",Er="_columnMobile_cfatr_41",kr="_contactInfoColumn_cfatr_47",Tr="_contactName_cfatr_58",Ir="_contactPosition_cfatr_65",ie={fullContainer:vr,wrapperClassname:jr,containerAccordion:Cr,wrapperClassnameMobile:Sr,nameColumn:wr,rowAvatar:Pr,column:Nr,columnMobile:Er,contactInfoColumn:kr,contactName:Tr,contactPosition:Ir},Ar=({editAllowed:a,onEdit:r,...t})=>{const[s,n]=F.useState(null),d=F.useRef(null),{customerId:o,entityKey:l,avatarStorageKey:c,fullName:b,companyPositionInfo:g,primaryPhone:N,secondaryPhone:S,email:E,secondaryEmail:T,primaryAddress:k,secondaryAddress:P,facebookSet:M,facebook:_,twitterSet:V,twitter:H,instagramSet:ae,instagram:re,linkedInSet:ee,linkedIn:he,tikTokSet:f,tikTok:B}=t,U=()=>{const y=[];return E.email!==null&&y.push(E),T.email!==null&&y.push(T),y},Q=y=>{const w=o===h().customerId;d.current.open({entityId:o,entityType:fe.CONTACT,entityEmails:U(),contactType:y,allDetails:!0,canEditEmailSettings:w})},te=()=>{r&&r(t)},x=({wrapperClassname:y}={})=>e.jsxs("div",{className:"d-flex align-items-center",children:[e.jsx(Kt,{avatarRounded:!0,entityName:"Customer",size:"small",entityKey:l,imgClassname:ie.rowAvatar,wrapperClassname:y||ie.wrapperClassname,avatarStorageKey:c}),e.jsxs("div",{className:ie.nameColumn,children:[e.jsx("div",{className:ie.contactName,children:b}),g.position&&e.jsx("span",{className:ie.contactPosition,children:g.position})]})]}),m=()=>{const y=M&&_,w=V&&H,z=ee&&he,W=ae&&re,q=f&&B;return e.jsx(br,{facebook:y,twitter:w,linkedIn:z,instagram:W,tikTok:q})},u=()=>e.jsx(yr,{hasPhone:N||S,hasEmail:E.email||T.email,emails:U(),showAddress:k||P,handleContact:Q}),p=()=>e.jsxs(be,{className:"edit-selector text-primary",variant:"outline",size:"xs",style:{fontSize:"12px"},"data-testid":`btn-contactRow-${o}-edit`,disabled:h().readOnlySession||h().previewSession,onClick:te,children:[e.jsx(j,{icon:Pe,className:"mr-1"}),"Edit"]});return e.jsxs(e.Fragment,{children:[e.jsxs(C,{className:ie.fullContainer,children:[e.jsx(v,{xs:12,md:3,sm:6,lg:2,xl:3,className:"d-flex align-items-center justify-content-start px-0 flex-grow-0",children:x()}),e.jsx(v,{className:ie.column,children:u()}),e.jsx(v,{xs:12,md:2,sm:6,lg:3,xl:3,className:ie.column,children:m()}),a&&e.jsx(v,{xs:12,md:2,sm:6,lg:2,xl:2,className:ie.column,style:{flexBasis:"max-content"},children:p()})]}),e.jsx(le,{activeKey:s,className:ie.containerAccordion,onSelect:y=>{n(w=>w===y?null:y)},children:e.jsxs(G,{className:"mb-3",children:[e.jsx(le.Toggle,{as:ce,variant:"none",className:"w-100 d-flex",eventKe
10y:o,children:e.jsxs(C,{className:"d-flex w-100 align-items-center justify-content-between",children:[x({wrapperClassname:ie.wrapperClassnameMobile}),e.jsx(j,{icon:s===o?es:ts})]})}),e.jsx(le.Collapse,{eventKey:o,children:e.jsxs(G.Body,{className:"p-3 rounded-sm bg-whitesmoke shadow-sm",children:[e.jsx(v,{className:ie.columnMobile,children:u()}),e.jsx("hr",{className:"my-2"}),e.jsx("div",{className:ie.columnMobile,children:m()}),e.jsx("hr",{className:"my-2"}),a&&e.jsx("div",{className:ie.columnMobile,children:p()})]})})]})}),e.jsx(vs,{customer:t,ref:d})]})};class js extends I.PureComponent{constructor(t){super(t);i(this,"buildState",()=>({items:this.props.items.map(t=>({...t,value:t.companyId,label:t.companyName}))}));this.state=this.buildState(),this._isMounted=!1}componentDidMount(){this._isMounted=!0}componentDidUpdate(t){JSON.stringify(t.items)!==JSON.stringify(this.props.items)&&this.setState(this.buildState())}componentWillUnmount(){this._isMounted=!1}render(){return e.jsx(Qe,{...this.props,"data-testid":this.props["data-testid"],items:this.state.items,includeInactive:!1,ref:t=>this._ctrl=t})}}js.defaultProps={formControl:!0,managed:!1,clearable:!0,searchable:!0,placeholder:""};const _e={ContactDetails:{key:"contactDetails",title:"Contact Details"},SocialProfiles:{key:"socialProfiles",title:"Social Profiles"}},Mr=[_e.ContactDetails,_e.SocialProfiles];class Dr extends I.Component{constructor(t){super(t);i(this,"open",t=>{var n,d;const s=t.adding?this._initialForm():t.form??{};this.setState({visible:!0,adding:t.adding,onSave:t.onSave,customerId:t.customerId,loggedInCustomerCompanies:t.loggedInCustomerCompanies||[],form:s,prevForm:{...s},modalTitle:`${t.adding?"Add":"Edit"} ${(d=(n=h().nomenclatures)==null?void 0:n.contacts)==null?void 0:d.singularTerm}`,addPersonalAddress:!!(s!=null&&s.primaryAddress),addSecondaryAddress:!!(s!=null&&s.secondaryAddress),disableAddress:t.disableAddress,disabled:t.disabled})});i(this,"close",()=>{this.setState({visible:!1,dirty:!1,saving:!1,form:{},activeTabKey:_e.ContactDetails.key})});i(this,"_initialState",()=>({params:{},visible:!1,dirty:!1,form:{},saving:!1,activeTabKey:_e.ContactDetails.key}
10));i(this,"_initialForm",()=>({companies:[]}));i(this,"handleChange",t=>{this.setState({form:t})});i(this,"handleCancel",()=>{this.close()});i(this,"handleDirt",()=>{this.setState({dirty:!0})});i(this,"handleSave",()=>{this.state.saving||this.save()});i(this,"save",()=>{this.setState({saving:!0},()=>{K.post("/customers/customer/saveCustomer",this.saveCustomerRequest(),{success:t=>{if(this.state.onSave&&this.state.onSave(t.data.entityId),ge(t.message),this.state.customerId===h().customerId){const s=this.state.form.email.email,n=`${this.state.form.firstName} ${this.state.form.lastName}`;Jt(s,n,n)}this.close()},error:t=>{R(t.error.errorMessage),this.setState({saving:!1})}})})});i(this,"handlePrimaryAddressChange",t=>{this.setState(s=>({...s,dirty:!0,form:{...s.form,primaryAddress:t}}))});i(this,"handleExpandSecondaryAddress",()=>{this.setState({addSecondaryAddress:!0})});i(this,"handleSecondaryAddressChange",t=>{this.setState(s=>({...s,dirty:!0,form:{...s.form,secondaryAddress:t}}))});i(this,"handleSecondaryAddressRemove",()=>{this.setState(t=>({...t,dirty:!0,form:{...t.form,secondaryAddress:null},addSecondaryAddress:!1}))});i(this,"handleSelectTab",t=>{this.setState({activeTabKey:t})});i(this,"handleChangeFacebook",t=>{this.setState(s=>({form:{...s.form,facebook:t},dirty:!0}))});i(this,"handleChangeTwitter",t=>{this.setState(s=>({form:{...s.form,twitter:t},dirty:!0}))});i(this,"handleChangeLinkedIn",t=>{this.setState(s=>({form:{...s.form,linkedIn:t},dirty:!0}))});i(this,"handleChangeInstagram",t=>{this.setState(s=>({form:{...s.form,instagram:t},dirty:!0}))});i(this,"handleChangeTikTok",t=>{this.setState(s=>({form:{...s.form,tikTok:t},dirty:!0}))});i(this,"handleCompanyPositionChange",(t,s)=>{this.setState(n=>({form:{...n.form,companies:n.form.companies.map(d=>d.companyId===s?{...d,position:t}:d)},dirty:!0}))});i(this,"handleCompanyChange",t=>{this.setState(s=>({form:{...s.form,companies:[t]},dirty:!0}))});i(this,"onCompanySelection",t=>{this.setState(s=>({form:{...s.form,companyId:t&&t.value,companyLabel:t&&t.label}}))});i(this,"saveCustomerRequest",()=>{const t=this.state.customerId;return{customerId:this.state.adding?null:t,customerAvatarInfo:this.state.form.customerAvatarInfo,firstName:this.state.form.firstName,lastName:this.state.form.lastName,nickname:this.state.form.nickname,companies:this.state.form.companies,email:this.state.form.email,secondaryEmail:this.state.form.secondaryEmail,primaryPhone:this.state.form.primaryPhone,secondaryPhone:this.state.form.secondaryPhone,primaryAddress:this.state.form.primaryAddress,secondaryAddress:this.state.form.secondaryAddress,facebookSet:this.state.form.facebookSet,facebook:this.state.form.facebook,twitterSet:this.state.form.twitterSet,twitter:this.state.form.twitter,linkedInSet:this.state.form.linkedInSet,linkedIn:this.state.form.linkedIn,instagramSet:this.state.form.instagramSet,instagram:this.state.form.instagram,tikTokSet:this.state.form.tikTokSet,tikTok:this.state.form.tikTok,rowVersion:this.state.form.rowVersion}});i(this,"renderCompanyPositionInput",t=>e.jsxs(A,{children:[e.jsx(pe,{value:t.position,onChange:s=>this.handleCompanyPositionChange(s,t.companyId),maxLength:150,"data-testid":"input-contacts-1"}),e.jsxs(D,{required:!0,htmlFor:"position",children:["Title/Position in"," ",t.companyName]})]}));i(this,"renderContactDetails",()=>{var n,d,o,l,c,b,g,N,S,E,T,k,P,M,_,V,H,ae,re,ee,he,f,B,U;const t=["Office","Mobile","Home"],s=["Office","Personal"];return e.jsxs(e.Fragment,{children:[e.jsxs(C,{className:"mb-2 d-flex",children:[e.jsx(v,{className:"pl-3 text-center flex-grow-0",children:e.jsx(Ke,{targetName:"avatar",name:"customerAvatarInfo",formControl:!0,size:"sm",folder:"CustomerPortalAvatars",customCanvasSize:!0,autoAdjustSize:{ratioWidth:300,ratioHeight:300}})}),e.jsxs(v,{className:"d-flex flex-column justify-content-center align-items-start",children:[e.jsx(D,{htmlFor:"customerAvatarInfo",className:"m-0",children:"Upload photo"}),e.jsx("em",{className:"small",children:"Click on the picture to upload. A square image will work best."})]})]}),e.jsxs(C,{children:[e.jsx(v,{md:6,children:e.jsxs(A,{children:[e.jsx(pe,{name:"firstName",maxLength:30,required:!0,"data-testid":"input-contacts-2"}),e.jsx(D,{htmlFor:"firstName",required:!0,children:"First Name"})]})}),e.jsx(v,{md:6,children:e.jsxs(A,{children:[e.jsx(pe,{name:"lastName",maxLength:30,required:!0,"data-testid":"input-contacts-3"}),e.jsx(D,{htmlFor:"lastName",required:!0,children:"Last Name"})]})})]}),e.jsx(C,{children:e.jsx(v,{md:6,children:e.jsxs(A,{children:[e.jsx(pe,{name:"nickname",maxLength:30,"data-testid":"input-contacts-4"}),e.jsx(D,{htmlFor:"nickname",children:"Nickname/Goes by ..."})]})})}),!this.state.adding&&this.state.addContactToCompany&&e.jsxs(C,{children:[e.jsx(v,{md:6,children:e.jsxs(A,{children:[e.jsx(ca,{"data-testid":"auto-saveContactModal-companyId",id:"companyId",value:(n=this.state.form)==null?void 0:n.companyId,text:(d=this.state.form)==null?void 0:d.companyLabel,label:(o=this.state.form)==null?void 0:o.companyLabel,formControl:!1,clearable:!0,onlyCompanies:!0,hasNoLabel:!0,onChange:Q=>this.onCompanySelection(Q),disabled:this.state.disabled||this.state.entityType===fe.CONTACT&&((l=this.state.form)==null?void 0:l.companyId)>0}),e.jsx(D,{htmlFor:"companyId",children:(c=h().nomenclatures)==null?void 0:c.companies.singularTerm})]})}),e.jsx(v,{md:6,children:((b=this.state.form)==null?void 0:b.companyId)&&e.jsxs(A,{children:[e.jsx(pe,{name:"position",maxLength:150,"data-testid":"input-contacts-5"}),e.jsxs(D,{htmlFor:"position",children:["Title/Position in"," ",(g=h().nomenclatures)==null?void 0:g.companies.singularTerm]})]})})]}),e.jsx(C,{children:e.jsx(v,{md:12,children:e.jsx(ma,{"data-testid":"input-saveContactModal-contactBox",name:"contactBox",primaryEmail:(N=this.state.form)==null?void 0:N.email,secondaryEmail:(S=this.state.form)==null?void 0:S.secondaryEmail,primaryPhone:(E=this.state.form)==null?void 0:E.primaryPhone,secondaryPhone:(T=this.state.form)==null?void 0:T.secondaryPhone,required:!0,phoneTypes:this.state.addContactToCompany?t:null,emailTypes:this.state.addContactToCompany?s:null,disablePrimaryEmailUpdate:((k=this.state.form)==null?void 0:k.portalAccessEnabled)&&!((P=this.state.form)!=null&&P.portalAccessRegistrationPending),emailTooltip:!this.state.adding&&((M=this.state.form)!=null&&M.portalAccessEnabled)&&((_=this.state.form)!=null&&_.portalAccessRegistrationPending)?e.jsxs(Se,{children:["This"," ",(V=h().nomenclatures)==null?void 0:V.contacts.singularTerm," ","has a pending registration in the Portal. If you change this email, a new Registration mail will be sent to the new email."]}):null})})}),e.jsxs(C,{children:[this.state.adding&&e.jsx(v,{children:e.jsxs(A,{children:[e.jsx(js,{"data-testid":"combo-saveContactModal-company",items:this.state.loggedInCustomerCompanies,value:(H=this.state.form.companies[0])==null?void 0:H.companyId,onChange:this.handleCompanyChange,clearable:!1}),e.jsx(D,{required:!0,children:(re=(ae=h().nomenclatures)==null?void 0:ae.companies)==null?void 0:re.singularTerm})]})}),!this.state.adding&&e.jsx(v,{children:this.state.form.companies.map(Q=>e.jsx(C,{children:e.jsx(v,{children:this.renderCompanyPositionInput(Q)})},Q.companyId))})]}),!this.state.addPersonalAddress&&e.jsx(Y,{variant:"link",onClick:()=>this.setState({addPersonalAddress:!0}),"data-testid":"btn-saveContactModal-addPersonalAddress",children:"Add personal address"}),this.state.addPersonalAddress&&e.jsxs(e.Fragment,{children:[e.jsx(C,{children:e.jsx(v,{md:12,children:e.jsx(Ze,{value:(ee=this.state.form)==null?void 0:ee.primaryAddress,disabled:this.state.disableAddress,formControl:!1,onChange:this.handlePrimaryAddressChange,label:"Primary Address",enableNickname:((he=this.state.form)==null?void 0:he.secondaryAddress)!==null||this.state.addSecondaryAddress,collapseCountry:!0,forceAutoComplete:!0})})}),!this.state.addSecondaryAddress&&!((f=this.state.form)!=null&&f.secondaryAddress)&&e.jsx("a",{href:"#",onClick:this.handleExpandSecondaryAddress,children:"Add a secondary address"}),(this.state.addSecondaryAddress||((B=this.state.form)==null?void 0:B.secondaryAddress))&&e.jsx(C,{className:"mt-2",children:e.jsx(v,{md:12,children:e.jsx(Ze,{value:(U=this.state.form)==null?void 0:U.secondaryAddress,disabled:this.state.disabled||this.state.disableAddress,formControl:!1,onChange:this.handleSecondaryAddressChange,label:"Secondary Address",enableNickname:!0,onRemove:this.handleSecondaryAddressRemove,collapseCountry:!0})})})]})]})});i(this,"renderSocialProfiles",()=>e.jsx(C,{children:e.jsxs(v,{children:[e.jsxs(C,{children:[e.jsx(A,{children:e.jsx(Ce,{className:"mt-2",name:"facebookSet","data-testid":"switch-contacts-1"})}),e.jsxs(A,{className:"w-75",children:[e.jsx(De,{"data-testid":"input-saveContactModal-facebook",name:"facebook",onChangeCallback:this.handleChangeFacebook,socialName:"Facebook",required:!0,value:this.state.form.facebook}),e.jsx(D,{htmlFor:"facebook",children:"Facebook"})]})]}),e.jsxs(C,{children:[e.jsx(A,{children:e.jsx(Ce,{className:"mt-2",name:"twitterSet","data-testid":"switch-contacts-2"})}),e.jsxs(A,{className:"w-75",children:[e.jsx(De,{"data-testid":"input-saveContactModal-twitter",name:"twitter",onChangeCallback:this.handleChangeTwitter,socialName:"Twitter",required:!0,value:this.state.form.twitter}),e.jsx(D,{htmlFor:"twitter",children:"Twitter"})]})]}),e.jsxs(C,{children:[e.jsx(A,{children:e.jsx(Ce,{className:"mt-2",name:"linkedInSet","data-testid":"switch-contacts-3"})}),e.jsxs(A,{className:"w-75",children:[e.jsx(De,{"data-testid":"input-saveContactModal-linkedIn",name:"linkedIn",onChangeCallback:this.handleChangeLinkedIn,socialName:"LinkedIn",required:!0,value:this.state.form.linkedIn}),e.jsx(D,{htmlFor:"linkedIn",children:"LinkedIn"})]})]}),e.jsxs(C,{children:[e.jsx(A,{children:e.jsx(Ce,{className:"mt-2",name:"instagramSet","data-testid":"switch-contacts-4"})}),e.jsxs(A,{className:"w-75",children:[e.jsx(De,{"data-testid":"input-saveContactModal-instagram",name:"instagram",onChangeCallback:this.handleChangeInstagram,socialName:"Instagram",required:!0,value:this.state.form.instagram}),e.jsx(D,{htmlFor:"instagram",children:"Instagram"})]})]}),e.jsxs(C,{children:[e.jsx(A,{children:e.jsx(Ce,{className:"mt-2",name:"tikTokSet","data-testid":"switch-contacts-5"})}),e.jsxs(A,{className:"w-75",children:[e.jsx(De,{"data-testid":"input-saveContactModal-tiktok",name:"tikTok",onChangeCallback:this.handleChangeTikTok,socialName:"TikTok",required:!0,value:this.state.form.tikTok}),e.jsx(D,{htmlFor:"tikTok",children:"TikTok"})]})]})]})}));i(this,"renderTabs",()=>Mr.map(t=>{const s=this.state.activeTabKey===t.key;return e.jsxs("a",{className:xe("text-sm",{active:s}),onClick:()=>this.handleSelectTab(t.key),children:[t.title,e.jsx("span",{className:"active-tab-bar"})]},t.key)}));i(this,"renderTabsContent",()=>this.state.activeTabKey===_e.ContactDetails.key?this.renderContactDetails():this.renderSocialProfiles());this.state=this._initialState()}render(){return this.state.visible?e.jsxs(O,{show:this.state.visible,onHide:this.handleCancel,size:"md",centered:"false","data-testid":"modal-saveContact",children:[e.jsx(O.Header,{closeButton:!0,children:e.jsx(O.Title,{children:this.state.modalTitle})}),e.jsxs(O.Body,{children:[e.jsx(Ae,{onChange:this.handleChange,onDirt:this.handleDirt,values:this.state.form,disabled:this.state.saving,children:e.jsxs("div",{className:"item-card-tab-container",children:[e.jsx("header",{className:"item-card-tab-header",children:e.jsx("div",{id:"material-tabs",children:this.renderTabs()})}),e.jsx("div",{className:"item-card-tab-content",children:this.renderTabsContent()})]})}),this.state.saving&&e.jsx(C,{className:"mt-3",children:e.jsx(v,{children:e.jsx(J,{})})})]}),!this.state.saving&&e.jsxs(O.Footer,{children:[e.jsx(Y,{variant:"danger",onClick:this.handleCancel,"data-testid":"btn-saveContact-cancel",children:"Cancel"}),e.jsx(Y,{variant:"success",onClick:this.handleSave,disabled:!this.state.dirty,"data-testid":"btn-saveContact-save",children:"Save"})]})]}):null}}class Rr extends I.Component{constructor(t){super(t);i(this,"search",()=>{this.setState({loading:!0}),K.get("/customers/customer/getAssociatedContacts",null,{success:t=>{this.setState({customers:t.data.contacts},()=>{this.state.customers.length===0&&R("No results found.")}),this.setState({loading:!1})},error:t=>{R(t.error.errorMessage),this.setState({loading:!1})}})});i(this,"getUserCompanies",()=>{K.get("/customers/customer/getUserCompanies",null,{success:t=>{this.setState({userCompanies:t.data.companies})},error:t=>R(t.error.errorMessage)})});i(this,"handleAdd",()=>{if(!h().currentCompanyInfo){R(`You cannot create a new ${h().nomenclatures.contacts.singularTerm} because there's no associated ${h().nomenclatures.companies.singularTerm} to your User.`);return}this._saveContactModal.open({adding:!0,loggedInCustomerCompanies:this.state.userCompanies,onSave:this.search})});i(this,"handleEditCustomer",t=>{K.get("/customers/customer/getCustomer",{customerId:t.customerId},{success:s=>{this._saveContactModal.open({adding:!1,form:s.data,customerId:t.customerId,onSave:this.search})},error:s=>R(s.error.errorMessage)})});this.state={addAllowed:Te("ModifyCompanyAffiliatedContacts:Update"),editAllowed:Te("ModifyCompanyAffiliatedContacts:Update"),customers:[],userCompanies:[],loading:!1}}componentDidMount(){this.search(),this.getUserCompanies()}render(){return e.jsxs(ne,{className:"mb-4",children:[e.jsxs("div",{className:"d-flex align-items-center w-100 justify-content-between py-3",children:[e.jsxs("div",{className:"d-flex align-items-center",children:[e.jsx(j,{icon:Me,color:"#3C8DBC",className:"body-icon"}),e.jsx("strong",{className:"ml-2 mb-0 body-icon",children:h().nomenclatures.contacts.pluralTerm})]}),this.state.addAllowed&&e.jsxs(be,{id:"btnAddNew","data-testid":"btn-contactsManagement-add",variant:"success",size:"sm",className:"float-right",disabled:h().readOnlySession||h().previewSession,onClick:this.handleAdd,children:["Create"," ",h().nomenclatures.contacts.singularTerm]})]}),e.jsx(Ge,{children:e.jsx(ha,{noPadding:!0,children:e.jsx(C,{className:"customers-list-container w-100 m-0",children:e.jsx(v,{className:"w-auto d-flex flex-column pt-2",children:this.state.loading?e.jsx(J,{className:"my-3"}):this.state.customers.length>0?this.state.customers.map(t=>F.createElement(Ar,{...t,key:t.customerId,editAllowed:this.state.editAllowed,onEdit:this.handleEditCustomer})):e.jsxs("div",{className:"d-flex flex-column align-items-center w-100 mt-4 py-5",children:[e.jsx("img",{src:"/images/customer-portal/contacts.png",width:36}),e.jsx("small",{className:"mt-2",children:"No contacts found"})]})})})})}),e.jsx(Dr,{...this.props,ref:t=>this._saveContactModal=t})]})}}const Fr=({inputValue:a,onInputChange:r,searchText:t,loading:s,onClearSearch:n,futureEvents:d,showOnlyMyRegistrations:o,onFutureEventsChange:l,onMyEventsChange:c})=>e.jsxs(C,{className:"align-items-center mx-0 mb-3 px-0 gap-2 row-gap-2 justify-content-start",children:[e.jsx(v,{sm:12,md:4,lg:3,className:"mx-0 px-0",children:e.jsxs("span",{className:"d-flex align-items-center mr-2",children:[e.jsx(ua,{"data-testid":"input-eventsFilterBar-search",value:a,placeholder:"Search event name...",className:"w-100",forcePlaceholder:!0,disabled:s,ariaLabel:"Search events",onChange:r}),t.length>0&&e.jsx(j,{icon:pa,className:"ml-2 mr-3 cursor-pointer",color:"darkgray",onClick:n})]})}),e.jsx(Ce,{"data-testid":"switch-eventsFilterBar-1",label:"Upcoming & Current Only",left:!0,value:d,className:"mb-0 mx-2",disabled:s,onChange:l}),e.jsx(Ce,{"data-testid":"switch-eventsFilterBar-2",label:"My Events Only",left:!0,value:o,className:"mb-0 mx-2",disabled:s,onChange:c})]}),_r=({event:a,isActive:r,onToggle:t})=>{const{eventId:s,eventName:n,eventStartDate:d,eventEndDate:o,registrations:l=[]}=a,c=l.flatMap(P=>P.attendees),b=He(d),g=o?He(o):"",N=g&&b!==g?`${b} - ${g}`:b,S=new Date,E=new Date(d)>S,T=new Date(d)<=S&&S<=new Date(o),k=new Date(o)<S;return e.jsx(le,{activeKey:r?s:null,className:"mb-1 p-0",style:{display:"contents"},onSelect:()=>t(s),children:e.jsxs(G,{className:"mb-2 w-100",children:[e.jsxs(le.Toggle,{as:Y,variant:"none",eventKe
10y:s,className:"text-left text-bold",children:[E&&e.jsx("small",{className:"text-primary",children:"Upcoming"}),T&&e.jsx("small",{className:"text-success",children:"Now"}),e.jsxs(C,{className:"d-flex w-100 align-items-center justify-content-between",children:[e.jsxs("span",{className:"d-flex flex-column pl-2 flex-nowrap",children:[e.jsx("strong",{className:k?"text-secondary":"",children:n}),e.jsx("small",{className:"text-secondary",children:N})]}),c.length>0&&e.jsxs("span",{children:[e.jsx("small",{children:r?"Close":"Show attendees"}),e.jsx(j,{icon:r?es:ts,className:"ml-2"})]})]})]}),e.jsx(le.Collapse,{eventKey:s,children:e.jsx(G.Body,{className:"p-3 rounded-sm bg-whitesmoke shadow-sm",children:e.jsx("ul",{style:{listStyleType:"number"},className:xe("px-2 mb-0",c.length<10?"pl-2":"pl-3"),children:c.map((P,M)=>e.jsx("li",{children:e.jsx("strong",{children:P!=null&&P.firstName?`${P.firstName} ${P.lastName}`:"TBD"})},M))})})})]})})},Lr=()=>{const[a,r]=F.useState({loading:!1,events:[],showOnlyMyRegistrations:!1,futureEvents:!1,searchText:"",activeKey:null,rowCount:50,showMoreRecords:!1}),[t,s]=F.useState("");F.useEffect(()=>{const{accountId:o,customerId:l,currentCompanyInfo:c}=h();if(!o)return;r(g=>({...g,loading:!0}));const b={customerId:l,companyId:(c==null?void 0:c.companyId)??null,accountId:o,futureEvents:a.futureEvents,searchText:a.searchText,showOnlyMyRegistrations:a.showOnlyMyRegistrations,rowCount:a.rowCount};K.get("/events/event/GetPortalEventsWithAttendees",b,{success:g=>{r(N=>({...N,loading:!1,events:g.data.items,showMoreRecords:g.data.items.length>=N.rowCount}))},error:g=>{r(N=>({...N,loading:!1,events:[]})),R(g.error.errorMessage)}},{block:!1})},[a.futureEvents,a.rowCount,a.searchText,a.showOnlyMyRegistrations]),F.useEffect(()=>{const o=setTimeout(()=>{r(l=>({...l,searchText:t}))},600);return()=>clearTimeout(o)},[t]);const n=()=>{r(o=>({...o,rowCount:o.rowCount+50}))},d=o=>{r(l=>({...l,activeKey:l.activeKey===o?null:o}))};return e.jsxs(e.Fragment,{children:[e.jsx(Fr,{inputValue:t,onInputChange:o=>s(o),searchText:a.searchText,loading:a.loading,onClearSearch:()=>s(""),futureEvents:a.futureEvents,showOnlyMyRegistrations:a.showOnlyMyRegistrations,onFutureEventsChange:o=>r(l=>({...l,futureEvents:o})),onMyEventsChange:o=>r(l=>({...l,showOnlyMyRegistrations:o}))}),!a.loading&&a.events.length>0&&h().accountTimeZoneName&&e.jsxs("small",{className:"text-muted font-italic d-block mb-2",children:["All times displayed in"," ",h().accountTimeZoneName]}),e.jsx(C,{className:"flex-column mx-0 px-0",children:a.loading?e.jsx(G,{className:"p-4",children:e.jsx(J,{})}):a.events.length>0?a.events.map(o=>e.jsx(_r,{event:o,isActive:a.activeKey===o.eventId,onToggle:d},o.eventId)):e.jsxs(G,{className:"d-flex flex-column align-items-center w-100 mt-2 p-5",children:[e.jsx("img",{src:"/images/customer-portal/calendar_2.png",width:48}),e.jsx("small",{className:"mt-2",children:"No events found"})]})}),a.showMoreRecords&&e.jsx(C,{children:e.jsx(v,{md:12,children:e.jsxs(Y,{"data-testid":"btn-EventsList",id:"btnViewMoreResults",className:"float-right mt-2",onClick:n,variant:"default",children:[e.jsx(j,{icon:ga,className:"mr-2"}),"Show more results"]})})})]})},Or=()=>e.jsxs(ne,{className:"mt-3",children:[e.jsxs("div",{className:"d-flex align-items-center body-icon mb-3",children:[e.jsx(j,{icon:xa,className:"mr-2",color:"#3c8dbc"}),e.jsx("strong",{children:"Events Attendance"})]}),e.jsx(Lr,{})]});class Br extends I.Component{constructor(r){super(r),this._isMounted=!1}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}render(){return this.props.eventsEnabled?e.jsx("div",{className:"tenantWebsite",children:e.jsx("div",{className:"tenantWebsite-content-body card pt-0 px-3",children:e.jsx(fa,{...this.props,containerClassName:"mt-0",eventsEnabled:this.props.eventsEnabled,headerText:"Events",timeFormatCode:this.props.timeFormatCode,pages:this.props.websiteData.sitePages.pages,eventDetailsUrl:"/memberPortal/events/event-detail",eventRegistrationUrl:"/memberPortal/event-registration",isPortal:!0})})}):null}}class qr extends I.Component{render(){return e.jsx(ne,{className:"mt-3","data-testid":"portalEvents",children:e.jsx(Br,{...this.props,accountId:h().accountId})})}}class Xe extends I.Component{constructor(t){super(t);i(this,"handleAddExtraWebsiteContents",t=>{this.setState({extraWebsiteContents:t})});this._isMounted=!1,this.state={extraWebsiteContents:[]}}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}render(){var t;return this.props.eventsEnabled?e.jsx(ne,{children:e.jsx("div",{className:"tenantWebsite mt-2 ",children:e.jsxs("div",{className:"tenantWebsite-content-body pt-0 card",children:[e.jsx(ya,{...this.props,pages:this.props.websiteData.sitePages.pages,timeFormatCode:this.props.timeFormatCode,eventRegistrationUrl:"/memberPortal/event-registration",isPortal:!0,onAddExtraWebsiteContents:this.handleAddExtraWebsiteContents}),((t=this.state.extraWebsiteContents)==null?void 0:t.length)>0&&e.jsx(je,{contents:this.state.extraWebsiteContents,skipWebsiteTitle:!0})]})})}):null}}const $r=({row:a})=>{switch(a.approvalRequestActionTypeCode){case qn:return e.jsx(ve,{variant:"primary",children:"Create"});case Bn:return e.jsx(ve,{variant:"info",children:"Update"});default:return null}};class Ur extends I.Component{constructor(t){super(t);i(this,"initialState",()=>({visible:!1,loading:!1,pendingEvents:[]}));i(this,"open",()=>{this.setState({visible:!0,loading:!0},()=>{K.get("/approvalRequest/getCustomerApprovalRequests",{approvalRequestTypeCode:ss},{success:t=>{this.setState({loading:!1,pendingEvents:t.data.approvalRequests})},error:t=>{R(t.error.errorMessage),this.setState({loading:!1})}},{redirectToLogin:!1})})});i(this,"close",()=>{this.setState(this.initialState())});i(this,"handleCancel",()=>{this.close()});i(this,"handleSave",()=>{this.close(),this.state.onSave&&this.state.onSave()});i(this,"handleEventLinkClick",t=>{this._approvalRequestInfoModal.open({approvalRequestId:t.approvalRequestId,approvalRequestListInfo:t})});i(this,"EventLinkFormatter",({row:t})=>e.jsx(ba,{entity:t,label:t.eventName,onLinkClick:this.handleEventLinkClick,useHover:!0}));i(this,"renderContent",()=>
10{const t=[{key:"eventName",name:"Event Name",cellClass:"text-center",formatter:this.EventLinkFormatter},{key:"createDate",name:"Create Date",cellClass:"text-center",width:200,formatter:va.ClientDateTime},{key:"approvalRequestTypeCode",name:"Operation",cellClass:"text-center",width:200,formatter:$r}];return e.jsxs(e.Fragment,{children:[e.jsx(C,{children:e.jsx(v,{children:e.jsx(as,{variant:"info",className:"text-center",children:"These Events are under review prior to being published."})})}),e.jsx(C,{children:e.jsx(v,{children:e.jsx(ot,{columns:t,rowKey:"approvalRequestId",items:this.state.pendingEvents,height:400})})}),e.jsx(On,{ref:s=>this._approvalRequestInfoModal=s,isPortal:!0})]})});this.state=this.initialState()}render(){return this.state.visible?e.jsxs(ns,{show:this.state.visible,onHide:this.handleCancel,dialogClassName:"modal-lg",backdrop:"static",enterDisabled:!0,"data-testid":"modal-pendingEvents",children:[e.jsx(O.Header,{closeButton:!0,children:e.jsx(O.Title,{children:"Pending Events"})}),e.jsx(O.Body,{children:this.state.loading?e.jsx(J,{}):this.renderContent()})]}):null}}class zr extends I.Component{constructor(t){super(t);i(this,"checkHasPendingEvents",()=>{if(h().previewSession)return;const t={approvalRequestTypeCode:ss};K.get("/approvalRequest/hasPendingApprovalRequests",t,{success:s=>{this.setState({hasPendingEvents:s.data.hasPendingApprovalRequests})},error:s=>{R(s.error.errorMessage)}})});i(this,"handleViewPendingEvents",()=>{this._pendingEventsModal.open()});this.state={hasPendingEvents:!1}}componentDidMount(){this.checkHasPendingEvents()}render(){if(!h().memberHostedEventsEnabled)return null;const t=!!h().currentCompanyInfo;return e.jsxs(ne,{className:"mt-3",children:[t?e.jsx(C,{children:e.jsx(v,{children:e.jsx("div",{children:e.jsx(ja,{containerClassName:"h-100",activityConfigCode:Ca.EVENTS,...!h().readOnlySession&&!h().previewSession&&{forceAddEventAllowed:Te("ModifyMemberLevelEvents"),forceEditEventAllowed:Te("ModifyMemberLevelEvents")},dashboardMode:!0,rowsMode:!0,history:this.props.history,isPortal:!0,disableAssociationLinks:!0,hasPendingEvents:this.state.hasPendingEvents,maxHeight:600,onSearch:this.checkHasPendingEvents,onViewPendingEvents:this.handleViewPendingEvents})})})}):e.jsx(vt,{}),e.jsx(Ur,{ref:s=>this._pendingEventsModal=s})]})}}class Hr extends I.Component{render(){return e.jsx(ne,{className:"card mt-3",children:e.jsx("div",{className:"tenantWebsite",children:e.jsx("div",{className:"tenantWebsite-content-body pt-0 mb-3",children:e.jsx(Sa,{membershipEnabled:!0,isPortal:!0,hasDirectorySorting:this.props.hasDirectorySorting})})})})}}class Vr extends I.Component{constructor(t){super(t);i(this,"navigateToCreateEditPage",()=>{this.props.history.push(`${this.props.match.url}/edit`)});i(this,"renderContent",()=>h().currentCompanyInfo?e.jsxs(e.Fragment,{children:[this.state.portalAccountboardInfo.allowMemberContribution&&e.jsx(C,{className:"mt-3",children:e.jsx(v,{className:"d-flex justify-content-end",children:e.jsx(be,{variant:"success","data-testid":"btn-portalPosts-createEdit",disabled:h().readOnlySession,onClick:this.navigateToCreateEditPage,children:"Create/Edit Posts"})})}),e.jsx(C,{children:e.jsx(v,{children:e.jsx("div",{className:"tenantWebsite",children:e.jsx("div",{className:"tenantWebsite-content-body pt-0",children:e.jsx(wa,{boardId:this.props.match.params.boardId,isPortal:!0})})})})})]}):e.jsx(vt,{}));this.state={loading:!0,portalAccountboardInfo:{allowMemberContribution:!1}}}componentDidMount(){const{websiteDomain:t,websiteShorthand:s}=ye(),n={websiteShorthand:s,websiteDomain:t};rs.get("/getAccountPortalSettings",n,{success:d=>{const o=d.data.boards.find(l=>l.boardId.toString()===this.props.match.params.boardId);this.setState({loading:!1,portalAccountboardInfo:{allowMemberContribution:o.allowMemberContribution}})}})}render(){return e.jsx(ne,{className:"card mt-3",children:this.state.loading?e.jsx(J,{}):this.renderContent()})}}let Wr=class extends I.Component{constructor(r){super(r),this.state={visible:!1,boardId:this.props.setupProps.match.params.boardId,items:[]}}componentDidMount(){K.get("/contents/board/getBoardsInfo",null,{success:r=>{this.setState({visible:!0,items:r.data.boards.filter(t=>t.allowMemberContribution).map(t=>({label:t.name,value:t.boardId,active:t.active}))})}},{block:!1})}
10render(){if(!this.state.visible)return null;const r=h().menuItems.find(s=>s.menuCode==="UserBoards").text,t={searchLabel:"Search Posts",searchCol:4,form:this.state.boardId!==null?{boardId:this.state.boardId}:{},formats:[],noSearchBox:!0,filters:[{name:"boardId",label:r,comp:Qe,props:{value:this.state.boardId,items:this.state.items,clearable:!1,searchable:!0},topFilter:!0,searchOnChange:!0,disableSearch:!0,formatter:()=>{}}],onControlChange:(s,n)=>{s.name==="boardId"&&this.props.setupProps.onSelectedBoardFilterChange(n.value)}};return e.jsx(is,{...this.props,...t})}};class Kr extends I.Component{constructor(t){super(t);i(this,"ResolvedStatusFormatter",({value:t})=>t===Pa?e.jsx(ve,{variant:"success",children:"Approved"}):t===Dt?e.jsx(ve,{variant:"info",children:"Pending"}):null);i(this,"handleCreatePost",(t,s,n)=>{this._postModal.open({postId:null,boardId:this.props.match.params.boardId,onClose:d=>{d&&n()}})});i(this,"handleSelect",(t,s,n)=>{if(s.resolvedStatusCode===Dt){R("This is a pending post and it cannot be edited.");return}this._postModal.open({postId:t,onClose:d=>{d&&n()}})});i(this,"handleSelectedBoardChange",t=>{this.props.history.replace(this.props.match.path.replace(":boardId",t))});h().readOnlySession&&this.props.history.replace(de)}render(){const t=h().menuItems.find(o=>o.menuCode==="UserBoards").text,s=h().portalSettings.boards;s.find(o=>o.boardId.toString()===this.props.match.params.boardId).allowMemberContribution||this.props.history.push("/memberPortal");let d={title:`Posts & ${t}`,breadcrumHeader:!0,setQueryString:o=>{var c;const l=(c=o.prevSearchData)==null?void 0:c.filters;return l.boardId===null||l.boardId===void 0?null:`?boardId=${l.boardId}`},addPrivilege:!0,editPrivilege:!0,addNewTitle:"Create Post",enableExport:!1,onAdd:this.handleCreatePost,onSelect:this.handleSelect,onSelectedBoardFilterChange:this.handleSelectedBoardChange,triggerInitialSearch:!0,list:{url:K.url("/contents/post/searchPortalPosts"),rowKey:"postId",columns:[{key:"startDate",name:"Publish Date",width:150,formatter:ze,sortable:!0,cellClass:"text-center"},{key:"resolvedStatusCode",name:"Resolved Status",sortable:!0,formatter:this.ResolvedStatusFormatter,width:150,cellClass:"text-center"},{key:"active",name:"Publish Status",sortable:!0,formatter:Na,width:150,cellClass:"text-center"},{key:"title",name:"Title",sortable:!0},{key:"endDate",name:"Expiration Date",width:150,formatter:ze,sortable:!0,cellClass:"text-center"}]}};return d=Object.assign(d,this.props),e.jsxs(Ge,{children:[e.jsx(Zt,{...d,Search:Wr}),e.jsx($n,{isPortal:!0,boardIds:s.filter(o=>o.allowMemberContribution).map(o=>o.boardId),ref:o=>{this._postModal=o}})]})}}class Gr extends I.Component{render(){return h().portalSettings.enableVIPContactDirectory?e.jsx(ne,{className:"mt-3",children:e.jsx(Ea,{isPortal:!0,includeSearch:h().portalSettings.vipContactDirectoryIncludeSearch,displayType:h().portalSettings.vipContactDirectoryDisplayType,headerText:h().portalSettings.vipContactDirectoryName})}):null}}class $t extends I.Component{constructor(t){super(t);i(this,"loadPage",t=>{if(!t){this.setState({loading:!1,page:null});return}this.setState({loading:!0},()=>{K.get("/portalResources/getPortalResourcePage",{portalResourcePageId:t},{success:s=>{this.setState({loading:!1,page:s.data})},error:()=>{this.setState({loading:!1,page:null})}})})});i(this,"renderBlocks",t=>t.filter(s=>s.active!==!1).map((s,n)=>{const d=os[s.version];return d?e.jsx(d,{...s,isPortal:!0},s.guid||n):null}));this.state={loading:!0,page:null}}componentDidMount(){var t,s;this.loadPage((s=(t=this.props.match)==null?void 0:t.params)==null?void 0:s.pageId)}componentDidUpdate(t){var d,o,l,c;const s=(o=(d=this.props.match)==null?void 0:d.params)==null?void 0:o.pageId,n=(c=(l=t.match)==null?void 0:l.params)==null?void 0:c.pageId;s!==n&&this.loadPage(s)}render(){const{loading:t,page:s}=this.state;if(t)return e.jsx(J,{});if(!s)return e.jsx(ne,{className:"mt-4",children:e.jsx("p",{className:"text-muted",children:"No content available."})});let n=[];if(s.contentJson)try{const d=JSON.parse(s.contentJson);Array.isArray(d)&&(n=d)}catch{n=[]}return n.length>0?e.jsx(ne,{fluid:!0,className:"mt-4 px-0",children:e.jsx("div",{className:"portal-resource-content",children:this.renderBlocks(n)})}):e.jsx(ne,{className:"mt-4",children:e.jsx("div",{className:"portal-resource-content",dangerouslySetInnerHTML:{__html:ka.sanitize(s.contentHtml??"")}})})}}const Ut=[{label:"Available",code:"OPEN",activeVariant:"success"},{label:"Redeemed",code:"REDEEMED",activeVariant:"primary"},{label:"Expired",code:"EXPIRED",activeVariant:"secondary"}],Yr={OPEN:"success",REDEEMED:"primary",EXPIRED:"secondary"},Qr={OPEN:"Available",REDEEMED:"Redeemed",EXPIRED:"Expired"};class Xr extends I.Component{constructor(t){super(t);i(this,"loadPerks",()=>{const{currentCompanyInfo:t}=h();t&&this.setState({loading:!0},()=>{K.post("/perk/searchPortalPerks",{},{success:s=>{this.setState({allItems:s.data.items||[],loading:!1})},error:s=>{R(s.error.errorMessage),this.setState({allItems:[],loading:!1})}},{block:!1})})});i(this,"setFilter",t=>{this.setState({activeFilter:t})});this.state={allItems:[],loading:!1,activeFilter:"OPEN"}}componentDidMount(){this.loadPerks()}render(){var l;const{allItems:t,loading:s,activeFilter:n}
10=this.state,d=t.filter(c=>c.perkStatusCode===n),o=Ut.find(c=>c.code===n);return e.jsxs(e.Fragment,{children:[e.jsx(ne,{children:e.jsx(Ta,{title:"My Perks",icon:{comp:Ve,color:"#3c8dbc"}})}),e.jsx(Ge,{children:e.jsx(ne,{className:"mt-3 mb-3",children:e.jsxs(G,{className:"px-4 pt-3 pb-3",children:[e.jsxs("div",{className:"d-flex justify-content-between align-items-center mb-3",children:[e.jsx(Ia,{children:Ut.map(c=>e.jsx(Y,{size:"sm",variant:n===c.code?c.activeVariant:"outline-secondary",onClick:()=>this.setFilter(c.code),"data-testid":`filter-${c.code}`,children:c.label},c.code))}),e.jsxs(Ne,{to:"/memberPortal",className:"text-muted",style:{fontSize:12,whiteSpace:"nowrap"},children:[e.jsx(j,{icon:Wt,className:"mr-1"}),"Back to Dashboard"]})]}),s&&e.jsx(J,{}),!s&&d.length===0&&e.jsxs("div",{className:"text-center py-5",style:{color:"#bbb"},children:[e.jsx(j,{icon:Ve,style:{fontSize:28,display:"block",margin:"0 auto 10px"}}),e.jsx("small",{children:`No ${((l=o==null?void 0:o.label)==null?void 0:l.toLowerCase())||""} perks found`})]}),!s&&d.length>0&&e.jsxs(Aa,{hover:!0,responsive:!0,size:"sm",className:"mb-0",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Perk Name"}),e.jsx("th",{children:"Description"}),e.jsx("th",{className:"text-center",children:"Qty"}),e.jsx("th",{className:"text-center",children:"Expiration Date"}),e.jsx("th",{className:"text-center",children:"Status"})]})}),e.jsx("tbody",{children:d.map(c=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("strong",{children:c.perkName})}),e.jsx("td",{children:c.description?e.jsx("span",{className:"text-muted",style:{fontSize:12},children:c.description}):"â"}),e.jsx("td",{className:"text-center",children:c.qty}),e.jsx("td",{className:"text-center",children:c.expirationDate?Yt(c.expirationDate):"â"}),e.jsx("td",{className:"text-center",children:e.jsx(ve,{variant:Yr[c.perkStatusCode]||"light",children:Qr[c.perkStatusCode]||c.perkStatusCode})})]},`${c.perkName}-${c.expirationDate||"none"}`))})]})]})})})]})}}class Cs extends I.Component{render(){return e.jsxs("div",{style:{textAlign:"center"},className:"not-found","data-testid":"notFoundError",children:[e.jsx("h1",{style:{fontSize:"80px",marginTop:0,paddingTop:"20px"},children:"404"}),e.jsx("h3",{children:"PAGE NOT FOUND"}),e.jsx("p",{children:"The page you are looking for might have been removed, had its name changed or is temporarily unavailable"}),e.jsx("p",{children:"Try going back to the main page"}),e.jsx(Ne,{to:"/",children:e.jsx(Y,{variant:"primary","data-testid":"btn-notFound-goBack",children:"Go back"})})]})}}const Jr=a=>{var d,o,l;const r=F.useRef(0),t=c=>{if(c.start!==""&&c.start!==null&&c.end!==""&&c.end!==null)return`${c.start} - ${c.end}`;if((c.start===""||c.start===null)&&c.end!==""&&c.end!==null)return`Up to ${c.end}`;if(c.start!==""&&c.start!==null&&(c.end===""||c.end===null))return`Starting ${c.start}`},s={searchTooltipCode:null,searchLabel:`Search Sales ${((d=h().nomenclatures)==null?void 0:d.invoices.pluralTerm)||"Invoices"}`,searchCol:4,form:{},formats:[{name:"salesItemTypeCodes",label:`All ${((o=h().nomenclatures)==null?void 0:o.invoices.pluralTerm)||"Invoices"}`}],filters:[{name:"salesItemTypeCodes",label:`Filter by ${((l=h().nomenclatures)==null?void 0:l.invoices.singularTerm)||"Invoice"} Item`,comp:Ma,props:{clearable:!1,multi:!0},formatter:c=>{var b;return`${((b=h().nomenclatures)==null?void 0:b.invoices.singularTerm)||"Invoice"} Items: ${c.map(g=>g.label).join(", ")}`}},{name:"orderDate",comp:Da,formatter:t},{name:"paymentStatusCode",label:"Filter by Payment Status",comp:Ra,props:{clearable:!1},formatter:c=>`Payment Status: ${c.label}`}],onSearch:a.onSearch},n=window.location.search;return n!==""&&new URLSearchParams(n).get("unpaid")==="true"&&(s.form.paymentStatusCode=Fa.UNPAID,s.formats.push({name:"paymentStatusCode",label:"Payment Status: Unpaid"}),r.current++,a.history.replace(window.location.pathname)),e.jsx(is,{searchTooltipCode:!0,...s},r.current)},Zr=a=>{const r={Paid:{bg:"#DFF5E1",color:"#276749"},Unpaid:{bg:"#FEE2E2",color:"#B91C1C"},Voided:{bg:"#FEF3C7",color:"#92400E"},PartiallyPaid:{bg:"#EDE9FE",color:"#6B21A8"}},t={bg:"#E5E7EB",color:"#374151"},{bg:s,color:n}=r[a]||t;return e.jsx("span",{className:"px-2 py-1 rounded-lg text-center text-bold",style:{backgroundColor:s,color:n,fontSize:"12px"},children:a})}
10,zt=(a,r,t)=>{let s="";return r!==null&&t==="Voided"&&(s="strike-through"),e.jsx("p",{className:s,children:st(a)})},ei=a=>{var r;return a.salesItemType==="Event Registration"&&((r=a.customerName)==null?void 0:r.length)>0?e.jsxs("span",{children:[a.salesItemType,e.jsx(we,{overlay:e.jsx(Se,{children:a.customerName}),children:e.jsx(j,{icon:Me,className:"ml-2",color:"#0056B3"})})]}):a.salesItemType},ti=a=>{ps("/reports/salesOrder",{orderKeys:[a.orderKey]})},si=()=>{var a;return[{key:"orderDate",name:"Date",width:200,sortable:!0,formatter:ze,cellClass:"text-center"},{key:"orderNumber",name:`${((a=h().nomenclatures)==null?void 0:a.invoices.singularTerm)||"Invoice"} #`,sortable:!0,cellClass:"text-center",formatter:({row:r})=>e.jsx("div",{style:{textDecoration:r.paymentStatus==="Voided"?"line-through":"none",color:"#0056B3"},className:"cursor-pointer",title:"Open PDF version",onClick:()=>ti(r),children:r.orderNumber})},{key:"salesItemType",name:"Item Type",sortable:!0,formatter:({row:r})=>ei(r),cellClass:"text-center"},{key:"totalAmt",name:"$ Total",width:150,sortable:!0,formatter:({row:r})=>zt(r.totalAmt,r.voidDate,r.paymentStatus),cellClass:"text-right"},{key:"dueAmt",name:"Amount Due",width:150,sortable:!0,formatter:({row:r})=>zt(r.dueAmt,r.voidDate,r.paymentStatus),cellClass:"text-right",resizable:!0},{key:"paymentStatus",name:"Status",cellClass:"text-center",formatter:({row:r})=>Zr(r.paymentStatus),sortable:!0},...Un(zn.INVOICE)?[{key:"qboInvoiceNumber",name:"QBO Invoice Number",sortable:!0,width:250,cellClass:"text-right"}]:[]]},ai=()=>{var S;const a=F.useRef(si()),[r,t]=F.useState([]),[s,n]=F.useState({}),[d,o]=F.useState(!1),[l,c]=F.useState({sortField:"orderDate",sortDirection:"DESC"}),b=F.useCallback(()=>{var re;const{searchText:E,orderDate:T,locationId:k,paymentStatusCode:P,recordsOrdersOnly:M,qboStatus:_,invoicingCustomerTypeCode:V,accountId:H}=s??{},ae={orderTypeCode:"SAS",customer:{companyId:((re=h().currentCompanyInfo)==null?void 0:re.companyId)??null,customerId:h().customerId},searchText:E,orderDate:T,locationId:k,paymentStatusCode:P,recordsOrdersOnly:M,qboStatus:_,invoicingCustomerTypeCode:V,accountId:H,salesItemTypeCodes:((s==null?void 0:s.salesItemTypeCodes)??[]).map(ee=>ee.value),...l};o(!0),K.post("/salesOrders/SalesOrder/searchPortalOrders",ae,{success:ee=>{t(ee.data.items),o(!1)},error:ee=>{R(ee.error.errorMessage),o(!1)}},{block:!1})},[s,l]);F.useEffect(()=>{b()},[b]);const g=E=>{n(E??s)},N=(E,T)=>{c({sortField:E,sortDirection:T})};return e.jsxs(ne,{className:"mt-3",children:[e.jsxs("div",{className:"d-flex align-items-center body-icon mb-2",children:[e.jsx(j,{icon:_a,className:"mr-2",color:"#3c8dbc"}),e.jsxs("strong",{children:[(S=h().nomenclatures)==null?void 0:S.invoices.pluralTerm," ","History"]})]}),e.jsx(Jr,{onSearch:g}),d?e.jsx(G,{className:"d-flex flex-column align-items-center w-100 mt-4 py-5",children:e.jsx(J,{})}):r.length>0?e.jsx(ot,{"data-testid":"grid-invoiceHistory",className:"mt-3",name:"orders",rowKey:"orderId",items:r,columns:a.current,onSort:N}):e.jsxs(G,{"data-testid":"emptyState-invoiceHistory",className:"d-flex flex-column align-items-center w-100 mt-4 py-5",children:[e.jsx("img",{src:"/images/customer-portal/papers.png",width:48}),e.jsx("small",{className:"mt-2",children:"No invoices found"})]})]})},se=({component:a,business:r,...t})=>e.jsx($,{...t,render:s=>{if(nt()!==!0){ke();const n=ls(s.location.pathname,window.location.search);return e.jsx(Re,{to:`/memberPortal/public/login${n}`})}return r&&h().accountId===null?e.jsx(Re,{to:"/memberPortal"}):e.jsx(a,{...t,...s},s.location.key)}});class ni extends I.Component{constructor(t){super(t);i(this,"findInMenu",(t,s)=>t.reduce((n,d)=>n||(d.menuCode===s?d:d.childs?this.findInMenu(d.childs,s):null),null));this.state={availablePaths:{products:!1,services:!1,memberships:!1,sales:!1,orders:!1,assets:!1,records:!1,assetCategories:!1,recordTypes:!1}}}static getDerivedStateFromProps(t,s){return s==null||t.accountId!==s.accountId?{accountId:t.accountId}:null}render(){return La(),e.jsxs(pt,{children:[e.jsx(se,{exact:!0,path:"/memberPortal",component:pr,...this.props}),e.jsx(se,{path:"/memberPortal/accounts/profile",component:fr}),e.jsx(se,{path:"/memberPortal/contacts",component:Rr,...this.props}
10),e.jsx(se,{path:"/memberPortal/eventsAttendance",component:Or,...this.props}),e.jsx(se,{path:"/memberPortal/invoices",component:ai,...this.props}),e.jsx(se,{exact:!0,path:"/memberPortal/events",component:qr,...this.props}),e.jsx(se,{exact:!0,path:"/memberPortal/ourEvents",component:zr,...this.props}),e.jsx(se,{path:"/memberPortal/events/event-detail",component:Xe,...this.props}),e.jsx(se,{path:"/memberPortal/events/event-detail/:token/:slug",component:Xe,...this.props}),e.jsx(se,{path:"/memberPortal/events/event-detail/:token",component:Xe,...this.props}),e.jsx(se,{exact:!0,path:"/memberPortal/posts/:boardId",component:Vr,...this.props}),e.jsx(se,{path:"/memberPortal/posts/:boardId/edit",component:Kr,...this.props}),e.jsx(se,{path:"/memberPortal/contactDirectory",component:Gr,...this.props}),e.jsx(se,{exact:!0,path:"/memberPortal/perks",component:Xr,...this.props}),h().portalSettings.enableMembershipDirectory&&e.jsx(se,{path:"/memberPortal/membershipDirectory",component:Hr,...this.props}),h().portalSettings.enablePortalResources&&e.jsxs(e.Fragment,{children:[e.jsx(se,{exact:!0,path:"/memberPortal/resources",component:$t,...this.props}),e.jsx(se,{path:"/memberPortal/resources/:pageId",component:$t,...this.props})]}),e.jsx(se,{path:"*",component:Cs})]})}}const ri=a=>({accountId:a.Account.accountId}),ii=gt(ri)(ni),oi="UserMembershipDirectory",li="UserResources",Ss=({item:a,exclude:r,collapsed:t,selected:s,darkMode:n})=>{const[d,o]=F.useState(!1),[l,c]=F.useState(!1);if(a.menuCode===r||a.menuCode==="UserQuickbooks"&&!h().qboIntegration)return null;const b=()=>{const k=a.text.toLowerCase();return k.length>20?`${k.substring(0,20)}...`:k},g=()=>{t&&o(!0)},N=()=>{t&&o(!1)},S=k=>{k.preventDefault(),!(t||a.childs.length<=0)&&c(!l)},E=()=>e.jsxs("ul",{className:"nav nav-treeview",children:[t&&e.jsx("a",{className:"nav-link",children:e.jsx("li",{className:"nav-item",children:e.jsx(D,{className:"float-left text-uppercase",children:a.text})})}),t&&a.childs.length>0&&e.jsx(qa.Divider,{}),a.childs.map(k=>e.jsx(Ss,{item:k,exclude:r,collapsed:t,selected:s,darkMode:n},k.menuCode))]});l&&(t||a.childs.length<=0)&&c(!1);const T=n?"white":void 0;return a.childs.length>0?e.jsxs("li",{className:xe("nav-item","position-relative",{"menu-is-opening":d||l,"menu-open":d||l}),onMouseEnter:g,onMouseLeave:N,children:[e.jsx(Oa,{to:a.childs.length>0?"#":a.path,children:e.jsxs("a",{className:xe("nav-link",{"force-open":l,active:s}),onClick:S,children:[a.iconName&&e.jsx(j,{className:"nav-icon",icon:a.iconName,color:T}),e.jsxs("p",{className:"text-capitalize",children:[b(),a.childs.length>0&&e.jsx(j,{className:"right",icon:d||l?"angle-down":"angle-right",color:T})]})]})}),E()]},a.menuCode):a.separator?e.jsx("hr",{className:"m-0"}):e.jsxs("li",{className:xe("nav-item","position-relative",{"menu-is-opening":!a.parentMenuCode&&(d||l),"menu-open":!a.parentMenuCode&&(d||l)}),onMouseEnter:g,onMouseLeave:N,children:[a.blankTarget?e.jsx("a",{href:a.path,target:"_blank",rel:"noopener noreferrer",className:"nav-link",children:e.jsx("p",{children:a.text})}):e.jsx(Ba,{to:a.path,children:e.jsxs("a",{className:"nav-link",children:[a.iconName&&!a.parentMenuCode&&e.jsx(j,{className:"nav-icon",icon:a.iconName,color:T}),e.jsx("p",{children:a.text})]})}),E()]})},di=({exclude:a,collapsed:r,currentPath:t,menuItems:s,darkMode:n})=>{const d=s.filter(c=>c.isSidebarMenu&&(c.menuCode!==oi||h().portalSettings.enableMembershipDirectory)&&(c.menuCode!==li||h().portalSettings.enablePortalResources)&&(!c.menuCode.startsWith("UserResourcesSubMenus_")||h().portalSettings.enablePortalResources)),o=c=>!!(c.path===t||c.childs.some(b=>o(b))),l=d.map(c=>e.jsx(Ss,{item:c,exclude:a,collapsed:r,selected:o(c),darkMode:n},c.menuCode));return e.jsx("nav",{className:"mt-2",children:e.jsx("ul",{className:"nav nav-pills nav-sidebar flex-column","data-widget":"treeview",role:"menu","data-accordion":"false",children:l})})},ci=a=>({menuItems:a.MenuItems.menuItems}),mi=gt(ci)(di);class hi extends I.Component{constructor(){super(...arguments);i(this,"setWrapperRef",t=>{this.wrapperRef=t})}componentDidMount(){}render(){const t=h().menuItems;return e.jsx("aside",{className:"main-sidebar portal sidebar-dark-primary sidebar-no-expand",ref:this.setWrapperRef,children:e.jsx("div",{className:"sidebar-no-expand",children:e.jsx(mi,{collapsed:this.props.collapsed,currentPath:this.props.currentPath,items:t})})})}}const ui=Oe(hi),pi=()=>e.jsx("footer",{className:"main-footer",children:e.jsx("footer",{children:e.jsx("div",{id:"Footer",children:e.jsx("div",{className:"text-center",children:e.jsx("small",{children:`© ${new Date().getUTCFullYear()} - ${h().accountName}`})})})})});class ws extends I.PureComponent{constructor(t){super(t);i(this,"completed",()=>this._ctrl.completed());i(this,"flag",()=>this._ctrl.flag());this.state={items:[]},this._isMounted=!1}componentDidMount(){this._isMounted=!0,K.get("/customers/customer/getUserCompanies",{},{success:t=>{this._isMounted&&this.setState({items:t.data.companies.map(s=>({...s,value:s.companyId,label:s.companyName}))})}},{block:!1})}componentWillUnmount(){this._isMounted=!1}render(){return e.jsx(Qe,{...this.props,"data-testid":this.props["data-testid"],items:this.state.items,searchable:!0,ref:t=>{this._ctrl=t}})}}ws.defaultProps={formControl:!0,managed:!1};const gi=a=>a.includes("/forms");class xi extends I.Component{constructor(t){super(t);i(this,"_initialState",()=>({visible:!1,form:{}}));i(this,"open",()=>{const{currentCompanyInfo:t}=h();this.setState({visible:!0,form:{companyId:t.companyId,companyName:t.companyName}})});i(this,"close",()=>{this.setState(this._initialState())});i(this,"_handleCancel",()=>{this.close()});i(this,"_handleChange",t=>{this.setState({form:t})});i(this,"_handleConfirm",()=>{const t=this.state.form;let s=null;gi(this.props.history.location.pathname)&&(s=this.props.history.location.pathname),$a(t.companyId,this.props.history,s),this.close()});this.state=this._initialState()}render(){var t,s;return this.state.visible?e.jsxs(ns,{show:this.state.visible,size:"md",onEnterKey:this._handleConfirm,onHide:this._handleCancel,"data-testid":"modal-companySelection",children:[e.jsx(O.Header,{closeButton:!0,children:e.jsx(O.Title,{children:`${(t=h().nomenclatures)==null?void 0:t.companies.singularTerm} Selection`})}),e.jsx(O.Body,{children:e.jsx(Ae,{values:this.state.form,onChange:this._handleChange,children:e.jsx(C,{children:e.jsx(v,{children:e.jsxs(A,{children:[e.jsx(ws,{"data-testid":"combo-companySelectionModal-companyId",name:"companyId"}),e.jsx(D,{required:!0,children:(s=h().nomenclatures)==null?void 0:s.companies.singularTerm})]})})})})}),e.jsxs(O.Footer,{children:[e.jsx(Y,{id:"btnCancel",variant:"danger",onClick:this._handleCancel,"data-testid":"btn-companySelection-cancel",children:"Cancel"}),e.jsx(Y,{id:"btnConfirm",variant:"success",onClick:this._handleConfirm,"data-testid":"btn-companySelection-confirm",children:"Confirm"})]})]}):null}}const fi=()=>window.location.search.includes("startRegistration=true");class yi extends I.Component{constructor(){super(...arguments);i(this,"_openModal",()=>{this._companySelectionModal.open()})}componentDidMount(){h().justLoggedIn&&(Ua(!1),!fi()&&h().hasMultipleCompanies&&this._openModal())}render(){const{currentCompanyInfo:t}=h();return e.jsxs(e.Fragment,{children:[t&&e.jsx(za,{children:e.jsx("a",{className:"nav-link",onClick:()=>this._openModal(),style:{cursor:"pointer"},children:t.companyName})}),e.jsx(xi,{...this.props,ref:s=>{this._companySelectionModal=s}})]})}}const bi=Oe(yi);class vi extends I.Component{render(){const r=h();return e.jsx("span",{children:r.userName})}}class ji extends I.Component{render(){return h().impersonationSession?e.jsx(Y,{variant:"link text-white",onClick:this.props.onChangeImpersonatedUser,"data-testid":"btn-userCard",children:"Change Impersonated User"}):null}}class Ps extends I.PureComponent{constructor(t){super(t);i(this,"completed",()=>this._ctrl.completed());i(this,"flag",()=>this._ctrl.flag());this.state={items:[]},this._isMounted=!1}componentDidMount(){this._isMounted=!0,X.get("/query/getUsers",{},{success:t=>{this._isMounted&&this.setState({items:t.data.users.map(s=>({...s,value:s.userId,label:s.userName}))})}},{block:!1})}componentWillUnmount(){this._isMounted=!1}render(){return e.jsx(Qe,{...this.props,"data-testid":this.props["data-testid"],items:this.state.items,searchable:!0,ref:t=>{this._ctrl=t}})}}Ps.defaultProps={formControl:!0,managed:!1};class Ci extends I.Component{constructor(t){super(t);i(this,"initialState",()=>({visible:!1,userId:null}));i(this,"open",()=>{this.setState({visible:!0,userId:h().userId})});i(this,"close",()=>{this.setState(this.initialState())});i(this,"handleUserChange",t=>{this.setState({userId:t.value})});i(this,"handleConfirm",()=>{X.post("/authentication/impersonate",{userId:this.state.userId},{success:t=>{const s=ds(window.location.search);We(t.data);const n=s??h().landingPage??de;xt(`${window.env.PSX_VERTICAL_NAME}`),this.props.history.push(n),this.close()},error:t=>{R(t.error.errorMessage)}},{sensitive:!0})});this.state=this.initialState()}render(){return e.jsxs(O,{size:"md",show:this.state.visible,onHide:this.close,"data-testid":"modal-changeImpersonatedUser",children:[e.jsx(O.Header,{closeButton:!0,children:e.jsx(O.Title,{children:"Change impersonated user"})}),e.jsx(O.Body,{children:e.jsxs(A,{children:[e.jsx(Ps,{"data-testid":"combo-changeImpersonatedUserModal-userId",value:this.state.userId,onChange:this.handleUserChange}),e.jsx(D,{required:!0,children:"User"})]})}),e.jsxs(O.Footer,{children:[e.jsx(Y,{variant:"danger",onClick:this.close,"data-testid":"btn-changeImpersonatedUser-cancel",children:"Cancel"}),e.jsx(Y,{disabled:this.state.userId===h().userId,variant:"success",onClick:this.handleConfirm,"data-testid":"btn-changeImpersonatedUser-confirm",children:"Confirm"})]})]})}}class Si extends I.Component{constructor(t){super(t);i(this,"onSignOut",()=>{ke(),this.props.history.push("/")});i(this,"toggleVisibility",()=>{this.setState(t=>({open:!t.open}))});i(this,"handleChangeImpersonatedUser",()=>{this._changeImpersonatedUserModalRef.open({onConfirm:()=>this.props.history.push(de)})});this.state={open:!1}}render(){const t=h();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:xe("dropdown","nav-item","hide-caret",{open:this.state.open}),onMouseEnter:this.toggleVisibility,onMouseLeave:this.toggleVisibility,children:[e.jsx("a",{"aria-haspopup":"true","aria-expanded":"true",id:"Retail",href:"#",className:"dropdown-toggle nav-link",role:"button","data-testid":"portalUserCard-menu",children:e.jsx(it,{userKey:t.customerKey,style:{width:"30px",height:"30px",marginTop:"-10px",marginBottom:"-5px",border:"0px"}})}),e.jsxs("div",{"aria-labelledby":"Admin",className:xe({"dropdown-menu":!0,"dropdown-menu-right":!0,"c-user-card":!0,show:this.state.open}),children:[e.jsxs("li",{className:"c-user-card__header",children:[e.jsx(it,{userKey:t.customerKey}),e.jsxs("p",{className:"c-user-card__title",children:[e.jsx(vi,{}),e.jsx("small",{className:"c-user-card__subtitle",children:t.email})]}),e.jsx(ji,{onChangeImpersonatedUser:this.handleChangeImpersonatedUser})]}),e.jsx("div",{className:"row",children:e.jsxs("div",{className:"col-md-12 d-flex justify-content-center",children:[!h().authenticationErrorCode&&!h().previewSession&&e.jsx(Ne,{to:"/memberPortal/accounts/profile#ProfileTab",className:"btn btn-default btn-flat float-left m-2",children:"My Profile"}),e.jsx("a",{className:"btn btn-default btn-flat float-right m-2",onClick:this.onSignOut,"data-testid":"btn-portalUserCard-signOut",children:"Sign out"})]})})]})]}),e.jsx(Ci,{ref:s=>{this._changeImpersonatedUserModalRef=s},history:this.props.history})]})}}const wi=Oe(Si);class Pi extends I.Component{render(){return e.jsx("div",{className:"nav-item",children:e.jsx("a",{className:"nav-link",onClick:()=>this.props.onToggleFullscreen(!0),style:{cursor:"pointer"},children:e.jsx(j,{icon:Ha})})})}}class Ni extends I.Component{constructor(t){super(t);i(this,"handleClick",()=>{let t;document.body.classList.contains(oe)?(document.body.classList.remove(oe),t=null):(document.body.classList.add(oe),t=oe);const s=t===oe;return Va(s),this.setState({forceCollapse:s,isCollapsed:s}),setTimeout(this._dispatchResize,100),setTimeout(this._dispatchResize,300),setTimeout(this._dispatchResize,500),this.props.onToggleSidebar&&this.props.onToggleSidebar(t===oe),!1});i(this,"_dispatchResize",()=>{if(document.createEventObject)window.fireEvent("resize");else{const t=new Event("resize",{bubbles:!1,cancelable:!0});window.dispatchEvent(t)}});i(this,"handleResize",t=>{!t.isTrusted||!this.props.autoResize||(window.innerWidth<_t?document.body.classList.add(oe):this.state.forceCollapse||document.body.classList.remove(oe))});this.state={forceCollapse:!1,isCollapsed:document.body.classList.contains(oe)}}componentDidMount(){window.addEventListener("resize",this.handleResize),window.innerWidth<_t&&document.body.classList.add(oe),h().sidebarCollapsed&&(this.setState({forceCollapse:!0,isCollapsed:document.body.classList.contains(oe)}),document.body.classList.add(oe))}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}render(){const t=this.state.isCollapsed,s=t?"Expand sidebar":"Collapse sidebar";return e.jsx("ul",{className:"navbar-nav d-flex cursor-pointer",role:"navigation","aria-label":"Sidebar controls",children:e.jsx("li",{className:"nav-item toggle-sidebar-icon",role:"none",children:e.jsx("a",{className:"nav-link","data-widget":"pushmenu",role:"button",tabIndex:0,"aria-label":s,title:s,onClick:this.handleClick,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),this.handleClick(n))},children:e.jsx(j,{icon:t?Wa:Ka,"aria-hidden":"true"})})})})}}let Ei=class extends I.Component{constructor(){super(...arguments);i(this,"handleShowMeAround",()=>{Qt({params:{visible:!0,videoUrl:"https://app.screencast.com/4Rp8jPdecOuwz"}})})}render(){var n,d;const{menuItems:t}=h(),{showSidebar:s}=Ee();return e.jsxs(rt,{className:"main-header navbar navbar-green d-flex portal",variant:"dark",expand:"sm",collapseOnSelect:!0,children:[s&&e.jsx(Ni,{onToggleSidebar:this.props.onToggleSidebar}),e.jsx("a",{href:"#",onClick:o=>{o.preventDefault(),this.props.history.push("/")},children:Ue()&&((d=(n=h())==null?void 0:n.portalSettings)==null?void 0:d.navbarShowLogo)&&e.jsx("img",{className:"ml-4",src:Ue(),height:52,alt:Ga()})}),e.jsx(rt.Collapse,{"aria-controls":"main-navbar",className:"justify-content-end",children:e.jsx(Ya,{children:e.jsx(Qa,{menuItems:t})})}),e.jsxs("span",{className:"d-flex flex-row align-items-center pb-1 navbar-fixed-controls",children:[e.jsx(Pi,{onToggleFullscreen:this.props.onToggleFullscreen}),e.jsx(bi,{}),e.jsx(wi,{})]})]})}};const ki=Oe(Ei),Ti=({children:a})=>e.jsx("div",{className:xe(Hn,"portal"),children:a});window.__isPrerender||ft(()=>import("./styles-mpRU3QBU.js"),__vite__mapDeps([0,1]));let Ii=class extends I.Component{constructor(t){super(t);i(this,"onToggleSidebar",t=>{this.setState({collapsed:t})});i(this,"toggleFullscreen",()=>{this.props.fullscreen?(this.props.fullScreenHideHeader&&document.body.classList.remove(Lt),document.fullscreenElement&&document.exitFullscreen()):(this.props.fullScreenHideHeader&&document.body.classList.add(Lt),document.documentElement.requestFullscreen&&document.documentElement.requestFullscreen()),Xa.dispatch(Vn(!this.props.fullscreen))});i(this,"onTimeout",()=>{this.setState({lockscreenVisible:!0},()=>{document.body.classList.add("hold-transition"),document.body.classList.add("lockscreen"),window.FreshworksWidget&&window.FreshworksWidget("hide")})});i(this,"lockscreenClose",()=>{this.setState({lockscreenVisible:!1},()=>{document.body.classList.remove("hold-transition"),document.body.classList.remove("lockscreen"),window.FreshworksWidget&&window.FreshworksWidget("show"),this.dispatchResize(),setTimeout(this.dispatchResize,100),setTimeout(this.dispatchResize,300),setTimeout(this.dispatchResize,500)})});i(this,"dispatchResize",()=>{if(document.createEventObject)window.fireEvent("resize");else{const t=new Event("resize",{bubbles:!1,cancelable:!0});window.dispatchEvent(t)}});i(this,"getSessionInfoAlertLabels",()=>{const{impersonationSession:t,readOnlySession:s,previewSession:n}=h();let d=null,o=null;return t?(d=`IMPERSONATION SESSION ${s?"(READ-ONLY)":""}`,o=e.jsxs(e.Fragment,{children:["You are experiencing the mem
10ber portal as if you were"," ",e.jsx("b",{children:h().userName}),s?", but in view-only mode.":". All changes will be made as them."]})):n?(d="PREVIEW SESSION",o=`You are previewing the Portal as a User without any associated ${h().nomenclatures.companies.pluralTerm}.`):(d="READ-ONLY SESSION",o="This session is read-only. You can view information but cannot edit or create anything."),{title:d,description:o}});i(this,"renderSessionInfoAlert",()=>{const{impersonationSession:t,readOnlySession:s,previewSession:n}=h();if(!t&&!n&&!s)return null;const{title:d,description:o}=this.getSessionInfoAlertLabels();return e.jsxs(as,{className:"read-only-alert mb-0 text-center",variant:"warning",children:[e.jsx("p",{className:"text-bold",children:d}),e.jsx("span",{children:o})]})});this.state={authenticated:!1,lockscreenVisible:!1,websiteData:this.props.tenantWebsiteSettings.data,websiteEventsEnabled:this.props.tenantWebsiteSettings.activityConfigCode!=="APPOINTMENTS",websiteTimeFormatCode:this.props.tenantWebsiteSettings.timeFormatCode,hasDirectorySorting:this.props.hasDirectorySorting,collapsed:!1}}componentDidMount(){var n;let t="skin-blue sidebar-mini text-sm";if(!Ee().showSidebar)t+=` ${Wn}`;else{const d=(n=h())==null?void 0:n.sidebarCollapsed;(d||d===void 0)&&(t+=` ${oe}`),this.setState({collapsed:d||d===void 0})}if(document.body.setAttribute("class",t),!nt()||!Rt()){ke();const d=ls(this.props.location.pathname,window.location.search);this.props.history.replace(Le+d)}else this.setState({authenticated:!0});Ee().alternativeInput&&document.body.classList.add("alternative-input"),document.addEventListener("fullscreenchange",this.handleExitFullscreen),document.addEventListener("webkitfullscreenchange",this.handleExitFullscreen),document.addEventListener("mozfullscreenchange",this.handleExitFullscreen),document.addEventListener("MSFullscreenChange",this.handleExitFullscreen);const s=h();s!==null&&(cs(s.portalSettings),ms())}componentDidUpdate(){(!nt()||!Rt())&&(ke(),this.props.history.replace(Le),this.setState({authenticated:!1}))}render(){if(!this.state.authenticated)return null;const{sessionTimeout:t}=h();return e.jsxs(yt,{ref:bt,children:[e.jsx(ar,{visible:this.state.lockscreenVisible,onRelogin:this.lockscreenClose}),e.jsx(Vt,{onTimeout:this.onTimeout,minutes:t}),e.jsx(ki,{onToggleFullscreen:this.toggleFullscreen,onToggleSidebar:this.onToggleSidebar}),Ee().showSidebar&&e.jsx(ui,{collapsed:this.state.collapsed,currentPath:this.props.history.location.pathname}),e.jsxs(Ti,{children:[(h().readOnlySession||h().impersonationSession)&&this.renderSessionInfoAlert(),e.jsx(ii,{match:this.props.match,websiteData:this.state.websiteData,timeFormatCode:this.state.websiteTimeFormatCode,eventsEnabled:this.state.websiteEventsEnabled,hasDirectorySorting:this.state.hasDirectorySorting})]}),!this.props.fullscreen&&e.jsx(pi,{})]})}};const Ai=a=>({fullscreen:a.Config.fullscreen}),Mi=gt(Ai)(Ii),Di=({children:a})=>e.jsx("div",{className:"login-box-body",children:a}),Ri=({logoUrl:a})=>e.jsx("div",{className:"login-box-logo clickable",children:a&&e.jsx("img",{src:a,alt:"Login"})});class Fi extends I.Component{constructor(t){super(t);i(this,"initialState",()=>({error:null,loading:!0}));this.state=this.initialState()}componentDidMount(){const t=window.location.search;if(!t){this.props.history.replace(de);return}const n=new URLSearchParams(t).get("token");if(!n){this.props.history.replace(de);return}const{websiteDomain:d,websiteShorthand:o}=ye(),l={impersonationSecurityToken:n,websiteDomain:d,websiteShorthand:o};X.post("/authentication/impersonate",l,{success:c=>{const b=ds(window.location.search);We(c.data);const g=b??h().landingPage??de;xt(`${window.env.PSX_VERTICAL_NAME}`),this.props.history.push(g)},error:c=>{this.setState({error:c.error})},exception:()=>{this.setState({error:{errorMessage:"Oops! Something went wrong. Please contact administrator."}})}},{sensitive:!0}).finally(()=>this.setState({loading:!1}))}render(){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"login-box-error",children:e.jsx(Ie,{error:this.state.error})}),e.jsx(yt,{ref:bt,children:this.state.loading&&e.jsx(J,{})})]})}}const _i=Oe(Fi);
10class jt extends I.Component{render(){return e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx("p",{className:"login-box-heading",children:"We are loading your information..."}),e.jsx("br",{}),e.jsx("div",{className:"text-center",children:e.jsx("img",{src:"/images/spinner.gif",alt:"..."})}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("p",{className:"login-box-heading",children:"... just a moment!"}),e.jsx("br",{}),e.jsx("br",{})]})}}class Li extends I.Component{constructor(t){super(t);i(this,"initialState",()=>({error:null,loading:!0,completed:!1,expired:!1}));i(this,"retrieveRestorePassword",()=>{const t={resetToken:this.state.resetToken};X.get("/recovery/retrieveRestorePassword",t,{success:s=>{this.setState({loading:!1,expired:s.data.expired,form:{password:"",confirmPassword:"",securityResponses:[]},data:{...s.data}})},error:s=>{this.setState({loading:!1,error:s.error,expired:s.data.expired})}},{sensitive:!0})});i(this,"completeRestorePassword",()=>{if(!this.validate())return;const{form:t}=this.state,s={newPassword:t.password,resetToken:this.state.resetToken,securityResponses:t.securityResponses,verificationCode:t.verificationCode};X.post("/recovery/completeRestorePassword",s,{success:()=>{this.setState({completed:!0})},error:n=>{this.setState({expired:n.data.expired}),R(n.error.errorMessage)}})});i(this,"handleTryAgain",()=>{this.setState({error:null,expired:!1},()=>this.retrieveRestorePassword())});i(this,"validate",()=>{const{form:t}=this.state;return t.password!==t.confirmPassword?(this.setState({error:{errorMessage:"The password and confirmation password do not match."}}),!1):!0});i(this,"onChange",t=>{this.setState({form:t})});this.state=this.initialState()}componentDidMount(){this.setState({resetToken:Fe.parse(this.props.location.search).p},()=>{this.retrieveRestorePassword()})}render(){return this.state.loading?e.jsx(jt,{}):this.state.expired?e.jsx(Ie,{error:this.state.error,goToLogin:!0}):this.state.error?e.jsx(Ie,{error:this.state.error,enableTryAgain:!0,onTryAgain:this.handleTryAgain}):this.state.completed?e.jsx(qe,{title:"Password restored.",message:"You have set your new password, and
10you can safely login now to the application."}):e.jsxs("div",{className:"login-box-expired-password",children:[e.jsx("p",{className:"login-box-heading",children:"Restore password"}),e.jsxs(Ae,{onSubmit:this.completeRestorePassword,values:this.state.form,onChange:this.onChange,children:[e.jsx(C,{children:e.jsx(v,{sm:12,children:e.jsxs("h6",{children:[e.jsx(j,{icon:Gt})," ","Type your new password"]})})}),e.jsx(C,{children:e.jsxs(v,{sm:6,children:[e.jsxs(A,{children:[e.jsx(me,{"data-testid":"input-portalRestorePassword-password",name:"password",required:!0}),e.jsx(D,{htmlFor:"password",required:!0,children:"New password"})]}),e.jsxs(A,{children:[e.jsx(me,{"data-testid":"input-portalRestorePassword-confirmPassword",confirmPassword:!0,name:"confirmPassword",required:!0}),e.jsx(D,{htmlFor:"confirmPassword",required:!0,children:"Confirm new password"})]})]})}),e.jsx(C,{children:e.jsx(v,{sm:12,children:e.jsx(Ye,{maxPasswordLength:128})})}),e.jsx("hr",{}),e.jsx(A,{className:"text-center",children:e.jsx(ce,{variant:"success",id:"btnChangePassword",type:"submit","data-testid":"btn-portalRestorePassword-change",children:"Change password"})})]})]})}}class Oi extends I.Component{constructor(t){super(t);i(this,"initialState",()=>({error:null,loading:!0,completed:!1,alreadyExists:!1,expired:!1}));i(this,"setTitle",()=>{xt("Confirm Portal Email Change")});i(this,"retrieveConfirmEmail",()=>{const t={resetToken:this.state.resetToken};X.get("/recovery/retrieveConfirmEmail",t,{success:s=>{this.setState({loading:!1,data:{...s.data}},()=>{this.state.data.newEmail||this.setState({expired:!0})})},error:s=>{s.error.errorCode==="EMAIL_ALREADY_EXISTS"?this.setState({loading:!1,alreadyExists:!0}):this.setState({loading:!1,error:s.error})}},{sensitive:!0})});i(this,"completeConfirmEmail",()=>{const t={newEmail:this.state.data.newEmail,resetToken:this.state.resetToken};X.post("/recovery/completeConfirmEmail",t,{success:()=>{this.setState({completed:!0})},error:s=>{R(s.error.errorMessage),s.error.errorCode==="EMAIL_ALREADY_EXISTS"&&this.setState({alreadyExists:!0})}})});i(this,"handleTryAgain",()=>{this.setState({error:null},()=>this.retrieveConfirmEmail())});this.state=this.initialState()}componentDidMount(){this.setState({resetToken:Fe.parse(this.props.location.search).p},()=>{this.retrieveConfirmEmail(),this.setTitle()})}render(){return this.state.loading?e.jsx(jt,{}):this.state.error?e.jsx(Ie,{error:this.state.error,goToLogin:!0}):this.state.completed?e.jsx(qe,{title:"Email Confirmed Successfully.",message:"You have confirmed your email change, and you can safely login now to the application."}):this.state.alreadyExists?e.jsx(qe,{title:"Email change operation was cancelled.",message:"The requested email is already in use by another user."}):this.state.expired?e.jsx(qe,{title:"This confirmation is no longer available.",message:""}):e.jsxs("div",{className:"login-box-expired-password text-center",children:[e.jsx("p",{className:"login-box-heading",children:"Confirm Email Change"}),this.state.data&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Hello",` ${this.state.data.firstName} ${this.state.data.lastName},`]}),e.jsxs("p",{children:["Your email was modified to",` ${this.state.data.newEmail}`]})]}),e.jsxs("p",{children:[" ","Please click the button below within"," ",this.state.data.linkExpireMinutes," ","minutes to confirm the change."," "]}),e.jsx("div",{className:"login-box-heading",children:e.jsx(ce,{variant:"success",id:"btnConfirmEmail",onClick:this.completeConfirmEmail,"data-testid":"btn-portalConfirmEmailChange-confirm",children:"Confirm Change"})}),e.jsx("p",{className:"mt-3",children:"Thank you!"})]})}}const Bi=6e3;class qi extends I.Component{constructor(t){super(t);i(this,"initialState",()=>({error:null,loading:!0,expired:!1,resendCodeDisabled:!1,resendLinkLoading:!1,resendLinkSuccess:!1}));i(this,"retrieveRegistration",()=>{const t={registrationToken:Fe.parse(this.props.location.search).p};X.get("/registration/retrieveRegistration",t,{success:s=>{this.setState({loading:!1,accountRegistration:s.data.accountRegistration,userId:s.data.userId,form:{email:s.data.email,password:"",confirmPassword:"",code:null},data:{firstName:s.data.firstName}})},error:s=>{var n;this.setState({loading:!1,error:s.error,expired:(n=s.data)==null?void 0:n.expired})}},{sensitive:!0})});i(this,"completeRegistration",()=>{if(!this.validate())return;const t={registrationToken:Fe.parse(this.props.location.search).p,password:this.state.form.password,code:this.state.form.code};X.post("/registration/completeRegistration",t,{success:()=>{this.signIn()},error:s=>{var n;this.setState({expired:(n=s.data)==null?void 0:n.expired}),R(s.error.errorMessage)}})});i(this,"signIn",()=>{const{websiteDomain:t,websiteShorthand:s}=ye(),n={email:this.state.form.email,password:this.state.form.password,websiteDomain:t,websiteShorthand:s};this.setState({error:null},()=>{X.post("/authentication/login",n,{success:d=>{We(d.data);const o=h().landingPage??de;this.props.history.push(o)},error:d=>{console.log(d),this.setState({error:d.error}),setTimeout(()=>{this.setState({error:""})},Bi)},exception:()=>{this.setState({error:{errorMessage:"Oops! Something went wrong. Please contact administrator."}})}},{sensitive:!0})})});i(this,"resendRegistrationLink",()=>{this.setState({resendLinkLoading:!0},()=>{const t={registrationToken:Fe.parse(this.props.location.search).p};X.post("/registration/resendRegistration",t,{success:s=>{this.setState({resendLinkLoading:!1,resendLinkSuccess:!0}),ge(s.message)},error:s=>{this.setState({resendLinkLoading:!1}),R(s.error.errorMessage)}})})});i(this,"resendCode",()=>{this.setState({resendCodeDisabled:!0},()=>{setTimeout(()=>this.setState({resendCodeDisabled:!1}),5e3);const t={userId:this.state.userId};X.post("/registration/resendCode",t,{success:s=>{ge(s.message)},error:s=>{R(s.error.errorMessage)}},{block:!1})})});i(this,"onSubmit",()=>{this.completeRegistration()});i(this,"onChange",t=>{this.setState({form:t})});this.state=this.initialState()}componentDidMount(){this.retrieveRegistration()}validate(){const{form:t}=this.state;return t.password!==t.confirmPassword?(R("The password and confirmation password do not match."),!1):!0}render(){return this.state.loading?e.jsx(jt,{}):this.state.expired?e.jsxs("div",{className:"login-box-expired-password text-center d-flex flex-column align-items-center",children:[e.jsx(Ie,{error:this.state.error}),e.jsxs("div",{className:"text-center mt-3 d-flex flex-column align-items-center",children:[this.state.resendLinkSuccess?e.jsx("p",{className:"text-success",children:"A new registration email has been sent. Please check your inbox."}):e.jsx(ce,{variant:"primary",onClick:this.resendRegistrationLink,disabled:this.state.resendLinkLoading,"data-testid":"btn-portalRegistration-resendLink",children:"Resend Registration Email"}),e.jsx(ce,{variant:"link",className:"d-block mt-2",onClick:()=>this.props.history.push(Le),"data-testid":"btn-portalRegistration-goToLogin",children:"Go to Login"})]})]}):this.state.error?e.jsx(Ie,{error:this.state.error}):e.jsxs("div",{className:"login-box-expired-password",children:[e.jsxs("p",{className:"login-box-heading",children:[this.state.accountRegistration&&e.jsxs("strong",{children:["Almost done ",this.state.data.firstName,"!"]}),!this.state.accountRegistration&&e.jsxs("strong",{children:["Welcome aboard ",this.state.data.firstName,"!"]}),e.jsx("br",{}),this.state.accountRegistration&&"Please enter your 6-digit verification code and set your password to activate your account.",!this.state.accountRegistration&&"Please use the form below to create your system password."]}),e.jsx("hr",{}),e.jsxs(Ae,{onSubmit:this.onSubmit,onChange:this.onChange,values:this.state.form,children:[e.jsx(C,{children:e.jsx(v,{md:6,children:e.jsxs(A,{children:[e.jsx(ut,{name:"email",disabled:!0,"data-testid":"input-cpUserRegistration-email"}),e.jsx(D,{htmlFor:"email",children:"Your email"})]})})}),e.jsx("hr",{}),this.state.accountRegistration&&e.jsxs(e.Fragment,{children:[e.jsx(C,{children:e.jsx(v,{children:e.jsx("span",{children:"Please enter the verification code that we sent to your email."})})}),e.jsx(C,{children:e.jsx(v,{md:6,children:e.jsxs(A,{children:[e.jsx(Ja,{name:"code",maxLength:"6",required:!0,"data-testid":"input-cpUserRegistration-code"}),e.jsx(D,{htmlFor:"code",required:!0,children:"Verification code"})]})})}),e.jsx(C,{children:e.jsx(v,{md:6,children:e.jsx(ce,{className:"p-0 float-right font-italic",variant:"link",size:"xs",onClick:()=>this.resendCode(),disabled:this.state.resendCodeDisabled,"data-testid":"btn-portalRegistration-resendCode",children:"Resend Code"})})})]}),e.jsxs(C,{children:[e.jsx(v,{md:6,children:e.jsxs(A,{children:[e.jsx(me,{name:"password",required:!0,autofocus:!0,"data-testid":"input-cpUserRegistration-password"}),e.jsx(D,{htmlFor:"password",required:!0,children:"Create a password"})]})}),e.jsx(v,{md:6,children:e.jsxs(A,{children:[e.jsx(me,{name:"confirmPassword",required:!0,"data-testid":"input-cpUserRegistration-confirmPassword"}),e.jsx(D,{htmlFor:"confirmPassword",required:!0,children:"Confirm your password"})]})})]}),e.jsx(C,{children:e.jsx(v,{md:12,children:e.jsx(Ye,{maxPasswordLength:128})})}),e.jsx("hr",{}),e.jsx(A,{className:"text-center",children:e.jsx(ce,{variant:"success",id:"btnFinish",type:"submit","data-testid":"btn-portalRegistration-finish",children:"Finish your registration"})})]})]})}}class $i extends I.Component{constructor(t){super(t);i(this,"initialState",()=>({form:{},userId:""}));i(this,"save",()=>{if(!this.validate())return;const{form:t}=this.state,s={userId:this.state.userId,newPassword:t.newPassword,oldPassword:t.oldPassword};X.post("/recovery/renewPassword",s,{success:n=>{ge(n.message),ke(),window.location.href="/"},error:n=>{R(n.error.errorMessage)}},{sensitive:!0})});i(this,"validate",()=>{const{form:t}=this.state;return t.newPassword!==t.confirmPassword?(R("The password and confirmation password do not match."),!1):!0});i(this,"cancel",()=>{this.props.history.push(Le)});i(this,"onSubmit",()=>{this.save()});i(this,"onCancel",()=>{const t=this;Za(()=>{t.cancel()})});i(this,"onChange",t=>{this.setState({form:t})});i(this,"setHelp",()=>{this.props.helpKey?en(this.props.helpKey):tn()});this.state=this.initialState()}componentDidMount(){this.setState({userId:h().userId}),this.setHelp()}render(){return e.jsxs("div",{className:"login-box-expired-password",children:[e.jsx("h5",{children:"Expired Password"}),e.jsx("hr",{}),e.jsxs(Ae,{onChange:this.onChange,onSubmit:this.onSubmit,values:this.state.form,unsavedChangesWarning:!1,ref:t=>this._form=t,children:[e.jsxs(C,{children:[e.jsxs(v,{md:12,children:[e.jsx("p",{children:"Your password has expired and must be changed. Please enter a new Password."}),e.jsxs(A,{children:[e.jsx(me,{"data-testid":"input-cpExpiredPassword-oldPassword",name:"oldPassword",required:!0}),e.jsx(D,{htmlFor:"oldPassword",required:!0,children:"Current password"})]}),e.jsxs(A,{children:[e.jsx(me,{"data-testid":"input-cpExpiredPassword-newPassword",name:"newPassword",required:!0}),e.jsx(D,{htmlFor:"newPassword",required:!0,children:"New password"})]}),e.jsxs(A,{children:[e.jsx(me,{"data-testid":"input-cpExpiredPassword-confirmPassword",name:"confirmPassword",required:!0}),e.jsx(D,{htmlFor:"confirmPassword",required:!0,children:"Confirm new password"})]})]}),e.jsx(v,{md:12,children:e.jsx(Ye,{maxPasswordLength:128})})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("hr",{}),e.jsx(sn,{onCancel:this.onCancel})]})]})]})}}let Ui=class extends I.Component{render(){return e.jsxs(pt,{children:[e.jsx($,{path:"/memberPortal/public/login",component:an}),e.jsx($,{path:"/memberPortal/public/impersonate",component:_i}),e.jsx($,{path:"/memberPortal/public/resetPassword",component:nn}),e.jsx($,{path:"/memberPortal/public/restorePassword",component:Li}),e.jsx($,{path:"/memberPortal/public/confirmEmailChange",component:Oi}),e.jsx($,{path:"/memberPortal/public/userRegistration",component:qi}),e.jsx($,{path:"/memberPortal/public/expiredPassword",component:$i}),e.jsx($,{path:"*",component:Cs})]})}};window.__isPrerender||ft(()=>import("./styles-mpRU3QBU.js"),__vite__mapDeps([0,1]));class zi extends I.Component{constructor(r){super(r),this.state={loadingPortalSettings:!0}}componentDidMount(){document.body.setAttribute("class","login-body"),Ee().alternativeInput&&document.body.classList.add("alternative-input");const{websiteShorthand:r,websiteDomain:t}=ye(this.props.websiteShorthand),s={websiteShorthand:r,websiteDomain:t};rs.get("/getAccountPortalSettings",s,{success:n=>{rn(n.data),cs(n.data),ms(),this.setState({loadingPortalSettings:!1})}})}componentWillUnmount(){document.body.classList.remove("login-body")}render(){return e.jsxs("div",{className:"login-box wide",children:[e.jsx(Ri,{logoUrl:Ue()}),e.jsx(Di,{children:e.jsx(yt,{ref:bt,children:e.jsx(Ui,{})})})]})}}const Hi=()=>(F.useEffect(()=>{const{websiteShorthand:a,websiteDomain:r}=ye(),t=new URLSearchParams;a&&t.set("websiteShorthand",a),t.set("websiteDomain",r),t.set("isSitemap","true"),window.location.replace(`${$e.url("/publicAccess/getSitemap")}?${t}`)},[]),null),Vi=({page:a})=>(F.useEffect(()=>{var s;const r=Kn(a);if(!r)return;const t={url:r.url,option:r.option,openNewPage:!1,internalPageId:((s=r.customDataAttributes)==null?void 0:s["data-internal-page-id"])??null,formId:a.formId??null,isForm:r.option==="publishedForm",subOption:a.subOption??null,enableLink:!0};on(t,{},!1)},[a]),null),Ns=(a,r)=>
10{var t;for(let s=0;s<a.length;s++){const n=a[s],d=(t=n.contents)==null?void 0:t.find(o=>o.guid===r);if(d)return d;if(n.pages.length>0){const o=Ns(n.pages,r);if(o)return o}}return null};class Wi extends I.Component{constructor(t){super(t);i(this,"initialState",()=>{const t=window.location.search;if(t!==""){const n=new URLSearchParams(t).get("id"),d=Ns(this.props.pages,n);return{blockGuid:n,block:d}}return{invalidRequest:!0}});i(this,"renderError",t=>e.jsx("div",{className:"d-flex justify-content-center align-items-center",children:e.jsx("h4",{children:t})}));this.state=this.initialState()}componentDidMount(){const t=document.querySelector(".navbar"),s=document.querySelector(".tenantWebsite-footer"),n=document.querySelector(".tenantWebsite-prefooter");t&&(t.style.display="none"),s&&(s.style.display="none"),n&&(n.style.display="none")}render(){var T;if(this.state.invalidRequest)return this.renderError("Invalid Request");if(!((T=this.state.block)!=null&&T.active))return this.renderError("Invalid Block");const{timeFormatCode:t,membershipEnabled:s,sponsorshipEnabled:n,eventsEnabled:d,pages:o,events:l,originalEvents:c,eventTypes:b,eventCategories:g,timeZoneIANAId:N,timeZoneName:S}=this.props,E=os[this.state.block.version];return e.jsx(E,{...this.state.block,timeFormatCode:t,membershipEnabled:s,sponsorshipEnabled:n,eventsEnabled:d,pages:o,events:l,originalEvents:c,eventTypes:b,eventCategories:g,timeZoneIANAId:N,timeZoneName:S,fullWidth:"true"})}}class Ki extends I.Component{constructor(r){super(r),this.state={encryptedKey:null,blocks:null,loading:!0,errorMessage:null}}componentDidMount(){const r=window.location.search,s=new URLSearchParams(r).get("encryptedKey");if(!s){this.setState({loading:!1,errorMessage:"Invalid report link."});return}ln.get("/getPublicExecutiveReport",{encryptedKey:s},{success:n=>{try{const d=JSON.parse(n.data.reportData);this.setState({blocks:d.blocks,encryptedKey:s,dashboardLayoutCode:n.data.dashboardLayoutCode,periodStartDate:n.data.periodStartDate,periodEndDate:n.data.periodEndDate,loading:!1})}catch{this.setState({loading:!1,errorMessage:"Unable to load report data."})}},error:n=>{var o;const d=((o=n==null?void 0:n.error)==null?void 0:o.errorMessage)||"Something went wrong. Please try again later.";this.setState({loading:!1,errorMessage:d})}})}render(){const{blocks:r,encryptedKey:t,dashboardLayoutCode:s,periodStartDate:n,periodEndDate:d,loading:o,errorMessage:l}=this.state;return o?e.jsx("div",{className:"tenantWebsite d-flex justify-content-center align-items-center py-5",children:e.jsx("span",{children:"Loading..."})}):l||!r?e.jsx("div",{className:"tenantWebsite d-flex justify-content-center align-items-center py-5",children:e.jsx("span",{children:l||"Report not found."})}):e.jsx("div",{className:"tenant-website-wrapper px-5",children:e.jsx(dn,{encryptedKey:t,dashboardLayoutCode:s,blocks:r,periodStartDate:n,periodEndDate:d})})}}const Je=(a,r)=>{var t;return((t=a.redirectSlugs)==null?void 0:t.length)>0?a.redirectSlugs.map(s=>e.jsx($,{exact:!0,path:s,children:e.jsx(hs,{to:r})},`redirect-route-${s}`)):[]},Gi=({routes:a,privacyPolicy:r,terms:t,timeFormatCode:s,membershipEnabled:n,sponsorshipEnabled:d,eventsEnabled:o,events:l,originalEvents:c,memberEventsEnabled:b,eventTypes:g,eventCategories:N,timeZoneIANAId:S,timeZoneName:E,websiteName:T,isMemberPortal:k,tenantWebsiteSettings:P,googleAnalyticsTrackingId:M,globalRedirectSlugs:_,hasDirectorySorting:V})=>{var f,B,U,Q;const H=window.__isPrerender?null:M;F.useEffect(()=>{H&&Bt.initialize(H)},[H]);const ae=Ht();F.useEffect(()=>{H&&Bt.send({hitType:"pageview",page:ae.pathname})},[H,ae]);const re=((Q=(U=(B=(f=P==null?void 0:P.data)==null?void 0:f.templateAndColors)==null?void 0:B.colors)==null?void 0:U.find(te=>te.colorOptionName==="Site Text Color"))==null?void 0:Q.color)||"white";if(!a)return null;const ee=(te,x=null)=>te.flatMap(m=>{var y,w,z,W;if(!m||!m.active||m.isPopUpSection)return null;const u=x?`${x}${m.path}`:m.path;if(Qn(m)){const q=[e.jsx($,{exact:!0,path:u,children:e.jsx(Vi,{page:m})},`linked-page-redirect-${u}`)];return q.push(...Je(m,u)),q}if(((y=m.contents)==null?void 0:y.length)<1&&((w=m.contents)==null?void 0:w.length)>0&&((z=m.contents)!=null&&z.some(q=>q.contentType===Xn)&&!o||(W=m.contents)!=null&&W.some(q=>q.contentType===Jn)&&!n))return null;const p=[];if(m.isMemberPortal?(p.push(e.jsx($,{path:mn,component:zi},"route-member-portal-public"),e.jsx($,{path:de,render:q=>e.jsx(Mi,{...q,tenantWebsiteSettings:P,hasDirectorySorting:V})},"route-member-portal-main"),e.jsx($,{path:["*/memberPortal","*/member-portal"],children:e.jsx(Re,{to:de})},"route-member-portal-redirect")),p.push(...Je(m,de))):!m.noContent&&!m.defaultSubPageId&&(p.push(e.jsx($,{exact:!0,path:u,children:e.jsx(je,{contents:m.contents,visibility:m.visibility,timeFormatCode:s,membershipEnabled:n,sponsorshipEnabled:d,eventsEnabled:o,pages:a,eventContents:P.data.eventContents,events:l,originalEvents:c,memberEventsEnabled:b,eventTypes:g,eventCategories:N,timeZoneIANAId:S,timeZoneName:E,title:m.name,websiteName:T,isMemberPortal:k,hasDirectorySorting:V})},`route-${u}`)),p.push(...Je(m,u))),m.hasSubPages){p.push(...ee(m.pages,m.path));const q=Ot(m.pages,m.defaultSubPageId);q&&p.push(e.jsx($,{exact:!0,path:m.path,children:e.jsx(Re,{to:`${m.path}${q.path}`})},`redirect-route-${m.path}-${q.path}
10`)),m.pages.forEach(L=>{if(L.pages&&L.pages.length>0&&Array.isArray(L.pages)){p.push(...ee(L.pages,`${m.path}${L.path}`));const Z=Ot(L.pages,L.defaultSubPageId);Z&&p.push(e.jsx($,{exact:!0,path:`${m.path}${L.path}`,children:e.jsx(Re,{to:`${m.path}${L.path}${Z.path}`})},`redirect-route-${m.path}${L.path}-${Z.path}`)),L.contents&&p.push(e.jsx($,{exact:!0,path:`${m.path}${L.path}`,children:e.jsx(je,{contents:L.contents,visibility:L.visibility,timeFormatCode:s,membershipEnabled:n,sponsorshipEnabled:d,eventsEnabled:o,pages:a,eventContents:P.data.eventContents,events:l,originalEvents:c,memberEventsEnabled:b,eventTypes:g,eventCategories:N,timeZoneIANAId:S,timeZoneName:E,title:L.name,websiteName:T,isMemberPortal:k,hasDirectorySorting:V})},`route-${m.path}${L.path}`))}})}return p}),he=te=>te.map(x=>e.jsx($,{exact:!0,path:x.originalPath,children:e.jsx(hs,{to:x.newPath})},`redirect-route-${x.originalPath}`));return e.jsxs(pt,{"data-testid":"switch-tenantWebsite",children:[r.active&&e.jsx($,{exact:!0,path:"/privacyPolicy",children:e.jsx(je,{title:"Privacy Policy",websiteName:T,contents:[{headerEnabled:!0,headerText:"Privacy Policy",headerAlignment:"center",headerColor:re,contenName:"privacyPolicy",version:"FullWidth",active:!0,text:r.text,backgroundColor:r.backgroundColor}]})},"route-privacypolicy"),t.active&&e.jsx($,{exact:!0,path:"/termsOfUse",children:e.jsx(je,{title:"Terms Of Use",websiteName:T,contents:[{headerEnabled:!0,headerText:"Terms of Use",headerAlignment:"center",headerColor:re,contenName:"termsOfUse",version:"FullWidth",active:!0,text:t.text,backgroundColor:t.backgroundColor}]})},"route-terms"),o&&e.jsx($,{exact:!0,path:"/event-detail",children:e.jsx(je,{title:"Event Details",skipHeading:!0,websiteName:T,pages:a,eventContents:P.data.eventContents,timeFormatCode:s,membershipEnabled:n,sponsorshipEnabled:d,eventsEnabled:o,events:l,originalEvents:c,eventTypes:g,eventCategories:N,timeZoneIANAId:S,timeZoneName:E,contents:[{active:!0,contentName:"eventDetail",version:"EventDetailV1",websiteName:T}]})},"route-event-detail"),o&&e.jsx($,{exact:!0,path:"/event-detail/:token/:slug",children:e.jsx(je,{title:"Event Details",skipHeading:!0,websiteName:T,pages:a,eventContents:P.data.eventContents,timeFormatCode:s,membershipEnabled:n,sponsorshipEnabled:d,eventsEnabled:o,events:l,originalEvents:c,eventTypes:g,eventCategories:N,timeZoneIANAId:S,timeZoneName:E,contents:[{active:!0,contentName:"eventDetail",version:"EventDetailV1",websiteName:T}]})},"route-event-detail-token-slug"),o&&e.jsx($,{exact:!0,path:"/event-detail/:token/",children:e.jsx(je,{title:"Event Details",skipHeading:!0,websiteName:T,pages:a,eventContents:P.data.eventContents,timeFormatCode:s,membershipEnabled:n,sponsorshipEnabled:d,eventsEnabled:o,events:l,originalEvents:c,eventTypes:g,eventCategories:N,timeZoneIANAId:S,timeZoneName:E,contents:[{active:!0,contentName:"eventDetail",version:"EventDetailV1",websiteName:T}]})},"route-event-detail-token-slug"),o&&e.jsx($,{exact:!0,path:"/event-registration",component:cn},"route-event-registration"),e.jsx($,{exact:!0,path:"/internal/executivereports",component:Ki},"route-executivereports"),e.jsx($,{exact:!0,path:"/reset-cache",component:Pn},"route-reset-cache"),e.jsx($,{exact:!0,path:"/sitemap.xml",component:Hi},"route-sitemap"),e.jsx($,{exact:!0,path:"/robots.txt",component:Gn},"route-robots"),e.jsx($,{exact:!0,path:"/standalone",children:e.jsx(Wi,{pages:a,timeFormatCode:s,membershipEnabled:n,sponsorshipEnabled:d,eventsEnabled:o,events:l,originalEvents:c,eventTypes:g,eventCategories:N,timeZoneIANAId:S,timeZoneName:E})},"route-standalone-block"),ee(a),he(_),e.jsx($,{path:"*",render:te=>e.jsx(Yn,{...te,websiteName:T})},"route-error")]})},Yi=({pages:a,history:r,googleTagManagerEnabled:t,hasCustomDomain:s,websiteName:n,faviconStorageKey:d,logoStorageKey:o,gtmCode:l})=>{const c=F.useMemo(()=>Zn(a,r.location.pathname),[a,r.location.pathname]),g=window.location.pathname.endsWith("/index.html")?null:`${window.location.origin}${window.location.pathname}`,N=window.location.pathname==="/",S=c!=null&&c.name&&!N&&c.name!==n?`${c.name} | ${n}`:n,E=o||d,T=E?hn({storageKey:E}):void 0,k=c==null?void 0:c.description,P=t&&l&&s&&!window.__isPrerender;return F.useEffect(()=>{if(!P)return()=>{};const M=document.createElement("noscript"),_=document.createElement("iframe");return _.src=`https://www.googletagmanager.com/ns.html?id=${l}`,_.height="0",_.width="0",_.style.display="none",_.style.visibility="hidden",M.appendChild(_),document.body.prepend(M),()=>{M.remove()}},[P,l]),e.jsxs(us,{children:[P&&e.jsx("script",{children:`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 11 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 12 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 13 'https://www.googletagmanager.com/gtm.js?id=${l}'+dl; 14 f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','${l}');`}),S&&e.jsx("title",{children:S}),g&&e.jsx("link",{rel:"canonical",href:g}),k&&e.jsx("meta",{name:"description",content:k}),e.jsx("meta",{property:"og:type",content:"website"}),n&&e.jsx("meta",{property:"og:site_name",content:n}),S&&e.jsx("meta",{property:"og:title",content:S}),T&&e.jsx("meta",{property:"og:image",content:T}),g&&e.jsx("meta",{property:"og:url",content:g}),k&&e.jsx("meta",{property:"og:description",content:k}),e.jsx("meta",{name:"twitter:card",content:o?"summary_large_image":"summary"}),S&&e.jsx("meta",{name:"twitter:title",content:S}),k&&e.jsx("meta",{name:"twitter:description",content:k}),T&&e.jsx("meta",{name:"twitter:image",content:T})]})};window.__isPrerender||ft(()=>Promise.resolve({}),__vite__mapDeps([2]));class io extends I.Component{constructor(t){super(t);i(this,"getWebsiteSettings",async()=>{const t=await xn(),{websiteShorthand:s,websiteDomain:n}=ye(),d={websiteShorthand:s,websiteDomain:n,publicPageCode:Nn,rowVersion:(t==null?void 0:t.rowVersion)??null};return $e.get("/publicAccess/getPublicPage",d,{success:async o=>{let l=o.data.accountWebsite;o.data.isCacheValid?l={...l,...t.tenantWebsiteSettings,timeFormatCode:l.timeFormatCode,activityConfigCode:l.activityConfigCode,customerPortalEnabled:l.customerPortalEnabled,membershipsEnabled:l.membershipsEnabled,sponsorshipsEnabled:l.sponsorshipsEnabled,googleAnalyticsTrackingId:l.googleAnalyticsTrackingId,websiteUrl:l.websiteUrl,websiteName:l.websiteName,googleTagManagerEnabled:l.googleTagManagerEnabled,hasCustomDomain:l.hasCustomDomain,hasDirectorySorting:l.hasDirectorySorting}:fn({tenantWebsiteSettings:l,rowVersion:o.data.rowVersion}
14),this.setState({...this.getStateFromWebsiteSettings(l)},()=>{this.loadCSS()})},error:o=>{this.setState({error:o.error})}})});i(this,"getGlobalRedirectSlugs",async()=>{const{websiteShorthand:t,websiteDomain:s}=ye(),n={websiteShorthand:t,websiteDomain:s};return $e.get("/publicAccess/getGlobalRedirectSlugs",n,{success:d=>{this.setState({globalRedirectSlugs:d.data.redirectSlugs})}})});i(this,"getSitemapLinks",async()=>{const{websiteShorthand:t,websiteDomain:s}=ye(),n={websiteShorthand:t,websiteDomain:s,isSitemap:!1};return $e.get("/publicAccess/getSitemap",n,{success:d=>{this.setState({sitemapPaths:d.data.urls||[]})}})});i(this,"initialState",()=>({loading:!0,data:null,websiteStatusCode:null,timeFormatCode:null,activityConfigCode:null,customerPortalEnabled:null,membershipsEnabled:null,sponsorshipsEnabled:null,googleAnalyticsTrackingId:null,faviconInfo:null,websiteUrl:null,websiteName:null,globalRedirectSlugs:[],sitemapPaths:[]}));i(this,"getStateFromWebsiteSettings",t=>({data:this.formatWebsiteData(t),websiteStatusCode:t.websiteStatusCode,timeFormatCode:t.timeFormatCode,activityConfigCode:t.activityConfigCode,customerPortalEnabled:t.customerPortalEnabled,membershipsEnabled:t.membershipsEnabled,sponsorshipsEnabled:t.sponsorshipsEnabled,googleAnalyticsTrackingId:t.googleAnalyticsTrackingId,faviconInfo:t.faviconInfo,websiteUrl:t.websiteUrl,websiteName:t.websiteName,googleTagManagerEnabled:t.googleTagManagerEnabled,hasCustomDomain:t.hasCustomDomain,hasDirectorySorting:t.hasDirectorySorting}));i(this,"formatWebsiteData",t=>{const s=JSON.parse(t.websiteConfig);return s.sitePages.pages=yn(s.sitePages.pages,t.customerPortalEnabled),s});i(this,"loadCSS",()=>{window.__isPrerender||En(this.state.data)});i(this,"setHeaderHeightVariable",()=>{const t=document.querySelector(".navbar.fixed-top");t&&document.body.style.setProperty("--header-height",`${t.offsetHeight}px`)});i(this,"renderRoutes",()=>e.jsx(Gi,{routes:this.state.data.sitePages.pages,privacyPolicy:this.state.data.privacyPolicy,terms:this.state.data.terms,timeFormatCode:this.state.timeFormatCode,eventsEnabled:this.state.activityConfigCode!=="APPOINTMENTS",membershipEnabled:this.state.membershipsEnabled,sponsorshipEnabled:this.state.sponsorshipsEnabled,googleAnalyticsTrackingId:this.state.googleAnalyticsTrackingId,customerPortalEnabled:this.state.customerPortalEnabled,events:this.state.events,originalEvents:this.state.originalEvents,memberEventsEnabled:this.state.memberEventsEnabled,eventTypes:this.state.eventTypes,eventCategories:this.state.eventCategories,timeZoneIANAId:this.state.timeZoneIANAId,timeZoneName:this.state.timeZoneName,tenantWebsiteSettings:this.state,websiteName:this.state.websiteName,websiteFavicon:this.state.faviconInfo.avatarStorageKey,isMemberPortal:this.props.location.pathname.includes(de),globalRedirectSlugs:this.state.globalRedirectSlugs,hasDirectorySorting:this.state.hasDirectorySorting}));this.state=this.initialState()}componentDidMount(){Promise.all([this.getWebsiteSettings(),this.getGlobalRedirectSlugs(),this.getSitemapLinks()]).finally(()=>{this.setState({loading:!1}),un()})}componentDidUpdate(t,s){s.loading&&!this.state.loading&&this.state.data&&this.setHeaderHeightVariable(),s.loading&&!this.state.loading&&pn()}componentWillUnmount(){gn()}render(){var d,o,l,c,b;if(this.state.error)return e.jsx(bn,{error:this.state.error});if(this.state.loading)return e.jsx(J,{fullscreen:!0});if(this.state.websiteStatusCode!==vn.PUBLISHED||this.state.data.error)return e.jsxs(e.Fragment,{children:[e.jsx(us,{children:e.jsx("meta",{name:"prerender-status-code",content:"404"})}),e.jsx(jn,{message:"The page you are looking for doesn't exist or hasn't been published yet.",showActions:!1})]});const t=this.state.data.sitePages.pages.find(g=>g.isMemberPortal);if(this.props.location.pathname.includes(de)&&(!(t!=null&&t.hasSubPages)||!t.pages.some(g=>this.props.location.pathname.includes(g.path))))return this.renderRoutes();const n=window.location.pathname!==Sn&&window.location.pathname!==wn;return e.jsx("div",{className:"tenantWebsite",children:e.jsxs(Cn,{history:this.props.history,children:[e.jsx(sr,{}),e.jsx(Yi,{pages:this.state.data.sitePages.pages,websiteName:this.state.websiteName,faviconStorageKey:(d=this.state.faviconInfo)==null?void 0:d.avatarStorageKey,logoStorageKey:(l=(o=this.state.data.defaults)==null?void 0:o.logoInfo)!=null&&l.isValid?this.state.data.defaults.logoInfo.avatarStorageKey:null,history:this.props.history,googleTagManagerEnabled:this.state.googleTagManagerEnabled,hasCustomDomain:this.state.hasCustomDomain,gtmCode:this.state.data.gtmCode}),n&&e.jsx(gs,{routes:this.state.data.sitePages.pages,defaults:this.state.data.defaults,eventsEnabled:this.state.activityConfigCode!=="APPOINTMENTS",membershipEnabled:this.state.membershipsEnabled,sponsorshipEnabled:this.state.sponsorshipsEnabled,history:this.props.history}),e.jsx("main",{role:"main",children:this.renderRoutes()}),e.jsx(er,{preFooter:this.state.data.preFooter,homeContents:this.state.data.sitePages.pages,membershipEnabled:this.state.membershipsEnabled,sponsorshipEnabled:this.state.sponsorshipsEnabled,pages:this.state.data.sitePages.pages,preview:!1}),n&&e.jsx(tr,{...this.state.data.footer,activePrivacyPolicy:this.state.data.footer.activePrivacyPolicy||((c=this.state.data.privacyPolicy)==null?void 0:c.active),activeTerms:this.state.data.footer.activeTerms||((b=this.state.data.terms)==null?void 0:b.active),defaults:this.state.data.defaults,sitemapPaths:this.state.sitemapPaths})]})})}}export{io as default};
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.