@flarehr/apollo-benefits 2.88.50785 → 2.89.56619

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var Xn=Object.defineProperty;var Jn=(e,n,a)=>n in e?Xn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var y=(e,n,a)=>(Jn(e,typeof n!="symbol"?n+"":n,a),a);import{Q as Ye,t as Zn,v as ea,E as ta,x as na,z as Jt,A as Te,B as aa,C as t,S as ht,D as C,H as Se,I as Le,J as He,K as Xe,L as Zt,M as fe,N as sa,O as ft,P as $,R,U as j,W as ae,X as ra,r as f,p as h,T as ce,F as H,Y as w,Z as at,$ as en,a0 as ia,a1 as ke,a2 as he,w as we,a3 as ca,q as oe,a4 as la,o as oa,a5 as da,a6 as ma,a7 as ua,k as M,a8 as ha,a9 as fa,aa as V,ab as ve,ac as Je,ad as pa,ae as ga,af as ba,ag as ya,ah as wa,ai as Pt,aj as va,ak as ka,al as xa,am as Ce,an as tn,ao as It,ap as nn,aq as Ue,ar as Ve,as as Tt,at as St,au as Na,av as an,aw as Aa,ax as Ca,ay as Pa,az as Ia,aA as Ta,aB as Sa,aC as pt,aD as gt,aE as F,n as La,aF as Ea,aG as sn,aH as Lt,aI as Oa,aJ as Ba,aK as $a,aL as Ra,aM as _a,aN as Ma,aO as Ua,aP as Va,aQ as Da}from"./vendor-1c5ad091.js";import{O as $e}from"./oidc-client-6f6e47c2.js";import{u as Fa,a as ja,S as Wa}from"./@splitsoftware-dc67820b.js";import{f as ue,p as Ha,a as Et}from"./date-fns-20ad091e.js";import{m as Ot}from"./framer-motion-04a96014.js";import{i as za}from"./datadog-52cc8f8a.js";import"./lodash-5d893f8c.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function a(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=a(i);fetch(i.href,r)}})();Ye.prototype.selectCached=function(e,n=a=>null){return this.selectHasCache().pipe(Zn(0),ea(a=>a?ta:na(e()).pipe(Jt(n))))};class D{static setParameters(n,a){this._apiBaseUrl=n,this._jwt=a}static get instance(){return Te(this._apiBaseUrl).headers({Authorization:`Bearer ${this._jwt}`,"X-APP-VERSION":"2.88.50785"}).addon(aa)}}y(D,"_apiBaseUrl"),y(D,"_jwt");class qa extends D{}class se extends D{}class Ae{static setParameters(n,a,s){this._apiBaseUrl=n,this._jwt=a,this._profileId=s}static get instance(){return Te(this._apiBaseUrl).headers({Authorization:`Bearer ${this._jwt}`,"X-PROFILE-ID":this._profileId,"X-APP-VERSION":"2.88.50785"})}}y(Ae,"_apiBaseUrl"),y(Ae,"_jwt"),y(Ae,"_profileId");const Ee=({size:e})=>t("svg",{className:`animate-spin h-${e??5} w-${e??5}`,viewBox:"0 0 24 24",fill:"none",children:[t("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),t("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),Ze=()=>t("div",{className:"flex justify-center items-center h-screen text-primary",children:[t(Ee,{size:5}),t("div",{className:"pl-3 text-xl font-light text-primary",children:"Loading..."})]}),rn="/benefits/app/assets/logo-a34e9b4b.png",Ga=()=>t("div",{className:"flex flex-col justify-center items-center h-screen text-grey-900",children:[t("img",{className:"block h-8 w-auto",src:rn,alt:"Flare Benefits"}),t("h1",{className:"mt-8",children:"You have been successfully logged out of Flare Benefits"})]});var Bt,$t;const ze=["money","mind","body","work","life"];var cn=(e=>(e.WellbeingHub="wellbeing",e.FlareApp="flareMobileApp",e.SalaryPackagingCars="salaryPackagingCars",e.Allowance="allowance",e))(cn||{});const Ka=["default","pba"];function Qa(){return{user:C,config:C,navTab:"benefits",appView:"employee",redirectPath:C,deepLink:C,referrer:C,promotionId:C,mode:"default",isWelcomeModalOpen:!1}}let Ya=(Bt=Se({name:"benefits-app",resettable:!0,producerFn:Le}),Bt($t=class extends ht{constructor(){super(Qa())}})||$t);const P=new Ya;class Xa extends Ye{constructor(a){super(a);y(this,"signedInUser$",this.select(a=>a.user));y(this,"appConfig$",this.select(a=>a.config));y(this,"navPage$",this.select(a=>a.navTab));y(this,"appView$",this.select(a=>a.appView));y(this,"signedInUserRole$",this.select(a=>He.pipe(a.user,Xe(()=>"user",s=>s.benefitsProfile.role))));this.store=a}}const Q=new Xa(P);function T(e,n){return Zt(e,sa(()=>n))}function ln(e){return T(e,null)}function Pe(e,n="Option value is none."){if(fe(e))throw new Error(n);return e.value}function Rt(e,n){return Zt(e,Xe(()=>n===null,a=>a===n))}const Ja=()=>{const e=async()=>{const s=await Te(`${window.location.origin}/benefits/app/config.json`).get().json();P.update({config:ft(s)})},n=()=>Pe(Q.getValue().config);return{fetchConfigAsync:e,getConfig:n,getPublicBackendUrl:()=>n().apiBaseUrl.replace("backend","public")}},_=Ja();function ge(e,n){const a=new URLSearchParams(n);return $(a.get(e))}function st(e,n){const a=new URLSearchParams(n.replace(/^#+/,""));return $(a.get(e))}const dt=e=>{const n=_.getConfig().apiGatewayBaseUrl+"/benefits/app/#";if(e!=null&&e.startsWith(n)||e!=null&&e.startsWith("#"))return e.split("#")[1]};function Za(e,n){return this.replace(e,n||e)}String.prototype.replaceIf=Za;const es=(e,n)=>e==null?void 0:e.replaceIf("${profileId}",n==null?void 0:n.basicProfile.profileId).replaceIf("${accountId}",n==null?void 0:n.basicProfile.accountId).replaceIf("${partnerId}",n==null?void 0:n.basicProfile.partnerId).replaceIf("${customerId}",n==null?void 0:n.basicProfile.customerId);class ts{updateIsWelcomeModalOpen(n){P.update({isWelcomeModalOpen:n})}getIsWelcomeModalOpen(){return P.getValue().isWelcomeModalOpen}getReferrer(){const n=P.getValue().referrer;return R(n)?n.value:void 0}getPromotionId(){const n=P.getValue().promotionId;return R(n)?n.value:void 0}setReferrer(n){P.update({referrer:n})}setPromotionId(n){P.update({promotionId:n})}}const be=new ts,ns=()=>{const e="redirectPath",n="mode",a=r=>{P.update({redirectPath:r})},s=r=>{P.update({deepLink:r})},i=r=>{P.update({mode:r})};return{extractRedirectPath:()=>{const r=ge(e,window.location.search);R(r)&&(a(r),s(r))},extractMode(){const r=ge(n,window.location.search);R(r)&&Ka.includes(r.value)&&i(r.value)},extractTrackingParameters:()=>{const r=ge("referrer",window.location.search),c=ge("promotionId",window.location.search);R(r)&&be.setReferrer(r),R(c)&&be.setPromotionId(c)},redirectToPathIfExists(){const r=Q.getValue().redirectPath;R(r)&&(a(C),j(r.value))}}},De=ns();let on=class{constructor(n){y(this,"_value",C);this.factory=n}get value(){if(R(this._value))return this._value.value;const n=this.factory();return this._value=ft(n),n}};var _t,Mt,z=(e=>(e[e.Unauthorized=0]="Unauthorized",e[e.SignInPending=1]="SignInPending",e[e.Authenticated=2]="Authenticated",e[e.SignOutPending=3]="SignOutPending",e[e.Error=4]="Error",e))(z||{});function as(){return{authStatus:0,jwt:C}}let ss=(_t=Se({name:"authentication",resettable:!0,producerFn:Le}),_t(Mt=class extends ht{constructor(){super(as())}})||Mt);const de=new ss;var Fe=(e=>(e.SignIn="callback",e.SignOut="logout",e.SilentRefresh="silent-refresh",e))(Fe||{});class rs{constructor(){y(this,"userManager");y(this,"tokenQueryParameter","token");y(this,"b2cJwtQueryParameter","b2cJwt");y(this,"profileIdQueryParameter","profileId");y(this,"getHostOidcUrl",()=>`${window.location.origin}/benefits/app/#/oidc`);this.userManager=new on(()=>{const n=new $e.UserManager(this.userManagerSettings());return n.events.addAccessTokenExpired(()=>this.signOutRedirectAsync()),n.events.addUserLoaded(this.sessionUpdatedHandler),this.configureLogging(),n})}async refreshIfExpired(){const n=await this.userManager.value.getUser();n!=null&&n.expired&&this.userManager.value.signinSilent()}tokenExists(n){const a=ge(this.tokenQueryParameter,n);return ae.isSome(a)}b2cJwtExists(n){const a=st(this.b2cJwtQueryParameter,n);return ae.isSome(a)}isOidcRoute(n){return n.includes("callback")||n.includes("logout")||n.includes("silent-refresh")}async initFromB2cJwt(n,a){const s=Pe(st(this.b2cJwtQueryParameter,a),`"${this.b2cJwtQueryParameter}" fragment is required`),i=Pe(st(this.profileIdQueryParameter,a),`"${this.profileIdQueryParameter}" fragment is required`);Ae.setParameters(_.getConfig().workplaceBackendUrl,s,i);const r=await Ae.instance.url("token").get().json();window.location.href=n+"?token="+r.token}async initFromToken(n,a){if(this.isOidcRoute(n))return;const s=ge(this.tokenQueryParameter,a);if(ae.isNone(s))throw de.update({authStatus:z.Error}),Error(`"${this.tokenQueryParameter}" URL query parameter is required`);await this.signInRedirectAsync(s)}signOutRedirectAsync(){return de.update({authStatus:z.SignOutPending}),this.userManager.value.signoutRedirect()}async signInRedirectCallbackAsync(){await this.userManager.value.signinRedirectCallback(window.location.href.replace("/oidc/callback?","")),de.update({authStatus:z.Authenticated})}async signOutRedirectCallbackAsync(){await this.userManager.value.signoutRedirectCallback(),ra()}async silentRefreshCallbackAsync(){await this.userManager.value.signinSilentCallback()}async signOut(){return de.update({authStatus:z.Unauthorized,jwt:ae.none})}async signInRedirectAsync(n){de.update({authStatus:z.SignInPending}),await this.userManager.value.signinRedirect({extraQueryParams:{irt:n.value}})}sessionUpdatedHandler(n){de.update({jwt:ae.fromNullable(n.access_token)})}userManagerSettings(){return{authority:_.getConfig().oidcAuthority,client_id:"apollo-benefits-ui",redirect_uri:`${this.getHostOidcUrl()}/callback?`,response_type:"id_token token",scope:"openid",post_logout_redirect_uri:`${this.getHostOidcUrl()}/logout?`,silent_redirect_uri:`${this.getHostOidcUrl()}/silent-refresh?`,automaticSilentRenew:!0,accessTokenExpiringNotificationTime:10,filterProtocolClaims:!0,loadUserInfo:!0,clockSkew:2592e3}}configureLogging(){$e.Log.logger=console,$e.Log.level=$e.Log.DEBUG}}const G=new rs,is=({mode:e})=>{const[n,a]=f(!1);return h(()=>{(async()=>{switch(e){case Fe.SignIn:await G.signInRedirectCallbackAsync(),window.location.hash="#",j("/"),De.redirectToPathIfExists();break;case Fe.SignOut:await G.signOutRedirectCallbackAsync(),a(!0);break;case Fe.SilentRefresh:await G.silentRefreshCallbackAsync();break}})()},[]),n?t(Ga,{}):t(Ze,{})},cs=({fragment:e})=>(h(()=>{(async()=>await G.initFromB2cJwt(window.location.pathname,e))()},[]),t(Ze,{}));class ls extends Ye{constructor(a){super(a);y(this,"authState$",this.select());this.store=a}get isUnauthorized(){return this.getValue().authStatus===z.Unauthorized||this.getValue().authStatus===z.Error}get isAuthorized(){return this.getValue().authStatus===z.Authenticated}get jwt(){const a=this.getValue().jwt;return R(a)?a.value:""}}const dn=new ls(de);class os{constructor(){y(this,"_isLocked");y(this,"queue");y(this,"lock",n=>{this._isLocked=!0,setTimeout(this.unlockAndFlushQueue,n)});y(this,"unlockAndFlushQueue",async()=>{this._isLocked=!1,await Promise.all(this.queue.map(n=>D.instance.url("benefits/track-event").post(n).res())),this.queue=[]});this._isLocked=!1,this.queue=[]}async postTrackEventAsync(n){return this.isLocked?(this.queue.push(n),Promise.resolve()):D.instance.url("benefits/track-event").post(n).res()}get isLocked(){return this._isLocked}}const qe=new os,Ut=e=>{switch(e){case"cars-calculator-gated":case"cars-calculator-ungated":return"cars-calculator";case"typeform":return"typeform";case"external-link":case"activity-advertisement":return"advertisement";case void 0:return"unknown";default:return e}};class mn{constructor(n){y(this,"trackEventAsync");this.trackEventAsync=n}async trackAppLoadedAsync(){return this.trackEventAsync("appLoaded")}async trackBenefitsOpenedAsync(){return this.trackEventAsync("benefitsOpened")}async trackAppOfferViewedAsync(){return this.trackEventAsync("appOfferViewed")}async trackAppOfferAcceptedAsync(){return this.trackEventAsync("appOfferAccepted")}async trackWellbeingOpenedAsync(){return this.trackEventAsync("wellbeingOpened")}async trackAdminOpenedAsync(){return this.trackEventAsync("adminOpened")}async trackConsentStartedAsync(){return this.trackEventAsync("consentStarted")}async trackConsentCompletedAsync(){return this.trackEventAsync("consentCompleted")}async trackRegistrationStartedAsync(){return this.trackEventAsync("registrationStarted")}async trackRegistrationSubmittedAsync(){return this.trackEventAsync("registrationSubmitted")}async trackRegistrationResentAsync(){return this.trackEventAsync("registrationResent")}async trackRegistrationVerifiedAsync(){return this.trackEventAsync("registrationVerified")}async trackRegistrationFailedAsync(n){return this.trackEventAsync({registrationFailed:{reason:n}})}async trackRegistrationCompletedAsync(){return this.trackEventAsync("registrationCompleted")}async trackRegistrationErrorViewedAsync(n){return this.trackEventAsync({registrationErrorViewed:{reason:n}})}async trackRegistrationErrorDismissedAsync(){return this.trackEventAsync("registrationErrorDismissed")}async trackMarketplaceOfferViewedAsync(n,a,s){const i={offer:n,experiment:a,treatment:s};return this.trackEventAsync({marketplaceOfferViewed:i})}async trackMarketplaceOfferAcceptedAsync(n,a,s){const i={offer:n,experiment:a,treatment:s};return this.trackEventAsync({marketplaceOfferAccepted:i})}async trackPerksListViewedAsync(n){const a={pillar:n};return this.trackEventAsync({perksListViewed:a})}async trackEntriesListViewedAsync(n){const a={pillar:n};return this.trackEventAsync({entriesListViewed:a})}async trackFeaturePerkViewedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title,placement:"feature"};return this.trackEventAsync({perkViewed:s})}async trackExplorePerkViewedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title,placement:"explore"};return this.trackEventAsync({perkViewed:s})}async trackDocumentClickedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title,type:"document"};return this.trackEventAsync({attachmentOpened:s})}async trackPerkVisitedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title};return this.trackEventAsync({perkVisited:s})}async trackPerksListSearched(n){const a={query:n};return this.trackEventAsync({perksListSearched:a})}async trackRoleAssignedAsync(n){return this.trackEventAsync({roleAssigned:n})}async trackEntryViewed(n){return this.trackEventAsync({entryViewed:n})}async trackEntriesListSearchedAsync(n){const a={query:n};return this.trackEventAsync({entriesListSearched:a})}async trackCategoryOpenedAsync(n,a){const s={categoryId:n,categoryName:a};return this.trackEventAsync({categoryOpened:s})}async trackCategoryClosedAsync(n,a,s){const i={categoryId:n,categoryName:a,screen:s};return this.trackEventAsync({categoryClosed:i})}async trackDiscountsOpenedAsync(n,a){const s={categoryId:n,categoryName:a};return this.trackEventAsync({discountsOpened:s})}async trackActivityActionedAsync(n,a,s,i){i==="external-link"?this.trackActivityCompletedAsync(n,a,s,i):this.trackActivityStartedAsync(n,a,s,i)}async trackActivityStartedAsync(n,a,s,i){const r={categoryId:n,id:a,name:s,type:Ut(i)};return this.trackEventAsync({activityStarted:r})}async trackActivityCompletedAsync(n,a,s,i){const r={categoryId:n,id:a,name:s,type:Ut(i)};return this.trackEventAsync({activityCompleted:r})}async trackBenefitsPlanViewedAsync(n){const a={categories:n};return this.trackEventAsync({benefitsPlanViewed:a})}async trackDeepLinkOpenedAsync(n){const a={link:n};return this.trackEventAsync({deepLinkOpened:a})}async trackPromotionViewedAsync(n,a,s,i){return this.trackEventAsync({promotionViewed:{promotionId:n,location:a,categoryId:s,categoryName:i}})}async trackPromotionSelectedAsync(n,a,s,i,r){return this.trackEventAsync({promotionSelected:{promotionId:n,location:a,categoryId:s,categoryName:i,targetUrl:r}})}}const ds=async e=>{try{await qe.postTrackEventAsync({event:e,treatments:[]})}catch{return}},mt=new mn(ds);var J=(e=>(e.Consent="apollo-benefits-consent",e.CustomerRegistration="apollo-benefits-customer-registration",e))(J||{});const ms=e=>{if(e){const n=[];return Object.values(J).map(a=>{var s;n.push({featureFlag:a,treatment:(s=e[a])==null?void 0:s.treatment})}),n}return[]},O=()=>{const[e,n]=f(),{isReady:a,client:s}=Fa(),[i,r]=f(mt);h(()=>{(async()=>{if(a){s==null||s.setMaxListeners(30);const l=s==null?void 0:s.getTreatmentsWithConfig(Object.values(J)),m=ms(l);n(m)}})()},[a]);const c=ce(async l=>{try{await qe.postTrackEventAsync({event:l,treatments:e||[],referrer:be.getReferrer(),promotionId:be.getPromotionId(),path:window.location.hash})}catch{return}},[e]);return h(()=>{r(new mn(c))},[c]),{service:i}};const us="/benefits/app/assets/external_link-599a0aec.svg";function Y(...e){return e.filter(Boolean).join(" ")}const hs=e=>`${e[0].toUpperCase()}${e.slice(1)}`,fs="/customer-storecards/workplace-backend/v1.0/shopify-url",ps=async(e,n)=>(await Te(_.getConfig().apolloBaseUrl).url(fs).headers({Authorization:`Bearer ${e}`,"X-PROFILE-ID":n}).get().json()).redirectUrl,un=async(e,n)=>{let a=null;try{a=window.open("","_blank");const s=await ps(e,n);a&&(a.location.href=s)}catch{a&&(a==null||a.close())}},Vt=({user:{featureFlags:e,basicProfile:n,workplaceLinkConfig:a}})=>{const[s,i]=f(C),{service:r}=O(),c=!!(a!=null&&a.workplaceBackendToken),l=H(()=>{const o=new Map([["benefits","/"]]);return e.wellbeing&&o.set("wellbeing","/wellbeing-hub"),Array.from(o)},[]);h(()=>{const o=[Q.navPage$.subscribe(g=>{i($(g))})];return()=>{o.map(g=>g.unsubscribe())}},[]);const m=async()=>{r.trackDiscountsOpenedAsync("discounts","Discounts"),await un(a.workplaceBackendToken,n.profileId)};return t("nav",{className:"-mb-px flex","aria-label":"Tabs",children:[l.map(([o,g])=>t("div",{onClick:async()=>{i($(o)),j(g)},className:Y(Rt(s,o)?"border-primary text-primary":"border-transparent text-gray-500","cursor-pointer hover:text-gray-700 hover:border-gray-300 px-4 md:ml-4 flex-grow md:flex-grow-0","py-4 text-center border-b-4 text-base leading-6 font-semibold cursor-pointer capitalize"),"aria-current":Rt(s,o)?"page":void 0,children:t("span",{children:o})},o)),t("div",{className:`border-transparent text-gray-500 cursor-pointer hover:text-gray-700 hover:border-gray-300 px-4 md:ml-4
1
+ var Xn=Object.defineProperty;var Jn=(e,n,a)=>n in e?Xn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var y=(e,n,a)=>(Jn(e,typeof n!="symbol"?n+"":n,a),a);import{Q as Ye,t as Zn,v as ea,E as ta,x as na,z as Jt,A as Te,B as aa,C as t,S as ht,D as C,H as Se,I as Le,J as He,K as Xe,L as Zt,M as fe,N as sa,O as ft,P as $,R,U as j,W as ae,X as ra,r as f,p as h,T as ce,F as H,Y as w,Z as at,$ as en,a0 as ia,a1 as ke,a2 as he,w as we,a3 as ca,q as oe,a4 as la,o as oa,a5 as da,a6 as ma,a7 as ua,k as M,a8 as ha,a9 as fa,aa as V,ab as ve,ac as Je,ad as pa,ae as ga,af as ba,ag as ya,ah as wa,ai as Pt,aj as va,ak as ka,al as xa,am as Ce,an as tn,ao as It,ap as nn,aq as Ue,ar as Ve,as as Tt,at as St,au as Na,av as an,aw as Aa,ax as Ca,ay as Pa,az as Ia,aA as Ta,aB as Sa,aC as pt,aD as gt,aE as F,n as La,aF as Ea,aG as sn,aH as Lt,aI as Oa,aJ as Ba,aK as $a,aL as Ra,aM as _a,aN as Ma,aO as Ua,aP as Va,aQ as Da}from"./vendor-1c5ad091.js";import{O as $e}from"./oidc-client-6f6e47c2.js";import{u as Fa,a as ja,S as Wa}from"./@splitsoftware-dc67820b.js";import{f as ue,p as Ha,a as Et}from"./date-fns-20ad091e.js";import{m as Ot}from"./framer-motion-04a96014.js";import{i as za}from"./datadog-c27a43eb.js";import"./lodash-5d893f8c.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function a(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=a(i);fetch(i.href,r)}})();Ye.prototype.selectCached=function(e,n=a=>null){return this.selectHasCache().pipe(Zn(0),ea(a=>a?ta:na(e()).pipe(Jt(n))))};class D{static setParameters(n,a){this._apiBaseUrl=n,this._jwt=a}static get instance(){return Te(this._apiBaseUrl).headers({Authorization:`Bearer ${this._jwt}`,"X-APP-VERSION":"2.89.56619"}).addon(aa)}}y(D,"_apiBaseUrl"),y(D,"_jwt");class qa extends D{}class se extends D{}class Ae{static setParameters(n,a,s){this._apiBaseUrl=n,this._jwt=a,this._profileId=s}static get instance(){return Te(this._apiBaseUrl).headers({Authorization:`Bearer ${this._jwt}`,"X-PROFILE-ID":this._profileId,"X-APP-VERSION":"2.89.56619"})}}y(Ae,"_apiBaseUrl"),y(Ae,"_jwt"),y(Ae,"_profileId");const Ee=({size:e})=>t("svg",{className:`animate-spin h-${e??5} w-${e??5}`,viewBox:"0 0 24 24",fill:"none",children:[t("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),t("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),Ze=()=>t("div",{className:"flex justify-center items-center h-screen text-primary",children:[t(Ee,{size:5}),t("div",{className:"pl-3 text-xl font-light text-primary",children:"Loading..."})]}),rn="/benefits/app/assets/logo-a34e9b4b.png",Ga=()=>t("div",{className:"flex flex-col justify-center items-center h-screen text-grey-900",children:[t("img",{className:"block h-8 w-auto",src:rn,alt:"Flare Benefits"}),t("h1",{className:"mt-8",children:"You have been successfully logged out of Flare Benefits"})]});var Bt,$t;const ze=["money","mind","body","work","life"];var cn=(e=>(e.WellbeingHub="wellbeing",e.FlareApp="flareMobileApp",e.SalaryPackagingCars="salaryPackagingCars",e.Allowance="allowance",e))(cn||{});const Ka=["default","pba"];function Qa(){return{user:C,config:C,navTab:"benefits",appView:"employee",redirectPath:C,deepLink:C,referrer:C,promotionId:C,mode:"default",isWelcomeModalOpen:!1}}let Ya=(Bt=Se({name:"benefits-app",resettable:!0,producerFn:Le}),Bt($t=class extends ht{constructor(){super(Qa())}})||$t);const P=new Ya;class Xa extends Ye{constructor(a){super(a);y(this,"signedInUser$",this.select(a=>a.user));y(this,"appConfig$",this.select(a=>a.config));y(this,"navPage$",this.select(a=>a.navTab));y(this,"appView$",this.select(a=>a.appView));y(this,"signedInUserRole$",this.select(a=>He.pipe(a.user,Xe(()=>"user",s=>s.benefitsProfile.role))));this.store=a}}const Q=new Xa(P);function T(e,n){return Zt(e,sa(()=>n))}function ln(e){return T(e,null)}function Pe(e,n="Option value is none."){if(fe(e))throw new Error(n);return e.value}function Rt(e,n){return Zt(e,Xe(()=>n===null,a=>a===n))}const Ja=()=>{const e=async()=>{const s=await Te(`${window.location.origin}/benefits/app/config.json`).get().json();P.update({config:ft(s)})},n=()=>Pe(Q.getValue().config);return{fetchConfigAsync:e,getConfig:n,getPublicBackendUrl:()=>n().apiBaseUrl.replace("backend","public")}},_=Ja();function ge(e,n){const a=new URLSearchParams(n);return $(a.get(e))}function st(e,n){const a=new URLSearchParams(n.replace(/^#+/,""));return $(a.get(e))}const dt=e=>{const n=_.getConfig().apiGatewayBaseUrl+"/benefits/app/#";if(e!=null&&e.startsWith(n)||e!=null&&e.startsWith("#"))return e.split("#")[1]};function Za(e,n){return this.replace(e,n||e)}String.prototype.replaceIf=Za;const es=(e,n)=>e==null?void 0:e.replaceIf("${profileId}",n==null?void 0:n.basicProfile.profileId).replaceIf("${accountId}",n==null?void 0:n.basicProfile.accountId).replaceIf("${partnerId}",n==null?void 0:n.basicProfile.partnerId).replaceIf("${customerId}",n==null?void 0:n.basicProfile.customerId);class ts{updateIsWelcomeModalOpen(n){P.update({isWelcomeModalOpen:n})}getIsWelcomeModalOpen(){return P.getValue().isWelcomeModalOpen}getReferrer(){const n=P.getValue().referrer;return R(n)?n.value:void 0}getPromotionId(){const n=P.getValue().promotionId;return R(n)?n.value:void 0}setReferrer(n){P.update({referrer:n})}setPromotionId(n){P.update({promotionId:n})}}const be=new ts,ns=()=>{const e="redirectPath",n="mode",a=r=>{P.update({redirectPath:r})},s=r=>{P.update({deepLink:r})},i=r=>{P.update({mode:r})};return{extractRedirectPath:()=>{const r=ge(e,window.location.search);R(r)&&(a(r),s(r))},extractMode(){const r=ge(n,window.location.search);R(r)&&Ka.includes(r.value)&&i(r.value)},extractTrackingParameters:()=>{const r=ge("referrer",window.location.search),c=ge("promotionId",window.location.search);R(r)&&be.setReferrer(r),R(c)&&be.setPromotionId(c)},redirectToPathIfExists(){const r=Q.getValue().redirectPath;R(r)&&(a(C),j(r.value))}}},De=ns();let on=class{constructor(n){y(this,"_value",C);this.factory=n}get value(){if(R(this._value))return this._value.value;const n=this.factory();return this._value=ft(n),n}};var _t,Mt,z=(e=>(e[e.Unauthorized=0]="Unauthorized",e[e.SignInPending=1]="SignInPending",e[e.Authenticated=2]="Authenticated",e[e.SignOutPending=3]="SignOutPending",e[e.Error=4]="Error",e))(z||{});function as(){return{authStatus:0,jwt:C}}let ss=(_t=Se({name:"authentication",resettable:!0,producerFn:Le}),_t(Mt=class extends ht{constructor(){super(as())}})||Mt);const de=new ss;var Fe=(e=>(e.SignIn="callback",e.SignOut="logout",e.SilentRefresh="silent-refresh",e))(Fe||{});class rs{constructor(){y(this,"userManager");y(this,"tokenQueryParameter","token");y(this,"b2cJwtQueryParameter","b2cJwt");y(this,"profileIdQueryParameter","profileId");y(this,"getHostOidcUrl",()=>`${window.location.origin}/benefits/app/#/oidc`);this.userManager=new on(()=>{const n=new $e.UserManager(this.userManagerSettings());return n.events.addAccessTokenExpired(()=>this.signOutRedirectAsync()),n.events.addUserLoaded(this.sessionUpdatedHandler),this.configureLogging(),n})}async refreshIfExpired(){const n=await this.userManager.value.getUser();n!=null&&n.expired&&this.userManager.value.signinSilent()}tokenExists(n){const a=ge(this.tokenQueryParameter,n);return ae.isSome(a)}b2cJwtExists(n){const a=st(this.b2cJwtQueryParameter,n);return ae.isSome(a)}isOidcRoute(n){return n.includes("callback")||n.includes("logout")||n.includes("silent-refresh")}async initFromB2cJwt(n,a){const s=Pe(st(this.b2cJwtQueryParameter,a),`"${this.b2cJwtQueryParameter}" fragment is required`),i=Pe(st(this.profileIdQueryParameter,a),`"${this.profileIdQueryParameter}" fragment is required`);Ae.setParameters(_.getConfig().workplaceBackendUrl,s,i);const r=await Ae.instance.url("token").get().json();window.location.href=n+"?token="+r.token}async initFromToken(n,a){if(this.isOidcRoute(n))return;const s=ge(this.tokenQueryParameter,a);if(ae.isNone(s))throw de.update({authStatus:z.Error}),Error(`"${this.tokenQueryParameter}" URL query parameter is required`);await this.signInRedirectAsync(s)}signOutRedirectAsync(){return de.update({authStatus:z.SignOutPending}),this.userManager.value.signoutRedirect()}async signInRedirectCallbackAsync(){await this.userManager.value.signinRedirectCallback(window.location.href.replace("/oidc/callback?","")),de.update({authStatus:z.Authenticated})}async signOutRedirectCallbackAsync(){await this.userManager.value.signoutRedirectCallback(),ra()}async silentRefreshCallbackAsync(){await this.userManager.value.signinSilentCallback()}async signOut(){return de.update({authStatus:z.Unauthorized,jwt:ae.none})}async signInRedirectAsync(n){de.update({authStatus:z.SignInPending}),await this.userManager.value.signinRedirect({extraQueryParams:{irt:n.value}})}sessionUpdatedHandler(n){de.update({jwt:ae.fromNullable(n.access_token)})}userManagerSettings(){return{authority:_.getConfig().oidcAuthority,client_id:"apollo-benefits-ui",redirect_uri:`${this.getHostOidcUrl()}/callback?`,response_type:"id_token token",scope:"openid",post_logout_redirect_uri:`${this.getHostOidcUrl()}/logout?`,silent_redirect_uri:`${this.getHostOidcUrl()}/silent-refresh?`,automaticSilentRenew:!0,accessTokenExpiringNotificationTime:10,filterProtocolClaims:!0,loadUserInfo:!0,clockSkew:2592e3}}configureLogging(){$e.Log.logger=console,$e.Log.level=$e.Log.DEBUG}}const G=new rs,is=({mode:e})=>{const[n,a]=f(!1);return h(()=>{(async()=>{switch(e){case Fe.SignIn:await G.signInRedirectCallbackAsync(),window.location.hash="#",j("/"),De.redirectToPathIfExists();break;case Fe.SignOut:await G.signOutRedirectCallbackAsync(),a(!0);break;case Fe.SilentRefresh:await G.silentRefreshCallbackAsync();break}})()},[]),n?t(Ga,{}):t(Ze,{})},cs=({fragment:e})=>(h(()=>{(async()=>await G.initFromB2cJwt(window.location.pathname,e))()},[]),t(Ze,{}));class ls extends Ye{constructor(a){super(a);y(this,"authState$",this.select());this.store=a}get isUnauthorized(){return this.getValue().authStatus===z.Unauthorized||this.getValue().authStatus===z.Error}get isAuthorized(){return this.getValue().authStatus===z.Authenticated}get jwt(){const a=this.getValue().jwt;return R(a)?a.value:""}}const dn=new ls(de);class os{constructor(){y(this,"_isLocked");y(this,"queue");y(this,"lock",n=>{this._isLocked=!0,setTimeout(this.unlockAndFlushQueue,n)});y(this,"unlockAndFlushQueue",async()=>{this._isLocked=!1,await Promise.all(this.queue.map(n=>D.instance.url("benefits/track-event").post(n).res())),this.queue=[]});this._isLocked=!1,this.queue=[]}async postTrackEventAsync(n){return this.isLocked?(this.queue.push(n),Promise.resolve()):D.instance.url("benefits/track-event").post(n).res()}get isLocked(){return this._isLocked}}const qe=new os,Ut=e=>{switch(e){case"cars-calculator-gated":case"cars-calculator-ungated":return"cars-calculator";case"typeform":return"typeform";case"external-link":case"activity-advertisement":return"advertisement";case void 0:return"unknown";default:return e}};class mn{constructor(n){y(this,"trackEventAsync");this.trackEventAsync=n}async trackAppLoadedAsync(){return this.trackEventAsync("appLoaded")}async trackBenefitsOpenedAsync(){return this.trackEventAsync("benefitsOpened")}async trackAppOfferViewedAsync(){return this.trackEventAsync("appOfferViewed")}async trackAppOfferAcceptedAsync(){return this.trackEventAsync("appOfferAccepted")}async trackWellbeingOpenedAsync(){return this.trackEventAsync("wellbeingOpened")}async trackAdminOpenedAsync(){return this.trackEventAsync("adminOpened")}async trackConsentStartedAsync(){return this.trackEventAsync("consentStarted")}async trackConsentCompletedAsync(){return this.trackEventAsync("consentCompleted")}async trackRegistrationStartedAsync(){return this.trackEventAsync("registrationStarted")}async trackRegistrationSubmittedAsync(){return this.trackEventAsync("registrationSubmitted")}async trackRegistrationResentAsync(){return this.trackEventAsync("registrationResent")}async trackRegistrationVerifiedAsync(){return this.trackEventAsync("registrationVerified")}async trackRegistrationFailedAsync(n){return this.trackEventAsync({registrationFailed:{reason:n}})}async trackRegistrationCompletedAsync(){return this.trackEventAsync("registrationCompleted")}async trackRegistrationErrorViewedAsync(n){return this.trackEventAsync({registrationErrorViewed:{reason:n}})}async trackRegistrationErrorDismissedAsync(){return this.trackEventAsync("registrationErrorDismissed")}async trackMarketplaceOfferViewedAsync(n,a,s){const i={offer:n,experiment:a,treatment:s};return this.trackEventAsync({marketplaceOfferViewed:i})}async trackMarketplaceOfferAcceptedAsync(n,a,s){const i={offer:n,experiment:a,treatment:s};return this.trackEventAsync({marketplaceOfferAccepted:i})}async trackPerksListViewedAsync(n){const a={pillar:n};return this.trackEventAsync({perksListViewed:a})}async trackEntriesListViewedAsync(n){const a={pillar:n};return this.trackEventAsync({entriesListViewed:a})}async trackFeaturePerkViewedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title,placement:"feature"};return this.trackEventAsync({perkViewed:s})}async trackExplorePerkViewedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title,placement:"explore"};return this.trackEventAsync({perkViewed:s})}async trackDocumentClickedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title,type:"document"};return this.trackEventAsync({attachmentOpened:s})}async trackPerkVisitedAsync({benefitId:n,benefit:a}){const s={perkId:n,perkPillar:a.category,perkTitle:a.title};return this.trackEventAsync({perkVisited:s})}async trackPerksListSearched(n){const a={query:n};return this.trackEventAsync({perksListSearched:a})}async trackRoleAssignedAsync(n){return this.trackEventAsync({roleAssigned:n})}async trackEntryViewed(n){return this.trackEventAsync({entryViewed:n})}async trackEntriesListSearchedAsync(n){const a={query:n};return this.trackEventAsync({entriesListSearched:a})}async trackCategoryOpenedAsync(n,a){const s={categoryId:n,categoryName:a};return this.trackEventAsync({categoryOpened:s})}async trackCategoryClosedAsync(n,a,s){const i={categoryId:n,categoryName:a,screen:s};return this.trackEventAsync({categoryClosed:i})}async trackDiscountsOpenedAsync(n,a){const s={categoryId:n,categoryName:a};return this.trackEventAsync({discountsOpened:s})}async trackActivityActionedAsync(n,a,s,i){i==="external-link"?this.trackActivityCompletedAsync(n,a,s,i):this.trackActivityStartedAsync(n,a,s,i)}async trackActivityStartedAsync(n,a,s,i){const r={categoryId:n,id:a,name:s,type:Ut(i)};return this.trackEventAsync({activityStarted:r})}async trackActivityCompletedAsync(n,a,s,i){const r={categoryId:n,id:a,name:s,type:Ut(i)};return this.trackEventAsync({activityCompleted:r})}async trackBenefitsPlanViewedAsync(n){const a={categories:n};return this.trackEventAsync({benefitsPlanViewed:a})}async trackDeepLinkOpenedAsync(n){const a={link:n};return this.trackEventAsync({deepLinkOpened:a})}async trackPromotionViewedAsync(n,a,s,i){return this.trackEventAsync({promotionViewed:{promotionId:n,location:a,categoryId:s,categoryName:i}})}async trackPromotionSelectedAsync(n,a,s,i,r){return this.trackEventAsync({promotionSelected:{promotionId:n,location:a,categoryId:s,categoryName:i,targetUrl:r}})}}const ds=async e=>{try{await qe.postTrackEventAsync({event:e,treatments:[]})}catch{return}},mt=new mn(ds);var J=(e=>(e.Consent="apollo-benefits-consent",e.CustomerRegistration="apollo-benefits-customer-registration",e))(J||{});const ms=e=>{if(e){const n=[];return Object.values(J).map(a=>{var s;n.push({featureFlag:a,treatment:(s=e[a])==null?void 0:s.treatment})}),n}return[]},O=()=>{const[e,n]=f(),{isReady:a,client:s}=Fa(),[i,r]=f(mt);h(()=>{(async()=>{if(a){s==null||s.setMaxListeners(30);const l=s==null?void 0:s.getTreatmentsWithConfig(Object.values(J)),m=ms(l);n(m)}})()},[a]);const c=ce(async l=>{try{await qe.postTrackEventAsync({event:l,treatments:e||[],referrer:be.getReferrer(),promotionId:be.getPromotionId(),path:window.location.hash})}catch{return}},[e]);return h(()=>{r(new mn(c))},[c]),{service:i}};const us="/benefits/app/assets/external_link-599a0aec.svg";function Y(...e){return e.filter(Boolean).join(" ")}const hs=e=>`${e[0].toUpperCase()}${e.slice(1)}`,fs="/customer-storecards/workplace-backend/v1.0/shopify-url",ps=async(e,n)=>(await Te(_.getConfig().apolloBaseUrl).url(fs).headers({Authorization:`Bearer ${e}`,"X-PROFILE-ID":n}).get().json()).redirectUrl,un=async(e,n)=>{let a=null;try{a=window.open("","_blank");const s=await ps(e,n);a&&(a.location.href=s)}catch{a&&(a==null||a.close())}},Vt=({user:{featureFlags:e,basicProfile:n,workplaceLinkConfig:a}})=>{const[s,i]=f(C),{service:r}=O(),c=!!(a!=null&&a.workplaceBackendToken),l=H(()=>{const o=new Map([["benefits","/"]]);return e.wellbeing&&o.set("wellbeing","/wellbeing-hub"),Array.from(o)},[]);h(()=>{const o=[Q.navPage$.subscribe(g=>{i($(g))})];return()=>{o.map(g=>g.unsubscribe())}},[]);const m=async()=>{r.trackDiscountsOpenedAsync("discounts","Discounts"),await un(a.workplaceBackendToken,n.profileId)};return t("nav",{className:"-mb-px flex","aria-label":"Tabs",children:[l.map(([o,g])=>t("div",{onClick:async()=>{i($(o)),j(g)},className:Y(Rt(s,o)?"border-primary text-primary":"border-transparent text-gray-500","cursor-pointer hover:text-gray-700 hover:border-gray-300 px-4 md:ml-4 flex-grow md:flex-grow-0","py-4 text-center border-b-4 text-base leading-6 font-semibold cursor-pointer capitalize"),"aria-current":Rt(s,o)?"page":void 0,children:t("span",{children:o})},o)),t("div",{className:`border-transparent text-gray-500 cursor-pointer hover:text-gray-700 hover:border-gray-300 px-4 md:ml-4
2
2
  flex-grow md:flex-grow-0 py-4 text-center border-b-4 text-base
3
3
  leading-6 font-semibold capitalize ${c?"":"hidden"}`,children:t("button",{className:"inline-flex",onClick:()=>{m()},children:[t("span",{children:"Discounts"}),t("img",{className:"ml-2",src:us})]})})]})},gs=()=>{const[e,n]=f("employee");return h(()=>{const a=[Q.appView$.subscribe(n)];return()=>{a.map(s=>s.unsubscribe())}},[]),t("span",{className:"relative z-0 inline-flex shadow-sm rounded-md",children:[t("button",{type:"button",className:Y(e==="admin"?"text-primary bg-white cursor-default":"text-gray-700 bg-gray-50","relative inline-flex items-center px-4 py-1 rounded-l-md border border-gray-300 text-sm font-medium hover:bg-white focus:z-10 focus:outline-none"),onClick:()=>{e!=="admin"&&j("/admin")},children:"Admin view"}),t("button",{type:"button",className:Y(e==="employee"?"text-primary bg-white cursor-default":"text-gray-700 bg-gray-50","-ml-px relative inline-flex items-center px-4 py-1 rounded-r-md border border-gray-300 text-sm font-medium hover:bg-white focus:z-10 focus:outline-none"),onClick:()=>{e!=="employee"&&j("/")},children:"Employee view"})]})},bs=[{name:"Admin view",href:"#/admin"},{name:"Employee view",href:"#/"}],hn=()=>t("span",{className:"inline-block h-8 w-8 rounded-full overflow-hidden bg-white border",children:t("svg",{className:"h-full w-full text-gray-300",fill:"currentColor",viewBox:"0 0 24 24",children:t("path",{d:"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"})})}),ys=({user:e})=>t(w,{children:t(ke,{as:"div","data-dd-action-name":"User menu",className:"z-30 relative inline-block text-left",children:({open:n})=>t(w,{children:[t("div",{children:t(ke.Button,{className:`max-w-xs bg-white flex items-center text-sm rounded-full hover:outline-none hover:ring-2 hover:ring-offset-2 hover:ring-primary ${n?"outline-none ring-2 ring-offset-2 ring-primary":""} `,children:t(hn,{})})}),t(he,{enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:t(ke.Items,{className:"absolute right-0 mt-2 w-56 divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:t("div",{className:"px-1 py-1 ",children:[t(ke.Item,{children:()=>t("div",{className:"mx-3 py-2",children:[t("div",{className:"text-base font-medium text-gray-800 dd-privacy-mask",children:e.basicProfile.firstName}),t("div",{className:"text-sm font-medium text-gray-500 dd-privacy-mask",children:e.basicProfile.email})]})}),t("div",{className:"border-t border-grey-900",children:t(ke.Item,{children:({active:a})=>t("button",{onClick:()=>G.signOutRedirectAsync(),className:`${a?"bg-secondary text-primary rounded-md":"text-gray-900 "} group flex w-full items-center mt-2 mb-1 px-3 py-2 text-sm font-medium`,children:"Logout"})})})]})})})]})})}),bt=e=>{const n=e.user;if(fe(n))return t(w,{});const[a,s]=f(!1),i=n.value.benefitsProfile.role!=="user";return h(()=>{const r=[Q.appView$.subscribe(c=>{s(c==="employee")})];return()=>{r.map(c=>c.unsubscribe())}},[]),t(w,{children:t(at,{as:"nav",className:"bg-gray-50 border-0 md:border-b md:border-gray-200",children:({open:r})=>t(w,{children:[t("div",{className:`mx-auto px-4 sm:px-6 lg:px-8 border-b border-gray-200 md:border-none ${i&&!a?"":"max-w-[90rem]"}`,children:t("div",{className:"flex justify-between h-16",children:[t("div",{className:"flex",children:t("a",{href:"#",onClick:()=>j("/"),className:"flex-shrink-0 flex items-center",children:t("img",{className:"block h-8 w-auto",src:rn,alt:"Flare Benefits"})})}),t("div",{className:"ml-10 flex flex-wrap flex-grow content-end",children:t("div",{className:"hidden sm:block",children:a&&t(Vt,{user:n.value})})}),t("div",{className:"flex flex-wrap content-center",children:t("div",{className:"hidden md:block",children:i&&t(gs,{})})}),t("div",{className:"hidden md:ml-6 md:flex md:items-center",children:t(ys,{user:n.value})}),t("div",{className:"-mr-2 flex items-center md:hidden",children:t(at.Button,{className:"bg-white inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary",children:[t("span",{className:"sr-only",children:"Open main menu"}),r?t(en,{className:"block h-6 w-6","aria-hidden":"true"}):t(ia,{className:"block h-6 w-6","aria-hidden":"true"})]})})]})}),t(at.Panel,{className:"md:hidden",children:t("div",{className:"pt-4 pb-3 border-b border-gray-200",children:[t("div",{className:"flex items-center px-4",children:[t("div",{className:"flex-shrink-0",children:t(hn,{})}),t("div",{className:"ml-3",children:[t("div",{className:"text-base font-medium text-gray-800 dd-privacy-mask",children:n.value.basicProfile.firstName}),t("div",{className:"text-sm font-medium text-gray-500 dd-privacy-mask",children:n.value.basicProfile.email})]})]}),t("div",{className:"mt-3 space-y-1",children:[i&&t(w,{children:bs.map(c=>t("a",{href:c.href,className:"block px-4 py-2 text-base font-medium text-gray-500 hover:text-primary hover:bg-secondary",children:c.name},c.name))}),t("a",{onClick:()=>G.signOutRedirectAsync(),className:"block cursor-pointer px-4 py-2 text-base font-medium text-gray-500 hover:text-primary hover:bg-secondary",children:"Logout"})]})]})}),a&&t("div",{className:"sm:hidden bg-white border-b border-gray-200",children:t(Vt,{user:n.value})})]})})})},ws="/customer-profile/backend/v1.0/workplace-link/config";class vs{async getConfigAsync(){return se.instance.url(ws).get().json()}}const ks=new vs,xs=e=>({isEstablished:e==null?void 0:e.isEstablished}),Ns="/flare-app-identity/backend/v1.0/auth/token";class As{async getTokenAsync(){return se.instance.url(Ns).get().json()}}const Cs=new As;class Ps{async getUserProfile(){return await D.instance.url("users/self").get().json()}async getBasicProfileByEmail(n){const a=await D.instance.url(`users?email=${n}`).get().notFound(()=>null).json();return $(a)}saveConsent(){D.instance.url("users/consent").post()}}const rt=new Ps;class Dt{constructor(){y(this,"basicProfile");y(this,"benefitsProfile");y(this,"featureFlags");y(this,"account")}static toDomain(n){return{basicProfile:n.basicProfile,benefitsProfile:n.benefitsProfile,featureFlags:n.featureFlags,accountName:n.account?n.account.name+(n.account.legalEntityName?" - "+n.account.legalEntityName:""):void 0}}}const me=class me{static get profileId(){if(fe(this._profileId))throw Error("ProfileId is missing.");return this._profileId.value}static set profileId(n){this._profileId=$(n)}static set accountId(n){this._accountId=$(n)}static get profileIdOrDefault(){return T(this._profileId,"")}static get accountIdOrDefault(){return T(this._accountId,"")}static get partnerIdOrDefault(){return T(this._partnerId,"")}extractProfileId(n){const a=$(ca(n).sub);if(fe(a))throw Error("profileId property is missing.");me.profileId=a.value}async loadSignedInUserProfileAsync(){const n=Dt.toDomain(await rt.getUserProfile());me.accountId=n.basicProfile.accountId,P.update(a=>{a.user=$(n)})}saveUserConsent(){return rt.saveConsent(),P.update(n=>{const a=T(n.user,void 0);a&&(n.user=$({...a,benefitsProfile:{...a.benefitsProfile,hasConsent:!0}}))}),Promise.resolve()}async setWorkplaceLinkConfig(){const n=xs(await ks.getConfigAsync()),a=n.isEstablished?await this.fetchWorkplaceBackendTokenAsync():void 0;P.update(s=>{const i=T(s.user,void 0);i&&(s.user=$({...i,workplaceLinkConfig:{...n,workplaceBackendToken:a}}))})}setIsEstablished(){P.update(n=>{const a=T(n.user,void 0);a&&(n.user=$({...a,workplaceLinkConfig:{...a.workplaceLinkConfig,isEstablished:!0}}))})}setAllowanceCompleted(){P.update(n=>{const a=T(n.user,void 0);a&&(n.user=$({...a,featureFlags:{...a.featureFlags,allowance:!1}}))})}async updateCustomerIdAsync(n){const a=Dt.toDomain(await rt.getUserProfile()),s=a.basicProfile.customerId?await this.fetchWorkplaceBackendTokenAsync():void 0;P.update(i=>{const r=T(i.user,void 0);r&&(i.user=$({...r,workplaceLinkConfig:{...r.workplaceLinkConfig,workplaceBackendToken:s},basicProfile:{...r.basicProfile,customerId:a.basicProfile.customerId}})),n&&n()})}async fetchWorkplaceBackendTokenAsync(){try{return(await Cs.getTokenAsync()).token}catch{return}}};y(me,"_profileId",C),y(me,"_accountId",C),y(me,"_partnerId",C);let ut=me;const q=we.createContext(C),fn=we.createContext(!1),te=new ut,je=()=>{const e=oe(q),{service:n}=O();return h(()=>{n.trackAppOfferAcceptedAsync()},[]),t(w,{children:[t(bt,{user:e}),t("div",{className:"p-4",children:t("workplace-link",{"access-token":dn.jwt,"backend-url":_.getConfig().apiGatewayBaseUrl,source:"WebBenefits",channel:"web"})})]})},pn=()=>{const e=la(),n=e.startsWith("state")||e.startsWith("code")||e.startsWith("error");return t(w,{children:n?t(je,{}):t("div",{className:"notfound",children:[t("h1",{children:"Error 404"}),t("p",{children:"That page doesn't exist."}),t("a",{href:"#/",children:t("h4",{children:"Back to Home"})})]})})};function xe(e){return we.useContext(fn)?oa(e.component,e):t(Ze,{})}const yt=e=>({listen:n=>e.listen(({location:a})=>n(a)),location:e.location,push:e.push,replace:e.replace}),Is="/benefits-plan/backend/v1.0/categories",Ts=(e,n)=>`/benefits-plan/backend/v1.0/categories/${e}/products/${n}`;class Ss{constructor(){y(this,"_backendClientWithCacheEnabled")}get backendClientWithCacheEnabled(){return this._backendClientWithCacheEnabled||(this._backendClientWithCacheEnabled=se.instance.middlewares([da(),ma({throttle:1e4})])),this._backendClientWithCacheEnabled}async getCategoriesAsync(){return this.backendClientWithCacheEnabled.url(Is).get().json()}async getProductActivitesAsync(n,a){const s=Ts(n,a);return se.instance.url(s).get().json()}}const wt=new Ss,Ls=(e,n)=>e.map((a,s)=>({title:a,completed:s<=n})),gn=(e,n)=>Te(_.getConfig().apolloBaseUrl).headers({Authorization:`Bearer ${e}`,"X-PROFILE-ID":n}),vt=async(e,n)=>{const[a]=await Promise.all([e,new Promise(s=>window.setTimeout(s,n))]);return a},Re=e=>new Promise(n=>setTimeout(n,e));class Es{constructor(){y(this,"client",new on(()=>{const n=_.getConfig();return ua({space:n.contentfulSpace,environment:n.contentfulEnvironment,accessToken:n.contentfulApiKey})}))}async loadCollectionsAsync(){return(await this.client.value.getEntries({content_type:"benefitsCollection"})).items.map(a=>{var i,r,c,l,m;const{fields:s}=a;return{id:a.sys.id,title:s.title,description:s.description,coverPhotoUrl:((c=(r=(i=s.coverPhoto)==null?void 0:i.fields)==null?void 0:r.file)==null?void 0:c.url)??"",pillar:((l=s.pillar)==null?void 0:l.toLowerCase())??"money",articles:((m=s.contentLibrary)==null?void 0:m.map(o=>({id:o.sys.id,title:o.fields.title,subtitle:o.fields.subtitle,coverPhotoUrl:o.fields.coverPhoto.fields.file.url,pillar:o.fields.pillar.toLowerCase(),primaryContentType:o.fields.primaryContentType.toLowerCase(),slug:"",externalLink:""})))??[],state:"visible"}})}async loadAvailableEntryPreviewsAsync(){return(await this.client.value.getEntries({"sys.contentType.sys.id[in]":"benefitsWellbeingArticle,benefitsExternalLink",select:"sys.id,fields"})).items.map(a=>{const{fields:s}=a;return{id:a.sys.id,title:s.title,subtitle:s.subtitle,coverPhotoUrl:s.coverPhoto.fields.file.url,pillar:s.pillar.toLowerCase(),primaryContentType:s.primaryContentType.toLowerCase(),slug:s.slug,externalLink:s.externalLink}})}async loadArticleAsync(n){const a=await this.client.value.getEntries({content_type:"benefitsWellbeingArticle",limit:1,include:10,"fields.slug":n});if(a.items.length===0)throw Error("Couldn't find this article");return a.items[0].fields}async loadBenefitsPlanCategoryAsync(){return(await this.client.value.getEntries({content_type:"benefitsWebCategoryTile"})).items.map(a=>a.fields)}async loadBenefitsLandingModalAsync(n){const a=await this.client.value.getEntries({content_type:"benefitsWebLandingModal",limit:1,"fields.slug":n});if(a.items.length!==0)return a.items[0].fields}async loadBenefitsPlanWebHomeAsync(){const n=await this.client.value.getEntries({content_type:"benefitsBenefitsPlanWeb",limit:1,"fields.slug":"home"});if(n.items.length===0)throw Error("Couldn't find benefits plan home.");return n.items[0].fields}async tryLoadActivityAdvertisementAsync(n){var a;try{return(a=(await this.client.value.getEntry(n)).fields.webBenefitsLandingModal)==null?void 0:a.fields}catch{return}}async loadFeaturedOffersAsync(){var s;const n=await this.client.value.getEntries({content_type:"benefitsProductOfferCategory"}),a=((s=n.includes)==null?void 0:s.Entry)??[];return n.items.map(({fields:{category:i,offers:r}})=>({category:i,offers:r.map(c=>{var o;if(typeof c!="object")return;const{sys:{id:l,type:m}}=c;return m==="Entry"?c.fields:m==="Link"?(o=a.find(g=>g.sys.id===l))==null?void 0:o.fields:void 0}).filter(c=>c)}))}async loadAllowanceContentAsync(n){return await this.client.value.getEntries({content_type:"benefitsMarketplaceContent","fields.contentId":n})}async loadBenefitsMarketplaceOfferAsync(){const n=await this.client.value.getEntries({content_type:"benefitsMarketplaceOffer",limit:1});if(n.items.length===0)throw Error("Couldn't find benefits marketplace offer.");return n.items[0].fields}}const ee=new Es,bn=["Start","Get Estimate","View","Ineligible"],Os=async()=>vt(ee.loadBenefitsPlanCategoryAsync(),700),Bs=async()=>vt(ee.loadBenefitsPlanWebHomeAsync(),700),yn=e=>{switch(e.action){case"activity-assessment":return"activity-assessment";case"cars-calculator-ungated":return"cars-calculator-ungated";case"cars-calculator-gated":return"cars-calculator-gated";case"typeform":return e.typeformId?"typeform":"none";case"shopify":return"shopify";case"external-link":return e.link?"external-link":"none";case"activity-advertisement":return"activity-advertisement";default:return"none"}},$s=async e=>{const n=e.products.length>0?await wt.getProductActivitesAsync(e.id,e.products[0].id):{activities:[]};return(await Promise.all(n.activities.filter(s=>s.activityType==="Advertisement").map(async s=>{const i=await ee.tryLoadActivityAdvertisementAsync(s.articleId);return i?{...i,id:s.id,title:s.title}:void 0}))).filter(s=>!!s)},wn=(e,n)=>{var a;return{id:e.slug,modalBody:e.body,disclaimer:e.disclaimer,heroImageDesktop:e.heroImageDesktop,heroImageMobile:e.heroImageMobile,buttonText:e.actionButtonText,component:yn(e),typeformId:e.typeformId,order:e.order||100,externalUrl:((a=e.link)==null?void 0:a.replace(/\s+/g,""))||void 0,categoryTitle:e.categoryTitle,assessmentId:e.assessmentId,selectionTile:e.tileDisplayTitle&&e.tileSubtitle&&e.tileImage?{activityId:e.id||"unknown",activityName:e.title||"unknown",displayTitle:e.tileDisplayTitle,subtitle:e.tileSubtitle,tileImage:e.tileImage,buttonText:(n==null?void 0:n.landingModal.fields.actionButtonText)||"Learn More",order:e.order||100}:void 0}},Ft=(e,n,a)=>{const s=a.map(i=>wn(i,n));return{id:e.id,title:n.categoryTitle,displayTitle:n.displayTitle,subtitle:n.subtitle,iconUrl:e.iconUrl,order:n.order,landings:s.filter(i=>i.component!=="none").sort((i,r)=>i.order-r.order)}},Rs=async e=>{try{const n=await ee.loadBenefitsLandingModalAsync(e);if(n&&(n==null?void 0:n.action)!=="activity-advertisement")return[wn(n)]}catch{return[]}return[]},_s=async()=>{try{const e=await wt.getCategoriesAsync(),n=await Os();return(await Promise.all(e.categories.filter(s=>n.find(r=>r.categoryTitle.toLowerCase()===s.title.toLowerCase())&&bn.includes(s.status)).map(async s=>{try{const i=n.find(r=>r.categoryTitle.toLowerCase()===s.title.toLowerCase());switch(yn(i.landingModal.fields)){case"activity-advertisement":{const r=await $s(s);return r.length>0?Ft(s,i,r):void 0}default:return Ft(s,i,[i.landingModal.fields])}}catch{return}}))).filter(s=>!!s&&s.landings.length>0).sort((s,i)=>s.order-i.order)}catch{return[]}},Ms=async(e,n)=>{try{const a=await wt.getCategoriesAsync(),s=await ee.loadFeaturedOffersAsync(),i=a.categories.filter(r=>bn.includes(r.status));return s.flatMap(r=>{const c=i.find(l=>l.title.toLocaleLowerCase()===r.category.toLocaleLowerCase());return c?r.offers.filter(l=>l.displayLocations.includes(e)&&(!l.expiryDate||new Date(l.expiryDate).getTime()>Date.now())&&(!l.accounts||l.accounts.length===0||l.accounts.includes(n))).map(l=>({...l,categoryName:c.title,categoryId:c.id})):[]}).map(r=>{try{return{title:r.title,subtitle:r.subtitle,categoryId:r.categoryId,categoryName:r.categoryName,slug:r.slug,location:e,coverPhotoMobileUrl:r.coverPhoto.fields.file.url,coverPhotoDesktopUrl:r.webBannerImage.fields.file.url,linkButtonText:r.linkButtonLabel,linkUrl:r.linkUrl,order:r.displayPriority??0}}catch{return}}).filter(r=>r).sort((r,c)=>c.order-r.order)}catch{return[]}},vn=async()=>{var i;const e=P.getValue().benefitsPlanOffers;if(e)return e;const n=ln(P.getValue().user);if(!((i=n==null?void 0:n.workplaceLinkConfig)!=null&&i.workplaceBackendToken))return[];const s=(await gn(n.workplaceLinkConfig.workplaceBackendToken,n.basicProfile.profileId).url("/benefits-plan/workplace-backend/v1.0/offers").get().json()).offers.filter(r=>r.isEnabled&&r.isEligible);return P.update(r=>{r.benefitsPlanOffers=s}),s},Us=()=>{const e=()=>Q.getValue().mode;return{isDefault:()=>e()==="default",isPba:()=>e()==="pba"}},kn=Us(),Vs=({children:e,onSwipedLeft:n,onSwipedRight:a,onSwipedUp:s,onSwipedDown:i,...r})=>{const[l,m]=f(0),[o,g]=f(0),[p,b]=f(0),[k,v]=f(0);return t("div",{onTouchStart:u=>{g(0),m(u.targetTouches[0].clientX),v(0),b(u.targetTouches[0].clientY)},onTouchMove:u=>{g(u.targetTouches[0].clientX),v(u.targetTouches[0].clientY)},onTouchEnd:()=>{if(!l||!o||!p||!k)return;const S=l-o>50,U=p-k>50;Math.abs(l-o)>Math.abs(p-k)?S?n==null||n():a==null||a():U?s==null||s():i==null||i()},...r,children:e})},Ds=({autoplay:e,slidesContainerClassName:n,onSlideChange:a,children:s})=>{const[i,r]=f(0),c=M(),l=(e==null?void 0:e.enabled)&&s.length>1;if(!s)return t(w,{});const m=()=>{l&&(c.current=setInterval(p,e.interval))},o=()=>clearInterval(c.current),g=()=>{o(),m()},p=()=>{r(v=>v===s.length-1?0:v+1),g()},b=()=>{r(v=>v===0?s.length-1:v-1),g()},k=v=>{r(v),g()};return h(()=>(m(),o),[]),h(()=>{a==null||a(i)},[i]),t(Vs,{onSwipedLeft:b,onSwipedRight:p,children:[t("div",{className:"relative",children:[s.length>1&&t(Fs,{className:"hidden md:flex absolute top-0 left-4",onClick:b}),t("div",{className:`${n??""} flex flex-row overflow-hidden`,children:s.map((v,x)=>t(Ws,{index:x,activeIndex:i,children:v},x))}),s.length>1&&t(js,{className:"hidden md:flex absolute top-0 right-4",onClick:p})]}),s.length>1&&t(Hs,{itemsCount:s.length,activeIndex:i,onClick:k})]})},Fs=({className:e,onClick:n})=>t("div",{className:`flex h-full items-center z-10 ${e??""}`,children:t(ha,{className:"w-7 h-7 p-1 rounded-full bg-white shadow cursor-pointer hover:bg-gray-200/50",onClick:n})}),js=({className:e,onClick:n})=>t("div",{className:`flex h-full items-center z-10 ${e??""}`,children:t(fa,{className:"w-7 h-7 p-1 rounded-full bg-white shadow cursor-pointer hover:bg-gray-200/50",onClick:n})}),Ws=({index:e,activeIndex:n,children:a})=>{let s;return e<n&&(s=`-${(e+1)*100}%`),e===n&&(s=`-${e*100}%`),e>n&&(s=`-${(e-1)*100}%`),t("div",{className:"w-full flex-none transition duration-500",style:{transform:`translate( ${s}, 0)`},children:a})},Hs=({itemsCount:e,activeIndex:n,onClick:a})=>t("div",{className:"mt-2 flex justify-center gap-2",children:Array(e).fill(null).map((s,i)=>t("span",{className:`inline-block w-2 h-2 cursor-pointer outline outline-4 rounded-full ${i===n?"bg-primary outline-primary/25":"bg-gray-300 outline-transparent"}`,onClick:()=>a(i)},i))}),ye=e=>{const n=dt(e.href),[a,s]=f();h(()=>{const r=[Q.signedInUser$.subscribe(c=>{R(c)?s(c.value):s(void 0)})];return()=>{r.map(c=>c.unsubscribe())}},[]);const i=r=>{r.preventDefault(),n&&j(n),e.onClick&&e.onClick()};return t(w,{children:n?t("a",{className:e.className,target:"_self",onClick:i,children:e.children}):t("a",{href:es(e.href,a),className:e.className,onClick:e.onClick,target:"_blank",rel:"noopener noreferrer",children:e.children})})},N=({height:e,width:n,className:a})=>t("div",{className:a,children:t("div",{className:"flex animate-pulse flex-row h-full",children:t("div",{style:{width:`${n?`${n}rem`:"100%"}`,height:`${e}rem`},className:"bg-gray-300 rounded"})})}),zs=()=>t(w,{children:t("div",{className:"w-full bg-gray-50 border-grey-100 border rounded-lg flex",children:t("div",{className:"w-full grid grid-cols-1 md:grid-cols-2 place-items-center md:h-72 p-4 md:p-9",children:[t("div",{className:"w-full flex flex-col gap-4 md:gap-8",children:[t(N,{className:"w-1/5",height:1.5}),t(N,{className:"w-2/5",height:1.5}),t(N,{className:"w-4/5",height:1.5})]}),t(N,{className:"hidden md:block w-full",width:20,height:10})]})})}),qs=({offers:e})=>{const n=M({}),{service:a}=O(),s=ce(r=>{if(!(e!=null&&e.length)||n.current[r])return;const c=e.find((l,m)=>m===r);c.isAppOffer?a.trackAppOfferViewedAsync():a.trackPromotionViewedAsync(c.slug,c.location,c.categoryId,c.categoryName),n.current[r]=!0},[e,a,n]),i=ce(r=>{a.trackPromotionSelectedAsync(r.slug,r.location,r.categoryId,r.categoryName,r.linkUrl)},[a]);return e?t(Ds,{autoplay:{enabled:!0,interval:5e3},slidesContainerClassName:"bg-white border-grey-100 border rounded",onSlideChange:s,children:e.map(r=>t(ye,{className:"cursor-pointer",onClick:()=>i(r),href:r.linkUrl,children:t("div",{className:"md:h-[22.5rem] w-full flex flex-col md:flex-row text-gray-900",children:[t("div",{className:"md:hidden overflow-hidden w-full",children:t("img",{src:r.coverPhotoMobileUrl})}),t("div",{className:"flex flex-1 flex-col flex-grow justify-center py-4 px-4 md:py-0 md:pl-16 md:pr-0",children:[t("div",{className:"text-2xl leading-8 lg:text-3xl xl:text-4xl lg:leading-10 font-extrabold pt-4",children:r.title}),t("div",{className:"text-md md:text-lg leading-6 mt-2 font-medium max-w-lg",children:r.subtitle}),t("div",{className:"pt-5",children:t("span",{className:"block w-full mx-auto md:w-auto text-center md:inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm leading-6 font-semibold rounded-md text-white bg-primary",children:t("span",{children:r.linkButtonText})})})]}),t("div",{className:"hidden md:block overflow-hidden",children:t("img",{src:r.coverPhotoDesktopUrl,className:"object-scale-down h-full"})})]})}))}):t(zs,{})};const Gs=({children:e,className:n})=>t("div",{className:"gradient-tile "+n,children:e}),Ks=({title:e,subtitle:n,externalUrl:a,icon:s,onClick:i})=>t("a",{className:"w-full cursor-pointer",href:a,target:a&&"_blank"||void 0,onClick:i,children:t(Gs,{className:"pl-6 pr-4 py-4 md:w-48 md:h-48 md:px-4 md:py-6 bg-white bg-opacity-50 hover:bg-opacity-100 shadow hover:shadow-lg border-2 rounded-md flex md:flex-col md:justify-items-center md:items-center",children:[t("div",{className:"flex justify-start item-center self-center",children:s}),t("div",{className:"ml-6 md:ml-0 md:text-center md:mt-auto",children:[t("div",{className:"text-blue-600 text-l md:text-xl font-bold leading-7",children:e}),t("div",{className:"text-gray-900 text-base font-medium leading-normal",children:n})]})]})}),Qs={renderText:e=>e.split(`
4
4
  `).flatMap((n,a)=>[a>0&&t("br",{}),n]),renderNode:{[V.BLOCKS.PARAGRAPH]:(e,n)=>t("p",{className:"relative text-gray-500 text-sm font-normal leading-5",children:n}),[V.INLINES.HYPERLINK]:(e,n)=>t("a",{className:"text-blue-600 underline",href:e.data.uri,target:"_blank",rel:"noopener noreferrer",children:n})}},Ys=({body:e})=>t(w,{children:ve.documentToReactComponents(e,Qs)}),Xs=()=>t(w,{children:[t(N,{className:"mb-1 md:mb-2",width:20,height:4}),t(N,{className:"mb-5 md:mb-10",width:40,height:2}),t("div",{className:"flex flex-col md:flex-row gap-3 md:gap-8 flex-wrap",children:[t(N,{className:"hidden md:block",width:12,height:12}),t(N,{className:"md:hidden block",height:6}),t(N,{className:"hidden md:block",width:12,height:12}),t(N,{className:"md:hidden block",height:6}),t(N,{className:"hidden md:block",width:12,height:12}),t(N,{className:"md:hidden block",height:6}),t(N,{className:"hidden md:block",width:12,height:12}),t(N,{className:"md:hidden block",height:6}),t(N,{className:"hidden md:block",width:12,height:12}),t(N,{className:"md:hidden block",height:6}),t(N,{className:"hidden md:block",width:12,height:12}),t(N,{className:"md:hidden block",height:6})]})]}),Js=({categories:e,content:n})=>{const{service:a}=O(),[s,i]=f(!0),r=be.getIsWelcomeModalOpen();return h(()=>{if(!s&&!r){const c=e?e.map(l=>l.title):[];a.trackBenefitsPlanViewedAsync(c)}},[s,r]),h(()=>{e&&(n!=null&&n.title)?i(!1):i(!0)},[e,n==null?void 0:n.title]),t("div",{className:"relative",children:[t("div",{className:"bg-[linear-gradient(0deg,_#2E66F7_0%,_#0005D2_100%)] absolute w-full h-full blur-[250px] opacity-10"}),e&&(n!=null&&n.title)?t(w,{children:[t("div",{className:"text-gray-700 text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 mb-1 md:mb-2",children:n.title}),n.subtitle&&t("div",{className:"text-black text-base md:text-2xl font-normal leading-normal md:leading-loose mb-5 md:mb-10",children:n.subtitle}),t("div",{className:"flex flex-col md:flex-row gap-3 md:gap-8 flex-wrap mb-6",children:e==null?void 0:e.map(c=>t("div",{className:"category-container flex md:flex-col",children:t(Ks,{title:c.displayTitle||c.title,subtitle:c.subtitle,icon:t("img",{src:c.iconUrl,className:"w-10 h-10 md:w-16 md:h-16"}),onClick:()=>j("/categories/"+c.title.toLocaleLowerCase())},c.id)}))}),n.disclaimer&&t(Ys,{body:n.disclaimer})]}):t(Xs,{})]})},Zs="/benefits/app/assets/all_tab_color-548783b9.svg",er="/benefits/app/assets/all_tab_gray-a5051313.svg",xn={money:"text-blue-400",mind:"text-green-400",body:"text-red-400",work:"text-orange-400",life:"text-yellow-400"},jt=["all",...ze],tr=({children:e})=>t("nav",{className:"flex p-2 space-x-8 bg-gray-50","aria-label":"Tabs",children:e}),nr=e=>{const{children:n,onClick:a,className:s,selected:i}=e;return t("div",{onClick:a,className:Y(s??"",i?"bg-white shadow-md text-gray-800":"text-gray-600 hover:bg-gray-100","w-full py-2 capitalize text-base leading-6 font-semibold rounded-lg focus:outline-none","cursor-pointer flex items-center justify-center"),"aria-current":i?"page":void 0,children:n})},ar=({currentTab:e,tabNameList:n,onTabClicked:a})=>t(w,{children:[t("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),t("select",{id:"tabs",name:"tabs",className:"block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-primary focus:border-primary sm:text-sm rounded-md",value:e,onChange:s=>{const i=s.currentTarget.value;a(i)},children:n.map(s=>t("option",{value:s,children:hs(s)}))})]}),sr={money:pa.faUsdSquare,mind:ga.faSpa,body:ba.faHeartbeat,work:ya.faBriefcase,life:wa.faUmbrellaBeach},Nn=(e,n)=>t(Je,{size:n??"lg",icon:sr[e]}),An=({currentTab:e,onTabClicked:n})=>{const a=c=>Nn(c,"1x"),s=c=>t("div",{className:xn[c],children:a(c)}),i={all:t("img",{className:"h-3.5 w-3.5",src:er,alt:""}),...Object.fromEntries(ze.map(c=>[c,a(c)]))},r={all:t("img",{className:"h-3.5 w-3.5",src:Zs,alt:""}),...Object.fromEntries(ze.map(c=>[c,s(c)]))};return t(w,{children:[t("div",{className:"sm:hidden",children:t(ar,{currentTab:e,onTabClicked:c=>n(c),tabNameList:[...jt]})}),t("div",{className:"hidden sm:block",children:t(tr,{children:jt.map(c=>t(nr,{onClick:()=>{n(c)},selected:e===c,className:"uiid-explore-perks-tabs",children:[e===c?r[c]:i[c],t("span",{className:"uiid-explore-tab-name ml-3",children:c})]},c))})})]})},Cn=({onSearchEvent:e})=>{const n=M(null),a=M(null),[s,i]=f(!1);return h(()=>{const r=[n.current&&Pt(n.current,"input").pipe(va("target","value"),Jt(c=>{i(!!c)}),ka(500)).subscribe(async c=>{e(c)}),a.current&&Pt(a.current,"click").subscribe(()=>{n.current.value="",i(!1),e("")})];return()=>{r.map(c=>c==null?void 0:c.unsubscribe())}},[]),t("div",{className:"flex relative rounded-md shadow-sm",children:[t("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none","aria-hidden":"true",children:t(xa,{className:"mr-3 h-4 w-4 text-gray-400","aria-hidden":"true"})}),t("input",{type:"text",name:"search",id:"search",ref:n,placeholder:"Search perks",className:"uiid-search-bar-input block w-full pl-9 rounded-none rounded-md sm:text-sm border-gray-300"}),t("div",{className:Y(s?"":"hidden","absolute inset-y-0 right-0 pr-3 flex items-center z-10 cursor-pointer"),ref:a,children:t(Ce,{className:"h-5 w-5 text-gray-400 ","aria-hidden":"true"})})]})};var Wt,Ht;const rr=()=>({all:[],money:[],mind:[],body:[],work:[],life:[]}),ir=()=>({perksTab:"all",searchString:""});let cr=(Wt=Se({name:"explore-perks",cache:{ttl:"3600000"},idKey:"benefitId",resettable:!0,producerFn:Le}),Wt(Ht=class extends tn{constructor(){super(ir())}})||Ht);const Ie=new cr,lr=()=>({setTab:e=>{Ie.update(n=>{n.perksTab=e})},searchPerks:e=>{Ie.update(n=>{n.searchString=e,n.perksTab="all"})}}),it=lr(),Pn=({children:e,className:n})=>t("div",{className:Y(n??"","grid items-stretch sm:grid-cols-2 lg:grid-cols-3 gap-8"),children:e}),In=({children:e})=>t("div",{className:"uiid-preview-empty flex items-center justify-center sm:col-span-2 lg:col-span-3 justify-items-center content-center bg-gray-100 rounded-lg overflow-hidden h-72",children:t("div",{className:"text-xl font-medium text-gray-400 text-center",children:e})});class or{async getBenefitsAsync(){return D.instance.url("benefits").get().json()}async postDocumentAsync(n){return D.instance.url("document").addon(It).formData(n).post().badRequest(a=>{throw new Error(a.message)}).json()}async postImageAsync(n){return D.instance.url("image").addon(It).formData(n).post().badRequest(a=>{throw new Error(a.message)}).json()}commandAsync(n,a){return D.instance.url("benefits/track-event").query(a||{}).post(n).badRequest(s=>{throw new Error(s.message)}).res()}}const re=new or,dr="/benefits/app/assets/workplace_link_banner_mobile-6ebaa24b.png",mr="/benefits/app/assets/workplace_link_banner_v2-c81ed849.png",ur="/workplace-link";class ne extends nn{constructor(a){super(a);y(this,"perksTab$",this.select(a=>a.perksTab));y(this,"all$",Ue([this.selectAll()]).pipe(Ve(([a])=>ne.filterPerks(a,"","all"))));y(this,"classifiedPerks$",Ue([this.selectAll(),this.select(a=>a.searchString)]).pipe(Ve(([a,s])=>{const i=s?ne.searchPerks(a,s):a;return ne.classifyPerks(i)})));y(this,"perksOnStage$",Ue([this.selectAll(),this.select(a=>a.searchString),this.select(a=>a.perksTab)]).pipe(Ve(([a,s,i])=>this.getHasCache()?ae.fromNullable(ne.filterPerks(a,s,i)):C)));this.store=a}static filterPerks(a,s,i){const r=ne.searchPerks(a,s).filter(c=>i==="all"||c.benefit.category===i);return ne.excludeLocalPerk(r,ur)}static searchPerks(a,s){return a.filter(i=>i.benefit.title.toLowerCase().includes(s.toLowerCase())||i.benefit.subtitle.toLowerCase().includes(s.toLowerCase()))}static classifyPerks(a){const s=rr();return a.forEach(i=>{const r=i.benefit.category;s[r].push(i)}),s.all=a,s}static findLocalPerk(a,s){const i=a.filter(r=>{var c;return(c=dt(r.benefit.url))==null?void 0:c.startsWith(s)});return i.length===0?void 0:i[0]}static excludeLocalPerk(a,s){return a.filter(r=>{var c;return!((c=dt(r.benefit.url))!=null&&c.startsWith(s))})}}const Ge=new ne(Ie);var zt,qt;function hr(){return{loading:!1,featuredPerks:C,featuredProductOffers:void 0,viewPerk:{isOpen:!1,perk:C},viewLanding:{isOpen:!1,landingSelection:[]},categories:void 0,benefitsPlanHome:void 0}}let fr=(zt=Se({name:"home-page",resettable:!0,producerFn:Le}),zt(qt=class extends ht{constructor(){super(hr())}})||qt);const X=new fr;class pr extends Ye{constructor(a){super(a);y(this,"homePageState$",this.select(a=>a.featuredPerks));y(this,"viewPerkState$",this.select(a=>a.viewPerk));y(this,"viewLandingState$",this.select(a=>a.viewLanding));y(this,"categoryState$",this.select(a=>a.categories));y(this,"benefitsPlanHomeState$",this.select(a=>a.benefitsPlanHome));y(this,"bannerItems$",this.select(a=>a.featuredProductOffers));this.store=a}}const Z=new pr(X),gr=()=>({getViewPageState:()=>{const e=n=>{X.update(a=>{a.featuredPerks=$(n)}),Ie.set(n.availableBenefits)};return Ge.selectCached(()=>re.getBenefitsAsync(),e)},getMarketplaceCategoryState:()=>{const e=n=>{X.update(a=>{a.categories=n})};return Z.selectCached(()=>_s(),e)},getBenefitsPlanHome:()=>{const e=n=>{X.update(a=>{a.benefitsPlanHome=n})};return Z.selectCached(()=>Bs(),e)},getBannerItems:e=>{const n=s=>{X.update(i=>{i.featuredProductOffers=s})},a=()=>Ms("webBanner",e.basicProfile.accountId).then(s=>e.featureFlags[cn.FlareApp]?s.concat([{isAppOffer:!0,title:"Workplace benefits in your pocket!",subtitle:"Download the Flare app for easy access to your workplace benefits and much more.",categoryId:"",categoryName:"",slug:"",location:"webBanner",coverPhotoMobileUrl:dr,coverPhotoDesktopUrl:mr,linkButtonText:"Get Flare App",linkUrl:"#/workplace-link"}]):s);return Z.selectCached(()=>a(),n)},reloadViewPageState:()=>{Ie.setHasCache(!1)},openPerk:e=>{X.update(n=>{n.viewLanding={isOpen:!1,landingSelection:[],category:void 0},n.viewPerk={isOpen:!0,perk:ft(e)}})},closePerk:()=>{X.update(e=>{e.viewPerk.isOpen=!1})},openLanding:(e,n)=>{X.update(a=>{a.viewPerk.isOpen=!1,a.viewLanding={isOpen:!0,landingSelection:e,category:n}})},closeLanding:()=>{X.update(e=>{e.viewLanding={isOpen:!1,landingSelection:[],category:void 0}})}}),B=gr(),Tn="/benefits/app/assets/default_backdrop-fdd955b8.png",kt=e=>{const n=t(w,{children:[t("div",{className:"flex-shrink-0",children:t("img",{className:Y(e.imageClassName??"h-48 w-full object-cover"),src:e.imageUrl,alt:""})}),t("div",{className:"flex-1 bg-white p-4 flex flex-col justify-between",children:e.children})]});return t("div",{onClick:e.onClick,className:Y(e.className??"",e.onClick?"cursor-pointer":"","flex flex-col rounded-lg shadow-lg overflow-hidden"),children:e.externalLink?t("a",{href:e.externalLink,target:"_blank",rel:"noopener noreferrer",children:n}):n})},br=e=>Tt.match(e.toLowerCase()).with("body",()=>"bg-pink-100 text-pink-800").with("life",()=>"bg-yellow-100 text-yellow-800").with("mind",()=>"bg-green-100 text-green-800").with("money",()=>"bg-blue-100 text-blue-800").with("work",()=>"bg-orange-100 text-orange-800").with(Tt.__,()=>"bg-gray-100 text-gray-800").exhaustive(),xt=e=>{const n=br(e.name),a=e.size==="xs"?"text-xs":"text-sm";return t("div",{className:Y(e.className??"","capitalize inline-flex items-center px-2 py-0.5 rounded font-medium",n,a),children:e.name})},Sn=({perk:e,onClick:n,className:a})=>{var s;return t(kt,{className:a,imageUrl:((s=e.backdrop)==null?void 0:s.downloadUrl)??Tn,onClick:n,children:t("div",{className:"flex-1 pt-2 pb-7 px-2",children:[t(xt,{className:"uiid-perk-tag",name:e.category}),t("div",{className:"block mt-2",children:[t("p",{className:"uiid-perk-item-title text-xl font-semibold text-gray-900",children:e.title}),t("p",{className:"uiid-perk-item-subtitle mt-1 text-sm text-gray-500",children:e.subtitle})]})]})})},Ln=()=>t("div",{className:"flex flex-col animate-pulse shadow-lg rounded-lg overflow-hidden",children:[t("div",{className:"flex-shrink-0",children:t("div",{className:"h-48 bg-gray-300"})}),t("div",{className:"flex-1 bg-white p-6 pb-9 flex flex-col justify-between",children:t("div",{className:"flex-1",children:[t("div",{className:"h-6 bg-gray-300 rounded w-12"}),t("div",{className:"block mt-2",children:[t("div",{className:"h-4 mt-4 bg-gray-300 rounded w-1/2"}),t("div",{className:"h-4 mt-2 bg-gray-300 rounded w-3/4"})]})]})})]}),En=()=>t(w,{children:[...Array(3).keys()].map((e,n)=>t(Ln,{},n))}),yr=()=>{const[e,n]=f(C),{service:a}=O();h(()=>{const r=[Ge.perksOnStage$.subscribe(n)];return()=>{r.map(c=>c.unsubscribe())}},[]);const s=async r=>{B.openPerk(r),await a.trackExplorePerkViewedAsync(r)},i=T(e,[]).length>0?T(e,[]).map(r=>{const{benefit:c,benefitId:l}=r;return t(Sn,{className:"uiid-explore-perk",perk:c,onClick:()=>s(r)},l)}):t(In,{children:[t("p",{children:"Sorry, no entries were found matching your search request."}),t("p",{children:"Please try another search."})]});return t(Pn,{className:"uiid-perks-grid",children:fe(e)?t(En,{}):i})},wr=()=>{const[e,n]=f(0),[a,s]=f("all"),{service:i}=O();h(()=>{(async()=>i.trackPerksListViewedAsync(a))();const c=[Ge.all$.subscribe(l=>{n(l.length)}),Ge.perksTab$.subscribe(s)];return()=>{c.map(l=>l.unsubscribe())}},[]),h(()=>()=>{it.searchPerks("")},[]);const r=async c=>{it.setTab(c),await i.trackPerksListViewedAsync(c)};return t("div",{className:"flex flex-col",style:{minHeight:window.innerHeight},children:[t("div",{className:"sm:flex sm:items-center sm:justify-between",children:[t("div",{className:"flex",children:[t("div",{className:"text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 text-gray-700",children:"Explore other perks"}),t("div",{className:"text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 text-gray-500 ml-2",children:["(",e,")"]})]}),t("div",{className:"mt-4 sm:mt-0",children:t(Cn,{onSearchEvent:async c=>{it.searchPerks(c),c&&await i.trackPerksListSearched(c)}})})]}),t("div",{className:"mt-4",children:t(An,{currentTab:a,onTabClicked:r})}),t("div",{className:"mt-6",children:t(yr,{})})]})},vr=e=>{const{perks:n}=e,[a,s]=f(!0),{service:i}=O();h(()=>{s(fe(n))},[n]);const r=l=>{B.openPerk(l),i.trackFeaturePerkViewedAsync(l)},c=T(n,[]).map(l=>{const{benefit:m,benefitId:o}=l;return t(Sn,{className:"uiid-featured-perk",perk:m,onClick:()=>r(l)},o)});return t("div",{className:"flex flex-col",children:[t("div",{className:"text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 text-gray-700",children:"Featured Perks"}),t("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-8 pt-6",children:a?t(En,{}):c})]})},et=({isOpen:e,fullWidthMobile:n,onClose:a,children:s})=>t(he.Root,{show:e,as:w,children:t(St,{as:"div",static:!0,className:"modal fixed z-40 inset-0 overflow-y-auto",open:e,onClose:a,children:t("div",{className:`flex items-center justify-center min-h-screen md:max-h-screen mt-auto text-center ${n?"w-screen md:w-auto md:p-4":"p-4"}`,children:[t(he.Child,{as:w,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:t(St.Overlay,{className:"fixed inset-0 bg-black bg-opacity-75 transition-opacity"})}),t("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),t(he.Child,{as:w,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:t("div",{className:`inline-block align-bottom transition-all md:align-middle bg-white text-left shadow-xl transform ${n?"mt-auto md:mb-auto md:rounded-lg overflow-visible":"rounded-lg overflow-hidden"}`,children:s})})]})})}),kr=e=>n=>!!n&&e(n),Ke=e=>kr(e.test.bind(e)),Nt=/^\+?(614|6104|04)([0-9]{2})([0-9]{3})([0-9]{3})$/,xr=/^(\+601){1}(1\d{8}|5\d{8}|(0|2|3|4|6|7|8|9)\d{7})$/,Nr=/^[0-9]{6}$/,Ar=/^[0-9]*$/,On=e=>{if(!e)return;const n=e.replace(/\s/g,""),a=n.match(Nt);return a==null?n:`04${a[2]} ${a[3]} ${a[4]}`},Cr=e=>{const n=e.replace(/\s/g,""),a=n.match(Nt);return a==null?n:`+614${a[2]}${a[3]}${a[4]}`},Bn=e=>Ke(Nt)(e)||Ke(xr)(e),$n=Ke(Nr),Pr=Ke(Ar),Ir=({formId:e,profile:n,categoryId:a,categoryName:s})=>{const{service:i}=O(),r=()=>{i.trackActivityCompletedAsync(a,a,s,"typeform")};let c={};return n&&(c={email:n.email,first_name:n.firstName,last_name:n.lastName,mobile:On(n.mobilePhone),profile_id:n.profileId,account_id:n.accountId,partner_id:n.partnerId,customer_id:n.customerId,campaign_class:"Platform",campaign_source:"Flare",campaign_medium:"Web Benefits",campaign_name:"Benefits Assessment",skip_welcome:"true"}),t(Na.Widget,{id:e,className:"mx-auto w-screen h-screen md:h-[40rem] md:w-[95vw] md:max-w-[70rem]",hidden:c,inlineOnMobile:!0,onSubmit:r})},Tr=(e,n,a)=>{var m,o,g,p,b,k,v,x,L,d,u,S;const s=oe(q),i=T(s,void 0),r=i==null?void 0:i.basicProfile,c=i==null?void 0:i.accountName;let l={};switch(r&&(l={email:r.email,"first-name":r.firstName,"last-name":r.lastName,mobile:r.mobilePhone,"employer-name":c,"profile-id":r.profileId,"account-id":r.accountId,"partner-id":r.partnerId,"customer-id":r==null?void 0:r.customerId,"sf-class":"Platform","sf-source":"Flare","sf-medium":"Web Benefits","sf-name":"Benefits Assessment"}),a.component){case"activity-assessment":return t("div",{className:"p-10 overflow-x-hidden overflow-y-auto bg-white md:bg-transparent w-screen md:w-auto",children:((m=i==null?void 0:i.workplaceLinkConfig)==null?void 0:m.workplaceBackendToken)&&t("benefits-plan-assessment",{"base-url":e,"profile-id":r.profileId,"access-token":(o=i.workplaceLinkConfig)==null?void 0:o.workplaceBackendToken,"image-url":`${a.heroImageDesktop.fields.file.url}?fm=jpg&q=90&w=640&h=480`,"assessment-title":(v=(k=(b=(p=(g=a.modalBody)==null?void 0:g.content)==null?void 0:p.find(I=>I.nodeType==="heading-1"))==null?void 0:b.content)==null?void 0:k.find(I=>I.nodeType==="text"))==null?void 0:v.value,description:(S=(u=(d=(L=(x=a.modalBody)==null?void 0:x.content)==null?void 0:L.find((I,U)=>U===1))==null?void 0:d.content)==null?void 0:u.find(I=>I.nodeType==="text"))==null?void 0:S.value,"assessment-id":a.assessmentId,"track-client":"webBenefits","track-source":"WebBenefits","track-channel":"web","vertical-alignment":"items-center","skip-intro":"true"})});case"cars-calculator-ungated":return t("div",{className:"md:p-1",children:t("cars-calculator",{"datadog-disabled":!0,...l,"backend-url":e,"hide-employer-name":!0})});case"cars-calculator-gated":return t("div",{className:"md:p-1",children:t("cars-calculator",{"datadog-disabled":!0,...l,"backend-url":e,"is-gated":!0,"hide-employer-name":!0})});case"typeform":return a.typeformId?t(Ir,{formId:a.typeformId,profile:r,categoryId:n.id||"",categoryName:n.title||""}):t(w,{});default:return t(w,{})}},Sr=({category:e,landing:n,apolloBaseUrl:a})=>Tr(a,e,n),le=({url:e,children:n,className:a,type:s,disabled:i,onClick:r})=>{const c=`block w-full mx-auto md:w-auto md:ml-0 text-center px-4 py-2 border border-transparent shadow-sm
@@ -29,4 +29,4 @@ var Xn=Object.defineProperty;var Jn=(e,n,a)=>n in e?Xn(e,n,{enumerable:!0,config
29
29
  .bg-lighter-than-text{
30
30
  background-color: hsl(from currentColor h s l / 0.08);
31
31
  }
32
- `}),s.map((r,c)=>t("div",{onClick:()=>n==null?void 0:n(c),className:Oa("text-sm font-medium cursor-auto h-full relative","flex items-center justify-center",c===e?"text-primary":"text-gray-400",i.length>0?"hover:before:cursor-pointer":"hover:before:cursor-default","hover:before:w-16 hover:before:h-16 hover:before:absolute"),children:r},r.key))]}),i.map((r,c)=>t(Oi,{visible:c===e,children:r},r.key))]})},Ri=e=>{var i,r,c,l,m;const n=oe(q),a=T(n,void 0),s=M(null);return h(()=>{re.commandAsync({eventType:"OfferViewed",offerName:e.marketPlaceOffer.name,data:e.marketPlaceOffer.metadata},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName}),s.current&&(s.current.terms=e.marketPlaceOffer.content.terms,s.current.details=e.marketPlaceOffer.content.details,s.current["on-accept"]=()=>{re.commandAsync({eventType:"OfferProgressed",offerName:e.marketPlaceOffer.name,data:{...e.marketPlaceOffer.metadata,template:e.marketPlaceOffer.content.template,assessmentId:e.marketPlaceOffer.content.assessmentId,accepted:!0}},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName})},s.current["on-decline"]=()=>{re.commandAsync({eventType:"OfferProgressed",offerName:e.marketPlaceOffer.name,data:{...e.marketPlaceOffer.metadata,template:e.marketPlaceOffer.content.template,assessmentId:e.marketPlaceOffer.content.assessmentId,accepted:!1}},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName}),e.onStepComplete(!1)},s.current["on-complete"]=()=>e.onStepComplete(!0),s.current["on-skip"]=e.marketPlaceOffer.content.skipButtonHidden?void 0:()=>e.onStepComplete(!1))},[]),(i=a==null?void 0:a.workplaceLinkConfig)!=null&&i.workplaceBackendToken?t("benefits-plan-assessment",{"base-url":_.getConfig().apolloBaseUrl,"profile-id":a==null?void 0:a.basicProfile.profileId,"skip-more-details":!0,"access-token":(r=a==null?void 0:a.workplaceLinkConfig)==null?void 0:r.workplaceBackendToken,"image-url":e.marketPlaceOffer.content.imageUrl,"assessment-id":e.marketPlaceOffer.content.assessmentId,"assessment-instructions":e.marketPlaceOffer.content.assessmentInstructions,"track-experiment":e.marketPlaceOffer.metadata.featureName,"track-treatment":e.marketPlaceOffer.metadata.treatmentName,"track-client":"webBenefits","track-source":"WebBenefits","track-channel":"web","marketplace-offer-name":e.marketPlaceOffer.name,"assessment-title":e.marketPlaceOffer.content.title,description:e.marketPlaceOffer.content.description,"accept-button":e.marketPlaceOffer.content.acceptButton,"decline-button":e.marketPlaceOffer.content.declineButton,"special-banner-title":(c=e.marketPlaceOffer.content.specialBanner)==null?void 0:c.title,"special-banner-subtitle":(l=e.marketPlaceOffer.content.specialBanner)==null?void 0:l.subtitle,"special-banner-type":(m=e.marketPlaceOffer.content.specialBanner)==null?void 0:m.type,"vertical-alignment":"items-center",ref:s}):null},_i=({navigate:e})=>{const[n,a]=f(0),[s,i]=f(!1),[r,c]=f([]);h(()=>{vn().then(c)},[]);const l=ce(o=>{if(o&&i(!0),n===r.length-1){const p=r.some(b=>b.name==="Perks");e(`/allowance/summary/${s||o?"true":"false"}/${p?"true":"false"}`)}else a(n+1)},[n,s]),m=ce(o=>{a(o);const g=r[o];g&&re.commandAsync({eventType:"OfferSelected",offerName:g.name,data:g.metadata},{experiment:g.metadata.featureName,treatment:g.metadata.treatmentName})},[]);return t("div",{className:"max-w-[59.5rem] mx-auto",children:t($i,{selectedIndex:n,onChange:m,children:[r.map(o=>t(Hn,{label:o.content.productName,icon:t(Bi,{iconUrl:o.content.iconUrl})},o.name)),r.map(o=>t(zn,{children:o.content.template==="Assessment"&&t(Ri,{onStepComplete:l,marketPlaceOffer:o},o.name)},o.name))]})})},Mi=e=>{var i;const n=oe(q),a=M(null),s=T(n,void 0);return h(()=>{a.current&&(a.current["on-complete"]=()=>e.navigate("/allowance/intro"))},[]),t("div",{className:"flex justify-center",children:t("benefits-plan-assessment",{"base-url":_.getConfig().apolloBaseUrl,"profile-id":s==null?void 0:s.basicProfile.profileId,"skip-intro":!0,"skip-more-details":!0,"skip-summary":!0,"access-token":(i=s==null?void 0:s.workplaceLinkConfig)==null?void 0:i.workplaceBackendToken,"assessment-id":"benefits-personalisation-assessment","track-client":"webBenefits","track-source":"WebBenefits","track-channel":"web","assessment-title":"Tell us a bit about yourself",description:"Answer a few questions to help us set up a personalised benefits plan for you:","vertical-alignment":"items-center",ref:a})})},Ui=({title:e,className:n,children:a,...s})=>{var m;const[i,r]=f(!1),c=M(null),l=ce(()=>{r(!i)},[i]);return t("div",{className:`border border-2 border-gray-300 p-2 rounded-md overflow-hidden w-full ${n??""}`,...s,children:[t("div",{className:"mx-2 flex justify-between cursor-pointer",onClick:l,children:[t("span",{className:"text-base text-left font-semibold text-primary",children:e}),t("span",{className:"text-base text-left font-semibold text-gray-500",children:i?"-":"+"})]}),t("div",{ref:c,className:"flex justify-center transition-all ease-in-out duration-1000",style:{height:i?`${((m=c==null?void 0:c.current)==null?void 0:m.scrollHeight)??0}px`:"0px",opacity:i?1:0},children:a})]})},Vi="/benefits/app/assets/check-c15931a5.svg",Di=({title:e,steps:n,...a})=>{const s=n.length,i=n.filter(r=>r.completed).length;return t("div",{...a,children:[e&&t("h1",{className:"text-lg font-semibold mb-4",children:e}),t("ol",{children:n.map((r,c)=>{const l=i===c;return t("li",{className:`relative flex-1 pb-6 ${c!==s-1?`after:content-[''] after:w-0.5 after:h-[calc(100%-theme(height.8))] ${r.completed?"after:bg-primary":"after:bg-gray-300"} after:inline-block after:absolute after:top-8 after:left-4`:""}`,children:t("div",{className:"flex font-medium w-full",children:[t("span",{className:`w-8 h-8 flex-shrink-0 ${r.completed?"bg-primary":"bg-white"} border-2 ${r.completed||l?"border-primary":"border-gray-300"} rounded-full flex justify-center items-center mr-3 text-sm ${l?"text-primary":"text-gray-500"}`,children:r.completed?t("img",{className:"w-4 h-4",src:Vi}):c+1}),t("div",{children:[t("h4",{className:`text-sm text-left font-semibold ${r.completed||l?"text-primary":"text-gray-600"}`,children:r.title}),t("p",{className:"text-sm text-left font-normal",children:r.description})]})]})},c)})})]})},Xt="allowance",Fi=({hasCompletedAnyOffers:e,isAppEnabled:n,onComplete:a})=>{h(()=>{const l=ji({isAppEnabled:n,hasCompletedAnyOffers:e});re.commandAsync({eventType:"SummaryViewed",summaryVariant:l},{treatment:Xt})},[n,e]);const[s,i]=f();h(()=>{(async()=>{const l=await ee.loadAllowanceContentAsync(e?"benefits-setup-summary-allowance":"benefits-setup-summary-allowance-no-selection");i(l.items[0].fields)})()},[]);const r=oe(q),c=T(r,void 0);return s?t(ie,{children:[t(ie.Top,{children:t("div",{className:"flex flex-col gap-4",children:[t(Dn,{children:s.title}),t(Fn,{children:s.description})]})}),t(ie.Bottom,{children:t("div",{className:"mt-5 flex flex-col items-center gap-5 text-center",children:[s.specialContent?t(Ui,{className:"lg:w-3/4",title:s.specialContent.title,children:t(Di,{steps:Ls(s.specialContent.content,1),className:"mt-2 rounded-md px-6 py-4"})}):null,t(Vn,{testId:"allowance_set_up_benefits_button_next_screen",class:"mt-5 w-full md:w-[240px]",onClickPromise:async()=>{var o;const l=(o=c==null?void 0:c.workplaceLinkConfig)==null?void 0:o.workplaceBackendToken,m=c==null?void 0:c.basicProfile.profileId;await Promise.all([re.commandAsync({eventType:"Completed"},{treatment:Xt}),l&&m?gn(l,m).url("/benefits-plan/workplace-backend/v1.0/allowance/complete").post():void 0]),a()},children:s.primaryAction})]})})]}):t("div",{className:"text-primary",children:t(Ee,{size:6})})},ji=({isAppEnabled:e,hasCompletedAnyOffers:n})=>{switch(!0){case(e&&n):return"allowance-accepted-app";case(e&&!n):return"allowance-declined-app";case(!e&&n):return"allowance-accepted-noapp";default:return"allowance-declined-noapp"}},Wi=({onComplete:e})=>{const n=oe(q),a=T(n,void 0),[s,i]=f("/allowance"),r=c=>i(c);return t("div",{className:"flex items-center",children:(()=>{var c;if(!((c=a==null?void 0:a.workplaceLinkConfig)!=null&&c.workplaceBackendToken))return t("div",{className:"text-primary",children:t(Ee,{size:10})});if(s==="/allowance/intro")return t(Li,{navigate:r,onComplete:e});if(s==="/allowance/offers")return t(_i,{navigate:r});if(s.startsWith("/allowance/summary/")){const l=s.replace("/allowance/summary/","").split("/");return t(Fi,{isAppEnabled:l[1]==="true",hasCompletedAnyOffers:l[0]==="true",onComplete:e})}return t(Mi,{navigate:r})})()})},Hi="/benefits/app/assets/welcome_image_mobile-dbde6c80.png",zi="/benefits/app/assets/welcome_image_v2-869c59e4.png",qi=({hasNextStep:e,onClick:n})=>{const{service:a}=O();h(()=>{a.trackConsentStartedAsync()},[]);const s=()=>{a.trackConsentCompletedAsync(),n()},i=e?"Get started":"Start exploring your benefits";return t("div",{children:[t("div",{className:"min-h-[12rem] items-center hidden md:flex",children:t("img",{className:"mx-auto align-middle w-[30rem]",src:zi})}),t("div",{className:"min-h-[8rem] flex items-center md:hidden",children:t("img",{className:"mx-auto align-middle w-[30rem]",src:Hi})}),t("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3 mt-4",children:[t("span",{className:"w-full block",children:"Welcome to your"}),t("span",{className:"w-full block",children:"workplace benefits"})]}),t("p",{className:"text-base leading-6 font-normal text-gray-500 mb-6",children:"Get access to savings and perks from Australia’s most-loved brands, plus special offers to help you save on bigger expenses like household utilities, health insurance and more."}),t(le,{className:"md:w-full md:text-base py-3 mb-6 focus:outline-none",onClick:s,children:i}),t("p",{className:"text-xs leading-4 font-normal text-gray-500 mb-0",children:["By clicking “",i,"” you accept the"," ",t(ye,{className:"text-primary underline",href:"https://www.flarehr.com/flare-app-terms-and-conditions",children:"Terms & Conditions"})," ","and acknowledge and consent to your data being processed in accordance with Flare's"," ",t(ye,{className:"text-primary underline",href:"https://www.flarehr.com/privacy-policy",children:"Privacy Policy"}),"."]})]})},Gi=({userProfile:e,isCategoryOpen:n})=>{const a=Ki({names:[J.Consent,J.CustomerRegistration]});h(()=>{(async()=>await te.setWorkplaceLinkConfig())()},[]);const s=H(()=>!a.isReady||!a.treatments[J.Consent]||!a.treatments[J.CustomerRegistration]?[]:[{stepType:"Consent",isRequired:()=>a.treatments[J.Consent].treatment==="on"&&(e==null?void 0:e.benefitsProfile.hasConsent)===!1},{stepType:"WorkplaceLink",isRequired:()=>{var k;return a.treatments[J.CustomerRegistration].treatment==="on"&&((k=e==null?void 0:e.workplaceLinkConfig)==null?void 0:k.isEstablished)===!1}},{stepType:"Allowance",isRequired:()=>{var b;return((b=e==null?void 0:e.featureFlags)==null?void 0:b.allowance)===!0}}].filter(b=>b.isRequired()),[a,e]),i=M();h(()=>{s.length>0&&(i.current=s[0])},[s]);const[r,c]=f(!1);h(()=>{c(s.length>0&&!n)},[s.length,n]),h(()=>{be.updateIsWelcomeModalOpen(r)},[r]);const l=()=>{var b;(b=e==null?void 0:e.benefitsProfile)!=null&&b.hasConsent||te.saveUserConsent()},m=()=>{qe.lock(5e3),te.updateCustomerIdAsync(qe.unlockAndFlushQueue),te.setIsEstablished()},o=()=>{te.setIsEstablished()},g=()=>{te.setAllowanceCompleted()},p=s[0]||i.current;return t(et,{isOpen:r,fullWidthMobile:!0,onClose:()=>{},children:t("div",{className:`${(p==null?void 0:p.stepType)==="Allowance"?"md:max-w-[68rem] md:min-h-[30rem] flex justify-center overflow-y-auto":"text-center md:w-[35rem]"} p-8 md:p-16 w-screen`,children:[(p==null?void 0:p.stepType)==="Consent"&&t(qi,{onClick:l,hasNextStep:s.length>1}),(p==null?void 0:p.stepType)==="WorkplaceLink"&&t(Ii,{onComplete:m,onError:o,config:e==null?void 0:e.workplaceLinkConfig}),(p==null?void 0:p.stepType)==="Allowance"&&t(Wi,{onComplete:g})]})})},Ki=e=>{const n=ja(e),[a,s]=f({...n,treatments:{}});return h(()=>{Object.values(n.treatments).some(i=>i.treatment==="control")||s(n)},[n]),a},Me=({category:e})=>{const[n,a]=f();return h(()=>{const s=[Q.signedInUser$.subscribe(i=>{R(i)?a(i.value):a(void 0)})];return()=>{s.map(i=>i.unsubscribe())}},[]),t(w,{children:[t(pt,{history:yt(gt()),children:[t(F,{path:"/",component:_e}),t(F,{path:"/categories/:category",component:_e}),t(F,{path:"/landing/:slug",component:_e}),t(F,{path:"/wellbeing-hub/:subroute*",component:di}),t(F,{default:!0,component:_e})]}),t(Gi,{userProfile:n,isCategoryOpen:!!e})]})},qn=e=>{analytics.identify(e.basicProfile.profileId,{profile:e.basicProfile.profileId,account:e.basicProfile.accountId,partner:e.basicProfile.partnerId,benefitsRole:e.benefitsProfile.role})},Qi=e=>{const n=`${e.eventName} ${e.eventAction}`,a={...e};delete a.eventName,delete a.eventAction,analytics.track(n,a)},Yi=e=>()=>{},vc={identifyUser:qn,trackEvent:Qi,handleTrackingOnClick:Yi},Xi=Ba(()=>$a(()=>import("./index-6bf06c19.js"),["assets/index-6bf06c19.js","assets/vendor-1c5ad091.js","assets/lodash-5d893f8c.js","assets/framer-motion-04a96014.js","assets/date-fns-20ad091e.js","assets/oidc-client-6f6e47c2.js","assets/@splitsoftware-dc67820b.js","assets/datadog-52cc8f8a.js"])),Ji=()=>{const[e,n]=f({user:C}),[a,s]=f(!1),[i,r]=f(!1),[c,l]=f(),[m,o]=f({}),{service:g}=O();if(typeof window<"u"&&window.location.pathname.replace("/benefits/app","")!=="/")return window.location.pathname="/benefits/app/",null;h(()=>{(async()=>{if(await _.fetchConfigAsync(),De.extractRedirectPath(),De.extractMode(),De.extractTrackingParameters(),G.tokenExists(window.location.search)){await G.signOut(),await G.initFromToken(window.location.pathname,window.location.search);return}r(!0)})();const b=[Q.signedInUser$.subscribe(k=>{n({user:k}),R(k)&&qn(k.value)}),dn.authState$.subscribe(async({authStatus:k,jwt:v})=>{R(v)&&k===z.Authenticated?(await G.refreshIfExpired(),D.setParameters(_.getConfig().apiBaseUrl,v.value),se.setParameters(_.getConfig().apolloBaseUrl,v.value),qa.setParameters(_.getConfig().apiV2BaseUrl,v.value),te.extractProfileId(v.value),await te.loadSignedInUserProfileAsync(),s(k===z.Authenticated)):s(!1)})];return()=>{b.map(k=>k.unsubscribe())}},[]);const p=b=>{switch(b.url.replace(/^\/+/,"").split("/")[0]){case"":P.update({appView:"employee",navTab:"benefits"});break;case"admin":P.update({appView:"admin",navTab:"benefits"});break;case"wellbeing-hub":P.update({appView:"employee",navTab:"wellbeing"});break}};return h(()=>{if(i&&a){g.trackAppLoadedAsync();const b=Q.getValue().deepLink;R(b)&&(g.trackDeepLinkOpenedAsync(b.value),P.update({deepLink:C}))}},[i,a]),h(()=>{if(i&&a&&R(e.user)){const b=e.user.value.basicProfile,v={core:{authorizationKey:_.getConfig().splitAuthorizationKey,key:b.profileId}},x={accountId:b.accountId,partnerId:b.partnerId};o(x),l(v)}},[i,a,e.user]),i?t("div",{id:"preact_root",className:"min-h-screen",children:t(Wa,{config:c,attributes:m,children:t(fn.Provider,{value:a,children:t(q.Provider,{value:e.user,children:t(pt,{history:yt(gt()),onChange:p,children:[t(xe,{path:"/",component:Me}),t(xe,{path:"/categories/:category",component:Me}),t(xe,{path:"/landing/:slug",component:Me}),t(xe,{path:"/wellbeing-hub/:subroute*",component:Me}),t(xe,{path:"/admin/:subroute*",component:Xi}),t(F,{path:"/oidc/:mode*",component:is}),t(F,{path:"/b2c/:fragment",component:cs}),t(F,{path:"/workplace-link",component:je}),t(F,{path:"state=:fragment*",component:je}),t(F,{path:"/code*",component:je}),t(pn,{default:!0})]})})})})}):t(Ze,{})};typeof window<"u"&&(Ra({storage:window.sessionStorage,key:"benefits-client-v2"}),_a(),Ma.polyfill(),za());Ua(t(Da,{children:t(Va,{fallback:pn,children:t(Ji,{})})}),document.body);export{D as B,Tn as D,bt as H,jr as I,Ee as L,et as M,xt as P,Dt as U,O as a,Pe as b,Y as c,q as d,qa as e,ee as f,ln as g,hs as h,ze as i,K as j,Fr as k,yc as l,vc as m,bc as n,gc as o,hc as p,Dr as q,pc as r,fc as s,uc as t,rt as u,B as v,vt as w,re as x,rn as y,yt as z};
32
+ `}),s.map((r,c)=>t("div",{onClick:()=>n==null?void 0:n(c),className:Oa("text-sm font-medium cursor-auto h-full relative","flex items-center justify-center",c===e?"text-primary":"text-gray-400",i.length>0?"hover:before:cursor-pointer":"hover:before:cursor-default","hover:before:w-16 hover:before:h-16 hover:before:absolute"),children:r},r.key))]}),i.map((r,c)=>t(Oi,{visible:c===e,children:r},r.key))]})},Ri=e=>{var i,r,c,l,m;const n=oe(q),a=T(n,void 0),s=M(null);return h(()=>{re.commandAsync({eventType:"OfferViewed",offerName:e.marketPlaceOffer.name,data:e.marketPlaceOffer.metadata},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName}),s.current&&(s.current.terms=e.marketPlaceOffer.content.terms,s.current.details=e.marketPlaceOffer.content.details,s.current["on-accept"]=()=>{re.commandAsync({eventType:"OfferProgressed",offerName:e.marketPlaceOffer.name,data:{...e.marketPlaceOffer.metadata,template:e.marketPlaceOffer.content.template,assessmentId:e.marketPlaceOffer.content.assessmentId,accepted:!0}},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName})},s.current["on-decline"]=()=>{re.commandAsync({eventType:"OfferProgressed",offerName:e.marketPlaceOffer.name,data:{...e.marketPlaceOffer.metadata,template:e.marketPlaceOffer.content.template,assessmentId:e.marketPlaceOffer.content.assessmentId,accepted:!1}},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName}),e.onStepComplete(!1)},s.current["on-complete"]=()=>e.onStepComplete(!0),s.current["on-skip"]=e.marketPlaceOffer.content.skipButtonHidden?void 0:()=>e.onStepComplete(!1))},[]),(i=a==null?void 0:a.workplaceLinkConfig)!=null&&i.workplaceBackendToken?t("benefits-plan-assessment",{"base-url":_.getConfig().apolloBaseUrl,"profile-id":a==null?void 0:a.basicProfile.profileId,"skip-more-details":!0,"access-token":(r=a==null?void 0:a.workplaceLinkConfig)==null?void 0:r.workplaceBackendToken,"image-url":e.marketPlaceOffer.content.imageUrl,"assessment-id":e.marketPlaceOffer.content.assessmentId,"assessment-instructions":e.marketPlaceOffer.content.assessmentInstructions,"track-experiment":e.marketPlaceOffer.metadata.featureName,"track-treatment":e.marketPlaceOffer.metadata.treatmentName,"track-client":"webBenefits","track-source":"WebBenefits","track-channel":"web","marketplace-offer-name":e.marketPlaceOffer.name,"assessment-title":e.marketPlaceOffer.content.title,description:e.marketPlaceOffer.content.description,"accept-button":e.marketPlaceOffer.content.acceptButton,"decline-button":e.marketPlaceOffer.content.declineButton,"special-banner-title":(c=e.marketPlaceOffer.content.specialBanner)==null?void 0:c.title,"special-banner-subtitle":(l=e.marketPlaceOffer.content.specialBanner)==null?void 0:l.subtitle,"special-banner-type":(m=e.marketPlaceOffer.content.specialBanner)==null?void 0:m.type,"vertical-alignment":"items-center",ref:s}):null},_i=({navigate:e})=>{const[n,a]=f(0),[s,i]=f(!1),[r,c]=f([]);h(()=>{vn().then(c)},[]);const l=ce(o=>{if(o&&i(!0),n===r.length-1){const p=r.some(b=>b.name==="Perks");e(`/allowance/summary/${s||o?"true":"false"}/${p?"true":"false"}`)}else a(n+1)},[n,s]),m=ce(o=>{a(o);const g=r[o];g&&re.commandAsync({eventType:"OfferSelected",offerName:g.name,data:g.metadata},{experiment:g.metadata.featureName,treatment:g.metadata.treatmentName})},[]);return t("div",{className:"max-w-[59.5rem] mx-auto",children:t($i,{selectedIndex:n,onChange:m,children:[r.map(o=>t(Hn,{label:o.content.productName,icon:t(Bi,{iconUrl:o.content.iconUrl})},o.name)),r.map(o=>t(zn,{children:o.content.template==="Assessment"&&t(Ri,{onStepComplete:l,marketPlaceOffer:o},o.name)},o.name))]})})},Mi=e=>{var i;const n=oe(q),a=M(null),s=T(n,void 0);return h(()=>{a.current&&(a.current["on-complete"]=()=>e.navigate("/allowance/intro"))},[]),t("div",{className:"flex justify-center",children:t("benefits-plan-assessment",{"base-url":_.getConfig().apolloBaseUrl,"profile-id":s==null?void 0:s.basicProfile.profileId,"skip-intro":!0,"skip-more-details":!0,"skip-summary":!0,"access-token":(i=s==null?void 0:s.workplaceLinkConfig)==null?void 0:i.workplaceBackendToken,"assessment-id":"benefits-personalisation-assessment","track-client":"webBenefits","track-source":"WebBenefits","track-channel":"web","assessment-title":"Tell us a bit about yourself",description:"Answer a few questions to help us set up a personalised benefits plan for you:","vertical-alignment":"items-center",ref:a})})},Ui=({title:e,className:n,children:a,...s})=>{var m;const[i,r]=f(!1),c=M(null),l=ce(()=>{r(!i)},[i]);return t("div",{className:`border border-2 border-gray-300 p-2 rounded-md overflow-hidden w-full ${n??""}`,...s,children:[t("div",{className:"mx-2 flex justify-between cursor-pointer",onClick:l,children:[t("span",{className:"text-base text-left font-semibold text-primary",children:e}),t("span",{className:"text-base text-left font-semibold text-gray-500",children:i?"-":"+"})]}),t("div",{ref:c,className:"flex justify-center transition-all ease-in-out duration-1000",style:{height:i?`${((m=c==null?void 0:c.current)==null?void 0:m.scrollHeight)??0}px`:"0px",opacity:i?1:0},children:a})]})},Vi="/benefits/app/assets/check-c15931a5.svg",Di=({title:e,steps:n,...a})=>{const s=n.length,i=n.filter(r=>r.completed).length;return t("div",{...a,children:[e&&t("h1",{className:"text-lg font-semibold mb-4",children:e}),t("ol",{children:n.map((r,c)=>{const l=i===c;return t("li",{className:`relative flex-1 pb-6 ${c!==s-1?`after:content-[''] after:w-0.5 after:h-[calc(100%-theme(height.8))] ${r.completed?"after:bg-primary":"after:bg-gray-300"} after:inline-block after:absolute after:top-8 after:left-4`:""}`,children:t("div",{className:"flex font-medium w-full",children:[t("span",{className:`w-8 h-8 flex-shrink-0 ${r.completed?"bg-primary":"bg-white"} border-2 ${r.completed||l?"border-primary":"border-gray-300"} rounded-full flex justify-center items-center mr-3 text-sm ${l?"text-primary":"text-gray-500"}`,children:r.completed?t("img",{className:"w-4 h-4",src:Vi}):c+1}),t("div",{children:[t("h4",{className:`text-sm text-left font-semibold ${r.completed||l?"text-primary":"text-gray-600"}`,children:r.title}),t("p",{className:"text-sm text-left font-normal",children:r.description})]})]})},c)})})]})},Xt="allowance",Fi=({hasCompletedAnyOffers:e,isAppEnabled:n,onComplete:a})=>{h(()=>{const l=ji({isAppEnabled:n,hasCompletedAnyOffers:e});re.commandAsync({eventType:"SummaryViewed",summaryVariant:l},{treatment:Xt})},[n,e]);const[s,i]=f();h(()=>{(async()=>{const l=await ee.loadAllowanceContentAsync(e?"benefits-setup-summary-allowance":"benefits-setup-summary-allowance-no-selection");i(l.items[0].fields)})()},[]);const r=oe(q),c=T(r,void 0);return s?t(ie,{children:[t(ie.Top,{children:t("div",{className:"flex flex-col gap-4",children:[t(Dn,{children:s.title}),t(Fn,{children:s.description})]})}),t(ie.Bottom,{children:t("div",{className:"mt-5 flex flex-col items-center gap-5 text-center",children:[s.specialContent?t(Ui,{className:"lg:w-3/4",title:s.specialContent.title,children:t(Di,{steps:Ls(s.specialContent.content,1),className:"mt-2 rounded-md px-6 py-4"})}):null,t(Vn,{testId:"allowance_set_up_benefits_button_next_screen",class:"mt-5 w-full md:w-[240px]",onClickPromise:async()=>{var o;const l=(o=c==null?void 0:c.workplaceLinkConfig)==null?void 0:o.workplaceBackendToken,m=c==null?void 0:c.basicProfile.profileId;await Promise.all([re.commandAsync({eventType:"Completed"},{treatment:Xt}),l&&m?gn(l,m).url("/benefits-plan/workplace-backend/v1.0/allowance/complete").post():void 0]),a()},children:s.primaryAction})]})})]}):t("div",{className:"text-primary",children:t(Ee,{size:6})})},ji=({isAppEnabled:e,hasCompletedAnyOffers:n})=>{switch(!0){case(e&&n):return"allowance-accepted-app";case(e&&!n):return"allowance-declined-app";case(!e&&n):return"allowance-accepted-noapp";default:return"allowance-declined-noapp"}},Wi=({onComplete:e})=>{const n=oe(q),a=T(n,void 0),[s,i]=f("/allowance"),r=c=>i(c);return t("div",{className:"flex items-center",children:(()=>{var c;if(!((c=a==null?void 0:a.workplaceLinkConfig)!=null&&c.workplaceBackendToken))return t("div",{className:"text-primary",children:t(Ee,{size:10})});if(s==="/allowance/intro")return t(Li,{navigate:r,onComplete:e});if(s==="/allowance/offers")return t(_i,{navigate:r});if(s.startsWith("/allowance/summary/")){const l=s.replace("/allowance/summary/","").split("/");return t(Fi,{isAppEnabled:l[1]==="true",hasCompletedAnyOffers:l[0]==="true",onComplete:e})}return t(Mi,{navigate:r})})()})},Hi="/benefits/app/assets/welcome_image_mobile-dbde6c80.png",zi="/benefits/app/assets/welcome_image_v2-869c59e4.png",qi=({hasNextStep:e,onClick:n})=>{const{service:a}=O();h(()=>{a.trackConsentStartedAsync()},[]);const s=()=>{a.trackConsentCompletedAsync(),n()},i=e?"Get started":"Start exploring your benefits";return t("div",{children:[t("div",{className:"min-h-[12rem] items-center hidden md:flex",children:t("img",{className:"mx-auto align-middle w-[30rem]",src:zi})}),t("div",{className:"min-h-[8rem] flex items-center md:hidden",children:t("img",{className:"mx-auto align-middle w-[30rem]",src:Hi})}),t("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3 mt-4",children:[t("span",{className:"w-full block",children:"Welcome to your"}),t("span",{className:"w-full block",children:"workplace benefits"})]}),t("p",{className:"text-base leading-6 font-normal text-gray-500 mb-6",children:"Get access to savings and perks from Australia’s most-loved brands, plus special offers to help you save on bigger expenses like household utilities, health insurance and more."}),t(le,{className:"md:w-full md:text-base py-3 mb-6 focus:outline-none",onClick:s,children:i}),t("p",{className:"text-xs leading-4 font-normal text-gray-500 mb-0",children:["By clicking “",i,"” you accept the"," ",t(ye,{className:"text-primary underline",href:"https://www.flarehr.com/flare-app-terms-and-conditions",children:"Terms & Conditions"})," ","and acknowledge and consent to your data being processed in accordance with Flare's"," ",t(ye,{className:"text-primary underline",href:"https://www.flarehr.com/privacy-policy",children:"Privacy Policy"}),"."]})]})},Gi=({userProfile:e,isCategoryOpen:n})=>{const a=Ki({names:[J.Consent,J.CustomerRegistration]});h(()=>{(async()=>await te.setWorkplaceLinkConfig())()},[]);const s=H(()=>!a.isReady||!a.treatments[J.Consent]||!a.treatments[J.CustomerRegistration]?[]:[{stepType:"Consent",isRequired:()=>a.treatments[J.Consent].treatment==="on"&&(e==null?void 0:e.benefitsProfile.hasConsent)===!1},{stepType:"WorkplaceLink",isRequired:()=>{var k;return a.treatments[J.CustomerRegistration].treatment==="on"&&((k=e==null?void 0:e.workplaceLinkConfig)==null?void 0:k.isEstablished)===!1}},{stepType:"Allowance",isRequired:()=>{var b;return((b=e==null?void 0:e.featureFlags)==null?void 0:b.allowance)===!0}}].filter(b=>b.isRequired()),[a,e]),i=M();h(()=>{s.length>0&&(i.current=s[0])},[s]);const[r,c]=f(!1);h(()=>{c(s.length>0&&!n)},[s.length,n]),h(()=>{be.updateIsWelcomeModalOpen(r)},[r]);const l=()=>{var b;(b=e==null?void 0:e.benefitsProfile)!=null&&b.hasConsent||te.saveUserConsent()},m=()=>{qe.lock(5e3),te.updateCustomerIdAsync(qe.unlockAndFlushQueue),te.setIsEstablished()},o=()=>{te.setIsEstablished()},g=()=>{te.setAllowanceCompleted()},p=s[0]||i.current;return t(et,{isOpen:r,fullWidthMobile:!0,onClose:()=>{},children:t("div",{className:`${(p==null?void 0:p.stepType)==="Allowance"?"md:max-w-[68rem] md:min-h-[30rem] flex justify-center overflow-y-auto":"text-center md:w-[35rem]"} p-8 md:p-16 w-screen`,children:[(p==null?void 0:p.stepType)==="Consent"&&t(qi,{onClick:l,hasNextStep:s.length>1}),(p==null?void 0:p.stepType)==="WorkplaceLink"&&t(Ii,{onComplete:m,onError:o,config:e==null?void 0:e.workplaceLinkConfig}),(p==null?void 0:p.stepType)==="Allowance"&&t(Wi,{onComplete:g})]})})},Ki=e=>{const n=ja(e),[a,s]=f({...n,treatments:{}});return h(()=>{Object.values(n.treatments).some(i=>i.treatment==="control")||s(n)},[n.isReady,n.treatments]),a},Me=({category:e})=>{const[n,a]=f();return h(()=>{const s=[Q.signedInUser$.subscribe(i=>{R(i)?a(i.value):a(void 0)})];return()=>{s.map(i=>i.unsubscribe())}},[]),t(w,{children:[t(pt,{history:yt(gt()),children:[t(F,{path:"/",component:_e}),t(F,{path:"/categories/:category",component:_e}),t(F,{path:"/landing/:slug",component:_e}),t(F,{path:"/wellbeing-hub/:subroute*",component:di}),t(F,{default:!0,component:_e})]}),t(Gi,{userProfile:n,isCategoryOpen:!!e})]})},qn=e=>{analytics.identify(e.basicProfile.profileId,{profile:e.basicProfile.profileId,account:e.basicProfile.accountId,partner:e.basicProfile.partnerId,benefitsRole:e.benefitsProfile.role})},Qi=e=>{const n=`${e.eventName} ${e.eventAction}`,a={...e};delete a.eventName,delete a.eventAction,analytics.track(n,a)},Yi=e=>()=>{},vc={identifyUser:qn,trackEvent:Qi,handleTrackingOnClick:Yi},Xi=Ba(()=>$a(()=>import("./index-9ce2ee20.js"),["assets/index-9ce2ee20.js","assets/vendor-1c5ad091.js","assets/lodash-5d893f8c.js","assets/framer-motion-04a96014.js","assets/date-fns-20ad091e.js","assets/oidc-client-6f6e47c2.js","assets/@splitsoftware-dc67820b.js","assets/datadog-c27a43eb.js"])),Ji=()=>{const[e,n]=f({user:C}),[a,s]=f(!1),[i,r]=f(!1),[c,l]=f(),[m,o]=f({}),{service:g}=O();if(typeof window<"u"&&window.location.pathname.replace("/benefits/app","")!=="/")return window.location.pathname="/benefits/app/",null;h(()=>{(async()=>{if(await _.fetchConfigAsync(),De.extractRedirectPath(),De.extractMode(),De.extractTrackingParameters(),G.tokenExists(window.location.search)){await G.signOut(),await G.initFromToken(window.location.pathname,window.location.search);return}r(!0)})();const b=[Q.signedInUser$.subscribe(k=>{n({user:k}),R(k)&&qn(k.value)}),dn.authState$.subscribe(async({authStatus:k,jwt:v})=>{R(v)&&k===z.Authenticated?(await G.refreshIfExpired(),D.setParameters(_.getConfig().apiBaseUrl,v.value),se.setParameters(_.getConfig().apolloBaseUrl,v.value),qa.setParameters(_.getConfig().apiV2BaseUrl,v.value),te.extractProfileId(v.value),await te.loadSignedInUserProfileAsync(),s(k===z.Authenticated)):s(!1)})];return()=>{b.map(k=>k.unsubscribe())}},[]);const p=b=>{switch(b.url.replace(/^\/+/,"").split("/")[0]){case"":P.update({appView:"employee",navTab:"benefits"});break;case"admin":P.update({appView:"admin",navTab:"benefits"});break;case"wellbeing-hub":P.update({appView:"employee",navTab:"wellbeing"});break}};return h(()=>{if(i&&a){g.trackAppLoadedAsync();const b=Q.getValue().deepLink;R(b)&&(g.trackDeepLinkOpenedAsync(b.value),P.update({deepLink:C}))}},[i,a]),h(()=>{if(i&&a&&R(e.user)){const b=e.user.value.basicProfile,v={core:{authorizationKey:_.getConfig().splitAuthorizationKey,key:b.profileId}},x={accountId:b.accountId,partnerId:b.partnerId};o(x),l(v)}},[i,a,e.user]),i?t("div",{id:"preact_root",className:"min-h-screen",children:t(Wa,{config:c,attributes:m,children:t(fn.Provider,{value:a,children:t(q.Provider,{value:e.user,children:t(pt,{history:yt(gt()),onChange:p,children:[t(xe,{path:"/",component:Me}),t(xe,{path:"/categories/:category",component:Me}),t(xe,{path:"/landing/:slug",component:Me}),t(xe,{path:"/wellbeing-hub/:subroute*",component:Me}),t(xe,{path:"/admin/:subroute*",component:Xi}),t(F,{path:"/oidc/:mode*",component:is}),t(F,{path:"/b2c/:fragment",component:cs}),t(F,{path:"/workplace-link",component:je}),t(F,{path:"state=:fragment*",component:je}),t(F,{path:"/code*",component:je}),t(pn,{default:!0})]})})})})}):t(Ze,{})};typeof window<"u"&&(Ra({storage:window.sessionStorage,key:"benefits-client-v2"}),_a(),Ma.polyfill(),za());Ua(t(Da,{children:t(Va,{fallback:pn,children:t(Ji,{})})}),document.body);export{D as B,Tn as D,bt as H,jr as I,Ee as L,et as M,xt as P,Dt as U,O as a,Pe as b,Y as c,q as d,qa as e,ee as f,ln as g,hs as h,ze as i,K as j,Fr as k,yc as l,vc as m,bc as n,gc as o,hc as p,Dr as q,pc as r,fc as s,uc as t,rt as u,B as v,vt as w,re as x,rn as y,yt as z};
package/dist/index.html CHANGED
@@ -84,14 +84,14 @@
84
84
  }
