@imtbl/auth 2.10.7-alpha.2 → 2.10.7-alpha.4

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,391 @@
1
+ import { UserManager, User, ErrorTimeout, ErrorResponse, InMemoryWebStorage, WebStorageStateStore } from 'oidc-client-ts';
2
+ import Or, { isAxiosError } from 'axios';
3
+ import Re from 'jwt-decode';
4
+ import { getDetail, Detail, track, identify } from '@imtbl/metrics';
5
+ import gr from 'localforage';
6
+
7
+ var Fe=Object.create;var se=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Be=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var $=(r,e)=>()=>(r&&(e=r(r=0)),e);var Ze=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var We=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ge(e))!Ke.call(r,i)&&i!==t&&se(r,i,{get:()=>e[i],enumerable:!(n=Ve(e,i))||n.enumerable});return r};var $e=(r,e,t)=>(t=r!=null?Fe(Be(r)):{},We(se(t,"default",{value:r,enumerable:!0}),r));function q(r){throw new Error("Node.js process "+r+" is not supported by JSPM core outside of Node.js")}function Ye(){!P||!T||(P=!1,T.length?C=T.concat(C):S=-1,C.length&&ae());}function ae(){if(!P){var r=setTimeout(Ye,0);P=!0;for(var e=C.length;e;){for(T=C,C=[];++S<e;)T&&T[S].run();S=-1,e=C.length;}T=null,P=!1,clearTimeout(r);}}function je(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];C.push(new le(r,e)),C.length===1&&!P&&setTimeout(ae,0);}function le(r,e){this.fun=r,this.array=e;}function h(){}function ut(r){q("_linkedBinding");}function gt(r){q("dlopen");}function ht(){return []}function vt(){return []}function Pt(r,e){if(!r)throw new Error(e||"assertion error")}function At(){return !1}function Yt(){return O.now()/1e3}function z(r){var e=Math.floor((Date.now()-O.now())*.001),t=O.now()*.001,n=Math.floor(t)+e,i=Math.floor(t%1*1e9);return r&&(n=n-r[0],i=i-r[1],i<0&&(n--,i+=j)),[n,i]}function R(){return p}function or(r){return []}var C,P,T,S,ze,qe,Xe,Qe,Je,et,tt,rt,nt,it,ot,st,at,lt,dt,ct,pt,mt,ft,Et,_t,X,Ct,yt,Ot,Rt,Lt,Tt,bt,wt,It,xt,kt,Mt,Ut,Nt,Dt,St,Ht,Ft,Vt,Gt,Bt,Kt,Zt,Wt,$t,O,Y,j,jt,zt,qt,Xt,Qt,Jt,er,tr,rr,nr,ir,p,de=$(()=>{l();a();C=[],P=!1,S=-1;le.prototype.run=function(){this.fun.apply(null,this.array);};ze="browser",qe="x64",Xe="browser",Qe={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Je=["/usr/bin/node"],et=[],tt="v16.8.0",rt={},nt=function(r,e){console.warn((e?e+": ":"")+r);},it=function(r){q("binding");},ot=function(r){return 0},st=function(){return "/"},at=function(r){},lt={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};dt=h,ct=[];pt={},mt=!1,ft={};Et=h,_t=h,X=function(){return {}},Ct=X,yt=X,Ot=h,Rt=h,Lt=h,Tt={};bt={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},wt=h,It=h;xt=h,kt=h,Mt=h,Ut=h,Nt=h,Dt=void 0,St=void 0,Ht=void 0,Ft=h,Vt=2,Gt=1,Bt="/bin/usr/node",Kt=9229,Zt="node",Wt=[],$t=h,O={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};O.now===void 0&&(Y=Date.now(),O.timing&&O.timing.navigationStart&&(Y=O.timing.navigationStart),O.now=()=>Date.now()-Y);j=1e9;z.bigint=function(r){var e=z(r);return typeof BigInt>"u"?e[0]*j+e[1]:BigInt(e[0]*j)+BigInt(e[1])};jt=10,zt={},qt=0;Xt=R,Qt=R,Jt=R,er=R,tr=R,rr=h,nr=R,ir=R;p={version:tt,versions:rt,arch:qe,platform:Xe,release:lt,_rawDebug:dt,moduleLoadList:ct,binding:it,_linkedBinding:ut,_events:zt,_eventsCount:qt,_maxListeners:jt,on:R,addListener:Xt,once:Qt,off:Jt,removeListener:er,removeAllListeners:tr,emit:rr,prependListener:nr,prependOnceListener:ir,listeners:or,domain:pt,_exiting:mt,config:ft,dlopen:gt,uptime:Yt,_getActiveRequests:ht,_getActiveHandles:vt,reallyExit:Et,_kill:_t,cpuUsage:X,resourceUsage:Ct,memoryUsage:yt,kill:Ot,exit:Rt,openStdin:Lt,allowedNodeEnvironmentFlags:Tt,assert:Pt,features:bt,_fatalExceptions:wt,setUncaughtExceptionCaptureCallback:It,hasUncaughtExceptionCaptureCallback:At,emitWarning:nt,nextTick:je,_tickCallback:xt,_debugProcess:kt,_debugEnd:Mt,_startProfilerIdleNotifier:Ut,_stopProfilerIdleNotifier:Nt,stdout:Dt,stdin:Ht,stderr:St,abort:Ft,umask:ot,chdir:at,cwd:st,env:Qe,title:ze,argv:Je,execArgv:et,pid:Vt,ppid:Gt,execPath:Bt,debugPort:Kt,hrtime:z,argv0:Zt,_preload_modules:Wt,setSourceMapsEnabled:$t};});var a=$(()=>{de();});var l=$(()=>{});var Se=Ze((Ti,ne)=>{l();a();var I=typeof Reflect=="object"?Reflect:null,be=I&&typeof I.apply=="function"?I.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},K;I&&typeof I.ownKeys=="function"?K=I.ownKeys:Object.getOwnPropertySymbols?K=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:K=function(e){return Object.getOwnPropertyNames(e)};function Vr(r){console&&console.warn&&console.warn(r);}var Ie=Number.isNaN||function(e){return e!==e};function c(){c.init.call(this);}ne.exports=c;ne.exports.once=Zr;c.EventEmitter=c;c.prototype._events=void 0;c.prototype._eventsCount=0;c.prototype._maxListeners=void 0;var we=10;function Z(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return we},set:function(r){if(typeof r!="number"||r<0||Ie(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");we=r;}});c.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0;};c.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Ie(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Ae(r){return r._maxListeners===void 0?c.defaultMaxListeners:r._maxListeners}c.prototype.getMaxListeners=function(){return Ae(this)};c.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return !1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var d=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw d.context=s,d}var f=o[e];if(f===void 0)return !1;if(typeof f=="function")be(f,this,t);else for(var _=f.length,u=Ne(f,_),n=0;n<_;++n)be(u[n],this,t);return !0};function xe(r,e,t,n){var i,o,s;if(Z(t),o=r._events,o===void 0?(o=r._events=Object.create(null),r._eventsCount=0):(o.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),o=r._events),s=o[e]),s===void 0)s=o[e]=t,++r._eventsCount;else if(typeof s=="function"?s=o[e]=n?[t,s]:[s,t]:n?s.unshift(t):s.push(t),i=Ae(r),i>0&&s.length>i&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=r,d.type=e,d.count=s.length,Vr(d);}return r}c.prototype.addListener=function(e,t){return xe(this,e,t,!1)};c.prototype.on=c.prototype.addListener;c.prototype.prependListener=function(e,t){return xe(this,e,t,!0)};function Gr(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ke(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=Gr.bind(n);return i.listener=t,n.wrapFn=i,i}c.prototype.once=function(e,t){return Z(t),this.on(e,ke(this,e,t)),this};c.prototype.prependOnceListener=function(e,t){return Z(t),this.prependListener(e,ke(this,e,t)),this};c.prototype.removeListener=function(e,t){var n,i,o,s,d;if(Z(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){d=n[s].listener,o=s;break}if(o<0)return this;o===0?n.shift():Br(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,d||t);}return this};c.prototype.off=c.prototype.removeListener;c.prototype.removeAllListeners=function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),s;for(i=0;i<o.length;++i)s=o[i],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function Me(r,e,t){var n=r._events;if(n===void 0)return [];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?Kr(i):Ne(i,i.length)}c.prototype.listeners=function(e){return Me(this,e,!0)};c.prototype.rawListeners=function(e){return Me(this,e,!1)};c.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):Ue.call(r,e)};c.prototype.listenerCount=Ue;function Ue(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?K(this._events):[]};function Ne(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function Br(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop();}function Kr(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Zr(r,e){return new Promise(function(t,n){function i(s){r.removeListener(e,o),n(s);}function o(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments));}De(r,e,o,{once:!0}),e!=="error"&&Wr(r,i,{once:!0});})}function Wr(r,e,t){typeof r.on=="function"&&De(r,"error",e,t);}function De(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(o){n.once&&r.removeEventListener(e,i),t(o);});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}});l();a();l();a();l();a();l();a();var ce="pkce_state",ue="pkce_verifier",ar=3600,x=class{isTokenValid(e){try{let n=Re(e).exp??0,i=Date.now()/1e3+ar;return n>i}catch{return !1}}savePKCEData(e){localStorage.setItem(ce,e.state),localStorage.setItem(ue,e.verifier);}getPKCEData(){let e=localStorage.getItem(ce),t=localStorage.getItem(ue);return e&&t?{state:e,verifier:t}:null}};l();a();var lr=(...r)=>{if(typeof p>"u")return;p?.env?.JEST_WORKER_ID===void 0&&console.warn(...r);},k={warn:lr};l();a();function pe(r){try{let e=Re(r),t=Math.floor(Date.now()/1e3);return e.exp?e.exp<=t+30:!0}catch{return !0}}function me(r){let{id_token:e,access_token:t}=r;return !t||!e?!0:pe(t)||pe(e)}l();a();var H=(m=>(m.AUTHENTICATION_ERROR="AUTHENTICATION_ERROR",m.INVALID_CONFIGURATION="INVALID_CONFIGURATION",m.WALLET_CONNECTION_ERROR="WALLET_CONNECTION_ERROR",m.NOT_LOGGED_IN_ERROR="NOT_LOGGED_IN_ERROR",m.SILENT_LOGIN_ERROR="SILENT_LOGIN_ERROR",m.REFRESH_TOKEN_ERROR="REFRESH_TOKEN_ERROR",m.USER_REGISTRATION_ERROR="USER_REGISTRATION_ERROR",m.USER_NOT_REGISTERED_ERROR="USER_NOT_REGISTERED_ERROR",m.LOGOUT_ERROR="LOGOUT_ERROR",m.TRANSFER_ERROR="TRANSFER_ERROR",m.CREATE_ORDER_ERROR="CREATE_ORDER_ERROR",m.CANCEL_ORDER_ERROR="CANCEL_ORDER_ERROR",m.EXCHANGE_TRANSFER_ERROR="EXCHANGE_TRANSFER_ERROR",m.CREATE_TRADE_ERROR="CREATE_TRADE_ERROR",m.OPERATION_NOT_SUPPORTED_ERROR="OPERATION_NOT_SUPPORTED_ERROR",m.LINK_WALLET_ALREADY_LINKED_ERROR="LINK_WALLET_ALREADY_LINKED_ERROR",m.LINK_WALLET_MAX_WALLETS_LINKED_ERROR="LINK_WALLET_MAX_WALLETS_LINKED_ERROR",m.LINK_WALLET_VALIDATION_ERROR="LINK_WALLET_VALIDATION_ERROR",m.LINK_WALLET_DUPLICATE_NONCE_ERROR="LINK_WALLET_DUPLICATE_NONCE_ERROR",m.LINK_WALLET_GENERIC_ERROR="LINK_WALLET_GENERIC_ERROR",m.SERVICE_UNAVAILABLE_ERROR="SERVICE_UNAVAILABLE_ERROR",m))(H||{});function ur(r){return "code"in r&&"message"in r}var v=class extends Error{type;constructor(e,t){super(e),this.type=t;}},L=async(r,e)=>{try{return await r()}catch(t){let n;throw t instanceof v&&t.type==="SERVICE_UNAVAILABLE_ERROR"?new v(t.message,t.type):(isAxiosError(t)&&t.response?.data&&ur(t.response.data)?n=t.response.data.message:n=t.message,new v(n,e))}};l();a();var fe=(t=>(t.IMX="imx",t.ZKEVM="zkEvm",t))(fe||{}),Q=r=>!!r.zkEvm,J=r=>!!r.imx,ge=(t=>(t.OptedIn="opted_in",t.Unsubscribed="unsubscribed",t))(ge||{}),ee=(t=>(t.LOGGED_OUT="loggedOut",t.LOGGED_IN="loggedIn",t))(ee||{});l();a();l();a();var b="passport-overlay",M="passport-overlay-contents",F=`${b}-close`,V=`${b}-try-again`,he=`
8
+ <svg
9
+ viewBox="0 0 20 20"
10
+ fill="none"
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ style="width: 20px !important;"
13
+ >
14
+ <path
15
+ d="M16.25 5.75833L14.2417 3.75L10 7.99167L5.75833 3.75L3.75 5.75833L7.99167 10L3.75 14.2417L5.75833 16.25L10 12.0083L14.2417 16.25L16.25 14.2417L12.0083 10L16.25 5.75833Z"
16
+ fill="#F3F3F3"
17
+ />
18
+ </svg>
19
+ `,ve=`
20
+ <svg
21
+ viewBox="0 0 17 16"
22
+ fill="none"
23
+ xmlns="http://www.w3.org/2000/svg"
24
+ style="width: 16px !important;"
25
+ >
26
+ <path
27
+ fill-rule="evenodd"
28
+ clip-rule="evenodd"
29
+ d="M0.5 14.3333L8.5 0.333336L16.5 14.3333H0.5ZM9.16667 10.6667V12H7.83333V10.6667H9.16667ZM9.16667 5.33334L9.16667 9.33334H7.83333L7.83333 5.33334H9.16667Z"
30
+ fill="#E01A3D"
31
+ />
32
+ </svg>
33
+ `,te=`
34
+ <svg
35
+ style="
36
+ max-width: 123px !important;
37
+ margin-bottom: 24px !important;
38
+ "
39
+ viewBox="0 0 124 112"
40
+ fill="none"
41
+ xmlns="http://www.w3.org/2000/svg"
42
+ >
43
+ <g clip-path="url(#clip0_332_47939)">
44
+ <g clip-path="url(#clip1_332_47939)">
45
+ <path
46
+ d="M4.10008 74.9453H0.5V93.6041H4.10008V74.9453Z"
47
+ fill="#F3F3F3"
48
+ />
49
+ <path
50
+ d="M22.9585 80.0212C21.1727 80.0212 19.5283 80.7622 18.5505 82.3115C17.8209 80.8013 16.3595 80.0212 14.4691 80.0212C12.864 80.0212 11.3786 80.7231 10.4792 82.1681V80.282H7.00976V93.6063H10.4792V86.2032C10.4792 84.3432 11.7445 82.9503 13.3475 82.9503H13.5565C14.9787 82.9503 15.643 83.8477 15.643 85.6187V93.6085H19.1124V86.2054C19.1124 84.3453 20.3647 82.9525 21.9676 82.9525H22.1767C23.5989 82.9525 24.237 83.8499 24.237 85.6208V93.6106H27.7064V85.2188C27.7064 83.6435 27.3274 82.3832 26.5717 81.4315C25.8029 80.4949 24.6029 80.0256 22.9585 80.0256V80.0212Z"
51
+ fill="#F3F3F3"
52
+ />
53
+ <path
54
+ d="M46.0291 80.0212C44.2432 80.0212 42.5989 80.7622 41.621 82.3115C40.8914 80.8013 39.43 80.0212 37.5396 80.0212C35.9345 80.0212 34.4492 80.7231 33.5497 82.1681V80.282H30.0803V93.6063H33.5497V86.2032C33.5497 84.3432 34.8151 82.9503 36.418 82.9503H36.6271C38.0493 82.9503 38.7135 83.8477 38.7135 85.6187V93.6085H42.1829V86.2054C42.1829 84.3453 43.4352 82.9525 45.0381 82.9525H45.2472C46.6694 82.9525 47.3075 83.8499 47.3075 85.6208V93.6106H50.7769V85.2188C50.7769 83.6435 50.398 82.3832 49.6422 81.4315C48.8734 80.4949 47.6734 80.0256 46.0291 80.0256V80.0212Z"
55
+ fill="#F3F3F3"
56
+ />
57
+ <path
58
+ d="M72.3077 89.2061V83.0785H75.2936V80.282H72.3077V75.9622H68.8383V80.282H61.4312V87.6851C61.4312 89.5451 60.192 91.0683 58.6805 91.0683H58.4715C57.2061 91.0683 56.4896 90.1318 56.4896 88.413V80.282H53.0202V88.8041C53.0202 90.3534 53.3991 91.5746 54.1549 92.4872C54.8975 93.4107 56.0322 93.867 57.5328 93.867C59.188 93.867 60.6102 93.0218 61.4312 91.655V93.6063H64.9006V83.0807H68.8405V90.1448C68.8405 92.396 70.0536 93.6063 72.3099 93.6063H75.7009V90.6794H73.7843C72.5582 90.6794 72.3099 90.4317 72.3099 89.2083L72.3077 89.2061Z"
59
+ fill="#F3F3F3"
60
+ />
61
+ <path
62
+ d="M88.0757 84.8082C88.0757 81.7378 85.8325 80.0191 82.4676 80.0191C79.1027 80.0191 77.0033 81.8791 76.7158 84.404H80.1982C80.2766 83.5979 81.0977 82.8156 82.35 82.8156H82.5722C83.8506 82.8156 84.7109 83.7391 84.7109 84.9364V85.2623L81.346 85.5622C79.9108 85.6795 78.7369 86.0945 77.8243 86.8246C76.9118 87.5525 76.4544 88.5934 76.4544 89.9471C76.4152 92.2895 78.4363 93.8888 80.8364 93.8627C82.5438 93.8627 83.9529 93.1348 84.7871 91.9766C84.8132 92.6785 84.8655 93.226 84.9439 93.6019H88.2042C88.1127 92.9783 88.0735 92.0005 88.0735 90.675V84.806L88.0757 84.8082ZM84.7109 88.1653C84.7109 89.8428 83.3148 91.0661 81.738 91.0661H81.5289C80.5772 91.0661 79.8737 90.5316 79.8737 89.7124C79.8737 89.204 80.0697 88.8281 80.4596 88.5543C80.8516 88.2805 81.3068 88.124 81.8164 88.0849L84.7109 87.785V88.1653Z"
63
+ fill="#F3F3F3"
64
+ />
65
+ <path
66
+ d="M97.7935 80.0212C96.0076 80.0212 94.5201 81.036 93.9452 82.0116V74.9475H90.4758V93.6063H93.9452V91.8766C94.5201 92.8523 96.0055 93.867 97.7935 93.867C101.537 93.9322 103.765 90.5881 103.726 86.9441C103.765 83.3002 101.535 79.956 97.7935 80.0212ZM97.2055 91.0683H96.9964C95.4044 91.1074 93.919 89.3908 93.9452 86.9441C93.919 84.4974 95.4065 82.7808 96.9964 82.8199H97.2055C98.9522 82.8199 100.257 84.4192 100.257 86.9181C100.257 89.4169 98.9391 91.0683 97.2055 91.0683Z"
67
+ fill="#F3F3F3"
68
+ />
69
+ <path
70
+ d="M108.931 74.9453H105.462V93.6041H108.931V74.9453Z"
71
+ fill="#F3F3F3"
72
+ />
73
+ <path
74
+ d="M117.057 80.0212C113.146 79.9691 110.667 82.9612 110.706 86.9441C110.641 91.1987 113.705 93.9192 117.057 93.867C120.33 93.867 122.443 92.0461 123.094 89.3908H119.651C119.403 90.3665 118.555 91.0683 117.303 91.0683H117.081C115.633 91.0683 114.2 89.8189 114.069 88.0371H123.094C123.133 87.4656 123.147 87.0484 123.147 86.7877C123.186 82.8982 120.956 79.9821 117.057 80.0212ZM114.071 85.3688C114.15 83.7934 115.363 82.8178 116.824 82.8178H117.033C118.495 82.8178 119.708 83.7934 119.784 85.3688H114.071Z"
75
+ fill="#F3F3F3"
76
+ />
77
+ </g>
78
+ <path
79
+ d="M30.4851 101.025V109H32.0581V106.195H33.2571C35.0941 106.195 36.7221 105.7 36.7221 103.665C36.7221 101.256 34.8521 101.025 33.2131 101.025H30.4851ZM33.2461 102.257C34.1041 102.257 35.1051 102.367 35.1051 103.676C35.1051 104.732 34.3351 104.974 33.3561 104.974H32.0581V102.257H33.2461Z"
80
+ fill="#F3F3F3"
81
+ />
82
+ <path
83
+ d="M36.9683 109H38.5743L39.1353 107.383H42.2373L42.7983 109H44.5034L41.5224 101.025H39.9383L36.9683 109ZM40.6863 102.95L41.7863 106.096H39.5863L40.6863 102.95Z"
84
+ fill="#F3F3F3"
85
+ />
86
+ <path
87
+ d="M49.1875 105.689C50.0345 105.843 50.6615 106.096 50.6615 106.778C50.6615 107.636 49.7705 107.889 49.0665 107.889C48.1205 107.889 47.3065 107.537 47.1305 106.371H45.6125C45.7555 108.087 47.0535 109.143 49.0115 109.143C50.6175 109.143 52.2455 108.34 52.2455 106.701C52.2455 105.051 50.8155 104.534 49.5175 104.303L48.4725 104.116C47.8345 103.995 47.3615 103.687 47.3615 103.126C47.3615 102.411 48.1755 102.136 48.9015 102.136C49.6495 102.136 50.4635 102.444 50.5845 103.379H52.1025C52.0255 101.85 50.6175 100.882 48.9675 100.882C47.4935 100.882 45.7885 101.586 45.7885 103.192C45.7885 104.578 46.8775 105.249 48.1755 105.502L49.1875 105.689Z"
88
+ fill="#F3F3F3"
89
+ />
90
+ <path
91
+ d="M57.5244 105.689C58.3714 105.843 58.9984 106.096 58.9984 106.778C58.9984 107.636 58.1074 107.889 57.4034 107.889C56.4574 107.889 55.6434 107.537 55.4674 106.371H53.9494C54.0924 108.087 55.3904 109.143 57.3484 109.143C58.9544 109.143 60.5824 108.34 60.5824 106.701C60.5824 105.051 59.1524 104.534 57.8544 104.303L56.8094 104.116C56.1714 103.995 55.6984 103.687 55.6984 103.126C55.6984 102.411 56.5124 102.136 57.2384 102.136C57.9864 102.136 58.8004 102.444 58.9214 103.379H60.4394C60.3624 101.85 58.9544 100.882 57.3044 100.882C55.8304 100.882 54.1254 101.586 54.1254 103.192C54.1254 104.578 55.2144 105.249 56.5124 105.502L57.5244 105.689Z"
92
+ fill="#F3F3F3"
93
+ />
94
+ <path
95
+ d="M62.5544 101.025V109H64.1274V106.195H65.3264C67.1634 106.195 68.7914 105.7 68.7914 103.665C68.7914 101.256 66.9214 101.025 65.2824 101.025H62.5544ZM65.3154 102.257C66.1734 102.257 67.1744 102.367 67.1744 103.676C67.1744 104.732 66.4044 104.974 65.4254 104.974H64.1274V102.257H65.3154Z"
96
+ fill="#F3F3F3"
97
+ />
98
+ <path
99
+ d="M71.8888 105.007C71.8888 103.137 72.9228 102.136 74.1658 102.136C75.4088 102.136 76.4428 103.137 76.4428 105.007C76.4428 106.877 75.4088 107.889 74.1658 107.889C72.9228 107.889 71.8888 106.877 71.8888 105.007ZM78.0708 105.007C78.0708 102.532 76.5418 100.882 74.1658 100.882C71.7898 100.882 70.2608 102.532 70.2608 105.007C70.2608 107.482 71.7898 109.143 74.1658 109.143C76.5418 109.143 78.0708 107.482 78.0708 105.007Z"
100
+ fill="#F3F3F3"
101
+ />
102
+ <path
103
+ d="M85.0133 109H86.7623L84.9913 105.546C85.9813 105.128 86.4323 104.358 86.4323 103.445C86.4323 101.773 85.4313 101.025 82.8023 101.025H80.1843V109H81.7573V105.876H83.0553H83.4293L85.0133 109ZM82.9783 102.257C84.0453 102.257 84.8153 102.532 84.8153 103.456C84.8153 104.237 84.2763 104.655 83.0553 104.655H81.7573V102.257H82.9783Z"
104
+ fill="#F3F3F3"
105
+ />
106
+ <path
107
+ d="M90.1424 109H91.7154V102.301H94.1794V101.025H87.6894V102.301H90.1424V109Z"
108
+ fill="#F3F3F3"
109
+ />
110
+ <g clip-path="url(#clip2_332_47939)">
111
+ <circle
112
+ cx="61.5"
113
+ cy="30"
114
+ r="28.125"
115
+ fill="url(#paint0_radial_332_47939)"
116
+ />
117
+ <circle
118
+ cx="61.5"
119
+ cy="30"
120
+ r="28.125"
121
+ fill="url(#paint1_radial_332_47939)"
122
+ />
123
+ <path
124
+ d="M61.5 0C44.9315 0 31.5 13.4315 31.5 30C31.5 46.5685 44.9315 60 61.5 60C78.0685 60 91.5 46.5685 91.5 30C91.5 13.4315 78.0685 0 61.5 0ZM60.3397 11.4576C61.1729 11.0494 62.0508 11.0774 62.8588 11.5359C65.6603 13.1323 68.4534 14.7428 71.2325 16.37C72.1272 16.8956 72.5857 17.7372 72.5885 18.7717C72.6053 22.3979 72.5997 26.0214 72.5885 29.6477C72.5885 29.7819 72.5019 29.9776 72.3928 30.0419C71.3164 30.685 70.226 31.3029 69.0433 31.9851V31.4147C69.0433 27.685 69.0322 23.9581 69.0517 20.2283C69.0545 19.5126 68.8085 19.0513 68.1738 18.6906C64.9222 16.8425 61.6873 14.9609 58.4469 13.0904C58.3071 13.0093 58.1701 12.9226 57.9576 12.794C58.7908 12.3215 59.5401 11.8462 60.3341 11.4576H60.3397ZM59.7442 48.5564C59.5624 48.4641 59.4282 48.3998 59.2968 48.3243C55.0051 45.8499 50.719 43.3588 46.4133 40.904C45.2055 40.2162 44.6547 39.2349 44.6687 37.8565C44.6938 34.9264 44.6855 31.9963 44.6715 29.0634C44.6659 27.7409 45.2027 26.7819 46.3658 26.1221C49.3882 24.4026 52.3938 22.658 55.3993 20.9105C55.6594 20.7596 55.8495 20.7344 56.1207 20.8966C57.158 21.52 58.2148 22.1156 59.3192 22.753C59.1095 22.8788 58.9501 22.9739 58.788 23.069C55.5335 24.9478 52.2847 26.8322 49.0219 28.6999C48.4879 29.0047 48.239 29.4017 48.2446 30.0224C48.2614 32.3318 48.2642 34.6412 48.2446 36.9506C48.239 37.5881 48.4935 37.9935 49.0415 38.3066C52.4832 40.2749 55.911 42.2656 59.35 44.2395C59.6407 44.4073 59.7637 44.5806 59.7582 44.9273C59.733 46.11 59.7498 47.2954 59.7498 48.5592L59.7442 48.5564ZM59.7442 41.9413C59.445 41.7707 59.2297 41.6505 59.0144 41.5247C56.2856 39.9506 53.5596 38.3709 50.8253 36.808C50.5289 36.6403 50.4199 36.4585 50.4226 36.1146C50.4422 34.3392 50.4338 32.5638 50.4282 30.7884C50.4282 30.548 50.4646 30.383 50.7022 30.2488C51.7088 29.6869 52.7041 29.0997 53.7022 28.5266C53.7749 28.4846 53.8532 28.4539 53.9846 28.3896V30.383C53.9846 31.4623 54.0014 32.5443 53.979 33.6235C53.9651 34.2386 54.2027 34.6552 54.7395 34.9571C56.2856 35.8294 57.8122 36.7353 59.3583 37.6048C59.6631 37.7754 59.7554 37.9655 59.7498 38.301C59.7302 39.4809 59.7414 40.6636 59.7414 41.9385L59.7442 41.9413ZM56.5932 18.6375C56.0144 18.2964 55.5196 18.2992 54.9408 18.6375C51.6976 20.5331 48.4404 22.4035 45.1859 24.2824C45.0489 24.3635 44.9063 24.4362 44.6631 24.5676C44.7498 23.3318 44.4842 22.1659 44.9063 21.0363C45.1356 20.4185 45.5662 19.9543 46.1365 19.6244C48.8514 18.0559 51.5634 16.4846 54.2838 14.9245C55.2763 14.3541 56.2884 14.3681 57.281 14.9413C60.3705 16.7195 63.4571 18.5033 66.5382 20.2926C66.6696 20.3681 66.8346 20.5387 66.8346 20.6673C66.8569 21.9366 66.8486 23.2088 66.8486 24.5704C65.7274 23.9245 64.6929 23.3262 63.6584 22.7279C61.3015 21.3663 58.939 20.0186 56.5932 18.6375ZM78.3033 38.5974C78.2223 39.5955 77.6379 40.3029 76.774 40.8006C73.4664 42.7018 70.1617 44.6142 66.8569 46.521C65.8197 47.1193 64.7824 47.7176 63.7423 48.3159C63.6165 48.3886 63.4879 48.4501 63.3173 48.5396C63.3061 48.3663 63.2922 48.2404 63.2922 48.1146C63.2922 47.0186 63.2978 45.9254 63.2866 44.8294C63.2866 44.5806 63.3453 44.4296 63.5746 44.2982C68.3947 41.5247 73.212 38.7428 78.0266 35.9637C78.0993 35.9217 78.1803 35.8882 78.3173 35.8239C78.3173 36.7968 78.3732 37.7027 78.3033 38.5974ZM78.3285 31.6971C78.3201 32.8322 77.7078 33.6291 76.7377 34.1883C72.9688 36.3551 69.2027 38.5331 65.4366 40.7083C64.7488 41.1053 64.0582 41.4995 63.3201 41.9245C63.3089 41.7372 63.295 41.6142 63.295 41.4883C63.295 40.4091 63.3062 39.3271 63.2866 38.2479C63.281 37.9404 63.3844 37.7782 63.65 37.6244C67.075 35.6589 70.4888 33.671 73.9194 31.7167C74.5289 31.37 74.7973 30.9422 74.7917 30.2265C74.7665 26.4967 74.7805 22.767 74.7805 19.0373V18.3858C75.6752 18.9254 76.514 19.37 77.2801 19.9124C77.979 20.4073 78.3313 21.1566 78.3341 22.0205C78.3453 25.247 78.3537 28.4734 78.3313 31.6999L78.3285 31.6971Z"
125
+ fill="#131313"
126
+ />
127
+ <path
128
+ fill-rule="evenodd"
129
+ clip-rule="evenodd"
130
+ d="M61.5 0C44.9315 0 31.5 13.4315 31.5 30C31.5 46.5685 44.9315 60 61.5 60C78.0685 60 91.5 46.5685 91.5 30C91.5 13.4315 78.0685 0 61.5 0ZM61.5 2.5C46.3122 2.5 34 14.8122 34 30C34 45.1878 46.3122 57.5 61.5 57.5C76.6878 57.5 89 45.1878 89 30C89 14.8122 76.6878 2.5 61.5 2.5Z"
131
+ fill="url(#paint2_radial_332_47939)"
132
+ />
133
+ <path
134
+ fill-rule="evenodd"
135
+ clip-rule="evenodd"
136
+ d="M61.5 0C44.9315 0 31.5 13.4315 31.5 30C31.5 46.5685 44.9315 60 61.5 60C78.0685 60 91.5 46.5685 91.5 30C91.5 13.4315 78.0685 0 61.5 0ZM61.5 2.5C46.3122 2.5 34 14.8122 34 30C34 45.1878 46.3122 57.5 61.5 57.5C76.6878 57.5 89 45.1878 89 30C89 14.8122 76.6878 2.5 61.5 2.5Z"
137
+ fill="url(#paint3_radial_332_47939)"
138
+ />
139
+ </g>
140
+ </g>
141
+ <defs>
142
+ <radialGradient
143
+ id="paint0_radial_332_47939"
144
+ cx="0"
145
+ cy="0"
146
+ r="1"
147
+ gradientUnits="userSpaceOnUse"
148
+ gradientTransform="translate(48.3053 16.7373) rotate(44.9817) scale(58.4359 123.929)"
149
+ >
150
+ <stop stop-color="#A3EEF8" />
151
+ <stop offset="0.177083" stop-color="#A4DCF5" />
152
+ <stop offset="0.380208" stop-color="#A6AEEC" />
153
+ <stop offset="1" stop-color="#ECBEE1" />
154
+ </radialGradient>
155
+ <radialGradient
156
+ id="paint1_radial_332_47939"
157
+ cx="0"
158
+ cy="0"
159
+ r="1"
160
+ gradientUnits="userSpaceOnUse"
161
+ gradientTransform="translate(63.9394 54.6335) rotate(84.265) scale(30.2672 57.9018)"
162
+ >
163
+ <stop stop-color="#FCF5EE" />
164
+ <stop offset="0.715135" stop-color="#ECBEE1" stop-opacity="0" />
165
+ </radialGradient>
166
+ <radialGradient
167
+ id="paint2_radial_332_47939"
168
+ cx="0"
169
+ cy="0"
170
+ r="1"
171
+ gradientUnits="userSpaceOnUse"
172
+ gradientTransform="translate(47.4257 15.8532) rotate(44.9817) scale(62.3316 132.191)"
173
+ >
174
+ <stop stop-color="#A3EEF8" />
175
+ <stop offset="0.177083" stop-color="#A4DCF5" />
176
+ <stop offset="0.380208" stop-color="#A6AEEC" />
177
+ <stop offset="1" stop-color="#ECBEE1" />
178
+ </radialGradient>
179
+ <radialGradient
180
+ id="paint3_radial_332_47939"
181
+ cx="0"
182
+ cy="0"
183
+ r="1"
184
+ gradientUnits="userSpaceOnUse"
185
+ gradientTransform="translate(64.102 56.2758) rotate(84.265) scale(32.2851 61.7619)"
186
+ >
187
+ <stop stop-color="#FCF5EE" />
188
+ <stop offset="0.715135" stop-color="#ECBEE1" stop-opacity="0" />
189
+ </radialGradient>
190
+ <clipPath id="clip0_332_47939">
191
+ <rect
192
+ width="123"
193
+ height="112"
194
+ fill="white"
195
+ transform="translate(0.5)"
196
+ />
197
+ </clipPath>
198
+ <clipPath id="clip1_332_47939">
199
+ <rect
200
+ width="123"
201
+ height="19"
202
+ fill="white"
203
+ transform="translate(0.5 75)"
204
+ />
205
+ </clipPath>
206
+ <clipPath id="clip2_332_47939">
207
+ <rect
208
+ width="60"
209
+ height="60"
210
+ fill="white"
211
+ transform="translate(31.5)"
212
+ />
213
+ </clipPath>
214
+ </defs>
215
+ </svg>
216
+ `;l();a();var pr=()=>`
217
+ <button
218
+ id="${F}"
219
+ style="
220
+ background: #f3f3f326 !important;
221
+ border: none !important;
222
+ border-radius: 50% !important;
223
+ width: 48px !important;
224
+ height: 48px !important;
225
+ position: absolute !important;
226
+ top: 40px !important;
227
+ right: 40px !important;
228
+ cursor: pointer !important;
229
+ display: flex !important;
230
+ align-items: center !important;
231
+ justify-content: center !important;
232
+ "
233
+ >
234
+ ${he}
235
+ </button>
236
+ `,Ee=()=>`
237
+ <button
238
+ id="${V}"
239
+ style="
240
+ margin-top: 27px !important;
241
+ color: #f3f3f3 !important;
242
+ background: transparent !important;
243
+ padding: 12px 24px !important;
244
+ border-radius: 30px !important;
245
+ border: 2px solid #f3f3f3 !important;
246
+ font-size: 1em !important;
247
+ font-weight: 500 !important;
248
+ cursor: pointer !important;
249
+ "
250
+ >
251
+ Try again
252
+ </button>
253
+ `,mr=()=>`
254
+ ${te}
255
+ <div
256
+ style="
257
+ color: #e01a3d !important;
258
+ display: flex !important;
259
+ align-items: center !important;
260
+ gap: 4px !important;
261
+ margin-bottom: 10px !important;
262
+ "
263
+ >
264
+ ${ve}
265
+ Pop-up blocked
266
+ </div>
267
+ <p style="
268
+ color: #b6b6b6 !important;
269
+ text-align: center !important;
270
+ margin: 0 !important;
271
+ "
272
+ >
273
+ Please try again below.<br />
274
+ If the problem continues, adjust your<br />
275
+ browser settings.
276
+ </p>
277
+ ${Ee()}
278
+ `,fr=()=>`
279
+ ${te}
280
+ <p style="
281
+ color: #b6b6b6 !important;
282
+ text-align: center !important;
283
+ margin: 0 !important;
284
+ "
285
+ >
286
+ Secure pop-up not showing?<br />We'll help you re-launch
287
+ </p>
288
+ ${Ee()}
289
+ `,_e=r=>`
290
+ <div
291
+ id="${b}"
292
+ style="
293
+ position: fixed !important;
294
+ top: 0 !important;
295
+ left: 0 !important;
296
+ width: 100% !important;
297
+ height: 100% !important;
298
+ background: rgba(13, 13, 13, 0.48) !important;
299
+ backdrop-filter: blur(28px) !important;
300
+ -webkit-backdrop-filter: blur(28px) !important;
301
+ display: flex !important;
302
+ flex-direction: column !important;
303
+ justify-content: center !important;
304
+ align-items: center !important;
305
+ font-size: 16px !important;
306
+ line-height: 1.5 !important;
307
+ font-family: Roboto !important;
308
+ font-style: normal !important;
309
+ font-weight: 400 !important;
310
+ font-feature-settings: 'clig' off, 'liga' off !important;
311
+ z-index: 2147483647 !important;
312
+ "
313
+ >
314
+ ${pr()}
315
+ <div
316
+ id="${M}"
317
+ style="
318
+ display: flex !important;
319
+ flex-direction: column !important;
320
+ align-items: center !important;
321
+ max-width: 400px !important;
322
+ "
323
+ >
324
+ ${r??""}
325
+ </div>
326
+ </div>
327
+ `,Ce=()=>`
328
+ <div
329
+ id="${b}"
330
+ style="
331
+ position: fixed;
332
+ top: 0;
333
+ left: 0;
334
+ width: 100%;
335
+ height: 100%;
336
+ display: flex;
337
+ flex-direction: column;
338
+ justify-content: center;
339
+ align-items: center;
340
+ z-index: 2147483647;
341
+ background: rgba(247, 247, 247, 0.24);
342
+ animation-name: passportEmbeddedLoginPromptOverlayFadeIn;
343
+ animation-duration: 0.8s;
344
+ "
345
+ >
346
+ <div
347
+ id="${M}"
348
+ style="
349
+ display: flex;
350
+ flex-direction: column;
351
+ align-items: center;
352
+ width: 100%;
353
+ "
354
+ />
355
+ </div>
356
+ `;function G({id:r,href:e,rel:t,crossOrigin:n}){let i=`${b}-${r}`;if(!document.getElementById(i)){let o=document.createElement("link");o.id=i,o.href=e,t&&(o.rel=t),n&&(o.crossOrigin=n),document.head.appendChild(o);}}var ye=()=>_e(mr()),Oe=()=>_e(fr());var U=class{disableGenericPopupOverlay;disableBlockedPopupOverlay;overlay;isBlockedOverlay;tryAgainListener;onCloseListener;constructor(e,t=!1){this.disableBlockedPopupOverlay=e.disableBlockedPopupOverlay||!1,this.disableGenericPopupOverlay=e.disableGenericPopupOverlay||!1,this.isBlockedOverlay=t;}append(e,t){this.shouldAppendOverlay()&&(this.appendOverlay(),this.updateTryAgainButton(e),this.updateCloseButton(t));}update(e){this.updateTryAgainButton(e);}remove(){this.overlay&&this.overlay.remove();}shouldAppendOverlay(){return !(this.disableGenericPopupOverlay&&this.disableBlockedPopupOverlay||this.disableGenericPopupOverlay&&!this.isBlockedOverlay||this.disableBlockedPopupOverlay&&this.isBlockedOverlay)}appendOverlay(){if(!this.overlay){G({id:"link-googleapis",href:"https://fonts.googleapis.com"}),G({id:"link-gstatic",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),G({id:"link-roboto",href:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap",rel:"stylesheet"});let t=document.createElement("div");t.innerHTML=this.isBlockedOverlay?ye():Oe(),document.body.insertAdjacentElement("beforeend",t),this.overlay=t;}}updateTryAgainButton(e){let t=document.getElementById(V);t&&(this.tryAgainListener&&t.removeEventListener("click",this.tryAgainListener),this.tryAgainListener=e,t.addEventListener("click",e));}updateCloseButton(e){let t=document.getElementById(F);t&&(this.onCloseListener&&t.removeEventListener("click",this.onCloseListener),this.onCloseListener=e,t.addEventListener("click",e));}};l();a();var B=class{storage;constructor(e,t){this.storage=gr.createInstance({name:e,driver:t});}get length(){return this.storage.length()}clear(){return this.storage.clear()}getItem(e){return this.storage.getItem(e)}key(e){return this.storage.key(e)}async removeItem(e){await this.storage.removeItem(e);}async setItem(e,t){await this.storage.setItem(e,t);}};var Pr=500,br={headers:{"Content-Type":"application/x-www-form-urlencoded"}},wr="/v2/logout",Ir="/im-logged-out",Ar="/authorize",xr=r=>r?Ir:wr,kr=r=>{let{authenticationDomain:e,oidcConfiguration:t}=r,n;r.crossSdkBridgeEnabled?n=new B("ImmutableSDKPassport",gr.INDEXEDDB):typeof window<"u"?n=window.localStorage:n=new InMemoryWebStorage;let i=new WebStorageStateStore({store:n}),o=new URL(xr(r.crossSdkBridgeEnabled),e.replace(/^(?:https?:\/\/)?(.*)/,"https://$1"));return o.searchParams.set("client_id",t.clientId),t.logoutRedirectUri&&o.searchParams.set("returnTo",t.logoutRedirectUri),{authority:e,redirect_uri:t.redirectUri,popup_redirect_uri:t.popupRedirectUri||t.redirectUri,client_id:t.clientId,metadata:{authorization_endpoint:`${e}/authorize`,token_endpoint:`${e}/oauth/token`,userinfo_endpoint:`${e}/userinfo`,end_session_endpoint:o.toString(),revocation_endpoint:`${e}/oauth/revoke`},automaticSilentRenew:!1,scope:t.scope,userStore:i,revokeTokenTypes:["refresh_token"],extraQueryParams:{...t.audience?{audience:t.audience}:{}}}};function re(r){return btoa(String.fromCharCode(...new Uint8Array(r))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}async function Mr(r){let t=new TextEncoder().encode(r);return await window.crypto.subtle.digest("SHA-256",t)}var w=class r{userManager;deviceCredentialsManager;config;embeddedLoginPrompt;logoutMode;refreshingPromise=null;constructor(e,t){this.config=e,this.userManager=new UserManager(kr(e)),this.deviceCredentialsManager=new x,this.embeddedLoginPrompt=t,this.logoutMode=e.oidcConfiguration.logoutMode||"redirect";}static mapOidcUserToDomainModel=e=>{let t;e.id_token&&(t=Re(e.id_token)?.passport);let n={expired:e.expired,idToken:e.id_token,accessToken:e.access_token,refreshToken:e.refresh_token,profile:{sub:e.profile.sub,email:e.profile.email,nickname:e.profile.nickname}};return t?.imx_eth_address&&(n.imx={ethAddress:t.imx_eth_address,starkAddress:t.imx_stark_address,userAdminAddress:t.imx_user_admin_address}),t?.zkevm_eth_address&&(n.zkEvm={ethAddress:t?.zkevm_eth_address,userAdminAddress:t?.zkevm_user_admin_address}),n};static mapDeviceTokenResponseToOidcUser=e=>{let t=Re(e.id_token);return new User({id_token:e.id_token,access_token:e.access_token,refresh_token:e.refresh_token,token_type:e.token_type,profile:{sub:t.sub,iss:t.iss,aud:t.aud,exp:t.exp,iat:t.iat,email:t.email,nickname:t.nickname,passport:t.passport}})};buildExtraQueryParams(e,t){let n={...this.userManager.settings?.extraQueryParams??{},rid:getDetail(Detail.RUNTIME_ID)||"",third_party_a_id:""};if(e){if(e.directLoginMethod==="email"){let i=e.email;i&&(n.direct=e.directLoginMethod,n.email=i);}else n.direct=e.directLoginMethod;e.marketingConsentStatus&&(n.marketingConsent=e.marketingConsentStatus);}return t&&(n.im_passport_trace_id=t),n}async loginWithRedirect(e){return await this.userManager.clearStaleState(),L(async()=>{let t=this.buildExtraQueryParams(e);await this.userManager.signinRedirect({extraQueryParams:t});},"AUTHENTICATION_ERROR")}async login(e){return L(async()=>{let t,n;if(e)t=e;else if(!this.config.popupOverlayOptions?.disableHeadlessLoginPromptOverlay){let{imPassportTraceId:s,...d}=await this.embeddedLoginPrompt.displayEmbeddedLoginPrompt();t=d,n=s;}let i=window.crypto.randomUUID(),o=async()=>{let s=this.buildExtraQueryParams(t,n),d=this.userManager.signinPopup({extraQueryParams:s,popupWindowFeatures:{width:410,height:450},popupWindowTarget:i}),f=window.open("",i);if(f){let _=new Promise((u,y)=>{let oe=setInterval(()=>{f.closed&&(clearInterval(oe),y(new Error("Popup closed by user")));},Pr);d.finally(()=>{clearInterval(oe),f.close();});});return Promise.race([d,_])}return d};return new Promise((s,d)=>{o().then(f=>{s(r.mapOidcUserToDomainModel(f));}).catch(f=>{if(!(f instanceof Error)||f.message!=="Attempted to navigate on a disposed window"){d(f);return}let _=!1,u=new U(this.config.popupOverlayOptions||{},!0);u.append(async()=>{try{if(_)window.open("",i);else {_=!0;let y=await o();u.remove(),s(r.mapOidcUserToDomainModel(y));}}catch(y){u.remove(),d(y);}},()=>{u.remove(),d(new Error("Popup closed by user"));});});})},"AUTHENTICATION_ERROR")}async getUserOrLogin(){let e=null;try{e=await this.getUser();}catch(t){k.warn("Failed to retrieve a cached user session",t);}return e||this.login()}static shouldUseSigninPopupCallback(){try{let n=`oidc.${new URLSearchParams(window.location.search).get("state")}`,i=localStorage.getItem(n);return JSON.parse(i||"{}")?.request_type==="si:p"}catch{return !1}}async loginCallback(){return L(async()=>{if(r.shouldUseSigninPopupCallback()){await this.userManager.signinPopupCallback(void 0,!0);return}let e=await this.userManager.signinCallback();if(e)return r.mapOidcUserToDomainModel(e)},"AUTHENTICATION_ERROR")}async getPKCEAuthorizationUrl(e,t){let n=re(window.crypto.getRandomValues(new Uint8Array(32))),i=re(await Mr(n)),o=re(window.crypto.getRandomValues(new Uint8Array(32))),{redirectUri:s,scope:d,audience:f,clientId:_}=this.config.oidcConfiguration;this.deviceCredentialsManager.savePKCEData({state:o,verifier:n});let u=new URL(Ar,this.config.authenticationDomain);if(u.searchParams.set("response_type","code"),u.searchParams.set("code_challenge",i),u.searchParams.set("code_challenge_method","S256"),u.searchParams.set("client_id",_),u.searchParams.set("redirect_uri",s),u.searchParams.set("state",o),d&&u.searchParams.set("scope",d),f&&u.searchParams.set("audience",f),e){if(e.directLoginMethod==="email"){let y=e.email;y&&(u.searchParams.set("direct",e.directLoginMethod),u.searchParams.set("email",y));}else u.searchParams.set("direct",e.directLoginMethod);e.marketingConsentStatus&&u.searchParams.set("marketingConsent",e.marketingConsentStatus);}return t&&u.searchParams.set("im_passport_trace_id",t),u.toString()}async loginWithPKCEFlowCallback(e,t){return L(async()=>{let n=this.deviceCredentialsManager.getPKCEData();if(!n)throw new Error("No code verifier or state for PKCE");if(t!==n.state)throw new Error("Provided state does not match stored state");let i=await this.getPKCEToken(e,n.verifier),o=r.mapDeviceTokenResponseToOidcUser(i),s=r.mapOidcUserToDomainModel(o);return await this.userManager.storeUser(o),s},"AUTHENTICATION_ERROR")}async getPKCEToken(e,t){return (await Or.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"authorization_code",code_verifier:t,code:e,redirect_uri:this.config.oidcConfiguration.redirectUri},br)).data}async storeTokens(e){return L(async()=>{let t=r.mapDeviceTokenResponseToOidcUser(e),n=r.mapOidcUserToDomainModel(t);return await this.userManager.storeUser(t),n},"AUTHENTICATION_ERROR")}async logout(){return L(async()=>{await this.userManager.revokeTokens(["refresh_token"]),this.logoutMode==="silent"?await this.userManager.signoutSilent():await this.userManager.signoutRedirect();},"LOGOUT_ERROR")}async logoutSilentCallback(e){return this.userManager.signoutSilentCallback(e)}async removeUser(){return this.userManager.removeUser()}async getLogoutUrl(){let e=this.userManager.settings?.metadata?.end_session_endpoint;return e||(k.warn("Failed to get logout URL"),null)}forceUserRefreshInBackground(){this.refreshTokenAndUpdatePromise().catch(e=>{k.warn("Failed to refresh user token",e);});}async forceUserRefresh(){return this.refreshTokenAndUpdatePromise().catch(e=>(k.warn("Failed to refresh user token",e),null))}async refreshTokenAndUpdatePromise(){return this.refreshingPromise?this.refreshingPromise:(this.refreshingPromise=new Promise(async(e,t)=>{try{let n=await this.userManager.signinSilent();if(n){e(r.mapOidcUserToDomainModel(n));return}e(null);}catch(n){let i="AUTHENTICATION_ERROR",o="Failed to refresh token",s=!0;if(n instanceof ErrorTimeout?(i="SILENT_LOGIN_ERROR",o=`${o}: ${n.message}`,s=!1):n instanceof ErrorResponse?(i="NOT_LOGGED_IN_ERROR",o=`${o}: ${n.message||n.error_description}`):n instanceof Error?o=`${o}: ${n.message}`:typeof n=="string"&&(o=`${o}: ${n}`),s)try{await this.userManager.removeUser();}catch(d){d instanceof Error&&(o=`${o}: Failed to remove user: ${d.message}`);}t(new v(o,i));}finally{this.refreshingPromise=null;}}),this.refreshingPromise)}async getUser(e=t=>!0){if(this.refreshingPromise){let n=await this.refreshingPromise;return n&&e(n)?n:null}let t=await this.userManager.getUser();if(!t)return null;if(!me(t)){let n=r.mapOidcUserToDomainModel(t);if(n&&e(n))return n}if(t.refresh_token){let n=await this.refreshTokenAndUpdatePromise();if(n&&e(n))return n}return null}async getUserZkEvm(){let e=await this.getUser(Q);if(!e)throw new Error("Failed to obtain a User with the required ZkEvm attributes");return e}async getUserImx(){let e=await this.getUser(J);if(!e)throw new Error("Failed to obtain a User with the required IMX attributes");return e}};l();a();var Ur=(r,e,t)=>{let n=e.map(i=>!r[i]&&i).filter(i=>i).join(", ");if(n!==""){let i=`${n} cannot be null`;throw new v(i,"INVALID_CONFIGURATION")}},N=class{authenticationDomain;passportDomain;oidcConfiguration;crossSdkBridgeEnabled;popupOverlayOptions;constructor({authenticationDomain:e,passportDomain:t,crossSdkBridgeEnabled:n,popupOverlayOptions:i,...o}){Ur(o,["clientId","redirectUri"]),this.oidcConfiguration=o,this.crossSdkBridgeEnabled=n||!1,this.popupOverlayOptions=i,this.authenticationDomain=e||"https://auth.immutable.com",this.passportDomain=t||"https://passport.immutable.com";}};l();a();l();a();var Le="im_passport_embedded_login_prompt";l();a();var E=class{static overlay;static onCloseListener;static closeButton;static remove(){this.onCloseListener&&this.closeButton?.removeEventListener?.("click",this.onCloseListener),this.overlay?.remove(),this.closeButton=void 0,this.onCloseListener=void 0,this.overlay=void 0;}static appendOverlay(e,t){if(!this.overlay){let n=document.createElement("div");n.innerHTML=Ce(),document.body.insertAdjacentElement("beforeend",n);let i=document.querySelector(`#${M}`);i&&i.appendChild(e),n.addEventListener("click",t),this.overlay=n;}}};var Sr=660,Hr=440,Fr="16px",Te="passport-embedded-login-keyframes",Pe="passport-embedded-login-iframe",D=class r{config;constructor(e){this.config=e;}getHref=()=>`${this.config.authenticationDomain}/im-embedded-login-prompt?client_id=${this.config.oidcConfiguration.clientId}&rid=${getDetail(Detail.RUNTIME_ID)}`;static appendIFrameStylesIfNeeded=()=>{if(document.getElementById(Te))return;let e=document.createElement("style");e.id=Te,e.textContent=`
357
+ @keyframes passportEmbeddedLoginPromptPopBounceIn {
358
+ 0% {
359
+ opacity: 0.5;
360
+ }
361
+ 50% {
362
+ opacity: 1;
363
+ transform: scale(1.05);
364
+ }
365
+ 75% {
366
+ transform: scale(0.98);
367
+ }
368
+ 100% {
369
+ opacity: 1;
370
+ transform: scale(1);
371
+ }
372
+ }
373
+
374
+ @media (max-height: 400px) {
375
+ #${Pe} {
376
+ width: 100% !important;
377
+ max-width: none !important;
378
+ }
379
+ }
380
+
381
+ @keyframes passportEmbeddedLoginPromptOverlayFadeIn {
382
+ from {
383
+ opacity: 0;
384
+ }
385
+ to {
386
+ opacity: 1;
387
+ }
388
+ }
389
+ `,document.head.appendChild(e);};getEmbeddedLoginIFrame=()=>{let e=document.createElement("iframe");return e.id=Pe,e.src=this.getHref(),e.style.height="100vh",e.style.width="100vw",e.style.maxHeight=`${Sr}px`,e.style.maxWidth=`${Hr}px`,e.style.borderRadius=Fr,e.style.opacity="0",e.style.transform="scale(0.6)",e.style.animation="passportEmbeddedLoginPromptPopBounceIn 1s ease forwards",r.appendIFrameStylesIfNeeded(),e};displayEmbeddedLoginPrompt(){return new Promise((e,t)=>{let n=this.getEmbeddedLoginIFrame(),i=({data:o,origin:s})=>{if(!(s!==this.config.authenticationDomain||o.eventType!==Le))switch(o.messageType){case"login_method_selected":{let d=o.payload;window.removeEventListener("message",i),E.remove(),e(d);break}case"login_prompt_error":{window.removeEventListener("message",i),E.remove(),t(new Error("Error during embedded login prompt",{cause:o.payload}));break}case"login_prompt_closed":{window.removeEventListener("message",i),E.remove(),t(new Error("Popup closed by user"));break}default:window.removeEventListener("message",i),E.remove(),t(new Error(`Unsupported message type: ${o.messageType}`));break}};window.addEventListener("message",i),E.appendOverlay(n,()=>{window.removeEventListener("message",i),E.remove(),t(new Error("Popup closed by user"));});})}};l();a();var He=$e(Se()),A=class{emitter=new He.EventEmitter;emit(e,...t){this.emitter.emit(e,...t);}on(e,t){this.emitter.on(e,t);}removeListener(e,t){this.emitter.removeListener(e,t);}};var ie=class{authManager;config;eventEmitter;constructor(e){this.config=new N(e);let t=new D(this.config);this.authManager=new w(this.config,t),this.eventEmitter=new A,track("passport","initialise");}async login(e){return this.authManager.login(e)}async loginWithRedirect(e){await this.authManager.loginWithRedirect(e);}async loginWithOptions(e){let{useCachedSession:t=!1,useSilentLogin:n}=e||{},i=null;try{i=await this.authManager.getUser();}catch(o){if(t)throw o}if(!i&&n&&(i=await this.authManager.forceUserRefresh()),!i&&!t){if(e?.useRedirectFlow)return await this.authManager.loginWithRedirect(e?.directLoginOptions),null;i=await this.authManager.login(e?.directLoginOptions);}return i&&(this.eventEmitter.emit("loggedIn",i),identify({passportId:i.profile.sub})),i}async loginCallback(){let e=await this.authManager.loginCallback();if(!e)throw new Error("Login callback failed - no user returned");return this.eventEmitter.emit("loggedIn",e),identify({passportId:e.profile.sub}),e}async logout(){await this.authManager.logout(),this.eventEmitter.emit("loggedOut");}async getUser(){return this.authManager.getUser()}async getIdToken(){return (await this.authManager.getUser())?.idToken}async getAccessToken(){return (await this.authManager.getUser())?.accessToken}async isLoggedIn(){return await this.getUser()!==null}async forceUserRefresh(){return this.authManager.forceUserRefresh()}async loginWithPKCEFlow(e,t){return this.authManager.getPKCEAuthorizationUrl(e,t)}async loginWithPKCEFlowCallback(e,t){let n=await this.authManager.loginWithPKCEFlowCallback(e,t);return this.eventEmitter.emit("loggedIn",n),identify({passportId:n.profile.sub}),n}async storeTokens(e){let t=await this.authManager.storeTokens(e);return this.eventEmitter.emit("loggedIn",t),identify({passportId:t.profile.sub}),t}async getLogoutUrl(){return await this.authManager.removeUser(),this.eventEmitter.emit("loggedOut"),await this.authManager.getLogoutUrl()||void 0}async logoutSilentCallback(e){return this.authManager.logoutSilentCallback(e)}getAuthManager(){return this.authManager}getConfig(){return this.config}};
390
+
391
+ export { ie as Auth, N as AuthConfiguration, ee as AuthEvents, w as AuthManager, ge as MarketingConsentStatus, v as PassportError, H as PassportErrorType, fe as RollupType, A as TypedEventEmitter, J as isUserImx, Q as isUserZkEvm, L as withPassportError };