@flarehr/apollo-benefits-onboarding 0.1.3337 → 0.1.3339

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.
@@ -4,5 +4,5 @@ var __defProp=Object.defineProperty,__typeError=e=>{throw TypeError(e)},__defNor
4
4
  * Copyright(c) 2015 Douglas Christopher Wilson
5
5
  * MIT Licensed
6
6
  */
7
- var Bi=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Mi=/\\([\u000b\u0020-\u00ff])/g,Di=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,zi=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var n=t.indexOf(";"),r=-1!==n?t.slice(0,n).trim():t.trim();if(!Di.test(r))throw new TypeError("invalid media type");var o=new Hi(r.toLowerCase());if(-1!==n){var i,a,s;for(Bi.lastIndex=n;a=Bi.exec(t);){if(a.index!==n)throw new TypeError("invalid parameter format");n+=a[0].length,i=a[1].toLowerCase(),34===(s=a[2]).charCodeAt(0)&&-1!==(s=s.slice(1,-1)).indexOf("\\")&&(s=s.replace(Mi,"$1")),o.parameters[i]=s}if(n!==t.length)throw new TypeError("invalid parameter format")}return o};function Hi(e){this.parameters=Object.create(null),this.type=e}var qi=new Map,Wi=function(e){return e.cloneNode(!0)},Vi=function(){return"file:"===window.location.protocol},$i=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&2===r.readyState){var t=r.getResponseHeader("Content-Type");if(!t)throw new Error("Content type not found");var o=zi(t).type;if("image/svg+xml"!==o&&"text/plain"!==o)throw new Error("Invalid content type: ".concat(o))}if(4===r.readyState){if(404===r.status||null===r.responseXML)throw new Error(Vi()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(!(200===r.status||Vi()&&0===r.status))throw new Error("There was a problem injecting the SVG: "+r.status+" "+r.statusText);n(null,r)}}catch(i){if(r.abort(),!(i instanceof Error))throw i;n(i,r)}},r.open("GET",e),r.withCredentials=t,r.overrideMimeType&&r.overrideMimeType("text/xml"),r.send()},Gi={},Yi=function(e,t){Gi[e]=Gi[e]||[],Gi[e].push(t)},Zi=function(e,t,n){if(qi.has(e)){var r=qi.get(e);if(void 0===r)return void Yi(e,n);if(r instanceof SVGSVGElement)return void n(null,Wi(r))}qi.set(e,void 0),Yi(e,n),$i(e,t,(function(t,n){var r;t?qi.set(e,t):(null===(r=n.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&qi.set(e,n.responseXML.documentElement),function(e){for(var t=function(t,n){setTimeout((function(){if(Array.isArray(Gi[e])){var n=qi.get(e),r=Gi[e][t];n instanceof SVGSVGElement&&r(null,Wi(n)),n instanceof Error&&r(n),t===Gi[e].length-1&&delete Gi[e]}}),0)},n=0,r=Gi[e].length;n<r;n++)t(n)}(e)}))},Ji=function(e,t,n){$i(e,t,(function(e,t){var r;e?n(e):(null===(r=t.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&n(null,t.responseXML.documentElement)}))},Xi=0,Ki=[],Qi={},ea="http://www.w3.org/1999/xlink",ta=function(e,t,n,r,o,i,a){var s=e.getAttribute("data-src")||e.getAttribute("src");if(s){if(-1!==Ki.indexOf(e))return Ki.splice(Ki.indexOf(e),1),void(e=null);Ki.push(e),e.setAttribute("src",""),(r?Zi:Ji)(s,o,(function(r,o){if(!o)return Ki.splice(Ki.indexOf(e),1),e=null,void a(r);var l=e.getAttribute("id");l&&o.setAttribute("id",l);var c=e.getAttribute("title");c&&o.setAttribute("title",c);var u=e.getAttribute("width");u&&o.setAttribute("width",u);var d=e.getAttribute("height");d&&o.setAttribute("height",d);var p=Array.from(new Set(ji(ji(ji([],(o.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();o.setAttribute("class",p);var f=e.getAttribute("style");f&&o.setAttribute("style",f),o.setAttribute("data-src",s);var m=[].filter.call(e.attributes,(function(e){return/^data-\w[\w-]*$/.test(e.name)}));if(Array.prototype.forEach.call(m,(function(e){e.name&&e.value&&o.setAttribute(e.name,e.value)})),n){var h,g,y,_,b,w={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]};Object.keys(w).forEach((function(e){h=e,y=w[e];for(var t=function(e,t){var n;_=g[e].id,b=_+"-"+ ++Xi,Array.prototype.forEach.call(y,(function(e){for(var t=0,r=(n=o.querySelectorAll("["+e+'*="'+_+'"]')).length;t<r;t++){var i=n[t].getAttribute(e);i&&!i.match(new RegExp('url\\("?#'+_+'"?\\)'))||n[t].setAttribute(e,"url(#"+b+")")}}));for(var r=o.querySelectorAll("[*|href]"),i=[],a=0,s=r.length;a<s;a++){var l=r[a].getAttributeNS(ea,"href");l&&l.toString()==="#"+g[e].id&&i.push(r[a])}for(var c=0,u=i.length;c<u;c++)i[c].setAttributeNS(ea,"href","#"+b);g[e].id=b},n=0,r=(g=o.querySelectorAll(h+"[id]")).length;n<r;n++)t(n)}))}o.removeAttribute("xmlns:a");for(var v,x,k=o.querySelectorAll("script"),C=[],E=0,S=k.length;E<S;E++)(x=k[E].getAttribute("type"))&&"application/ecmascript"!==x&&"application/javascript"!==x&&"text/javascript"!==x||((v=k[E].innerText||k[E].textContent)&&C.push(v),o.removeChild(k[E]));if(C.length>0&&("always"===t||"once"===t&&!Qi[s])){for(var N=0,T=C.length;N<T;N++)new Function(C[N])(window);Qi[s]=!0}var A=o.querySelectorAll("style");if(Array.prototype.forEach.call(A,(function(e){e.textContent+=""})),o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("xmlns:xlink",ea),i(o),!e.parentNode)return Ki.splice(Ki.indexOf(e),1),e=null,void a(new Error("Parent node is null"));e.parentNode.replaceChild(o,e),Ki.splice(Ki.indexOf(e),1),e=null,a(null,o)}))}else a(new Error("Invalid data-src or src attribute"))},na={exports:{}};function ra(){}function oa(){}oa.resetWarningCache=ra;na.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:oa,resetWarningCache:ra};return n.PropTypes=n,n}();var ia=na.exports,aa=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],sa="http://www.w3.org/2000/svg",la="http://www.w3.org/1999/xlink",ca=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).initialState={hasError:!1,isLoading:!0},t.state=t.initialState,t._isMounted=!1,t.reactWrapper=void 0,t.nonReactWrapper=void 0,t.refCallback=function(e){t.reactWrapper=e},t}var n,r;r=e,(n=t).prototype=Object.create(r.prototype),n.prototype.constructor=n,Fi(n,r);var o=t.prototype;return o.renderSVG=function(){var e,t=this;if(this.reactWrapper instanceof(e=this.reactWrapper,((null==e?void 0:e.ownerDocument)||document).defaultView||window).Node){var n,r,o=this.props,i=o.desc,a=o.evalScripts,s=o.httpRequestWithCredentials,l=o.renumerateIRIElements,c=o.src,u=o.title,d=o.useRequestCache,p=this.props.onError,f=this.props.beforeInjection,m=this.props.afterInjection,h=this.props.wrapper;"svg"===h?((n=document.createElementNS(sa,h)).setAttribute("xmlns",sa),n.setAttribute("xmlns:xlink",la),r=document.createElementNS(sa,h)):(n=document.createElement(h),r=document.createElement(h)),n.appendChild(r),r.dataset.src=c,this.nonReactWrapper=this.reactWrapper.appendChild(n);var g=function(e){t.removeSVG(),t._isMounted?t.setState((function(){return{hasError:!0,isLoading:!1}}),(function(){p(e)})):p(e)};!function(e,t){var n=void 0===t?{}:t,r=n.afterAll,o=void 0===r?function(){}:r,i=n.afterEach,a=void 0===i?function(){}:i,s=n.beforeEach,l=void 0===s?function(){}:s,c=n.cacheRequests,u=void 0===c||c,d=n.evalScripts,p=void 0===d?"never":d,f=n.httpRequestWithCredentials,m=void 0!==f&&f,h=n.renumerateIRIElements,g=void 0===h||h;if(e&&"length"in e)for(var y=0,_=0,b=e.length;_<b;_++)ta(e[_],p,g,u,m,l,(function(t,n){a(t,n),e&&"length"in e&&e.length===++y&&o(y)}));else e?ta(e,p,g,u,m,l,(function(t,n){a(t,n),o(1),e=null})):o(0)}(r,{afterEach:function(e,n){e?g(e):t._isMounted&&t.setState((function(){return{isLoading:!1}}),(function(){try{m(n)}catch(e){g(e)}}))},beforeEach:function(e){if(e.setAttribute("role","img"),i){var t=e.querySelector(":scope > desc");t&&e.removeChild(t);var n=document.createElement("desc");n.innerHTML=i,e.prepend(n)}if(u){var r=e.querySelector(":scope > title");r&&e.removeChild(r);var o=document.createElement("title");o.innerHTML=u,e.prepend(o)}try{f(e)}catch(a){g(a)}},cacheRequests:d,evalScripts:a,httpRequestWithCredentials:s,renumerateIRIElements:l})}},o.removeSVG=function(){var e;null!=(e=this.nonReactWrapper)&&e.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},o.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},o.componentDidUpdate=function(e){var t=this;(function(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1})(Ui({},e),this.props)&&this.setState((function(){return t.initialState}),(function(){t.removeSVG(),t.renderSVG()}))},o.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},o.render=function(){var e=this.props;e.afterInjection,e.beforeInjection,e.desc,e.evalScripts;var t=e.fallback;e.httpRequestWithCredentials;var n=e.loading;e.renumerateIRIElements,e.src,e.title,e.useRequestCache;var r=e.wrapper,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,aa);return v(r,Ui({},o,{ref:this.refCallback},"svg"===r?{xmlns:sa,xmlnsXlink:la}:{}),this.state.isLoading&&n&&v(n,null),this.state.hasError&&t&&v(t,null))},t}(E);ca.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"},ca.propTypes={afterInjection:ia.func,beforeInjection:ia.func,desc:ia.string,evalScripts:ia.oneOf(["always","once","never"]),fallback:ia.oneOfType([ia.func,ia.object,ia.string]),httpRequestWithCredentials:ia.bool,loading:ia.oneOfType([ia.func,ia.object,ia.string]),onError:ia.func,renumerateIRIElements:ia.bool,src:ia.string.isRequired,title:ia.string,useRequestCache:ia.bool,wrapper:ia.oneOf(["div","span","svg"])};const ua=e=>{const{fetchAssessments:t,getOffers:n,hostInformation:{experiment:r,treatment:o}}=Xn(ho),[i,a]=qn(void 0),[s,l]=qn("fetching-offers"),[c,u]=qn([]),{trace:d}=No();Li((()=>{(async()=>{await Ii(5e3),await t();const e=n().map((e=>({name:e.content.productName,url:e.content.iconUrl})));u(e),l("displaying-offers-one-by-one");for(let t=0;t<e.length;t++)a(t),await Ii(1e3);await Ii(1e3),l("scaling-up-offers"),await Ii(1e3),l("set-up-benefits")})()}));const p=Zn((()=>{switch(s){case"fetching-offers":case"displaying-offers-one-by-one":case"scaling-up-offers":return"Personalising your benefits plan";case"set-up-benefits":return"Your Benefits Plan"}}),[s]),f=Zn((()=>{switch(s){case"fetching-offers":return"Finding benefits...";case"displaying-offers-one-by-one":case"scaling-up-offers":return 0===i?"1 benefit found that matches your profile":`${i+1} benefits found that match your profile`;case"set-up-benefits":return"Based on your profile, these are the benefits available to you"}}),[s,i]),m=Zn((()=>"fetching-offers"===s),[s]),h=Zn((()=>"scaling-up-offers"!==s),[s]),g=Zn((()=>"scaling-up-offers"===s||"set-up-benefits"===s),[s]),y=Zn((()=>"set-up-benefits"===s),[s]),_=Zn((()=>"set-up-benefits"===s),[s]);return fo(vi,{children:[fo(vi.Top,{children:fo("div",{className:"flex flex-col gap-4",children:[fo("div",{className:"transition-opacity duration-700 ease-in-out "+(m?"opacity-100":"opacity-0"),children:fo(xo,{size:"lg"})}),fo(Ni,{className:"transition-opacity duration-700 ease-in-out "+(h?"opacity-100":"opacity-0"),children:p}),fo(Ti,{className:"transition-opacity duration-700 ease-in-out "+(h?"opacity-100":"opacity-0"),children:f})]})}),fo(vi.Bottom,{children:fo("div",{class:"flex flex-col items-center gap-4",children:[fo(da,{scaleUp:g,showName:y,icons:c}),fo(Co,{testId:"set_up_benefits_button_next_screen",class:"mt-4 w-full md:w-[240px] transition-opacity duration-700 ease-in-out "+(_?"opacity-100":"hidden opacity-0"),onClickPromise:async()=>{await d("marketplace-started",{experiment:r,treatment:o}),await e.onComplete()},children:"Set up your benefits"})]})})]})},da=({scaleUp:e,showName:t,icons:n})=>fo("div",{children:[fo("style",{children:"\n .bg-lighter-than-text{\n background-color: hsl(from currentColor h s l / 0.08);\n }\n\n .animate-slide-from-right {\n opacity: 0;\n transform: translateX(400px);\n animation: slide-from-right 1s ease-out forwards;\n }\n\n @keyframes slide-from-right {\n from {\n transform: translateX(400px);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n "}),fo("div",{className:"flex gap-4 transition-scale transition-margin duration-700 ease-in-out "+(e?"scale-150 m-4":"scale-100"),children:n.map(((e,n)=>fo("div",{className:"mt-4 flex flex-col gap-1 items-center text-primary-base text-[0.5rem] w-12 max-w-12 min-w-12 animate-slide-from-right",style:{animationDelay:1e3*n+"ms"},children:[fo(ca,{src:e.url,wrapper:"svg",className:"w-10 h-10 max-h-10 max-w-10 min-h-10 min-w-10 p-2.5 rounded-lg bg-lighter-than-text",beforeInjection:e=>{var t;e.removeAttribute("width"),e.removeAttribute("height"),null==(t=e.querySelector("path"))||t.removeAttribute("fill"),e.setAttribute("fill","currentColor")}}),fo("p",{className:"transition-opacity duration-700 ease-in-out "+(t?"opacity-100":"opacity-0"),children:e.name})]},e.name)))})]});var pa=(e=>(e[e.PHONE_NUMBER=0]="PHONE_NUMBER",e[e.OTP=1]="OTP",e[e.SUCCESS=2]="SUCCESS",e))(pa||{});const fa=({className:e,children:t,...n})=>fo("label",{class:`text-base text-gray-600 ${e??""}`,...n,children:t}),ma=e=>v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"green",className:"w-5 h-5",...e},v("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"})),ha=({className:e,onClick:t,...n})=>{const[r,o]=qn(!1);return fo("button",{className:`inline-flex items-center justify-center px-2 text-primary-base rounded-md bg-transparent hover:bg-sky-50/50 focus:ring-2 focus:ring-primary-focus ${e??""}`,onClick:Jn((()=>{if(!r)return o(!0),t().finally((()=>{o(!1)}))}),[r,t]),...n,children:[fo("div",{class:"relative "+(r?"invisible":""),children:n.children}),r&&fo("div",{class:"absolute",children:fo(xo,{theme:"primary"})})]})},ga=({className:e,allowedKeyPattern:t,onChange:n,value:r,leadingIconElement:o,trailingIconElement:i,...a})=>{const s=Jn((e=>{t.test(e.key)||e.preventDefault()}),[t]);return fo(C,{children:fo("div",{class:"relative",children:[o,fo("input",{"data-testid":a.testId,type:"text",className:`border-0 ring-2 ring-gray-200 focus:outline-none text-base font-medium rounded-md shadow-sm ${e}`,value:r,onKeyPress:s,onChange:e=>n(e.currentTarget.value),...a}),i]})})},ya=e=>e.replace(/ /g,""),_a=e=>{const t=ya(e);return t.startsWith("04")&&10===t.length||t.startsWith("614")&&11===t.length||t.startsWith("+614")&&12===t.length||/^\+642\d{7,9}$/.test(t)},ba=({phoneNumber:e,onSubmit:t,onDecline:n})=>{const{hostInformation:{workflowsJourneyType:r}}=Xn(ho),[o,i]=qn(""),{setPhoneNumber:a,phoneNumber:s}=(e=>{const{identity:t}=Xn(ho),[n,r]=qn((()=>e&&_a(e)?e:"")),o=Zn((()=>_a(n)),[n]),i=Zn((()=>ya(n)),[n]),a=Zn((()=>i.startsWith("04")?`+61${i.replace(/^0+/,"")}`:i.startsWith("614")?`+${i}`:i),[i]),s=Zn((()=>(e=>{let t=0;return"#### ### ### ### ### ### ###".replace(/#/g,(()=>e[t++]??"")).trim()})(i)),[i]),l=Zn((()=>_a(t.verifiedPhoneNumber)&&a===t.verifiedPhoneNumber),[a,t.verifiedPhoneNumber]);return{setPhoneNumber:r,phoneNumber:{valid:o,original:n,formatted:a,masked:s,isVerified:l}}})(e),[l,c]=qn(s.isVerified),u=Jn((()=>{i("")}),[]),d=Jn((()=>{const e=s.valid?"":"Please enter a valid Australian mobile number beginning with 04.";i(e),c(s.isVerified)}),[s.isVerified,s.valid]),p=Jn((async()=>{s.valid&&await t(s).catch(i)}),[s,t]),f=Jn((async()=>{c(!1)}),[]),m=fo("div",{class:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-xs text-green-700 font-bold",children:["Verified ",fo(ma,{})]});return fo(vi,{children:[fo(vi.Top,{children:fo("div",{className:"flex flex-col gap-5",children:[fo(Ni,{children:"Join your workplace benefits program"}),fo(Ti,{children:[s.isVerified?"Confirm ":"Enter "," your ",fo("b",{children:"personal"})," mobile number to finish setting up your Flare Benefits account linked to your workplace"]})]})}),fo(vi.Bottom,{children:fo("div",{className:"mt-5 md:w-[300px] text-left",children:[fo(fa,{className:"font-medium text-sm text-gray-900 text-left",children:"Australian Mobile Number"}),fo(ga,{testId:"sign_in_mobile_number_text_input_mobile_number",allowedKeyPattern:/[+0-9]/,inputMode:"numeric",className:"mt-1 mb-1 w-full p-2 focus-visible:ring-gray-500",value:s.original,onChange:a,onfocusin:u,onfocusout:d,trailingIconElement:l&&m,disabled:l}),0!==o.length&&fo("div",{className:"h-8 leading-none",children:fo("span",{className:"text-xs text-rose-500",children:o})}),l&&fo("div",{className:"mt-2 ml-2 mb-2 leading-none",children:fo("span",{className:"text-xs",children:["Not your personal number?",fo(ha,{class:"text-blue-500",onClick:f,children:"Change number"})]})}),fo("div",{children:fo("span",{className:"font-medium text-sm text-gray-900 text-center",children:["By creating your account you confirm you have read and agree to Flare Benefits"," ",fo("a",{href:"https://www.flarehr.com/flare-app-terms-and-conditions/",target:"_blank",rel:"noreferrer",children:" Terms of Use "}),"and",fo("a",{href:"https://www.flarehr.com/privacy-policy/",target:"_blank",rel:"noreferrer",children:" Privacy Policy"}),"."," "]})}),fo(Co,{testId:"sign_in_mobile_number_button_send_otp",class:"mt-5 md:w-full",onClickPromise:p,children:"Join your workplace"}),r!==ne.AppInvite&&fo(Co,{testId:"sign_in_mobile_number_button_decline_to_send_otp",class:"mt-5 md:w-full bg-white hover:!bg-gray-100 focus:!ring-gray-200 !border-0 !shadow-none !text-gray-700 !border-gray-300",onClickPromise:n,children:"Not now"})]})})]})},wa=""+("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__dirname+"/assets/check-animated-QQOZQPLY.gif?inline").href:new URL("assets/check-animated-QQOZQPLY.gif?inline","undefined"==typeof document?location.href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||document.baseURI).href),va=({onContinue:e})=>{const{featureFlags:{marketplaceScheme:t},hostInformation:{experiment:n,treatment:r}}=Xn(ho),{trace:o}=No(),i=Zn((()=>({title:"You’ve joined your workplace benefits program",isNextButtonHidden:"allowance"===t.scheme})),[t]),a=Jn((async()=>{"allowance"!==t.scheme&&await o("marketplace-started",{experiment:n,treatment:r}),e()}),[n,t.scheme,e,o,r]);return Vn((()=>{if("allowance"===t.scheme){const t=setTimeout(e,3e3);return()=>clearTimeout(t)}}),[t,e]),fo(vi,{children:[fo(vi.Top,{children:fo("img",{src:wa,className:"h-16 w-16"})}),fo(vi.Bottom,{children:fo("div",{className:"mt-5 flex flex-col items-center gap-5 text-center",children:[fo(Ni,{children:i.title}),!i.isNextButtonHidden&&fo(Co,{testId:"sign_in_success_button_next_screen",class:"mt-5 w-full md:w-[240px]",onClickPromise:a,children:"Set up your benefits"})]})})]})},xa=e=>v("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,fill:"currentColor",...e},v("path",{d:"m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"})),ka=({open:e})=>fo(vo,{open:e,children:fo(wo,{children:fo("div",{className:"flex flex-col gap-5 items-center justify-center text-center",children:[fo(xo,{size:"lg"}),fo(Ni,{children:"Creating your account"}),fo("div",{children:[fo(Ti,{children:"This can take up to 30 seconds."}),fo(Ti,{children:"Please don't navigate away or refresh your browser."})]})]})})}),Ca=({phoneNumber:e,onVerify:t,onResendOtp:n,onGoBack:r})=>{const{otp:o,setOtp:i}=(()=>{const[e,t]=qn("");return{otp:{valid:Zn((()=>6===e.length),[e.length]),code:e},setOtp:t}})(),[a,s]=qn(!1),[l,c]=qn(""),{countdown:u,restart:d}=(e=>{const[t,n]=qn(e),r=Gn(),o=Jn((()=>{clearInterval(r.current)}),[]);return Vn((()=>o),[o]),{countdown:t,restart:Jn((()=>{let t=e;clearInterval(r.current),r.current=setInterval((()=>{t<0?clearInterval(r.current):n(t--)}),1e3)}),[e])}})(60);Vn(d,[d]);const p=Jn((()=>(s(!0),c(""),t(o.code).catch(c).finally((()=>{s(!1)})))),[t,o.code]),f=Jn((()=>(c(""),n().then(d).catch(c))),[n,d]);return fo(C,{children:[fo(ka,{open:a}),fo(vi,{children:[fo(vi.Top,{children:fo("div",{className:"flex flex-col gap-5",children:[fo(Ni,{children:"Verify your mobile number"}),fo(Ti,{children:["An SMS verification code has been sent to the number ",e,"."]})]})}),fo(vi.Bottom,{children:fo("div",{className:"mt-5 md:w-[300px] text-left",children:[fo(fa,{className:"font-medium text-sm text-gray-900 text-left",children:"Enter your verification code"}),fo(ga,{testId:"sign_in_otp_text_input_otp",allowedKeyPattern:/[0-9]/,inputMode:"numeric",minLength:6,maxLength:6,className:"mt-1 mb-1 w-full p-2 focus-visible:ring-gray-500",trailingIconElement:!1,onChange:i}),l&&fo("span",{className:"text-xs text-rose-500",children:l}),fo("p",{class:"mt-2 text-center text-xs text-gray-600 disabled:opacity-75 ",children:["Didn't get the code?",fo(ha,{disabled:0!==u,className:"underline mx-2 disabled:text-gray-600 disabled:hover:bg-transparent disabled:cursor-text disabled:px-0",onClick:f,children:"Resend SMS"}),0!==u&&fo(C,{children:["in ",u," secs"]})]}),fo(Co,{testId:"sign_in_otp_button_verify_otp",class:"mt-5 md:w-full",disabled:!o.valid,onClickPromise:p,children:"Continue"}),fo(Co,{testId:"sign_in_otp_button_decline_to_verify_otp",class:"mt-5 md:w-full bg-white hover:!bg-gray-100 focus:!ring-gray-200 !border-0 !shadow-none !text-gray-700 !border-gray-300",onClickPromise:async()=>{r()},children:fo("span",{className:"flex gap-3",children:[fo(xa,{}),"Back"]})})]})})]})]})},Ea=({phoneNumber:e,onSignUp:t,onVerify:n,onResendOtp:r,onSuccess:o,onDecline:i})=>{const{trace:a}=No(),[s,l]=qn(e??""),{step:c,goBack:u,goToStep:d}=(()=>{const[e,t]=qn(0),n=Jn((()=>{const n=e-1;n>=0&&t(n)}),[e]),r=Jn((e=>{e<=2&&t(e)}),[]);return{step:e,goBack:n,goToStep:r}})();Vn((()=>{(async()=>{await a("sign-up-viewed")})()}),[a]);const p=Jn((e=>t(e.formatted).then((async t=>{l(e.masked),t.isVerificationRequired?d(pa.OTP):(await a("sign-up-completed"),d(pa.SUCCESS))}))),[d,t,a]),f=Jn((()=>a("sign-up-declined").then(i)),[i,a]),m=Jn((e=>n(e).then((async()=>{await a("sign-up-completed"),d(pa.SUCCESS)}))),[d,n,a]);return fo(C,{children:[c===pa.PHONE_NUMBER&&fo(ba,{phoneNumber:s,onSubmit:p,onDecline:f}),c===pa.OTP&&fo(Ca,{phoneNumber:s,onVerify:m,onResendOtp:r,onGoBack:u}),c===pa.SUCCESS&&fo(va,{onContinue:o})]})};var Sa=(e=>(e.Auth_AccountDisabled="Sorry, your account has been deactivated. Please contact Flare if there are any issues.",e.Auth_AccountLocked="Sorry, your account is currently locked due to too many attempts. Please try again later.",e.Auth_Unregistered="Sorry, we are currently experiencing some issues. Please try again later.",e.Auth_InvalidVerificationCode="Your one time passcode doesn't look right. Please try again with a new one time passcode.",e.Auth_SessionExpired="Sorry, looks like your session has expired. Please try again.",e.Validation_InvalidPhoneNumber="Please enter a valid Australian mobile number beginning with 04.",e))(Sa||{});const Na=e=>{var t;const n=null==(t=null==e?void 0:e.response)?void 0:t.data;throw Sa[null==n?void 0:n.code]??"Sorry, we are currently experiencing some issues. Please try again later."},Ta=({onSuccess:e,onDecline:t})=>{const{identity:{phoneNumber:n}}=Xn(ho),{signUp:r,verifyOtp:o,resendOtp:i}={signUp:async e=>kn.backend.getClient().post("v2.0/auth/signUp",{mobileNumber:e}).then((e=>({isVerificationRequired:e.data.isVerificationRequired??!0}))),verifyOtp:async e=>{await kn.backend.getClient().post("auth/verify",{otp:e}).catch(Na)},resendOtp:async()=>{await kn.backend.getClient().post("auth/resend").catch(Na)}};return fo(C,{children:fo(Ea,{phoneNumber:n,onSignUp:r,onVerify:o,onResendOtp:i,onSuccess:e,onDecline:t})})},Aa=""+("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__dirname+"/assets/intro-COqxd5jd.png").href:new URL("assets/intro-COqxd5jd.png","undefined"==typeof document?location.href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||document.baseURI).href),Oa=e=>{const{trace:t}=No(),{hostInformation:{experiment:n,treatment:r}}=Xn(ho);return Vn((()=>{t("benefits-setup-started",{experiment:n,treatment:r})}),[n,t,r]),fo(vi,{children:[fo(vi.Top,{children:fo("img",{class:"max-w-[30rem] w-full",src:Aa})}),fo(vi.Bottom,{children:fo("div",{children:[fo("h3",{class:"mt-8 text-2xl md:text-3xl leading-8 md:leading-9 font-bold",children:"Finish setting up your workplace benefits"}),fo("p",{class:"mt-3 text-lg leading-7 text-gray-600",children:"Because your workplace uses Flare you have access to a range of exclusive benefits that can save you thousands of dollars every year on your car, private health insurance, weekly grocery shop and more."}),fo(Co,{testId:"introduction_button_next_screen",class:"mt-8",onClickPromise:async()=>{e.onStepComplete()},children:"Continue"})]})})]})},Ra=({visible:e,children:t})=>{const n=Gn(e);return e&&!n.current&&(n.current=!0),n.current?fo("div",{hidden:!e,children:t}):null},Pa=({icon:e})=>"string"==typeof e?fo(ca,{src:e,wrapper:"svg",className:"w-10 h-10 max-h-10 max-w-10 min-h-10 min-w-10 p-2.5 rounded-lg bg-lighter-than-text",beforeInjection:e=>{var t;e.removeAttribute("width"),e.removeAttribute("height"),null==(t=e.querySelector("path"))||t.removeAttribute("fill"),e.setAttribute("fill","currentColor")}}):fo("div",{className:"w-10 h-10 max-h-10 max-w-10 min-h-10 min-w-10 p-2.5 rounded-lg bg-lighter-than-text",children:e}),La=({label:e,icon:t})=>fo("div",{className:"flex flex-col gap-1 items-center w-12 max-w-12 min-w-12",children:[t,fo("p",{className:"max-h-10 max-w-20 break-words text-ellipsis overflow-hidden line-clamp-2",children:e})]}),Ia=({children:e})=>fo(C,{children:e}),Ua=({selectedIndex:e,onChange:t,children:n})=>{const r=Zn((()=>hr.toArray(n).filter((e=>e.type===La))),[n]),o=Zn((()=>hr.toArray(n).filter((e=>e.type===Ia))),[n]);return Li((()=>{o.length>0&&(null==t||t(0))})),fo("div",{children:[fo("div",{className:"flex items-baseline gap-8 md:mb-4",children:[fo("style",{children:"\n .bg-lighter-than-text{\n background-color: hsl(from currentColor h s l / 0.08);\n }\n "}),r.map(((n,r)=>fo("div",{onClick:()=>null==t?void 0:t(r),className:`\n text-sm font-medium cursor-auto h-full relative\n flex items-center justify-center\n ${r===e?"text-primary-base":"text-gray-400"}\n ${o.length>0?"hover:before:cursor-pointer":"hover:before:cursor-default"} \n hover:before:w-16 hover:before:h-16 hover:before:absolute\n `,children:n},n.key)))]}),o.map(((t,n)=>fo(Ra,{visible:n===e,children:t},t.key)))]})},Fa=()=>fo("div",{class:"flex justify-center",children:fo(xo,{size:"lg"})}),ja=(Ba=e=>{var t,n,r;const{featureFlags:{marketplaceScheme:o},hostInformation:i,offersProgress:{canOfferSkipToEstimate:a}}=Xn(ho),{trace:s}=No(),l=Gn(null);return Li((()=>{s({type:"offer-viewed",offerName:e.marketPlaceOffer.name,data:e.marketPlaceOffer.metadata},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName}),l.current&&(l.current.terms=e.marketPlaceOffer.content.terms,l.current.details=e.marketPlaceOffer.content.details,l.current["on-accept"]=async()=>{await s({type:"offer-accepted",offerName:e.marketPlaceOffer.name,data:{...e.marketPlaceOffer.metadata,template:e.marketPlaceOffer.content.template,assessmentId:e.marketPlaceOffer.content.assessmentId}},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName})},l.current["on-decline"]=async()=>{await s({type:"offer-declined",offerName:e.marketPlaceOffer.name,data:{...e.marketPlaceOffer.metadata,template:e.marketPlaceOffer.content.template,assessmentId:e.marketPlaceOffer.content.assessmentId}},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName}),e.onStepComplete(!1,!1)},l.current["on-complete"]=()=>e.onStepComplete(!0,!0),l.current["on-skip"]=e.marketPlaceOffer.content.skipButtonHidden?void 0:()=>e.onStepComplete(!0,!1))})),fo("benefits-plan-assessment",{"base-url":Cn.workplaceBackend.getBaseUrl(),"profile-id":Cn.workplaceBackend.getProfileId(),"skip-more-details":!0,"access-token":e.accessToken,"image-url":e.marketPlaceOffer.content.imageUrl,"assessment-id":e.marketPlaceOffer.content.assessmentId,"assessment-instructions":"allowance"===o.scheme?e.marketPlaceOffer.content.assessmentInstructions:void 0,"track-client":i.client,"track-source":i.source,"track-channel":i.channel,"track-experiment":e.marketPlaceOffer.metadata.featureName,"track-treatment":e.marketPlaceOffer.metadata.treatmentName,"marketplace-offer-name":e.marketPlaceOffer.name,"assessment-title":e.marketPlaceOffer.content.title,description:e.marketPlaceOffer.content.description,"accept-button":e.marketPlaceOffer.content.acceptButton,"decline-button":e.marketPlaceOffer.content.declineButton,"special-banner-title":"allowance"===o.scheme?null==(t=e.marketPlaceOffer.content.specialBanner)?void 0:t.title:void 0,"special-banner-subtitle":"allowance"===o.scheme?null==(n=e.marketPlaceOffer.content.specialBanner)?void 0:n.subtitle:void 0,"special-banner-type":"allowance"===o.scheme?null==(r=e.marketPlaceOffer.content.specialBanner)?void 0:r.type:void 0,"vertical-alignment":"items-center","skip-to-completion":a(e.marketPlaceOffer.name),ref:l})},e=>{const t=Gn(null),[n,r]=qn(),[o,i]=qn(!1);return Vn((()=>{(async()=>{const e=await Cn.workplaceBackend.getIdToken();r(e)})(),(()=>{if(t.current&&!t.current.querySelector("script[data-injected]")){const e=document.createElement("script"),n=yo(Cn.workplaceBackend.getBaseUrl());e.type="module",e.src=`https://npm-cdn.flarehr.com/@flarehr/benefits-plan-assessment@${n}/dist/benefits-plan-assessment.js`,e.dataset.injected="true",e.onload=()=>{i(!0)},t.current.appendChild(e)}else i(!0)})()}),[]),fo("div",{ref:t,className:n,children:n&&o?fo(Ba,{...e,accessToken:n}):fo(Fa,{})})});var Ba;const Ma=e=>v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",...e},v("path",{fill:"currentColor",d:"M345 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-119 119L73 103c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l119 119L39 375c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l119-119L311 409c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-119-119L345 137z"}))
7
+ var Bi=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Mi=/\\([\u000b\u0020-\u00ff])/g,Di=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,zi=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var n=t.indexOf(";"),r=-1!==n?t.slice(0,n).trim():t.trim();if(!Di.test(r))throw new TypeError("invalid media type");var o=new Hi(r.toLowerCase());if(-1!==n){var i,a,s;for(Bi.lastIndex=n;a=Bi.exec(t);){if(a.index!==n)throw new TypeError("invalid parameter format");n+=a[0].length,i=a[1].toLowerCase(),34===(s=a[2]).charCodeAt(0)&&-1!==(s=s.slice(1,-1)).indexOf("\\")&&(s=s.replace(Mi,"$1")),o.parameters[i]=s}if(n!==t.length)throw new TypeError("invalid parameter format")}return o};function Hi(e){this.parameters=Object.create(null),this.type=e}var qi=new Map,Wi=function(e){return e.cloneNode(!0)},Vi=function(){return"file:"===window.location.protocol},$i=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&2===r.readyState){var t=r.getResponseHeader("Content-Type");if(!t)throw new Error("Content type not found");var o=zi(t).type;if("image/svg+xml"!==o&&"text/plain"!==o)throw new Error("Invalid content type: ".concat(o))}if(4===r.readyState){if(404===r.status||null===r.responseXML)throw new Error(Vi()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(!(200===r.status||Vi()&&0===r.status))throw new Error("There was a problem injecting the SVG: "+r.status+" "+r.statusText);n(null,r)}}catch(i){if(r.abort(),!(i instanceof Error))throw i;n(i,r)}},r.open("GET",e),r.withCredentials=t,r.overrideMimeType&&r.overrideMimeType("text/xml"),r.send()},Gi={},Yi=function(e,t){Gi[e]=Gi[e]||[],Gi[e].push(t)},Zi=function(e,t,n){if(qi.has(e)){var r=qi.get(e);if(void 0===r)return void Yi(e,n);if(r instanceof SVGSVGElement)return void n(null,Wi(r))}qi.set(e,void 0),Yi(e,n),$i(e,t,(function(t,n){var r;t?qi.set(e,t):(null===(r=n.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&qi.set(e,n.responseXML.documentElement),function(e){for(var t=function(t,n){setTimeout((function(){if(Array.isArray(Gi[e])){var n=qi.get(e),r=Gi[e][t];n instanceof SVGSVGElement&&r(null,Wi(n)),n instanceof Error&&r(n),t===Gi[e].length-1&&delete Gi[e]}}),0)},n=0,r=Gi[e].length;n<r;n++)t(n)}(e)}))},Ji=function(e,t,n){$i(e,t,(function(e,t){var r;e?n(e):(null===(r=t.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&n(null,t.responseXML.documentElement)}))},Xi=0,Ki=[],Qi={},ea="http://www.w3.org/1999/xlink",ta=function(e,t,n,r,o,i,a){var s=e.getAttribute("data-src")||e.getAttribute("src");if(s){if(-1!==Ki.indexOf(e))return Ki.splice(Ki.indexOf(e),1),void(e=null);Ki.push(e),e.setAttribute("src",""),(r?Zi:Ji)(s,o,(function(r,o){if(!o)return Ki.splice(Ki.indexOf(e),1),e=null,void a(r);var l=e.getAttribute("id");l&&o.setAttribute("id",l);var c=e.getAttribute("title");c&&o.setAttribute("title",c);var u=e.getAttribute("width");u&&o.setAttribute("width",u);var d=e.getAttribute("height");d&&o.setAttribute("height",d);var p=Array.from(new Set(ji(ji(ji([],(o.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();o.setAttribute("class",p);var f=e.getAttribute("style");f&&o.setAttribute("style",f),o.setAttribute("data-src",s);var m=[].filter.call(e.attributes,(function(e){return/^data-\w[\w-]*$/.test(e.name)}));if(Array.prototype.forEach.call(m,(function(e){e.name&&e.value&&o.setAttribute(e.name,e.value)})),n){var h,g,y,_,b,w={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]};Object.keys(w).forEach((function(e){h=e,y=w[e];for(var t=function(e,t){var n;_=g[e].id,b=_+"-"+ ++Xi,Array.prototype.forEach.call(y,(function(e){for(var t=0,r=(n=o.querySelectorAll("["+e+'*="'+_+'"]')).length;t<r;t++){var i=n[t].getAttribute(e);i&&!i.match(new RegExp('url\\("?#'+_+'"?\\)'))||n[t].setAttribute(e,"url(#"+b+")")}}));for(var r=o.querySelectorAll("[*|href]"),i=[],a=0,s=r.length;a<s;a++){var l=r[a].getAttributeNS(ea,"href");l&&l.toString()==="#"+g[e].id&&i.push(r[a])}for(var c=0,u=i.length;c<u;c++)i[c].setAttributeNS(ea,"href","#"+b);g[e].id=b},n=0,r=(g=o.querySelectorAll(h+"[id]")).length;n<r;n++)t(n)}))}o.removeAttribute("xmlns:a");for(var v,x,k=o.querySelectorAll("script"),C=[],E=0,S=k.length;E<S;E++)(x=k[E].getAttribute("type"))&&"application/ecmascript"!==x&&"application/javascript"!==x&&"text/javascript"!==x||((v=k[E].innerText||k[E].textContent)&&C.push(v),o.removeChild(k[E]));if(C.length>0&&("always"===t||"once"===t&&!Qi[s])){for(var N=0,T=C.length;N<T;N++)new Function(C[N])(window);Qi[s]=!0}var A=o.querySelectorAll("style");if(Array.prototype.forEach.call(A,(function(e){e.textContent+=""})),o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("xmlns:xlink",ea),i(o),!e.parentNode)return Ki.splice(Ki.indexOf(e),1),e=null,void a(new Error("Parent node is null"));e.parentNode.replaceChild(o,e),Ki.splice(Ki.indexOf(e),1),e=null,a(null,o)}))}else a(new Error("Invalid data-src or src attribute"))},na={exports:{}};function ra(){}function oa(){}oa.resetWarningCache=ra;na.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:oa,resetWarningCache:ra};return n.PropTypes=n,n}();var ia=na.exports,aa=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],sa="http://www.w3.org/2000/svg",la="http://www.w3.org/1999/xlink",ca=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).initialState={hasError:!1,isLoading:!0},t.state=t.initialState,t._isMounted=!1,t.reactWrapper=void 0,t.nonReactWrapper=void 0,t.refCallback=function(e){t.reactWrapper=e},t}var n,r;r=e,(n=t).prototype=Object.create(r.prototype),n.prototype.constructor=n,Fi(n,r);var o=t.prototype;return o.renderSVG=function(){var e,t=this;if(this.reactWrapper instanceof(e=this.reactWrapper,((null==e?void 0:e.ownerDocument)||document).defaultView||window).Node){var n,r,o=this.props,i=o.desc,a=o.evalScripts,s=o.httpRequestWithCredentials,l=o.renumerateIRIElements,c=o.src,u=o.title,d=o.useRequestCache,p=this.props.onError,f=this.props.beforeInjection,m=this.props.afterInjection,h=this.props.wrapper;"svg"===h?((n=document.createElementNS(sa,h)).setAttribute("xmlns",sa),n.setAttribute("xmlns:xlink",la),r=document.createElementNS(sa,h)):(n=document.createElement(h),r=document.createElement(h)),n.appendChild(r),r.dataset.src=c,this.nonReactWrapper=this.reactWrapper.appendChild(n);var g=function(e){t.removeSVG(),t._isMounted?t.setState((function(){return{hasError:!0,isLoading:!1}}),(function(){p(e)})):p(e)};!function(e,t){var n=void 0===t?{}:t,r=n.afterAll,o=void 0===r?function(){}:r,i=n.afterEach,a=void 0===i?function(){}:i,s=n.beforeEach,l=void 0===s?function(){}:s,c=n.cacheRequests,u=void 0===c||c,d=n.evalScripts,p=void 0===d?"never":d,f=n.httpRequestWithCredentials,m=void 0!==f&&f,h=n.renumerateIRIElements,g=void 0===h||h;if(e&&"length"in e)for(var y=0,_=0,b=e.length;_<b;_++)ta(e[_],p,g,u,m,l,(function(t,n){a(t,n),e&&"length"in e&&e.length===++y&&o(y)}));else e?ta(e,p,g,u,m,l,(function(t,n){a(t,n),o(1),e=null})):o(0)}(r,{afterEach:function(e,n){e?g(e):t._isMounted&&t.setState((function(){return{isLoading:!1}}),(function(){try{m(n)}catch(e){g(e)}}))},beforeEach:function(e){if(e.setAttribute("role","img"),i){var t=e.querySelector(":scope > desc");t&&e.removeChild(t);var n=document.createElement("desc");n.innerHTML=i,e.prepend(n)}if(u){var r=e.querySelector(":scope > title");r&&e.removeChild(r);var o=document.createElement("title");o.innerHTML=u,e.prepend(o)}try{f(e)}catch(a){g(a)}},cacheRequests:d,evalScripts:a,httpRequestWithCredentials:s,renumerateIRIElements:l})}},o.removeSVG=function(){var e;null!=(e=this.nonReactWrapper)&&e.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},o.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},o.componentDidUpdate=function(e){var t=this;(function(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1})(Ui({},e),this.props)&&this.setState((function(){return t.initialState}),(function(){t.removeSVG(),t.renderSVG()}))},o.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},o.render=function(){var e=this.props;e.afterInjection,e.beforeInjection,e.desc,e.evalScripts;var t=e.fallback;e.httpRequestWithCredentials;var n=e.loading;e.renumerateIRIElements,e.src,e.title,e.useRequestCache;var r=e.wrapper,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,aa);return v(r,Ui({},o,{ref:this.refCallback},"svg"===r?{xmlns:sa,xmlnsXlink:la}:{}),this.state.isLoading&&n&&v(n,null),this.state.hasError&&t&&v(t,null))},t}(E);ca.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"},ca.propTypes={afterInjection:ia.func,beforeInjection:ia.func,desc:ia.string,evalScripts:ia.oneOf(["always","once","never"]),fallback:ia.oneOfType([ia.func,ia.object,ia.string]),httpRequestWithCredentials:ia.bool,loading:ia.oneOfType([ia.func,ia.object,ia.string]),onError:ia.func,renumerateIRIElements:ia.bool,src:ia.string.isRequired,title:ia.string,useRequestCache:ia.bool,wrapper:ia.oneOf(["div","span","svg"])};const ua=e=>{const{fetchAssessments:t,getOffers:n,hostInformation:{experiment:r,treatment:o}}=Xn(ho),[i,a]=qn(void 0),[s,l]=qn("fetching-offers"),[c,u]=qn([]),{trace:d}=No();Li((()=>{(async()=>{await Ii(5e3),await t();const e=n().map((e=>({name:e.content.productName,url:e.content.iconUrl})));u(e),l("displaying-offers-one-by-one");for(let t=0;t<e.length;t++)a(t),await Ii(1e3);await Ii(1e3),l("scaling-up-offers"),await Ii(1e3),l("set-up-benefits")})()}));const p=Zn((()=>{switch(s){case"fetching-offers":case"displaying-offers-one-by-one":case"scaling-up-offers":return"Personalising your benefits plan";case"set-up-benefits":return"Your Benefits Plan"}}),[s]),f=Zn((()=>{switch(s){case"fetching-offers":return"Finding benefits...";case"displaying-offers-one-by-one":case"scaling-up-offers":return 0===i?"1 benefit found that matches your profile":`${i+1} benefits found that match your profile`;case"set-up-benefits":return"Based on your profile, these are the benefits available to you"}}),[s,i]),m=Zn((()=>"fetching-offers"===s),[s]),h=Zn((()=>"scaling-up-offers"!==s),[s]),g=Zn((()=>"scaling-up-offers"===s||"set-up-benefits"===s),[s]),y=Zn((()=>"set-up-benefits"===s),[s]),_=Zn((()=>"set-up-benefits"===s),[s]);return fo(vi,{children:[fo(vi.Top,{children:fo("div",{className:"flex flex-col gap-4",children:[fo("div",{className:"transition-opacity duration-700 ease-in-out "+(m?"opacity-100":"opacity-0"),children:fo(xo,{size:"lg"})}),fo(Ni,{className:"transition-opacity duration-700 ease-in-out "+(h?"opacity-100":"opacity-0"),children:p}),fo(Ti,{className:"transition-opacity duration-700 ease-in-out "+(h?"opacity-100":"opacity-0"),children:f})]})}),fo(vi.Bottom,{children:fo("div",{class:"flex flex-col items-center gap-4",children:[fo(da,{scaleUp:g,showName:y,icons:c}),fo(Co,{testId:"set_up_benefits_button_next_screen",class:"mt-4 w-full md:w-[240px] transition-opacity duration-700 ease-in-out "+(_?"opacity-100":"hidden opacity-0"),onClickPromise:async()=>{await d("marketplace-started",{experiment:r,treatment:o}),await e.onComplete()},children:"Set up your benefits"})]})})]})},da=({scaleUp:e,showName:t,icons:n})=>fo("div",{children:[fo("style",{children:"\n .bg-lighter-than-text{\n background-color: hsl(from currentColor h s l / 0.08);\n }\n\n .animate-slide-from-right {\n opacity: 0;\n transform: translateX(400px);\n animation: slide-from-right 1s ease-out forwards;\n }\n\n @keyframes slide-from-right {\n from {\n transform: translateX(400px);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n "}),fo("div",{className:"flex gap-4 transition-scale transition-margin duration-700 ease-in-out "+(e?"scale-150 m-4":"scale-100"),children:n.map(((e,n)=>fo("div",{className:"mt-4 flex flex-col gap-1 items-center text-primary-base text-[0.5rem] w-12 max-w-12 min-w-12 animate-slide-from-right",style:{animationDelay:1e3*n+"ms"},children:[fo(ca,{src:e.url,wrapper:"svg",className:"w-10 h-10 max-h-10 max-w-10 min-h-10 min-w-10 p-2.5 rounded-lg bg-lighter-than-text",beforeInjection:e=>{var t;e.removeAttribute("width"),e.removeAttribute("height"),null==(t=e.querySelector("path"))||t.removeAttribute("fill"),e.setAttribute("fill","currentColor")}}),fo("p",{className:"transition-opacity duration-700 ease-in-out "+(t?"opacity-100":"opacity-0"),children:e.name})]},e.name)))})]});var pa=(e=>(e[e.PHONE_NUMBER=0]="PHONE_NUMBER",e[e.OTP=1]="OTP",e[e.SUCCESS=2]="SUCCESS",e))(pa||{});const fa=({className:e,children:t,...n})=>fo("label",{class:`text-base text-gray-600 ${e??""}`,...n,children:t}),ma=e=>v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"green",className:"w-5 h-5",...e},v("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"})),ha=({className:e,onClick:t,...n})=>{const[r,o]=qn(!1);return fo("button",{className:`inline-flex items-center justify-center px-2 text-primary-base rounded-md bg-transparent hover:bg-sky-50/50 focus:ring-2 focus:ring-primary-focus ${e??""}`,onClick:Jn((()=>{if(!r)return o(!0),t().finally((()=>{o(!1)}))}),[r,t]),...n,children:[fo("div",{class:"relative "+(r?"invisible":""),children:n.children}),r&&fo("div",{class:"absolute",children:fo(xo,{theme:"primary"})})]})},ga=({className:e,allowedKeyPattern:t,onChange:n,value:r,leadingIconElement:o,trailingIconElement:i,...a})=>{const s=Jn((e=>{t.test(e.key)||e.preventDefault()}),[t]);return fo(C,{children:fo("div",{class:"relative",children:[o,fo("input",{"data-testid":a.testId,type:"text",className:`border-0 ring-2 ring-gray-200 focus:outline-none text-base font-medium rounded-md shadow-sm ${e}`,value:r,onKeyPress:s,onChange:e=>n(e.currentTarget.value),...a}),i]})})},ya=e=>e.replace(/ /g,""),_a=e=>{const t=ya(e);return t.startsWith("04")&&10===t.length||t.startsWith("614")&&11===t.length||t.startsWith("+614")&&12===t.length||/^\+642\d{7,9}$/.test(t)},ba=({phoneNumber:e,onSubmit:t,onDecline:n})=>{const{hostInformation:{workflowsJourneyType:r}}=Xn(ho),[o,i]=qn(""),{setPhoneNumber:a,phoneNumber:s}=(e=>{const{identity:t}=Xn(ho),[n,r]=qn((()=>e&&_a(e)?e:"")),o=Zn((()=>_a(n)),[n]),i=Zn((()=>ya(n)),[n]),a=Zn((()=>i.startsWith("04")?`+61${i.replace(/^0+/,"")}`:i.startsWith("614")?`+${i}`:i),[i]),s=Zn((()=>(e=>{let t=0;return"#### ### ### ### ### ### ###".replace(/#/g,(()=>e[t++]??"")).trim()})(i)),[i]),l=Zn((()=>_a(t.verifiedPhoneNumber)&&a===t.verifiedPhoneNumber),[a,t.verifiedPhoneNumber]);return{setPhoneNumber:r,phoneNumber:{valid:o,original:n,formatted:a,masked:s,isVerified:l}}})(e),[l,c]=qn(s.isVerified),u=Jn((()=>{i("")}),[]),d=Jn((()=>{const e=s.valid?"":"Please enter a valid Australian mobile number beginning with 04.";i(e),c(s.isVerified)}),[s.isVerified,s.valid]),p=Jn((async()=>{s.valid&&await t(s).catch(i)}),[s,t]),f=Jn((async()=>{c(!1)}),[]),m=fo("div",{class:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-xs text-green-700 font-bold",children:["Verified ",fo(ma,{})]});return fo(vi,{children:[fo(vi.Top,{children:fo("div",{className:"flex flex-col gap-5",children:[fo(Ni,{children:"Join your workplace benefits program"}),fo(Ti,{children:[s.isVerified?"Confirm ":"Enter "," your ",fo("b",{children:"personal"})," mobile number to finish setting up your Flare Benefits account linked to your workplace"]})]})}),fo(vi.Bottom,{children:fo("div",{className:"mt-5 md:w-[300px] text-left",children:[fo(fa,{className:"font-medium text-sm text-gray-900 text-left",children:"Australian Mobile Number"}),fo(ga,{testId:"sign_in_mobile_number_text_input_mobile_number",allowedKeyPattern:/[+0-9]/,inputMode:"numeric",className:"mt-1 mb-1 w-full p-2 focus-visible:ring-gray-500",value:s.original,onChange:a,onfocusin:u,onfocusout:d,trailingIconElement:l&&m,disabled:l}),0!==o.length&&fo("div",{className:"h-8 leading-none",children:fo("span",{className:"text-xs text-rose-500",children:o})}),l&&fo("div",{className:"mt-2 ml-2 mb-2 leading-none",children:fo("span",{className:"text-xs",children:["Not your personal number?",fo(ha,{class:"text-blue-500",onClick:f,children:"Change number"})]})}),fo("div",{children:fo("span",{className:"font-medium text-sm text-gray-900 text-center",children:["By creating your account you confirm you have read and agree to Flare Benefits"," ",fo("a",{href:"https://www.flarehr.com/flare-app-terms-and-conditions/",target:"_blank",rel:"noreferrer",children:" Terms of Use "}),"and",fo("a",{href:"https://www.flarehr.com/privacy-policy/",target:"_blank",rel:"noreferrer",children:" Privacy Policy"}),"."," "]})}),fo(Co,{testId:"sign_in_mobile_number_button_send_otp",class:"mt-5 md:w-full",onClickPromise:p,children:"Join your workplace"}),r!==ne.AppInvite&&fo(Co,{testId:"sign_in_mobile_number_button_decline_to_send_otp",class:"mt-5 md:w-full bg-white hover:!bg-gray-100 focus:!ring-gray-200 !border-0 !shadow-none !text-gray-700 !border-gray-300",onClickPromise:n,children:"Not now"})]})})]})},wa=""+("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__dirname+"/assets/check-animated-QQOZQPLY.gif?inline").href:new URL("assets/check-animated-QQOZQPLY.gif?inline","undefined"==typeof document?location.href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||document.baseURI).href),va=({onContinue:e})=>{const{featureFlags:{marketplaceScheme:t},hostInformation:{experiment:n,treatment:r}}=Xn(ho),{trace:o}=No(),i=Zn((()=>({title:"You’ve joined your workplace benefits program",isNextButtonHidden:"allowance"===t.scheme})),[t]),a=Jn((async()=>{"allowance"!==t.scheme&&await o("marketplace-started",{experiment:n,treatment:r}),e()}),[n,t.scheme,e,o,r]);return Vn((()=>{if("allowance"===t.scheme){const t=setTimeout(e,3e3);return()=>clearTimeout(t)}}),[t,e]),fo(vi,{children:[fo(vi.Top,{children:fo("img",{src:wa,className:"h-16 w-16"})}),fo(vi.Bottom,{children:fo("div",{className:"mt-5 flex flex-col items-center gap-5 text-center",children:[fo(Ni,{children:i.title}),!i.isNextButtonHidden&&fo(Co,{testId:"sign_in_success_button_next_screen",class:"mt-5 w-full md:w-[240px]",onClickPromise:a,children:"Set up your benefits"})]})})]})},xa=e=>v("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,fill:"currentColor",...e},v("path",{d:"m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"})),ka=({open:e})=>fo(vo,{open:e,children:fo(wo,{children:fo("div",{className:"flex flex-col gap-5 items-center justify-center text-center",children:[fo(xo,{size:"lg"}),fo(Ni,{children:"Creating your account"}),fo("div",{children:[fo(Ti,{children:"This can take up to 30 seconds."}),fo(Ti,{children:"Please don't navigate away or refresh your browser."})]})]})})}),Ca=({phoneNumber:e,onVerify:t,onResendOtp:n,onGoBack:r})=>{const{otp:o,setOtp:i}=(()=>{const[e,t]=qn("");return{otp:{valid:Zn((()=>6===e.length),[e.length]),code:e},setOtp:t}})(),[a,s]=qn(!1),[l,c]=qn(""),{countdown:u,restart:d}=(e=>{const[t,n]=qn(e),r=Gn(),o=Jn((()=>{clearInterval(r.current)}),[]);return Vn((()=>o),[o]),{countdown:t,restart:Jn((()=>{let t=e;clearInterval(r.current),r.current=setInterval((()=>{t<0?clearInterval(r.current):n(t--)}),1e3)}),[e])}})(60);Vn(d,[d]);const p=Jn((()=>(s(!0),c(""),t(o.code).catch(c).finally((()=>{s(!1)})))),[t,o.code]),f=Jn((()=>(c(""),n().then(d).catch(c))),[n,d]);return fo(C,{children:[fo(ka,{open:a}),fo(vi,{children:[fo(vi.Top,{children:fo("div",{className:"flex flex-col gap-5",children:[fo(Ni,{children:"Verify your mobile number"}),fo(Ti,{children:["An SMS verification code has been sent to the number ",e,"."]})]})}),fo(vi.Bottom,{children:fo("div",{className:"mt-5 md:w-[300px] text-left",children:[fo(fa,{className:"font-medium text-sm text-gray-900 text-left",children:"Enter your verification code"}),fo(ga,{testId:"sign_in_otp_text_input_otp",allowedKeyPattern:/[0-9]/,inputMode:"numeric",minLength:6,maxLength:6,className:"mt-1 mb-1 w-full p-2 focus-visible:ring-gray-500",trailingIconElement:!1,onChange:i}),l&&fo("span",{className:"text-xs text-rose-500",children:l}),fo("p",{class:"mt-2 text-center text-xs text-gray-600 disabled:opacity-75 ",children:["Didn't get the code?",fo(ha,{disabled:0!==u,className:"underline mx-2 disabled:text-gray-600 disabled:hover:bg-transparent disabled:cursor-text disabled:px-0",onClick:f,children:"Resend SMS"}),0!==u&&fo(C,{children:["in ",u," secs"]})]}),fo(Co,{testId:"sign_in_otp_button_verify_otp",class:"mt-5 md:w-full",disabled:!o.valid,onClickPromise:p,children:"Continue"}),fo(Co,{testId:"sign_in_otp_button_decline_to_verify_otp",class:"mt-5 md:w-full bg-white hover:!bg-gray-100 focus:!ring-gray-200 !border-0 !shadow-none !text-gray-700 !border-gray-300",onClickPromise:async()=>{r()},children:fo("span",{className:"flex gap-3",children:[fo(xa,{}),"Back"]})})]})})]})]})},Ea=({phoneNumber:e,onSignUp:t,onVerify:n,onResendOtp:r,onSuccess:o,onDecline:i})=>{const{trace:a}=No(),[s,l]=qn(e??""),{step:c,goBack:u,goToStep:d}=(()=>{const[e,t]=qn(0),n=Jn((()=>{const n=e-1;n>=0&&t(n)}),[e]),r=Jn((e=>{e<=2&&t(e)}),[]);return{step:e,goBack:n,goToStep:r}})();Vn((()=>{(async()=>{await a("sign-up-viewed")})()}),[a]);const p=Jn((e=>t(e.formatted).then((async t=>{l(e.masked),t.isVerificationRequired?d(pa.OTP):(await a("sign-up-completed"),d(pa.SUCCESS))}))),[d,t,a]),f=Jn((()=>a("sign-up-declined").then(i)),[i,a]),m=Jn((e=>n(e).then((async()=>{await a("sign-up-completed"),d(pa.SUCCESS)}))),[d,n,a]);return fo(C,{children:[c===pa.PHONE_NUMBER&&fo(ba,{phoneNumber:s,onSubmit:p,onDecline:f}),c===pa.OTP&&fo(Ca,{phoneNumber:s,onVerify:m,onResendOtp:r,onGoBack:u}),c===pa.SUCCESS&&fo(va,{onContinue:o})]})};var Sa=(e=>(e.Auth_AccountDisabled="Sorry, your account has been deactivated. Please contact Flare if there are any issues.",e.Auth_AccountLocked="Sorry, your account is currently locked due to too many attempts. Please try again later.",e.Auth_TooManyAttempts="Sorry, you have too many attempts. Please try again later.",e.Auth_Unregistered="Sorry, we are currently experiencing some issues. Please try again later.",e.Auth_InvalidVerificationCode="Your one time passcode doesn't look right. Please try again with a new one time passcode.",e.Auth_SessionExpired="Sorry, looks like your session has expired. Please try again.",e.Validation_InvalidPhoneNumber="Please enter a valid Australian mobile number beginning with 04.",e))(Sa||{});const Na=e=>{var t;const n=null==(t=null==e?void 0:e.response)?void 0:t.data;throw Sa[null==n?void 0:n.code]??"Sorry, we are currently experiencing some issues. Please try again later."},Ta=({onSuccess:e,onDecline:t})=>{const{identity:{phoneNumber:n}}=Xn(ho),{signUp:r,verifyOtp:o,resendOtp:i}={signUp:async e=>kn.backend.getClient().post("v2.0/auth/signUp",{mobileNumber:e}).then((e=>({isVerificationRequired:e.data.isVerificationRequired??!0}))).catch(Na),verifyOtp:async e=>{await kn.backend.getClient().post("auth/verify",{otp:e}).catch(Na)},resendOtp:async()=>{await kn.backend.getClient().post("auth/resend").catch(Na)}};return fo(C,{children:fo(Ea,{phoneNumber:n,onSignUp:r,onVerify:o,onResendOtp:i,onSuccess:e,onDecline:t})})},Aa=""+("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__dirname+"/assets/intro-COqxd5jd.png").href:new URL("assets/intro-COqxd5jd.png","undefined"==typeof document?location.href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||document.baseURI).href),Oa=e=>{const{trace:t}=No(),{hostInformation:{experiment:n,treatment:r}}=Xn(ho);return Vn((()=>{t("benefits-setup-started",{experiment:n,treatment:r})}),[n,t,r]),fo(vi,{children:[fo(vi.Top,{children:fo("img",{class:"max-w-[30rem] w-full",src:Aa})}),fo(vi.Bottom,{children:fo("div",{children:[fo("h3",{class:"mt-8 text-2xl md:text-3xl leading-8 md:leading-9 font-bold",children:"Finish setting up your workplace benefits"}),fo("p",{class:"mt-3 text-lg leading-7 text-gray-600",children:"Because your workplace uses Flare you have access to a range of exclusive benefits that can save you thousands of dollars every year on your car, private health insurance, weekly grocery shop and more."}),fo(Co,{testId:"introduction_button_next_screen",class:"mt-8",onClickPromise:async()=>{e.onStepComplete()},children:"Continue"})]})})]})},Ra=({visible:e,children:t})=>{const n=Gn(e);return e&&!n.current&&(n.current=!0),n.current?fo("div",{hidden:!e,children:t}):null},Pa=({icon:e})=>"string"==typeof e?fo(ca,{src:e,wrapper:"svg",className:"w-10 h-10 max-h-10 max-w-10 min-h-10 min-w-10 p-2.5 rounded-lg bg-lighter-than-text",beforeInjection:e=>{var t;e.removeAttribute("width"),e.removeAttribute("height"),null==(t=e.querySelector("path"))||t.removeAttribute("fill"),e.setAttribute("fill","currentColor")}}):fo("div",{className:"w-10 h-10 max-h-10 max-w-10 min-h-10 min-w-10 p-2.5 rounded-lg bg-lighter-than-text",children:e}),La=({label:e,icon:t})=>fo("div",{className:"flex flex-col gap-1 items-center w-12 max-w-12 min-w-12",children:[t,fo("p",{className:"max-h-10 max-w-20 break-words text-ellipsis overflow-hidden line-clamp-2",children:e})]}),Ia=({children:e})=>fo(C,{children:e}),Ua=({selectedIndex:e,onChange:t,children:n})=>{const r=Zn((()=>hr.toArray(n).filter((e=>e.type===La))),[n]),o=Zn((()=>hr.toArray(n).filter((e=>e.type===Ia))),[n]);return Li((()=>{o.length>0&&(null==t||t(0))})),fo("div",{children:[fo("div",{className:"flex items-baseline gap-8 md:mb-4",children:[fo("style",{children:"\n .bg-lighter-than-text{\n background-color: hsl(from currentColor h s l / 0.08);\n }\n "}),r.map(((n,r)=>fo("div",{onClick:()=>null==t?void 0:t(r),className:`\n text-sm font-medium cursor-auto h-full relative\n flex items-center justify-center\n ${r===e?"text-primary-base":"text-gray-400"}\n ${o.length>0?"hover:before:cursor-pointer":"hover:before:cursor-default"} \n hover:before:w-16 hover:before:h-16 hover:before:absolute\n `,children:n},n.key)))]}),o.map(((t,n)=>fo(Ra,{visible:n===e,children:t},t.key)))]})},Fa=()=>fo("div",{class:"flex justify-center",children:fo(xo,{size:"lg"})}),ja=(Ba=e=>{var t,n,r;const{featureFlags:{marketplaceScheme:o},hostInformation:i,offersProgress:{canOfferSkipToEstimate:a}}=Xn(ho),{trace:s}=No(),l=Gn(null);return Li((()=>{s({type:"offer-viewed",offerName:e.marketPlaceOffer.name,data:e.marketPlaceOffer.metadata},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName}),l.current&&(l.current.terms=e.marketPlaceOffer.content.terms,l.current.details=e.marketPlaceOffer.content.details,l.current["on-accept"]=async()=>{await s({type:"offer-accepted",offerName:e.marketPlaceOffer.name,data:{...e.marketPlaceOffer.metadata,template:e.marketPlaceOffer.content.template,assessmentId:e.marketPlaceOffer.content.assessmentId}},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName})},l.current["on-decline"]=async()=>{await s({type:"offer-declined",offerName:e.marketPlaceOffer.name,data:{...e.marketPlaceOffer.metadata,template:e.marketPlaceOffer.content.template,assessmentId:e.marketPlaceOffer.content.assessmentId}},{experiment:e.marketPlaceOffer.metadata.featureName,treatment:e.marketPlaceOffer.metadata.treatmentName}),e.onStepComplete(!1,!1)},l.current["on-complete"]=()=>e.onStepComplete(!0,!0),l.current["on-skip"]=e.marketPlaceOffer.content.skipButtonHidden?void 0:()=>e.onStepComplete(!0,!1))})),fo("benefits-plan-assessment",{"base-url":Cn.workplaceBackend.getBaseUrl(),"profile-id":Cn.workplaceBackend.getProfileId(),"skip-more-details":!0,"access-token":e.accessToken,"image-url":e.marketPlaceOffer.content.imageUrl,"assessment-id":e.marketPlaceOffer.content.assessmentId,"assessment-instructions":"allowance"===o.scheme?e.marketPlaceOffer.content.assessmentInstructions:void 0,"track-client":i.client,"track-source":i.source,"track-channel":i.channel,"track-experiment":e.marketPlaceOffer.metadata.featureName,"track-treatment":e.marketPlaceOffer.metadata.treatmentName,"marketplace-offer-name":e.marketPlaceOffer.name,"assessment-title":e.marketPlaceOffer.content.title,description:e.marketPlaceOffer.content.description,"accept-button":e.marketPlaceOffer.content.acceptButton,"decline-button":e.marketPlaceOffer.content.declineButton,"special-banner-title":"allowance"===o.scheme?null==(t=e.marketPlaceOffer.content.specialBanner)?void 0:t.title:void 0,"special-banner-subtitle":"allowance"===o.scheme?null==(n=e.marketPlaceOffer.content.specialBanner)?void 0:n.subtitle:void 0,"special-banner-type":"allowance"===o.scheme?null==(r=e.marketPlaceOffer.content.specialBanner)?void 0:r.type:void 0,"vertical-alignment":"items-center","skip-to-completion":a(e.marketPlaceOffer.name),ref:l})},e=>{const t=Gn(null),[n,r]=qn(),[o,i]=qn(!1);return Vn((()=>{(async()=>{const e=await Cn.workplaceBackend.getIdToken();r(e)})(),(()=>{if(t.current&&!t.current.querySelector("script[data-injected]")){const e=document.createElement("script"),n=yo(Cn.workplaceBackend.getBaseUrl());e.type="module",e.src=`https://npm-cdn.flarehr.com/@flarehr/benefits-plan-assessment@${n}/dist/benefits-plan-assessment.js`,e.dataset.injected="true",e.onload=()=>{i(!0)},t.current.appendChild(e)}else i(!0)})()}),[]),fo("div",{ref:t,className:n,children:n&&o?fo(Ba,{...e,accessToken:n}):fo(Fa,{})})});var Ba;const Ma=e=>v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",...e},v("path",{fill:"currentColor",d:"M345 137c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-119 119L73 103c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l119 119L39 375c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l119-119L311 409c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-119-119L345 137z"}))
8
8
  /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */,{entries:Da,setPrototypeOf:za,isFrozen:Ha,getPrototypeOf:qa,getOwnPropertyDescriptor:Wa}=Object;let{freeze:Va,seal:$a,create:Ga}=Object,{apply:Ya,construct:Za}="undefined"!=typeof Reflect&&Reflect;Va||(Va=function(e){return e}),$a||($a=function(e){return e}),Ya||(Ya=function(e,t,n){return e.apply(t,n)}),Za||(Za=function(e,t){return new e(...t)});const Ja=ds(Array.prototype.forEach),Xa=ds(Array.prototype.lastIndexOf),Ka=ds(Array.prototype.pop),Qa=ds(Array.prototype.push),es=ds(Array.prototype.splice),ts=ds(String.prototype.toLowerCase),ns=ds(String.prototype.toString),rs=ds(String.prototype.match),os=ds(String.prototype.replace),is=ds(String.prototype.indexOf),as=ds(String.prototype.trim),ss=ds(Object.prototype.hasOwnProperty),ls=ds(RegExp.prototype.test),cs=(us=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Za(us,t)});var us;function ds(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Ya(e,t,r)}}function ps(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ts;za&&za(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(Ha(t)||(t[r]=e),o=e)}e[o]=!0}return e}function fs(e){for(let t=0;t<e.length;t++){ss(e,t)||(e[t]=null)}return e}function ms(e){const t=Ga(null);for(const[n,r]of Da(e)){ss(e,n)&&(Array.isArray(r)?t[n]=fs(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=ms(r):t[n]=r)}return t}function hs(e,t){for(;null!==e;){const n=Wa(e,t);if(n){if(n.get)return ds(n.get);if("function"==typeof n.value)return ds(n.value)}e=qa(e)}return function(){return null}}const gs=Va(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ys=Va(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),_s=Va(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),bs=Va(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ws=Va(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),vs=Va(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xs=Va(["#text"]),ks=Va(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Cs=Va(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Es=Va(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ss=Va(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ns=$a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ts=$a(/<%[\w\W]*|[\w\W]*%>/gm),As=$a(/\$\{[\w\W]*/gm),Os=$a(/^data-[\-\w.\u00B7-\uFFFF]+$/),Rs=$a(/^aria-[\-\w]+$/),Ps=$a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ls=$a(/^(?:\w+script|data):/i),Is=$a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Us=$a(/^html$/i),Fs=$a(/^[a-z][.\w]*(-[.\w]+)+$/i);var js=Object.freeze({__proto__:null,ARIA_ATTR:Rs,ATTR_WHITESPACE:Is,CUSTOM_ELEMENT:Fs,DATA_ATTR:Os,DOCTYPE_NAME:Us,ERB_EXPR:Ts,IS_ALLOWED_URI:Ps,IS_SCRIPT_OR_DATA:Ls,MUSTACHE_EXPR:Ns,TMPLIT_EXPR:As});const Bs=1,Ms=3,Ds=7,zs=8,Hs=9;var qs=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==Hs||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:f,trustedTypes:m}=t,h=c.prototype,g=hs(h,"cloneNode"),y=hs(h,"remove"),_=hs(h,"nextSibling"),b=hs(h,"childNodes"),w=hs(h,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let v,x="";const{implementation:k,createNodeIterator:C,createDocumentFragment:E,getElementsByTagName:S}=r,{importNode:N}=o;let T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof Da&&"function"==typeof w&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:A,ERB_EXPR:O,TMPLIT_EXPR:R,DATA_ATTR:P,ARIA_ATTR:L,IS_SCRIPT_OR_DATA:I,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:F}=js;let{IS_ALLOWED_URI:j}=js,B=null;const M=ps({},[...gs,...ys,..._s,...ws,...xs]);let D=null;const z=ps({},[...ks,...Cs,...Es,...Ss]);let H=Object.seal(Ga(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,W=null,V=!0,$=!0,G=!1,Y=!0,Z=!1,J=!0,X=!1,K=!1,Q=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!1,ie=!0,ae=!1,se={},le=null;const ce=ps({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const de=ps({},["audio","video","img","source","image","track"]);let pe=null;const fe=ps({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",he="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let ye=ge,_e=!1,be=null;const we=ps({},[me,he,ge],ns);let ve=ps({},["mi","mo","mn","ms","mtext"]),xe=ps({},["annotation-xml"]);const ke=ps({},["title","style","font","a","script"]);let Ce=null;const Ee=["application/xhtml+xml","text/html"];let Se=null,Ne=null;const Te=r.createElement("form"),Ae=function(e){return e instanceof RegExp||e instanceof Function},Oe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ne||Ne!==e){if(e&&"object"==typeof e||(e={}),e=ms(e),Ce=-1===Ee.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Se="application/xhtml+xml"===Ce?ns:ts,B=ss(e,"ALLOWED_TAGS")?ps({},e.ALLOWED_TAGS,Se):M,D=ss(e,"ALLOWED_ATTR")?ps({},e.ALLOWED_ATTR,Se):z,be=ss(e,"ALLOWED_NAMESPACES")?ps({},e.ALLOWED_NAMESPACES,ns):we,pe=ss(e,"ADD_URI_SAFE_ATTR")?ps(ms(fe),e.ADD_URI_SAFE_ATTR,Se):fe,ue=ss(e,"ADD_DATA_URI_TAGS")?ps(ms(de),e.ADD_DATA_URI_TAGS,Se):de,le=ss(e,"FORBID_CONTENTS")?ps({},e.FORBID_CONTENTS,Se):ce,q=ss(e,"FORBID_TAGS")?ps({},e.FORBID_TAGS,Se):ms({}),W=ss(e,"FORBID_ATTR")?ps({},e.FORBID_ATTR,Se):ms({}),se=!!ss(e,"USE_PROFILES")&&e.USE_PROFILES,V=!1!==e.ALLOW_ARIA_ATTR,$=!1!==e.ALLOW_DATA_ATTR,G=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Z=e.SAFE_FOR_TEMPLATES||!1,J=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,ie=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,j=e.ALLOWED_URI_REGEXP||Ps,ye=e.NAMESPACE||ge,ve=e.MATHML_TEXT_INTEGRATION_POINTS||ve,xe=e.HTML_INTEGRATION_POINTS||xe,H=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ae(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ae(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(H.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&($=!1),te&&(ee=!0),se&&(B=ps({},xs),D=[],!0===se.html&&(ps(B,gs),ps(D,ks)),!0===se.svg&&(ps(B,ys),ps(D,Cs),ps(D,Ss)),!0===se.svgFilters&&(ps(B,_s),ps(D,Cs),ps(D,Ss)),!0===se.mathMl&&(ps(B,ws),ps(D,Es),ps(D,Ss))),e.ADD_TAGS&&(B===M&&(B=ms(B)),ps(B,e.ADD_TAGS,Se)),e.ADD_ATTR&&(D===z&&(D=ms(D)),ps(D,e.ADD_ATTR,Se)),e.ADD_URI_SAFE_ATTR&&ps(pe,e.ADD_URI_SAFE_ATTR,Se),e.FORBID_CONTENTS&&(le===ce&&(le=ms(le)),ps(le,e.FORBID_CONTENTS,Se)),ie&&(B["#text"]=!0),X&&ps(B,["html","head","body"]),B.table&&(ps(B,["tbody"]),delete q.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw cs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw cs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');v=e.TRUSTED_TYPES_POLICY,x=v.createHTML("")}else void 0===v&&(v=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(i){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(m,i)),null!==v&&"string"==typeof x&&(x=v.createHTML(""));Va&&Va(e),Ne=e}},Re=ps({},[...ys,..._s,...bs]),Pe=ps({},[...ws,...vs]),Le=function(e){Qa(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){y(e)}},Ie=function(e,t){try{Qa(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(r){Qa(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Le(t)}catch(r){}else try{t.setAttribute(e,"")}catch(r){}},Ue=function(e){let t=null,n=null;if(Q)e="<remove></remove>"+e;else{const t=rs(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ce&&ye===ge&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=v?v.createHTML(e):e;if(ye===ge)try{t=(new f).parseFromString(o,Ce)}catch(a){}if(!t||!t.documentElement){t=k.createDocument(ye,"template",null);try{t.documentElement.innerHTML=_e?x:o}catch(a){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ye===ge?S.call(t,X?"html":"body")[0]:X?t.documentElement:i},Fe=function(e){return C.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},je=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Be=function(e){return"function"==typeof l&&e instanceof l};function Me(e,t,r){Ja(e,(e=>{e.call(n,t,r,Ne)}))}const De=function(e){let t=null;if(Me(T.beforeSanitizeElements,e,null),je(e))return Le(e),!0;const r=Se(e.nodeName);if(Me(T.uponSanitizeElement,e,{tagName:r,allowedTags:B}),J&&e.hasChildNodes()&&!Be(e.firstElementChild)&&ls(/<[/\w!]/g,e.innerHTML)&&ls(/<[/\w!]/g,e.textContent))return Le(e),!0;if(e.nodeType===Ds)return Le(e),!0;if(J&&e.nodeType===zs&&ls(/<[/\w]/g,e.data))return Le(e),!0;if(!B[r]||q[r]){if(!q[r]&&He(r)){if(H.tagNameCheck instanceof RegExp&&ls(H.tagNameCheck,r))return!1;if(H.tagNameCheck instanceof Function&&H.tagNameCheck(r))return!1}if(ie&&!le[r]){const t=w(e)||e.parentNode,n=b(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const o=g(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,_(e))}}}return Le(e),!0}return e instanceof c&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:ye,tagName:"template"});const n=ts(e.tagName),r=ts(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===he?t.namespaceURI===ge?"svg"===n:t.namespaceURI===me?"svg"===n&&("annotation-xml"===r||ve[r]):Boolean(Re[n]):e.namespaceURI===me?t.namespaceURI===ge?"math"===n:t.namespaceURI===he?"math"===n&&xe[r]:Boolean(Pe[n]):e.namespaceURI===ge?!(t.namespaceURI===he&&!xe[r])&&!(t.namespaceURI===me&&!ve[r])&&!Pe[n]&&(ke[n]||!Re[n]):!("application/xhtml+xml"!==Ce||!be[e.namespaceURI]))}(e)?(Le(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!ls(/<\/no(script|embed|frames)/i,e.innerHTML)?(Z&&e.nodeType===Ms&&(t=e.textContent,Ja([A,O,R],(e=>{t=os(t,e," ")})),e.textContent!==t&&(Qa(n.removed,{element:e.cloneNode()}),e.textContent=t)),Me(T.afterSanitizeElements,e,null),!1):(Le(e),!0)},ze=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in r||n in Te))return!1;if($&&!W[t]&&ls(P,t));else if(V&&ls(L,t));else if(!D[t]||W[t]){if(!(He(e)&&(H.tagNameCheck instanceof RegExp&&ls(H.tagNameCheck,e)||H.tagNameCheck instanceof Function&&H.tagNameCheck(e))&&(H.attributeNameCheck instanceof RegExp&&ls(H.attributeNameCheck,t)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(t))||"is"===t&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&ls(H.tagNameCheck,n)||H.tagNameCheck instanceof Function&&H.tagNameCheck(n))))return!1}else if(pe[t]);else if(ls(j,os(n,U,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==is(n,"data:")||!ue[e]){if(G&&!ls(I,os(n,U,"")));else if(n)return!1}else;return!0},He=function(e){return"annotation-xml"!==e&&rs(e,F)},qe=function(e){Me(T.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||je(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let o=t.length;for(;o--;){const a=t[o],{name:s,namespaceURI:l,value:c}=a,u=Se(s),d=c;let p="value"===s?d:as(d);if(r.attrName=u,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,Me(T.uponSanitizeAttribute,e,r),p=r.attrValue,!oe||"id"!==u&&"name"!==u||(Ie(s,e),p="user-content-"+p),J&&ls(/((--!?|])>)|<\/(style|title)/i,p)){Ie(s,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Ie(s,e);continue}if(!Y&&ls(/\/>/i,p)){Ie(s,e);continue}Z&&Ja([A,O,R],(e=>{p=os(p,e," ")}));const f=Se(e.nodeName);if(ze(f,u,p)){if(v&&"object"==typeof m&&"function"==typeof m.getAttributeType)if(l);else switch(m.getAttributeType(f,u)){case"TrustedHTML":p=v.createHTML(p);break;case"TrustedScriptURL":p=v.createScriptURL(p)}if(p!==d)try{l?e.setAttributeNS(l,s,p):e.setAttribute(s,p),je(e)?Le(e):Ka(n.removed)}catch(i){Ie(s,e)}}else Ie(s,e)}Me(T.afterSanitizeAttributes,e,null)},We=function e(t){let n=null;const r=Fe(t);for(Me(T.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Me(T.uponSanitizeShadowNode,n,null),De(n),qe(n),n.content instanceof a&&e(n.content);Me(T.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,c=null;if(_e=!e,_e&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Be(e)){if("function"!=typeof e.toString)throw cs("toString is not a function");if("string"!=typeof(e=e.toString()))throw cs("dirty is not a string, aborting")}if(!n.isSupported)return e;if(K||Oe(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Se(e.nodeName);if(!B[t]||q[t])throw cs("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Ue("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===Bs&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!ee&&!Z&&!X&&-1===e.indexOf("<"))return v&&ne?v.createHTML(e):e;if(r=Ue(e),!r)return ee?null:ne?x:""}r&&Q&&Le(r.firstChild);const u=Fe(ae?e:r);for(;s=u.nextNode();)De(s),qe(s),s.content instanceof a&&We(s.content);if(ae)return e;if(ee){if(te)for(c=E.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(D.shadowroot||D.shadowrootmode)&&(c=N.call(o,c,!0)),c}let d=X?r.outerHTML:r.innerHTML;return X&&B["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&ls(Us,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Z&&Ja([A,O,R],(e=>{d=os(d,e," ")})),v&&ne?v.createHTML(d):d},n.setConfig=function(){Oe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),K=!0},n.clearConfig=function(){Ne=null,K=!1},n.isValidAttribute=function(e,t,n){Ne||Oe({});const r=Se(e),o=Se(t);return ze(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&Qa(T[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Xa(T[e],t);return-1===n?void 0:es(T[e],n,1)[0]}return Ka(T[e])},n.removeHooks=function(e){T[e]=[]},n.removeAllHooks=function(){T={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const Ws=({children:e})=>{const t=lo.Children.toArray(e),n=t.find((e=>e.type===Vs)),r=t.find((e=>e.type===$s));return fo(wi,{appear:!0,show:!0,enter:"transition duration-700 ease-out",enterFrom:"opacity-0",enterTo:"opacity-100",children:fo("div",{class:"md:grid md:grid-cols-2 max-w-[59.5rem] mx-auto",children:[fo(wi,{appear:!0,show:!0,enter:"transition duration-700 ease-out md:transition-none",enterFrom:"-translate-y-6",enterTo:"translate-y-0",children:n&&fo("div",{class:"flex items-center h-full",children:n})}),fo(wi,{appear:!0,show:!0,enter:"transition delay-300 duration-[600ms] ease-out",enterFrom:"opacity-0 -translate-y-6",enterTo:"opacity-100 translate-y-0",children:r&&fo("div",{class:"flex items-center h-full",children:r})})]})})},Vs=({children:e})=>fo(C,{children:e}),$s=({children:e})=>fo(C,{children:e});Ws.Left=Vs,Ws.Right=$s;const Gs=e=>v("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,...e},v("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})),Ys=e=>fo(wi,{appear:!0,show:!0,enter:"transition duration-300 ease-out",enterFrom:"opacity-0",enterTo:"opacity-100",children:fo("div",{class:"w-full border border-gray-200 rounded-lg shadow-sm p-4 pl-3 md:p-6 space-y-2",children:e.items.map(((e,t)=>fo("div",{class:"flex space-x-1",children:[fo("span",{children:fo(Ai,{class:"h-5 w-5 fill-primary-base"})}),fo("span",{class:"text-sm leading-5 text-gray-600",children:e})]},t)))})}),Zs=e=>{const[t,n]=qn(!1);return fo("div",{class:e.class,children:t?fo(Ys,{items:e.items}):fo("button",{type:"button",class:"w-full inline-flex justify-center items-center px-4 py-3 border border-gray-200 shadow-sm text-sm font-medium rounded-md text-primary-base bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-focus",onClick:()=>n(!0),children:["Learn more",fo("span",{class:"ml-1",children:fo(Gs,{class:"h-4 w-4"})})]})})},Js=e=>{var t,n,r,o;const{featureFlags:{marketplaceScheme:i}}=Xn(ho),{trace:a}=No(),[s,l]=qn(!1);Li((()=>{a({type:"offer-viewed",offerName:e.step.name,data:e.step.metadata},{experiment:e.step.metadata.featureName,treatment:e.step.metadata.treatmentName})}));const c=async t=>{t?await a({type:"offer-accepted",offerName:e.step.name,data:{...e.step.metadata,template:"Eoi"}},{experiment:e.step.metadata.featureName,treatment:e.step.metadata.treatmentName}):await a({type:"offer-declined",offerName:e.step.name,data:{...e.step.metadata,template:"Eoi"}},{experiment:e.step.metadata.featureName,treatment:e.step.metadata.treatmentName});return(t?e.primaryButton:e.secondaryButton).onClick()};return fo(Ws,{children:[fo(Ws.Left,{children:fo("div",{children:fo(wi,{appear:!0,show:!0,enter:"transition duration-700 ease-out md:transition-none",enterFrom:"-translate-y-6",enterTo:"translate-y-0",children:fo("div",{children:[fo("img",{class:"mt-4 max-w-full w-full mx-auto md:hidden",src:e.step.content.mobileImageUrl,loading:"lazy"}),fo("div",{class:"md:max-w-[27.5rem]",children:[fo("h3",{class:"mt-8 md:mt-3 text-2xl md:text-3xl leading-8 md:leading-9 font-bold",children:e.step.content.title}),fo("p",{class:"mt-2 text-base md:text-lg leading-6 md:leading-7 text-gray-600 break-words",children:e.step.content.description}),e.step.content.details&&fo("div",{class:"mt-6 hidden md:block",children:fo(Ys,{items:e.step.content.details})})]}),e.step.content.details&&fo(Zs,{class:"mt-6 md:hidden",items:e.step.content.details}),"allowance"===i.scheme&&"offer"==(null==(t=e.step.content.specialBanner)?void 0:t.type)&&fo(Eo,{style:{background:"linear-gradient(90deg, rgba(255, 135, 111, 0.10) 0%, rgba(166, 80, 255, 0.10) 100%)"},className:"md:max-w-[27.5rem] mt-6",children:fo("div",{children:[fo("p",{className:"font-semibold text-lg leading-tight text-gray-900",children:e.step.content.specialBanner.title}),fo("span",{className:"font-normal text-sm text-gray-900",children:e.step.content.specialBanner.subtitle})]})}),e.children&&e.children,fo("div",{class:"flex flex-col md:flex-row md:justify-between gap-4 md:max-w-[27.5rem] mt-6 md:mt-11",children:[fo(Co,{testId:`offer_${e.step.name}_button_accept`,class:e.primaryButton.class??"",onClickPromise:()=>c(!0),children:e.primaryButton.text??"Next"}),(null==(n=e.secondaryButton)?void 0:n.text)&&fo(Co,{testId:`offer_${e.step.name}_button_decline`,class:e.secondaryButton.class??"bg-white hover:!bg-gray-100 focus:!ring-gray-200 !border-0 !shadow-none !text-gray-700 !border-gray-300",onClickPromise:()=>c(!1),children:e.secondaryButton.text})]}),(null==(r=e.step.content.terms)?void 0:r.length)>0&&fo("p",{className:"mt-6 text-xs",children:[fo("span",{children:"*"}),fo("span",{className:"underline text-primary-base cursor-pointer",onClick:()=>l(!0),children:"T&C's apply"})]}),(null==(o=e.step.content.terms)?void 0:o.length)>0&&fo(vo,{open:s,children:[fo(bo,{children:fo("div",{className:"relative",children:[fo("h3",{className:"text-base font-semibold text-gray-900",children:"Terms & Conditions"}),fo("span",{className:"absolute top-0 right-0 p-1 rounded-full bg-gray-200 cursor-pointer hover:bg-gray-100",onClick:()=>l(!1),children:fo(Ma,{className:"h-4 min-h-4 max-h-4 w-4 min-w-4 max-w-4"})})]})}),fo(wo,{children:fo("div",{class:"flex flex-col gap-3 mt-6 text-gray-600 text-xs",children:e.step.content.terms.map(((e,t)=>fo("span",{dangerouslySetInnerHTML:{__html:qs.sanitize(e,{ADD_ATTR:["target"]})}},t)))})})]})]})})})}),fo(Ws.Right,{children:fo("img",{class:"max-w-[30rem] w-full hidden md:block",src:e.step.content.imageUrl,loading:"lazy"})})]})},Xs=e=>{var t,n,r;const{featureFlags:{marketplaceScheme:o}}=Xn(ho),{trace:i}=No(),[a,s]=qn(!1);Li((()=>{"name"in e.step&&i({type:"offer-viewed",offerName:e.step.name,data:e.step.metadata},{experiment:e.step.metadata.featureName,treatment:e.step.metadata.treatmentName})}));return fo(Ws,{children:[fo(Ws.Left,{children:fo("div",{children:fo(wi,{appear:!0,show:!0,enter:"transition duration-700 ease-out md:transition-none",enterFrom:"-translate-y-6",enterTo:"translate-y-0",children:fo("div",{children:[fo("img",{class:"mt-4 max-w-full w-full mx-auto md:hidden",src:e.step.content.mobileImageUrl,loading:"lazy"}),fo("div",{class:"md:max-w-[27.5rem]",children:[fo("h3",{class:"mt-8 md:mt-3 text-2xl md:text-3xl leading-8 md:leading-9 font-bold",children:e.step.content.title}),fo("p",{class:"mt-2 text-base md:text-lg leading-6 md:leading-7 text-gray-600 break-words",children:e.step.content.description}),e.step.content.details&&fo("div",{class:"mt-6 hidden md:block",children:fo(Ys,{items:e.step.content.details})})]}),e.step.content.details&&fo(Zs,{class:"mt-6 md:hidden",items:e.step.content.details}),"allowance"===o.scheme&&"offer"==(null==(t=e.step.content.specialBanner)?void 0:t.type)&&fo(Eo,{style:{background:"linear-gradient(90deg, rgba(255, 135, 111, 0.10) 0%, rgba(166, 80, 255, 0.10) 100%)"},className:"md:max-w-[27.5rem] mt-6",children:fo("div",{children:[fo("p",{className:"font-semibold text-lg leading-tight text-gray-900",children:e.step.content.specialBanner.title}),fo("span",{className:"font-normal text-sm text-gray-900",children:e.step.content.specialBanner.subtitle})]})}),e.children&&e.children,fo("div",{class:"flex flex-col md:flex-row md:justify-between gap-4 md:max-w-[27.5rem] mt-6 md:mt-11",children:fo(Co,{testId:`offer_${e.step.name}_button_accept`,class:e.primaryButton.class??"",onClickPromise:async()=>{"name"in e.step&&await i({type:"offer-progressed",offerName:e.step.name,data:{...e.step.metadata,template:"Simple"}},{experiment:e.step.metadata.featureName,treatment:e.step.metadata.treatmentName}),e.primaryButton.onClick()},children:e.primaryButton.text??"Next"})}),(null==(n=e.step.content.terms)?void 0:n.length)>0&&fo("p",{className:"mt-6 text-xs",children:[fo("span",{children:"*"}),fo("span",{className:"underline text-primary-base cursor-pointer",onClick:()=>s(!0),children:"T&C's apply"})]}),(null==(r=e.step.content.terms)?void 0:r.length)>0&&fo(vo,{open:a,children:[fo(bo,{children:fo("div",{className:"relative",children:[fo("h3",{className:"text-base font-semibold text-gray-900",children:"Terms & Conditions"}),fo("span",{className:"absolute top-0 right-0 p-1 rounded-full bg-gray-200 cursor-pointer hover:bg-gray-100",onClick:()=>s(!1),children:fo(Ma,{className:"h-4 min-h-4 max-h-4 w-4 min-w-4 max-w-4"})})]})}),fo(wo,{children:fo("div",{class:"flex flex-col gap-3 mt-6 text-gray-600 text-xs",children:e.step.content.terms.map(((e,t)=>fo("span",{dangerouslySetInnerHTML:{__html:qs.sanitize(e,{ADD_ATTR:["target"]})}},t)))})})]})]})})})}),fo(Ws.Right,{children:fo("img",{class:"max-w-[30rem] w-full hidden md:block",src:e.step.content.imageUrl,loading:"lazy"})})]})},Ks=({current:e,total:t})=>fo("div",{className:"flex justify-between md:block text-xs tracking-wide",children:fo("span",{className:"relative px-3 py-0.5 text-primary-base font-semibold",children:[e," OF ",t,fo("span",{className:"absolute left-0 rounded-xl bg-primary-base opacity-10 w-full h-[90%]"})]})}),Qs=e=>{const{getOffers:t,featureFlags:{marketplaceSubNavigation:n},offersProgress:{update:r,isOfferCompleted:o,isOfferProgressed:i}}=Xn(ho),[a,s]=qn(0),{trace:l}=No(),c=Jn(((n,o,i)=>{r(n,o,i),a===t().length-1?e.onComplete():s(a+1)}),[r,a,t,e]),u=Jn((e=>{s(e);const n=t()[e];l({type:"offer-selected",offerName:n.name},{experiment:n.metadata.featureName,treatment:n.metadata.treatmentName})}),[t,l]),d=(e,t,n)=>{const r=i(e);return!!o(e)||(!r||t!==n)&&!!r},p=t();return fo("div",{className:"max-w-[59.5rem] mx-auto",children:[!n&&fo(Ks,{current:a+1,total:p.length+1}),fo(Ua,{selectedIndex:a,onChange:u,children:[n&&p.map(((e,t)=>{var n,r;return fo(La,{label:null==(n=e.content)?void 0:n.productName,icon:fo(Pa,{icon:d(e.name,t,a)?fo(Ai,{}):null==(r=e.content)?void 0:r.iconUrl})},e.name)})),p.map((e=>{var t,n,r;return fo(Ia,{children:["Eoi"===(null==(t=e.content)?void 0:t.template)&&fo(Js,{step:e,primaryButton:{text:e.content.acceptButton,onClick:()=>c(e.name,!0,!0)},secondaryButton:{text:e.content.declineButton,onClick:()=>c(e.name,!1,!1)}}),"Simple"===(null==(n=e.content)?void 0:n.template)&&fo(Xs,{step:e,primaryButton:{text:e.content.acceptButton,onClick:()=>c(e.name,!0,!0)}}),"Assessment"===(null==(r=e.content)?void 0:r.template)&&fo(ja,{onStepComplete:(t,n)=>c(e.name,t,n),marketPlaceOffer:e},e.name)]},e.name)}))]})]})},el=()=>fo("div",{class:"flex justify-center",children:fo(xo,{size:"lg"})}),tl=(e=>t=>{const n=Gn(null),[r,o]=qn(),[i,a]=qn(!1);return Vn((()=>{(async()=>{const e=await Cn.workplaceBackend.getIdToken();o(e)})(),(()=>{if(n.current&&!n.current.querySelector("script[data-injected]")){const e=document.createElement("script"),t=yo(Cn.workplaceBackend.getBaseUrl());e.type="module",e.src=`https://npm-cdn.flarehr.com/@flarehr/benefits-plan-assessment@${t}/dist/benefits-plan-assessment.js`,e.dataset.injected="true",e.onload=()=>{a(!0)},n.current.appendChild(e)}else a(!0)})()}),[]),fo("div",{ref:n,className:r,children:r&&i?fo(e,{...t,accessToken:r}):fo(el,{})})})((e=>{const{hostInformation:t,benefitsPlanPersonalisationAssessmentId:n}=Xn(ho),r=Gn(null);return Li((()=>{r.current&&(r.current["on-complete"]=e.onComplete)})),fo("div",{className:"flex justify-center",children:fo("benefits-plan-assessment",{"base-url":Cn.workplaceBackend.getBaseUrl(),"profile-id":Cn.workplaceBackend.getProfileId(),"skip-intro":!0,"skip-more-details":!0,"skip-summary":!0,"access-token":e.accessToken,"assessment-id":n,"track-client":t.client,"track-source":t.source,"track-channel":t.channel,"track-experiment":t.experiment,"track-treatment":t.treatment,"assessment-title":"Personalise your benefits plan",description:"Setup your profile so that we can find the most relevant benefits for you","vertical-alignment":"items-center",ref:r})})})),nl=""+("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__dirname+"/assets/get-app-CQalMIl7.jpg").href:new URL("assets/get-app-CQalMIl7.jpg","undefined"==typeof document?location.href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||document.baseURI).href),rl=e=>v("svg",{width:36,height:42,viewBox:"0 0 36 42",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},v("path",{d:"M29.7406 21.8737C29.7406 18.5174 31.3138 16.0681 34.3678 14.1632C32.6094 11.714 30.0182 10.444 26.5941 10.1719C23.2625 9.89974 19.6532 11.9861 18.3576 11.9861C16.9694 11.9861 13.8229 10.2626 11.3242 10.2626C6.14176 10.3533 0.681641 14.2539 0.681641 22.3273C0.681641 24.6858 1.05182 27.135 1.97726 29.6749C3.18034 33.0312 7.43738 41.1953 11.8795 41.0139C14.1931 41.0139 15.8589 39.3811 18.9129 39.3811C21.8743 39.3811 23.355 41.0139 25.9463 41.0139C30.4809 41.0139 34.3678 33.5755 35.4783 30.2192C29.4629 27.4071 29.7406 22.0551 29.7406 21.8737ZM24.5581 6.99696C27.0568 4.09418 26.7792 1.37283 26.7792 0.375C24.5581 0.556424 21.9668 1.9171 20.4861 3.54991C18.8203 5.36415 17.8949 7.63194 18.08 10.0812C20.4861 10.2626 22.7072 9.08333 24.5581 6.99696Z",fill:"#9CA3AF"})),ol=e=>v("svg",{width:37,height:40,viewBox:"0 0 37 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},v("path",{d:"M24.1063 18.8401L6.78538 1.88173L28.8088 14.2567L24.1063 18.8401ZM2.318 0.888672C1.29913 1.42339 0.59375 2.41645 0.59375 3.63867V37.3262C0.59375 38.5484 1.29913 39.5415 2.318 39.9998L22.382 20.4442L2.318 0.888672ZM35.6274 18.1526L31.0033 15.5553L25.8305 20.4442L31.0033 25.4095L35.7058 22.8123C37.1165 21.7428 37.1165 19.222 35.6274 18.1526ZM6.78538 39.0067L28.8088 26.7081L24.1063 22.1248L6.78538 39.0067Z",fill:"#9CA3AF"})),il=""+("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__dirname+"/assets/get-app-mobile-DORYS6YR.jpg").href:new URL("assets/get-app-mobile-DORYS6YR.jpg","undefined"==typeof document?location.href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||document.baseURI).href),al=({onComplete:e})=>{const{trace:t}=No(),{identity:n,getIdentityRegistrationStatus:r,hostInformation:{experiment:o,treatment:i}}=Xn(ho);Vn((()=>{(async()=>{await t({type:"summary-viewed",data:{summaryVariant:"app"}},{experiment:o,treatment:i})})()}),[o,t,i]);const a={...sl(n,r()),imageUrl:nl,mobileImageUrl:il},s={text:"Continue",class:"mt-6 md:mt-14",onClick:async()=>{await t("completed",{experiment:o,treatment:i}),await e()}};return fo(Ws,{children:[fo(Ws.Left,{children:fo("div",{children:[fo("img",{class:"mt-4 max-w-full w-full mx-auto md:hidden",src:a.mobileImageUrl,loading:"lazy"}),fo("div",{class:"md:max-w-[27.5rem]",children:[fo("h3",{class:"mt-8 md:mt-3 text-2xl md:text-3xl leading-8 md:leading-9 font-bold",children:a.title}),fo("p",{class:"mt-2 text-base md:text-lg leading-6 md:leading-7 text-gray-600 break-words",children:a.description})]}),fo("div",{class:"mt-6 flex space-x-6",children:[fo(rl,{}),fo(ol,{})]}),fo(Co,{testId:"step-benefits-finish",class:s.class,onClickPromise:s.onClick,children:s.text})]})}),fo(Ws.Right,{children:fo("img",{class:"max-w-[30rem] w-full hidden md:block",src:a.imageUrl,loading:"lazy"})})]})},sl=(e,t)=>{switch(t){case"RegistrationAbandoned":return{title:"Join your workplace",description:`We’ve sent an email to ${e.email} with instructions on how to join your workplace. This will enable you to access all your workplace benefits through the Flare app in the future.`};case"NewlyRegistered":return{title:"Join your workplace’s benefits program",description:`We’ve sent an email to ${e.email} with instructions on how to download the Flare app - where your company’s benefits live.`};default:return{title:"Check your email",description:`We’ve sent an email to ${e.email} with instructions on how to download and activate the Flare App and Card.`}}},ll=""+("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__dirname+"/assets/all-set-vt2mQYDm.jpg").href:new URL("assets/all-set-vt2mQYDm.jpg","undefined"==typeof document?location.href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||document.baseURI).href),cl=""+("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__dirname+"/assets/all-set-mobile-Fhtje9HW.jpg").href:new URL("assets/all-set-mobile-Fhtje9HW.jpg","undefined"==typeof document?location.href:document.currentScript&&"SCRIPT"===document.currentScript.tagName.toUpperCase()&&document.currentScript.src||document.baseURI).href),ul=({onComplete:e})=>{const{trace:t}=No(),{getWorkplaceLinkingStatus:n,hostInformation:{experiment:r,treatment:o}}=Xn(ho);Vn((()=>{(async()=>{await t({type:"summary-viewed",data:{summaryVariant:"generic"}},{experiment:r,treatment:o})})()}),[r,o,t]);const i={imageUrl:ll,mobileImageUrl:cl,title:"You're all set!",description:"PreviouslyLinked"===n()?"You’ve already connected this employer with your Flare Benefits account. Simply continue and review the details you have provided to complete your onboarding.":"Simply continue and review the details you have provided to complete your onboarding."},a={text:"Continue",class:"mt-6 md:mt-6",onClick:async()=>{await t("completed",{experiment:r,treatment:o}),await e()}};return fo(Ws,{children:[fo(Ws.Left,{children:fo("div",{children:[fo("img",{class:"mt-4 max-w-full w-full mx-auto md:hidden",src:i.mobileImageUrl,loading:"lazy"}),fo("div",{class:"md:max-w-[27.5rem]",children:[fo("h3",{class:"mt-8 md:mt-3 text-2xl md:text-3xl leading-8 md:leading-9 font-bold",children:i.title}),fo("p",{class:"mt-2 text-base md:text-lg leading-6 md:leading-7 text-gray-600 break-words",children:i.description})]}),fo("div",{class:"flex flex-col md:flex-row md:justify-between gap-4 md:max-w-[27.5rem] mt-6 md:mt-11",children:fo(Co,{testId:"step-benefits-finish",class:a.class,onClickPromise:a.onClick,children:a.text})})]})}),fo(Ws.Right,{children:fo("img",{class:"max-w-[30rem] w-full hidden md:block",src:i.imageUrl,loading:"lazy"})})]})},dl=()=>{const{updateIdentity:e}=Xn(ho),{current:t,goNext:n}=function(){const{isAppEnabled:e,getIdentityRegistrationStatus:t,featureFlags:n}=Xn(ho),r=Zn((()=>"allowance"===n.marketplaceScheme.scheme?["Allowance_JoinBenefits","FlareAppIdentity","BenefitsPersonalisationAssessment","ConfigureBenefits","MarketplaceOffers","Allowance_BenefitsSummary"]:["Introduction","FlareAppIdentity","BenefitsPersonalisationAssessment","ConfigureBenefits","MarketplaceOffers",e?"SummaryApp":"SummaryGeneric"]),[n.marketplaceScheme.scheme,e]),[o,i]=qn(r[0]);Vn((()=>{i(r[0])}),[r]);const a=Jn((async()=>{if(r.indexOf(o)===r.length-1){const e=document.querySelector(fl),t=new CustomEvent("step-completion",{bubbles:!0});return null==e||e.dispatchEvent(t),void(await new Promise((e=>setTimeout(e,1e4))))}if("RegistrationAbandoned"!==t())try{const e=r.findIndex((e=>e===o)),t=r[e+1];return void i(t)}catch{}else i(r[r.length-1])}),[o,t,r]);return{current:o,goNext:a}}(),r=Jn((()=>{e(!0),n()}),[n,e]),o=Jn((()=>{e(!1),n()}),[n,e]);switch(t){case"Introduction":return fo(Oa,{onStepComplete:n});case"Allowance_JoinBenefits":return fo(Ci,{onContinue:n});case"FlareAppIdentity":return fo(Ta,{onSuccess:r,onDecline:o});case"BenefitsPersonalisationAssessment":return fo(tl,{onComplete:n});case"ConfigureBenefits":return fo(ua,{onComplete:n});case"MarketplaceOffers":return fo(Qs,{onComplete:n});case"Allowance_BenefitsSummary":return fo(Pi,{onContinue:n});case"SummaryApp":return fo(al,{onComplete:n});case"SummaryGeneric":return fo(ul,{onComplete:n});default:return fo(C,{})}},pl=()=>{const e=Xn(ho);return fo(C,{children:[fo(vo,{open:e.isFetching,children:fo(wo,{children:fo(xo,{size:"lg"})})}),e.isInitialized?fo(dl,{}):fo("div",{className:"fixed flex items-center justify-center top-0 bottom-0 left-0 right-0",children:fo(xo,{size:"lg"})})]})},fl="benefits-onboarding";!function(e,t,n,r){function o(){var t=Reflect.construct(HTMLElement,[],o);return t._vdomComponent=e,t._root=r&&r.shadow?t.attachShadow({mode:r.mode||"open"}):t,t}(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=X,o.prototype.attributeChangedCallback=Q,o.prototype.disconnectedCallback=ee,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach((function(e){Object.defineProperty(o.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})})),customElements.define(t,o)}((e=>{const[t,n]=qn(0);Vn((()=>le((()=>{n(t+1)}))),[t]);const r={backendUrl:e["backend-url"],accessToken:e["access-token"],workflowsInstanceId:e["workflows-instance-id"],workflowsJourneyType:e["journey-type"]},o={channel:"onboarding",client:"onboarding",source:(e=>{switch(e){case ne.BenefitsExisting:case ne.AppInvite:return"Invite";default:return"Onboarding"}})(r.workflowsJourneyType),experiment:"onboarding-marketplace-scheme",workflowsJourneyType:r.workflowsJourneyType,workflowsInstanceId:r.workflowsInstanceId};return Nn(r.backendUrl,r.accessToken,o),"prod"===yo(r.backendUrl)&&_o.init("p09arvzysr"),fo(C,{children:[fo("style",{children:ko.toString()}),fo("div",{class:"font-inter pt-6 pb-8 md:py-24 px-px",children:fo(go,{hostInformation:o,children:fo(pl,{})})},t)]})}),fl,[],{shadow:!0})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flarehr/apollo-benefits-onboarding",
3
- "version": "0.1.3337",
3
+ "version": "0.1.3339",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist/"