@wellesley/host-remote 1.0.471 → 1.0.473

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.
Files changed (2) hide show
  1. package/index.mjs +1 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{subscribeAfter as bs}from"https://cdn.jsdelivr.net/npm/@wellesley/redux-subscribe-action@1.0.373";import $_,{useRef as lr,useCallback as Ue,useEffect as le,useState as Wu,memo as zs}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{getStore as ze,hydrate as V_,createStore as J_}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.628";import{api as Ss,handleBasicResponse as Pt}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.629";import{createSlice as K_,createAction as qs}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{toast as $s}from"https://cdn.jsdelivr.net/npm/react-toastify@10.0.5/+esm";import{getErrorMsg as Q_}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.480";import{useDispatch as ei,useSelector as Ee}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{routerSlice as Re}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.557";import{useLocation as Vs,useBlocker as H_,useNavigate as Js}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";import{Dialog as Y_,DialogContent as G_,cn as xs,ButtonLoader as As}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.591";import{handleLogin as Z_,handleLogout as X_}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.685";const $r="8.48.0",he=globalThis;function Nu(t,n,e){const r=he,i=r.__SENTRY__=r.__SENTRY__||{},o=i[$r]=i[$r]||{};return o[t]||(o[t]=n())}const Ks=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,tv="Sentry Logger ",Is=["debug","info","warn","error","log","assert","trace"],Es={};function ev(t){if(!("console"in he))return t();const n=he.console,e={},r=Object.keys(Es);r.forEach((t=>{const r=Es[t];e[t]=n[t],n[t]=r}));try{return t()}finally{r.forEach((t=>{n[t]=e[t]}))}}function rv(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Ks?Is.forEach((e=>{n[e]=(...n)=>{t&&ev((()=>{he.console[e](`${tv}[${e}]:`,...n)}))}})):Is.forEach((t=>{n[t]=()=>{}})),n}const Gn=Nu("logger",rv);function Tu(){return Fu(he),he}function Fu(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||$r,n[$r]=n[$r]||{}}const nv=Object.prototype.toString;function iv(t,n){return nv.call(t)===`[object ${n}]`}function uv(t){return iv(t,"Object")}function ov(t){return!(!t||!t.then||"function"!=typeof t.then)}function av(t,n,e){try{Object.defineProperty(t,n,{value:e,writable:!0,configurable:!0})}catch{Ks&&Gn.log(`Failed to add non-enumerable property "${n}" to object`,t)}}const Qs=1e3;function Hs(){return Date.now()/Qs}function sv(){const{performance:t}=he;if(!t||!t.now)return Hs;const n=Date.now()-t.now(),e=null==t.timeOrigin?n:t.timeOrigin;return()=>(e+t.now())/Qs}const cv=sv();function fr(){const t=he,n=t.crypto||t.msCrypto;let e=()=>16*Math.random();try{if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");n&&n.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(t=>(t^(15&e())>>t/4).toString(16)))}function fv(t,n={}){if(n.user&&(!t.ipAddress&&n.user.ip_address&&(t.ipAddress=n.user.ip_address),!t.did&&!n.did&&(t.did=n.user.id||n.user.email||n.user.username)),t.timestamp=n.timestamp||cv(),n.abnormal_mechanism&&(t.abnormal_mechanism=n.abnormal_mechanism),n.ignoreDuration&&(t.ignoreDuration=n.ignoreDuration),n.sid&&(t.sid=32===n.sid.length?n.sid:fr()),void 0!==n.init&&(t.init=n.init),!t.did&&n.did&&(t.did=`${n.did}`),"number"==typeof n.started&&(t.started=n.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof n.duration)t.duration=n.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}n.release&&(t.release=n.release),n.environment&&(t.environment=n.environment),!t.ipAddress&&n.ipAddress&&(t.ipAddress=n.ipAddress),!t.userAgent&&n.userAgent&&(t.userAgent=n.userAgent),"number"==typeof n.errors&&(t.errors=n.errors),n.status&&(t.status=n.status)}function Rs(){return fr()}function Os(){return fr().substring(16)}function Ys(t,n,e=2){if(!n||"object"!=typeof n||e<=0)return n;if(t&&n&&0===Object.keys(n).length)return t;const r={...t};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=Ys(r[t],n[t],e-1));return r}(()=>{const{performance:t}=he;if(!t||!t.now)return;const n=36e5,e=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+e-r):n,o=i<n,u=t.timing&&t.timing.navigationStart,a="number"==typeof u?Math.abs(u+e-r):n;(o||a<n)&&(i<=a&&t.timeOrigin)})();const ku="_sentrySpan";function Cs(t,n){n?av(t,ku,n):delete t[ku]}function ks(t){return t[ku]}const lv=100;class Bu{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Rs(),spanId:Os()}}clone(){const t=new Bu;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,Cs(t,ks(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&fv(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this._tags={...this._tags,[t]:n},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return null===n?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,[e,r]=n instanceof Vr?[n.getScopeData(),n.getRequestSession()]:uv(n)?[t,t.requestSession]:[],{tags:i,extra:o,user:u,contexts:a,level:s,fingerprint:c=[],propagationContext:l}=e||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},u&&Object.keys(u).length&&(this._user=u),s&&(this._level=s),c.length&&(this._fingerprint=c),l&&(this._propagationContext=l),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Cs(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Rs()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const e="number"==typeof n?n:lv;if(e<=0)return this;const r={timestamp:Hs(),...t},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>e?i.slice(-e):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ks(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Ys(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:Os(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,n){const e=n&&n.event_id?n.event_id:fr();if(!this._client)return Gn.warn("No client configured on scope - will not capture exception!"),e;const r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...n,event_id:e},this),e}captureMessage(t,n,e){const r=e&&e.event_id?e.event_id:fr();if(!this._client)return Gn.warn("No client configured on scope - will not capture message!"),r;const i=new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...e,event_id:r},this),r}captureEvent(t,n){const e=n&&n.event_id?n.event_id:fr();return this._client?(this._client.captureEvent(t,{...n,event_id:e},this),e):(Gn.warn("No client configured on scope - will not capture event!"),e)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}}const Vr=Bu;function hv(){return Nu("defaultCurrentScope",(()=>new Vr))}function pv(){return Nu("defaultIsolationScope",(()=>new Vr))}class dv{constructor(t,n){let e,r;e=t||new Vr,r=n||new Vr,this._stack=[{scope:e}],this._isolationScope=r}withScope(t){const n=this._pushScope();let e;try{e=t(n)}catch(t){throw this._popScope(),t}return ov(e)?e.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(this._popScope(),e)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function hr(){const t=Fu(Tu());return t.stack=t.stack||new dv(hv(),pv())}function gv(t){return hr().withScope(t)}function _v(t,n){const e=hr();return e.withScope((()=>(e.getStackTop().scope=t,n(t))))}function Ps(t){return hr().withScope((()=>t(hr().getIsolationScope())))}function vv(){return{withIsolationScope:Ps,withScope:gv,withSetScope:_v,withSetIsolationScope:(t,n)=>Ps(n),getCurrentScope:()=>hr().getScope(),getIsolationScope:()=>hr().getIsolationScope()}}function Gs(t){const n=Fu(t);return n.acs?n.acs:vv()}function Zs(){return Gs(Tu()).getCurrentScope()}function yv(){return Gs(Tu()).getIsolationScope()}function mv(t,n){return Zs().captureException(t,void 0)}function wv(t,n){const e={captureContext:n};return Zs().captureMessage(t,void 0,e)}function bv(t,n){yv().setExtra(t,n)}var Hn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const Sv=(...t)=>{let n="";for(const e of t){if(e instanceof Error){const t=e;return bv("exceptionMessage",n),void mv(t)}if("object"!=typeof e)n+=e;else try{n+=" "+JSON.stringify(e)}catch{n+=" "+e}}wv(n)},xv=()=>"object"!=typeof window,Av="wlsy",Xs=()=>{try{return window.localStorage}catch(t){console.warn("Error getting window.localStorage storage",t)}},Iv=()=>{const t=new Set,n=Xs();if(!n)return[];for(let e=0;e<(null==n?void 0:n.length);e+=1){const r=null==n?void 0:n.key(e);"string"==typeof r&&t.add(r)}return Array.from(t)},Du=t=>{const n=`${Av}${t?`:${t}`:""}`,e=t=>`${n}:${t}`,r=()=>Iv().filter((t=>t.startsWith(`${n}:`))),i=t=>t.slice(n.length+1),o=Xs(),u=t=>{try{return null==o?void 0:o.getItem(e(t))}catch{return null}},a=(t,n)=>{try{null==o||o.setItem(e(t),String(n))}catch{return}};return{getItem:u,setItem:a,removeItem:t=>{try{null==o||o.removeItem(e(t))}catch{return}},clear:()=>{try{r().forEach((t=>null==o?void 0:o.removeItem(t)))}catch{return}},keys:()=>r().map(i),has:t=>null!==u(t),getJSON:t=>{const n=u(t);if(null==n)return null;try{return JSON.parse(n)}catch{return null}},setJSON:(t,n)=>{try{a(t,JSON.stringify(n))}catch{return}}}},Ls=["debug","info","warn","error"],Ev=(t,n)=>{const e=Ls.indexOf(t);return Ls.indexOf(n)>=e},Yn=(t,n,e,...r)=>{Ev(n,t)&&console.log(`[${t}] ${e}`,...r)},Rv=()=>Du().getItem("logger_lvl"),Ov=(t=(xv()?"info":Rv()||"warn"))=>{let n=t;return{debug:(t,...e)=>Yn("debug",n,t,...e),info:(t,...e)=>Yn("info",n,t,...e),warn:(t,...e)=>Yn("warn",n,t,...e),error:(t,...e)=>(Sv(t,...e),Yn("error",n,t,...e)),setLevel:t=>{n=t},getLevel:()=>n}},ri=Ov(),ni="staticState",tc=Du(),Zn={path:"",baseUrl:"",search:""},Cv=t=>{if(!t)return Zn;try{return JSON.parse(decodeURIComponent(t))||Zn}catch(t){return ri.error("Error parsing static state",t),Zn}},ec=()=>new URLSearchParams(window.location.search).get(ni),kv=({path:t,baseUrl:n,search:e}={})=>{const{pathname:r,origin:i,search:o}=window.location;return`${ni}=${encodeURIComponent(JSON.stringify({path:t||r,baseUrl:n||i,search:e||o}))}`},Pv=()=>{const t=ec();return t&&tc.setItem(ni,t),rc()},rc=()=>{try{const t=tc.getItem(ni)||ec();return Cv(t)}catch(t){return ri.error("Error parsing static state",t),Zn}},Lv={create:kv,init:Pv,get:rc},Mu=({onMessage:t,whitelist:n,sourceWindow:e})=>{const r=r=>{const i=r.origin===window.location.origin,o=!e||r.source===e,u=r.data&&"object"==typeof r.data&&"type"in r.data,a=n.some((({type:t})=>t===r.data.type||"*"===t));!i&&o&&u&&a&&t(r.data)};return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},jv=t=>{try{const{type:n,payload:e}=t,r={type:n};return void 0!==e&&(r.payload=JSON.parse(JSON.stringify(e))),r}catch(n){return ri.warn(`Could not serialize action type: ${t.type}`,n),{type:t.type,payload:`[Non-serializable payload for action: ${t.type}]`}}},Uu=({action:t,windowElement:n,whitelist:e})=>{if(n)try{const{type:r}=t;if(!e.some((({type:t})=>t===r||"*"===t)))return;const i=jv(t);n.postMessage(i,"*")}catch(t){ri.error("Failed to process or send message:",t)}},nc=({sourceWindow:t,sendWhitelist:n,receiveWhitelist:e,onMessage:r,onAction:i,name:o})=>{const u=lr((()=>{})),a=lr((()=>{}));return Ue((o=>{if(o)return u.current(),a.current(),u.current=bs((t=>{null==i||i(t),Uu({action:t,windowElement:o,whitelist:n})})),a.current=Mu({sourceWindow:t,onMessage:t=>{r?r(t):ze().dispatch(t)},whitelist:e}),()=>{u.current(),a.current()}}),[t,n,e,r,bs,i,o])},Wv=t=>{if("object"!=typeof t||null===t)return!1;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n||null===Object.getPrototypeOf(t)},Nv=t=>Wv(t)&&"type"in t&&"string"==typeof t.type,H=t=>{const n=n=>({type:t,payload:n});return n.toString=()=>`${t}`,n.type=t,n.match=n=>Nv(n)&&n.type===t,n},Xn=H("hostStoreConnect"),ic=H("remoteLogin"),uc=H("remoteLogout"),Tv=H("wsOnMessage"),oc=H("setRouterPath"),Fv=H("setDeviceType"),Bv=H("setUserError"),Dv=H("setUserIsError"),Mv=H("setUserPending"),Uv=H("setUserSuccess"),zv=H("setUserData"),ac=H("updateAccountData"),qv=H("updateUser"),$v=H("addNotification"),Vv=H("markNotification"),Jv=H("setNotificationsError"),Kv=H("setNotificationsList"),Qv=H("setNotificationsPending"),Hv=H("setNotificationsTotalCount"),Yv=H("setNotificationsUnreadCount"),Gv=H("resetNotificationsState"),Zv=H("undoNotification"),Xv=H("setInstanceInfo"),t0=H("setInstanceInfoPending"),e0=H("setInstanceInfoError"),r0=H("setPlatformSettings"),n0=H("setProfileSettings"),i0=H("setGroupData"),u0=H("setGroupLoading"),ti=H("remoteReady"),sc=H("askLogin"),cc=H("reselectUser"),fc=H("requestLogout"),lc=H("setConfirmLeavePage"),zu=H("requestChangePath"),o0=H("wsSubscribe"),a0=H("wsUnSubscribe"),qu=[zu,o0,a0,ti,cc,fc,sc,lc],$u=[ic,uc,Xn,Tv,oc,Fv,Bv,Dv,Mv,Uv,zv,ac,qv,$v,Vv,Jv,Kv,Qv,Hv,Yv,Gv,Zv,Xv,t0,e0,r0,n0,i0,u0];if($u.some((t=>qu.some((n=>(null==n?void 0:n.toString())===(null==t?void 0:t.toString()))))))throw new Error("Output action is duplicated with input action");const Vu="auth_token",Ju=Du("user"),hc=()=>Ju.getItem(Vu)||void 0,s0=t=>Ju.setItem(Vu,t),c0=()=>Ju.removeItem(Vu),f0=()=>!!hc(),Ku={getToken:hc,setToken:s0,removeToken:c0,hasToken:f0},js={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isPending:!!Ku.getToken(),isAuthenticated:!1,isAskLoginOpen:!1},Pu=K_({name:"auth",initialState:js,reducers:{setAskLoginOpen:(t,n)=>{t.isAskLoginOpen=n.payload},login:(t,n)=>{t.isAuthenticated=!0,t.token=n.payload||null,t.isPending=!1},logout:()=>({...js,isPending:!1}),setNewEmail:(t,n)=>{t.newEmail=n.payload},setForgotPasswordStep:(t,n)=>{t.forgotPasswordStep=n.payload},updateForgotPasswordFields:(t,n)=>{t.forgotPasswordFields={...t.forgotPasswordFields,...n.payload}},resetForgotPasswordFields:t=>{t.forgotPasswordFields=null},setSignupStep:(t,n)=>{t.signupStep=n.payload},updateSignupFields:(t,n)=>{t.signupFields={...t.signupFields,...n.payload}},resetSignupFields:t=>{t.signupFields=null},setPending:(t,n)=>{t.isPending=n.payload}},selectors:{selectAskLoginOpen:t=>t.isAskLoginOpen,selectToken:t=>t.token,selectNewEmail:t=>t.newEmail,selectForgotPasswordStep:t=>t.forgotPasswordStep,selectForgotPasswordFields:t=>t.forgotPasswordFields,selectSignupStep:t=>t.signupStep,selectSignupFields:t=>t.signupFields,selectPending:t=>t.isPending,selectIsAuthenticated:t=>t.isAuthenticated}});qs("requestMicroFrontendFetch"),qs("sendMicroFrontendFetchResponse");const l0=t=>{var n;return 401===(null==t?void 0:t.status)&&"UserBadCreds"===(null==(n=null==t?void 0:t.data)?void 0:n.errorCode)},Au=async({dispatch:t,queryFulfilled:n,onSuccess:e,showInvalidCredsToast:r=!0,showErrorToast:i=!0})=>{try{t(Pu.actions.setPending(!0));const{data:r}=await n,i="sessionKey"in r?r.sessionKey:r.token.sessionKey;return Ku.setToken(i),null==e||e(),n}catch(n){const e=n.error,o=l0(e);if(t(Pu.actions.setPending(!1)),o&&!r)return;i&&$s.error(Q_(n))}},h0=Ss.enhanceEndpoints({endpoints:{getApiV1Rules:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsPasswordRecover:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsPasswordRecoverCheckCode:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsPasswordRecoverChange:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsPasswordChangeConfirm:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},putApiV1AccountsPasswordChangeResendCode:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsPasswordChangeRequest:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},putApiV1AccountsEmailChangeResendCode:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},putApiV1AccountsResendEmailByHash:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsEmailChangeRequest:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsEmailChangeConfirm:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsConfirmEmail:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsCheckCaptcha:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsFinishCreating:{async onQueryStarted(t,{dispatch:n,queryFulfilled:e}){await Au({dispatch:n,queryFulfilled:e,showErrorToast:!1,onSuccess:()=>{$s.success("User registered successfully")}})}},postApiV1AccountsAuthenticateEmail:{invalidatesTags:["Secure"],async onQueryStarted(t,{dispatch:n,queryFulfilled:e}){await Au({dispatch:n,queryFulfilled:e,showInvalidCredsToast:!1})}},postApiV1AccountsSignup:{invalidatesTags:["Secure"]},postApiV1AccountsUserReselectUser:{async onQueryStarted({userId:t},{dispatch:n,queryFulfilled:e}){await Au({dispatch:n,queryFulfilled:e}),t&&(n(ac({selectedUserId:t})),n(Ss.util.invalidateTags(["UserSettings"])))}},getApiV1RbacActorsByActorIdPermissions:{providesTags:["RBAC"],async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}}}}),pc={[sc.type]:()=>ze().dispatch(Pu.actions.setAskLoginOpen(!0)),[cc.type]:t=>ze().dispatch(h0.endpoints.postApiV1AccountsUserReselectUser.initiate(t)),[fc.type]:()=>Ku.removeToken()},p0=t=>Object.keys(pc).includes(t.type),Ws=t=>p0(t)?pc[t.type](t.payload):null;var Ns,qr={exports:{}},d0=qr.exports;