85
85
  })();
86
86
  </script>
87
- <script type="module" crossorigin src="/benefits/app/assets/index-c4919830.js"></script>
87
+ <script type="module" crossorigin src="/benefits/app/assets/index-a3cf435b.js"></script>
88
88
  <link rel="modulepreload" crossorigin href="/benefits/app/assets/lodash-5d893f8c.js">
89
89
  <link rel="modulepreload" crossorigin href="/benefits/app/assets/vendor-1c5ad091.js">
90
90
  <link rel="modulepreload" crossorigin href="/benefits/app/assets/oidc-client-6f6e47c2.js">
91
91
  <link rel="modulepreload" crossorigin href="/benefits/app/assets/@splitsoftware-dc67820b.js">
92
92
  <link rel="modulepreload" crossorigin href="/benefits/app/assets/date-fns-20ad091e.js">
93
93
  <link rel="modulepreload" crossorigin href="/benefits/app/assets/framer-motion-04a96014.js">
94
- <link rel="modulepreload" crossorigin href="/benefits/app/assets/datadog-52cc8f8a.js">
94
+ <link rel="modulepreload" crossorigin href="/benefits/app/assets/datadog-c27a43eb.js">
95
95
  <link rel="stylesheet" href="/benefits/app/assets/index-dff3b0d2.css">
96
96
  </head>
97
97
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flarehr/apollo-benefits",
3
- "version": "2.88.50785",
3
+ "version": "2.89.56619",
4
4
  "license": "MIT",
5
5
  "description": "Flare Benefits",
6
6
  "files": [