@flarehr/workflows-app 0.1.3442 → 0.1.3446
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.
|
Binary file
|
package/dist/app-invite/qr.png
CHANGED
|
Binary file
|
package/dist/workflows-app.js
CHANGED
|
@@ -806,7 +806,7 @@ Thoth.Json.Net only support the following enum types:
|
|
|
806
806
|
- int
|
|
807
807
|
- uint32
|
|
808
808
|
If you can't use one of these types, please pass an extra decoder.
|
|
809
|
-
`))(c);return m=>p(m)}}else if(Vu(r))if(Ao(r)){const f=nr(c=>St(e,t,!1,c),Uu(r));return c=>p=>Array.isArray(p)?wt(m=>jm(ir(m)),fh(0,f,c,p)):new h(1,[[c,new L(0,["an array",p])]])}else switch(pe(Fu(r))){case"Microsoft.FSharp.Core.FSharpOption`1[System.Object]":return i=St(e,t,!0,ee(0,Qe(r))),c=>p=>bb(Q(i),c,p);case"Microsoft.FSharp.Collections.FSharpList`1[System.Object]":return s=St(e,t,!1,ee(0,Qe(r))),c=>p=>lh(Q(s),c,p);case"System.Collections.Generic.IEnumerable`1[System.Object]":return o=St(e,t,!1,ee(0,Qe(r))),c=>p=>Cb(Q(o),c,p);case"Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]":{const c=St(e,t,!1,ee(0,Qe(r))),p=St(e,t,!1,ee(1,Qe(r)));let m;const $=_([g=>w=>Pb(Q(c),Q(p),g,w),(a=Ib(Q(c),Q(p)),g=>w=>lh(Q(a),g,w))]);return m=g=>w=>Sb($,g,w),g=>w=>xb(Ab,Q(m),g,w)}case"Microsoft.FSharp.Collections.FSharpSet`1[System.Object]":{const c=St(e,t,!1,ee(0,Qe(r)));return p=>m=>{const $=uh(Q(c),p,m);return $.tag===0?new h(0,[Eb($.fields[0])]):new h(1,[$.fields[0]])}}default:return hh(e,t,n,r)}else switch(l){case"System.Boolean":return f=>c=>$b(f,c);case"Microsoft.FSharp.Core.Unit":return f=>c=>pb(f,c);case"System.String":return f=>c=>eh(f,c);case"System.Char":return f=>c=>hb(f,c);case"System.SByte":return th;case"System.Byte":return nh;case"System.Int16":return rh;case"System.UInt16":return ih;case"System.Int32":return sh;case"System.UInt32":return oh;case"System.Double":return f=>c=>gb(f,c);case"System.Single":return f=>c=>wb(f,c);case"System.DateTime":return f=>c=>yb(f,c);case"System.DateTimeOffset":return f=>c=>_b(f,c);case"System.TimeSpan":return f=>c=>vb(f,c);case"System.Guid":return f=>c=>mb(f,c);case"System.Object":return f=>c=>new h(0,[c]);default:return hh(e,t,n,r)}else{const f=u;return c=>p=>f.contents(c)(p)}}function Ob(e){return fl({Compare:Bi})}function tn(e,t,n){const r=be(t,new Ne(0,[]));return St(Ob(),r,!1,e)}class Mb{constructor(t){this.magicLink=t,this.backendUrl=`${Bn}/workflows/public-backend/invites/${this.magicLink.InviteToken}`}}function Db(e){return new Mb(e)}function Nb(e){return E.Delay(()=>{let t,n;const r=bi(e,(t=Jt(new Dt(1,[]),Yt(`${e.backendUrl}/magic-link/validate`)),Zt(new Nt(1,[(n=new w0(e.magicLink.MagicCode),Xt(0,Qt(V_(),new Ne(1,[]),void 0,void 0)(n)))]),t)));return E.Bind(r,i=>{const s=i;if(s.tag===1)return E.Return(new h(1,[s.fields[0]]));{let o;const a=s.fields[0];return o=a.statusCode===200?en(Q(tn(G_(),new Ne(1,[]))),a.responseText):new h(1,["Unexpected response from backend"]),E.Return(o)}})})}function Rb(e,t){return E.Delay(()=>{let n,r;const i=bi(e,(n=Jt(new Dt(1,[]),Yt(`${e.backendUrl}/magic-link/reissue`)),Zt(new Nt(1,[(r=new y0(e.magicLink.MagicCode,t),Xt(0,Qt(q_(),new Ne(1,[]),void 0,void 0)(r)))]),n)));return E.Bind(i,s=>{const o=s;if(o.tag===1)return E.Return(new h(1,[o.fields[0]]));{let a;const l=o.fields[0];return a=l.statusCode===200?en(Q(tn(X_(),new Ne(1,[]))),l.responseText):new h(1,["Unexpected response from backend"]),E.Return(a)}})})}function Bb(e,t){return E.Delay(()=>{let n,r;const i=bi(e,(n=Jt(new Dt(1,[]),Yt(`${e.backendUrl}/one-time-code/issue`)),Zt(new Nt(1,[(r=new _0(e.magicLink.MagicCode,t),Xt(0,Qt(K_(),new Ne(1,[]),void 0,void 0)(r)))]),n)));return E.Bind(i,s=>{const o=s;if(o.tag===1)return E.Return(new h(1,[o.fields[0]]));{let a;const l=o.fields[0];return a=l.statusCode===200?en(Q(tn(n2(),new Ne(1,[]))),l.responseText):new h(1,["Unexpected response from backend"]),E.Return(a)}})})}function Lb(e,t){return E.Delay(()=>{let n,r;const i=bi(e,(n=Jt(new Dt(1,[]),Yt(`${e.backendUrl}/one-time-code/validate`)),Zt(new Nt(1,[(r=new v0(t),Xt(0,Qt(r2(),new Ne(1,[]),void 0,void 0)(r)))]),n)));return E.Bind(i,s=>{const o=s;if(o.tag===1)return E.Return(new h(1,[o.fields[0]]));{let a;const l=o.fields[0];return a=l.statusCode===200?en(Q(tn(a2(),new Ne(1,[]))),l.responseText):new h(1,["Unexpected response from backend"]),E.Return(a)}})})}function Vb(e,t){return E.Delay(()=>{let n,r;const i=bi(e,(n=Jt(new Dt(1,[]),Yt(`${e.backendUrl}/progress`)),Zt(new Nt(1,[(r=new b0(e.magicLink.MagicCode,t),Xt(0,Qt(l2(),new Ne(1,[]),void 0,void 0)(r)))]),n)));return E.Bind(i,s=>{const o=s;if(o.tag===1)return E.Return(new h(1,[o.fields[0]]));{let a;const l=o.fields[0];return a=l.statusCode===200?en(Q(tn(d2(),new Ne(1,[]))),l.responseText):new h(1,["Unexpected response from backend"]),E.Return(a)}})})}function bi(e,t){return E.Delay(()=>{let n;const r=yi(t);return n=E.Bind(r,i=>E.Return(new h(0,[i]))),E.Bind(n,i=>{const s=i;if(s.tag===1)return E.Return(new h(1,[s.fields[0]]));{const o=s.fields[0];if(o.statusCode===429||o.statusCode>=500){let a;const l=$s(2e3);return a=E.Bind(l,u=>E.Return(new h(0,[u]))),E.Bind(a,u=>{const f=u;if(f.tag===1)return E.Return(new h(1,[f.fields[0]]));{const c=yi(t);return E.Bind(c,p=>E.Return(new h(0,[p])))}})}else return E.Return(new h(0,[o]))}})})}class Fb extends N{constructor(t){super(),this.tag=0,this.fields=[t]}cases(){return["AuthCode"]}}function dl(e){return new Fb(e)}function Wb(e){return e.fields[0]}class mh extends R{constructor(t,n,r,i,s,o){super(),this.id_token=t,this.access_token=n,this.expires_in=r,this.refresh_token=i,this.scope=s,this.token_type=o}}function hl(){return ne("Workflows.UI.Auth.Types.Credentials",[],mh,()=>[["id_token",H],["access_token",H],["expires_in",Rm],["refresh_token",J(H)],["scope",H],["token_type",H]])}let Wn=class extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["SignIn","SignInWithCurrentAuth","NavigateToOnboarding"]}};function jb(){return[new il(le(),new G(0,[]),void 0,void 0,new $0(0,[new g0(void 0)])),T(e=>{e(new U(1,[new _e(0,[])]))})]}function Ub(e,t,n,r,i){let s,o,a,l,u,f,c;const p=Db(e);switch(r.tag){case 1:if(r.fields[0].tag===1){if(r.fields[0].fields[0].tag===1)return[i,T(m=>{m(new U(0,[new G(6,[new re(5,[])])]))})];{let m;const $=r.fields[0].fields[0].fields[0].Outcome;switch($.tag){case 1:{const g=$.fields[0],w=g.OneTimeCodeOptionAvailable;m=g.IsInitialMagicLinkUsed?w?new U(0,[new G(1,[g.FirstName,new rl(1,[])])]):new U(0,[new G(1,[g.FirstName,new rl(0,[])])]):w?new U(3,[!1,new _e(0,[])]):new U(0,[new G(4,[])]);break}case 4:{m=new U(0,[new G(5,[])]);break}case 2:case 7:{m=new U(0,[new G(6,[new re(2,[])])]);break}case 3:{m=new U(0,[new G(6,[new re(4,[])])]);break}case 5:{m=new U(0,[new G(6,[new re(3,[])])]);break}case 6:{m=new U(0,[new G(6,[new re(1,[])])]);break}default:{const g=$.fields[0];g.IsInitialMagicLinkUsed?(n(dl(g.AuthCode)),m=new U(0,[new G(1,[g.FirstName,new rl(2,[])])])):m=new U(6,[g.AuthCode])}}return[new il(r.fields[0].fields[0].fields[0].CssOverrides,i.Page,j_(r.fields[0].fields[0].fields[0].Outcome),z_(r.fields[0].fields[0].fields[0].Outcome),be(U_(r.fields[0].fields[0].fields[0].Outcome),i.JourneyType)),T(g=>{g(m)})]}}else return[i,bt(m=>{je(m)},()=>Nb(p),void 0,m=>new U(1,[new _e(1,[m])]),m=>new U(1,[new _e(1,[new h(1,[m.message])])]))];case 2:return r.fields[1].tag===1?r.fields[1].fields[0].tag===1?[i,T(m=>{m(new U(0,[new G(6,[new re(5,[])])]))})]:[i,(s=new U(0,[(o=r.fields[1].fields[0].fields[0].Outcome,o.tag===2?new G(2,[o.fields[0].MaskedEmail]):o.tag===1?new G(6,[new re(2,[])]):o.tag===5?new G(6,[new re(2,[])]):o.tag===3?new G(6,[new re(4,[])]):o.tag===4?new G(6,[new re(1,[])]):o.tag===6?new G(5,[]):o.tag===7?new G(6,[new re(3,[])]):new G(2,[o.fields[0].MaskedEmail]))]),T(m=>{m(s)}))]:[i,bt(m=>{je(m)},m=>Rb(p,m),r.fields[0],m=>new U(2,[r.fields[0],new _e(1,[m])]),m=>new U(2,[r.fields[0],new _e(1,[new h(1,[m.message])])]))];case 3:return r.fields[1].tag===1?r.fields[1].fields[0].tag===1?[i,T(m=>{m(new U(0,[new G(6,[new re(5,[])])]))})]:[i,(a=new U(0,[(l=r.fields[1].fields[0].fields[0].Outcome,l.tag===1?new G(4,[]):l.tag===2?new G(6,[new re(0,[])]):l.tag===3?r.fields[0]?i.Page:new G(3,[l.fields[0].MaskedPhone]):l.tag===4?new G(6,[new re(2,[])]):l.tag===7?new G(6,[new re(2,[])]):l.tag===5?new G(6,[new re(4,[])]):l.tag===6?new G(6,[new re(1,[])]):l.tag===8?new G(5,[]):l.tag===9?new G(6,[new re(3,[])]):r.fields[0]?i.Page:new G(3,[l.fields[0].MaskedPhone]))]),T(m=>{m(a)}))]:[i,bt(m=>{je(m)},m=>Bb(p,m),r.fields[0],m=>new U(3,[r.fields[0],new _e(1,[m])]),m=>new U(3,[r.fields[0],new _e(1,[new h(1,[m.message])])]))];case 4:return r.fields[2].tag===1?r.fields[2].fields[0].tag===1?[i,T(m=>{m(new U(0,[new G(6,[new re(5,[])])]))})]:[i,(u=r.fields[2].fields[0].fields[0].Outcome,u.tag===1?u.fields[0].RemainingAttempts>0?(r.fields[1]({AttemptsRemaining:u.fields[0].RemainingAttempts}),z()):T(m=>{m(new U(0,[new G(6,[new re(0,[])])]))}):u.tag===5?T(m=>{m(new U(0,[new G(6,[new re(0,[])])]))}):u.tag===2?(r.fields[1]({}),z()):u.tag===3?(r.fields[1]({}),z()):u.tag===4?(r.fields[1]({}),z()):u.tag===6?T(m=>{m(new U(0,[new G(6,[new re(4,[])])]))}):u.tag===7?T(m=>{m(new U(0,[new G(6,[new re(1,[])])]))}):u.tag===8?T(m=>{m(new U(0,[new G(6,[new re(2,[])])]))}):u.tag===9?T(m=>{m(new U(0,[new G(5,[])]))}):u.tag===10?T(m=>{m(new U(0,[new G(6,[new re(0,[])])]))}):T(m=>{m(new U(6,[u.fields[0].AuthCode]))}))]:[i,bt(m=>{je(m)},m=>Lb(p,m),r.fields[0],m=>new U(4,[r.fields[0],r.fields[1],new _e(1,[m])]),m=>new U(4,[r.fields[0],r.fields[1],new _e(1,[new h(1,[m.message])])]))];case 5:return r.fields[1].tag===1?r.fields[1].fields[0].tag===1?[i,T(m=>{m(new U(0,[new G(6,[new re(5,[])])]))})]:[i,(f=(c=r.fields[1].fields[0].fields[0].Outcome,c.tag===1?new U(0,[new G(6,[new re(2,[])])]):c.tag===4?new U(0,[new G(6,[new re(2,[])])]):c.tag===2?new U(0,[new G(6,[new re(4,[])])]):c.tag===3?new U(0,[new G(6,[new re(1,[])])]):c.tag===5?new U(0,[new G(5,[])]):c.tag===6?new U(0,[new G(6,[new re(0,[])])]):r.fields[0].tag===1?new U(3,[!1,new _e(0,[])]):r.fields[0].tag===2?new U(6,[void 0]):new U(2,[!1,new _e(0,[])])),T(m=>{m(f)}))]:[i,bt(m=>{je(m)},m=>Vb(p,m),r.fields[0].tag===1?!1:r.fields[0].tag===2,m=>new U(5,[r.fields[0],new _e(1,[m])]),m=>new U(5,[r.fields[0],new _e(1,[new h(1,[m.message])])]))];case 6:return t(Ee(dl,r.fields[0])),[i,z()];default:return[new il(i.CssOverrides,r.fields[0],i.Branding,i.ProcessConfigId,i.JourneyType),z()]}}function zb(e,t,n,r,i){const s=os(!1),o=Ee(f=>d("span",{className:"font-semibold",children:`${f}`}),on(f=>f.CompanyName,t)),a=be(Ee(f=>f===ia(fs.Id),n),!1),l=r.tag===1?`Hi, ${e}`:r.tag===3?`Hi, ${e}`:r.tag===4?`Hi, ${e}`:r.tag===2?a?`Hi, ${e}`:`${e}, join your workplace benefits program`:`Welcome, ${e}`,u=ce(A(()=>{let f,c;return j((f=r,f.tag===1?v(Kr([])):f.tag===3?v(Kr([])):f.tag===4?v(Kr([])):f.tag===2?v(a?Kr([]):d("div",S(_([["className","sm:w-[700px]"],(c=[d("img",{src:"/workflows/app/app-invite/welcome.png"})],["children",C.Children.toArray(Array.from(c))])])))):v(Kr([]))),A(()=>j(v(un(l)),A(()=>{let p;return j(v(d("div",S(_([["className","text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4 mb-8 sm:mb-14"],(p=ce(A(()=>{let m;return r.tag===1?j(v(be(o,d("span",{children:["Your employer"]}))),A(()=>j(v(d("span",{children:[" has requested additional information from you."]})),A(()=>v(d("p",{children:["Sign in to complete your information request."]})))))):r.tag===3?v(d("p",{children:["Sign in to set up your benefits."]})):r.tag===4?v(d("p",{children:["Sign in to set up your benefits."]})):r.tag===2?v(a?d("p",{children:["Sign in to set up your benefits."]}):(m="Your employer has partnered with Flare Benefits to give you exclusive 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.",d("p",{children:[m]}))):j(v(d("p",{children:["Congratulations on the new role!"]})),A(()=>{let $;return v(($=_([d("span",{children:["Sign in to complete your onboarding with "]}),be(o,d("span",{children:["your employer"]})),d("span",{children:["."]})]),d("p",{children:C.Children.toArray(Array.from($))})))}))})),["children",C.Children.toArray(Array.from(p))])])))),A(()=>v(Go(void 0,()=>{s[1](!0),i()},s[0],[d("span",{children:[r.tag===1||r.tag===3||r.tag===4?"Sign in":r.tag===2?a?"Sign in":"Continue":"Sign in"]})]))))}))))}));return d(Se,{},...u)}function Hb(e,t){let n,r,i,s;const o=[d1([]),un("Check your inbox"),d("div",S(_([(n="text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4",["className",n]),(r=[(i=_([d("span",{children:["We’ve sent a temporary access link to "]}),d("span",{className:"font-semibold",children:dc(e,"*","•")}),d("span",{children:["."]})]),d("p",{children:C.Children.toArray(Array.from(i))})),d("p",{children:["Click the link to confirm your email address and sign in. The link is valid for 5 minutes."]})],["children",C.Children.toArray(Array.from(r))])]))),d("div",S(_([["className","text-sm text-gray-900 whitespace-pre-wrap mt-10 sm:mt-14 space-y-4 leading-5"],(s=ce(A(()=>j(v(d("p",{children:["Can’t see the email? Check your spam folder."]})),A(()=>{const a=t;return a==null?v(K()):v(Qr(a))})))),["children",C.Children.toArray(Array.from(s))])])))];return d(Se,{},...o)}let nn=class extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["ResendTimerTick","SignIn","IncorrectOneTimeCodeCallback","SetCodeInvalid","SetCodeInputValue","SetReissueLinkInProgress"]}},jn=class extends R{constructor(t,n,r,i,s,o){super(),this.AttemptsRemaining=t,this.CodeInvalid=n,this.CodeInputValue=r,this.ResendTimer=i,this.SignInInProgress=s,this.ReissueLinkInProgress=o}};function Gb(){return[new jn(void 0,!1,"",void 0,!1,!1),z()]}function qb(e,t,n){let r;switch(t.tag){case 1:{const i=Mo(ta,n.CodeInputValue);return i.length===6?(e([Ho(i,511,!1,32),t.fields[0]]),[new jn(n.AttemptsRemaining,n.CodeInvalid,n.CodeInputValue,n.ResendTimer,!0,n.ReissueLinkInProgress),z()]):[n,T(s=>{s(new nn(3,[!0]))})]}case 2:return[new jn(t.fields[0],n.CodeInvalid,n.CodeInputValue,n.ResendTimer,n.SignInInProgress,n.ReissueLinkInProgress),T(i=>{i(new nn(3,[!0]))})];case 3:{const i=t.fields[0];return[new jn(n.AttemptsRemaining,i,i?"":n.CodeInputValue,n.ResendTimer,!1,n.ReissueLinkInProgress),z()]}case 4:return[new jn(n.AttemptsRemaining,n.CodeInvalid,t.fields[0],n.ResendTimer,n.SignInInProgress,n.ReissueLinkInProgress),z()];case 5:return[new jn(n.AttemptsRemaining,n.CodeInvalid,n.CodeInputValue,n.ResendTimer,n.SignInInProgress,!0),z()];default:{const i=Ms(a=>{je(a)},()=>E.Delay(()=>E.Bind($s(1e3),()=>E.Return(void 0))),void 0,()=>new nn(0,[]));let s;const o=n.ResendTimer;return s=o!=null?o>0?(r=o|0,[r-1,i]):[void 0,z()]:[20,i],[new jn(n.AttemptsRemaining,n.CodeInvalid,n.CodeInputValue,s[0],n.SignInInProgress,n.ReissueLinkInProgress),s[1]]}}}function zs(e){e.target.id==="one-time-code-input"||e.key!=="Enter"&&document.getElementById("one-time-code-input").focus()}function Yb(){document.addEventListener("keypress",e=>{zs(e)}),document.addEventListener("paste",e=>{zs(e)})}const Jb={Dispose(){document.removeEventListener("keypress",e=>{zs(e)}),document.removeEventListener("paste",e=>{zs(e)})}};function Zb(e){const t=e.reissueLink,n=e.reissueOneTimeCode,r=e.validateOneTimeCode,i=e.maskedPhone,s=el(()=>Ds(Gb,(f,c)=>qb(r,f,c),(f,c)=>{}),void 0,void 0),o=s[0],a=s[1];qo(()=>(Yb(),Jb),new Array(0));const l=()=>{a(new nn(1,[f=>{a(new nn(2,[f.AttemptsRemaining]))}]))},u=ce(A(()=>j(v(f1([])),A(()=>j(v(un("Enter your security code")),A(()=>{let f,c,p;return j(v(d("div",S(_([(f="text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4",["className",f]),(c=[(p=_([d("span",{children:["We’ve sent a security code to your mobile number ending in •••"]}),d("span",{className:"font-semibold",children:Mo(ta,i)}),d("span",{children:["."]})]),d("p",{children:C.Children.toArray(Array.from(p))})),d("p",{children:["Enter your code to sign in."]})],["children",C.Children.toArray(Array.from(c))])])))),A(()=>{let m;return j(v(d("div",S(_([["className","mt-8 flex relative"],(m=ce(A(()=>{let $;return j(v(d("input",S(_([["className","absolute w-full h-full peer z-10 opacity-0"],["id","one-time-code-input"],["type","text"],["autoComplete","one-time-code"],["maxLength",6],["onClick",g=>{const w=g.target;w.selectionStart=o.CodeInputValue.length|0,w.selectionEnd=o.CodeInputValue.length|0,a(new nn(3,[!1]))}],["onChange",g=>{const w=Mo(ta,g.target.value);a(new nn(4,[w])),w.length===6&&l()}],($=o.CodeInputValue,["ref",g=>{g!=null&&!M(g.value,$)&&(g.value=$)}])])))),A(()=>Cc(g=>{const w=Ee(y=>y,pc(g,o.CodeInputValue.split(""))),b=Ee(y=>y,pc(g-1,o.CodeInputValue.split("")));return v(d("div",{key:g,className:ge(" ",ce(A(()=>j(v("flex justify-center items-center text-xl w-10 h-12 rounded-md ring-inset ring-1 transition ease-in"),A(()=>j(o.CodeInvalid?v("ring-red-600"):v("ring-gray-400"),A(()=>j(v(g===2?"mr-4":g===5?"":"mr-2"),A(()=>w!=null||b!=null||g===0?v("peer-focus:ring-2 peer-focus:ring-primary-base"):is()))))))))),children:be(w,"")}))},l0(0,1,5))))})),["children",C.Children.toArray(Array.from(m))])])))),A(()=>{let $;return j(o.CodeInvalid?v(d("p",S(_([["className","w-[288px] text-red-600 mt-2 leading-5"],($=ce(A(()=>j(v("The code you entered is invalid"),A(()=>{let g;return j((g=o.AttemptsRemaining,g==null?v(K()):v(`, you have ${g} attempts remaining`)),A(()=>j(v("."),A(()=>o.AttemptsRemaining==null?v(" Try again or click on the link below to resend the code."):v(K())))))})))),["children",C.Children.toArray(Array.from($))])])))):is(),A(()=>j(v(Go("sm:w-[288px] mt-6",l,o.SignInInProgress,[d("span",{children:["Continue"]})])),A(()=>{let g;return v(d("div",S(_([["className","mt-8 sm:mt-14 text-sm text-gray-900 whitespace-pre-wrap leading-5 space-y-4"],(g=ce(A(()=>{let w,b;return j((w=o.ResendTimer,w!=null?v(d("p",{children:[`Message sent. Wait ${w} seconds before trying again.`]})):v((b=_([d("span",{children:["Didn’t get the code? "]}),d("span",{className:"text-primary-base underline underline-offset-3 cursor-pointer",onClick:y=>{n(),a(new nn(0,[]))},children:"Resend message"}),d("span",{children:["."]})]),d("p",{children:C.Children.toArray(Array.from(b))})))),A(()=>{let y;return v((y=_([d("span",{children:["Still having trouble? "]}),d("span",{className:"text-primary-base underline underline-offset-3 cursor-pointer",onClick:x=>{o.ReissueLinkInProgress||(a(new nn(5,[])),t())},children:"Sign in with email instead"}),d("span",{children:["."]})]),d("p",{children:C.Children.toArray(Array.from(y))})))}))})),["children",C.Children.toArray(Array.from(g))])]))))}))))}))}))}))))));return d(Se,{},...u)}function Xb(e){const t=e.reissueLink,n=e.brandingOption,r=os(!1),i=ce(A(()=>j(v(h1([])),A(()=>j(v(un("Access link timed-out")),A(()=>{let s,o;return j(v(d("div",S(_([(s="text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4",["className",s]),(o=[d("p",{children:["Your 5-minute temporary access link has timed-out."]}),d("p",{children:["Get a new link to continue."]})],["children",C.Children.toArray(Array.from(o))])])))),A(()=>j(v(Go("mt-8 mb-8 sm:mb-14",()=>{r[1](!0),t()},r[0],[d("span",{children:["Get a new link"]})])),A(()=>{const a=n;return a==null?v(K()):v(Qr(a))}))))}))))));return d(Se,{},...i)}function Hs(e,t){const n=be(on(i=>i.CompanyName,e),"your employer"),r=ce(A(()=>j(v(Uo([])),A(()=>j(v(un("You’re all done")),A(()=>{let i;return j(v(d("div",S(_([["className","text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4 mb-8 sm:mb-14"],(i=[d("p",{children:[`Your ${t} is now complete and your pay information has now been submitted to ${n}.`]}),d("p",{children:["You can now close this window."]})],["children",C.Children.toArray(Array.from(i))])])))),A(()=>{const s=e;return s==null?v(K()):v(Qr(s))}))}))))));return d(Se,{},...r)}function ph(){let e,t,n,r,i,s,o,a,l;return d("div",S(_([["className","flex lg:min-w-[1024px] xl:min-w-[1280px] max-w-screen-xl justify-center"],(e=[d("div",S(_([["className","flex flex-col justify-center items-center"],(t=[Uo([]),un("You’re all set!"),d("div",S(_([["className","text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4 mb-8 sm:mb-14"],(n=[d("p",{children:["Access your exclusive benefits by downloading the Flare app."]}),d("div",S(_([["className","hidden lg:flex justify-center lg:py-8"],(r=[d("img",{className:"h-40",src:"/workflows/app/app-invite/qr.png"})],["children",C.Children.toArray(Array.from(r))])]))),d("div",S(_([["className","flex items-center justify-center lg:hidden"],(i=[d("img",{className:"w-[280px]",src:"/workflows/app/app-invite/completed.png"})],["children",C.Children.toArray(Array.from(i))])]))),d("p",S(_([["className","font-semibold pt-5 lg:pt-0"],(s=[d("span",{className:"lg:hidden",children:"Download the Flare App"}),d("span",{className:"hidden lg:block",children:"Scan to download"})],["children",C.Children.toArray(Array.from(s))])]))),d("p",{children:"Available on iOS and Android"})],["children",C.Children.toArray(Array.from(n))])]))),d("div",S(_([["className","flex space-x-6"],(o=[d("a",S(_([["href","https://apps.apple.com/us/app/flare/id1587276031"],["target","_blank"],["rel","noreferrer"],(a=[d("img",{className:"h-10 cursor-pointer",src:"/workflows/app/app-invite/app-store.png"})],["children",C.Children.toArray(Array.from(a))])]))),d("a",S(_([["href","https://play.google.com/store/apps/details?id=com.flarehr.payandbenefits"],["target","_blank"],["rel","noreferrer"],(l=[d("img",{className:"h-10 cursor-pointer",src:"/workflows/app/app-invite/google-play.png"})],["children",C.Children.toArray(Array.from(l))])])))],["children",C.Children.toArray(Array.from(o))])])))],["children",C.Children.toArray(Array.from(t))])]))),d("img",{className:"hidden lg:block w-[640px]",src:"/workflows/app/app-invite/completed.png"})],["children",C.Children.toArray(Array.from(e))])])))}function ml(){let e;const t=[Uo([]),un("You’re all done"),d("div",S(_([["className","text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4 mb-8 sm:mb-14"],(e=[d("p",{children:["You’ve finished setting up your benefits."]}),d("p",{children:["You can now close this window."]})],["children",C.Children.toArray(Array.from(e))])]))),Qr(new nl("Flare",void 0,new tl("support@flarehr.com",void 0)))];return d(Se,{},...t)}function Kb(e){const t=e.startAuthCodeExchangeBackground,n=e.navigateAuthCodeExchangePage,r=e.magicLink,i=el(()=>Ds(jb,(l,u)=>Ub(r,n,t,l,u),(l,u)=>{}),void 0,void 0),s=i[0],o=i[1],a=ce(A(()=>j(Ce(l=>d("style",{children:[l]}),s.CssOverrides),A(()=>{const l=s.Page;switch(l.tag){case 1:return v(zb(l.fields[0],s.Branding,s.ProcessConfigId,s.JourneyType,()=>{o(new U(5,[l.fields[1],new _e(0,[])]))}));case 2:return v(Hb(l.fields[0],s.Branding));case 3:return v(d(Zb,{maskedPhone:l.fields[0],validateOneTimeCode:u=>{o(new U(4,[u[0],u[1],new _e(0,[])]))},reissueOneTimeCode:()=>{o(new U(3,[!0,new _e(0,[])]))},reissueLink:()=>{o(new U(2,[!0,new _e(0,[])]))}}));case 4:return v(d(Xb,{brandingOption:Gi(s.Branding),reissueLink:()=>{o(new U(2,[!1,new _e(0,[])]))}}));case 5:switch(s.JourneyType.tag){case 1:return v(Hs(s.Branding,"information request"));case 2:return v(ph());case 3:case 4:return v(ml());default:return v(Hs(s.Branding,"onboarding"))}case 6:return l.fields[0].tag===1?v(L1()):l.fields[0].tag===0?v(d(B1,{reissueMagicLink:()=>{o(new U(2,[!0,new _e(0,[])]))}})):l.fields[0].tag===5?v(Zo()):l.fields[0].tag===2?v(Ac(s.Branding)):l.fields[0].tag===3?v(V1(s.Branding)):v(F1(s.Branding));default:return v(b1)}}))));return d(Se,{},...a)}function Qb(e){let t,n,r;const i=e.startAuthCodeExchangeBackground,s=e.navigateAuthCodeExchangePage,o=e.inviteCode;return ur(()=>{Ut(0)}),d("div",S(_([(t="min-h-full flex flex-col items-center justify-between w-full mx-auto text-center pt-8 sm:pt-20 pb-6 sm:pb-8 px-4 bg-white",["className",t]),(n=[d("div",S(_([["className","flex flex-col items-center justify-center sm:max-w-[640px]"],(r=ce(A(()=>{const a=m2(o);return a.tag===0?v(d(Kb,{magicLink:a.fields[0],navigateAuthCodeExchangePage:s,startAuthCodeExchangeBackground:i})):v(Ac(void 0))})),["children",C.Children.toArray(Array.from(r))])]))),Ko],["children",C.Children.toArray(Array.from(n))])])))}class W extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Home","LegacyInvite","InviteV2","AuthCodeExchange","AuthCodeExchangeWithCurrentAuth","NotFound","LoggedOut"]}}function eC(e){let t,n,r;if(O(e))t=2;else if(k(e)==="workflows")if(O(P(e)))t=2;else switch(k(P(e))){case"app":{t=0,n=P(P(e));break}case"embed":{O(P(P(e)))?t=2:k(P(P(e)))==="v1.0"?(t=1,r=P(P(P(e)))):t=2;break}default:t=2}else t=2;switch(t){case 0:return new na(1,[n]);case 1:return new na(0,[r]);default:return new na(2,[void 0])}}function tC(e){const t=mn(e);if(t!=null)return Ee(r=>r[1],Jr(r=>r[0]==="code",t))}function $h(e){let t,n,r,i,s,o,a;const l=eC(e);switch(l.tag){case 1:return[O(l.fields[0])?O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[])):(t=mn(k(l.fields[0])),t!=null?O(t)?O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[])):k(t)[0]==="invite"?O(P(t))?O(P(l.fields[0]))?(n=k(t)[1],r=Fc(n),r.tag===1?new W(5,[]):new W(1,[])):O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[])):O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[])):O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[])):O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[]))),new Ln(1,[])];case 2:return[new W(5,[]),new Ln(2,[])];default:return[O(l.fields[0])?new W(0,[]):O(P(l.fields[0]))?new W(0,[]):(o=tC(k(P(l.fields[0]))),o!=null?O(P(P(l.fields[0])))?(a=o,new W(3,[dl(a)])):new W(0,[]):new W(0,[])),new Ln(0,[])]}}let Un=class extends R{constructor(t,n,r){super(),this.CurrentPage=t,this.Credentials=n,this.AppMode=r}},pn=class extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["UrlChanged","NavigateAuthCodeExchangePage","NavigateAuthCodeExchangePageWithCurrentAuth","AuthMsg","StartAuthCodeExchangeBackground","DisplayLoggedOut"]}};function nC(){let e;return ur(()=>{Ut(0)}),d("div",S(_([["className","w-full sm:max-w-md mt-5 mx-1 text-center mx-auto"],(e=[d("h4",{className:"text-2xl",children:"You have been logged out of your onboarding due to inactivity"}),d("br",{}),d("p",{children:["To continue your onboarding, please find your onboarding invite email and click the link again."]})],["children",C.Children.toArray(Array.from(e))])])))}class Ci extends Error{}Ci.prototype.name="InvalidTokenError";function rC(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function iC(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return rC(t)}catch{return atob(t)}}function sC(e,t){if(typeof e!="string")throw new Ci("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new Ci(`Invalid token specified: missing part #${n+1}`);let i;try{i=iC(r)}catch(s){throw new Ci(`Invalid token specified: invalid base64 for part #${n+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new Ci(`Invalid token specified: invalid json for part #${n+1} (${s.message})`)}}class $n extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}class gh extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Requested","Finished"]}}class ve extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["PersonalDetails","EmergencyContacts","Bank","Tax","Super","WorkplaceLinking","BenefitsOnboarding","WorkplacePolicies","DiscreteBenefits"]}}class Si extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Hidden","Incomplete","Complete"]}}function pl(e){return e?new Si(1,[]):new Si(0,[])}class se extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Completed","Disabled","Active","Locked","CompletedAndDisabled"]}}function wh(e){return M(e,Ue)?new h(0,[new ve(0,[])]):M(e,ut)?new h(0,[new ve(1,[])]):M(e,ct)?new h(0,[new ve(2,[])]):M(e,ft)?new h(0,[new ve(3,[])]):M(e,Pe)?new h(0,[new ve(4,[])]):M(e,In)?new h(0,[new ve(5,[])]):M(e,jt)?new h(0,[new ve(7,[])]):M(e,An)?new h(0,[new ve(8,[])]):new h(1,["Invalid step"])}function oC(e){switch(e.tag){case 1:return ut;case 2:return ct;case 3:return ft;case 4:return Pe;case 5:return In;case 6:return us;case 7:return jt;case 8:return An;default:return Ue}}function yh(e){switch(e.tag){case 1:return"Emergency contacts";case 2:return"Bank details";case 3:return"Tax declaration";case 4:return"Super nomination";case 5:return In.DisplayName;case 6:return"Workplace benefits";case 7:return"Fair Work";case 8:return An.DisplayName;default:return"Employee profile"}}function _h(e){switch(e.tag){case 1:return"Contacts";case 2:return"Bank";case 3:return"Tax";case 4:return"Super";case 5:return In.DisplayName;case 6:return"Benefits";case 7:return"Fair Work";case 8:return An.DisplayName;default:return"Profile"}}function vh(e){switch(e.tag){case 1:return ut;case 2:return ct;case 3:return ft;case 4:return Pe;case 5:return In;case 6:return us;case 7:return jt;case 8:return An;default:return Ue}}function aC(e){switch(e.tag){case 5:case 6:case 8:return!1;default:return!0}}function lC(e,t){return e.tag===0?t:$t(t,T(new ve(6,[])))}class Ir extends R{constructor(t,n){super(),this.Id=t,this.Status=n}}function zn(e){return yh(e.Id)}function uC(e){return _h(e.Id)}function cC(e){return vh(e.Id).ComponentTagName}function fC(e){return vh(e.Id).Id}function dC(e){return aC(e.Id)}function hC(e){if(e.Id.tag===0)return e}function mC(e){if(e.Id.tag===1)return e}function pC(e){return Jr(t=>M(t.Status,new se(2,[])),e)}function $C(e){return((n,r)=>{e:for(;;){const i=n,s=r;if(O(i))return s;if(M(k(i).Status,new se(2,[])))return Ro([s,T(k(i)),P(i)]);if(M(k(i).Status,new se(1,[])))return Ro([s,T(new Ir(k(i).Id,new se(2,[]))),P(i)]);n=P(i),r=$t(s,T(k(i)));continue e}})(e,le())}function $l(e,t){const n=be(e.PaySetupComplete,!1);let r;const i=Sr(Xe(wh,e.Configuration.Steps));if(r=i.tag===1?new h(1,[i.fields[0]]):new h(0,[lC(t,i.fields[0])]),r.tag===1)return new h(1,[r.fields[0]]);{const s=Sr(Xe(wh,V$(e)));return s.tag===1?new h(1,[s.fields[0]]):new h(0,[$C(Xe(o=>n&&dC(o)&&M(o.Status,new se(0,[]))?new Ir(o.Id,new se(4,[])):o,Xe(o=>yc(a=>M(a,o.Id),s.fields[0])?new Ir(o.Id,new se(0,[])):o,Xe(o=>M(o.Id,new ve(6,[]))&&!n?new Ir(o.Id,new se(3,[])):o,Xe(o=>new Ir(o,new se(1,[])),r.fields[0])))))])}}class bh extends R{constructor(t,n,r,i,s,o,a,l,u,f,c){super(),this.AppMode=t,this.JourneyType=n,this.Branding=r,this.IsBenefitsStepEnabled=i,this.IsPaySetupCompatible=s,this.IsPaySetupComplete=o,this.Status=a,this.ProcessInstanceId=l,this.InstanceName=u,this.ProcessConfigId=f,this.Steps=c}}function Ch(e){switch(e.Status.tag){case 3:return!1;case 0:return!1;case 1:return be(e.PaySetupComplete,!1);default:return!0}}function gC(e,t){let n;const r=[t.ProcessInstance,pl(t.IsBenefitsEnabled)];return n=$l(r[0],r[1]),n.tag===1?new h(1,[n.fields[0]]):new h(0,[new bh(e,t.ProcessInstance.JourneyType,t.Branding,t.IsBenefitsEnabled,x$(t.ProcessInstance.Configuration),Ch(t.ProcessInstance),t.ProcessInstance.Status,t.ProcessInstance.Id,t.ProcessInstance.Configuration.Name,t.ProcessInstance.Configuration.Id,n.fields[0])])}function wC(e,t){let n;const r=[t,pl(e.IsBenefitsStepEnabled)];return n=$l(r[0],r[1]),n.tag===1?new h(1,[n.fields[0]]):new h(0,[new bh(e.AppMode,e.JourneyType,e.Branding,e.IsBenefitsStepEnabled,e.IsPaySetupCompatible,Ch(t),t.Status,e.ProcessInstanceId,e.InstanceName,e.ProcessConfigId,n.fields[0])])}function gl(e,t){const n=e;return n.tag===1?new h(1,[n.fields[0]]):wC(t,n.fields[0])}let me=class extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Initialising","StepList","Step","PaySetupCompleteConfirmation","Oops","ErrorPage","AllDone"]}};function Hn(e){switch(e.tag){case 1:return e.fields[0];case 2:return e.fields[1];case 3:return e.fields[0];case 4:return;case 5:return;case 6:return e.fields[0];default:return}}class X extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Activate","ChangeCurrentView","CloseStepListView","StepCompletionEventCallback","CompleteStep","ConfirmPaySetupComplete","ResumePaySetup","CompletePaySetup","PaySetupCompleted","CompleteWorkflow","ShowAllDoneAndNotifyComplete","SendAnalyticsEvent","AppendTrailingSlashToUrl","CompleteBenefitsOnboardingStep","CommandSuccess","CommandFailure"]}}class Ae extends R{constructor(t,n,r,i,s){super(),this.ProfileId=t,this.ProcessInstanceId=n,this.CurrentView=r,this.CssOverrides=i,this.BenefitsOnboarding=s}}function wl(e){switch(e.tag){case 1:return"Information request";case 2:return"Workflow";case 3:return"Benefits Onboarding";case 4:return"Benefits Onboarding";default:return"Onboarding"}}function yl(e){if(e<640)return ke(void 0)}function _l(e){return((n,r)=>{e:for(;;){const i=n,s=r;let o,a,l,u;if(O(i))o=0;else{const f=hC(k(i));if(f!=null)if(O(P(i)))o=2;else{const c=mC(k(P(i)));c!=null?(o=1,a=c,l=f,u=P(P(i))):o=2}else o=2}switch(o){case 0:return s;case 1:{n=u,r=$t(s,T(M(a.Status,new se(2,[]))?new Ir(l.Id,new se(2,[])):l));continue e}default:if(O(i))throw new Error("Match failure");n=P(i),r=$t(s,T(k(i)));continue e}}})(e,le())}function Ar(e){let t,n;return d("div",S(_([(t="absolute inset-0 min-h-full flex flex-col items-center justify-between w-full mx-auto text-center pt-8 sm:pt-20 pb-6 sm:pb-8 px-4 bg-white",["className",t]),(n=[d("div",{className:"mt-5 px-4 flex flex-col items-center justify-center sm:max-w-[640px]",children:C.Children.toArray([e])}),Ko],["children",C.Children.toArray(Array.from(n))])])))}function yC(e,t){let n,r;const i=e.tag===2?e.fields[0]:void 0;let s;if(i==null)s=void 0;else{const f=i;s=on(c=>Dp(c+1,t.Steps),ns(c=>M(f,c),t.Steps))}const o=Ee(f=>new X(1,[new me(2,[f,t])]),Jr(f=>M(f.Status,new se(2,[])),t.Steps));let a,l,u;switch(i!=null&&s!=null?(r=s,M(i.Status,new se(2,[]))&&(M(r.Status,new se(1,[]))?!0:M(r.Status,new se(3,[])))?(a=0,l=i):(a=1,u=s)):a=2,a){case 0:return new X(1,[(n=[l,t],new me(2,[n[0],n[1]]))]);case 1:return M(u.Status,new se(3,[]))?void 0:new X(1,[new me(2,[u,t])]);default:return o}}function _C(e,t){let n;const r=e.IsPaySetupCompatible&&!e.IsPaySetupComplete&&rr(e.Steps)!==1;let i;if(r)switch(t.tag){case 1:case 0:{i=0;break}default:i=1}else i=1;switch(i){case 0:return n=[e,{Branding:Gi(e.Branding),InjectedBenefits:e.IsBenefitsStepEnabled}],new X(5,[n[0],n[1]]);default:return}}function vC(e){if(sa(e.Status))return new X(10,[e])}function vl(e,t,n){return be(Yu(Yu(vC(t),yC(e,t)),_C(t,n)),new X(9,[new $n(0,[])]))}function bC(e){const t=cr(e)|0;return Ve(Le("%s/workflows/backend/%i"))(Bn)(t)}function CC(e){const t=cr(e)|0;return Ve(Le("%s/workflows/backend/process-instances/%i/activate"))(Bn)(t)}function SC(e){const t=cr(e)|0;return Ve(Le("%s/workflows/backend/process-instances/%i/analytics-events"))(Bn)(t)}function bl(e,t){return E.Delay(()=>{const n=wi(zv(Ve(Le("Bearer %s"))(e)),t);let r;const i=yi(n);return r=E.Bind(i,s=>E.Return(new h(0,[s]))),E.Bind(r,s=>{const o=s;if(o.tag===1)return E.Return(new h(1,[o.fields[0]]));{const a=o.fields[0];if(a.statusCode===429||a.statusCode>=500){const l=yi(n);return E.Bind(l,u=>E.Return(new h(0,[u])))}else return E.Return(new h(0,[a]))}})})}function ki(e,t,n,r){return E.Delay(()=>{let i,s;const o=bl(n,(i=Zt(new Nt(1,[(s=new A0(T(rv(e)),r),Xt(0,Qt(Cv(),new Ne(1,[]),void 0,void 0)(s)))]),Jt(new Dt(1,[]),Yt(bC(t)))),wi(js("application/json"),i)));return E.Bind(o,a=>{const l=a;if(l.tag===1)return E.Return(new h(1,[l.fields[0]]));{const u=l.fields[0];if(u.statusCode===200){let f;const c=en(Q(tn(C0(),new Ne(1,[]))),u.responseText);return f=c.tag===1?new h(1,[c.fields[0]]):iv(c.fields[0]),E.Return(f)}else return E.Return(new h(1,["Unexpected response from backend"]))}})})}function kC(e,t,n){return E.Delay(()=>{let r,i;const s=bl(t,(r=Zt(new Nt(1,[(i=new I0(n),Xt(0,Qt(bv(),new Ne(1,[]),void 0,void 0)(i)))]),Jt(new Dt(1,[]),Yt(CC(e)))),wi(js("application/json"),r)));return E.Bind(s,o=>{const a=o;if(a.tag===1)return E.Return(new h(1,[a.fields[0]]));{const l=a.fields[0];if(l.statusCode===200){let u;const f=en(Q(tn(ov(),new Ne(1,[]))),l.responseText);return u=f.tag===1?new h(1,[f.fields[0]]):new h(0,[dv(f.fields[0])]),E.Return(u)}else return E.Return(new h(1,["Unexpected response from backend"]))}})})}function xC(e,t,n,r){let i;const s=E.Delay(()=>{let o,a;return bl(e,(o=Zt(new Nt(1,[(a=new E0(T(n),r),Xt(0,Qt(Sv(),new Ne(1,[]),void 0,void 0)(a)))]),Jt(new Dt(1,[]),Yt(SC(t)))),wi(js("application/json"),o)))});return i=E.Bind(s,o=>{let a;const l=o;return a=l.tag===1?new h(1,[l.fields[0]]):new h(0,[void l.fields[0]]),E.Return(a)}),E.Bind(i,o=>{const a=o;return a.tag===1||a.fields[0],E.Return()})}function IC(e,t,n){return kC(e,t,n)}function AC(e,t,n,r){return ki(new $i(1,[n]),t,r,e)}function EC(e,t,n,r){return ki(new $i(3,[r]),t,n,e)}function TC(e,t,n,r){return ki(new $i(4,[r]),t,n,e)}function PC(e,t,n,r){return ki(new $i(5,[r]),t,n,e)}function OC(e,t,n){return ki(new $i(2,[]),t,n,e)}function MC(e){const t=sC(e);return[new Ae(Lc(t.sub),df(t.workflow.instanceId),new me(0,[]),le(),new Si(0,[])),T(n=>{n(new X(0,[new gh(0,[void 0])]))})]}function Cl(e,t){if(e.tag===2){const n=oC(e.fields[0].Id);if(M(n.Id,us.Id))return T(r=>{r(new X(11,[t,new Ns(1,[])]))});{const r=new X(11,[t,new Ns(0,[cs(n.Id)])]);return T(i=>{i(r)})}}else return z()}function DC(e,t,n,r,i){let s,o,a,l,u,f,c,p,m,$,g,w,b;switch(r.tag){case 1:return[new Ae(i.ProfileId,i.ProcessInstanceId,r.fields[0],i.CssOverrides,i.BenefitsOnboarding),Cl(r.fields[0],i.ProcessInstanceId)];case 2:{const y=vl(i.CurrentView,r.fields[0],i.BenefitsOnboarding);return[i,T(x=>{x(y)})]}case 11:return je(xC(t,r.fields[0],r.fields[1],n)),[i,z()];case 3:{const y=Hn(i.CurrentView);if(y!=null){const x=y;return[i,(s=r.fields[0].target,o=Jr(B=>cp(cC(B),s.tagName,5)===0,x.Steps),o==null?z():M(o.Id,new ve(6,[]))?T(B=>{B(new X(13,[]))}):(a=o,l=new X(4,[fC(a),new $n(0,[])]),T(B=>{B(l)})))]}else return[i,z()]}case 13:{const y=Hn(i.CurrentView);let x,B;switch(y!=null?M(i.BenefitsOnboarding,new Si(0,[]))?x=1:(x=0,B=y):x=1,x){case 0:return[new Ae(i.ProfileId,i.ProcessInstanceId,i.CurrentView,i.CssOverrides,new Si(2,[])),o0(_([T(V=>{V(new X(11,[i.ProcessInstanceId,new Ns(2,[])]))}),T(V=>{V(new X(9,[new $n(0,[])]))}),T(V=>{V(new X(1,[new me(6,[B])]))})]))];default:return[i,z()]}}case 4:switch(r.fields[1].tag){case 1:return[i,z()];case 2:{const y=r.fields[1].fields[0],x=y;x.tag===1?x.fields[0]:Cg(r.fields[0],x.fields[0],i.ProfileId);const B=Hn(i.CurrentView);if(B==null)return[i,z()];{const V=gl(y,B);return V.tag===1?[new Ae(i.ProfileId,i.ProcessInstanceId,new me(4,[]),i.CssOverrides,i.BenefitsOnboarding),z()]:[i,(u=vl(i.CurrentView,V.fields[0],i.BenefitsOnboarding),T(te=>{te(u)}))]}}case 3:return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(5,[]),i.CssOverrides,i.BenefitsOnboarding),z()];default:return[i,bt(y=>{je(y)},y=>AC(n,i.ProcessInstanceId,r.fields[0],y),t,y=>new X(4,[r.fields[0],new $n(2,[y])]),y=>new X(4,[r.fields[0],new $n(3,[y])]))]}case 5:return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(3,[r.fields[0]]),i.CssOverrides,i.BenefitsOnboarding),bt(y=>{je(y)},y=>EC(n,i.ProcessInstanceId,t,y),r.fields[1].InjectedBenefits,y=>new X(14,[]),y=>new X(15,[y]))];case 6:{const y=Hn(i.CurrentView);if(y==null)return[i,z()];{const x=y,B=bt(te=>{je(te)},te=>PC(n,i.ProcessInstanceId,t,te),r.fields[0].InjectedBenefits,te=>new X(14,[]),te=>new X(15,[te])),V=new me(2,[xp(Bo(te=>M(te.Status,new se(0,[]))?!0:M(te.Status,new se(4,[])),x.Steps)),x]);return[new Ae(i.ProfileId,i.ProcessInstanceId,V,i.CssOverrides,i.BenefitsOnboarding),o0(_([B,Cl(V,i.ProcessInstanceId)]))]}}case 7:return[i,bt(y=>{je(y)},Vi(e)(i.ProcessInstanceId)(t),r.fields[0].InjectedBenefits,y=>new X(8,[y]),y=>new X(15,[y]))];case 8:{const y=Hn(i.CurrentView);if(y==null)return[i,z()];{const x=gl(r.fields[0],y);if(x.tag===1)return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(4,[]),i.CssOverrides,i.BenefitsOnboarding),z()];{const B=vl(i.CurrentView,x.fields[0],i.BenefitsOnboarding);return[i,T(V=>{V(B)})]}}}case 9:switch(r.fields[0].tag){case 1:return[i,z()];case 2:if(r.fields[0].fields[0].tag===1)return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(5,[]),i.CssOverrides,i.BenefitsOnboarding),z()];{ha(r.fields[0].fields[0].fields[0].Id,r.fields[0].fields[0].fields[0].Configuration.Name,r.fields[0].fields[0].fields[0].Configuration.Id,i.ProfileId);const y=Hn(i.CurrentView);if(y==null)return[i,z()];{const x=gl(new h(0,[r.fields[0].fields[0].fields[0]]),y);return x.tag===1?[new Ae(i.ProfileId,i.ProcessInstanceId,new me(5,[]),i.CssOverrides,i.BenefitsOnboarding),z()]:[new Ae(i.ProfileId,i.ProcessInstanceId,new me(6,[x.fields[0]]),i.CssOverrides,i.BenefitsOnboarding),z()]}}case 3:return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(5,[]),i.CssOverrides,i.BenefitsOnboarding),z()];default:{const y=Hn(i.CurrentView);let x,B;switch(y!=null&&sa(y.Status)?(x=0,B=y):x=1,x){case 0:return ha(B.ProcessInstanceId,B.InstanceName,B.ProcessConfigId,i.ProfileId),[i,z()];default:return[i,bt(V=>{je(V)},V=>OC(n,i.ProcessInstanceId,V),t,V=>new X(9,[new $n(2,[V])]),V=>new X(9,[new $n(3,[V])]))]}}}case 10:return ha(r.fields[0].ProcessInstanceId,r.fields[0].InstanceName,r.fields[0].ProcessConfigId,i.ProfileId),[new Ae(i.ProfileId,i.ProcessInstanceId,new me(6,[r.fields[0]]),i.CssOverrides,i.BenefitsOnboarding),z()];case 12:return[i,(f=window.location.pathname+"/"+window.location.search+window.location.hash,a0(y=>{ol(T(f),1)}))];case 14:return[i,z()];case 15:return[i,z()];default:if(r.fields[0].tag===1){if(r.fields[0].fields[0].tag===1)return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(4,[]),i.CssOverrides,i.BenefitsOnboarding),z()];{let y;const x=pl(r.fields[0].fields[0].fields[0].IsBenefitsEnabled);let B;const V=[r.fields[0].fields[0].fields[0].ProcessInstance,x];if(B=$l(V[0],V[1]),B.tag===1)y=new h(1,[B.fields[0]]);else{const te=B.fields[0],Ke=gC(n,r.fields[0].fields[0].fields[0]);y=Ke.tag===1?new h(1,[Ke.fields[0]]):new h(0,[(c=Ke.fields[0],p=sa(r.fields[0].fields[0].fields[0].ProcessInstance.Status),m=pC(te),m==null?c.IsPaySetupComplete?p?[new Ae(i.ProfileId,i.ProcessInstanceId,new me(6,[c]),r.fields[0].fields[0].fields[0].CssOverrides,x),z()]:(Ut(0),[new Ae(i.ProfileId,i.ProcessInstanceId,new me(6,[c]),r.fields[0].fields[0].fields[0].CssOverrides,x),T(Re=>{Re(new X(9,[new $n(0,[])]))})]):[new Ae(i.ProfileId,i.ProcessInstanceId,new me(3,[c]),r.fields[0].fields[0].fields[0].CssOverrides,x),z()]:($=(g=m,w=al.clientWidth,b=rr(te)|0,b===1?(document.title=zn(g),new me(2,[g,c])):yl(w)!=null?new me(1,[c]):new me(2,[g,c])),[new Ae(i.ProfileId,i.ProcessInstanceId,$,r.fields[0].fields[0].fields[0].CssOverrides,x),Cl($,i.ProcessInstanceId)]))])}return y.tag===1?[new Ae(i.ProfileId,i.ProcessInstanceId,new me(4,[]),i.CssOverrides,i.BenefitsOnboarding),z()]:y.fields[0]}}else return[i,Ms(y=>{je(y)},()=>IC(i.ProcessInstanceId,t,n),void 0,y=>new X(0,[new gh(1,[y])]))]}}function NC(e,t,n,r){return DC((i,s,o)=>TC(t,i,s,o),e,t,n,r)}const RC=d("div",S(_([["className","text-primary-base"],(()=>{let e,t,n;const r=[d("svg",S(_([["fill","none"],["height",32],["viewBox","0 0 32 32"],["width",32],["xmlns","http://www.w3.org/2000/svg"],(e=T(d("g",S(T((t=_([d("rect",{width:32,height:32,fill:"white"}),d("circle",{cx:16,cy:16,r:16,fill:"currentColor"}),d("path",S(_([(n="M20.3018 11.7811L13.9959 18.0829L11.6982 15.7867C11.5092 15.6043 11.2561 15.5033 10.9933 15.5056C10.7306 15.5079 10.4793 15.6132 10.2935 15.7989C10.1077 15.9845 10.0023 16.2357 10 16.4983C9.99775 16.7608 10.0988 17.0138 10.2813 17.2026L13.2874 20.2068C13.4754 20.3945 13.7302 20.5 13.9959 20.5C14.2616 20.5 14.5164 20.3945 14.7043 20.2068L21.7187 13.1971C21.9012 13.0082 22.0022 12.7553 22 12.4927C21.9977 12.2301 21.8923 11.979 21.7065 11.7933C21.5207 11.6076 21.2694 11.5023 21.0067 11.5C20.7439 11.4978 20.4908 11.5987 20.3018 11.7811Z",["d",n]),["fill","white"]])))]),["children",C.Children.toArray(Array.from(t))]))))),["children",C.Children.toArray(Array.from(e))])])))];return["children",C.Children.toArray(Array.from(r))]})()]))),BC=d("div",S(_([["className","text-primary-base"],(()=>{let e,t,n,r;const i=[d("svg",S(_([["fill","none"],["height",32],["viewBox","0 0 32 32"],["width",32],["xmlns","http://www.w3.org/2000/svg"],(e=T(d("g",S(T((t=_([d("rect",{width:32,height:32,fill:"white"}),d("circle",{cx:16,cy:16,r:15,stroke:"currentColor",strokeWidth:2}),d("path",S(_([(n="M16.616 12.6769L11.146 18.1459C11.0908 18.2022 11.0497 18.2707 11.026 18.3459L10.026 21.3459C10.0018 21.4208 9.99555 21.5004 10.0079 21.5781C10.0202 21.6559 10.0507 21.7296 10.0969 21.7934C10.1431 21.8571 10.2036 21.909 10.2737 21.9449C10.3438 21.9808 10.4213 21.9997 10.5 21.9999C10.5538 22.0002 10.6072 21.9914 10.658 21.9739L13.658 20.9739C13.7332 20.9503 13.8017 20.9091 13.858 20.8539L19.327 15.3839L16.616 12.6769Z",["d",n]),["fill","currentColor"]]))),d("path",S(_([(r="M21.8545 12.146L19.8545 10.146C19.808 10.0994 19.7529 10.0625 19.6921 10.0373C19.6314 10.0121 19.5663 9.99908 19.5005 9.99908C19.4347 9.99908 19.3696 10.0121 19.3089 10.0373C19.2481 10.0625 19.1929 10.0994 19.1465 10.146L17.6775 11.616L20.3845 14.323L21.8545 12.854C21.9011 12.8075 21.938 12.7524 21.9632 12.6916C21.9884 12.6309 22.0014 12.5657 22.0014 12.5C22.0014 12.4342 21.9884 12.3691 21.9632 12.3083C21.938 12.2476 21.9011 12.1924 21.8545 12.146Z",["d",r]),["fill","currentColor"]])))]),["children",C.Children.toArray(Array.from(t))]))))),["children",C.Children.toArray(Array.from(e))])])))];return["children",C.Children.toArray(Array.from(i))]})()]))),LC=d("svg",S(_([["fill","none"],["height",32],["viewBox","0 0 32 32"],["width",32],["xmlns","http://www.w3.org/2000/svg"],(()=>{let e,t,n;const r=T(d("g",S(T((e=_([d("rect",{width:32,height:32,fill:"white"}),d("circle",{cx:16,cy:16,r:15,stroke:"#D1D5DB",strokeWidth:2}),d("path",S(_([(t="M15 13C15 12.7348 15.1054 12.4804 15.2929 12.2929C15.4804 12.1054 15.7348 12 16 12C16.2652 12 16.5196 12.1054 16.7071 12.2929C16.8946 12.4804 17 12.7348 17 13V15H19V13C19 12.2044 18.6839 11.4413 18.1213 10.8787C17.5587 10.3161 16.7956 10 16 10C15.2044 10 14.4413 10.3161 13.8787 10.8787C13.3161 11.4413 13 12.2044 13 13V15H15V13Z",["d",t]),["fill","#9CA3AF"]]))),d("path",S(_([(n="M19.6 16H12.4C11.9029 16 11.5 16.3731 11.5 16.8333V20.1667C11.5 20.6269 11.9029 21 12.4 21H19.6C20.0971 21 20.5 20.6269 20.5 20.1667V16.8333C20.5 16.3731 20.0971 16 19.6 16Z",["d",n]),["fill","#9CA3AF"]])))]),["children",C.Children.toArray(Array.from(e))])))));return["children",C.Children.toArray(Array.from(r))]})()]))),Sh=d("svg",S(_([["fill","none"],["height",32],["viewBox","0 0 32 32"],["width",32],["xmlns","http://www.w3.org/2000/svg"],(()=>{let e;const t=T(d("g",S(T((e=_([d("rect",{width:32,height:32,fill:"white"}),d("circle",{cx:16,cy:16,r:15,stroke:"#D1D5DB",strokeWidth:2})]),["children",C.Children.toArray(Array.from(e))])))));return["children",C.Children.toArray(Array.from(t))]})()]))),VC=d("svg",S(_([["fill","none"],["height",32],["viewBox","0 0 32 32"],["width",32],["xmlns","http://www.w3.org/2000/svg"],(()=>{let e,t;const n=T(d("g",S(T((e=_([d("rect",{width:32,height:32,fill:"white"}),d("circle",{cx:16,cx:16,cy:16,r:15,stroke:"#D1D5DB",strokeWidth:2}),d("path",S(_([(t="M20.3018 11.7811L13.9959 18.0829L11.6982 15.7867C11.5092 15.6043 11.2561 15.5033 10.9933 15.5056C10.7306 15.5079 10.4793 15.6132 10.2935 15.7989C10.1077 15.9845 10.0023 16.2357 10 16.4983C9.99775 16.7608 10.0988 17.0138 10.2813 17.2026L13.2874 20.2068C13.4754 20.3945 13.7302 20.5 13.9959 20.5C14.2616 20.5 14.5164 20.3945 14.7043 20.2068L21.7187 13.1971C21.9012 13.0082 22.0022 12.7553 22 12.4927C21.9977 12.2301 21.8923 11.979 21.7065 11.7933C21.5207 11.6076 21.2694 11.5023 21.0067 11.5C20.7439 11.4978 20.4908 11.5987 20.3018 11.7811Z",["d",t]),["fill","#D1D5DB"]])))]),["children",C.Children.toArray(Array.from(e))])))));return["children",C.Children.toArray(Array.from(n))]})()])));function Sl(e,t){let n;return d("div",S(_([["className","w-full h-6 rounded justify-start items-center inline-flex"],(n=[d("div",{className:ge(" ",[e,"text-lg font-medium leading-normal"]),children:t})],["children",C.Children.toArray(Array.from(n))])])))}function FC(e){return Sl("text-gray-900",e)}function kl(e){return Sl("text-gray-500",e)}function WC(e){return Sl("text-primary-base",e)}function jC(e){switch(e.Status.tag){case 0:return FC(zn(e));case 1:return kl(zn(e));case 3:return kl(zn(e));case 4:return kl(zn(e));default:return WC(zn(e))}}function kh(e){let t;return d("div",S(_([["className","w-8 h-6 flex-col justify-center items-center inline-flex"],(t=[d("div",{className:ge(" ",[e,"w-0.5 h-6 relative"])})],["children",C.Children.toArray(Array.from(t))])])))}const UC=kh("bg-gray-300"),xh=kh("bg-primary-base");function zC(e){const t=M(e.Id,new ve(6,[])),n=e.Status;let r;if(t)r=2;else switch(n.tag){case 0:{r=0;break}case 2:{r=1;break}default:r=2}switch(r){case 0:return xh;case 1:return xh;default:return UC}}function Ih(e,t,n){let r,i,s;const o=M(n.Status,new se(0,[]))?!0:M(n.Status,new se(2,[]));return d("button",S(_([["className",ge(" ",["group h-8 justify-start items-center space-x-4 inline-flex focus:outline-none"])],["type","button"],["disabled",!o],["onClick",a=>{let l;e(new X(1,[(l=[n,t],new me(2,[l[0],l[1]]))]))}],(r=[d("div",S(_([["className","w-8 h-8 relative"],(i=ce(A(()=>{const a=n.Status;return a.tag===0?v(RC):a.tag===1?v(Sh):a.tag===3?M(n.Id,new ve(6,[]))?v(LC):v(Sh):a.tag===4?v(VC):v(BC)})),["children",C.Children.toArray(Array.from(i))])]))),d("div",S(_([["className",ge(" ",ce(A(()=>j(v("rounded justify-start items-center flex"),A(()=>o?v("group-focus:outline-none group-focus:ring-2 group-focus:ring-offset-4 group-focus:ring-primary-focus"):is())))))],(s=[jC(n)],["children",C.Children.toArray(Array.from(s))])])))],["children",C.Children.toArray(Array.from(r))])])))}function HC(e){let t,n,r,i=!1,s=0;const o=de(e.Steps);try{for(;o["System.Collections.IEnumerator.MoveNext"]();){const u=o["System.Collections.Generic.IEnumerator`1.get_Current"]();switch(u.Id.tag){case 0:case 1:{i=M(u.Status,new se(0,[]))?!0:M(u.Status,new se(4,[]));break}default:(M(u.Status,new se(0,[]))||M(u.Status,new se(4,[])))&&(s=s+1|0)}}}finally{oe(o)}r=s+(i?1:0);const a=rr(_l(e.Steps))|0,l=u=>d("div",{className:"text-gray-500 text-sm font-medium leading-tight",children:u});return d("div",S(_([(t="h-20 w-full px-6 py-4 bg-white border-b border-gray-300 flex-col justify-start items-start inline-flex cursor-default",["className",t]),(n=ce(A(()=>{let u,f;return j((u=e.Branding,M(e.AppMode,new Ln(0,[]))?v(K()):u!=null&&u.CompanyName!=null?(f=u.CompanyName,v(l(ni(f)))):v(l(wl(e.JourneyType)))),A(()=>v(d("div",{className:"text-center text-gray-900 text-base font-semibold leading-normal",children:`${r}/${a} sections complete`}))))})),["children",C.Children.toArray(Array.from(n))])])))}function GC(e,t){return((r,i)=>{e:for(;;){const s=r,o=i;if(O(s))return o;if(O(P(s)))return $t(o,T(Ih(e,t,k(s))));r=Ze(k(P(s)),P(P(s))),i=$t(o,_([Ih(e,t,k(s)),zC(k(P(s)))]));continue e}})(_l(t.Steps),le())}function qC(e){let t,n,r;const i=e.dispatch,s=e.detail,o=Ic(void 0),a=os(!1);return P1(()=>{const l=window.ResizeObserver?new window.ResizeObserver(()=>{const u=document.body.offsetWidth;yl(u)!=null||a[0]===!1&&(a[1](!0),i(new X(2,[s])))}):new Of(()=>{const u=document.body.offsetWidth;yl(u)!=null||a[0]===!1&&(a[1](!0),i(new X(2,[s])))});return Sn(u=>{l.observe(u)},qi(o.current)),{Dispose(){l.disconnect()}}}),d("div",S(_([["ref",o],["className","absolute top-0 bottom-0 left-0 right-0"],(t=[d("div",S(_([["className","w-full h-full bg-white flex-col justify-start items-start inline-flex"],(n=[HC(s),d("div",S(_([["className","p-6 bg-white flex-col justify-start items-start inline-flex"],(r=GC(i,s),["children",C.Children.toArray(Array.from(r))])])))],["children",C.Children.toArray(Array.from(n))])])))],["children",C.Children.toArray(Array.from(t))])])))}class Er extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["backend-url","access-token","journey-type"]}}class YC extends N{constructor(t){super(),this.tag=0,this.fields=[t]}cases(){return["app-base-url"]}}class JC extends N{constructor(t){super(),this.tag=0,this.fields=[t]}cases(){return["workflows-instance-id"]}}function Ah(e){const t=e.children,n=e.effect,r=e.props,i=e.step;ur(n);const s=i.tag===1?ut.ComponentTagName:i.tag===2?ct.ComponentTagName:i.tag===3?ft.ComponentTagName:i.tag===4?Pe.ComponentTagName:i.tag===5?In.ComponentTagName:i.tag===6?us.ComponentTagName:i.tag===7?jt.ComponentTagName:i.tag===8?An.ComponentTagName:Ue.ComponentTagName;return d(s,gt(r,1),...t)}class xi extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Mobile","MobileLandscape","Tablet","Desktop","WideScreen"]}}class ZC extends R{constructor(t,n,r,i){super(),this.MobileLandscape=t|0,this.Tablet=n|0,this.Desktop=r|0,this.WideScreen=i|0}}const XC=new ZC(576,768,1024,1216);function KC(e){return["(max-width: "+e.MobileLandscape+"px)","(max-width: "+e.Tablet+"px)","(max-width: "+e.Desktop+"px)","(max-width: "+e.WideScreen+"px)"]}function Gs(e){const t=T1(()=>window.matchMedia(e).matches);return qo(()=>{const n=window.matchMedia(e),r=()=>{t[1](n.matches)};return r(),n.addListener(r),ss(()=>{n.removeListener(r)})},[e]),t[0]}function QC(e){const t=KC(be(e,XC)),n=Gs(t[0]),r=Gs(t[1]),i=Gs(t[2]),s=Gs(t[3]);return n?new xi(0,[]):r?new xi(1,[]):i?new xi(2,[]):s?new xi(3,[]):new xi(4,[])}const e3=d("svg",S(_([["fill","none"],["height",16],["viewBox","0 0 16 16"],["width",16],["xmlns","http://www.w3.org/2000/svg"],(()=>{let e,t;const n=T(d("g",S(T((e=_([d("rect",{width:16,height:16,fill:"white"}),d("path",S(_([(t="M15 6.99992H3.41403L6.70703 3.70692C6.88919 3.51832 6.98998 3.26571 6.9877 3.00352C6.98543 2.74132 6.88026 2.49051 6.69485 2.3051C6.50944 2.11969 6.25863 2.01452 5.99643 2.01224C5.73423 2.00997 5.48163 2.11076 5.29303 2.29292L0.293031 7.29292C0.10556 7.48045 0.000244141 7.73475 0.000244141 7.99992C0.000244141 8.26508 0.10556 8.51939 0.293031 8.70692L5.29303 13.7069C5.38528 13.8024 5.49562 13.8786 5.61763 13.931C5.73963 13.9834 5.87085 14.011 6.00363 14.0122C6.13641 14.0133 6.26809 13.988 6.39098 13.9377C6.51388 13.8875 6.62553 13.8132 6.71943 13.7193C6.81332 13.6254 6.88757 13.5138 6.93785 13.3909C6.98813 13.268 7.01343 13.1363 7.01228 13.0035C7.01113 12.8707 6.98354 12.7395 6.93113 12.6175C6.87872 12.4955 6.80254 12.3852 6.70703 12.2929L3.41403 8.99992H15C15.2652 8.99992 15.5196 8.89456 15.7071 8.70703C15.8947 8.51949 16 8.26514 16 7.99992C16 7.7347 15.8947 7.48035 15.7071 7.29281C15.5196 7.10528 15.2652 6.99992 15 6.99992Z",["d",t]),["fill","#212121"]])))]),["children",C.Children.toArray(Array.from(e))])))));return["children",C.Children.toArray(Array.from(n))]})()])));function t3(e,t,n){let r,i,s,o,a;const l=t.Steps;let u;const f=Pp($=>M($.Id,n.Id),l)/rr(l)*100;u=Ve(Le("%.0f%%"))(f);let c;const p=Mp($=>M($.Status,new se(2,[]))?!0:M($.Status,new se(0,[])),l)/rr(l)*100;c=Ve(Le("%.0f%%"))(p);const m=M(n.Id,new ve(1,[]))?yh(new ve(0,[])):zn(n);return d("div",S(_([(r="h-20 w-full px-6 py-4 bg-white border-b border-gray-300 flex-col justify-start items-start space-y-3 inline-flex sticky left-0 right-0 top-0 z-50",["className",r]),(i=[d("div",S(_([["className","self-stretch justify-start items-center space-x-3 inline-flex"],(s=[d("button",{type:"button",className:"w-4 h-4 rounded-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-base",onClick:$=>{e(new X(1,[new me(1,[t])]))},children:C.Children.toArray([e3])}),d("div",{className:"text-center text-gray-900 text-base font-semibold leading-normal",children:m})],["children",C.Children.toArray(Array.from(s))])]))),d("div",S(_([["className","w-full h-2 relative rounded-sm"],(o=[d("div",{className:"w-full h-0.5 left-0 top-[3px] absolute bg-gray-300 rounded-sm"}),d("div",S(_([["className","w-full left-0 top-0 absolute"],(a=[d("div",{className:"h-0.5 left-0 top-[3px] absolute bg-primary-base rounded-sm",style:{width:c}}),d("div",{className:"w-2 h-2 top-0 absolute bg-primary-base rounded-full",style:{left:u}})],["children",C.Children.toArray(Array.from(a))])])))],["children",C.Children.toArray(Array.from(o))])])))],["children",C.Children.toArray(Array.from(i))])])))}const n3=d("div",S(_([["className","relative h-4 w-2 z-50"],(()=>{const e=[d("div",{className:"absolute left-0 top-1 h-2 w-2 rounded-full bg-primary-base"})];return["children",C.Children.toArray(Array.from(e))]})()]))),r3=d("div",{className:"relative h-0.5 w-2 bg-gray-300"}),Eh=d("div",{className:"relative h-0.5 w-2 bg-primary-base"}),i3=d("div",S(_([["className","w-4 h-4 relative"],(()=>{let e,t,n;const r=[d("svg",S(_([["fill","none"],["height",16],["viewBox","0 0 16 16"],["width",16],["xmlns","http://www.w3.org/2000/svg"],(e=_([d("path",S(_([(t="M7 5C7 4.73478 7.10536 4.48043 7.29289 4.29289C7.48043 4.10536 7.73478 4 8 4C8.26522 4 8.51957 4.10536 8.70711 4.29289C8.89464 4.48043 9 4.73478 9 5V7H11V5C11 4.20435 10.6839 3.44129 10.1213 2.87868C9.55871 2.31607 8.79565 2 8 2C7.20435 2 6.44129 2.31607 5.87868 2.87868C5.31607 3.44129 5 4.20435 5 5V7H7V5Z",["d",t]),["fill","#9CA3AF"]]))),d("path",S(_([(n="M11.6 8H4.4C3.90294 8 3.5 8.3731 3.5 8.83333V12.1667C3.5 12.6269 3.90294 13 4.4 13H11.6C12.0971 13 12.5 12.6269 12.5 12.1667V8.83333C12.5 8.3731 12.0971 8 11.6 8Z",["d",n]),["fill","#9CA3AF"]])))]),["children",C.Children.toArray(Array.from(e))])])))];return["children",C.Children.toArray(Array.from(r))]})()])));function Th(e,t,n){let r;if(e)r=0;else switch(n.tag){case 0:case 4:{r=2;break}case 1:{r=4;break}case 3:{t?r=3:r=4;break}default:r=1}switch(r){case 0:return n3;case 1:return Eh;case 2:return Eh;case 3:return i3;default:return r3}}const Ph=d("div",{className:"relative h-0.5 w-full"}),s3=d("div",{className:"relative h-0.5 w-full bg-gray-300"}),o3=d("div",{className:"relative h-0.5 w-full bg-primary-base"});function xl(e){let t;if(e==null)t=1;else switch(e.tag){case 0:case 4:case 2:{t=0;break}default:t=2}switch(t){case 0:return o3;case 1:return Ph;default:return s3}}function Oh(e){let t,n;return d("div",S(_([["className","inline-flex h-11 w-10 flex-col items-center justify-start"],(t=[d("div",S(_([["className","inline-flex h-4 items-center justify-center self-stretch"],(n=[d("div",{className:ge(" ",[e,"relative h-0.5 w-10"])})],["children",C.Children.toArray(Array.from(n))])])))],["children",C.Children.toArray(Array.from(t))])])))}const a3=Oh("bg-gray-300"),l3=Oh("bg-primary-base");function u3(e){switch(e.tag){case 0:case 4:case 2:return l3;default:return a3}}function Mh(e,t,n,r){let i,s;const o=!e&&(M(n.Status,new se(0,[]))?!0:M(n.Status,new se(2,[]))),a=e?"text-primary-base":M(n.Status,new se(2,[]))||M(n.Status,new se(0,[]))?"text-gray-900 group-hover:text-primary-base":"text-gray-500",l=d("div",{className:"absolute inset-0 group-hover:bg-primary-base group-hover:opacity-10 rounded"});let u;const f=dc(_h(n.Id).toLocaleLowerCase()," ","-");return u=Ve(Le("step-%s"))(f),d("div",S(_([["className",ge(" ",["h-11 flex-col justify-start items-center inline-flex"])],(i=[d("div",{className:"h-4 inline-flex items-center justify-center self-stretch",children:C.Children.toArray(Array.from(r))}),d("button",S(_([["type","button"],["disabled",!o],["data-testid",u],["className",ge(" ",["relative group h-7 px-2 py-1 justify-center items-center gap-2 inline-flex rounded","focus:outline-none focus:ring-1 focus:ring-offset-1 focus:ring-primary-focus"])],["onClick",kt(t)(n)],(s=ce(A(()=>j(v(o?l:K()),A(()=>v(d("div",{className:ge(" ",[a,"text-sm font-medium leading-tight whitespace-nowrap"]),children:uC(n)})))))),["children",C.Children.toArray(Array.from(s))])])))],["children",C.Children.toArray(Array.from(i))])])))}function c3(e,t,n){const r=M(n.Id,new ve(1,[]))?new ve(0,[]):n.Id,i=(o,a)=>{let l;e(new X(1,[(l=[o,t],new me(2,[l[0],l[1]]))]))};return sr(((o,a,l)=>{e:for(;;){const u=o,f=a,c=l;if(O(u))return c;if(O(P(u))){const p=xl(f),m=M(k(u).Id,r);return $t(c,T(Mh(m,i,k(u),_([Ph,Th(m,M(k(u).Id,new ve(6,[])),k(u).Status),p]))))}else{const p=xl(f),m=M(k(u).Id,r),$=Th(m,M(k(u).Id,new ve(6,[])),k(u).Status);o=P(u),a=k(u).Status,l=$t(c,_([Mh(m,i,k(u),_([xl(k(u).Status),$,p])),u3(k(u).Status)]));continue e}}})(sr(_l(t.Steps)),void 0,le()))}function f3(e,t,n){let r,i,s;const o=d("div",S(_([["className","grow shrink basis-0 flex-col justify-start items-start inline-flex"],(r=[d("div",{className:"hidden lg:inline text-gray-500 text-sm font-medium leading-tight",children:wl(t.JourneyType)}),be(Ee(l=>d("div",{className:"hidden lg:inline text-center text-gray-900 text-base font-semibold leading-normal",children:l}),Ee(ni,on(l=>l.CompanyName,t.Branding))),K())],["children",C.Children.toArray(Array.from(r))])]))),a=d("div",{className:"grow shrink basis-0"});return d("div",S(_([(i="w-full h-20 px-8 py-4 bg-white border-b border-gray-300 justify-between items-center inline-flex sticky left-0 right-0 top-0 z-50",["className",i]),(s=ce(A(()=>j(M(t.AppMode,new Ln(0,[]))?v(a):v(o),A(()=>{let l;return j(v(d("div",S(_([["className","bg-white justify-center items-start flex"],(l=c3(e,t,n),["children",C.Children.toArray(Array.from(l))])])))),A(()=>v(d("div",{className:"grow shrink basis-0"}))))})))),["children",C.Children.toArray(Array.from(s))])])))}function d3(e){let t;const n=e.body,r=e.currentStep,i=e.detail,s=e.dispatch;return d("div",S(_([["className","w-full flex-col justify-start items-center inline-flex bg-white"],(t=ce(A(()=>j(rr(i.Steps)===1?v(K()):QC().tag===0?v(t3(s,i,r)):v(f3(s,i,r)),A(()=>v(d("div",{className:"p-4 max-w-7xl mx-auto w-full",children:n})))))),["children",C.Children.toArray(Array.from(t))])])))}const h3=e=>d("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},d("path",{d:"M16 16V30",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M11 21L16 16L21 21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M11 29H4C3.20435 29 2.44129 28.6839 1.87868 28.1213C1.31607 27.5587 1 26.7956 1 26V2H12L15 7H31V26C31 26.7956 30.6839 27.5587 30.1213 28.1213C29.5587 28.6839 28.7956 29 28 29H21",stroke:"#111827",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),m3=e=>d("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},d("path",{d:"M19.7 4.3C19.3 3.9 18.7 3.9 18.3 4.3L12 10.6L5.7 4.3C5.3 3.9 4.7 3.9 4.3 4.3C3.9 4.7 3.9 5.3 4.3 5.7L10.6 12L4.3 18.3C3.9 18.7 3.9 19.3 4.3 19.7C4.5 19.9 4.7 20 5 20C5.3 20 5.5 19.9 5.7 19.7L12 13.4L18.3 19.7C18.5 19.9 18.8 20 19 20C19.2 20 19.5 19.9 19.7 19.7C20.1 19.3 20.1 18.7 19.7 18.3L13.4 12L19.7 5.7C20.1 5.3 20.1 4.7 19.7 4.3Z",fill:"#9CA3AF"}));function p3(e){const t=gt(e,1);return d(h3,t)}function $3(e){const t=gt(e,1);return d(m3,t)}function g3(e){return d("div",{className:"absolute top-0 bottom-0 left-0 right-0",children:C.Children.toArray([e])})}function w3(e,t){let n;return d("button",S(_([["type","button"],["data-testid","submit-btn"],["className",ge(" ",["self-stretch md:self-auto md:w-60 px-4 py-2 bg-primary-base hover:bg-primary-hover rounded-md shadow","focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-focus cursor-pointer","justify-center items-center inline-flex"])],["onClick",t],(n=[d("div",{className:"text-white text-base font-semibold leading-normal",children:e})],["children",C.Children.toArray(Array.from(n))])])))}function y3(e,t){let n;return d("button",S(_([["type","button"],["className",ge(" ",["relative group self-stretch md:self-auto md:w-60 px-4 py-2 rounded-md shadow justify-center items-center inline-flex","focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-focus cursor-pointer"])],["onClick",t],(n=[d("div",{className:"text-primary-dark text-base font-semibold leading-normal z-[1]",children:e}),d("div",{className:"absolute w-full h-full rounded-md z-[0] bg-primary-base opacity-10 group-hover:opacity-20"})],["children",C.Children.toArray(Array.from(n))])])))}function qs(e,t,n,r,i){let s,o,a,l,u,f,c,p,m,$,g,w,b,y,x;return g3(d("div",S(_([["className","w-full h-full md:pb-8 bg-white flex-col justify-start items-start md:items-center inline-flex"],(s=[d("div",S(_([(o="w-full md:self-stretch p-4 bg-white border-gray-200 flex-col justify-start items-end space-x-4 space-y-4 flex",["className",o]),(a=[d("button",S(_([["type","button"],(l="w-6 h-6 relative rounded-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-base",["className",l]),["onClick",B=>{i(new X(6,[{InjectedBenefits:r}]))}],(u=[$3([])],["children",C.Children.toArray(Array.from(u))])])))],["children",C.Children.toArray(Array.from(a))])]))),d("div",S(_([(f="w-full md:w-[560px] grow shrink basis-0 px-4 md:px-0 pb-8 md:pb-0 bg-white flex-col justify-between md:justify-start items-center md:space-y-14 flex",["className",f]),(c=[d("div",S(_([["className","self-stretch h-64 md:h-56 flex-col justify-start items-center space-y-8 flex"],(p=[d("div",S(_([["className","self-stretch h-64 flex-col justify-start items-center space-y-6 flex"],(m=[d("div",S(_([["className","self-stretch h-24 flex-col justify-start items-center space-y-4 flex"],($=[d("div",S(_([["className","w-12 h-12 relative rounded-lg"],(g=[d("div",{className:"w-12 h-12 relative bg-primary-base opacity-10 rounded-lg"}),d("div",S(_([["className","w-8 h-8 left-2 top-2 absolute"],(w=[d("div",S(_([["className","w-7 h-7 left-px top-0.5 absolute"],(b=[p3([["className","text-primary-base"]])],["children",C.Children.toArray(Array.from(b))])])))],["children",C.Children.toArray(Array.from(w))])])))],["children",C.Children.toArray(Array.from(g))])]))),d("div",{className:"self-stretch text-center text-gray-900 text-2xl md:text-3xl font-bold leading-7 md:leading-9",children:e})],["children",C.Children.toArray(Array.from($))])]))),d("div",S(_([["className","self-stretch h-40 md:h-24 flex-col justify-start items-center space-y-3 md:space-y-4 flex"],(y=[d("div",{className:"self-stretch text-center text-gray-900 text-base md:text-lg font-normal leading-normal md:leading-7",children:t}),d("div",{className:"self-stretch text-center text-gray-900 text-base md:text-lg font-normal leading-normal md:leading-7",children:n})],["children",C.Children.toArray(Array.from(y))])])))],["children",C.Children.toArray(Array.from(m))])])))],["children",C.Children.toArray(Array.from(p))])]))),d("div",S(_([["className","self-stretch h-24 flex-col justify-start items-center space-y-4 flex cursor-pointer"],(x=[w3(r?"Submit and continue":"Submit",B=>{i(new X(7,[{InjectedBenefits:r}]))}),y3("Keep editing",B=>{i(new X(6,[{InjectedBenefits:r}]))})],["children",C.Children.toArray(Array.from(x))])])))],["children",C.Children.toArray(Array.from(c))])])))],["children",C.Children.toArray(Array.from(s))])]))))}function _3(e){let t,n;const r=e.dispatch,i=e.wd,s=i.IsBenefitsStepEnabled;return i.AppMode.tag===1?s?qs("Before you continue",(t=on(o=>o.CompanyName,i.Branding),t==null?"Submit to finalise your pay information to your employer and continue to access your workplace benefits":`Submit to finalise your pay information to ${ni(t)} and continue to access your workplace benefits`),"Once you submit, you’ll be unable to view or edit your details",!0,r):qs("Submit your details",(n=on(o=>o.CompanyName,i.Branding),n==null?"Submit to finalise your pay information to your employer":`Submit to finalise your pay information to ${ni(n)}`),"Once you submit, you’ll be unable to view or edit your details.",!1,r):s?qs("Before you continue","Submit to finalise your pay information to your employer and continue to access your workplace benefits","",!0,r):qs("Submit your details","Submit to finalise your pay information to your employer","",!1,r)}function Ys(e,t){let n;return d("div",S(_([["className",ge(" ",["animate-pulse w-full relative",e,t])],(n=[d("div",{className:ge(" ",["w-full left-0 top-0 absolute bg-gray-200 rounded",e])})],["children",C.Children.toArray(Array.from(n))])])))}const v3=Ys("h-9","max-w-96"),Dh=Ys("h-6","max-w-96"),b3=Ys("h-80","max-w-96"),C3=Ys("h-10","max-w-48"),S3=(()=>{let e,t,n;const r=[d("div",S(_([(e="w-full h-full px-8 py-20 bg-white rounded border border-zinc-200 flex-col justify-start items-center gap-10 inline-flex",["className",e]),(t=[d("div",S(_([["className","max-w-96 w-full flex-col justify-start items-center gap-6 flex"],(n=[v3,d("div",{className:"self-stretch h-14 flex-col justify-start items-center gap-2 flex",children:C.Children.toArray([Dh,Dh])})],["children",C.Children.toArray(Array.from(n))])]))),b3,C3],["children",C.Children.toArray(Array.from(t))])])))];return d(Se,{},...r)})();function k3(e){const t=e.accessToken,n=e.appMode;let r;const i=MC(t);r=el(()=>Ds(()=>i,(u,f)=>NC(t,n,u,f),(u,f)=>{}),void 0,[]);const s=r[0],o=r[1],a=(u,f)=>{let c;return d("div",S(_([["className","w-full min-h-[600px] mx-auto bg-white"],(c=ce(A(()=>j(Ce(p=>d("style",{children:[p]}),s.CssOverrides),A(()=>j(u,A(()=>is())))))),["children",C.Children.toArray(Array.from(c))])])))};Yo(()=>{bg()},[]),Yo(()=>{const u=s.CurrentView;let f;switch(u.tag){case 1:case 3:{f=2;break}case 2:{M(u.fields[0].Id,new ve(4,[]))?(f=0,u.fields[0]):M(u.fields[0].Id,new ve(5,[]))?(f=1,u.fields[0]):f=2;break}default:f=3}switch(f){case 0:break;case 1:break;case 2:{ol(T(ul(n)),2);break}}},[s.CurrentView]),ur(()=>{window.addEventListener("step-completion",u=>{o(new X(3,[u]))})});const l=s.CurrentView;switch(l.tag){case 1:return Ut(0),a([d(qC,{detail:l.fields[0],dispatch:o})]);case 2:{const u=l.fields[1],f=l.fields[0],c=B$(u.JourneyType);let p;const m=f.Id;return p=m.tag===4?d(Ah,{step:new ve(4,[]),props:[new Er(1,[t]),new Er(0,[`${Bn}/super-selection/backend/v1.0/`]),new Er(2,[c]),new YC(ul(n))],effect:()=>{o(new X(12,[])),Ut(2500)},children:[]}):d(Ah,{step:m,props:[new Er(1,[t]),new Er(0,[Bn]),new Er(2,[c]),new JC(rn(cr(s.ProcessInstanceId)))],effect:()=>{Ut(1500)},children:[]}),a([d(d3,{dispatch:o,detail:u,currentStep:f,body:p})])}case 3:return Ut(0),a([d(_3,{wd:l.fields[0],dispatch:o})]);case 4:return Ut(0),a([d("div",{className:"text-center mt-5",children:"We had an issue. Please try again shortly."})]);case 5:return Ar(Zo());case 6:{const u=l.fields[0],f=u.JourneyType,c=Ee(L_,u.Branding);return a(ce(A(()=>u.AppMode.tag===0?v(S3):f.tag===1?v(Ar(Hs(c,"information request"))):f.tag===2?v(Ar(ph())):f.tag===3||f.tag===4?v(Ar(ml())):v(Ar(Hs(c,"onboarding"))))))}default:return d("div",{children:["Please wait..."]})}}function x3(e){return{render:function(t){Mi(t,e)},unmount:function(){mo(e)}}}class I3 extends R{constructor(t,n,r){super(),this.model=t,this.render=n,this.equal=r}}class A3 extends st{constructor(t){super(t)}shouldComponentUpdate(t,n){const r=this;return!r.props.equal(r.props.model,t.model)}render(){return this.props.render()}}function E3(e,t,n,r){const i=new I3(n,()=>t(n,r),e);return d(A3,i)}const T3=(()=>{try{return Ho(_u.slice(void 0,2),511,!1,32)>=18}catch{return!1}})();function P3(e,t,n){let r;return c0(Q(T3?(r=x3(document.getElementById(t)),i=>s=>{r.render(e(o=>a=>o===a,f0(n),i,s))}):i=>s=>{Mi(e(o=>a=>o===a,f0(n),i,s),document.getElementById(t))}),n)}function O3(e,t){return P3((n,r,i,s)=>E3(Q(n),Q(r),i,s),e,t)}function M3(e,t){const n=encodeURIComponent(Wb(t)),r=encodeURIComponent(vv),i=encodeURIComponent(kv(new Ln(0,[])));return E.Delay(()=>{let s,o;const a=yi(Zt(new Nt(1,[`grant_type=authorization_code&code=${n}&client_id=${r}&redirect_uri=${i}`]),(s=Jt(new Dt(1,[]),Yt(`${wv}/connect/token`)),wi(js("application/x-www-form-urlencoded"),s))));return o=E.Bind(a,l=>E.Return(new h(0,[l]))),E.Bind(o,l=>{const u=l;if(u.tag===1)return E.Return(new h(1,[u.fields[0]]));{const f=u.fields[0];if(f.statusCode===200){const c=en(Q(tn(hl(),void 0)),f.responseText);return E.Return(c)}else return E.Return(new h(1,["Unexpected result from backend"]))}})})}function D3(){return new Cr(0,[])}function Il(e){return $s(e)}function N3(e,t){return E.Delay(()=>{let n;return E.Bind(hg([(n=M3(e,t),E.Bind(n,r=>E.Return(r))),E.Delay(()=>E.Bind(Il(2e3),()=>E.Return(void 0)))]),r=>E.Return(ee(0,r)))})}function R3(e,t,n){let r;switch(e.tag){case 1:switch(t.tag){case 1:return[t,Ms(i=>{je(i)},Il,1e3,()=>new Wn(1,[]))];case 2:return t.fields[0].tag===1?[t,z()]:[t,Ms(i=>{je(i)},Il,2e3,()=>new Wn(2,[]))];default:return[new Cr(2,[new h(1,["No current authenticated user"])]),z()]}case 2:return[t,(r=window.location.pathname,a0(i=>{ol(T(r),1)}))];default:if(e.fields[0].tag===1)return e.fields[0].fields[0].tag===1?[new Cr(2,[new h(1,[`SignIn failed: ${e.fields[0].fields[0].fields[0]}`])]),z()]:(window.gtag&&window.gtag("event","oidc_sign_in",{}),[new Cr(2,[new h(0,[e.fields[0].fields[0].fields[0]])]),e.fields[2]?z():T(i=>{i(new Wn(2,[]))})]);switch(t.tag){case 1:return[t,z()];default:return[new Cr(1,[]),bt(i=>{je(i)},i=>N3(i[0],i[1]),[n,e.fields[1]],i=>{const s=[new _e(1,[i]),e.fields[1],e.fields[2]];return new Wn(0,[s[0],s[1],s[2]])},i=>{const s=[new _e(1,[new h(1,[i.message])]),e.fields[1],e.fields[2]];return new Wn(0,[s[0],s[1],s[2]])})]}}}function B3(){const e=qu(window.sessionStorage.getItem("credentials"));if(e!=null){const t=e,n=en(Q(tn(hl(),void 0)),t);return n.tag===1?void 0:n.fields[0]}}function L3(e){let t;const n=["credentials",(t=new mh(e.id_token,e.access_token,e.expires_in,void 0,e.scope,e.token_type),Xt(0,Qt(hl(),void 0,void 0,void 0)(t)))];window.sessionStorage.setItem(n[0],n[1])}function Nh(e,t){return Xa(n=>new pn(3,[n]),T(n=>{n(new Wn(0,[new _e(0,[]),e,t]))}))}function Al(e){return Nh(e,!1)}function V3(e){return Nh(e,!0)}function F3(){const e=$h(x0(window.location.pathname+window.location.search,2)),t=e[0],n=e[1],r=new Un(t,D3(),n);switch(t.tag){case 4:case 1:case 2:case 5:case 6:return[r,z()];case 0:{const i=B3();let s;switch(n.tag){case 0:case 2:{s=1;break}default:i==null?s=1:s=0}switch(s){case 0:return[new Un(r.CurrentPage,new Cr(2,[new h(0,[i])]),r.AppMode),z()];default:return[r,T(o=>{o(new pn(5,[]))})]}}default:return[r,Al(t.fields[0])]}}function W3(e,t){switch(e.tag){case 1:{const n=e.fields[0];return[new Un(new W(3,[n]),t.Credentials,t.AppMode),Al(n)]}case 2:return[new Un(new W(4,[]),t.Credentials,t.AppMode),Xa(n=>new pn(3,[n]),T(n=>{n(new Wn(1,[]))}))];case 3:{const n=R3(e.fields[0],t.Credentials,t.AppMode),r=n[0];let i,s;switch(r.tag===2&&r.fields[0].tag===0&&t.AppMode.tag===1?(i=0,s=r.fields[0].fields[0]):i=1,i){case 0:{L3(s);break}}return[new Un(t.CurrentPage,r,t.AppMode),Xa(o=>new pn(3,[o]),n[1])]}case 4:return[t,V3(e.fields[0])];case 5:return[new Un(new W(6,[]),t.Credentials,t.AppMode),z()];default:{const n=$h(e.fields[0])[0],r=new Un(n,t.Credentials,t.AppMode);return n.tag===3?[r,Al(n.fields[0])]:[r,z()]}}}const Rh=d("div",S(_([["className","flex flex-col justify-center items-center pt-10"],(()=>{const e=[Zo()];return["children",C.Children.toArray(Array.from(e))]})()])));function j3(e){switch(e.CurrentPage.tag){case 3:case 4:case 2:return T("bg-white h-full");default:return le()}}function U3(e){switch(e.tag){case 1:return d("style",{children:[`
|
|
809
|
+
`))(c);return m=>p(m)}}else if(Vu(r))if(Ao(r)){const f=nr(c=>St(e,t,!1,c),Uu(r));return c=>p=>Array.isArray(p)?wt(m=>jm(ir(m)),fh(0,f,c,p)):new h(1,[[c,new L(0,["an array",p])]])}else switch(pe(Fu(r))){case"Microsoft.FSharp.Core.FSharpOption`1[System.Object]":return i=St(e,t,!0,ee(0,Qe(r))),c=>p=>bb(Q(i),c,p);case"Microsoft.FSharp.Collections.FSharpList`1[System.Object]":return s=St(e,t,!1,ee(0,Qe(r))),c=>p=>lh(Q(s),c,p);case"System.Collections.Generic.IEnumerable`1[System.Object]":return o=St(e,t,!1,ee(0,Qe(r))),c=>p=>Cb(Q(o),c,p);case"Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]":{const c=St(e,t,!1,ee(0,Qe(r))),p=St(e,t,!1,ee(1,Qe(r)));let m;const $=_([g=>w=>Pb(Q(c),Q(p),g,w),(a=Ib(Q(c),Q(p)),g=>w=>lh(Q(a),g,w))]);return m=g=>w=>Sb($,g,w),g=>w=>xb(Ab,Q(m),g,w)}case"Microsoft.FSharp.Collections.FSharpSet`1[System.Object]":{const c=St(e,t,!1,ee(0,Qe(r)));return p=>m=>{const $=uh(Q(c),p,m);return $.tag===0?new h(0,[Eb($.fields[0])]):new h(1,[$.fields[0]])}}default:return hh(e,t,n,r)}else switch(l){case"System.Boolean":return f=>c=>$b(f,c);case"Microsoft.FSharp.Core.Unit":return f=>c=>pb(f,c);case"System.String":return f=>c=>eh(f,c);case"System.Char":return f=>c=>hb(f,c);case"System.SByte":return th;case"System.Byte":return nh;case"System.Int16":return rh;case"System.UInt16":return ih;case"System.Int32":return sh;case"System.UInt32":return oh;case"System.Double":return f=>c=>gb(f,c);case"System.Single":return f=>c=>wb(f,c);case"System.DateTime":return f=>c=>yb(f,c);case"System.DateTimeOffset":return f=>c=>_b(f,c);case"System.TimeSpan":return f=>c=>vb(f,c);case"System.Guid":return f=>c=>mb(f,c);case"System.Object":return f=>c=>new h(0,[c]);default:return hh(e,t,n,r)}else{const f=u;return c=>p=>f.contents(c)(p)}}function Ob(e){return fl({Compare:Bi})}function tn(e,t,n){const r=be(t,new Ne(0,[]));return St(Ob(),r,!1,e)}class Mb{constructor(t){this.magicLink=t,this.backendUrl=`${Bn}/workflows/public-backend/invites/${this.magicLink.InviteToken}`}}function Db(e){return new Mb(e)}function Nb(e){return E.Delay(()=>{let t,n;const r=bi(e,(t=Jt(new Dt(1,[]),Yt(`${e.backendUrl}/magic-link/validate`)),Zt(new Nt(1,[(n=new w0(e.magicLink.MagicCode),Xt(0,Qt(V_(),new Ne(1,[]),void 0,void 0)(n)))]),t)));return E.Bind(r,i=>{const s=i;if(s.tag===1)return E.Return(new h(1,[s.fields[0]]));{let o;const a=s.fields[0];return o=a.statusCode===200?en(Q(tn(G_(),new Ne(1,[]))),a.responseText):new h(1,["Unexpected response from backend"]),E.Return(o)}})})}function Rb(e,t){return E.Delay(()=>{let n,r;const i=bi(e,(n=Jt(new Dt(1,[]),Yt(`${e.backendUrl}/magic-link/reissue`)),Zt(new Nt(1,[(r=new y0(e.magicLink.MagicCode,t),Xt(0,Qt(q_(),new Ne(1,[]),void 0,void 0)(r)))]),n)));return E.Bind(i,s=>{const o=s;if(o.tag===1)return E.Return(new h(1,[o.fields[0]]));{let a;const l=o.fields[0];return a=l.statusCode===200?en(Q(tn(X_(),new Ne(1,[]))),l.responseText):new h(1,["Unexpected response from backend"]),E.Return(a)}})})}function Bb(e,t){return E.Delay(()=>{let n,r;const i=bi(e,(n=Jt(new Dt(1,[]),Yt(`${e.backendUrl}/one-time-code/issue`)),Zt(new Nt(1,[(r=new _0(e.magicLink.MagicCode,t),Xt(0,Qt(K_(),new Ne(1,[]),void 0,void 0)(r)))]),n)));return E.Bind(i,s=>{const o=s;if(o.tag===1)return E.Return(new h(1,[o.fields[0]]));{let a;const l=o.fields[0];return a=l.statusCode===200?en(Q(tn(n2(),new Ne(1,[]))),l.responseText):new h(1,["Unexpected response from backend"]),E.Return(a)}})})}function Lb(e,t){return E.Delay(()=>{let n,r;const i=bi(e,(n=Jt(new Dt(1,[]),Yt(`${e.backendUrl}/one-time-code/validate`)),Zt(new Nt(1,[(r=new v0(t),Xt(0,Qt(r2(),new Ne(1,[]),void 0,void 0)(r)))]),n)));return E.Bind(i,s=>{const o=s;if(o.tag===1)return E.Return(new h(1,[o.fields[0]]));{let a;const l=o.fields[0];return a=l.statusCode===200?en(Q(tn(a2(),new Ne(1,[]))),l.responseText):new h(1,["Unexpected response from backend"]),E.Return(a)}})})}function Vb(e,t){return E.Delay(()=>{let n,r;const i=bi(e,(n=Jt(new Dt(1,[]),Yt(`${e.backendUrl}/progress`)),Zt(new Nt(1,[(r=new b0(e.magicLink.MagicCode,t),Xt(0,Qt(l2(),new Ne(1,[]),void 0,void 0)(r)))]),n)));return E.Bind(i,s=>{const o=s;if(o.tag===1)return E.Return(new h(1,[o.fields[0]]));{let a;const l=o.fields[0];return a=l.statusCode===200?en(Q(tn(d2(),new Ne(1,[]))),l.responseText):new h(1,["Unexpected response from backend"]),E.Return(a)}})})}function bi(e,t){return E.Delay(()=>{let n;const r=yi(t);return n=E.Bind(r,i=>E.Return(new h(0,[i]))),E.Bind(n,i=>{const s=i;if(s.tag===1)return E.Return(new h(1,[s.fields[0]]));{const o=s.fields[0];if(o.statusCode===429||o.statusCode>=500){let a;const l=$s(2e3);return a=E.Bind(l,u=>E.Return(new h(0,[u]))),E.Bind(a,u=>{const f=u;if(f.tag===1)return E.Return(new h(1,[f.fields[0]]));{const c=yi(t);return E.Bind(c,p=>E.Return(new h(0,[p])))}})}else return E.Return(new h(0,[o]))}})})}class Fb extends N{constructor(t){super(),this.tag=0,this.fields=[t]}cases(){return["AuthCode"]}}function dl(e){return new Fb(e)}function Wb(e){return e.fields[0]}class mh extends R{constructor(t,n,r,i,s,o){super(),this.id_token=t,this.access_token=n,this.expires_in=r,this.refresh_token=i,this.scope=s,this.token_type=o}}function hl(){return ne("Workflows.UI.Auth.Types.Credentials",[],mh,()=>[["id_token",H],["access_token",H],["expires_in",Rm],["refresh_token",J(H)],["scope",H],["token_type",H]])}let Wn=class extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["SignIn","SignInWithCurrentAuth","NavigateToOnboarding"]}};function jb(){return[new il(le(),new G(0,[]),void 0,void 0,new $0(0,[new g0(void 0)])),T(e=>{e(new U(1,[new _e(0,[])]))})]}function Ub(e,t,n,r,i){let s,o,a,l,u,f,c;const p=Db(e);switch(r.tag){case 1:if(r.fields[0].tag===1){if(r.fields[0].fields[0].tag===1)return[i,T(m=>{m(new U(0,[new G(6,[new re(5,[])])]))})];{let m;const $=r.fields[0].fields[0].fields[0].Outcome;switch($.tag){case 1:{const g=$.fields[0],w=g.OneTimeCodeOptionAvailable;m=g.IsInitialMagicLinkUsed?w?new U(0,[new G(1,[g.FirstName,new rl(1,[])])]):new U(0,[new G(1,[g.FirstName,new rl(0,[])])]):w?new U(3,[!1,new _e(0,[])]):new U(0,[new G(4,[])]);break}case 4:{m=new U(0,[new G(5,[])]);break}case 2:case 7:{m=new U(0,[new G(6,[new re(2,[])])]);break}case 3:{m=new U(0,[new G(6,[new re(4,[])])]);break}case 5:{m=new U(0,[new G(6,[new re(3,[])])]);break}case 6:{m=new U(0,[new G(6,[new re(1,[])])]);break}default:{const g=$.fields[0];g.IsInitialMagicLinkUsed?(n(dl(g.AuthCode)),m=new U(0,[new G(1,[g.FirstName,new rl(2,[])])])):m=new U(6,[g.AuthCode])}}return[new il(r.fields[0].fields[0].fields[0].CssOverrides,i.Page,j_(r.fields[0].fields[0].fields[0].Outcome),z_(r.fields[0].fields[0].fields[0].Outcome),be(U_(r.fields[0].fields[0].fields[0].Outcome),i.JourneyType)),T(g=>{g(m)})]}}else return[i,bt(m=>{je(m)},()=>Nb(p),void 0,m=>new U(1,[new _e(1,[m])]),m=>new U(1,[new _e(1,[new h(1,[m.message])])]))];case 2:return r.fields[1].tag===1?r.fields[1].fields[0].tag===1?[i,T(m=>{m(new U(0,[new G(6,[new re(5,[])])]))})]:[i,(s=new U(0,[(o=r.fields[1].fields[0].fields[0].Outcome,o.tag===2?new G(2,[o.fields[0].MaskedEmail]):o.tag===1?new G(6,[new re(2,[])]):o.tag===5?new G(6,[new re(2,[])]):o.tag===3?new G(6,[new re(4,[])]):o.tag===4?new G(6,[new re(1,[])]):o.tag===6?new G(5,[]):o.tag===7?new G(6,[new re(3,[])]):new G(2,[o.fields[0].MaskedEmail]))]),T(m=>{m(s)}))]:[i,bt(m=>{je(m)},m=>Rb(p,m),r.fields[0],m=>new U(2,[r.fields[0],new _e(1,[m])]),m=>new U(2,[r.fields[0],new _e(1,[new h(1,[m.message])])]))];case 3:return r.fields[1].tag===1?r.fields[1].fields[0].tag===1?[i,T(m=>{m(new U(0,[new G(6,[new re(5,[])])]))})]:[i,(a=new U(0,[(l=r.fields[1].fields[0].fields[0].Outcome,l.tag===1?new G(4,[]):l.tag===2?new G(6,[new re(0,[])]):l.tag===3?r.fields[0]?i.Page:new G(3,[l.fields[0].MaskedPhone]):l.tag===4?new G(6,[new re(2,[])]):l.tag===7?new G(6,[new re(2,[])]):l.tag===5?new G(6,[new re(4,[])]):l.tag===6?new G(6,[new re(1,[])]):l.tag===8?new G(5,[]):l.tag===9?new G(6,[new re(3,[])]):r.fields[0]?i.Page:new G(3,[l.fields[0].MaskedPhone]))]),T(m=>{m(a)}))]:[i,bt(m=>{je(m)},m=>Bb(p,m),r.fields[0],m=>new U(3,[r.fields[0],new _e(1,[m])]),m=>new U(3,[r.fields[0],new _e(1,[new h(1,[m.message])])]))];case 4:return r.fields[2].tag===1?r.fields[2].fields[0].tag===1?[i,T(m=>{m(new U(0,[new G(6,[new re(5,[])])]))})]:[i,(u=r.fields[2].fields[0].fields[0].Outcome,u.tag===1?u.fields[0].RemainingAttempts>0?(r.fields[1]({AttemptsRemaining:u.fields[0].RemainingAttempts}),z()):T(m=>{m(new U(0,[new G(6,[new re(0,[])])]))}):u.tag===5?T(m=>{m(new U(0,[new G(6,[new re(0,[])])]))}):u.tag===2?(r.fields[1]({}),z()):u.tag===3?(r.fields[1]({}),z()):u.tag===4?(r.fields[1]({}),z()):u.tag===6?T(m=>{m(new U(0,[new G(6,[new re(4,[])])]))}):u.tag===7?T(m=>{m(new U(0,[new G(6,[new re(1,[])])]))}):u.tag===8?T(m=>{m(new U(0,[new G(6,[new re(2,[])])]))}):u.tag===9?T(m=>{m(new U(0,[new G(5,[])]))}):u.tag===10?T(m=>{m(new U(0,[new G(6,[new re(0,[])])]))}):T(m=>{m(new U(6,[u.fields[0].AuthCode]))}))]:[i,bt(m=>{je(m)},m=>Lb(p,m),r.fields[0],m=>new U(4,[r.fields[0],r.fields[1],new _e(1,[m])]),m=>new U(4,[r.fields[0],r.fields[1],new _e(1,[new h(1,[m.message])])]))];case 5:return r.fields[1].tag===1?r.fields[1].fields[0].tag===1?[i,T(m=>{m(new U(0,[new G(6,[new re(5,[])])]))})]:[i,(f=(c=r.fields[1].fields[0].fields[0].Outcome,c.tag===1?new U(0,[new G(6,[new re(2,[])])]):c.tag===4?new U(0,[new G(6,[new re(2,[])])]):c.tag===2?new U(0,[new G(6,[new re(4,[])])]):c.tag===3?new U(0,[new G(6,[new re(1,[])])]):c.tag===5?new U(0,[new G(5,[])]):c.tag===6?new U(0,[new G(6,[new re(0,[])])]):r.fields[0].tag===1?new U(3,[!1,new _e(0,[])]):r.fields[0].tag===2?new U(6,[void 0]):new U(2,[!1,new _e(0,[])])),T(m=>{m(f)}))]:[i,bt(m=>{je(m)},m=>Vb(p,m),r.fields[0].tag===1?!1:r.fields[0].tag===2,m=>new U(5,[r.fields[0],new _e(1,[m])]),m=>new U(5,[r.fields[0],new _e(1,[new h(1,[m.message])])]))];case 6:return t(Ee(dl,r.fields[0])),[i,z()];default:return[new il(i.CssOverrides,r.fields[0],i.Branding,i.ProcessConfigId,i.JourneyType),z()]}}function zb(e,t,n,r,i){const s=os(!1),o=Ee(f=>d("span",{className:"font-semibold",children:`${f}`}),on(f=>f.CompanyName,t)),a=be(Ee(f=>f===ia(fs.Id),n),!1),l=r.tag===1?`Hi, ${e}`:r.tag===3?`Hi, ${e}`:r.tag===4?`Hi, ${e}`:r.tag===2?a?`Hi, ${e}`:`${e}, join your workplace benefits program`:`Welcome, ${e}`,u=ce(A(()=>{let f,c;return j((f=r,f.tag===1?v(Kr([])):f.tag===3?v(Kr([])):f.tag===4?v(Kr([])):f.tag===2?v(a?Kr([]):d("div",S(_([["className","sm:w-[700px]"],(c=[d("img",{src:"/workflows/app/app-invite/welcome.png"})],["children",C.Children.toArray(Array.from(c))])])))):v(Kr([]))),A(()=>j(v(un(l)),A(()=>{let p;return j(v(d("div",S(_([["className","text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4 mb-8 sm:mb-14"],(p=ce(A(()=>{let m;return r.tag===1?j(v(be(o,d("span",{children:["Your employer"]}))),A(()=>j(v(d("span",{children:[" has requested additional information from you."]})),A(()=>v(d("p",{children:["Sign in to complete your information request."]})))))):r.tag===3?v(d("p",{children:["Sign in to set up your benefits."]})):r.tag===4?v(d("p",{children:["Sign in to set up your benefits."]})):r.tag===2?v(a?d("p",{children:["Sign in to set up your benefits."]}):(m="Your employer has partnered with Flare Benefits to give you exclusive 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.",d("p",{children:[m]}))):j(v(d("p",{children:["Congratulations on the new role!"]})),A(()=>{let $;return v(($=_([d("span",{children:["Sign in to complete your onboarding with "]}),be(o,d("span",{children:["your employer"]})),d("span",{children:["."]})]),d("p",{children:C.Children.toArray(Array.from($))})))}))})),["children",C.Children.toArray(Array.from(p))])])))),A(()=>v(Go(void 0,()=>{s[1](!0),i()},s[0],[d("span",{children:[r.tag===1||r.tag===3||r.tag===4?"Sign in":r.tag===2?a?"Sign in":"Continue":"Sign in"]})]))))}))))}));return d(Se,{},...u)}function Hb(e,t){let n,r,i,s;const o=[d1([]),un("Check your inbox"),d("div",S(_([(n="text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4",["className",n]),(r=[(i=_([d("span",{children:["We’ve sent a temporary access link to "]}),d("span",{className:"font-semibold",children:dc(e,"*","•")}),d("span",{children:["."]})]),d("p",{children:C.Children.toArray(Array.from(i))})),d("p",{children:["Click the link to confirm your email address and sign in. The link is valid for 5 minutes."]})],["children",C.Children.toArray(Array.from(r))])]))),d("div",S(_([["className","text-sm text-gray-900 whitespace-pre-wrap mt-10 sm:mt-14 space-y-4 leading-5"],(s=ce(A(()=>j(v(d("p",{children:["Can’t see the email? Check your spam folder."]})),A(()=>{const a=t;return a==null?v(K()):v(Qr(a))})))),["children",C.Children.toArray(Array.from(s))])])))];return d(Se,{},...o)}let nn=class extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["ResendTimerTick","SignIn","IncorrectOneTimeCodeCallback","SetCodeInvalid","SetCodeInputValue","SetReissueLinkInProgress"]}},jn=class extends R{constructor(t,n,r,i,s,o){super(),this.AttemptsRemaining=t,this.CodeInvalid=n,this.CodeInputValue=r,this.ResendTimer=i,this.SignInInProgress=s,this.ReissueLinkInProgress=o}};function Gb(){return[new jn(void 0,!1,"",void 0,!1,!1),z()]}function qb(e,t,n){let r;switch(t.tag){case 1:{const i=Mo(ta,n.CodeInputValue);return i.length===6?(e([Ho(i,511,!1,32),t.fields[0]]),[new jn(n.AttemptsRemaining,n.CodeInvalid,n.CodeInputValue,n.ResendTimer,!0,n.ReissueLinkInProgress),z()]):[n,T(s=>{s(new nn(3,[!0]))})]}case 2:return[new jn(t.fields[0],n.CodeInvalid,n.CodeInputValue,n.ResendTimer,n.SignInInProgress,n.ReissueLinkInProgress),T(i=>{i(new nn(3,[!0]))})];case 3:{const i=t.fields[0];return[new jn(n.AttemptsRemaining,i,i?"":n.CodeInputValue,n.ResendTimer,!1,n.ReissueLinkInProgress),z()]}case 4:return[new jn(n.AttemptsRemaining,n.CodeInvalid,t.fields[0],n.ResendTimer,n.SignInInProgress,n.ReissueLinkInProgress),z()];case 5:return[new jn(n.AttemptsRemaining,n.CodeInvalid,n.CodeInputValue,n.ResendTimer,n.SignInInProgress,!0),z()];default:{const i=Ms(a=>{je(a)},()=>E.Delay(()=>E.Bind($s(1e3),()=>E.Return(void 0))),void 0,()=>new nn(0,[]));let s;const o=n.ResendTimer;return s=o!=null?o>0?(r=o|0,[r-1,i]):[void 0,z()]:[20,i],[new jn(n.AttemptsRemaining,n.CodeInvalid,n.CodeInputValue,s[0],n.SignInInProgress,n.ReissueLinkInProgress),s[1]]}}}function zs(e){e.target.id==="one-time-code-input"||e.key!=="Enter"&&document.getElementById("one-time-code-input").focus()}function Yb(){document.addEventListener("keypress",e=>{zs(e)}),document.addEventListener("paste",e=>{zs(e)})}const Jb={Dispose(){document.removeEventListener("keypress",e=>{zs(e)}),document.removeEventListener("paste",e=>{zs(e)})}};function Zb(e){const t=e.reissueLink,n=e.reissueOneTimeCode,r=e.validateOneTimeCode,i=e.maskedPhone,s=el(()=>Ds(Gb,(f,c)=>qb(r,f,c),(f,c)=>{}),void 0,void 0),o=s[0],a=s[1];qo(()=>(Yb(),Jb),new Array(0));const l=()=>{a(new nn(1,[f=>{a(new nn(2,[f.AttemptsRemaining]))}]))},u=ce(A(()=>j(v(f1([])),A(()=>j(v(un("Enter your security code")),A(()=>{let f,c,p;return j(v(d("div",S(_([(f="text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4",["className",f]),(c=[(p=_([d("span",{children:["We’ve sent a security code to your mobile number ending in •••"]}),d("span",{className:"font-semibold",children:Mo(ta,i)}),d("span",{children:["."]})]),d("p",{children:C.Children.toArray(Array.from(p))})),d("p",{children:["Enter your code to sign in."]})],["children",C.Children.toArray(Array.from(c))])])))),A(()=>{let m;return j(v(d("div",S(_([["className","mt-8 flex relative"],(m=ce(A(()=>{let $;return j(v(d("input",S(_([["className","absolute w-full h-full peer z-10 opacity-0"],["id","one-time-code-input"],["type","text"],["autoComplete","one-time-code"],["maxLength",6],["onClick",g=>{const w=g.target;w.selectionStart=o.CodeInputValue.length|0,w.selectionEnd=o.CodeInputValue.length|0,a(new nn(3,[!1]))}],["onChange",g=>{const w=Mo(ta,g.target.value);a(new nn(4,[w])),w.length===6&&l()}],($=o.CodeInputValue,["ref",g=>{g!=null&&!M(g.value,$)&&(g.value=$)}])])))),A(()=>Cc(g=>{const w=Ee(y=>y,pc(g,o.CodeInputValue.split(""))),b=Ee(y=>y,pc(g-1,o.CodeInputValue.split("")));return v(d("div",{key:g,className:ge(" ",ce(A(()=>j(v("flex justify-center items-center text-xl w-10 h-12 rounded-md ring-inset ring-1 transition ease-in"),A(()=>j(o.CodeInvalid?v("ring-red-600"):v("ring-gray-400"),A(()=>j(v(g===2?"mr-4":g===5?"":"mr-2"),A(()=>w!=null||b!=null||g===0?v("peer-focus:ring-2 peer-focus:ring-primary-base"):is()))))))))),children:be(w,"")}))},l0(0,1,5))))})),["children",C.Children.toArray(Array.from(m))])])))),A(()=>{let $;return j(o.CodeInvalid?v(d("p",S(_([["className","w-[288px] text-red-600 mt-2 leading-5"],($=ce(A(()=>j(v("The code you entered is invalid"),A(()=>{let g;return j((g=o.AttemptsRemaining,g==null?v(K()):v(`, you have ${g} attempts remaining`)),A(()=>j(v("."),A(()=>o.AttemptsRemaining==null?v(" Try again or click on the link below to resend the code."):v(K())))))})))),["children",C.Children.toArray(Array.from($))])])))):is(),A(()=>j(v(Go("sm:w-[288px] mt-6",l,o.SignInInProgress,[d("span",{children:["Continue"]})])),A(()=>{let g;return v(d("div",S(_([["className","mt-8 sm:mt-14 text-sm text-gray-900 whitespace-pre-wrap leading-5 space-y-4"],(g=ce(A(()=>{let w,b;return j((w=o.ResendTimer,w!=null?v(d("p",{children:[`Message sent. Wait ${w} seconds before trying again.`]})):v((b=_([d("span",{children:["Didn’t get the code? "]}),d("span",{className:"text-primary-base underline underline-offset-3 cursor-pointer",onClick:y=>{n(),a(new nn(0,[]))},children:"Resend message"}),d("span",{children:["."]})]),d("p",{children:C.Children.toArray(Array.from(b))})))),A(()=>{let y;return v((y=_([d("span",{children:["Still having trouble? "]}),d("span",{className:"text-primary-base underline underline-offset-3 cursor-pointer",onClick:x=>{o.ReissueLinkInProgress||(a(new nn(5,[])),t())},children:"Sign in with email instead"}),d("span",{children:["."]})]),d("p",{children:C.Children.toArray(Array.from(y))})))}))})),["children",C.Children.toArray(Array.from(g))])]))))}))))}))}))}))))));return d(Se,{},...u)}function Xb(e){const t=e.reissueLink,n=e.brandingOption,r=os(!1),i=ce(A(()=>j(v(h1([])),A(()=>j(v(un("Access link timed-out")),A(()=>{let s,o;return j(v(d("div",S(_([(s="text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4",["className",s]),(o=[d("p",{children:["Your 5-minute temporary access link has timed-out."]}),d("p",{children:["Get a new link to continue."]})],["children",C.Children.toArray(Array.from(o))])])))),A(()=>j(v(Go("mt-8 mb-8 sm:mb-14",()=>{r[1](!0),t()},r[0],[d("span",{children:["Get a new link"]})])),A(()=>{const a=n;return a==null?v(K()):v(Qr(a))}))))}))))));return d(Se,{},...i)}function Hs(e,t){const n=be(on(i=>i.CompanyName,e),"your employer"),r=ce(A(()=>j(v(Uo([])),A(()=>j(v(un("You’re all done")),A(()=>{let i;return j(v(d("div",S(_([["className","text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4 mb-8 sm:mb-14"],(i=[d("p",{children:[`Your ${t} is now complete and your pay information has now been submitted to ${n}.`]}),d("p",{children:["You can now close this window."]})],["children",C.Children.toArray(Array.from(i))])])))),A(()=>{const s=e;return s==null?v(K()):v(Qr(s))}))}))))));return d(Se,{},...r)}function ph(){let e,t,n,r,i,s,o,a,l;return d("div",S(_([["className","flex lg:min-w-[1024px] xl:min-w-[1280px] max-w-screen-xl justify-center"],(e=[d("div",S(_([["className","flex flex-col justify-center items-center"],(t=[Uo([]),un("You’re all set!"),d("div",S(_([["className","text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4 mb-8 sm:mb-14"],(n=[d("p",{children:["Access your exclusive benefits by downloading the Flare app."]}),d("div",S(_([["className","hidden lg:flex justify-center lg:py-8"],(r=[d("img",{className:"h-40",src:"/workflows/app/app-invite/qr.png"})],["children",C.Children.toArray(Array.from(r))])]))),d("div",S(_([["className","flex items-center justify-center lg:hidden"],(i=[d("img",{className:"w-[280px]",src:"/workflows/app/app-invite/completed.png"})],["children",C.Children.toArray(Array.from(i))])]))),d("p",S(_([["className","font-semibold pt-5 lg:pt-0"],(s=[d("span",{className:"lg:hidden",children:"Download the Flare App"}),d("span",{className:"hidden lg:block",children:"Scan to download"})],["children",C.Children.toArray(Array.from(s))])]))),d("p",{children:"Available on iOS and Android"})],["children",C.Children.toArray(Array.from(n))])]))),d("div",S(_([["className","flex space-x-6"],(o=[d("a",S(_([["href","https://apps.apple.com/au/app/flare/id1587276031"],["target","_blank"],["rel","noreferrer"],(a=[d("img",{className:"h-10 cursor-pointer",src:"/workflows/app/app-invite/app-store.png"})],["children",C.Children.toArray(Array.from(a))])]))),d("a",S(_([["href","https://play.google.com/store/apps/details?id=com.flarehr.payandbenefits"],["target","_blank"],["rel","noreferrer"],(l=[d("img",{className:"h-10 cursor-pointer",src:"/workflows/app/app-invite/google-play.png"})],["children",C.Children.toArray(Array.from(l))])])))],["children",C.Children.toArray(Array.from(o))])])))],["children",C.Children.toArray(Array.from(t))])]))),d("img",{className:"hidden lg:block w-[640px]",src:"/workflows/app/app-invite/completed.png"})],["children",C.Children.toArray(Array.from(e))])])))}function ml(){let e;const t=[Uo([]),un("You’re all done"),d("div",S(_([["className","text-base sm:text-lg text-gray-900 whitespace-pre-wrap leading-6 sm:leading-8 space-y-3 sm:space-y-4 mb-8 sm:mb-14"],(e=[d("p",{children:["You’ve finished setting up your benefits."]}),d("p",{children:["You can now close this window."]})],["children",C.Children.toArray(Array.from(e))])]))),Qr(new nl("Flare",void 0,new tl("support@flarehr.com",void 0)))];return d(Se,{},...t)}function Kb(e){const t=e.startAuthCodeExchangeBackground,n=e.navigateAuthCodeExchangePage,r=e.magicLink,i=el(()=>Ds(jb,(l,u)=>Ub(r,n,t,l,u),(l,u)=>{}),void 0,void 0),s=i[0],o=i[1],a=ce(A(()=>j(Ce(l=>d("style",{children:[l]}),s.CssOverrides),A(()=>{const l=s.Page;switch(l.tag){case 1:return v(zb(l.fields[0],s.Branding,s.ProcessConfigId,s.JourneyType,()=>{o(new U(5,[l.fields[1],new _e(0,[])]))}));case 2:return v(Hb(l.fields[0],s.Branding));case 3:return v(d(Zb,{maskedPhone:l.fields[0],validateOneTimeCode:u=>{o(new U(4,[u[0],u[1],new _e(0,[])]))},reissueOneTimeCode:()=>{o(new U(3,[!0,new _e(0,[])]))},reissueLink:()=>{o(new U(2,[!0,new _e(0,[])]))}}));case 4:return v(d(Xb,{brandingOption:Gi(s.Branding),reissueLink:()=>{o(new U(2,[!1,new _e(0,[])]))}}));case 5:switch(s.JourneyType.tag){case 1:return v(Hs(s.Branding,"information request"));case 2:return v(ph());case 3:case 4:return v(ml());default:return v(Hs(s.Branding,"onboarding"))}case 6:return l.fields[0].tag===1?v(L1()):l.fields[0].tag===0?v(d(B1,{reissueMagicLink:()=>{o(new U(2,[!0,new _e(0,[])]))}})):l.fields[0].tag===5?v(Zo()):l.fields[0].tag===2?v(Ac(s.Branding)):l.fields[0].tag===3?v(V1(s.Branding)):v(F1(s.Branding));default:return v(b1)}}))));return d(Se,{},...a)}function Qb(e){let t,n,r;const i=e.startAuthCodeExchangeBackground,s=e.navigateAuthCodeExchangePage,o=e.inviteCode;return ur(()=>{Ut(0)}),d("div",S(_([(t="min-h-full flex flex-col items-center justify-between w-full mx-auto text-center pt-8 sm:pt-20 pb-6 sm:pb-8 px-4 bg-white",["className",t]),(n=[d("div",S(_([["className","flex flex-col items-center justify-center sm:max-w-[640px]"],(r=ce(A(()=>{const a=m2(o);return a.tag===0?v(d(Kb,{magicLink:a.fields[0],navigateAuthCodeExchangePage:s,startAuthCodeExchangeBackground:i})):v(Ac(void 0))})),["children",C.Children.toArray(Array.from(r))])]))),Ko],["children",C.Children.toArray(Array.from(n))])])))}class W extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Home","LegacyInvite","InviteV2","AuthCodeExchange","AuthCodeExchangeWithCurrentAuth","NotFound","LoggedOut"]}}function eC(e){let t,n,r;if(O(e))t=2;else if(k(e)==="workflows")if(O(P(e)))t=2;else switch(k(P(e))){case"app":{t=0,n=P(P(e));break}case"embed":{O(P(P(e)))?t=2:k(P(P(e)))==="v1.0"?(t=1,r=P(P(P(e)))):t=2;break}default:t=2}else t=2;switch(t){case 0:return new na(1,[n]);case 1:return new na(0,[r]);default:return new na(2,[void 0])}}function tC(e){const t=mn(e);if(t!=null)return Ee(r=>r[1],Jr(r=>r[0]==="code",t))}function $h(e){let t,n,r,i,s,o,a;const l=eC(e);switch(l.tag){case 1:return[O(l.fields[0])?O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[])):(t=mn(k(l.fields[0])),t!=null?O(t)?O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[])):k(t)[0]==="invite"?O(P(t))?O(P(l.fields[0]))?(n=k(t)[1],r=Fc(n),r.tag===1?new W(5,[]):new W(1,[])):O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[])):O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[])):O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[])):O(l.fields[0])?new W(0,[]):(i=mn(k(l.fields[0])),i!=null?O(i)?new W(0,[]):k(i)[0]==="invite-code"?O(P(i))?O(P(l.fields[0]))?(s=k(i)[1],new W(2,[s])):new W(0,[]):new W(0,[]):new W(0,[]):new W(0,[]))),new Ln(1,[])];case 2:return[new W(5,[]),new Ln(2,[])];default:return[O(l.fields[0])?new W(0,[]):O(P(l.fields[0]))?new W(0,[]):(o=tC(k(P(l.fields[0]))),o!=null?O(P(P(l.fields[0])))?(a=o,new W(3,[dl(a)])):new W(0,[]):new W(0,[])),new Ln(0,[])]}}let Un=class extends R{constructor(t,n,r){super(),this.CurrentPage=t,this.Credentials=n,this.AppMode=r}},pn=class extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["UrlChanged","NavigateAuthCodeExchangePage","NavigateAuthCodeExchangePageWithCurrentAuth","AuthMsg","StartAuthCodeExchangeBackground","DisplayLoggedOut"]}};function nC(){let e;return ur(()=>{Ut(0)}),d("div",S(_([["className","w-full sm:max-w-md mt-5 mx-1 text-center mx-auto"],(e=[d("h4",{className:"text-2xl",children:"You have been logged out of your onboarding due to inactivity"}),d("br",{}),d("p",{children:["To continue your onboarding, please find your onboarding invite email and click the link again."]})],["children",C.Children.toArray(Array.from(e))])])))}class Ci extends Error{}Ci.prototype.name="InvalidTokenError";function rC(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function iC(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return rC(t)}catch{return atob(t)}}function sC(e,t){if(typeof e!="string")throw new Ci("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new Ci(`Invalid token specified: missing part #${n+1}`);let i;try{i=iC(r)}catch(s){throw new Ci(`Invalid token specified: invalid base64 for part #${n+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new Ci(`Invalid token specified: invalid json for part #${n+1} (${s.message})`)}}class $n extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}class gh extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Requested","Finished"]}}class ve extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["PersonalDetails","EmergencyContacts","Bank","Tax","Super","WorkplaceLinking","BenefitsOnboarding","WorkplacePolicies","DiscreteBenefits"]}}class Si extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Hidden","Incomplete","Complete"]}}function pl(e){return e?new Si(1,[]):new Si(0,[])}class se extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Completed","Disabled","Active","Locked","CompletedAndDisabled"]}}function wh(e){return M(e,Ue)?new h(0,[new ve(0,[])]):M(e,ut)?new h(0,[new ve(1,[])]):M(e,ct)?new h(0,[new ve(2,[])]):M(e,ft)?new h(0,[new ve(3,[])]):M(e,Pe)?new h(0,[new ve(4,[])]):M(e,In)?new h(0,[new ve(5,[])]):M(e,jt)?new h(0,[new ve(7,[])]):M(e,An)?new h(0,[new ve(8,[])]):new h(1,["Invalid step"])}function oC(e){switch(e.tag){case 1:return ut;case 2:return ct;case 3:return ft;case 4:return Pe;case 5:return In;case 6:return us;case 7:return jt;case 8:return An;default:return Ue}}function yh(e){switch(e.tag){case 1:return"Emergency contacts";case 2:return"Bank details";case 3:return"Tax declaration";case 4:return"Super nomination";case 5:return In.DisplayName;case 6:return"Workplace benefits";case 7:return"Fair Work";case 8:return An.DisplayName;default:return"Employee profile"}}function _h(e){switch(e.tag){case 1:return"Contacts";case 2:return"Bank";case 3:return"Tax";case 4:return"Super";case 5:return In.DisplayName;case 6:return"Benefits";case 7:return"Fair Work";case 8:return An.DisplayName;default:return"Profile"}}function vh(e){switch(e.tag){case 1:return ut;case 2:return ct;case 3:return ft;case 4:return Pe;case 5:return In;case 6:return us;case 7:return jt;case 8:return An;default:return Ue}}function aC(e){switch(e.tag){case 5:case 6:case 8:return!1;default:return!0}}function lC(e,t){return e.tag===0?t:$t(t,T(new ve(6,[])))}class Ir extends R{constructor(t,n){super(),this.Id=t,this.Status=n}}function zn(e){return yh(e.Id)}function uC(e){return _h(e.Id)}function cC(e){return vh(e.Id).ComponentTagName}function fC(e){return vh(e.Id).Id}function dC(e){return aC(e.Id)}function hC(e){if(e.Id.tag===0)return e}function mC(e){if(e.Id.tag===1)return e}function pC(e){return Jr(t=>M(t.Status,new se(2,[])),e)}function $C(e){return((n,r)=>{e:for(;;){const i=n,s=r;if(O(i))return s;if(M(k(i).Status,new se(2,[])))return Ro([s,T(k(i)),P(i)]);if(M(k(i).Status,new se(1,[])))return Ro([s,T(new Ir(k(i).Id,new se(2,[]))),P(i)]);n=P(i),r=$t(s,T(k(i)));continue e}})(e,le())}function $l(e,t){const n=be(e.PaySetupComplete,!1);let r;const i=Sr(Xe(wh,e.Configuration.Steps));if(r=i.tag===1?new h(1,[i.fields[0]]):new h(0,[lC(t,i.fields[0])]),r.tag===1)return new h(1,[r.fields[0]]);{const s=Sr(Xe(wh,V$(e)));return s.tag===1?new h(1,[s.fields[0]]):new h(0,[$C(Xe(o=>n&&dC(o)&&M(o.Status,new se(0,[]))?new Ir(o.Id,new se(4,[])):o,Xe(o=>yc(a=>M(a,o.Id),s.fields[0])?new Ir(o.Id,new se(0,[])):o,Xe(o=>M(o.Id,new ve(6,[]))&&!n?new Ir(o.Id,new se(3,[])):o,Xe(o=>new Ir(o,new se(1,[])),r.fields[0])))))])}}class bh extends R{constructor(t,n,r,i,s,o,a,l,u,f,c){super(),this.AppMode=t,this.JourneyType=n,this.Branding=r,this.IsBenefitsStepEnabled=i,this.IsPaySetupCompatible=s,this.IsPaySetupComplete=o,this.Status=a,this.ProcessInstanceId=l,this.InstanceName=u,this.ProcessConfigId=f,this.Steps=c}}function Ch(e){switch(e.Status.tag){case 3:return!1;case 0:return!1;case 1:return be(e.PaySetupComplete,!1);default:return!0}}function gC(e,t){let n;const r=[t.ProcessInstance,pl(t.IsBenefitsEnabled)];return n=$l(r[0],r[1]),n.tag===1?new h(1,[n.fields[0]]):new h(0,[new bh(e,t.ProcessInstance.JourneyType,t.Branding,t.IsBenefitsEnabled,x$(t.ProcessInstance.Configuration),Ch(t.ProcessInstance),t.ProcessInstance.Status,t.ProcessInstance.Id,t.ProcessInstance.Configuration.Name,t.ProcessInstance.Configuration.Id,n.fields[0])])}function wC(e,t){let n;const r=[t,pl(e.IsBenefitsStepEnabled)];return n=$l(r[0],r[1]),n.tag===1?new h(1,[n.fields[0]]):new h(0,[new bh(e.AppMode,e.JourneyType,e.Branding,e.IsBenefitsStepEnabled,e.IsPaySetupCompatible,Ch(t),t.Status,e.ProcessInstanceId,e.InstanceName,e.ProcessConfigId,n.fields[0])])}function gl(e,t){const n=e;return n.tag===1?new h(1,[n.fields[0]]):wC(t,n.fields[0])}let me=class extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Initialising","StepList","Step","PaySetupCompleteConfirmation","Oops","ErrorPage","AllDone"]}};function Hn(e){switch(e.tag){case 1:return e.fields[0];case 2:return e.fields[1];case 3:return e.fields[0];case 4:return;case 5:return;case 6:return e.fields[0];default:return}}class X extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Activate","ChangeCurrentView","CloseStepListView","StepCompletionEventCallback","CompleteStep","ConfirmPaySetupComplete","ResumePaySetup","CompletePaySetup","PaySetupCompleted","CompleteWorkflow","ShowAllDoneAndNotifyComplete","SendAnalyticsEvent","AppendTrailingSlashToUrl","CompleteBenefitsOnboardingStep","CommandSuccess","CommandFailure"]}}class Ae extends R{constructor(t,n,r,i,s){super(),this.ProfileId=t,this.ProcessInstanceId=n,this.CurrentView=r,this.CssOverrides=i,this.BenefitsOnboarding=s}}function wl(e){switch(e.tag){case 1:return"Information request";case 2:return"Workflow";case 3:return"Benefits Onboarding";case 4:return"Benefits Onboarding";default:return"Onboarding"}}function yl(e){if(e<640)return ke(void 0)}function _l(e){return((n,r)=>{e:for(;;){const i=n,s=r;let o,a,l,u;if(O(i))o=0;else{const f=hC(k(i));if(f!=null)if(O(P(i)))o=2;else{const c=mC(k(P(i)));c!=null?(o=1,a=c,l=f,u=P(P(i))):o=2}else o=2}switch(o){case 0:return s;case 1:{n=u,r=$t(s,T(M(a.Status,new se(2,[]))?new Ir(l.Id,new se(2,[])):l));continue e}default:if(O(i))throw new Error("Match failure");n=P(i),r=$t(s,T(k(i)));continue e}}})(e,le())}function Ar(e){let t,n;return d("div",S(_([(t="absolute inset-0 min-h-full flex flex-col items-center justify-between w-full mx-auto text-center pt-8 sm:pt-20 pb-6 sm:pb-8 px-4 bg-white",["className",t]),(n=[d("div",{className:"mt-5 px-4 flex flex-col items-center justify-center sm:max-w-[640px]",children:C.Children.toArray([e])}),Ko],["children",C.Children.toArray(Array.from(n))])])))}function yC(e,t){let n,r;const i=e.tag===2?e.fields[0]:void 0;let s;if(i==null)s=void 0;else{const f=i;s=on(c=>Dp(c+1,t.Steps),ns(c=>M(f,c),t.Steps))}const o=Ee(f=>new X(1,[new me(2,[f,t])]),Jr(f=>M(f.Status,new se(2,[])),t.Steps));let a,l,u;switch(i!=null&&s!=null?(r=s,M(i.Status,new se(2,[]))&&(M(r.Status,new se(1,[]))?!0:M(r.Status,new se(3,[])))?(a=0,l=i):(a=1,u=s)):a=2,a){case 0:return new X(1,[(n=[l,t],new me(2,[n[0],n[1]]))]);case 1:return M(u.Status,new se(3,[]))?void 0:new X(1,[new me(2,[u,t])]);default:return o}}function _C(e,t){let n;const r=e.IsPaySetupCompatible&&!e.IsPaySetupComplete&&rr(e.Steps)!==1;let i;if(r)switch(t.tag){case 1:case 0:{i=0;break}default:i=1}else i=1;switch(i){case 0:return n=[e,{Branding:Gi(e.Branding),InjectedBenefits:e.IsBenefitsStepEnabled}],new X(5,[n[0],n[1]]);default:return}}function vC(e){if(sa(e.Status))return new X(10,[e])}function vl(e,t,n){return be(Yu(Yu(vC(t),yC(e,t)),_C(t,n)),new X(9,[new $n(0,[])]))}function bC(e){const t=cr(e)|0;return Ve(Le("%s/workflows/backend/%i"))(Bn)(t)}function CC(e){const t=cr(e)|0;return Ve(Le("%s/workflows/backend/process-instances/%i/activate"))(Bn)(t)}function SC(e){const t=cr(e)|0;return Ve(Le("%s/workflows/backend/process-instances/%i/analytics-events"))(Bn)(t)}function bl(e,t){return E.Delay(()=>{const n=wi(zv(Ve(Le("Bearer %s"))(e)),t);let r;const i=yi(n);return r=E.Bind(i,s=>E.Return(new h(0,[s]))),E.Bind(r,s=>{const o=s;if(o.tag===1)return E.Return(new h(1,[o.fields[0]]));{const a=o.fields[0];if(a.statusCode===429||a.statusCode>=500){const l=yi(n);return E.Bind(l,u=>E.Return(new h(0,[u])))}else return E.Return(new h(0,[a]))}})})}function ki(e,t,n,r){return E.Delay(()=>{let i,s;const o=bl(n,(i=Zt(new Nt(1,[(s=new A0(T(rv(e)),r),Xt(0,Qt(Cv(),new Ne(1,[]),void 0,void 0)(s)))]),Jt(new Dt(1,[]),Yt(bC(t)))),wi(js("application/json"),i)));return E.Bind(o,a=>{const l=a;if(l.tag===1)return E.Return(new h(1,[l.fields[0]]));{const u=l.fields[0];if(u.statusCode===200){let f;const c=en(Q(tn(C0(),new Ne(1,[]))),u.responseText);return f=c.tag===1?new h(1,[c.fields[0]]):iv(c.fields[0]),E.Return(f)}else return E.Return(new h(1,["Unexpected response from backend"]))}})})}function kC(e,t,n){return E.Delay(()=>{let r,i;const s=bl(t,(r=Zt(new Nt(1,[(i=new I0(n),Xt(0,Qt(bv(),new Ne(1,[]),void 0,void 0)(i)))]),Jt(new Dt(1,[]),Yt(CC(e)))),wi(js("application/json"),r)));return E.Bind(s,o=>{const a=o;if(a.tag===1)return E.Return(new h(1,[a.fields[0]]));{const l=a.fields[0];if(l.statusCode===200){let u;const f=en(Q(tn(ov(),new Ne(1,[]))),l.responseText);return u=f.tag===1?new h(1,[f.fields[0]]):new h(0,[dv(f.fields[0])]),E.Return(u)}else return E.Return(new h(1,["Unexpected response from backend"]))}})})}function xC(e,t,n,r){let i;const s=E.Delay(()=>{let o,a;return bl(e,(o=Zt(new Nt(1,[(a=new E0(T(n),r),Xt(0,Qt(Sv(),new Ne(1,[]),void 0,void 0)(a)))]),Jt(new Dt(1,[]),Yt(SC(t)))),wi(js("application/json"),o)))});return i=E.Bind(s,o=>{let a;const l=o;return a=l.tag===1?new h(1,[l.fields[0]]):new h(0,[void l.fields[0]]),E.Return(a)}),E.Bind(i,o=>{const a=o;return a.tag===1||a.fields[0],E.Return()})}function IC(e,t,n){return kC(e,t,n)}function AC(e,t,n,r){return ki(new $i(1,[n]),t,r,e)}function EC(e,t,n,r){return ki(new $i(3,[r]),t,n,e)}function TC(e,t,n,r){return ki(new $i(4,[r]),t,n,e)}function PC(e,t,n,r){return ki(new $i(5,[r]),t,n,e)}function OC(e,t,n){return ki(new $i(2,[]),t,n,e)}function MC(e){const t=sC(e);return[new Ae(Lc(t.sub),df(t.workflow.instanceId),new me(0,[]),le(),new Si(0,[])),T(n=>{n(new X(0,[new gh(0,[void 0])]))})]}function Cl(e,t){if(e.tag===2){const n=oC(e.fields[0].Id);if(M(n.Id,us.Id))return T(r=>{r(new X(11,[t,new Ns(1,[])]))});{const r=new X(11,[t,new Ns(0,[cs(n.Id)])]);return T(i=>{i(r)})}}else return z()}function DC(e,t,n,r,i){let s,o,a,l,u,f,c,p,m,$,g,w,b;switch(r.tag){case 1:return[new Ae(i.ProfileId,i.ProcessInstanceId,r.fields[0],i.CssOverrides,i.BenefitsOnboarding),Cl(r.fields[0],i.ProcessInstanceId)];case 2:{const y=vl(i.CurrentView,r.fields[0],i.BenefitsOnboarding);return[i,T(x=>{x(y)})]}case 11:return je(xC(t,r.fields[0],r.fields[1],n)),[i,z()];case 3:{const y=Hn(i.CurrentView);if(y!=null){const x=y;return[i,(s=r.fields[0].target,o=Jr(B=>cp(cC(B),s.tagName,5)===0,x.Steps),o==null?z():M(o.Id,new ve(6,[]))?T(B=>{B(new X(13,[]))}):(a=o,l=new X(4,[fC(a),new $n(0,[])]),T(B=>{B(l)})))]}else return[i,z()]}case 13:{const y=Hn(i.CurrentView);let x,B;switch(y!=null?M(i.BenefitsOnboarding,new Si(0,[]))?x=1:(x=0,B=y):x=1,x){case 0:return[new Ae(i.ProfileId,i.ProcessInstanceId,i.CurrentView,i.CssOverrides,new Si(2,[])),o0(_([T(V=>{V(new X(11,[i.ProcessInstanceId,new Ns(2,[])]))}),T(V=>{V(new X(9,[new $n(0,[])]))}),T(V=>{V(new X(1,[new me(6,[B])]))})]))];default:return[i,z()]}}case 4:switch(r.fields[1].tag){case 1:return[i,z()];case 2:{const y=r.fields[1].fields[0],x=y;x.tag===1?x.fields[0]:Cg(r.fields[0],x.fields[0],i.ProfileId);const B=Hn(i.CurrentView);if(B==null)return[i,z()];{const V=gl(y,B);return V.tag===1?[new Ae(i.ProfileId,i.ProcessInstanceId,new me(4,[]),i.CssOverrides,i.BenefitsOnboarding),z()]:[i,(u=vl(i.CurrentView,V.fields[0],i.BenefitsOnboarding),T(te=>{te(u)}))]}}case 3:return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(5,[]),i.CssOverrides,i.BenefitsOnboarding),z()];default:return[i,bt(y=>{je(y)},y=>AC(n,i.ProcessInstanceId,r.fields[0],y),t,y=>new X(4,[r.fields[0],new $n(2,[y])]),y=>new X(4,[r.fields[0],new $n(3,[y])]))]}case 5:return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(3,[r.fields[0]]),i.CssOverrides,i.BenefitsOnboarding),bt(y=>{je(y)},y=>EC(n,i.ProcessInstanceId,t,y),r.fields[1].InjectedBenefits,y=>new X(14,[]),y=>new X(15,[y]))];case 6:{const y=Hn(i.CurrentView);if(y==null)return[i,z()];{const x=y,B=bt(te=>{je(te)},te=>PC(n,i.ProcessInstanceId,t,te),r.fields[0].InjectedBenefits,te=>new X(14,[]),te=>new X(15,[te])),V=new me(2,[xp(Bo(te=>M(te.Status,new se(0,[]))?!0:M(te.Status,new se(4,[])),x.Steps)),x]);return[new Ae(i.ProfileId,i.ProcessInstanceId,V,i.CssOverrides,i.BenefitsOnboarding),o0(_([B,Cl(V,i.ProcessInstanceId)]))]}}case 7:return[i,bt(y=>{je(y)},Vi(e)(i.ProcessInstanceId)(t),r.fields[0].InjectedBenefits,y=>new X(8,[y]),y=>new X(15,[y]))];case 8:{const y=Hn(i.CurrentView);if(y==null)return[i,z()];{const x=gl(r.fields[0],y);if(x.tag===1)return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(4,[]),i.CssOverrides,i.BenefitsOnboarding),z()];{const B=vl(i.CurrentView,x.fields[0],i.BenefitsOnboarding);return[i,T(V=>{V(B)})]}}}case 9:switch(r.fields[0].tag){case 1:return[i,z()];case 2:if(r.fields[0].fields[0].tag===1)return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(5,[]),i.CssOverrides,i.BenefitsOnboarding),z()];{ha(r.fields[0].fields[0].fields[0].Id,r.fields[0].fields[0].fields[0].Configuration.Name,r.fields[0].fields[0].fields[0].Configuration.Id,i.ProfileId);const y=Hn(i.CurrentView);if(y==null)return[i,z()];{const x=gl(new h(0,[r.fields[0].fields[0].fields[0]]),y);return x.tag===1?[new Ae(i.ProfileId,i.ProcessInstanceId,new me(5,[]),i.CssOverrides,i.BenefitsOnboarding),z()]:[new Ae(i.ProfileId,i.ProcessInstanceId,new me(6,[x.fields[0]]),i.CssOverrides,i.BenefitsOnboarding),z()]}}case 3:return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(5,[]),i.CssOverrides,i.BenefitsOnboarding),z()];default:{const y=Hn(i.CurrentView);let x,B;switch(y!=null&&sa(y.Status)?(x=0,B=y):x=1,x){case 0:return ha(B.ProcessInstanceId,B.InstanceName,B.ProcessConfigId,i.ProfileId),[i,z()];default:return[i,bt(V=>{je(V)},V=>OC(n,i.ProcessInstanceId,V),t,V=>new X(9,[new $n(2,[V])]),V=>new X(9,[new $n(3,[V])]))]}}}case 10:return ha(r.fields[0].ProcessInstanceId,r.fields[0].InstanceName,r.fields[0].ProcessConfigId,i.ProfileId),[new Ae(i.ProfileId,i.ProcessInstanceId,new me(6,[r.fields[0]]),i.CssOverrides,i.BenefitsOnboarding),z()];case 12:return[i,(f=window.location.pathname+"/"+window.location.search+window.location.hash,a0(y=>{ol(T(f),1)}))];case 14:return[i,z()];case 15:return[i,z()];default:if(r.fields[0].tag===1){if(r.fields[0].fields[0].tag===1)return[new Ae(i.ProfileId,i.ProcessInstanceId,new me(4,[]),i.CssOverrides,i.BenefitsOnboarding),z()];{let y;const x=pl(r.fields[0].fields[0].fields[0].IsBenefitsEnabled);let B;const V=[r.fields[0].fields[0].fields[0].ProcessInstance,x];if(B=$l(V[0],V[1]),B.tag===1)y=new h(1,[B.fields[0]]);else{const te=B.fields[0],Ke=gC(n,r.fields[0].fields[0].fields[0]);y=Ke.tag===1?new h(1,[Ke.fields[0]]):new h(0,[(c=Ke.fields[0],p=sa(r.fields[0].fields[0].fields[0].ProcessInstance.Status),m=pC(te),m==null?c.IsPaySetupComplete?p?[new Ae(i.ProfileId,i.ProcessInstanceId,new me(6,[c]),r.fields[0].fields[0].fields[0].CssOverrides,x),z()]:(Ut(0),[new Ae(i.ProfileId,i.ProcessInstanceId,new me(6,[c]),r.fields[0].fields[0].fields[0].CssOverrides,x),T(Re=>{Re(new X(9,[new $n(0,[])]))})]):[new Ae(i.ProfileId,i.ProcessInstanceId,new me(3,[c]),r.fields[0].fields[0].fields[0].CssOverrides,x),z()]:($=(g=m,w=al.clientWidth,b=rr(te)|0,b===1?(document.title=zn(g),new me(2,[g,c])):yl(w)!=null?new me(1,[c]):new me(2,[g,c])),[new Ae(i.ProfileId,i.ProcessInstanceId,$,r.fields[0].fields[0].fields[0].CssOverrides,x),Cl($,i.ProcessInstanceId)]))])}return y.tag===1?[new Ae(i.ProfileId,i.ProcessInstanceId,new me(4,[]),i.CssOverrides,i.BenefitsOnboarding),z()]:y.fields[0]}}else return[i,Ms(y=>{je(y)},()=>IC(i.ProcessInstanceId,t,n),void 0,y=>new X(0,[new gh(1,[y])]))]}}function NC(e,t,n,r){return DC((i,s,o)=>TC(t,i,s,o),e,t,n,r)}const RC=d("div",S(_([["className","text-primary-base"],(()=>{let e,t,n;const r=[d("svg",S(_([["fill","none"],["height",32],["viewBox","0 0 32 32"],["width",32],["xmlns","http://www.w3.org/2000/svg"],(e=T(d("g",S(T((t=_([d("rect",{width:32,height:32,fill:"white"}),d("circle",{cx:16,cy:16,r:16,fill:"currentColor"}),d("path",S(_([(n="M20.3018 11.7811L13.9959 18.0829L11.6982 15.7867C11.5092 15.6043 11.2561 15.5033 10.9933 15.5056C10.7306 15.5079 10.4793 15.6132 10.2935 15.7989C10.1077 15.9845 10.0023 16.2357 10 16.4983C9.99775 16.7608 10.0988 17.0138 10.2813 17.2026L13.2874 20.2068C13.4754 20.3945 13.7302 20.5 13.9959 20.5C14.2616 20.5 14.5164 20.3945 14.7043 20.2068L21.7187 13.1971C21.9012 13.0082 22.0022 12.7553 22 12.4927C21.9977 12.2301 21.8923 11.979 21.7065 11.7933C21.5207 11.6076 21.2694 11.5023 21.0067 11.5C20.7439 11.4978 20.4908 11.5987 20.3018 11.7811Z",["d",n]),["fill","white"]])))]),["children",C.Children.toArray(Array.from(t))]))))),["children",C.Children.toArray(Array.from(e))])])))];return["children",C.Children.toArray(Array.from(r))]})()]))),BC=d("div",S(_([["className","text-primary-base"],(()=>{let e,t,n,r;const i=[d("svg",S(_([["fill","none"],["height",32],["viewBox","0 0 32 32"],["width",32],["xmlns","http://www.w3.org/2000/svg"],(e=T(d("g",S(T((t=_([d("rect",{width:32,height:32,fill:"white"}),d("circle",{cx:16,cy:16,r:15,stroke:"currentColor",strokeWidth:2}),d("path",S(_([(n="M16.616 12.6769L11.146 18.1459C11.0908 18.2022 11.0497 18.2707 11.026 18.3459L10.026 21.3459C10.0018 21.4208 9.99555 21.5004 10.0079 21.5781C10.0202 21.6559 10.0507 21.7296 10.0969 21.7934C10.1431 21.8571 10.2036 21.909 10.2737 21.9449C10.3438 21.9808 10.4213 21.9997 10.5 21.9999C10.5538 22.0002 10.6072 21.9914 10.658 21.9739L13.658 20.9739C13.7332 20.9503 13.8017 20.9091 13.858 20.8539L19.327 15.3839L16.616 12.6769Z",["d",n]),["fill","currentColor"]]))),d("path",S(_([(r="M21.8545 12.146L19.8545 10.146C19.808 10.0994 19.7529 10.0625 19.6921 10.0373C19.6314 10.0121 19.5663 9.99908 19.5005 9.99908C19.4347 9.99908 19.3696 10.0121 19.3089 10.0373C19.2481 10.0625 19.1929 10.0994 19.1465 10.146L17.6775 11.616L20.3845 14.323L21.8545 12.854C21.9011 12.8075 21.938 12.7524 21.9632 12.6916C21.9884 12.6309 22.0014 12.5657 22.0014 12.5C22.0014 12.4342 21.9884 12.3691 21.9632 12.3083C21.938 12.2476 21.9011 12.1924 21.8545 12.146Z",["d",r]),["fill","currentColor"]])))]),["children",C.Children.toArray(Array.from(t))]))))),["children",C.Children.toArray(Array.from(e))])])))];return["children",C.Children.toArray(Array.from(i))]})()]))),LC=d("svg",S(_([["fill","none"],["height",32],["viewBox","0 0 32 32"],["width",32],["xmlns","http://www.w3.org/2000/svg"],(()=>{let e,t,n;const r=T(d("g",S(T((e=_([d("rect",{width:32,height:32,fill:"white"}),d("circle",{cx:16,cy:16,r:15,stroke:"#D1D5DB",strokeWidth:2}),d("path",S(_([(t="M15 13C15 12.7348 15.1054 12.4804 15.2929 12.2929C15.4804 12.1054 15.7348 12 16 12C16.2652 12 16.5196 12.1054 16.7071 12.2929C16.8946 12.4804 17 12.7348 17 13V15H19V13C19 12.2044 18.6839 11.4413 18.1213 10.8787C17.5587 10.3161 16.7956 10 16 10C15.2044 10 14.4413 10.3161 13.8787 10.8787C13.3161 11.4413 13 12.2044 13 13V15H15V13Z",["d",t]),["fill","#9CA3AF"]]))),d("path",S(_([(n="M19.6 16H12.4C11.9029 16 11.5 16.3731 11.5 16.8333V20.1667C11.5 20.6269 11.9029 21 12.4 21H19.6C20.0971 21 20.5 20.6269 20.5 20.1667V16.8333C20.5 16.3731 20.0971 16 19.6 16Z",["d",n]),["fill","#9CA3AF"]])))]),["children",C.Children.toArray(Array.from(e))])))));return["children",C.Children.toArray(Array.from(r))]})()]))),Sh=d("svg",S(_([["fill","none"],["height",32],["viewBox","0 0 32 32"],["width",32],["xmlns","http://www.w3.org/2000/svg"],(()=>{let e;const t=T(d("g",S(T((e=_([d("rect",{width:32,height:32,fill:"white"}),d("circle",{cx:16,cy:16,r:15,stroke:"#D1D5DB",strokeWidth:2})]),["children",C.Children.toArray(Array.from(e))])))));return["children",C.Children.toArray(Array.from(t))]})()]))),VC=d("svg",S(_([["fill","none"],["height",32],["viewBox","0 0 32 32"],["width",32],["xmlns","http://www.w3.org/2000/svg"],(()=>{let e,t;const n=T(d("g",S(T((e=_([d("rect",{width:32,height:32,fill:"white"}),d("circle",{cx:16,cx:16,cy:16,r:15,stroke:"#D1D5DB",strokeWidth:2}),d("path",S(_([(t="M20.3018 11.7811L13.9959 18.0829L11.6982 15.7867C11.5092 15.6043 11.2561 15.5033 10.9933 15.5056C10.7306 15.5079 10.4793 15.6132 10.2935 15.7989C10.1077 15.9845 10.0023 16.2357 10 16.4983C9.99775 16.7608 10.0988 17.0138 10.2813 17.2026L13.2874 20.2068C13.4754 20.3945 13.7302 20.5 13.9959 20.5C14.2616 20.5 14.5164 20.3945 14.7043 20.2068L21.7187 13.1971C21.9012 13.0082 22.0022 12.7553 22 12.4927C21.9977 12.2301 21.8923 11.979 21.7065 11.7933C21.5207 11.6076 21.2694 11.5023 21.0067 11.5C20.7439 11.4978 20.4908 11.5987 20.3018 11.7811Z",["d",t]),["fill","#D1D5DB"]])))]),["children",C.Children.toArray(Array.from(e))])))));return["children",C.Children.toArray(Array.from(n))]})()])));function Sl(e,t){let n;return d("div",S(_([["className","w-full h-6 rounded justify-start items-center inline-flex"],(n=[d("div",{className:ge(" ",[e,"text-lg font-medium leading-normal"]),children:t})],["children",C.Children.toArray(Array.from(n))])])))}function FC(e){return Sl("text-gray-900",e)}function kl(e){return Sl("text-gray-500",e)}function WC(e){return Sl("text-primary-base",e)}function jC(e){switch(e.Status.tag){case 0:return FC(zn(e));case 1:return kl(zn(e));case 3:return kl(zn(e));case 4:return kl(zn(e));default:return WC(zn(e))}}function kh(e){let t;return d("div",S(_([["className","w-8 h-6 flex-col justify-center items-center inline-flex"],(t=[d("div",{className:ge(" ",[e,"w-0.5 h-6 relative"])})],["children",C.Children.toArray(Array.from(t))])])))}const UC=kh("bg-gray-300"),xh=kh("bg-primary-base");function zC(e){const t=M(e.Id,new ve(6,[])),n=e.Status;let r;if(t)r=2;else switch(n.tag){case 0:{r=0;break}case 2:{r=1;break}default:r=2}switch(r){case 0:return xh;case 1:return xh;default:return UC}}function Ih(e,t,n){let r,i,s;const o=M(n.Status,new se(0,[]))?!0:M(n.Status,new se(2,[]));return d("button",S(_([["className",ge(" ",["group h-8 justify-start items-center space-x-4 inline-flex focus:outline-none"])],["type","button"],["disabled",!o],["onClick",a=>{let l;e(new X(1,[(l=[n,t],new me(2,[l[0],l[1]]))]))}],(r=[d("div",S(_([["className","w-8 h-8 relative"],(i=ce(A(()=>{const a=n.Status;return a.tag===0?v(RC):a.tag===1?v(Sh):a.tag===3?M(n.Id,new ve(6,[]))?v(LC):v(Sh):a.tag===4?v(VC):v(BC)})),["children",C.Children.toArray(Array.from(i))])]))),d("div",S(_([["className",ge(" ",ce(A(()=>j(v("rounded justify-start items-center flex"),A(()=>o?v("group-focus:outline-none group-focus:ring-2 group-focus:ring-offset-4 group-focus:ring-primary-focus"):is())))))],(s=[jC(n)],["children",C.Children.toArray(Array.from(s))])])))],["children",C.Children.toArray(Array.from(r))])])))}function HC(e){let t,n,r,i=!1,s=0;const o=de(e.Steps);try{for(;o["System.Collections.IEnumerator.MoveNext"]();){const u=o["System.Collections.Generic.IEnumerator`1.get_Current"]();switch(u.Id.tag){case 0:case 1:{i=M(u.Status,new se(0,[]))?!0:M(u.Status,new se(4,[]));break}default:(M(u.Status,new se(0,[]))||M(u.Status,new se(4,[])))&&(s=s+1|0)}}}finally{oe(o)}r=s+(i?1:0);const a=rr(_l(e.Steps))|0,l=u=>d("div",{className:"text-gray-500 text-sm font-medium leading-tight",children:u});return d("div",S(_([(t="h-20 w-full px-6 py-4 bg-white border-b border-gray-300 flex-col justify-start items-start inline-flex cursor-default",["className",t]),(n=ce(A(()=>{let u,f;return j((u=e.Branding,M(e.AppMode,new Ln(0,[]))?v(K()):u!=null&&u.CompanyName!=null?(f=u.CompanyName,v(l(ni(f)))):v(l(wl(e.JourneyType)))),A(()=>v(d("div",{className:"text-center text-gray-900 text-base font-semibold leading-normal",children:`${r}/${a} sections complete`}))))})),["children",C.Children.toArray(Array.from(n))])])))}function GC(e,t){return((r,i)=>{e:for(;;){const s=r,o=i;if(O(s))return o;if(O(P(s)))return $t(o,T(Ih(e,t,k(s))));r=Ze(k(P(s)),P(P(s))),i=$t(o,_([Ih(e,t,k(s)),zC(k(P(s)))]));continue e}})(_l(t.Steps),le())}function qC(e){let t,n,r;const i=e.dispatch,s=e.detail,o=Ic(void 0),a=os(!1);return P1(()=>{const l=window.ResizeObserver?new window.ResizeObserver(()=>{const u=document.body.offsetWidth;yl(u)!=null||a[0]===!1&&(a[1](!0),i(new X(2,[s])))}):new Of(()=>{const u=document.body.offsetWidth;yl(u)!=null||a[0]===!1&&(a[1](!0),i(new X(2,[s])))});return Sn(u=>{l.observe(u)},qi(o.current)),{Dispose(){l.disconnect()}}}),d("div",S(_([["ref",o],["className","absolute top-0 bottom-0 left-0 right-0"],(t=[d("div",S(_([["className","w-full h-full bg-white flex-col justify-start items-start inline-flex"],(n=[HC(s),d("div",S(_([["className","p-6 bg-white flex-col justify-start items-start inline-flex"],(r=GC(i,s),["children",C.Children.toArray(Array.from(r))])])))],["children",C.Children.toArray(Array.from(n))])])))],["children",C.Children.toArray(Array.from(t))])])))}class Er extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["backend-url","access-token","journey-type"]}}class YC extends N{constructor(t){super(),this.tag=0,this.fields=[t]}cases(){return["app-base-url"]}}class JC extends N{constructor(t){super(),this.tag=0,this.fields=[t]}cases(){return["workflows-instance-id"]}}function Ah(e){const t=e.children,n=e.effect,r=e.props,i=e.step;ur(n);const s=i.tag===1?ut.ComponentTagName:i.tag===2?ct.ComponentTagName:i.tag===3?ft.ComponentTagName:i.tag===4?Pe.ComponentTagName:i.tag===5?In.ComponentTagName:i.tag===6?us.ComponentTagName:i.tag===7?jt.ComponentTagName:i.tag===8?An.ComponentTagName:Ue.ComponentTagName;return d(s,gt(r,1),...t)}class xi extends N{constructor(t,n){super(),this.tag=t,this.fields=n}cases(){return["Mobile","MobileLandscape","Tablet","Desktop","WideScreen"]}}class ZC extends R{constructor(t,n,r,i){super(),this.MobileLandscape=t|0,this.Tablet=n|0,this.Desktop=r|0,this.WideScreen=i|0}}const XC=new ZC(576,768,1024,1216);function KC(e){return["(max-width: "+e.MobileLandscape+"px)","(max-width: "+e.Tablet+"px)","(max-width: "+e.Desktop+"px)","(max-width: "+e.WideScreen+"px)"]}function Gs(e){const t=T1(()=>window.matchMedia(e).matches);return qo(()=>{const n=window.matchMedia(e),r=()=>{t[1](n.matches)};return r(),n.addListener(r),ss(()=>{n.removeListener(r)})},[e]),t[0]}function QC(e){const t=KC(be(e,XC)),n=Gs(t[0]),r=Gs(t[1]),i=Gs(t[2]),s=Gs(t[3]);return n?new xi(0,[]):r?new xi(1,[]):i?new xi(2,[]):s?new xi(3,[]):new xi(4,[])}const e3=d("svg",S(_([["fill","none"],["height",16],["viewBox","0 0 16 16"],["width",16],["xmlns","http://www.w3.org/2000/svg"],(()=>{let e,t;const n=T(d("g",S(T((e=_([d("rect",{width:16,height:16,fill:"white"}),d("path",S(_([(t="M15 6.99992H3.41403L6.70703 3.70692C6.88919 3.51832 6.98998 3.26571 6.9877 3.00352C6.98543 2.74132 6.88026 2.49051 6.69485 2.3051C6.50944 2.11969 6.25863 2.01452 5.99643 2.01224C5.73423 2.00997 5.48163 2.11076 5.29303 2.29292L0.293031 7.29292C0.10556 7.48045 0.000244141 7.73475 0.000244141 7.99992C0.000244141 8.26508 0.10556 8.51939 0.293031 8.70692L5.29303 13.7069C5.38528 13.8024 5.49562 13.8786 5.61763 13.931C5.73963 13.9834 5.87085 14.011 6.00363 14.0122C6.13641 14.0133 6.26809 13.988 6.39098 13.9377C6.51388 13.8875 6.62553 13.8132 6.71943 13.7193C6.81332 13.6254 6.88757 13.5138 6.93785 13.3909C6.98813 13.268 7.01343 13.1363 7.01228 13.0035C7.01113 12.8707 6.98354 12.7395 6.93113 12.6175C6.87872 12.4955 6.80254 12.3852 6.70703 12.2929L3.41403 8.99992H15C15.2652 8.99992 15.5196 8.89456 15.7071 8.70703C15.8947 8.51949 16 8.26514 16 7.99992C16 7.7347 15.8947 7.48035 15.7071 7.29281C15.5196 7.10528 15.2652 6.99992 15 6.99992Z",["d",t]),["fill","#212121"]])))]),["children",C.Children.toArray(Array.from(e))])))));return["children",C.Children.toArray(Array.from(n))]})()])));function t3(e,t,n){let r,i,s,o,a;const l=t.Steps;let u;const f=Pp($=>M($.Id,n.Id),l)/rr(l)*100;u=Ve(Le("%.0f%%"))(f);let c;const p=Mp($=>M($.Status,new se(2,[]))?!0:M($.Status,new se(0,[])),l)/rr(l)*100;c=Ve(Le("%.0f%%"))(p);const m=M(n.Id,new ve(1,[]))?yh(new ve(0,[])):zn(n);return d("div",S(_([(r="h-20 w-full px-6 py-4 bg-white border-b border-gray-300 flex-col justify-start items-start space-y-3 inline-flex sticky left-0 right-0 top-0 z-50",["className",r]),(i=[d("div",S(_([["className","self-stretch justify-start items-center space-x-3 inline-flex"],(s=[d("button",{type:"button",className:"w-4 h-4 rounded-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-base",onClick:$=>{e(new X(1,[new me(1,[t])]))},children:C.Children.toArray([e3])}),d("div",{className:"text-center text-gray-900 text-base font-semibold leading-normal",children:m})],["children",C.Children.toArray(Array.from(s))])]))),d("div",S(_([["className","w-full h-2 relative rounded-sm"],(o=[d("div",{className:"w-full h-0.5 left-0 top-[3px] absolute bg-gray-300 rounded-sm"}),d("div",S(_([["className","w-full left-0 top-0 absolute"],(a=[d("div",{className:"h-0.5 left-0 top-[3px] absolute bg-primary-base rounded-sm",style:{width:c}}),d("div",{className:"w-2 h-2 top-0 absolute bg-primary-base rounded-full",style:{left:u}})],["children",C.Children.toArray(Array.from(a))])])))],["children",C.Children.toArray(Array.from(o))])])))],["children",C.Children.toArray(Array.from(i))])])))}const n3=d("div",S(_([["className","relative h-4 w-2 z-50"],(()=>{const e=[d("div",{className:"absolute left-0 top-1 h-2 w-2 rounded-full bg-primary-base"})];return["children",C.Children.toArray(Array.from(e))]})()]))),r3=d("div",{className:"relative h-0.5 w-2 bg-gray-300"}),Eh=d("div",{className:"relative h-0.5 w-2 bg-primary-base"}),i3=d("div",S(_([["className","w-4 h-4 relative"],(()=>{let e,t,n;const r=[d("svg",S(_([["fill","none"],["height",16],["viewBox","0 0 16 16"],["width",16],["xmlns","http://www.w3.org/2000/svg"],(e=_([d("path",S(_([(t="M7 5C7 4.73478 7.10536 4.48043 7.29289 4.29289C7.48043 4.10536 7.73478 4 8 4C8.26522 4 8.51957 4.10536 8.70711 4.29289C8.89464 4.48043 9 4.73478 9 5V7H11V5C11 4.20435 10.6839 3.44129 10.1213 2.87868C9.55871 2.31607 8.79565 2 8 2C7.20435 2 6.44129 2.31607 5.87868 2.87868C5.31607 3.44129 5 4.20435 5 5V7H7V5Z",["d",t]),["fill","#9CA3AF"]]))),d("path",S(_([(n="M11.6 8H4.4C3.90294 8 3.5 8.3731 3.5 8.83333V12.1667C3.5 12.6269 3.90294 13 4.4 13H11.6C12.0971 13 12.5 12.6269 12.5 12.1667V8.83333C12.5 8.3731 12.0971 8 11.6 8Z",["d",n]),["fill","#9CA3AF"]])))]),["children",C.Children.toArray(Array.from(e))])])))];return["children",C.Children.toArray(Array.from(r))]})()])));function Th(e,t,n){let r;if(e)r=0;else switch(n.tag){case 0:case 4:{r=2;break}case 1:{r=4;break}case 3:{t?r=3:r=4;break}default:r=1}switch(r){case 0:return n3;case 1:return Eh;case 2:return Eh;case 3:return i3;default:return r3}}const Ph=d("div",{className:"relative h-0.5 w-full"}),s3=d("div",{className:"relative h-0.5 w-full bg-gray-300"}),o3=d("div",{className:"relative h-0.5 w-full bg-primary-base"});function xl(e){let t;if(e==null)t=1;else switch(e.tag){case 0:case 4:case 2:{t=0;break}default:t=2}switch(t){case 0:return o3;case 1:return Ph;default:return s3}}function Oh(e){let t,n;return d("div",S(_([["className","inline-flex h-11 w-10 flex-col items-center justify-start"],(t=[d("div",S(_([["className","inline-flex h-4 items-center justify-center self-stretch"],(n=[d("div",{className:ge(" ",[e,"relative h-0.5 w-10"])})],["children",C.Children.toArray(Array.from(n))])])))],["children",C.Children.toArray(Array.from(t))])])))}const a3=Oh("bg-gray-300"),l3=Oh("bg-primary-base");function u3(e){switch(e.tag){case 0:case 4:case 2:return l3;default:return a3}}function Mh(e,t,n,r){let i,s;const o=!e&&(M(n.Status,new se(0,[]))?!0:M(n.Status,new se(2,[]))),a=e?"text-primary-base":M(n.Status,new se(2,[]))||M(n.Status,new se(0,[]))?"text-gray-900 group-hover:text-primary-base":"text-gray-500",l=d("div",{className:"absolute inset-0 group-hover:bg-primary-base group-hover:opacity-10 rounded"});let u;const f=dc(_h(n.Id).toLocaleLowerCase()," ","-");return u=Ve(Le("step-%s"))(f),d("div",S(_([["className",ge(" ",["h-11 flex-col justify-start items-center inline-flex"])],(i=[d("div",{className:"h-4 inline-flex items-center justify-center self-stretch",children:C.Children.toArray(Array.from(r))}),d("button",S(_([["type","button"],["disabled",!o],["data-testid",u],["className",ge(" ",["relative group h-7 px-2 py-1 justify-center items-center gap-2 inline-flex rounded","focus:outline-none focus:ring-1 focus:ring-offset-1 focus:ring-primary-focus"])],["onClick",kt(t)(n)],(s=ce(A(()=>j(v(o?l:K()),A(()=>v(d("div",{className:ge(" ",[a,"text-sm font-medium leading-tight whitespace-nowrap"]),children:uC(n)})))))),["children",C.Children.toArray(Array.from(s))])])))],["children",C.Children.toArray(Array.from(i))])])))}function c3(e,t,n){const r=M(n.Id,new ve(1,[]))?new ve(0,[]):n.Id,i=(o,a)=>{let l;e(new X(1,[(l=[o,t],new me(2,[l[0],l[1]]))]))};return sr(((o,a,l)=>{e:for(;;){const u=o,f=a,c=l;if(O(u))return c;if(O(P(u))){const p=xl(f),m=M(k(u).Id,r);return $t(c,T(Mh(m,i,k(u),_([Ph,Th(m,M(k(u).Id,new ve(6,[])),k(u).Status),p]))))}else{const p=xl(f),m=M(k(u).Id,r),$=Th(m,M(k(u).Id,new ve(6,[])),k(u).Status);o=P(u),a=k(u).Status,l=$t(c,_([Mh(m,i,k(u),_([xl(k(u).Status),$,p])),u3(k(u).Status)]));continue e}}})(sr(_l(t.Steps)),void 0,le()))}function f3(e,t,n){let r,i,s;const o=d("div",S(_([["className","grow shrink basis-0 flex-col justify-start items-start inline-flex"],(r=[d("div",{className:"hidden lg:inline text-gray-500 text-sm font-medium leading-tight",children:wl(t.JourneyType)}),be(Ee(l=>d("div",{className:"hidden lg:inline text-center text-gray-900 text-base font-semibold leading-normal",children:l}),Ee(ni,on(l=>l.CompanyName,t.Branding))),K())],["children",C.Children.toArray(Array.from(r))])]))),a=d("div",{className:"grow shrink basis-0"});return d("div",S(_([(i="w-full h-20 px-8 py-4 bg-white border-b border-gray-300 justify-between items-center inline-flex sticky left-0 right-0 top-0 z-50",["className",i]),(s=ce(A(()=>j(M(t.AppMode,new Ln(0,[]))?v(a):v(o),A(()=>{let l;return j(v(d("div",S(_([["className","bg-white justify-center items-start flex"],(l=c3(e,t,n),["children",C.Children.toArray(Array.from(l))])])))),A(()=>v(d("div",{className:"grow shrink basis-0"}))))})))),["children",C.Children.toArray(Array.from(s))])])))}function d3(e){let t;const n=e.body,r=e.currentStep,i=e.detail,s=e.dispatch;return d("div",S(_([["className","w-full flex-col justify-start items-center inline-flex bg-white"],(t=ce(A(()=>j(rr(i.Steps)===1?v(K()):QC().tag===0?v(t3(s,i,r)):v(f3(s,i,r)),A(()=>v(d("div",{className:"p-4 max-w-7xl mx-auto w-full",children:n})))))),["children",C.Children.toArray(Array.from(t))])])))}const h3=e=>d("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},d("path",{d:"M16 16V30",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M11 21L16 16L21 21",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M11 29H4C3.20435 29 2.44129 28.6839 1.87868 28.1213C1.31607 27.5587 1 26.7956 1 26V2H12L15 7H31V26C31 26.7956 30.6839 27.5587 30.1213 28.1213C29.5587 28.6839 28.7956 29 28 29H21",stroke:"#111827",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),m3=e=>d("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},d("path",{d:"M19.7 4.3C19.3 3.9 18.7 3.9 18.3 4.3L12 10.6L5.7 4.3C5.3 3.9 4.7 3.9 4.3 4.3C3.9 4.7 3.9 5.3 4.3 5.7L10.6 12L4.3 18.3C3.9 18.7 3.9 19.3 4.3 19.7C4.5 19.9 4.7 20 5 20C5.3 20 5.5 19.9 5.7 19.7L12 13.4L18.3 19.7C18.5 19.9 18.8 20 19 20C19.2 20 19.5 19.9 19.7 19.7C20.1 19.3 20.1 18.7 19.7 18.3L13.4 12L19.7 5.7C20.1 5.3 20.1 4.7 19.7 4.3Z",fill:"#9CA3AF"}));function p3(e){const t=gt(e,1);return d(h3,t)}function $3(e){const t=gt(e,1);return d(m3,t)}function g3(e){return d("div",{className:"absolute top-0 bottom-0 left-0 right-0",children:C.Children.toArray([e])})}function w3(e,t){let n;return d("button",S(_([["type","button"],["data-testid","submit-btn"],["className",ge(" ",["self-stretch md:self-auto md:w-60 px-4 py-2 bg-primary-base hover:bg-primary-hover rounded-md shadow","focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-focus cursor-pointer","justify-center items-center inline-flex"])],["onClick",t],(n=[d("div",{className:"text-white text-base font-semibold leading-normal",children:e})],["children",C.Children.toArray(Array.from(n))])])))}function y3(e,t){let n;return d("button",S(_([["type","button"],["className",ge(" ",["relative group self-stretch md:self-auto md:w-60 px-4 py-2 rounded-md shadow justify-center items-center inline-flex","focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-focus cursor-pointer"])],["onClick",t],(n=[d("div",{className:"text-primary-dark text-base font-semibold leading-normal z-[1]",children:e}),d("div",{className:"absolute w-full h-full rounded-md z-[0] bg-primary-base opacity-10 group-hover:opacity-20"})],["children",C.Children.toArray(Array.from(n))])])))}function qs(e,t,n,r,i){let s,o,a,l,u,f,c,p,m,$,g,w,b,y,x;return g3(d("div",S(_([["className","w-full h-full md:pb-8 bg-white flex-col justify-start items-start md:items-center inline-flex"],(s=[d("div",S(_([(o="w-full md:self-stretch p-4 bg-white border-gray-200 flex-col justify-start items-end space-x-4 space-y-4 flex",["className",o]),(a=[d("button",S(_([["type","button"],(l="w-6 h-6 relative rounded-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-base",["className",l]),["onClick",B=>{i(new X(6,[{InjectedBenefits:r}]))}],(u=[$3([])],["children",C.Children.toArray(Array.from(u))])])))],["children",C.Children.toArray(Array.from(a))])]))),d("div",S(_([(f="w-full md:w-[560px] grow shrink basis-0 px-4 md:px-0 pb-8 md:pb-0 bg-white flex-col justify-between md:justify-start items-center md:space-y-14 flex",["className",f]),(c=[d("div",S(_([["className","self-stretch h-64 md:h-56 flex-col justify-start items-center space-y-8 flex"],(p=[d("div",S(_([["className","self-stretch h-64 flex-col justify-start items-center space-y-6 flex"],(m=[d("div",S(_([["className","self-stretch h-24 flex-col justify-start items-center space-y-4 flex"],($=[d("div",S(_([["className","w-12 h-12 relative rounded-lg"],(g=[d("div",{className:"w-12 h-12 relative bg-primary-base opacity-10 rounded-lg"}),d("div",S(_([["className","w-8 h-8 left-2 top-2 absolute"],(w=[d("div",S(_([["className","w-7 h-7 left-px top-0.5 absolute"],(b=[p3([["className","text-primary-base"]])],["children",C.Children.toArray(Array.from(b))])])))],["children",C.Children.toArray(Array.from(w))])])))],["children",C.Children.toArray(Array.from(g))])]))),d("div",{className:"self-stretch text-center text-gray-900 text-2xl md:text-3xl font-bold leading-7 md:leading-9",children:e})],["children",C.Children.toArray(Array.from($))])]))),d("div",S(_([["className","self-stretch h-40 md:h-24 flex-col justify-start items-center space-y-3 md:space-y-4 flex"],(y=[d("div",{className:"self-stretch text-center text-gray-900 text-base md:text-lg font-normal leading-normal md:leading-7",children:t}),d("div",{className:"self-stretch text-center text-gray-900 text-base md:text-lg font-normal leading-normal md:leading-7",children:n})],["children",C.Children.toArray(Array.from(y))])])))],["children",C.Children.toArray(Array.from(m))])])))],["children",C.Children.toArray(Array.from(p))])]))),d("div",S(_([["className","self-stretch h-24 flex-col justify-start items-center space-y-4 flex cursor-pointer"],(x=[w3(r?"Submit and continue":"Submit",B=>{i(new X(7,[{InjectedBenefits:r}]))}),y3("Keep editing",B=>{i(new X(6,[{InjectedBenefits:r}]))})],["children",C.Children.toArray(Array.from(x))])])))],["children",C.Children.toArray(Array.from(c))])])))],["children",C.Children.toArray(Array.from(s))])]))))}function _3(e){let t,n;const r=e.dispatch,i=e.wd,s=i.IsBenefitsStepEnabled;return i.AppMode.tag===1?s?qs("Before you continue",(t=on(o=>o.CompanyName,i.Branding),t==null?"Submit to finalise your pay information to your employer and continue to access your workplace benefits":`Submit to finalise your pay information to ${ni(t)} and continue to access your workplace benefits`),"Once you submit, you’ll be unable to view or edit your details",!0,r):qs("Submit your details",(n=on(o=>o.CompanyName,i.Branding),n==null?"Submit to finalise your pay information to your employer":`Submit to finalise your pay information to ${ni(n)}`),"Once you submit, you’ll be unable to view or edit your details.",!1,r):s?qs("Before you continue","Submit to finalise your pay information to your employer and continue to access your workplace benefits","",!0,r):qs("Submit your details","Submit to finalise your pay information to your employer","",!1,r)}function Ys(e,t){let n;return d("div",S(_([["className",ge(" ",["animate-pulse w-full relative",e,t])],(n=[d("div",{className:ge(" ",["w-full left-0 top-0 absolute bg-gray-200 rounded",e])})],["children",C.Children.toArray(Array.from(n))])])))}const v3=Ys("h-9","max-w-96"),Dh=Ys("h-6","max-w-96"),b3=Ys("h-80","max-w-96"),C3=Ys("h-10","max-w-48"),S3=(()=>{let e,t,n;const r=[d("div",S(_([(e="w-full h-full px-8 py-20 bg-white rounded border border-zinc-200 flex-col justify-start items-center gap-10 inline-flex",["className",e]),(t=[d("div",S(_([["className","max-w-96 w-full flex-col justify-start items-center gap-6 flex"],(n=[v3,d("div",{className:"self-stretch h-14 flex-col justify-start items-center gap-2 flex",children:C.Children.toArray([Dh,Dh])})],["children",C.Children.toArray(Array.from(n))])]))),b3,C3],["children",C.Children.toArray(Array.from(t))])])))];return d(Se,{},...r)})();function k3(e){const t=e.accessToken,n=e.appMode;let r;const i=MC(t);r=el(()=>Ds(()=>i,(u,f)=>NC(t,n,u,f),(u,f)=>{}),void 0,[]);const s=r[0],o=r[1],a=(u,f)=>{let c;return d("div",S(_([["className","w-full min-h-[600px] mx-auto bg-white"],(c=ce(A(()=>j(Ce(p=>d("style",{children:[p]}),s.CssOverrides),A(()=>j(u,A(()=>is())))))),["children",C.Children.toArray(Array.from(c))])])))};Yo(()=>{bg()},[]),Yo(()=>{const u=s.CurrentView;let f;switch(u.tag){case 1:case 3:{f=2;break}case 2:{M(u.fields[0].Id,new ve(4,[]))?(f=0,u.fields[0]):M(u.fields[0].Id,new ve(5,[]))?(f=1,u.fields[0]):f=2;break}default:f=3}switch(f){case 0:break;case 1:break;case 2:{ol(T(ul(n)),2);break}}},[s.CurrentView]),ur(()=>{window.addEventListener("step-completion",u=>{o(new X(3,[u]))})});const l=s.CurrentView;switch(l.tag){case 1:return Ut(0),a([d(qC,{detail:l.fields[0],dispatch:o})]);case 2:{const u=l.fields[1],f=l.fields[0],c=B$(u.JourneyType);let p;const m=f.Id;return p=m.tag===4?d(Ah,{step:new ve(4,[]),props:[new Er(1,[t]),new Er(0,[`${Bn}/super-selection/backend/v1.0/`]),new Er(2,[c]),new YC(ul(n))],effect:()=>{o(new X(12,[])),Ut(2500)},children:[]}):d(Ah,{step:m,props:[new Er(1,[t]),new Er(0,[Bn]),new Er(2,[c]),new JC(rn(cr(s.ProcessInstanceId)))],effect:()=>{Ut(1500)},children:[]}),a([d(d3,{dispatch:o,detail:u,currentStep:f,body:p})])}case 3:return Ut(0),a([d(_3,{wd:l.fields[0],dispatch:o})]);case 4:return Ut(0),a([d("div",{className:"text-center mt-5",children:"We had an issue. Please try again shortly."})]);case 5:return Ar(Zo());case 6:{const u=l.fields[0],f=u.JourneyType,c=Ee(L_,u.Branding);return a(ce(A(()=>u.AppMode.tag===0?v(S3):f.tag===1?v(Ar(Hs(c,"information request"))):f.tag===2?v(Ar(ph())):f.tag===3||f.tag===4?v(Ar(ml())):v(Ar(Hs(c,"onboarding"))))))}default:return d("div",{children:["Please wait..."]})}}function x3(e){return{render:function(t){Mi(t,e)},unmount:function(){mo(e)}}}class I3 extends R{constructor(t,n,r){super(),this.model=t,this.render=n,this.equal=r}}class A3 extends st{constructor(t){super(t)}shouldComponentUpdate(t,n){const r=this;return!r.props.equal(r.props.model,t.model)}render(){return this.props.render()}}function E3(e,t,n,r){const i=new I3(n,()=>t(n,r),e);return d(A3,i)}const T3=(()=>{try{return Ho(_u.slice(void 0,2),511,!1,32)>=18}catch{return!1}})();function P3(e,t,n){let r;return c0(Q(T3?(r=x3(document.getElementById(t)),i=>s=>{r.render(e(o=>a=>o===a,f0(n),i,s))}):i=>s=>{Mi(e(o=>a=>o===a,f0(n),i,s),document.getElementById(t))}),n)}function O3(e,t){return P3((n,r,i,s)=>E3(Q(n),Q(r),i,s),e,t)}function M3(e,t){const n=encodeURIComponent(Wb(t)),r=encodeURIComponent(vv),i=encodeURIComponent(kv(new Ln(0,[])));return E.Delay(()=>{let s,o;const a=yi(Zt(new Nt(1,[`grant_type=authorization_code&code=${n}&client_id=${r}&redirect_uri=${i}`]),(s=Jt(new Dt(1,[]),Yt(`${wv}/connect/token`)),wi(js("application/x-www-form-urlencoded"),s))));return o=E.Bind(a,l=>E.Return(new h(0,[l]))),E.Bind(o,l=>{const u=l;if(u.tag===1)return E.Return(new h(1,[u.fields[0]]));{const f=u.fields[0];if(f.statusCode===200){const c=en(Q(tn(hl(),void 0)),f.responseText);return E.Return(c)}else return E.Return(new h(1,["Unexpected result from backend"]))}})})}function D3(){return new Cr(0,[])}function Il(e){return $s(e)}function N3(e,t){return E.Delay(()=>{let n;return E.Bind(hg([(n=M3(e,t),E.Bind(n,r=>E.Return(r))),E.Delay(()=>E.Bind(Il(2e3),()=>E.Return(void 0)))]),r=>E.Return(ee(0,r)))})}function R3(e,t,n){let r;switch(e.tag){case 1:switch(t.tag){case 1:return[t,Ms(i=>{je(i)},Il,1e3,()=>new Wn(1,[]))];case 2:return t.fields[0].tag===1?[t,z()]:[t,Ms(i=>{je(i)},Il,2e3,()=>new Wn(2,[]))];default:return[new Cr(2,[new h(1,["No current authenticated user"])]),z()]}case 2:return[t,(r=window.location.pathname,a0(i=>{ol(T(r),1)}))];default:if(e.fields[0].tag===1)return e.fields[0].fields[0].tag===1?[new Cr(2,[new h(1,[`SignIn failed: ${e.fields[0].fields[0].fields[0]}`])]),z()]:(window.gtag&&window.gtag("event","oidc_sign_in",{}),[new Cr(2,[new h(0,[e.fields[0].fields[0].fields[0]])]),e.fields[2]?z():T(i=>{i(new Wn(2,[]))})]);switch(t.tag){case 1:return[t,z()];default:return[new Cr(1,[]),bt(i=>{je(i)},i=>N3(i[0],i[1]),[n,e.fields[1]],i=>{const s=[new _e(1,[i]),e.fields[1],e.fields[2]];return new Wn(0,[s[0],s[1],s[2]])},i=>{const s=[new _e(1,[new h(1,[i.message])]),e.fields[1],e.fields[2]];return new Wn(0,[s[0],s[1],s[2]])})]}}}function B3(){const e=qu(window.sessionStorage.getItem("credentials"));if(e!=null){const t=e,n=en(Q(tn(hl(),void 0)),t);return n.tag===1?void 0:n.fields[0]}}function L3(e){let t;const n=["credentials",(t=new mh(e.id_token,e.access_token,e.expires_in,void 0,e.scope,e.token_type),Xt(0,Qt(hl(),void 0,void 0,void 0)(t)))];window.sessionStorage.setItem(n[0],n[1])}function Nh(e,t){return Xa(n=>new pn(3,[n]),T(n=>{n(new Wn(0,[new _e(0,[]),e,t]))}))}function Al(e){return Nh(e,!1)}function V3(e){return Nh(e,!0)}function F3(){const e=$h(x0(window.location.pathname+window.location.search,2)),t=e[0],n=e[1],r=new Un(t,D3(),n);switch(t.tag){case 4:case 1:case 2:case 5:case 6:return[r,z()];case 0:{const i=B3();let s;switch(n.tag){case 0:case 2:{s=1;break}default:i==null?s=1:s=0}switch(s){case 0:return[new Un(r.CurrentPage,new Cr(2,[new h(0,[i])]),r.AppMode),z()];default:return[r,T(o=>{o(new pn(5,[]))})]}}default:return[r,Al(t.fields[0])]}}function W3(e,t){switch(e.tag){case 1:{const n=e.fields[0];return[new Un(new W(3,[n]),t.Credentials,t.AppMode),Al(n)]}case 2:return[new Un(new W(4,[]),t.Credentials,t.AppMode),Xa(n=>new pn(3,[n]),T(n=>{n(new Wn(1,[]))}))];case 3:{const n=R3(e.fields[0],t.Credentials,t.AppMode),r=n[0];let i,s;switch(r.tag===2&&r.fields[0].tag===0&&t.AppMode.tag===1?(i=0,s=r.fields[0].fields[0]):i=1,i){case 0:{L3(s);break}}return[new Un(t.CurrentPage,r,t.AppMode),Xa(o=>new pn(3,[o]),n[1])]}case 4:return[t,V3(e.fields[0])];case 5:return[new Un(new W(6,[]),t.Credentials,t.AppMode),z()];default:{const n=$h(e.fields[0])[0],r=new Un(n,t.Credentials,t.AppMode);return n.tag===3?[r,Al(n.fields[0])]:[r,z()]}}}const Rh=d("div",S(_([["className","flex flex-col justify-center items-center pt-10"],(()=>{const e=[Zo()];return["children",C.Children.toArray(Array.from(e))]})()])));function j3(e){switch(e.CurrentPage.tag){case 3:case 4:case 2:return T("bg-white h-full");default:return le()}}function U3(e){switch(e.tag){case 1:return d("style",{children:[`
|
|
810
810
|
html {
|
|
811
811
|
height: 100%;
|
|
812
812
|
height: 100dvh;
|