1
+ import{subscribeAfter as bs}from"https://cdn.jsdelivr.net/npm/@wellesley/redux-subscribe-action@1.0.375";import $_,{useRef as lr,useCallback as Ue,useEffect as le,useState as Wu,memo as zs}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{getStore as ze,hydrate as V_,createStore as J_}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.630";import{api as Ss,handleBasicResponse as Pt}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.631";import{createSlice as K_,createAction as qs}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{toast as $s}from"https://cdn.jsdelivr.net/npm/react-toastify@10.0.5/+esm";import{getErrorMsg as Q_}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.482";import{useDispatch as ei,useSelector as Ee}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{routerSlice as Re}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.559";import{useLocation as Vs,useBlocker as H_,useNavigate as Js}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";import{Dialog as Y_,DialogContent as G_,cn as xs,ButtonLoader as As}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.593";import{handleLogin as Z_,handleLogout as X_}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.687";const $r="8.48.0",he=globalThis;function Nu(t,n,e){const r=he,i=r.__SENTRY__=r.__SENTRY__||{},o=i[$r]=i[$r]||{};return o[t]||(o[t]=n())}const Ks=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,tv="Sentry Logger ",Is=["debug","info","warn","error","log","assert","trace"],Es={};function ev(t){if(!("console"in he))return t();const n=he.console,e={},r=Object.keys(Es);r.forEach((t=>{const r=Es[t];e[t]=n[t],n[t]=r}));try{return t()}finally{r.forEach((t=>{n[t]=e[t]}))}}function rv(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return Ks?Is.forEach((e=>{n[e]=(...n)=>{t&&ev((()=>{he.console[e](`${tv}[${e}]:`,...n)}))}})):Is.forEach((t=>{n[t]=()=>{}})),n}const Gn=Nu("logger",rv);function Tu(){return Fu(he),he}function Fu(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||$r,n[$r]=n[$r]||{}}const nv=Object.prototype.toString;function iv(t,n){return nv.call(t)===`[object ${n}]`}function uv(t){return iv(t,"Object")}function ov(t){return!(!t||!t.then||"function"!=typeof t.then)}function av(t,n,e){try{Object.defineProperty(t,n,{value:e,writable:!0,configurable:!0})}catch{Ks&&Gn.log(`Failed to add non-enumerable property "${n}" to object`,t)}}const Qs=1e3;function Hs(){return Date.now()/Qs}function sv(){const{performance:t}=he;if(!t||!t.now)return Hs;const n=Date.now()-t.now(),e=null==t.timeOrigin?n:t.timeOrigin;return()=>(e+t.now())/Qs}const cv=sv();function fr(){const t=he,n=t.crypto||t.msCrypto;let e=()=>16*Math.random();try{if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");n&&n.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(t=>(t^(15&e())>>t/4).toString(16)))}function fv(t,n={}){if(n.user&&(!t.ipAddress&&n.user.ip_address&&(t.ipAddress=n.user.ip_address),!t.did&&!n.did&&(t.did=n.user.id||n.user.email||n.user.username)),t.timestamp=n.timestamp||cv(),n.abnormal_mechanism&&(t.abnormal_mechanism=n.abnormal_mechanism),n.ignoreDuration&&(t.ignoreDuration=n.ignoreDuration),n.sid&&(t.sid=32===n.sid.length?n.sid:fr()),void 0!==n.init&&(t.init=n.init),!t.did&&n.did&&(t.did=`${n.did}`),"number"==typeof n.started&&(t.started=n.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof n.duration)t.duration=n.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}n.release&&(t.release=n.release),n.environment&&(t.environment=n.environment),!t.ipAddress&&n.ipAddress&&(t.ipAddress=n.ipAddress),!t.userAgent&&n.userAgent&&(t.userAgent=n.userAgent),"number"==typeof n.errors&&(t.errors=n.errors),n.status&&(t.status=n.status)}function Rs(){return fr()}function Os(){return fr().substring(16)}function Ys(t,n,e=2){if(!n||"object"!=typeof n||e<=0)return n;if(t&&n&&0===Object.keys(n).length)return t;const r={...t};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=Ys(r[t],n[t],e-1));return r}(()=>{const{performance:t}=he;if(!t||!t.now)return;const n=36e5,e=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+e-r):n,o=i<n,u=t.timing&&t.timing.navigationStart,a="number"==typeof u?Math.abs(u+e-r):n;(o||a<n)&&(i<=a&&t.timeOrigin)})();const ku="_sentrySpan";function Cs(t,n){n?av(t,ku,n):delete t[ku]}function ks(t){return t[ku]}const lv=100;class Bu{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Rs(),spanId:Os()}}clone(){const t=new Bu;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,Cs(t,ks(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&fv(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this._tags={...this._tags,[t]:n},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return null===n?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,[e,r]=n instanceof Vr?[n.getScopeData(),n.getRequestSession()]:uv(n)?[t,t.requestSession]:[],{tags:i,extra:o,user:u,contexts:a,level:s,fingerprint:c=[],propagationContext:l}=e||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},u&&Object.keys(u).length&&(this._user=u),s&&(this._level=s),c.length&&(this._fingerprint=c),l&&(this._propagationContext=l),r&&(this._requestSession=r),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Cs(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Rs()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const e="number"==typeof n?n:lv;if(e<=0)return this;const r={timestamp:Hs(),...t},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>e?i.slice(-e):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ks(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Ys(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:Os(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,n){const e=n&&n.event_id?n.event_id:fr();if(!this._client)return Gn.warn("No client configured on scope - will not capture exception!"),e;const r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...n,event_id:e},this),e}captureMessage(t,n,e){const r=e&&e.event_id?e.event_id:fr();if(!this._client)return Gn.warn("No client configured on scope - will not capture message!"),r;const i=new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...e,event_id:r},this),r}captureEvent(t,n){const e=n&&n.event_id?n.event_id:fr();return this._client?(this._client.captureEvent(t,{...n,event_id:e},this),e):(Gn.warn("No client configured on scope - will not capture event!"),e)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}}const Vr=Bu;function hv(){return Nu("defaultCurrentScope",(()=>new Vr))}function pv(){return Nu("defaultIsolationScope",(()=>new Vr))}class dv{constructor(t,n){let e,r;e=t||new Vr,r=n||new Vr,this._stack=[{scope:e}],this._isolationScope=r}withScope(t){const n=this._pushScope();let e;try{e=t(n)}catch(t){throw this._popScope(),t}return ov(e)?e.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(this._popScope(),e)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function hr(){const t=Fu(Tu());return t.stack=t.stack||new dv(hv(),pv())}function gv(t){return hr().withScope(t)}function _v(t,n){const e=hr();return e.withScope((()=>(e.getStackTop().scope=t,n(t))))}function Ps(t){return hr().withScope((()=>t(hr().getIsolationScope())))}function vv(){return{withIsolationScope:Ps,withScope:gv,withSetScope:_v,withSetIsolationScope:(t,n)=>Ps(n),getCurrentScope:()=>hr().getScope(),getIsolationScope:()=>hr().getIsolationScope()}}function Gs(t){const n=Fu(t);return n.acs?n.acs:vv()}function Zs(){return Gs(Tu()).getCurrentScope()}function yv(){return Gs(Tu()).getIsolationScope()}function mv(t,n){return Zs().captureException(t,void 0)}function wv(t,n){const e={captureContext:n};return Zs().captureMessage(t,void 0,e)}function bv(t,n){yv().setExtra(t,n)}var Hn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const Sv=(...t)=>{let n="";for(const e of t){if(e instanceof Error){const t=e;return bv("exceptionMessage",n),void mv(t)}if("object"!=typeof e)n+=e;else try{n+=" "+JSON.stringify(e)}catch{n+=" "+e}}wv(n)},xv=()=>"object"!=typeof window,Av="wlsy",Xs=()=>{try{return window.localStorage}catch(t){console.warn("Error getting window.localStorage storage",t)}},Iv=()=>{const t=new Set,n=Xs();if(!n)return[];for(let e=0;e<(null==n?void 0:n.length);e+=1){const r=null==n?void 0:n.key(e);"string"==typeof r&&t.add(r)}return Array.from(t)},Du=t=>{const n=`${Av}${t?`:${t}`:""}`,e=t=>`${n}:${t}`,r=()=>Iv().filter((t=>t.startsWith(`${n}:`))),i=t=>t.slice(n.length+1),o=Xs(),u=t=>{try{return null==o?void 0:o.getItem(e(t))}catch{return null}},a=(t,n)=>{try{null==o||o.setItem(e(t),String(n))}catch{return}};return{getItem:u,setItem:a,removeItem:t=>{try{null==o||o.removeItem(e(t))}catch{return}},clear:()=>{try{r().forEach((t=>null==o?void 0:o.removeItem(t)))}catch{return}},keys:()=>r().map(i),has:t=>null!==u(t),getJSON:t=>{const n=u(t);if(null==n)return null;try{return JSON.parse(n)}catch{return null}},setJSON:(t,n)=>{try{a(t,JSON.stringify(n))}catch{return}}}},Ls=["debug","info","warn","error"],Ev=(t,n)=>{const e=Ls.indexOf(t);return Ls.indexOf(n)>=e},Yn=(t,n,e,...r)=>{Ev(n,t)&&console.log(`[${t}] ${e}`,...r)},Rv=()=>Du().getItem("logger_lvl"),Ov=(t=(xv()?"info":Rv()||"warn"))=>{let n=t;return{debug:(t,...e)=>Yn("debug",n,t,...e),info:(t,...e)=>Yn("info",n,t,...e),warn:(t,...e)=>Yn("warn",n,t,...e),error:(t,...e)=>(Sv(t,...e),Yn("error",n,t,...e)),setLevel:t=>{n=t},getLevel:()=>n}},ri=Ov(),ni="staticState",tc=Du(),Zn={path:"",baseUrl:"",search:""},Cv=t=>{if(!t)return Zn;try{return JSON.parse(decodeURIComponent(t))||Zn}catch(t){return ri.error("Error parsing static state",t),Zn}},ec=()=>new URLSearchParams(window.location.search).get(ni),kv=({path:t,baseUrl:n,search:e}={})=>{const{pathname:r,origin:i,search:o}=window.location;return`${ni}=${encodeURIComponent(JSON.stringify({path:t||r,baseUrl:n||i,search:e||o}))}`},Pv=()=>{const t=ec();return t&&tc.setItem(ni,t),rc()},rc=()=>{try{const t=tc.getItem(ni)||ec();return Cv(t)}catch(t){return ri.error("Error parsing static state",t),Zn}},Lv={create:kv,init:Pv,get:rc},Mu=({onMessage:t,whitelist:n,sourceWindow:e})=>{const r=r=>{const i=r.origin===window.location.origin,o=!e||r.source===e,u=r.data&&"object"==typeof r.data&&"type"in r.data,a=n.some((({type:t})=>t===r.data.type||"*"===t));!i&&o&&u&&a&&t(r.data)};return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},jv=t=>{try{const{type:n,payload:e}=t,r={type:n};return void 0!==e&&(r.payload=JSON.parse(JSON.stringify(e))),r}catch(n){return ri.warn(`Could not serialize action type: ${t.type}`,n),{type:t.type,payload:`[Non-serializable payload for action: ${t.type}]`}}},Uu=({action:t,windowElement:n,whitelist:e})=>{if(n)try{const{type:r}=t;if(!e.some((({type:t})=>t===r||"*"===t)))return;const i=jv(t);n.postMessage(i,"*")}catch(t){ri.error("Failed to process or send message:",t)}},nc=({sourceWindow:t,sendWhitelist:n,receiveWhitelist:e,onMessage:r,onAction:i,name:o})=>{const u=lr((()=>{})),a=lr((()=>{}));return Ue((o=>{if(o)return u.current(),a.current(),u.current=bs((t=>{null==i||i(t),Uu({action:t,windowElement:o,whitelist:n})})),a.current=Mu({sourceWindow:t,onMessage:t=>{r?r(t):ze().dispatch(t)},whitelist:e}),()=>{u.current(),a.current()}}),[t,n,e,r,bs,i,o])},Wv=t=>{if("object"!=typeof t||null===t)return!1;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n||null===Object.getPrototypeOf(t)},Nv=t=>Wv(t)&&"type"in t&&"string"==typeof t.type,H=t=>{const n=n=>({type:t,payload:n});return n.toString=()=>`${t}`,n.type=t,n.match=n=>Nv(n)&&n.type===t,n},Xn=H("hostStoreConnect"),ic=H("remoteLogin"),uc=H("remoteLogout"),Tv=H("wsOnMessage"),oc=H("setRouterPath"),Fv=H("setDeviceType"),Bv=H("setUserError"),Dv=H("setUserIsError"),Mv=H("setUserPending"),Uv=H("setUserSuccess"),zv=H("setUserData"),ac=H("updateAccountData"),qv=H("updateUser"),$v=H("addNotification"),Vv=H("markNotification"),Jv=H("setNotificationsError"),Kv=H("setNotificationsList"),Qv=H("setNotificationsPending"),Hv=H("setNotificationsTotalCount"),Yv=H("setNotificationsUnreadCount"),Gv=H("resetNotificationsState"),Zv=H("undoNotification"),Xv=H("setInstanceInfo"),t0=H("setInstanceInfoPending"),e0=H("setInstanceInfoError"),r0=H("setPlatformSettings"),n0=H("setProfileSettings"),i0=H("setGroupData"),u0=H("setGroupLoading"),ti=H("remoteReady"),sc=H("askLogin"),cc=H("reselectUser"),fc=H("requestLogout"),lc=H("setConfirmLeavePage"),zu=H("requestChangePath"),o0=H("wsSubscribe"),a0=H("wsUnSubscribe"),qu=[zu,o0,a0,ti,cc,fc,sc,lc],$u=[ic,uc,Xn,Tv,oc,Fv,Bv,Dv,Mv,Uv,zv,ac,qv,$v,Vv,Jv,Kv,Qv,Hv,Yv,Gv,Zv,Xv,t0,e0,r0,n0,i0,u0];if($u.some((t=>qu.some((n=>(null==n?void 0:n.toString())===(null==t?void 0:t.toString()))))))throw new Error("Output action is duplicated with input action");const Vu="auth_token",Ju=Du("user"),hc=()=>Ju.getItem(Vu)||void 0,s0=t=>Ju.setItem(Vu,t),c0=()=>Ju.removeItem(Vu),f0=()=>!!hc(),Ku={getToken:hc,setToken:s0,removeToken:c0,hasToken:f0},js={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isPending:!!Ku.getToken(),isAuthenticated:!1,isAskLoginOpen:!1},Pu=K_({name:"auth",initialState:js,reducers:{setAskLoginOpen:(t,n)=>{t.isAskLoginOpen=n.payload},login:(t,n)=>{t.isAuthenticated=!0,t.token=n.payload||null,t.isPending=!1},logout:()=>({...js,isPending:!1}),setNewEmail:(t,n)=>{t.newEmail=n.payload},setForgotPasswordStep:(t,n)=>{t.forgotPasswordStep=n.payload},updateForgotPasswordFields:(t,n)=>{t.forgotPasswordFields={...t.forgotPasswordFields,...n.payload}},resetForgotPasswordFields:t=>{t.forgotPasswordFields=null},setSignupStep:(t,n)=>{t.signupStep=n.payload},updateSignupFields:(t,n)=>{t.signupFields={...t.signupFields,...n.payload}},resetSignupFields:t=>{t.signupFields=null},setPending:(t,n)=>{t.isPending=n.payload}},selectors:{selectAskLoginOpen:t=>t.isAskLoginOpen,selectToken:t=>t.token,selectNewEmail:t=>t.newEmail,selectForgotPasswordStep:t=>t.forgotPasswordStep,selectForgotPasswordFields:t=>t.forgotPasswordFields,selectSignupStep:t=>t.signupStep,selectSignupFields:t=>t.signupFields,selectPending:t=>t.isPending,selectIsAuthenticated:t=>t.isAuthenticated}});qs("requestMicroFrontendFetch"),qs("sendMicroFrontendFetchResponse");const l0=t=>{var n;return 401===(null==t?void 0:t.status)&&"UserBadCreds"===(null==(n=null==t?void 0:t.data)?void 0:n.errorCode)},Au=async({dispatch:t,queryFulfilled:n,onSuccess:e,showInvalidCredsToast:r=!0,showErrorToast:i=!0})=>{try{t(Pu.actions.setPending(!0));const{data:r}=await n,i="sessionKey"in r?r.sessionKey:r.token.sessionKey;return Ku.setToken(i),null==e||e(),n}catch(n){const e=n.error,o=l0(e);if(t(Pu.actions.setPending(!1)),o&&!r)return;i&&$s.error(Q_(n))}},h0=Ss.enhanceEndpoints({endpoints:{getApiV1Rules:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsPasswordRecover:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsPasswordRecoverCheckCode:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsPasswordRecoverChange:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsPasswordChangeConfirm:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},putApiV1AccountsPasswordChangeResendCode:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsPasswordChangeRequest:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},putApiV1AccountsEmailChangeResendCode:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},putApiV1AccountsResendEmailByHash:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsEmailChangeRequest:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsEmailChangeConfirm:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsConfirmEmail:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsCheckCaptcha:{async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}},postApiV1AccountsFinishCreating:{async onQueryStarted(t,{dispatch:n,queryFulfilled:e}){await Au({dispatch:n,queryFulfilled:e,showErrorToast:!1,onSuccess:()=>{$s.success("User registered successfully")}})}},postApiV1AccountsAuthenticateEmail:{invalidatesTags:["Secure"],async onQueryStarted(t,{dispatch:n,queryFulfilled:e}){await Au({dispatch:n,queryFulfilled:e,showInvalidCredsToast:!1})}},postApiV1AccountsSignup:{invalidatesTags:["Secure"]},postApiV1AccountsUserReselectUser:{async onQueryStarted({userId:t},{dispatch:n,queryFulfilled:e}){await Au({dispatch:n,queryFulfilled:e}),t&&(n(ac({selectedUserId:t})),n(Ss.util.invalidateTags(["UserSettings"])))}},getApiV1RbacActorsByActorIdPermissions:{providesTags:["RBAC"],async onQueryStarted(t,{queryFulfilled:n}){await Pt(n)}}}}),pc={[sc.type]:()=>ze().dispatch(Pu.actions.setAskLoginOpen(!0)),[cc.type]:t=>ze().dispatch(h0.endpoints.postApiV1AccountsUserReselectUser.initiate(t)),[fc.type]:()=>Ku.removeToken()},p0=t=>Object.keys(pc).includes(t.type),Ws=t=>p0(t)?pc[t.type](t.payload):null;var Ns,qr={exports:{}},d0=qr.exports;
2
2
  /**
3
3
  * @license
4
4
  * Lodash <https://lodash.com/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wellesley/host-remote",
3
- "version": "1.0.471",
3
+ "version": "1.0.473",
4
4
  "license": "UNLICENSED",
5
5
  "main": "index.mjs",
6
6
  "files": [