@flarehr/promoted-benefits-ui 1.0.239 → 1.0.241
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 re,p,Me,P,ye,Fe,ce,We,F={},Ve=[],ut=/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 ft(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,h,u,b,k,y=r&&r.__k||Ve,v=t.length;for(n.__d=l,dt(n,t,y),l=n.__d,s=0;s<v;s++)(u=n.__k[s])!=null&&typeof u!="boolean"&&typeof u!="function"&&(h=u.__i===-1?F:y[u.__i]||F,u.__i=s,pe(e,u,h,o,i,a,c,l,_,f),b=u.__e,u.ref&&h.ref!=u.ref&&(h.ref&&ve(h.ref,null,u),f.push(u.ref,u.__c||b,u)),k==null&&b!=null&&(k=b),65536&u.__u||h.__k===u.__k?(b||h.__e!=l||(l=A(h)),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 dt(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=ht(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 ht(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"||ut.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,h,u,b,k,y,v,g,T,z,E,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],T=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,T):(t.__c=s=new Q(v,T),s.constructor=w,s.render=vt),g&&g.sub(s),s.props=v,s.state||(s.state={}),s.context=T,s.__n=r,h=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,h)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,T),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(v,s.__s,T)===!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,T),s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(u,b,k)})}if(s.context=T,s.props=v,s.__P=e,s.__e=!1,E=p.__r,j=0,"prototype"in w&&w.prototype.render){for(s.state=s.__s,s.__d=!1,E&&E(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,E&&E(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())),h||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=pt(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 pt(e,t,n,r,o,i,a,c,l){var _,f,s,h,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"?h=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(h)?h:[h],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 vt(e,t,n){return this.constructor(e,n)}function mt(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=ft($,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"+We++,__: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=Ve.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,We=0;var gt=0;function d(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:--gt,__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,ie,Te,ue=0,Ze=[],Y=[],x=p,Ce=x.__b,Ee=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,bt(Qe,e)}function bt(e,t,n){var r=me(W++,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(h){return!!h.__c});if(f.every(function(h){return!h.__N}))return!i||i.call(this,c,l,_);var s=!1;return f.forEach(function(h){if(h.__N){var u=h.__[0];h.__=h.__N,h.__N=void 0,u!==h.__[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(W++,3);!x.__s&&wt(n.__H,t)&&(n.__=e,n.i=t,m.__H.__h.push(n))}function Ke(e){var t=m.context[e.__c],n=me(W++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(m)),t.props.value):e.__}function yt(){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){Ee&&Ee(e),W=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=[],W=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&&Te===x.requestAnimationFrame||((Te=x.requestAnimationFrame)||xt)(yt)),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 xt(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 wt(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}),kt=()=>Ke(Ye),Tt=()=>{et({})},Ct=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},Et=e=>{if(e)return{accessToken:e.access_token,isLoggedIn:!!e.access_token,expiresIn:e.expires_in}},St=e=>new URLSearchParams(window.location.search).get(e)??void 0,Ot=async e=>{const t=St("code"),n=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!(!e.identityUrl||!e.clientId||!t))return Et(await Ct(e.identityUrl,t,e.clientId,n))};let tt=oe({});const zt=e=>tt=oe({...e}),Pt=()=>Ke(tt),Rt=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="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",rt=({path:e,children:t,className:n,onClick:r})=>e?d("a",{href:e,className:n,onClick:r,target:"_blank",rel:"noreferrer",children:t}):d("button",{type:"button",className:n,onClick:r,children:t}),Bt=({banner:e,path:t,onClick:n})=>d("div",{"data-testid":"banner",className:"font-['Inter'] p-4 bg-white flex rounded-lg gap-2 card:hidden",children:[d("div",{className:"flex-col justify-between flex flex-1",children:[d("div",{className:"flex-col gap-4 flex pb-2",children:d("div",{className:"self-stretch flex-col justify-start items-start gap-2 flex",children:[d("h1",{className:"text-[#143057] font-bold leading-7",children:e.title}),d("p",{className:"text-gray-900 text-xs leading-normal",children:e.description})]})}),d("div",{className:"justify-end",children:d(rt,{className:"px-2 py-1 bg-[#2e66f7] hover:bg-[#286090] rounded-lg justify-center items-center gap-2 inline-flex text-white text-xs font-semibold leading-normal",path:t,onClick:n,children:[e.buttonText,d("img",{className:"self-center",src:nt,alt:""})]})})]}),d("div",{className:"self-center",children:d("img",{className:"w-20 h-20",src:e.imageUrl})})]}),Nt=({card:e,path:t,onClick:n})=>d("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:[d("div",{children:d("img",{className:"relative bg-white block max-h-[15.5625rem] max-w-[100%] h-auto",src:e.imageUrl})}),d("div",{className:"flex-col justify-start items-center gap-7 flex",children:[d("div",{className:"flex-col justify-start items-start gap-4 flex",children:d("div",{className:"self-stretch flex-col justify-start items-start gap-2 flex",children:[d("div",{className:"self-stretch text-[#143057] text-2xl font-bold font-['Inter'] leading-7",children:e.title}),d("div",{className:"self-stretch text-gray-900 text-base font-normal font-['Inter'] leading-normal",children:e.description})]})}),d(rt,{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,d("img",{className:"self-center",src:nt,alt:""})]})]})]}),$t="fallback-cars-promotion",At={title:"Benefit with Flare Cars and save",description:"In the market for a new car? We’ve got a benefit for that. Find out if you're eligible, and you could save, on average, $10,000 every year on your next car.",buttonText:"Learn more",imageUrl:"./images/flare-cars-banner.png"},Ht={title:"Benefit with Flare Cars and save",description:"In the market for a new car? We’ve got a benefit for that. Find out if you're eligible, and you could save, on average, $10,000 every year on your next car.",buttonText:"Learn more",imageUrl:"./images/flare-cars-card.png"},It={type:"Public",path:"https://www.flarecars.com/"},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.241"}});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.241"}})},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.241"}})},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}`},Wt=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)},Vt=async(e,t,n)=>{let r;switch(e.action.type.toLowerCase()){case"benefits":return r=await Wt(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=kt(),t=Pt(),[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(_),Tt()},c);return()=>clearTimeout(l)}},[n,e]),R(()=>{(async()=>n&&i(await Vt(n,t,e)))()},[t,e,n]);const a=()=>{o!=null&&o.onClick&&(o==null||o.onClick()),Ut(t.apolloBaseUrl,e.accessToken,n)};return n?d($,{children:[d(Bt,{banner:n.banner,path:o==null?void 0:o.path,onClick:a}),d(Nt,{card:n.card,path:o==null?void 0:o.path,onClick:a})]}):d($,{})};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)},V;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(V||(V={}));var N=function(e){return Object.freeze(e)},Jt=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,N(this)}return e}(),ot=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},it=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 ot(0,0,0,0)}),st=function(e,t){if(t===void 0&&(t=!1),G.has(e)&&!t)return G.get(e);if(it(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),h=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,T=h+b,z=c?e.offsetHeight-T-e.clientHeight:0,E=a?e.offsetWidth-g-e.clientWidth:0,j=o?y+g:0,H=o?v+T:0,S=r?r.width:C(n.width)-j-E,w=r?r.height:C(n.height)-H-z,I=S+y+E+g,lt=w+v+z+T,be=N({devicePixelContentBoxSize:D(Math.round(S*devicePixelRatio),Math.round(w*devicePixelRatio),i),borderBoxSize:D(I,lt,i),contentBoxSize:D(S,w,i),contentRect:new ot(s,l,S,w)});return G.set(e,be),be},at=function(e,t,n){var r=st(e,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case V.DEVICE_PIXEL_CONTENT_BOX:return a;case V.BORDER_BOX:return o;default:return i}},Yt=function(){function e(t){var n=st(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}(),ct=function(e){if(it(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=ct(_.target);c.push(f),_.lastReportedSize=at(_.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()&&(ct(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,_t=[],nn=function(){return _t.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++)}}_t.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||V.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=at(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:document.body.offsetHeight,sender:"flare",type:"contentResize"};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 Rt();a&&(zt(a),r(a))})()},[]),R(()=>{(async()=>{if(!o&&n){const a=await Ot(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?d("div",{className:"flex items-center justify-center min-h-[150px]",children:d(jt,{})}):d($,{})};mt(d(bn,{}),document.body);
|
package/dist/index.html
CHANGED
|
@@ -9,9 +9,34 @@
|
|
|
9
9
|
margin: 0;
|
|
10
10
|
}
|
|
11
11
|
</style>
|
|
12
|
-
<script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/promoted-benefits/app/v1.0/assets/index-CO7krrE2.js"></script>
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/promoted-benefits/app/v1.0/assets/index-D7f2SOcP.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
|
+
<script>
|
|
17
|
+
const getSanitizedEnv = () => window.location.hostname.toLocaleLowerCase().replace(/[^.a-z]/, '');
|
|
18
|
+
const getAppVersion = () => __APP_VERSION__.toLocaleLowerCase().replace(/[^0-9a-z.]/, '');
|
|
19
|
+
(function(h,o,u,n,d) {
|
|
20
|
+
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
|
|
21
|
+
d=o.createElement(u);d.async=1;d.src=n
|
|
22
|
+
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
|
|
23
|
+
})(window,document,'script','https://www.datadoghq-browser-agent.com/us1/v5/datadog-rum.js','DD_RUM')
|
|
24
|
+
window.DD_RUM.onReady(function() {
|
|
25
|
+
window.DD_RUM.init({
|
|
26
|
+
clientToken: 'pub5e80ea780c075721b6eae10ca8ae63d4',
|
|
27
|
+
applicationId: 'a7d17216-17ec-4e42-8114-71729286c31e',
|
|
28
|
+
site: 'datadoghq.com',
|
|
29
|
+
service: 'promoted-benefits',
|
|
30
|
+
env: `${getSanitizedEnv()}`,
|
|
31
|
+
version: `${getAppVersion()}`,
|
|
32
|
+
sessionSampleRate: 100,
|
|
33
|
+
sessionReplaySampleRate: 20,
|
|
34
|
+
trackUserInteractions: true,
|
|
35
|
+
trackResources: true,
|
|
36
|
+
trackLongTasks: true,
|
|
37
|
+
defaultPrivacyLevel: 'mask-user-input',
|
|
38
|
+
});
|
|
39
|
+
})
|
|
40
|
+
</script>
|
|
16
41
|
</body>
|
|
17
42
|
</html>
|
package/package.json
CHANGED
|
@@ -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,We,M={},Ve=[],ut=/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 ft(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 Z(e,a,r,o,null)}function Z(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 K(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,h,u,b,k,y=r&&r.__k||Ve,v=t.length;for(n.__d=l,dt(n,t,y),l=n.__d,s=0;s<v;s++)(u=n.__k[s])!=null&&typeof u!="boolean"&&typeof u!="function"&&(h=u.__i===-1?M:y[u.__i]||M,u.__i=s,pe(e,u,h,o,i,a,c,l,_,f),b=u.__e,u.ref&&h.ref!=u.ref&&(h.ref&&ve(h.ref,null,u),f.push(u.ref,u.__c||b,u)),k==null&&b!=null&&(k=b),65536&u.__u||h.__k===u.__k?(b||h.__e!=l||(l=A(h)),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 dt(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?Z(null,o,null,null,null):he(o)?Z($,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Z(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,c=ht(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 ht(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"||ut.test(t)?n:n+"px"}function j(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,h,u,b,k,y,v,g,T,z,E,V,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],T=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,T):(t.__c=s=new K(v,T),s.constructor=w,s.render=vt),g&&g.sub(s),s.props=v,s.state||(s.state={}),s.context=T,s.__n=r,h=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,h)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,T),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(v,s.__s,T)===!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,T),s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(u,b,k)})}if(s.context=T,s.props=v,s.__P=e,s.__e=!1,E=p.__r,V=0,"prototype"in w&&w.prototype.render){for(s.state=s.__s,s.__d=!1,E&&E(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,E&&E(t),f=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++V<25);s.state=s.__s,s.getChildContext!=null&&(r=O(O({},r),s.getChildContext())),h||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=pt(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 pt(e,t,n,r,o,i,a,c,l){var _,f,s,h,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||M,!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||j(e,_,null,u,o));for(_ in v)u=v[_],_=="children"?h=u:_=="dangerouslySetInnerHTML"?f=u:_=="value"?b=u:_=="checked"?k=u:_==="key"||c&&typeof u!="function"||y[_]===u||j(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(h)?h:[h],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[_])&&j(e,_,b,y[_],!1),_="checked",k!==void 0&&k!==e[_]&&j(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 vt(e,t,n){return this.constructor(e,n)}function mt(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=ft($,null,[e]),o||M,M,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"+We++,__: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=Ve.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,K.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))},K.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_e(this))},K.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,We=0;var gt=0;function d(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:--gt,__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 F,m,ie,Te,ue=0,Ze=[],Q=[],x=p,Ce=x.__b,Ee=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:Q}),n.__[e]}function L(e){return ue=1,bt(Qe,e)}function bt(e,t,n){var r=me(F++,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(h){return!!h.__c});if(f.every(function(h){return!h.__N}))return!i||i.call(this,c,l,_);var s=!1;return f.forEach(function(h){if(h.__N){var u=h.__[0];h.__=h.__N,h.__N=void 0,u!==h.__[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(F++,3);!x.__s&&wt(n.__H,t)&&(n.__=e,n.i=t,m.__H.__h.push(n))}function Ke(e){var t=m.context[e.__c],n=me(F++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(m)),t.props.value):e.__}function yt(){for(var e;e=Ze.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Y),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){Ee&&Ee(e),F=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=Q,n.__N=n.i=void 0})):(t.__h.forEach(Y),t.__h.forEach(fe),t.__h=[],F=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&&Te===x.requestAnimationFrame||((Te=x.requestAnimationFrame)||xt)(yt)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Q&&(n.__=n.__V),n.i=void 0,n.__V=Q})),ie=m=null},x.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Y),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{Y(r)}catch(o){t=o}}),n.__H=void 0,t&&x.__e(t,n.__v))};var Re=typeof requestAnimationFrame=="function";function xt(e){var t,n=function(){clearTimeout(r),Re&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Re&&(t=requestAnimationFrame(n))}function Y(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 wt(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}),kt=()=>Ke(Ye),Tt=()=>{et({})},Ct=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},Et=e=>{if(e)return{accessToken:e.access_token,isLoggedIn:!!e.access_token,expiresIn:e.expires_in}},St=e=>new URLSearchParams(window.location.search).get(e)??void 0,Ot=async e=>{const t=St("code"),n=`${window.location.origin}/promoted-benefits/app/v1.0/`;if(!(!e.identityUrl||!e.clientId||!t))return Et(await Ct(e.identityUrl,t,e.clientId,n))};let tt=oe({});const zt=e=>tt=oe({...e}),Pt=()=>Ke(tt),Rt=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="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",rt=({path:e,children:t,className:n,onClick:r})=>e?d("a",{href:e,className:n,onClick:r,target:"_blank",rel:"noreferrer",children:t}):d("button",{type:"button",className:n,onClick:r,children:t}),Bt=({banner:e,path:t,onClick:n})=>d("div",{"data-testid":"banner",className:"font-['Inter'] p-4 bg-white flex rounded-lg gap-2 card:hidden",children:[d("div",{className:"flex-col justify-between flex flex-1",children:[d("div",{className:"flex-col gap-4 flex pb-2",children:d("div",{className:"self-stretch flex-col justify-start items-start gap-2 flex",children:[d("h1",{className:"text-[#143057] font-bold leading-7",children:e.title}),d("p",{className:"text-gray-900 text-xs leading-normal",children:e.description})]})}),d("div",{className:"justify-end",children:d(rt,{className:"px-2 py-1 bg-[#2e66f7] hover:bg-[#286090] rounded-lg justify-center items-center gap-2 inline-flex text-white text-xs font-semibold leading-normal",path:t,onClick:n,children:[e.buttonText,d("img",{className:"self-center",src:nt,alt:""})]})})]}),d("div",{className:"self-center",children:d("img",{className:"w-20 h-20",src:e.imageUrl})})]}),Nt=({card:e,path:t,onClick:n})=>d("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:[d("div",{children:d("img",{className:"relative bg-white block max-h-[15.5625rem] max-w-[100%] h-auto",src:e.imageUrl})}),d("div",{className:"flex-col justify-start items-center gap-7 flex",children:[d("div",{className:"flex-col justify-start items-start gap-4 flex",children:d("div",{className:"self-stretch flex-col justify-start items-start gap-2 flex",children:[d("div",{className:"self-stretch text-[#143057] text-2xl font-bold font-['Inter'] leading-7",children:e.title}),d("div",{className:"self-stretch text-gray-900 text-base font-normal font-['Inter'] leading-normal",children:e.description})]})}),d(rt,{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,d("img",{className:"self-center",src:nt,alt:""})]})]})]}),$t="fallback-cars-promotion",At={title:"Benefit with Flare Cars and save",description:"In the market for a new car? We’ve got a benefit for that. Find out if you're eligible, and you could save, on average, $10,000 every year on your next car.",buttonText:"Learn more",imageUrl:"./images/flare-cars-banner.png"},Ht={title:"Benefit with Flare Cars and save",description:"In the market for a new car? We’ve got a benefit for that. Find out if you're eligible, and you could save, on average, $10,000 every year on your next car.",buttonText:"Learn more",imageUrl:"./images/flare-cars-card.png"},It={type:"Public",path:"https://www.flarecars.com/"},X={id:$t,banner:At,card:Ht,action:It},Dt=async(e,t)=>{if(!e||!t)return ee();const n=`${e}/promoted-benefits/backend`,r=await fetch(`${n}/v1.0/promotion`,{headers:{Authorization:`Bearer ${t}`,"X-APP-VERSION":"1.0.239"}});let o;if(r.ok)try{o=await r.json()}catch(i){return console.error(`Error parsing promotion response: ${i}`),ee()}return!o||Object.keys(o).length===0?ee():o},ee=()=>({action:X.action,banner:X.banner,card:X.card,id:X.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.239"}})},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.239"}})},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}`},Wt=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)},Vt=async(e,t,n)=>{let r;switch(e.action.type.toLowerCase()){case"benefits":return r=await Wt(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=kt(),t=Pt(),[n,r]=L(),[o,i]=L();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 _=ee();r(_),Tt()},c);return()=>clearTimeout(l)}},[n,e]),R(()=>{(async()=>n&&i(await Vt(n,t,e)))()},[t,e,n]);const a=()=>{o!=null&&o.onClick&&(o==null||o.onClick()),Ut(t.apolloBaseUrl,e.accessToken,n)};return n?d($,{children:[d(Bt,{banner:n.banner,path:o==null?void 0:o.path,onClick:a}),d(Nt,{card:n.card,path:o==null?void 0:o.path,onClick:a})]}):d($,{})};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}(),ot=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},it=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},U=typeof window<"u"?window:{},q=new WeakMap,$e=/auto|scroll/,Kt=/^tb|vertical/,Qt=/msie|trident/i.test(U.navigator&&U.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 ot(0,0,0,0)}),st=function(e,t){if(t===void 0&&(t=!1),q.has(e)&&!t)return q.get(e);if(it(e))return q.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),h=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,T=h+b,z=c?e.offsetHeight-T-e.clientHeight:0,E=a?e.offsetWidth-g-e.clientWidth:0,V=o?y+g:0,H=o?v+T:0,S=r?r.width:C(n.width)-V-E,w=r?r.height:C(n.height)-H-z,I=S+y+E+g,lt=w+v+z+T,be=N({devicePixelContentBoxSize:D(Math.round(S*devicePixelRatio),Math.round(w*devicePixelRatio),i),borderBoxSize:D(I,lt,i),contentBoxSize:D(S,w,i),contentRect:new ot(s,l,S,w)});return q.set(e,be),be},at=function(e,t,n){var r=st(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=st(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}(),ct=function(e){if(it(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=ct(_.target);c.push(f),_.lastReportedSize=at(_.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()&&(ct(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,_t=[],nn=function(){return _t.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++)}}_t.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():U.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 U.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ie.forEach(function(n){return U.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=at(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}(),G=new WeakMap,Ue=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},J=function(){function e(){}return e.connect=function(t,n){var r=new fn(t,n);G.set(t,r)},e.observe=function(t,n,r){var o=G.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=G.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=G.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.");J.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");J.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");J.unobserve(this,t)},e.prototype.disconnect=function(){J.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:document.body.offsetHeight,sender:"flare",type:"contentResize"};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]=L({}),[n,r]=L(),[o,i]=L(!1);return et(e),R(()=>{(async()=>{const a=await Rt();a&&(zt(a),r(a))})()},[]),R(()=>{(async()=>{if(!o&&n){const a=await Ot(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?d("div",{className:"flex items-center justify-center min-h-[150px]",children:d(jt,{})}):d($,{})};mt(d(bn,{}),document.body);
|