@wellesley/instanceinfo 1.0.704 → 1.0.705
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.
- package/index.mjs +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createAction as ds,createSelector as ur,createSlice as n_}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{api as i_}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.831";import u_,{forwardRef as _s,createElement as mu}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{toast as Qa}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.175";const o_=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)},a_=t=>o_(t)&&"type"in t&&"string"==typeof t.type,P=t=>{const n=n=>({type:t,payload:n});return n.toString=()=>`${t}`,n.type=t,n.match=n=>a_(n)&&n.type===t,n};P("remoteReady"),P("askLogin"),P("reselectUser"),P("requestLogout"),P("setConfirmLeavePage"),P("requestChangePath"),P("wsSubscribe"),P("wsUnSubscribe"),P("hostStoreConnect"),P("remoteLogin"),P("remoteLogout"),P("wsOnMessage"),P("setRouterPath"),P("setDeviceType"),P("setDeviceWidth"),P("setUserError"),P("setUserIsError"),P("setUserPending"),P("setUserSuccess"),P("setUserData"),P("updateAccountData"),P("updateUser"),P("addNotification"),P("markNotification"),P("setNotificationsError"),P("setNotificationsList"),P("setNotificationsPending"),P("setNotificationsTotalCount"),P("setNotificationsUnreadCount"),P("acceptAllFollowRequests"),P("resetNotificationsState"),P("undoNotification");const vs=P("setInstanceInfo"),bu=P("setInstanceInfoPending"),ys=P("setInstanceInfoError");P("setPlatformSettings"),P("setProfileSettings"),P("setGroupData"),P("setGroupLoading"),P("requestLocalStorageGet"),P("requestLocalStorageSet"),P("requestLocalStorageRemove"),P("requestLocalStorageClear"),P("requestLocalStorageKeys"),P("requestLocalStorageHas"),P("sendLocalStorageResponse"),P("sendLocalStorageChanged");const Tr="8.48.0",ce=globalThis;function xu(t,n,r){const e=ce,i=e.__SENTRY__=e.__SENTRY__||{},u=i[Tr]=i[Tr]||{};return u[t]||(u[t]=n())}const ms=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,s_="Sentry Logger ",ts=["debug","info","warn","error","log","assert","trace"],es={};function c_(t){if(!("console"in ce))return t();const n=ce.console,r={},e=Object.keys(es);e.forEach((t=>{const e=es[t];r[t]=n[t],n[t]=e}));try{return t()}finally{e.forEach((t=>{n[t]=r[t]}))}}function f_(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return ms?ts.forEach((r=>{n[r]=(...n)=>{t&&c_((()=>{ce.console[r](`${s_}[${r}]:`,...n)}))}})):ts.forEach((t=>{n[t]=()=>{}})),n}const $n=xu("logger",f_);function Su(){return Au(ce),ce}function Au(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||Tr,n[Tr]=n[Tr]||{}}const l_=Object.prototype.toString;function h_(t,n){return l_.call(t)===`[object ${n}]`}function p_(t){return h_(t,"Object")}function g_(t){return!(!t||!t.then||"function"!=typeof t.then)}function d_(t,n,r){try{Object.defineProperty(t,n,{value:r,writable:!0,configurable:!0})}catch{ms&&$n.log(`Failed to add non-enumerable property "${n}" to object`,t)}}const bs=1e3;function ws(){return Date.now()/bs}function __(){const{performance:t}=ce;if(!t||!t.now)return ws;const n=Date.now()-t.now(),r=null==t.timeOrigin?n:t.timeOrigin;return()=>(r+t.now())/bs}const v_=__();function nr(){const t=ce,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 y_(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||v_(),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 xs(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]=xs(e[t],n[t],r-1));return e}(()=>{const{performance:t}=ce;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 wu="_sentrySpan";function is(t,n){n?d_(t,wu,n):delete t[wu]}function us(t){return t[wu]}const m_=100;class Iu{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 Iu;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&&y_(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 Nr?[n.getScopeData(),n.getRequestSession()]:p_(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:m_;if(r<=0)return this;const e={timestamp:ws(),...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=xs(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 $n.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 $n.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):($n.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 Nr=Iu;function b_(){return xu("defaultCurrentScope",(()=>new Nr))}function w_(){return xu("defaultIsolationScope",(()=>new Nr))}class x_{constructor(t,n){let r,e;r=t||new Nr,e=n||new Nr,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 g_(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=Au(Su());return t.stack=t.stack||new x_(b_(),w_())}function S_(t){return ir().withScope(t)}function A_(t,n){const r=ir();return r.withScope((()=>(r.getStackTop().scope=t,n(t))))}function os(t){return ir().withScope((()=>t(ir().getIsolationScope())))}function I_(){return{withIsolationScope:os,withScope:S_,withSetScope:A_,withSetIsolationScope:(t,n)=>os(n),getCurrentScope:()=>ir().getScope(),getIsolationScope:()=>ir().getIsolationScope()}}function Ss(t){const n=Au(t);return n.acs?n.acs:I_()}function As(){return Ss(Su()).getCurrentScope()}function E_(){return Ss(Su()).getIsolationScope()}function R_(t,n){return As().captureException(t,void 0)}function O_(t,n){const r={captureContext:n};return As().captureMessage(t,void 0,r)}function k_(t,n){E_().setExtra(t,n)}var qn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const L_=(...t)=>{let n="";for(const r of t){if(r instanceof Error){const t=r;return k_("exceptionMessage",n),void R_(t)}if("object"!=typeof r)n+=r;else try{n+=" "+JSON.stringify(r)}catch{n+=" "+r}}O_(n)},C_=()=>"object"!=typeof window,W_="wlsy",Is=()=>{try{return window.localStorage}catch(t){console.warn("Error getting window.localStorage storage",t)}},j_=()=>{const t=new Set,n=Is();if(!n)return[];for(let r=0;r<(null==n?void 0:n.length);r+=1){const e=null==n?void 0:n.key(r);"string"==typeof e&&t.add(e)}return Array.from(t)},P_=t=>{const n=`${W_}`,r=t=>`${n}:${t}`,e=()=>j_().filter((t=>t.startsWith(`${n}:`))),i=t=>t.slice(n.length+1),u=Is(),o=t=>{try{return null==u?void 0:u.getItem(r(t))}catch{return null}},a=(t,n)=>{try{null==u||u.setItem(r(t),String(n))}catch{return}};return{getItem:o,setItem:a,removeItem:t=>{try{null==u||u.removeItem(r(t))}catch{return}},clear:()=>{try{e().forEach((t=>null==u?void 0:u.removeItem(t)))}catch{return}},keys:()=>e().map(i),has:t=>null!==o(t),getJSON:t=>{const n=o(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}}}},as=["debug","info","warn","error"],B_=(t,n)=>{const r=as.indexOf(t);return as.indexOf(n)>=r},Un=(t,n,r,...e)=>{B_(n,t)&&console.log(`[${t}] ${r}`,...e)},D_=()=>P_().getItem("logger_lvl"),T_=(t=(C_()?"info":D_()||"warn"))=>{let n=t;return{debug:(t,...r)=>Un("debug",n,t,...r),info:(t,...r)=>Un("info",n,t,...r),warn:(t,...r)=>Un("warn",n,t,...r),error:(t,...r)=>(L_(t,...r),Un("error",n,t,...r)),setLevel:t=>{n=t},getLevel:()=>n}};T_(),ds("requestMicroFrontendFetch"),ds("sendMicroFrontendFetchResponse");const Eu=t=>t,Gn=ur(Eu,(t=>t.data)),N_=ur(Eu,(t=>t.error)),M_=ur(Eu,(t=>t.isPending)),F_=ur(Gn,(t=>null==t?void 0:t.rules)),z_=ur(Gn,(t=>null==t?void 0:t.contact_account)),q_=ur(Gn,(t=>(null==t?void 0:t.stats)&&Object.fromEntries(Object.entries(t.stats).map((([t,n])=>[t,n??0]))))),U_={data:null,isPending:!1},gv=n_({name:"instanceInfo",initialState:U_,reducers:{},extraReducers:t=>{t.addCase(vs,((t,{payload:n})=>{t.data=n})).addCase(bu,((t,{payload:n})=>{t.isPending=n})).addCase(ys,((t,{payload:n})=>{t.error=n}))},selectors:{selectInstanceInfo:Gn,selectInstanceInfoError:N_,selectInstanceInfoPending:M_,selectPlatformRules:F_,selectInstanceContacts:z_,selectInstanceStats:q_,selectDescription:t=>{var n;return null==(n=t.data)?void 0:n.description},selectStats:t=>{var n;return null==(n=t.data)?void 0:n.stats},selectRegistrations:t=>{var n;return null==(n=t.data)?void 0:n.configuration.registrations}}});var ss,Dr={exports:{}},$_=Dr.exports;
|
|
1
|
+
import{createAction as ds,createSelector as ur,createSlice as n_}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{api as i_}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.832";import u_,{forwardRef as _s,createElement as mu}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{toast as Qa}from"https://cdn.jsdelivr.net/npm/@wellesley/system-toast@1.0.176";const o_=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)},a_=t=>o_(t)&&"type"in t&&"string"==typeof t.type,P=t=>{const n=n=>({type:t,payload:n});return n.toString=()=>`${t}`,n.type=t,n.match=n=>a_(n)&&n.type===t,n};P("remoteReady"),P("askLogin"),P("reselectUser"),P("requestLogout"),P("setConfirmLeavePage"),P("requestChangePath"),P("wsSubscribe"),P("wsUnSubscribe"),P("hostStoreConnect"),P("remoteLogin"),P("remoteLogout"),P("wsOnMessage"),P("setRouterPath"),P("setDeviceType"),P("setDeviceWidth"),P("setUserError"),P("setUserIsError"),P("setUserPending"),P("setUserSuccess"),P("setUserData"),P("updateAccountData"),P("updateUser"),P("addNotification"),P("markNotification"),P("setNotificationsError"),P("setNotificationsList"),P("setNotificationsPending"),P("setNotificationsTotalCount"),P("setNotificationsUnreadCount"),P("acceptAllFollowRequests"),P("resetNotificationsState"),P("undoNotification");const vs=P("setInstanceInfo"),bu=P("setInstanceInfoPending"),ys=P("setInstanceInfoError");P("setPlatformSettings"),P("setProfileSettings"),P("setGroupData"),P("setGroupLoading"),P("requestLocalStorageGet"),P("requestLocalStorageSet"),P("requestLocalStorageRemove"),P("requestLocalStorageClear"),P("requestLocalStorageKeys"),P("requestLocalStorageHas"),P("sendLocalStorageResponse"),P("sendLocalStorageChanged");const Tr="8.48.0",ce=globalThis;function xu(t,n,r){const e=ce,i=e.__SENTRY__=e.__SENTRY__||{},u=i[Tr]=i[Tr]||{};return u[t]||(u[t]=n())}const ms=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,s_="Sentry Logger ",ts=["debug","info","warn","error","log","assert","trace"],es={};function c_(t){if(!("console"in ce))return t();const n=ce.console,r={},e=Object.keys(es);e.forEach((t=>{const e=es[t];r[t]=n[t],n[t]=e}));try{return t()}finally{e.forEach((t=>{n[t]=r[t]}))}}function f_(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return ms?ts.forEach((r=>{n[r]=(...n)=>{t&&c_((()=>{ce.console[r](`${s_}[${r}]:`,...n)}))}})):ts.forEach((t=>{n[t]=()=>{}})),n}const $n=xu("logger",f_);function Su(){return Au(ce),ce}function Au(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||Tr,n[Tr]=n[Tr]||{}}const l_=Object.prototype.toString;function h_(t,n){return l_.call(t)===`[object ${n}]`}function p_(t){return h_(t,"Object")}function g_(t){return!(!t||!t.then||"function"!=typeof t.then)}function d_(t,n,r){try{Object.defineProperty(t,n,{value:r,writable:!0,configurable:!0})}catch{ms&&$n.log(`Failed to add non-enumerable property "${n}" to object`,t)}}const bs=1e3;function ws(){return Date.now()/bs}function __(){const{performance:t}=ce;if(!t||!t.now)return ws;const n=Date.now()-t.now(),r=null==t.timeOrigin?n:t.timeOrigin;return()=>(r+t.now())/bs}const v_=__();function nr(){const t=ce,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 y_(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||v_(),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 xs(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]=xs(e[t],n[t],r-1));return e}(()=>{const{performance:t}=ce;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 wu="_sentrySpan";function is(t,n){n?d_(t,wu,n):delete t[wu]}function us(t){return t[wu]}const m_=100;class Iu{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 Iu;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&&y_(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 Nr?[n.getScopeData(),n.getRequestSession()]:p_(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:m_;if(r<=0)return this;const e={timestamp:ws(),...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=xs(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 $n.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 $n.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):($n.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 Nr=Iu;function b_(){return xu("defaultCurrentScope",(()=>new Nr))}function w_(){return xu("defaultIsolationScope",(()=>new Nr))}class x_{constructor(t,n){let r,e;r=t||new Nr,e=n||new Nr,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 g_(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=Au(Su());return t.stack=t.stack||new x_(b_(),w_())}function S_(t){return ir().withScope(t)}function A_(t,n){const r=ir();return r.withScope((()=>(r.getStackTop().scope=t,n(t))))}function os(t){return ir().withScope((()=>t(ir().getIsolationScope())))}function I_(){return{withIsolationScope:os,withScope:S_,withSetScope:A_,withSetIsolationScope:(t,n)=>os(n),getCurrentScope:()=>ir().getScope(),getIsolationScope:()=>ir().getIsolationScope()}}function Ss(t){const n=Au(t);return n.acs?n.acs:I_()}function As(){return Ss(Su()).getCurrentScope()}function E_(){return Ss(Su()).getIsolationScope()}function R_(t,n){return As().captureException(t,void 0)}function O_(t,n){const r={captureContext:n};return As().captureMessage(t,void 0,r)}function k_(t,n){E_().setExtra(t,n)}var qn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const L_=(...t)=>{let n="";for(const r of t){if(r instanceof Error){const t=r;return k_("exceptionMessage",n),void R_(t)}if("object"!=typeof r)n+=r;else try{n+=" "+JSON.stringify(r)}catch{n+=" "+r}}O_(n)},C_=()=>"object"!=typeof window,W_="wlsy",Is=()=>{try{return window.localStorage}catch(t){console.warn("Error getting window.localStorage storage",t)}},j_=()=>{const t=new Set,n=Is();if(!n)return[];for(let r=0;r<(null==n?void 0:n.length);r+=1){const e=null==n?void 0:n.key(r);"string"==typeof e&&t.add(e)}return Array.from(t)},P_=t=>{const n=`${W_}`,r=t=>`${n}:${t}`,e=()=>j_().filter((t=>t.startsWith(`${n}:`))),i=t=>t.slice(n.length+1),u=Is(),o=t=>{try{return null==u?void 0:u.getItem(r(t))}catch{return null}},a=(t,n)=>{try{null==u||u.setItem(r(t),String(n))}catch{return}};return{getItem:o,setItem:a,removeItem:t=>{try{null==u||u.removeItem(r(t))}catch{return}},clear:()=>{try{e().forEach((t=>null==u?void 0:u.removeItem(t)))}catch{return}},keys:()=>e().map(i),has:t=>null!==o(t),getJSON:t=>{const n=o(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}}}},as=["debug","info","warn","error"],B_=(t,n)=>{const r=as.indexOf(t);return as.indexOf(n)>=r},Un=(t,n,r,...e)=>{B_(n,t)&&console.log(`[${t}] ${r}`,...e)},D_=()=>P_().getItem("logger_lvl"),T_=(t=(C_()?"info":D_()||"warn"))=>{let n=t;return{debug:(t,...r)=>Un("debug",n,t,...r),info:(t,...r)=>Un("info",n,t,...r),warn:(t,...r)=>Un("warn",n,t,...r),error:(t,...r)=>(L_(t,...r),Un("error",n,t,...r)),setLevel:t=>{n=t},getLevel:()=>n}};T_(),ds("requestMicroFrontendFetch"),ds("sendMicroFrontendFetchResponse");const Eu=t=>t,Gn=ur(Eu,(t=>t.data)),N_=ur(Eu,(t=>t.error)),M_=ur(Eu,(t=>t.isPending)),F_=ur(Gn,(t=>null==t?void 0:t.rules)),z_=ur(Gn,(t=>null==t?void 0:t.contact_account)),q_=ur(Gn,(t=>(null==t?void 0:t.stats)&&Object.fromEntries(Object.entries(t.stats).map((([t,n])=>[t,n??0]))))),U_={data:null,isPending:!1},gv=n_({name:"instanceInfo",initialState:U_,reducers:{},extraReducers:t=>{t.addCase(vs,((t,{payload:n})=>{t.data=n})).addCase(bu,((t,{payload:n})=>{t.isPending=n})).addCase(ys,((t,{payload:n})=>{t.error=n}))},selectors:{selectInstanceInfo:Gn,selectInstanceInfoError:N_,selectInstanceInfoPending:M_,selectPlatformRules:F_,selectInstanceContacts:z_,selectInstanceStats:q_,selectDescription:t=>{var n;return null==(n=t.data)?void 0:n.description},selectStats:t=>{var n;return null==(n=t.data)?void 0:n.stats},selectRegistrations:t=>{var n;return null==(n=t.data)?void 0:n.configuration.registrations}}});var ss,Dr={exports:{}},$_=Dr.exports;
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Lodash <https://lodash.com/>
|