@flarehr/promoted-benefits-ui 1.0.270 → 1.0.271

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.
@@ -0,0 +1 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var ie,p,qe,R,Ee,Ge,ue,Je,V={},Ze=[],vt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,me=Array.isArray;function z(e,t){for(var n in t)e[n]=t[n];return e}function Ke(e){var t=e.parentNode;t&&t.removeChild(e)}function mt(e,t,n){var r,o,i,a={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?ie.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Y(e,a,r,o,null)}function Y(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++qe,__i:-1,__u:0};return o==null&&p.vnode!=null&&p.vnode(i),i}function $(e){return e.children}function ee(e,t){this.props=e,this.context=t}function A(e,t){if(t==null)return e.__?A(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?A(e):null}function Qe(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Qe(e)}}function de(e){(!e.__d&&(e.__d=!0)&&R.push(e)&&!oe.__r++||Ee!==p.debounceRendering)&&((Ee=p.debounceRendering)||Ge)(oe)}function oe(){var e,t,n,r,o,i,a,c,l;for(R.sort(ue);e=R.shift();)e.__d&&(t=R.length,r=void 0,i=(o=(n=e).__v).__e,c=[],l=[],(a=n.__P)&&((r=z({},o)).__v=o.__v+1,p.vnode&&p.vnode(r),ge(a,r,o,n.__n,a.ownerSVGElement!==void 0,32&o.__u?[i]:null,c,i??A(o),!!(32&o.__u),l),r.__v=o.__v,r.__.__k[r.__i]=r,tt(c,r,l),r.__e!=i&&Qe(r)),R.length>t&&R.sort(ue));oe.__r=0}function Ye(e,t,n,r,o,i,a,c,l,_,d){var s,f,u,y,S,b=r&&r.__k||Ze,v=t.length;for(n.__d=l,gt(n,t,b),l=n.__d,s=0;s<v;s++)(u=n.__k[s])!=null&&typeof u!="boolean"&&typeof u!="function"&&(f=u.__i===-1?V:b[u.__i]||V,u.__i=s,ge(e,u,f,o,i,a,c,l,_,d),y=u.__e,u.ref&&f.ref!=u.ref&&(f.ref&&ye(f.ref,null,u),d.push(u.ref,u.__c||y,u)),S==null&&y!=null&&(S=y),65536&u.__u||f.__k===u.__k?(y||f.__e!=l||(l=A(f)),l=et(u,l,e)):typeof u.type=="function"&&u.__d!==void 0?l=u.__d:y&&(l=y.nextSibling),u.__d=void 0,u.__u&=-196609);n.__d=l,n.__e=S}function gt(e,t,n){var r,o,i,a,c,l=t.length,_=n.length,d=_,s=0;for(e.__k=[],r=0;r<l;r++)a=r+s,(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Y(null,o,null,null,null):me(o)?Y($,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Y(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,c=yt(o,n,a,d),o.__i=c,i=null,c!==-1&&(d--,(i=n[c])&&(i.__u|=131072)),i==null||i.__v===null?(c==-1&&s--,typeof o.type!="function"&&(o.__u|=65536)):c!==a&&(c===a+1?s++:c>a?d>l-a?s+=c-a:s--:c<a?c==a-1&&(s=c-a):s=0,c!==r+s&&(o.__u|=65536))):(i=n[a])&&i.key==null&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=A(i)),fe(i,i,!1),n[a]=null,d--);if(d)for(r=0;r<_;r++)(i=n[r])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=A(i)),fe(i,i))}function et(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=et(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function yt(e,t,n,r){var o=e.key,i=e.type,a=n-1,c=n+1,l=t[n];if(l===null||l&&o==l.key&&i===l.type&&!(131072&l.__u))return n;if(r>(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||c<t.length;){if(a>=0){if((l=t[a])&&!(131072&l.__u)&&o==l.key&&i===l.type)return a;a--}if(c<t.length){if((l=t[c])&&!(131072&l.__u)&&o==l.key&&i===l.type)return c;c++}}return-1}function Te(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||vt.test(t)?n:n+"px"}function q(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Te(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Te(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?Oe:Ce,i)):e.removeEventListener(t,i?Oe:Ce,i);else{if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function Ce(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(p.event?p.event(e):e)}}function Oe(e){if(this.l)return this.l[e.type+!0](p.event?p.event(e):e)}function ge(e,t,n,r,o,i,a,c,l,_){var d,s,f,u,y,S,b,v,g,E,P,C,X,U,O,w=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[c=t.__e=n.__e]),(d=p.__b)&&d(t);e:if(typeof w=="function")try{if(v=t.props,g=(d=w.contextType)&&r[d.__c],E=d?g?g.props.value:d.__:r,n.__c?b=(s=t.__c=n.__c).__=s.__E:("prototype"in w&&w.prototype.render?t.__c=s=new w(v,E):(t.__c=s=new ee(v,E),s.constructor=w,s.render=xt),g&&g.sub(s),s.props=v,s.state||(s.state={}),s.context=E,s.__n=r,f=s.__d=!0,s.__h=[],s._sb=[]),s.__s==null&&(s.__s=s.state),w.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=z({},s.__s)),z(s.__s,w.getDerivedStateFromProps(v,s.__s))),u=s.props,y=s.state,s.__v=t,f)w.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(w.getDerivedStateFromProps==null&&v!==u&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(v,E),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(v,s.__s,E)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(s.props=v,s.state=s.__s,s.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(D){D&&(D.__=t)}),P=0;P<s._sb.length;P++)s.__h.push(s._sb[P]);s._sb=[],s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(v,s.__s,E),s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(u,y,S)})}if(s.context=E,s.props=v,s.__P=e,s.__e=!1,C=p.__r,X=0,"prototype"in w&&w.prototype.render){for(s.state=s.__s,s.__d=!1,C&&C(t),d=s.render(s.props,s.state,s.context),U=0;U<s._sb.length;U++)s.__h.push(s._sb[U]);s._sb=[]}else do s.__d=!1,C&&C(t),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++X<25);s.state=s.__s,s.getChildContext!=null&&(r=z(z({},r),s.getChildContext())),f||s.getSnapshotBeforeUpdate==null||(S=s.getSnapshotBeforeUpdate(u,y)),Ye(e,me(O=d!=null&&d.type===$&&d.key==null?d.props.children:d)?O:[O],t,n,r,o,i,a,c,l,_),s.base=t.__e,t.__u&=-161,s.__h.length&&a.push(s),b&&(s.__E=s.__=null)}catch(D){t.__v=null,l||i!=null?(t.__e=c,t.__u|=l?160:32,i[i.indexOf(c)]=null):(t.__e=n.__e,t.__k=n.__k),p.__e(D,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=bt(n.__e,t,n,r,o,i,a,l,_);(d=p.diffed)&&d(t)}function tt(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)ye(n[r],n[++r],n[++r]);p.__c&&p.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){p.__e(i,o.__v)}})}function bt(e,t,n,r,o,i,a,c,l){var _,d,s,f,u,y,S,b=n.props,v=t.props,g=t.type;if(g==="svg"&&(o=!0),i!=null){for(_=0;_<i.length;_++)if((u=i[_])&&"setAttribute"in u==!!g&&(g?u.localName===g:u.nodeType===3)){e=u,i[_]=null;break}}if(e==null){if(g===null)return document.createTextNode(v);e=o?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,v.is&&v),i=null,c=!1}if(g===null)b===v||c&&e.data===v||(e.data=v);else{if(i=i&&ie.call(e.childNodes),b=n.props||V,!c&&i!=null)for(b={},_=0;_<e.attributes.length;_++)b[(u=e.attributes[_]).name]=u.value;for(_ in b)u=b[_],_=="children"||(_=="dangerouslySetInnerHTML"?s=u:_==="key"||_ in v||q(e,_,null,u,o));for(_ in v)u=v[_],_=="children"?f=u:_=="dangerouslySetInnerHTML"?d=u:_=="value"?y=u:_=="checked"?S=u:_==="key"||c&&typeof u!="function"||b[_]===u||q(e,_,u,b[_],o);if(d)c||s&&(d.__html===s.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(s&&(e.innerHTML=""),Ye(e,me(f)?f:[f],t,n,r,o&&g!=="foreignObject",i,a,i?i[0]:n.__k&&A(n,0),c,l),i!=null)for(_=i.length;_--;)i[_]!=null&&Ke(i[_]);c||(_="value",y!==void 0&&(y!==e[_]||g==="progress"&&!y||g==="option"&&y!==b[_])&&q(e,_,y,b[_],!1),_="checked",S!==void 0&&S!==e[_]&&q(e,_,S,b[_],!1))}return e}function ye(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){p.__e(r,n)}}function fe(e,t,n){var r,o;if(p.unmount&&p.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ye(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){p.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&fe(r[o],t,n||typeof e.type!="function");n||e.__e==null||Ke(e.__e),e.__=e.__e=e.__d=void 0}function xt(e,t,n){return this.constructor(e,n)}function wt(e,t,n){var r,o,i,a;p.__&&p.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],a=[],ge(t,e=(!r&&n||t).__k=mt($,null,[e]),o||V,V,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?ie.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,a),tt(i,e,a)}function se(e,t){var n={__c:t="__cC"+Je++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&o.some(function(c){c.__e=!0,de(c)})},this.sub=function(a){o.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){o.splice(o.indexOf(a),1),c&&c.call(a)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}ie=Ze.slice,p={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(c){e=c}throw e}},qe=0,ee.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=z({},this.state),typeof e=="function"&&(e=e(z({},n),this.props)),e&&z(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),de(this))},ee.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),de(this))},ee.prototype.render=$,R=[],Ge=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ue=function(e,t){return e.__v.__b-t.__v.__b},oe.__r=0,Je=0;var kt=0;function h(e,t,n,r,o,i){var a,c,l={};for(c in t)c=="ref"?a=t[c]:l[c]=t[c];var _={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--kt,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(c in a)l[c]===void 0&&(l[c]=a[c]);return p.vnode&&p.vnode(_),_}var W,m,ae,ze,he=0,nt=[],te=[],x=p,Pe=x.__b,Re=x.__r,Ne=x.diffed,Be=x.__c,Ie=x.unmount,$e=x.__;function be(e,t){x.__h&&x.__h(m,e,he||t),he=0;var n=m.__H||(m.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:te}),n.__[e]}function M(e){return he=1,St(ot,e)}function St(e,t,n){var r=be(W++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ot(void 0,t),function(c){var l=r.__N?r.__N[0]:r.__[0],_=r.t(l,c);l!==_&&(r.__N=[_,r.__[1]],r.__c.setState({}))}],r.__c=m,!m.u)){var o=function(c,l,_){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(f){return!!f.__c});if(d.every(function(f){return!f.__N}))return!i||i.call(this,c,l,_);var s=!1;return d.forEach(function(f){if(f.__N){var u=f.__[0];f.__=f.__N,f.__N=void 0,u!==f.__[0]&&(s=!0)}}),!(!s&&r.__c.props===c)&&(!i||i.call(this,c,l,_))};m.u=!0;var i=m.shouldComponentUpdate,a=m.componentWillUpdate;m.componentWillUpdate=function(c,l,_){if(this.__e){var d=i;i=void 0,o(c,l,_),i=d}a&&a.call(this,c,l,_)},m.shouldComponentUpdate=o}return r.__N||r.__}function N(e,t){var n=be(W++,3);!x.__s&&Ct(n.__H,t)&&(n.__=e,n.i=t,m.__H.__h.push(n))}function rt(e){var t=m.context[e.__c],n=be(W++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(m)),t.props.value):e.__}function Et(){for(var e;e=nt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ne),e.__H.__h.forEach(pe),e.__H.__h=[]}catch(t){e.__H.__h=[],x.__e(t,e.__v)}}x.__b=function(e){m=null,Pe&&Pe(e)},x.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),$e&&$e(e,t)},x.__r=function(e){Re&&Re(e),W=0;var t=(m=e.__c).__H;t&&(ae===m?(t.__h=[],m.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=te,n.__N=n.i=void 0})):(t.__h.forEach(ne),t.__h.forEach(pe),t.__h=[],W=0)),ae=m},x.diffed=function(e){Ne&&Ne(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(nt.push(t)!==1&&ze===x.requestAnimationFrame||((ze=x.requestAnimationFrame)||Tt)(Et)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==te&&(n.__=n.__V),n.i=void 0,n.__V=te})),ae=m=null},x.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ne),n.__h=n.__h.filter(function(r){return!r.__||pe(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],x.__e(r,n.__v)}}),Be&&Be(e,t)},x.unmount=function(e){Ie&&Ie(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ne(r)}catch(o){t=o}}),n.__H=void 0,t&&x.__e(t,n.__v))};var Ae=typeof requestAnimationFrame=="function";function Tt(e){var t,n=function(){clearTimeout(r),Ae&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Ae&&(t=requestAnimationFrame(n))}function ne(e){var t=m,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),m=t}function pe(e){var t=m;e.__c=e.__(),m=t}function Ct(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function ot(e,t){return typeof t=="function"?t(e):t}let it=se({});const st=e=>it=se({...e}),Ot=()=>rt(it),zt=()=>{st({})},Pt=async(e,t,n,r)=>{const o=new Headers;o.append("Content-Type","application/x-www-form-urlencoded");let i;const a=new URLSearchParams;a.append("grant_type","authorization_code"),a.append("code",t),a.append("client_id",n),a.append("redirect_uri",r);const c=await fetch(`${e}/connect/token`,{method:"POST",headers:o,body:a});return c.ok&&(i=await c.json()),i},Rt=e=>{if(e)return{accessToken:e.access_token,isLoggedIn:!!e.access_token,expiresIn:e.expires_in}},Nt=e=>new URLSearchParams(window.location.search).get(e)??void 0,Bt=async e=>{const t=Nt("code"),n=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!(!e.identityUrl||!e.clientId||!t))return Rt(await Pt(e.identityUrl,t,e.clientId,n))};let at=se({});const It=e=>at=se({...e}),$t=()=>rt(at),At=async()=>{let e;const t=await fetch(`${window.location.origin}/promoted-benefits/app/v1.0/config.json`);return t.ok&&(e=await t.json()),e},ct=({path:e,children:t,className:n,onClick:r})=>e?h("a",{href:e,className:n,onClick:r,target:"_blank",rel:"noreferrer",children:t}):h("button",{type:"button",className:n,onClick:r,children:t}),Ut=({banner:e,path:t,onClick:n})=>h("div",{"data-testid":"banner",children:h(ct,{className:"font-['Inter'] bg-white grid grid-cols-12 overflow-hidden text-left card:hidden",path:t,onClick:n,children:[h("div",{className:"col-span-8 xl:col-span-10 lg:col-span-8 grid gap-1 my-auto items-start p-4",children:[h("h1",{className:"text-[#20303C] text-xs md:text-sm font-bold leading-4",children:e.title}),h("p",{className:"text-[#4D5963] text-[0.6875rem] leading-4 md:text-xs font-medium md:leading-5",children:[e.description,h("span",{className:"sm:block sm:pl-0 sm:pt-1 pl-1 pt-0 font-bold text-[#116DFF] whitespace-nowrap ",children:[h("span",{className:"underline underline-offset-2",children:e.buttonText}),h("span",{className:"no-underline",children:" -->"})]})]})]}),h("div",{className:"p-0 col-span-4 xl:col-span-2 lg:col-span-4 grid h-full auto-cols-max ml-auto justify-self-start overflow-hidden",children:h("img",{className:"w-52 h-full max-h-44 object-cover",src:e.imageUrl})})]})}),Dt="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11%203C10.4477%203%2010%203.44772%2010%204C10%204.55228%2010.4477%205%2011%205H13.5858L7.29289%2011.2929C6.90237%2011.6834%206.90237%2012.3166%207.29289%2012.7071C7.68342%2013.0976%208.31658%2013.0976%208.70711%2012.7071L15%206.41421V9C15%209.55228%2015.4477%2010%2016%2010C16.5523%2010%2017%209.55228%2017%209V4C17%203.44772%2016.5523%203%2016%203H11Z'%20fill='white'/%3e%3cpath%20d='M5%205C3.89543%205%203%205.89543%203%207V15C3%2016.1046%203.89543%2017%205%2017H13C14.1046%2017%2015%2016.1046%2015%2015V12C15%2011.4477%2014.5523%2011%2014%2011C13.4477%2011%2013%2011.4477%2013%2012V15H5V7L8%207C8.55228%207%209%206.55228%209%206C9%205.44772%208.55228%205%208%205H5Z'%20fill='white'/%3e%3c/svg%3e",Ht=({card:e,path:t,onClick:n})=>h("div",{"data-testid":"card",className:"px-8 pt-6 pb-4 bg-white rounded-lg flex-col justify-start items-center gap-5 hidden card:inline-flex",children:[h("div",{children:h("img",{className:"relative bg-white block max-h-[15.5625rem] max-w-[100%] h-auto",src:e.imageUrl})}),h("div",{className:"flex-col justify-start items-center gap-7 flex",children:[h("div",{className:"flex-col justify-start items-start gap-4 flex",children:h("div",{className:"self-stretch flex-col justify-start items-start gap-2 flex",children:[h("div",{className:"self-stretch text-[#143057] text-2xl font-bold font-['Inter'] leading-7",children:e.title}),h("div",{className:"self-stretch text-gray-900 text-base font-normal font-['Inter'] leading-normal",children:e.description})]})}),h(ct,{className:"self-stretch p-4 justify-center items-center bg-[#2e66f7] hover:bg-[#286090] rounded-md text-white text-base font-semibold font-['Inter'] leading-normal flex gap-2",path:t,onClick:n,children:[e.buttonText,h("img",{className:"self-center",src:Dt,alt:""})]})]})]}),Lt="fallback-econnex-energy",Mt={title:"Paying too much for energy?",description:"Compare plans in just a few minutes with Flare Benefits & Econnex, and you could save when you switch to a better deal.",buttonText:"Learn more",imageUrl:"./images/flare-energy-banner.png"},Ft={title:"Paying too much for energy?",description:"Compare plans in just a few minutes with Flare Benefits & Econnex, and you could save when you switch to a better deal.",buttonText:"Learn more",imageUrl:"./images/flare-energy-card.png"},Vt={type:"Public",path:"https://econnex.com.au/?rc=862160&utm_source=promoted_benefits&utm_medium=fallback&utm_campaign=energy_alwayson&utm_content=energy_intialoffer"},G={id:Lt,banner:Mt,card:Ft,action:Vt},Wt=async(e,t)=>{if(!e||!t)return L();const n=`${e}/promoted-benefits/backend`,r=await fetch(`${n}/v1.0/promotion`,{headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.271"}});if(r.status===204)return L();let o;if(r.ok)try{o=await r.json()}catch(i){return console.error(`Error parsing promotion response: ${i}`),L()}return!o||Object.keys(o).length===0?L():o},L=()=>({action:G.action,banner:G.banner,card:G.card,id:G.id}),jt=e=>{const t=sessionStorage.getItem(e);return t?JSON.parse(t):void 0},Xt=(e,t)=>{sessionStorage.setItem(e,JSON.stringify(t))};var k=[];for(var ce=0;ce<256;++ce)k.push((ce+256).toString(16).slice(1));function qt(e,t=0){return(k[e[t+0]]+k[e[t+1]]+k[e[t+2]]+k[e[t+3]]+"-"+k[e[t+4]]+k[e[t+5]]+"-"+k[e[t+6]]+k[e[t+7]]+"-"+k[e[t+8]]+k[e[t+9]]+"-"+k[e[t+10]]+k[e[t+11]]+k[e[t+12]]+k[e[t+13]]+k[e[t+14]]+k[e[t+15]]).toLowerCase()}var J,Gt=new Uint8Array(16);function Jt(){if(!J&&(J=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!J))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return J(Gt)}var Zt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Ue={randomUUID:Zt};function Kt(e,t,n){if(Ue.randomUUID&&!t&&!e)return Ue.randomUUID();e=e||{};var r=e.random||(e.rng||Jt)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return qt(r)}const xe=()=>{const e=jt("distinctId");if(!e){const t=Kt();return Xt("distinctId",t),t}return e},Qt=async e=>{e&&we(e,{eventName:"appLoaded",distinctId:xe()})},Yt=async(e,t,n)=>{if(!e)return;if(!t)return we(e,{eventName:"promotionViewed",promotionId:n,distinctId:xe()});const r=`${e}/promoted-benefits/backend`;await fetch(`${r}/v1.0/promotion/${n}/view`,{method:"POST",headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.271"}})},en=async(e,t,n)=>{var o;if(!e)return;if(!t)return we(e,{eventName:"promotionActioned",promotionId:n==null?void 0:n.id,actionUrl:(o=n==null?void 0:n.action)==null?void 0:o.path,distinctId:xe()});const r=`${e}/promoted-benefits/backend`;await fetch(`${r}/v1.0/promotion/${n==null?void 0:n.id}/action`,{method:"POST",body:JSON.stringify(n==null?void 0:n.action),headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.271"}})},we=async(e,t)=>{const n=`${e}/promoted-benefits/public`;await fetch(`${n}/v1.0/track`,{method:"POST",body:JSON.stringify(t),headers:{"X-APP-VERSION":"1.0.271"}})},tn=async(e,t)=>{let n;const r=await fetch(e,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});return r.ok&&(n=await r.json()),n},nn=(e,t,n,r)=>{const o=document.referrer;return`${e}/app/?token=${t}&redirectPath=${n}&referrer=${o}&promotionId=${r}`},rn=async(e,t,n,r)=>{const o=`${e==null?void 0:e.apolloBaseUrl}/benefits`;if(!o||!n||!t||!r)return;const i=await tn(`${o}/backend/v1.0/current/token`,t);if(!(!i||!i.token))return nn(o,i.token,n,r)},on=async(e,t,n)=>{let r;switch(e.action.type.toLowerCase()){case"benefits":return r=await rn(t,n.accessToken,e.action.path,e.id),{path:void 0,onClick:()=>{const i=window.open();i&&r&&(i.location=r)}};case"public":return{path:e.action.path,onClick:void 0};default:return}},sn=()=>{const e=Ot(),t=$t(),[n,r]=M(),[o,i]=M();N(()=>{(async()=>{const c=await Wt(t==null?void 0:t.apolloBaseUrl,e==null?void 0:e.accessToken);r(c),Yt(t.apolloBaseUrl,e.accessToken,c==null?void 0:c.id)})()},[t.apolloBaseUrl,e.accessToken]),N(()=>{if(e&&e.expiresIn){const c=1e3*e.expiresIn,l=setTimeout(()=>{const _=L();r(_),zt()},c);return()=>clearTimeout(l)}},[n,e]),N(()=>{(async()=>n&&i(await on(n,t,e)))()},[t,e,n]);const a=()=>{o!=null&&o.onClick&&(o==null||o.onClick()),en(t.apolloBaseUrl,e.accessToken,n)};return n?h($,{children:[h(Ut,{banner:n.banner,path:o==null?void 0:o.path,onClick:a}),h(Ht,{card:n.card,path:o==null?void 0:o.path,onClick:a})]}):h($,{})};var B=[],an=function(){return B.some(function(e){return e.activeTargets.length>0})},cn=function(){return B.some(function(e){return e.skippedTargets.length>0})},De="ResizeObserver loop completed with undelivered notifications.",_n=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:De}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=De),window.dispatchEvent(e)},j;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(j||(j={}));var I=function(e){return Object.freeze(e)},ln=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,I(this)}return e}(),_t=function(){function e(t,n,r,o){return this.x=t,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,I(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,o=t.top,i=t.right,a=t.bottom,c=t.left,l=t.width,_=t.height;return{x:n,y:r,top:o,right:i,bottom:a,left:c,width:l,height:_}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),ke=function(e){return e instanceof SVGElement&&"getBBox"in e},lt=function(e){if(ke(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||e.getClientRects().length)},He=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},un=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},F=typeof window<"u"?window:{},Z=new WeakMap,Le=/auto|scroll/,dn=/^tb|vertical/,fn=/msie|trident/i.test(F.navigator&&F.navigator.userAgent),T=function(e){return parseFloat(e||"0")},H=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new ln((n?t:e)||0,(n?e:t)||0)},Me=I({devicePixelContentBoxSize:H(),borderBoxSize:H(),contentBoxSize:H(),contentRect:new _t(0,0,0,0)}),ut=function(e,t){if(t===void 0&&(t=!1),Z.has(e)&&!t)return Z.get(e);if(lt(e))return Z.set(e,Me),Me;var n=getComputedStyle(e),r=ke(e)&&e.ownerSVGElement&&e.getBBox(),o=!fn&&n.boxSizing==="border-box",i=dn.test(n.writingMode||""),a=!r&&Le.test(n.overflowY||""),c=!r&&Le.test(n.overflowX||""),l=r?0:T(n.paddingTop),_=r?0:T(n.paddingRight),d=r?0:T(n.paddingBottom),s=r?0:T(n.paddingLeft),f=r?0:T(n.borderTopWidth),u=r?0:T(n.borderRightWidth),y=r?0:T(n.borderBottomWidth),S=r?0:T(n.borderLeftWidth),b=s+_,v=l+d,g=S+u,E=f+y,P=c?e.offsetHeight-E-e.clientHeight:0,C=a?e.offsetWidth-g-e.clientWidth:0,X=o?b+g:0,U=o?v+E:0,O=r?r.width:T(n.width)-X-C,w=r?r.height:T(n.height)-U-P,D=O+b+C+g,pt=w+v+P+E,Se=I({devicePixelContentBoxSize:H(Math.round(O*devicePixelRatio),Math.round(w*devicePixelRatio),i),borderBoxSize:H(D,pt,i),contentBoxSize:H(O,w,i),contentRect:new _t(s,l,O,w)});return Z.set(e,Se),Se},dt=function(e,t,n){var r=ut(e,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case j.DEVICE_PIXEL_CONTENT_BOX:return a;case j.BORDER_BOX:return o;default:return i}},hn=function(){function e(t){var n=ut(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=I([n.borderBoxSize]),this.contentBoxSize=I([n.contentBoxSize]),this.devicePixelContentBoxSize=I([n.devicePixelContentBoxSize])}return e}(),ft=function(e){if(lt(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},pn=function(){var e=1/0,t=[];B.forEach(function(a){if(a.activeTargets.length!==0){var c=[];a.activeTargets.forEach(function(_){var d=new hn(_.target),s=ft(_.target);c.push(d),_.lastReportedSize=dt(_.target,_.observedBox),s<e&&(e=s)}),t.push(function(){a.callback.call(a.observer,c,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var o=r[n];o()}return e},Fe=function(e){B.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&(ft(o.target)>e?n.activeTargets.push(o):n.skippedTargets.push(o))})})},vn=function(){var e=0;for(Fe(e);an();)e=pn(),Fe(e);return cn()&&_n(),e>0},_e,ht=[],mn=function(){return ht.splice(0).forEach(function(e){return e()})},gn=function(e){if(!_e){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return mn()}).observe(n,r),_e=function(){n.textContent="".concat(t?t--:t++)}}ht.push(e),_e()},yn=function(e){gn(function(){requestAnimationFrame(e)})},re=0,bn=function(){return!!re},xn=250,wn={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ve=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],We=function(e){return e===void 0&&(e=0),Date.now()+e},le=!1,kn=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=xn),!le){le=!0;var r=We(t);yn(function(){var o=!1;try{o=vn()}finally{if(le=!1,t=r-We(),!bn())return;o?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,wn)};document.body?n():F.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ve.forEach(function(n){return F.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ve.forEach(function(n){return F.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),ve=new kn,je=function(e){!re&&e>0&&ve.start(),re+=e,!re&&ve.stop()},Sn=function(e){return!ke(e)&&!un(e)&&getComputedStyle(e).display==="inline"},En=function(){function e(t,n){this.target=t,this.observedBox=n||j.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=dt(this.target,this.observedBox,!0);return Sn(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Tn=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),K=new WeakMap,Xe=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Q=function(){function e(){}return e.connect=function(t,n){var r=new Tn(t,n);K.set(t,r)},e.observe=function(t,n,r){var o=K.get(t),i=o.observationTargets.length===0;Xe(o.observationTargets,n)<0&&(i&&B.push(o),o.observationTargets.push(new En(n,r&&r.box)),je(1),ve.schedule())},e.unobserve=function(t,n){var r=K.get(t),o=Xe(r.observationTargets,n),i=r.observationTargets.length===1;o>=0&&(i&&B.splice(B.indexOf(r),1),r.observationTargets.splice(o,1),je(-1))},e.disconnect=function(t){var n=this,r=K.get(t);r.observationTargets.slice().forEach(function(o){return n.unobserve(t,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Cn=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Q.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!He(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Q.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!He(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Q.unobserve(this,t)},e.prototype.disconnect=function(){Q.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();const On=e=>{if(e){const t=1e3*e,n={sender:"flare",type:"promotionsSessionExpired"};setTimeout(()=>{window.parent.postMessage(n,"*")},t)}},zn=(e,t)=>{if(e&&t){const n=1e3*e,r=1e3*60*5,o={expiry:t,sender:"flare",type:"promotionsSessionExpiring"};setTimeout(()=>{window.parent.postMessage(o,"*")},n-r)}},Pn=()=>{const t={height:Math.min(document.body.offsetHeight,220),sender:"flare",type:"contentResized"};window.parent.postMessage(t,"*")},Rn=()=>{new Cn(()=>{Pn()}).observe(document.body)},Nn=e=>{try{const n=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=atob(n);return JSON.parse(r)}catch{return}},Bn=()=>{const[e,t]=M({}),[n,r]=M(),[o,i]=M(!1);return st(e),N(()=>{(async()=>{const a=await At();a&&(It(a),r(a))})()},[]),N(()=>{(async()=>{if(!o&&n){Qt(n.apolloBaseUrl);const a=await Bt(n);a&&t(a),i(!0)}})()},[n,o]),N(()=>{if(e.expiresIn&&e.accessToken){const a=Nn(e.accessToken);On(e.expiresIn),zn(e.expiresIn,a==null?void 0:a.exp)}},[e]),N(()=>{Rn()},[]),o?h("div",{className:"flex items-center justify-center min-h-[100px]",children:h(sn,{})}):h($,{})};wt(h(Bn,{}),document.body);
package/dist/index.html CHANGED
@@ -9,12 +9,12 @@
9
9
  margin: 0;
10
10
  }
11
11
  </style>
12
- <script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-mmijXFWV.js"></script>
12
+ <script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-wDnojKRI.js"></script>
13
13
  <link rel="stylesheet" crossorigin href="/promoted-benefits/app/v1.0/assets/index-Bu-1sSpn.css">
14
14
  </head>
15
15
  <body>
16
16
  <script>
17
- const appVersion = "1.0.270";
17
+ const appVersion = "1.0.271";
18
18
  const getSanitizedEnv = () => window.location.hostname.toLocaleLowerCase().replace(/[^.a-z]/, '');
19
19
  const getAppVersion = () => appVersion.toLocaleLowerCase().replace(/[^0-9a-z.]/, '');
20
20
  (function(h,o,u,n,d) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flarehr/promoted-benefits-ui",
3
- "version": "1.0.270",
3
+ "version": "1.0.271",
4
4
  "description": "Flare Promoted Benefits",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -19,7 +19,8 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@juggle/resize-observer": "^3.4.0",
22
- "preact": "^10.16.0"
22
+ "preact": "^10.16.0",
23
+ "uuid": "^10.0.0"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@babel/plugin-transform-react-jsx": "^7.23.4",
@@ -30,6 +31,7 @@
30
31
  "@testing-library/jest-dom": "^6.4.0",
31
32
  "@testing-library/preact": "^3.2.3",
32
33
  "@types/jest": "^29.5.3",
34
+ "@types/uuid": "^10.0.0",
33
35
  "@typescript-eslint/eslint-plugin": "^7.4.0",
34
36
  "@typescript-eslint/parser": "^7.4.0",
35
37
  "babel-jest": "^29.7.0",
@@ -1 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var re,p,Me,P,ye,Fe,ce,Ve,F={},We=[],lt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,he=Array.isArray;function O(e,t){for(var n in t)e[n]=t[n];return e}function je(e){var t=e.parentNode;t&&t.removeChild(e)}function ut(e,t,n){var r,o,i,a={};for(i in t)i=="key"?r=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?re.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return K(e,a,r,o,null)}function K(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++Me,__i:-1,__u:0};return o==null&&p.vnode!=null&&p.vnode(i),i}function $(e){return e.children}function Q(e,t){this.props=e,this.context=t}function A(e,t){if(t==null)return e.__?A(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?A(e):null}function Xe(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Xe(e)}}function _e(e){(!e.__d&&(e.__d=!0)&&P.push(e)&&!ne.__r++||ye!==p.debounceRendering)&&((ye=p.debounceRendering)||Fe)(ne)}function ne(){var e,t,n,r,o,i,a,c,l;for(P.sort(ce);e=P.shift();)e.__d&&(t=P.length,r=void 0,i=(o=(n=e).__v).__e,c=[],l=[],(a=n.__P)&&((r=O({},o)).__v=o.__v+1,p.vnode&&p.vnode(r),pe(a,r,o,n.__n,a.ownerSVGElement!==void 0,32&o.__u?[i]:null,c,i??A(o),!!(32&o.__u),l),r.__v=o.__v,r.__.__k[r.__i]=r,Je(c,r,l),r.__e!=i&&Xe(r)),P.length>t&&P.sort(ce));ne.__r=0}function qe(e,t,n,r,o,i,a,c,l,_,f){var s,d,u,b,k,y=r&&r.__k||We,v=t.length;for(n.__d=l,ft(n,t,y),l=n.__d,s=0;s<v;s++)(u=n.__k[s])!=null&&typeof u!="boolean"&&typeof u!="function"&&(d=u.__i===-1?F:y[u.__i]||F,u.__i=s,pe(e,u,d,o,i,a,c,l,_,f),b=u.__e,u.ref&&d.ref!=u.ref&&(d.ref&&ve(d.ref,null,u),f.push(u.ref,u.__c||b,u)),k==null&&b!=null&&(k=b),65536&u.__u||d.__k===u.__k?(b||d.__e!=l||(l=A(d)),l=Ge(u,l,e)):typeof u.type=="function"&&u.__d!==void 0?l=u.__d:b&&(l=b.nextSibling),u.__d=void 0,u.__u&=-196609);n.__d=l,n.__e=k}function ft(e,t,n){var r,o,i,a,c,l=t.length,_=n.length,f=_,s=0;for(e.__k=[],r=0;r<l;r++)a=r+s,(o=e.__k[r]=(o=t[r])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?K(null,o,null,null,null):he(o)?K($,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?K(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,c=dt(o,n,a,f),o.__i=c,i=null,c!==-1&&(f--,(i=n[c])&&(i.__u|=131072)),i==null||i.__v===null?(c==-1&&s--,typeof o.type!="function"&&(o.__u|=65536)):c!==a&&(c===a+1?s++:c>a?f>l-a?s+=c-a:s--:c<a?c==a-1&&(s=c-a):s=0,c!==r+s&&(o.__u|=65536))):(i=n[a])&&i.key==null&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=A(i)),le(i,i,!1),n[a]=null,f--);if(f)for(r=0;r<_;r++)(i=n[r])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=A(i)),le(i,i))}function Ge(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Ge(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function dt(e,t,n,r){var o=e.key,i=e.type,a=n-1,c=n+1,l=t[n];if(l===null||l&&o==l.key&&i===l.type&&!(131072&l.__u))return n;if(r>(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||c<t.length;){if(a>=0){if((l=t[a])&&!(131072&l.__u)&&o==l.key&&i===l.type)return a;a--}if(c<t.length){if((l=t[c])&&!(131072&l.__u)&&o==l.key&&i===l.type)return c;c++}}return-1}function xe(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||lt.test(t)?n:n+"px"}function X(e,t,n,r,o){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||xe(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||xe(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?ke:we,i)):e.removeEventListener(t,i?ke:we,i);else{if(o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function we(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(p.event?p.event(e):e)}}function ke(e){if(this.l)return this.l[e.type+!0](p.event?p.event(e):e)}function pe(e,t,n,r,o,i,a,c,l,_){var f,s,d,u,b,k,y,v,g,E,z,T,j,H,S,w=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[c=t.__e=n.__e]),(f=p.__b)&&f(t);e:if(typeof w=="function")try{if(v=t.props,g=(f=w.contextType)&&r[f.__c],E=f?g?g.props.value:f.__:r,n.__c?y=(s=t.__c=n.__c).__=s.__E:("prototype"in w&&w.prototype.render?t.__c=s=new w(v,E):(t.__c=s=new Q(v,E),s.constructor=w,s.render=pt),g&&g.sub(s),s.props=v,s.state||(s.state={}),s.context=E,s.__n=r,d=s.__d=!0,s.__h=[],s._sb=[]),s.__s==null&&(s.__s=s.state),w.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=O({},s.__s)),O(s.__s,w.getDerivedStateFromProps(v,s.__s))),u=s.props,b=s.state,s.__v=t,d)w.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(w.getDerivedStateFromProps==null&&v!==u&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(v,E),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(v,s.__s,E)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(s.props=v,s.state=s.__s,s.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(I){I&&(I.__=t)}),z=0;z<s._sb.length;z++)s.__h.push(s._sb[z]);s._sb=[],s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(v,s.__s,E),s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(u,b,k)})}if(s.context=E,s.props=v,s.__P=e,s.__e=!1,T=p.__r,j=0,"prototype"in w&&w.prototype.render){for(s.state=s.__s,s.__d=!1,T&&T(t),f=s.render(s.props,s.state,s.context),H=0;H<s._sb.length;H++)s.__h.push(s._sb[H]);s._sb=[]}else do s.__d=!1,T&&T(t),f=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++j<25);s.state=s.__s,s.getChildContext!=null&&(r=O(O({},r),s.getChildContext())),d||s.getSnapshotBeforeUpdate==null||(k=s.getSnapshotBeforeUpdate(u,b)),qe(e,he(S=f!=null&&f.type===$&&f.key==null?f.props.children:f)?S:[S],t,n,r,o,i,a,c,l,_),s.base=t.__e,t.__u&=-161,s.__h.length&&a.push(s),y&&(s.__E=s.__=null)}catch(I){t.__v=null,l||i!=null?(t.__e=c,t.__u|=l?160:32,i[i.indexOf(c)]=null):(t.__e=n.__e,t.__k=n.__k),p.__e(I,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=ht(n.__e,t,n,r,o,i,a,l,_);(f=p.diffed)&&f(t)}function Je(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)ve(n[r],n[++r],n[++r]);p.__c&&p.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){p.__e(i,o.__v)}})}function ht(e,t,n,r,o,i,a,c,l){var _,f,s,d,u,b,k,y=n.props,v=t.props,g=t.type;if(g==="svg"&&(o=!0),i!=null){for(_=0;_<i.length;_++)if((u=i[_])&&"setAttribute"in u==!!g&&(g?u.localName===g:u.nodeType===3)){e=u,i[_]=null;break}}if(e==null){if(g===null)return document.createTextNode(v);e=o?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,v.is&&v),i=null,c=!1}if(g===null)y===v||c&&e.data===v||(e.data=v);else{if(i=i&&re.call(e.childNodes),y=n.props||F,!c&&i!=null)for(y={},_=0;_<e.attributes.length;_++)y[(u=e.attributes[_]).name]=u.value;for(_ in y)u=y[_],_=="children"||(_=="dangerouslySetInnerHTML"?s=u:_==="key"||_ in v||X(e,_,null,u,o));for(_ in v)u=v[_],_=="children"?d=u:_=="dangerouslySetInnerHTML"?f=u:_=="value"?b=u:_=="checked"?k=u:_==="key"||c&&typeof u!="function"||y[_]===u||X(e,_,u,y[_],o);if(f)c||s&&(f.__html===s.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(s&&(e.innerHTML=""),qe(e,he(d)?d:[d],t,n,r,o&&g!=="foreignObject",i,a,i?i[0]:n.__k&&A(n,0),c,l),i!=null)for(_=i.length;_--;)i[_]!=null&&je(i[_]);c||(_="value",b!==void 0&&(b!==e[_]||g==="progress"&&!b||g==="option"&&b!==y[_])&&X(e,_,b,y[_],!1),_="checked",k!==void 0&&k!==e[_]&&X(e,_,k,y[_],!1))}return e}function ve(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){p.__e(r,n)}}function le(e,t,n){var r,o;if(p.unmount&&p.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ve(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){p.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&le(r[o],t,n||typeof e.type!="function");n||e.__e==null||je(e.__e),e.__=e.__e=e.__d=void 0}function pt(e,t,n){return this.constructor(e,n)}function vt(e,t,n){var r,o,i,a;p.__&&p.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,i=[],a=[],pe(t,e=(!r&&n||t).__k=ut($,null,[e]),o||F,F,t.ownerSVGElement!==void 0,!r&&n?[n]:o?null:t.firstChild?re.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,a),Je(i,e,a)}function oe(e,t){var n={__c:t="__cC"+Ve++,__:e,Consumer:function(r,o){return r.children(o)},Provider:function(r){var o,i;return this.getChildContext||(o=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&o.some(function(c){c.__e=!0,_e(c)})},this.sub=function(a){o.push(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){o.splice(o.indexOf(a),1),c&&c.call(a)}}),r.children}};return n.Provider.__=n.Consumer.contextType=n}re=We.slice,p={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(c){e=c}throw e}},Me=0,Q.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=O({},this.state),typeof e=="function"&&(e=e(O({},n),this.props)),e&&O(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),_e(this))},Q.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_e(this))},Q.prototype.render=$,P=[],Fe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ce=function(e,t){return e.__v.__b-t.__v.__b},ne.__r=0,Ve=0;var mt=0;function h(e,t,n,r,o,i){var a,c,l={};for(c in t)c=="ref"?a=t[c]:l[c]=t[c];var _={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--mt,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(c in a)l[c]===void 0&&(l[c]=a[c]);return p.vnode&&p.vnode(_),_}var V,m,ie,Ee,ue=0,Ze=[],Y=[],x=p,Ce=x.__b,Te=x.__r,Se=x.diffed,Oe=x.__c,ze=x.unmount,Pe=x.__;function me(e,t){x.__h&&x.__h(m,e,ue||t),ue=0;var n=m.__H||(m.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Y}),n.__[e]}function U(e){return ue=1,gt(Qe,e)}function gt(e,t,n){var r=me(V++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Qe(void 0,t),function(c){var l=r.__N?r.__N[0]:r.__[0],_=r.t(l,c);l!==_&&(r.__N=[_,r.__[1]],r.__c.setState({}))}],r.__c=m,!m.u)){var o=function(c,l,_){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(d){return!!d.__c});if(f.every(function(d){return!d.__N}))return!i||i.call(this,c,l,_);var s=!1;return f.forEach(function(d){if(d.__N){var u=d.__[0];d.__=d.__N,d.__N=void 0,u!==d.__[0]&&(s=!0)}}),!(!s&&r.__c.props===c)&&(!i||i.call(this,c,l,_))};m.u=!0;var i=m.shouldComponentUpdate,a=m.componentWillUpdate;m.componentWillUpdate=function(c,l,_){if(this.__e){var f=i;i=void 0,o(c,l,_),i=f}a&&a.call(this,c,l,_)},m.shouldComponentUpdate=o}return r.__N||r.__}function R(e,t){var n=me(V++,3);!x.__s&&xt(n.__H,t)&&(n.__=e,n.i=t,m.__H.__h.push(n))}function Ke(e){var t=m.context[e.__c],n=me(V++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(m)),t.props.value):e.__}function bt(){for(var e;e=Ze.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ee),e.__H.__h.forEach(fe),e.__H.__h=[]}catch(t){e.__H.__h=[],x.__e(t,e.__v)}}x.__b=function(e){m=null,Ce&&Ce(e)},x.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Pe&&Pe(e,t)},x.__r=function(e){Te&&Te(e),V=0;var t=(m=e.__c).__H;t&&(ie===m?(t.__h=[],m.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Y,n.__N=n.i=void 0})):(t.__h.forEach(ee),t.__h.forEach(fe),t.__h=[],V=0)),ie=m},x.diffed=function(e){Se&&Se(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ze.push(t)!==1&&Ee===x.requestAnimationFrame||((Ee=x.requestAnimationFrame)||yt)(bt)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Y&&(n.__=n.__V),n.i=void 0,n.__V=Y})),ie=m=null},x.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ee),n.__h=n.__h.filter(function(r){return!r.__||fe(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],x.__e(r,n.__v)}}),Oe&&Oe(e,t)},x.unmount=function(e){ze&&ze(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ee(r)}catch(o){t=o}}),n.__H=void 0,t&&x.__e(t,n.__v))};var Re=typeof requestAnimationFrame=="function";function yt(e){var t,n=function(){clearTimeout(r),Re&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Re&&(t=requestAnimationFrame(n))}function ee(e){var t=m,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),m=t}function fe(e){var t=m;e.__c=e.__(),m=t}function xt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Qe(e,t){return typeof t=="function"?t(e):t}let Ye=oe({});const et=e=>Ye=oe({...e}),wt=()=>Ke(Ye),kt=()=>{et({})},Et=async(e,t,n,r)=>{const o=new Headers;o.append("Content-Type","application/x-www-form-urlencoded");let i;const a=new URLSearchParams;a.append("grant_type","authorization_code"),a.append("code",t),a.append("client_id",n),a.append("redirect_uri",r);const c=await fetch(`${e}/connect/token`,{method:"POST",headers:o,body:a});return c.ok&&(i=await c.json()),i},Ct=e=>{if(e)return{accessToken:e.access_token,isLoggedIn:!!e.access_token,expiresIn:e.expires_in}},Tt=e=>new URLSearchParams(window.location.search).get(e)??void 0,St=async e=>{const t=Tt("code"),n=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!(!e.identityUrl||!e.clientId||!t))return Ct(await Et(e.identityUrl,t,e.clientId,n))};let tt=oe({});const Ot=e=>tt=oe({...e}),zt=()=>Ke(tt),Pt=async()=>{let e;const t=await fetch(`${window.location.origin}/promoted-benefits/app/v1.0/config.json`);return t.ok&&(e=await t.json()),e},nt=({path:e,children:t,className:n,onClick:r})=>e?h("a",{href:e,className:n,onClick:r,target:"_blank",rel:"noreferrer",children:t}):h("button",{type:"button",className:n,onClick:r,children:t}),Rt=({banner:e,path:t,onClick:n})=>h("div",{"data-testid":"banner",children:h(nt,{className:"font-['Inter'] bg-white grid grid-cols-12 overflow-hidden text-left card:hidden",path:t,onClick:n,children:[h("div",{className:"col-span-8 xl:col-span-10 lg:col-span-8 grid gap-1 my-auto items-start p-4",children:[h("h1",{className:"text-[#20303C] text-xs md:text-sm font-bold leading-4",children:e.title}),h("p",{className:"text-[#4D5963] text-[0.6875rem] leading-4 md:text-xs font-medium md:leading-5",children:[e.description,h("span",{className:"sm:block sm:pl-0 sm:pt-1 pl-1 pt-0 font-bold text-[#116DFF] whitespace-nowrap ",children:[h("span",{className:"underline underline-offset-2",children:e.buttonText}),h("span",{className:"no-underline",children:" -->"})]})]})]}),h("div",{className:"p-0 col-span-4 xl:col-span-2 lg:col-span-4 grid h-full auto-cols-max ml-auto justify-self-start overflow-hidden",children:h("img",{className:"w-52 h-full max-h-44 object-cover",src:e.imageUrl})})]})}),Bt="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11%203C10.4477%203%2010%203.44772%2010%204C10%204.55228%2010.4477%205%2011%205H13.5858L7.29289%2011.2929C6.90237%2011.6834%206.90237%2012.3166%207.29289%2012.7071C7.68342%2013.0976%208.31658%2013.0976%208.70711%2012.7071L15%206.41421V9C15%209.55228%2015.4477%2010%2016%2010C16.5523%2010%2017%209.55228%2017%209V4C17%203.44772%2016.5523%203%2016%203H11Z'%20fill='white'/%3e%3cpath%20d='M5%205C3.89543%205%203%205.89543%203%207V15C3%2016.1046%203.89543%2017%205%2017H13C14.1046%2017%2015%2016.1046%2015%2015V12C15%2011.4477%2014.5523%2011%2014%2011C13.4477%2011%2013%2011.4477%2013%2012V15H5V7L8%207C8.55228%207%209%206.55228%209%206C9%205.44772%208.55228%205%208%205H5Z'%20fill='white'/%3e%3c/svg%3e",Nt=({card:e,path:t,onClick:n})=>h("div",{"data-testid":"card",className:"px-8 pt-6 pb-4 bg-white rounded-lg flex-col justify-start items-center gap-5 hidden card:inline-flex",children:[h("div",{children:h("img",{className:"relative bg-white block max-h-[15.5625rem] max-w-[100%] h-auto",src:e.imageUrl})}),h("div",{className:"flex-col justify-start items-center gap-7 flex",children:[h("div",{className:"flex-col justify-start items-start gap-4 flex",children:h("div",{className:"self-stretch flex-col justify-start items-start gap-2 flex",children:[h("div",{className:"self-stretch text-[#143057] text-2xl font-bold font-['Inter'] leading-7",children:e.title}),h("div",{className:"self-stretch text-gray-900 text-base font-normal font-['Inter'] leading-normal",children:e.description})]})}),h(nt,{className:"self-stretch p-4 justify-center items-center bg-[#2e66f7] hover:bg-[#286090] rounded-md text-white text-base font-semibold font-['Inter'] leading-normal flex gap-2",path:t,onClick:n,children:[e.buttonText,h("img",{className:"self-center",src:Bt,alt:""})]})]})]}),$t="fallback-econnex-energy",At={title:"Paying too much for energy?",description:"Compare plans in just a few minutes with Flare Benefits & Econnex, and you could save when you switch to a better deal.",buttonText:"Learn more",imageUrl:"./images/flare-energy-banner.png"},Ht={title:"Paying too much for energy?",description:"Compare plans in just a few minutes with Flare Benefits & Econnex, and you could save when you switch to a better deal.",buttonText:"Learn more",imageUrl:"./images/flare-energy-card.png"},It={type:"Public",path:"https://econnex.com.au/?rc=862160&utm_source=promoted_benefits&utm_medium=fallback&utm_campaign=energy_alwayson&utm_content=energy_intialoffer"},q={id:$t,banner:At,card:Ht,action:It},Dt=async(e,t)=>{if(!e||!t)return L();const n=`${e}/promoted-benefits/backend`,r=await fetch(`${n}/v1.0/promotion`,{headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.270"}});if(r.status===204)return L();let o;if(r.ok)try{o=await r.json()}catch(i){return console.error(`Error parsing promotion response: ${i}`),L()}return!o||Object.keys(o).length===0?L():o},L=()=>({action:q.action,banner:q.banner,card:q.card,id:q.id}),Lt=async(e,t,n)=>{if(!t||!e)return;const r=`${e}/promoted-benefits/backend`;await fetch(`${r}/v1.0/promotion/${n}/view`,{method:"POST",headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.270"}})},Ut=async(e,t,n)=>{if(!t||!e)return;const r=`${e}/promoted-benefits/backend`;await fetch(`${r}/v1.0/promotion/${n==null?void 0:n.id}/action`,{method:"POST",body:JSON.stringify(n==null?void 0:n.action),headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.270"}})},Mt=async(e,t)=>{let n;const r=await fetch(e,{method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"}});return r.ok&&(n=await r.json()),n},Ft=(e,t,n,r)=>{const o=document.referrer;return`${e}/app/?token=${t}&redirectPath=${n}&referrer=${o}&promotionId=${r}`},Vt=async(e,t,n,r)=>{const o=`${e==null?void 0:e.apolloBaseUrl}/benefits`;if(!o||!n||!t||!r)return;const i=await Mt(`${o}/backend/v1.0/current/token`,t);if(!(!i||!i.token))return Ft(o,i.token,n,r)},Wt=async(e,t,n)=>{let r;switch(e.action.type.toLowerCase()){case"benefits":return r=await Vt(t,n.accessToken,e.action.path,e.id),{path:void 0,onClick:()=>{const i=window.open();i&&r&&(i.location=r)}};case"public":return{path:e.action.path,onClick:void 0};default:return}},jt=()=>{const e=wt(),t=zt(),[n,r]=U(),[o,i]=U();R(()=>{(async()=>{const c=await Dt(t==null?void 0:t.apolloBaseUrl,e==null?void 0:e.accessToken);r(c),Lt(t.apolloBaseUrl,e.accessToken,c==null?void 0:c.id)})()},[t.apolloBaseUrl,e.accessToken]),R(()=>{if(e&&e.expiresIn){const c=1e3*e.expiresIn,l=setTimeout(()=>{const _=L();r(_),kt()},c);return()=>clearTimeout(l)}},[n,e]),R(()=>{(async()=>n&&i(await Wt(n,t,e)))()},[t,e,n]);const a=()=>{o!=null&&o.onClick&&(o==null||o.onClick()),Ut(t.apolloBaseUrl,e.accessToken,n)};return n?h($,{children:[h(Rt,{banner:n.banner,path:o==null?void 0:o.path,onClick:a}),h(Nt,{card:n.card,path:o==null?void 0:o.path,onClick:a})]}):h($,{})};var B=[],Xt=function(){return B.some(function(e){return e.activeTargets.length>0})},qt=function(){return B.some(function(e){return e.skippedTargets.length>0})},Be="ResizeObserver loop completed with undelivered notifications.",Gt=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:Be}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=Be),window.dispatchEvent(e)},W;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(W||(W={}));var N=function(e){return Object.freeze(e)},Jt=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,N(this)}return e}(),rt=function(){function e(t,n,r,o){return this.x=t,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,N(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,o=t.top,i=t.right,a=t.bottom,c=t.left,l=t.width,_=t.height;return{x:n,y:r,top:o,right:i,bottom:a,left:c,width:l,height:_}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),ge=function(e){return e instanceof SVGElement&&"getBBox"in e},ot=function(e){if(ge(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||e.getClientRects().length)},Ne=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Zt=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},M=typeof window<"u"?window:{},G=new WeakMap,$e=/auto|scroll/,Kt=/^tb|vertical/,Qt=/msie|trident/i.test(M.navigator&&M.navigator.userAgent),C=function(e){return parseFloat(e||"0")},D=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new Jt((n?t:e)||0,(n?e:t)||0)},Ae=N({devicePixelContentBoxSize:D(),borderBoxSize:D(),contentBoxSize:D(),contentRect:new rt(0,0,0,0)}),it=function(e,t){if(t===void 0&&(t=!1),G.has(e)&&!t)return G.get(e);if(ot(e))return G.set(e,Ae),Ae;var n=getComputedStyle(e),r=ge(e)&&e.ownerSVGElement&&e.getBBox(),o=!Qt&&n.boxSizing==="border-box",i=Kt.test(n.writingMode||""),a=!r&&$e.test(n.overflowY||""),c=!r&&$e.test(n.overflowX||""),l=r?0:C(n.paddingTop),_=r?0:C(n.paddingRight),f=r?0:C(n.paddingBottom),s=r?0:C(n.paddingLeft),d=r?0:C(n.borderTopWidth),u=r?0:C(n.borderRightWidth),b=r?0:C(n.borderBottomWidth),k=r?0:C(n.borderLeftWidth),y=s+_,v=l+f,g=k+u,E=d+b,z=c?e.offsetHeight-E-e.clientHeight:0,T=a?e.offsetWidth-g-e.clientWidth:0,j=o?y+g:0,H=o?v+E:0,S=r?r.width:C(n.width)-j-T,w=r?r.height:C(n.height)-H-z,I=S+y+T+g,_t=w+v+z+E,be=N({devicePixelContentBoxSize:D(Math.round(S*devicePixelRatio),Math.round(w*devicePixelRatio),i),borderBoxSize:D(I,_t,i),contentBoxSize:D(S,w,i),contentRect:new rt(s,l,S,w)});return G.set(e,be),be},st=function(e,t,n){var r=it(e,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case W.DEVICE_PIXEL_CONTENT_BOX:return a;case W.BORDER_BOX:return o;default:return i}},Yt=function(){function e(t){var n=it(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=N([n.borderBoxSize]),this.contentBoxSize=N([n.contentBoxSize]),this.devicePixelContentBoxSize=N([n.devicePixelContentBoxSize])}return e}(),at=function(e){if(ot(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},en=function(){var e=1/0,t=[];B.forEach(function(a){if(a.activeTargets.length!==0){var c=[];a.activeTargets.forEach(function(_){var f=new Yt(_.target),s=at(_.target);c.push(f),_.lastReportedSize=st(_.target,_.observedBox),s<e&&(e=s)}),t.push(function(){a.callback.call(a.observer,c,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var o=r[n];o()}return e},He=function(e){B.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&(at(o.target)>e?n.activeTargets.push(o):n.skippedTargets.push(o))})})},tn=function(){var e=0;for(He(e);Xt();)e=en(),He(e);return qt()&&Gt(),e>0},se,ct=[],nn=function(){return ct.splice(0).forEach(function(e){return e()})},rn=function(e){if(!se){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return nn()}).observe(n,r),se=function(){n.textContent="".concat(t?t--:t++)}}ct.push(e),se()},on=function(e){rn(function(){requestAnimationFrame(e)})},te=0,sn=function(){return!!te},an=250,cn={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ie=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],De=function(e){return e===void 0&&(e=0),Date.now()+e},ae=!1,_n=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=an),!ae){ae=!0;var r=De(t);on(function(){var o=!1;try{o=tn()}finally{if(ae=!1,t=r-De(),!sn())return;o?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,cn)};document.body?n():M.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ie.forEach(function(n){return M.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ie.forEach(function(n){return M.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),de=new _n,Le=function(e){!te&&e>0&&de.start(),te+=e,!te&&de.stop()},ln=function(e){return!ge(e)&&!Zt(e)&&getComputedStyle(e).display==="inline"},un=function(){function e(t,n){this.target=t,this.observedBox=n||W.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=st(this.target,this.observedBox,!0);return ln(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),fn=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),J=new WeakMap,Ue=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Z=function(){function e(){}return e.connect=function(t,n){var r=new fn(t,n);J.set(t,r)},e.observe=function(t,n,r){var o=J.get(t),i=o.observationTargets.length===0;Ue(o.observationTargets,n)<0&&(i&&B.push(o),o.observationTargets.push(new un(n,r&&r.box)),Le(1),de.schedule())},e.unobserve=function(t,n){var r=J.get(t),o=Ue(r.observationTargets,n),i=r.observationTargets.length===1;o>=0&&(i&&B.splice(B.indexOf(r),1),r.observationTargets.splice(o,1),Le(-1))},e.disconnect=function(t){var n=this,r=J.get(t);r.observationTargets.slice().forEach(function(o){return n.unobserve(t,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),dn=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Z.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ne(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Z.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ne(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Z.unobserve(this,t)},e.prototype.disconnect=function(){Z.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();const hn=e=>{if(e){const t=1e3*e,n={sender:"flare",type:"promotionsSessionExpired"};setTimeout(()=>{window.parent.postMessage(n,"*")},t)}},pn=(e,t)=>{if(e&&t){const n=1e3*e,r=1e3*60*5,o={expiry:t,sender:"flare",type:"promotionsSessionExpiring"};setTimeout(()=>{window.parent.postMessage(o,"*")},n-r)}},vn=()=>{const t={height:Math.min(document.body.offsetHeight,220),sender:"flare",type:"contentResized"};window.parent.postMessage(t,"*")},mn=()=>{new dn(()=>{vn()}).observe(document.body)},gn=e=>{try{const n=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=atob(n);return JSON.parse(r)}catch{return}},bn=()=>{const[e,t]=U({}),[n,r]=U(),[o,i]=U(!1);return et(e),R(()=>{(async()=>{const a=await Pt();a&&(Ot(a),r(a))})()},[]),R(()=>{(async()=>{if(!o&&n){const a=await St(n);a&&t(a),i(!0)}})()},[n,o]),R(()=>{if(e.expiresIn&&e.accessToken){const a=gn(e.accessToken);hn(e.expiresIn),pn(e.expiresIn,a==null?void 0:a.exp)}},[e]),R(()=>{mn()},[]),o?h("div",{className:"flex items-center justify-center min-h-[100px]",children:h(jt,{})}):h($,{})};vt(h(bn,{}),document.body);