@wellesley/error-kit 1.0.197 → 1.0.199

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
@@ -7,7 +7,7 @@ import n_,{isValidElement as _s,useRef as i_,useEffect as u_,memo as o_,createCo
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */function v_(){if(Va)return Fr;Va=1;var t=n_,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),e=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function o(t,r,o){var a,s={},c=null,f=null;for(a in void 0!==o&&(c=""+o),void 0!==r.key&&(c=""+r.key),void 0!==r.ref&&(f=r.ref),r)e.call(r,a)&&!u.hasOwnProperty(a)&&(s[a]=r[a]);if(t&&t.defaultProps)for(a in r=t.defaultProps)void 0===s[a]&&(s[a]=r[a]);return{$$typeof:n,type:t,key:c,ref:f,props:s,_owner:i.current}}return Fr.Fragment=r,Fr.jsx=o,Fr.jsxs=o,Fr}function y_(){return $a||($a=1,hu.exports=v_()),hu.exports}var ie=y_();const Br="8.48.0",st=globalThis;function mu(t,n,r){const e=st,i=e.__SENTRY__=e.__SENTRY__||{},u=i[Br]=i[Br]||{};return u[t]||(u[t]=n())}const ys=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,m_="Sentry Logger ",es=["debug","info","warn","error","log","assert","trace"],ts={};function b_(t){if(!("console"in st))return t();const n=st.console,r={},e=Object.keys(ts);e.forEach((t=>{const e=ts[t];r[t]=n[t],n[t]=e}));try{return t()}finally{e.forEach((t=>{n[t]=r[t]}))}}function w_(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return ys?es.forEach((r=>{n[r]=(...n)=>{t&&b_((()=>{st.console[r](`${m_}[${r}]:`,...n)}))}})):es.forEach((t=>{n[t]=()=>{}})),n}const Zn=mu("logger",w_);function bu(){return wu(st),st}function wu(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||Br,n[Br]=n[Br]||{}}const x_=Object.prototype.toString;function A_(t,n){return x_.call(t)===`[object ${n}]`}function S_(t){return A_(t,"Object")}function E_(t){return!(!t||!t.then||"function"!=typeof t.then)}function I_(t,n,r){try{Object.defineProperty(t,n,{value:r,writable:!0,configurable:!0})}catch{ys&&Zn.log(`Failed to add non-enumerable property "${n}" to object`,t)}}const ms=1e3;function bs(){return Date.now()/ms}function R_(){const{performance:t}=st;if(!t||!t.now)return bs;const n=Date.now()-t.now(),r=null==t.timeOrigin?n:t.timeOrigin;return()=>(r+t.now())/ms}const k_=R_();function nr(){const t=st,n=t.crypto||t.msCrypto;let r=()=>16*Math.random();try{if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");n&&n.getRandomValues&&(r=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(t=>(t^(15&r())>>t/4).toString(16)))}function j_(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||k_(),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:nr()),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 nr()}function ns(){return nr().substring(16)}function ws(t,n,r=2){if(!n||"object"!=typeof n||r<=0)return n;if(t&&n&&0===Object.keys(n).length)return t;const e={...t};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=ws(e[t],n[t],r-1));return e}(()=>{const{performance:t}=st;if(!t||!t.now)return;const n=36e5,r=t.now(),e=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+r-e):n,u=i<n,o=t.timing&&t.timing.navigationStart,a="number"==typeof o?Math.abs(o+r-e):n;(u||a<n)&&(i<=a&&t.timeOrigin)})();const yu="_sentrySpan";function is(t,n){n?I_(t,yu,n):delete t[yu]}function us(t){return t[yu]}const O_=100;class xu{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:ns()}}clone(){const t=new xu;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,is(t,us(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&&j_(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,[r,e]=n instanceof Tr?[n.getScopeData(),n.getRequestSession()]:S_(n)?[t,t.requestSession]:[],{tags:i,extra:u,user:o,contexts:a,level:s,fingerprint:c=[],propagationContext:f}=r||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...u},this._contexts={...this._contexts,...a},o&&Object.keys(o).length&&(this._user=o),s&&(this._level=s),c.length&&(this._fingerprint=c),f&&(this._propagationContext=f),e&&(this._requestSession=e),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,is(this,void 0),this._attachments=[],this.setPropagationContext({traceId:rs()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r="number"==typeof n?n:O_;if(r<=0)return this;const e={timestamp:bs(),...t},i=this._breadcrumbs;return i.push(e),this._breadcrumbs=i.length>r?i.slice(-r):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:us(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=ws(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:ns(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n&&n.event_id?n.event_id:nr();if(!this._client)return Zn.warn("No client configured on scope - will not capture exception!"),r;const e=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:e,...n,event_id:r},this),r}captureMessage(t,n,r){const e=r&&r.event_id?r.event_id:nr();if(!this._client)return Zn.warn("No client configured on scope - will not capture message!"),e;const i=new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:e},this),e}captureEvent(t,n){const r=n&&n.event_id?n.event_id:nr();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(Zn.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}}const Tr=xu;function C_(){return mu("defaultCurrentScope",(()=>new Tr))}function W_(){return mu("defaultIsolationScope",(()=>new Tr))}class L_{constructor(t,n){let r,e;r=t||new Tr,e=n||new Tr,this._stack=[{scope:r}],this._isolationScope=e}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(t){throw this._popScope(),t}return E_(r)?r.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(this._popScope(),r)}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 ir(){const t=wu(bu());return t.stack=t.stack||new L_(C_(),W_())}function F_(t){return ir().withScope(t)}function P_(t,n){const r=ir();return r.withScope((()=>(r.getStackTop().scope=t,n(t))))}function os(t){return ir().withScope((()=>t(ir().getIsolationScope())))}function B_(){return{withIsolationScope:os,withScope:F_,withSetScope:P_,withSetIsolationScope:(t,n)=>os(n),getCurrentScope:()=>ir().getScope(),getIsolationScope:()=>ir().getIsolationScope()}}function xs(t){const n=wu(t);return n.acs?n.acs:B_()}function As(){return xs(bu()).getCurrentScope()}function N_(){return xs(bu()).getIsolationScope()}function D_(t,n){return As().captureException(t,void 0)}function T_(t,n){const r={captureContext:n};return As().captureMessage(t,void 0,r)}function M_(t,n){N_().setExtra(t,n)}const z_=(...t)=>{let n="";for(const r of t){if(r instanceof Error){const t=r;return M_("exceptionMessage",n),void D_(t)}if("object"!=typeof r)n+=r;else try{n+=" "+JSON.stringify(r)}catch{n+=" "+r}}T_(n)},q_=()=>"object"!=typeof window,as=["debug","info","warn","error"],U_=(t,n)=>{const r=as.indexOf(t);return as.indexOf(n)>=r},Jn=(t,n,r,...e)=>{U_(n,t)&&console.log(`[${t}] ${r}`,...e)},J_=()=>null==window?void 0:window.localStorage.getItem("logger_lvl"),Z_=(t=!q_()&&J_()||"warn")=>{let n=t;return{debug:(t,...r)=>Jn("debug",n,t,...r),info:(t,...r)=>Jn("info",n,t,...r),warn:(t,...r)=>Jn("warn",n,t,...r),error:(t,...r)=>(z_(t,...r),Jn("error",n,t,...r)),setLevel:t=>{n=t},getLevel:()=>n}},ss=Z_(),Au="auth_token",Ss=()=>localStorage.getItem(Au)||void 0,K_=t=>localStorage.setItem(Au,t),H_=()=>localStorage.removeItem(Au),X_=()=>!!Ss(),Q_={getToken:Ss,setToken:K_,removeToken:H_,hasToken:X_},cs={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isPending:!!Q_.getToken(),isAuthenticated:!1},G_=c_({name:"auth",initialState:cs,reducers:{login:(t,n)=>{t.isAuthenticated=!0,t.token=n.payload||null,t.isPending=!1},logout:()=>({...cs,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:{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}});var fs,Pr={exports:{}},Y_=Pr.exports;
10
+ */function v_(){if(Va)return Fr;Va=1;var t=n_,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),e=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function o(t,r,o){var a,s={},c=null,f=null;for(a in void 0!==o&&(c=""+o),void 0!==r.key&&(c=""+r.key),void 0!==r.ref&&(f=r.ref),r)e.call(r,a)&&!u.hasOwnProperty(a)&&(s[a]=r[a]);if(t&&t.defaultProps)for(a in r=t.defaultProps)void 0===s[a]&&(s[a]=r[a]);return{$$typeof:n,type:t,key:c,ref:f,props:s,_owner:i.current}}return Fr.Fragment=r,Fr.jsx=o,Fr.jsxs=o,Fr}function y_(){return $a||($a=1,hu.exports=v_()),hu.exports}var ie=y_();const Br="8.48.0",st=globalThis;function mu(t,n,r){const e=st,i=e.__SENTRY__=e.__SENTRY__||{},u=i[Br]=i[Br]||{};return u[t]||(u[t]=n())}const ys=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,m_="Sentry Logger ",es=["debug","info","warn","error","log","assert","trace"],ts={};function b_(t){if(!("console"in st))return t();const n=st.console,r={},e=Object.keys(ts);e.forEach((t=>{const e=ts[t];r[t]=n[t],n[t]=e}));try{return t()}finally{e.forEach((t=>{n[t]=r[t]}))}}function w_(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return ys?es.forEach((r=>{n[r]=(...n)=>{t&&b_((()=>{st.console[r](`${m_}[${r}]:`,...n)}))}})):es.forEach((t=>{n[t]=()=>{}})),n}const Zn=mu("logger",w_);function bu(){return wu(st),st}function wu(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||Br,n[Br]=n[Br]||{}}const x_=Object.prototype.toString;function A_(t,n){return x_.call(t)===`[object ${n}]`}function S_(t){return A_(t,"Object")}function E_(t){return!(!t||!t.then||"function"!=typeof t.then)}function I_(t,n,r){try{Object.defineProperty(t,n,{value:r,writable:!0,configurable:!0})}catch{ys&&Zn.log(`Failed to add non-enumerable property "${n}" to object`,t)}}const ms=1e3;function bs(){return Date.now()/ms}function R_(){const{performance:t}=st;if(!t||!t.now)return bs;const n=Date.now()-t.now(),r=null==t.timeOrigin?n:t.timeOrigin;return()=>(r+t.now())/ms}const k_=R_();function nr(){const t=st,n=t.crypto||t.msCrypto;let r=()=>16*Math.random();try{if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");n&&n.getRandomValues&&(r=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch{}return"10000000100040008000100000000000".replace(/[018]/g,(t=>(t^(15&r())>>t/4).toString(16)))}function j_(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||k_(),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:nr()),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 nr()}function ns(){return nr().substring(16)}function ws(t,n,r=2){if(!n||"object"!=typeof n||r<=0)return n;if(t&&n&&0===Object.keys(n).length)return t;const e={...t};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=ws(e[t],n[t],r-1));return e}(()=>{const{performance:t}=st;if(!t||!t.now)return;const n=36e5,r=t.now(),e=Date.now(),i=t.timeOrigin?Math.abs(t.timeOrigin+r-e):n,u=i<n,o=t.timing&&t.timing.navigationStart,a="number"==typeof o?Math.abs(o+r-e):n;(u||a<n)&&(i<=a&&t.timeOrigin)})();const yu="_sentrySpan";function is(t,n){n?I_(t,yu,n):delete t[yu]}function us(t){return t[yu]}const O_=100;class xu{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:ns()}}clone(){const t=new xu;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,is(t,us(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&&j_(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,[r,e]=n instanceof Tr?[n.getScopeData(),n.getRequestSession()]:S_(n)?[t,t.requestSession]:[],{tags:i,extra:u,user:o,contexts:a,level:s,fingerprint:c=[],propagationContext:f}=r||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...u},this._contexts={...this._contexts,...a},o&&Object.keys(o).length&&(this._user=o),s&&(this._level=s),c.length&&(this._fingerprint=c),f&&(this._propagationContext=f),e&&(this._requestSession=e),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,is(this,void 0),this._attachments=[],this.setPropagationContext({traceId:rs()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r="number"==typeof n?n:O_;if(r<=0)return this;const e={timestamp:bs(),...t},i=this._breadcrumbs;return i.push(e),this._breadcrumbs=i.length>r?i.slice(-r):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:us(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=ws(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:ns(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n&&n.event_id?n.event_id:nr();if(!this._client)return Zn.warn("No client configured on scope - will not capture exception!"),r;const e=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:e,...n,event_id:r},this),r}captureMessage(t,n,r){const e=r&&r.event_id?r.event_id:nr();if(!this._client)return Zn.warn("No client configured on scope - will not capture message!"),e;const i=new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:e},this),e}captureEvent(t,n){const r=n&&n.event_id?n.event_id:nr();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(Zn.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((t=>{t(this)})),this._notifyingListeners=!1)}}const Tr=xu;function C_(){return mu("defaultCurrentScope",(()=>new Tr))}function W_(){return mu("defaultIsolationScope",(()=>new Tr))}class L_{constructor(t,n){let r,e;r=t||new Tr,e=n||new Tr,this._stack=[{scope:r}],this._isolationScope=e}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(t){throw this._popScope(),t}return E_(r)?r.then((t=>(this._popScope(),t)),(t=>{throw this._popScope(),t})):(this._popScope(),r)}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 ir(){const t=wu(bu());return t.stack=t.stack||new L_(C_(),W_())}function F_(t){return ir().withScope(t)}function P_(t,n){const r=ir();return r.withScope((()=>(r.getStackTop().scope=t,n(t))))}function os(t){return ir().withScope((()=>t(ir().getIsolationScope())))}function B_(){return{withIsolationScope:os,withScope:F_,withSetScope:P_,withSetIsolationScope:(t,n)=>os(n),getCurrentScope:()=>ir().getScope(),getIsolationScope:()=>ir().getIsolationScope()}}function xs(t){const n=wu(t);return n.acs?n.acs:B_()}function As(){return xs(bu()).getCurrentScope()}function N_(){return xs(bu()).getIsolationScope()}function D_(t,n){return As().captureException(t,void 0)}function T_(t,n){const r={captureContext:n};return As().captureMessage(t,void 0,r)}function M_(t,n){N_().setExtra(t,n)}const z_=(...t)=>{let n="";for(const r of t){if(r instanceof Error){const t=r;return M_("exceptionMessage",n),void D_(t)}if("object"!=typeof r)n+=r;else try{n+=" "+JSON.stringify(r)}catch{n+=" "+r}}T_(n)},q_=()=>"object"!=typeof window,as=["debug","info","warn","error"],U_=(t,n)=>{const r=as.indexOf(t);return as.indexOf(n)>=r},Jn=(t,n,r,...e)=>{U_(n,t)&&console.log(`[${t}] ${r}`,...e)},J_=()=>null==window?void 0:window.localStorage.getItem("logger_lvl"),Z_=(t=(q_()?"info":J_()||"warn"))=>{let n=t;return{debug:(t,...r)=>Jn("debug",n,t,...r),info:(t,...r)=>Jn("info",n,t,...r),warn:(t,...r)=>Jn("warn",n,t,...r),error:(t,...r)=>(z_(t,...r),Jn("error",n,t,...r)),setLevel:t=>{n=t},getLevel:()=>n}},ss=Z_(),Au="auth_token",Ss=()=>localStorage.getItem(Au)||void 0,K_=t=>localStorage.setItem(Au,t),H_=()=>localStorage.removeItem(Au),X_=()=>!!Ss(),Q_={getToken:Ss,setToken:K_,removeToken:H_,hasToken:X_},cs={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isPending:!!Q_.getToken(),isAuthenticated:!1},G_=c_({name:"auth",initialState:cs,reducers:{login:(t,n)=>{t.isAuthenticated=!0,t.token=n.payload||null,t.isPending=!1},logout:()=>({...cs,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:{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}});var fs,Pr={exports:{}},Y_=Pr.exports;
11
11
  /**
12
12
  * @license
13
13
  * Lodash <https://lodash.com/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wellesley/error-kit",
3
- "version": "1.0.197",
3
+ "version": "1.0.199",
4
4
  "license": "UNLICENSED",
5
5
  "main": "index.mjs",
6
6
  "files": [