@wellesley/host-remote 1.0.672 → 1.0.673

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 Ba}from"https://cdn.jsdelivr.net/npm/@wellesley/redux-subscribe-action@1.0.574";import gv,{useRef as Qe,useCallback as Ge,forwardRef as ac,createElement as Yo,useEffect as se,useState as nu,memo as cc}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{getStore as Ye,hydrate as _v,createStore as vv}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.829";import{api as Ua}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.830";import{toast as ci}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.174";import{createSlice as yv,createAction as lc}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{getErrorMsg as mv}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.679";import{useDispatch as yi,useSelector as je}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{routerSlice as Ne}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.756";import{useLocation as fc,useBlocker as wv,useNavigate as hc}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";import{Dialog as bv,DialogContent as Sv,cn as qa,ButtonLoader as $a}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.792";import{handleLogin as xv,handleLogout as Av}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.886";const Zr="8.48.0",me=globalThis;function iu(t,e,n){const r=me,i=r.__SENTRY__=r.__SENTRY__||{},o=i[Zr]=i[Zr]||{};return o[t]||(o[t]=e())}const pc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Iv="Sentry Logger ",za=["debug","info","warn","error","log","assert","trace"],Va={};function Ev(t){if(!("console"in me))return t();const e=me.console,n={},r=Object.keys(Va);r.forEach((t=>{const r=Va[t];n[t]=e[t],e[t]=r}));try{return t()}finally{r.forEach((t=>{e[t]=n[t]}))}}function kv(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return pc?za.forEach((n=>{e[n]=(...e)=>{t&&Ev((()=>{me.console[n](`${Iv}[${n}]:`,...e)}))}})):za.forEach((t=>{e[t]=()=>{}})),e}const ui=iu("logger",kv);function ou(){return uu(me),me}function uu(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Zr,e[Zr]=e[Zr]||{}}const Rv=Object.prototype.toString;function Cv(t,e){return Rv.call(t)===`[object ${e}]`}function Ov(t){return Cv(t,"Object")}function Lv(t){return!(!t||!t.then||"function"!=typeof t.then)}function Wv(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{pc&&ui.log(`Failed to add non-enumerable property "${e}" to object`,t)}}const dc=1e3;function gc(){return Date.now()/dc}function Pv(){const{performance:t}=me;if(!t||!t.now)return gc;const e=Date.now()-t.now(),n=null==t.timeOrigin?e:t.timeOrigin;return()=>(n+t.now())/dc}const jv=Pv();function wr(){const t=me,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function Nv(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||jv(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:wr()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"==typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"==typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Ka(){return wr()}function Ja(){return wr().substring(16)}function _c(t,e,n=2){if(!e||"object"!=typeof e||n<=0)return e;if(t&&e&&0===Object.keys(e).length)return t;const r={...t};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=_c(r[t],e[t],n-1));return r}(()=>{const{performance:t}=me;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=i<e,u=t.timing&&t.timing.navigationStart,a="number"==typeof u?Math.abs(u+n-r):e;(o||a<e)&&(i<=a&&t.timeOrigin)})();const Zo="_sentrySpan";function Ha(t,e){e?Wv(t,Zo,e):delete t[Zo]}function Ga(t){return t[Zo]}const Tv=100;class su{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:Ka(),spanId:Ja()}}clone(){const t=new su;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,Ha(t,Ga(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&&Nv(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,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},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,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,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 e="function"==typeof t?t(this):t,[n,r]=e instanceof Xr?[e.getScopeData(),e.getRequestSession()]:Ov(e)?[t,t.requestSession]:[],{tags:i,extra:o,user:u,contexts:a,level:s,fingerprint:c=[],propagationContext:l}=n||{};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,Ha(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ka()}),this._notifyScopeListeners(),this}addBreadcrumb(t,e){const n="number"==typeof e?e:Tv;if(n<=0)return this;const r={timestamp:gc(),...t},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):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:Ga(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=_c(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:Ja(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,e){const n=e&&e.event_id?e.event_id:wr();if(!this._client)return ui.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...e,event_id:n},this),n}captureMessage(t,e,n){const r=n&&n.event_id?n.event_id:wr();if(!this._client)return ui.warn("No client configured on scope - will not capture message!"),r;const i=new Error(t);return this._client.captureMessage(t,e,{originalException:t,syntheticException:i,...n,event_id:r},this),r}captureEvent(t,e){const n=e&&e.event_id?e.event_id:wr();return this._client?(this._client.captureEvent(t,{...e,event_id:n},this),n):(ui.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}}const Xr=su;function Fv(){return iu("defaultCurrentScope",(()=>new Xr))}function Dv(){return iu("defaultIsolationScope",(()=>new Xr))}class Mv{constructor(t,e){let n,r;n=t||new Xr,r=e||new Xr,this._stack=[{scope:n}],this._isolationScope=r}withScope(t){const e=this._pushScope();let n;try{n=t(e)}catch(t){throw this._popScope(),t}return Lv(n)?n.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(this._popScope(),n)}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 br(){const t=uu(ou());return t.stack=t.stack||new Mv(Fv(),Dv())}function Bv(t){return br().withScope(t)}function Uv(t,e){const n=br();return n.withScope((()=>(n.getStackTop().scope=t,e(t))))}function Qa(t){return br().withScope((()=>t(br().getIsolationScope())))}function qv(){return{withIsolationScope:Qa,withScope:Bv,withSetScope:Uv,withSetIsolationScope:(t,e)=>Qa(e),getCurrentScope:()=>br().getScope(),getIsolationScope:()=>br().getIsolationScope()}}function vc(t){const e=uu(t);return e.acs?e.acs:qv()}function yc(){return vc(ou()).getCurrentScope()}function $v(){return vc(ou()).getIsolationScope()}function zv(t,e){return yc().captureException(t,void 0)}function Vv(t,e){const n={captureContext:e};return yc().captureMessage(t,void 0,n)}function Kv(t,e){$v().setExtra(t,e)}var ni=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const Jv=(...t)=>{let e="";for(const n of t){if(n instanceof Error){const t=n;return Kv("exceptionMessage",e),void zv(t)}if("object"!=typeof n)e+=n;else try{e+=" "+JSON.stringify(n)}catch{e+=" "+n}}Vv(e)},mi=()=>"object"!=typeof window,Hv="wlsy",mc=()=>{try{return window.localStorage}catch(t){console.warn("Error getting window.localStorage storage",t)}},Gv=()=>{const t=new Set,e=mc();if(!e)return[];for(let n=0;n<(null==e?void 0:e.length);n+=1){const r=null==e?void 0:e.key(n);"string"==typeof r&&t.add(r)}return Array.from(t)},wi=t=>{const e=`${Hv}`,n=t=>`${e}:${t}`,r=()=>Gv().filter((t=>t.startsWith(`${e}:`))),i=t=>t.slice(e.length+1),o=mc(),u=t=>{try{return null==o?void 0:o.getItem(n(t))}catch{return null}},a=(t,e)=>{try{null==o||o.setItem(n(t),String(e))}catch{return}};return{getItem:u,setItem:a,removeItem:t=>{try{null==o||o.removeItem(n(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 e=u(t);if(null==e)return null;try{return JSON.parse(e)}catch{return null}},setJSON:(t,e)=>{try{a(t,JSON.stringify(e))}catch{return}}}},Ya=["debug","info","warn","error"],Qv=(t,e)=>{const n=Ya.indexOf(t);return Ya.indexOf(e)>=n},ii=(t,e,n,...r)=>{Qv(e,t)&&console.log(`[${t}] ${n}`,...r)},Yv=()=>wi().getItem("logger_lvl"),Zv=(t=(mi()?"info":Yv()||"warn"))=>{let e=t;return{debug:(t,...n)=>ii("debug",e,t,...n),info:(t,...n)=>ii("info",e,t,...n),warn:(t,...n)=>ii("warn",e,t,...n),error:(t,...n)=>(Jv(t,...n),ii("error",e,t,...n)),setLevel:t=>{e=t},getLevel:()=>e}},bi=Zv(),Si="staticState",wc=wi(),si={path:"",baseUrl:"",search:""},Xv=t=>{if(!t)return si;try{return JSON.parse(decodeURIComponent(t))||si}catch(t){return bi.error("Error parsing static state",t),si}},bc=()=>new URLSearchParams(window.location.search).get(Si),ty=({path:t,baseUrl:e,search:n}={})=>{const{pathname:r,origin:i,search:o}=window.location;return`${Si}=${encodeURIComponent(JSON.stringify({path:t||r,baseUrl:e||i,search:n||o}))}`},ey=()=>{const t=bc();return t&&wc.setItem(Si,t),Sc()},Sc=()=>{try{const t=wc.getItem(Si)||bc();return Xv(t)}catch(t){return bi.error("Error parsing static state",t),si}},ry={create:ty,init:ey,get:Sc},tn=({onMessage:t,whitelist:e,sourceWindow:n})=>{const r=r=>{const i=r.origin===window.location.origin,o=!n||r.source===n,u=r.data&&"object"==typeof r.data&&"type"in r.data,a=e.some((({type:t})=>t===r.data.type||"*"===t));!i&&o&&u&&a&&t(r.data)};return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},ny=t=>{try{const{type:e,payload:n}=t,r={type:e};return void 0!==n&&(r.payload=JSON.parse(JSON.stringify(n))),r}catch(e){return bi.warn(`Could not serialize action type: ${t.type}`,e),{type:t.type,payload:`[Non-serializable payload for action: ${t.type}]`}}},Tt=({action:t,windowElement:e,whitelist:n})=>{if(e)try{const{type:r}=t;if(!n.some((({type:t})=>t===r||"*"===t)))return;const i=ny(t);e.postMessage(i,"*")}catch(t){bi.error("Failed to process or send message:",t)}},xc=({sourceWindow:t,sendWhitelist:e,receiveWhitelist:n,onMessage:r,onAction:i,name:o})=>{const u=Qe((()=>{})),a=Qe((()=>{}));return Ge((o=>{if(o)return u.current(),a.current(),u.current=Ba((t=>{null==i||i(t),Tt({action:t,windowElement:o,whitelist:e})})),a.current=tn({sourceWindow:t,onMessage:t=>{r?r(t):Ye().dispatch(t)},whitelist:n}),()=>{u.current(),a.current()}}),[t,e,n,r,Ba,i,o])},iy=t=>{if("object"!=typeof t||null===t)return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||null===Object.getPrototypeOf(t)},oy=t=>iy(t)&&"type"in t&&"string"==typeof t.type,q=t=>{const e=e=>({type:t,payload:e});return e.toString=()=>`${t}`,e.type=t,e.match=e=>oy(e)&&e.type===t,e},li=q("hostStoreConnect"),Ac=q("remoteLogin"),Ic=q("remoteLogout"),uy=q("wsOnMessage"),Ec=q("setRouterPath"),sy=q("setDeviceType"),ay=q("setDeviceWidth"),cy=q("setUserError"),ly=q("setUserIsError"),fy=q("setUserPending"),hy=q("setUserSuccess"),py=q("setUserData"),kc=q("updateAccountData"),dy=q("updateUser"),gy=q("addNotification"),_y=q("markNotification"),vy=q("setNotificationsError"),yy=q("setNotificationsList"),my=q("setNotificationsPending"),wy=q("setNotificationsTotalCount"),by=q("setNotificationsUnreadCount"),Sy=q("acceptAllFollowRequests"),xy=q("resetNotificationsState"),Ay=q("undoNotification"),Iy=q("setInstanceInfo"),Ey=q("setInstanceInfoPending"),ky=q("setInstanceInfoError"),Ry=q("setPlatformSettings"),Cy=q("setProfileSettings"),Oy=q("setGroupData"),Ly=q("setGroupLoading"),fi=q("remoteReady"),Rc=q("askLogin"),Cc=q("reselectUser"),Oc=q("requestLogout"),Lc=q("setConfirmLeavePage"),au=q("requestChangePath"),Wy=q("wsSubscribe"),Py=q("wsUnSubscribe"),cu=[au,Wy,Py,fi,Cc,Oc,Rc,Lc,Sy],lu=[Ac,Ic,li,uy,Ec,sy,ay,cy,ly,fy,hy,py,kc,dy,gy,_y,vy,yy,my,wy,by,xy,Ay,Iy,Ey,ky,Ry,Cy,Oy,Ly];if(lu.some((t=>cu.some((e=>(null==e?void 0:e.toString())===(null==t?void 0:t.toString()))))))throw new Error("Output action is duplicated with input action");var Za,Yr={exports:{}},jy=Yr.exports;
1
+ import{subscribeAfter as Ba}from"https://cdn.jsdelivr.net/npm/@wellesley/redux-subscribe-action@1.0.575";import gv,{useRef as Qe,useCallback as Ge,forwardRef as ac,createElement as Yo,useEffect as se,useState as nu,memo as cc}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{getStore as Ye,hydrate as _v,createStore as vv}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.830";import{api as Ua}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.831";import{toast as ci}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.175";import{createSlice as yv,createAction as lc}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{getErrorMsg as mv}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.680";import{useDispatch as yi,useSelector as je}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{routerSlice as Ne}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.757";import{useLocation as fc,useBlocker as wv,useNavigate as hc}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";import{Dialog as bv,DialogContent as Sv,cn as qa,ButtonLoader as $a}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.793";import{handleLogin as xv,handleLogout as Av}from"https://cdn.jsdelivr.net/npm/@wellesley/auth@1.0.887";const Zr="8.48.0",me=globalThis;function iu(t,e,n){const r=me,i=r.__SENTRY__=r.__SENTRY__||{},o=i[Zr]=i[Zr]||{};return o[t]||(o[t]=e())}const pc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Iv="Sentry Logger ",za=["debug","info","warn","error","log","assert","trace"],Va={};function Ev(t){if(!("console"in me))return t();const e=me.console,n={},r=Object.keys(Va);r.forEach((t=>{const r=Va[t];n[t]=e[t],e[t]=r}));try{return t()}finally{r.forEach((t=>{e[t]=n[t]}))}}function kv(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return pc?za.forEach((n=>{e[n]=(...e)=>{t&&Ev((()=>{me.console[n](`${Iv}[${n}]:`,...e)}))}})):za.forEach((t=>{e[t]=()=>{}})),e}const ui=iu("logger",kv);function ou(){return uu(me),me}function uu(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Zr,e[Zr]=e[Zr]||{}}const Rv=Object.prototype.toString;function Cv(t,e){return Rv.call(t)===`[object ${e}]`}function Ov(t){return Cv(t,"Object")}function Lv(t){return!(!t||!t.then||"function"!=typeof t.then)}function Wv(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{pc&&ui.log(`Failed to add non-enumerable property "${e}" to object`,t)}}const dc=1e3;function gc(){return Date.now()/dc}function Pv(){const{performance:t}=me;if(!t||!t.now)return gc;const e=Date.now()-t.now(),n=null==t.timeOrigin?e:t.timeOrigin;return()=>(n+t.now())/dc}const jv=Pv();function wr(){const t=me,e=t.crypto||t.msCrypto;let n=()=>16*Math.random();try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(t=>(t^(15&n())>>t/4).toString(16)))}function Nv(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||jv(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=32===e.sid.length?e.sid:wr()),void 0!==e.init&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),"number"==typeof e.started&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof e.duration)t.duration=e.duration;else{const e=t.timestamp-t.started;t.duration=e>=0?e:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),"number"==typeof e.errors&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Ka(){return wr()}function Ja(){return wr().substring(16)}function _c(t,e,n=2){if(!e||"object"!=typeof e||n<=0)return e;if(t&&e&&0===Object.keys(e).length)return t;const r={...t};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=_c(r[t],e[t],n-1));return r}(()=>{const{performance:t}=me;if(!t||!t.now)return;const e=36e5,n=t.now(),r=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,o=i<e,u=t.timing&&t.timing.navigationStart,a="number"==typeof u?Math.abs(u+n-r):e;(o||a<e)&&(i<=a&&t.timeOrigin)})();const Zo="_sentrySpan";function Ha(t,e){e?Wv(t,Zo,e):delete t[Zo]}function Ga(t){return t[Zo]}const Tv=100;class su{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:Ka(),spanId:Ja()}}clone(){const t=new su;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,Ha(t,Ga(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&&Nv(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,e){return this._tags={...this._tags,[t]:e},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,e){return this._extra={...this._extra,[t]:e},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,e){return null===e?delete this._contexts[t]:this._contexts[t]=e,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 e="function"==typeof t?t(this):t,[n,r]=e instanceof Xr?[e.getScopeData(),e.getRequestSession()]:Ov(e)?[t,t.requestSession]:[],{tags:i,extra:o,user:u,contexts:a,level:s,fingerprint:c=[],propagationContext:l}=n||{};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,Ha(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ka()}),this._notifyScopeListeners(),this}addBreadcrumb(t,e){const n="number"==typeof e?e:Tv;if(n<=0)return this;const r={timestamp:gc(),...t},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):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:Ga(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=_c(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:Ja(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,e){const n=e&&e.event_id?e.event_id:wr();if(!this._client)return ui.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...e,event_id:n},this),n}captureMessage(t,e,n){const r=n&&n.event_id?n.event_id:wr();if(!this._client)return ui.warn("No client configured on scope - will not capture message!"),r;const i=new Error(t);return this._client.captureMessage(t,e,{originalException:t,syntheticException:i,...n,event_id:r},this),r}captureEvent(t,e){const n=e&&e.event_id?e.event_id:wr();return this._client?(this._client.captureEvent(t,{...e,event_id:n},this),n):(ui.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}}const Xr=su;function Fv(){return iu("defaultCurrentScope",(()=>new Xr))}function Dv(){return iu("defaultIsolationScope",(()=>new Xr))}class Mv{constructor(t,e){let n,r;n=t||new Xr,r=e||new Xr,this._stack=[{scope:n}],this._isolationScope=r}withScope(t){const e=this._pushScope();let n;try{n=t(e)}catch(t){throw this._popScope(),t}return Lv(n)?n.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(this._popScope(),n)}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 br(){const t=uu(ou());return t.stack=t.stack||new Mv(Fv(),Dv())}function Bv(t){return br().withScope(t)}function Uv(t,e){const n=br();return n.withScope((()=>(n.getStackTop().scope=t,e(t))))}function Qa(t){return br().withScope((()=>t(br().getIsolationScope())))}function qv(){return{withIsolationScope:Qa,withScope:Bv,withSetScope:Uv,withSetIsolationScope:(t,e)=>Qa(e),getCurrentScope:()=>br().getScope(),getIsolationScope:()=>br().getIsolationScope()}}function vc(t){const e=uu(t);return e.acs?e.acs:qv()}function yc(){return vc(ou()).getCurrentScope()}function $v(){return vc(ou()).getIsolationScope()}function zv(t,e){return yc().captureException(t,void 0)}function Vv(t,e){const n={captureContext:e};return yc().captureMessage(t,void 0,n)}function Kv(t,e){$v().setExtra(t,e)}var ni=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const Jv=(...t)=>{let e="";for(const n of t){if(n instanceof Error){const t=n;return Kv("exceptionMessage",e),void zv(t)}if("object"!=typeof n)e+=n;else try{e+=" "+JSON.stringify(n)}catch{e+=" "+n}}Vv(e)},mi=()=>"object"!=typeof window,Hv="wlsy",mc=()=>{try{return window.localStorage}catch(t){console.warn("Error getting window.localStorage storage",t)}},Gv=()=>{const t=new Set,e=mc();if(!e)return[];for(let n=0;n<(null==e?void 0:e.length);n+=1){const r=null==e?void 0:e.key(n);"string"==typeof r&&t.add(r)}return Array.from(t)},wi=t=>{const e=`${Hv}`,n=t=>`${e}:${t}`,r=()=>Gv().filter((t=>t.startsWith(`${e}:`))),i=t=>t.slice(e.length+1),o=mc(),u=t=>{try{return null==o?void 0:o.getItem(n(t))}catch{return null}},a=(t,e)=>{try{null==o||o.setItem(n(t),String(e))}catch{return}};return{getItem:u,setItem:a,removeItem:t=>{try{null==o||o.removeItem(n(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 e=u(t);if(null==e)return null;try{return JSON.parse(e)}catch{return null}},setJSON:(t,e)=>{try{a(t,JSON.stringify(e))}catch{return}}}},Ya=["debug","info","warn","error"],Qv=(t,e)=>{const n=Ya.indexOf(t);return Ya.indexOf(e)>=n},ii=(t,e,n,...r)=>{Qv(e,t)&&console.log(`[${t}] ${n}`,...r)},Yv=()=>wi().getItem("logger_lvl"),Zv=(t=(mi()?"info":Yv()||"warn"))=>{let e=t;return{debug:(t,...n)=>ii("debug",e,t,...n),info:(t,...n)=>ii("info",e,t,...n),warn:(t,...n)=>ii("warn",e,t,...n),error:(t,...n)=>(Jv(t,...n),ii("error",e,t,...n)),setLevel:t=>{e=t},getLevel:()=>e}},bi=Zv(),Si="staticState",wc=wi(),si={path:"",baseUrl:"",search:""},Xv=t=>{if(!t)return si;try{return JSON.parse(decodeURIComponent(t))||si}catch(t){return bi.error("Error parsing static state",t),si}},bc=()=>new URLSearchParams(window.location.search).get(Si),ty=({path:t,baseUrl:e,search:n}={})=>{const{pathname:r,origin:i,search:o}=window.location;return`${Si}=${encodeURIComponent(JSON.stringify({path:t||r,baseUrl:e||i,search:n||o}))}`},ey=()=>{const t=bc();return t&&wc.setItem(Si,t),Sc()},Sc=()=>{try{const t=wc.getItem(Si)||bc();return Xv(t)}catch(t){return bi.error("Error parsing static state",t),si}},ry={create:ty,init:ey,get:Sc},tn=({onMessage:t,whitelist:e,sourceWindow:n})=>{const r=r=>{const i=r.origin===window.location.origin,o=!n||r.source===n,u=r.data&&"object"==typeof r.data&&"type"in r.data,a=e.some((({type:t})=>t===r.data.type||"*"===t));!i&&o&&u&&a&&t(r.data)};return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},ny=t=>{try{const{type:e,payload:n}=t,r={type:e};return void 0!==n&&(r.payload=JSON.parse(JSON.stringify(n))),r}catch(e){return bi.warn(`Could not serialize action type: ${t.type}`,e),{type:t.type,payload:`[Non-serializable payload for action: ${t.type}]`}}},Tt=({action:t,windowElement:e,whitelist:n})=>{if(e)try{const{type:r}=t;if(!n.some((({type:t})=>t===r||"*"===t)))return;const i=ny(t);e.postMessage(i,"*")}catch(t){bi.error("Failed to process or send message:",t)}},xc=({sourceWindow:t,sendWhitelist:e,receiveWhitelist:n,onMessage:r,onAction:i,name:o})=>{const u=Qe((()=>{})),a=Qe((()=>{}));return Ge((o=>{if(o)return u.current(),a.current(),u.current=Ba((t=>{null==i||i(t),Tt({action:t,windowElement:o,whitelist:e})})),a.current=tn({sourceWindow:t,onMessage:t=>{r?r(t):Ye().dispatch(t)},whitelist:n}),()=>{u.current(),a.current()}}),[t,e,n,r,Ba,i,o])},iy=t=>{if("object"!=typeof t||null===t)return!1;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||null===Object.getPrototypeOf(t)},oy=t=>iy(t)&&"type"in t&&"string"==typeof t.type,q=t=>{const e=e=>({type:t,payload:e});return e.toString=()=>`${t}`,e.type=t,e.match=e=>oy(e)&&e.type===t,e},li=q("hostStoreConnect"),Ac=q("remoteLogin"),Ic=q("remoteLogout"),uy=q("wsOnMessage"),Ec=q("setRouterPath"),sy=q("setDeviceType"),ay=q("setDeviceWidth"),cy=q("setUserError"),ly=q("setUserIsError"),fy=q("setUserPending"),hy=q("setUserSuccess"),py=q("setUserData"),kc=q("updateAccountData"),dy=q("updateUser"),gy=q("addNotification"),_y=q("markNotification"),vy=q("setNotificationsError"),yy=q("setNotificationsList"),my=q("setNotificationsPending"),wy=q("setNotificationsTotalCount"),by=q("setNotificationsUnreadCount"),Sy=q("acceptAllFollowRequests"),xy=q("resetNotificationsState"),Ay=q("undoNotification"),Iy=q("setInstanceInfo"),Ey=q("setInstanceInfoPending"),ky=q("setInstanceInfoError"),Ry=q("setPlatformSettings"),Cy=q("setProfileSettings"),Oy=q("setGroupData"),Ly=q("setGroupLoading"),fi=q("remoteReady"),Rc=q("askLogin"),Cc=q("reselectUser"),Oc=q("requestLogout"),Lc=q("setConfirmLeavePage"),au=q("requestChangePath"),Wy=q("wsSubscribe"),Py=q("wsUnSubscribe"),cu=[au,Wy,Py,fi,Cc,Oc,Rc,Lc,Sy],lu=[Ac,Ic,li,uy,Ec,sy,ay,cy,ly,fy,hy,py,kc,dy,gy,_y,vy,yy,my,wy,by,xy,Ay,Iy,Ey,ky,Ry,Cy,Oy,Ly];if(lu.some((t=>cu.some((e=>(null==e?void 0:e.toString())===(null==t?void 0:t.toString()))))))throw new Error("Output action is duplicated with input action");var Za,Yr={exports:{}},jy=Yr.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.672",
3
+ "version": "1.0.673",
4
4
  "license": "UNLICENSED",
5
5
  "main": "index.mjs",
6
6
  "files": [