@sailfish-ai/sf-veritas 0.1.30 → 0.1.32
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/dist/sf-veritas.cjs +24 -13
- package/dist/sf-veritas.mjs +1052 -898
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/contextManager.d.ts +21 -3
- package/dist/types/index.d.ts +2 -1
- package/dist/types/networkRequestTransmitter.d.ts +24 -0
- package/dist/types/patches/helpers.d.ts +23 -0
- package/dist/types/patches/patchFactory.d.ts +22 -0
- package/dist/types/patches/webFrameworks/HapiHook.d.ts +9 -0
- package/dist/types/patches/webFrameworks/fastifyHook.d.ts +9 -0
- package/dist/types/patches/webFrameworks/fetchHandler.d.ts +5 -0
- package/dist/types/patches/webFrameworks/nodeBlanket.d.ts +16 -0
- package/dist/types/patchhttpInbound.d.ts +15 -0
- package/dist/types/setupConfig.d.ts +5 -0
- package/dist/types/types.d.ts +14 -0
- package/package.json +1 -1
package/dist/sf-veritas.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Te=Object.defineProperty;var Me=(i,r,s)=>r in i?Te(i,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[r]=s;var y=(i,r,s)=>Me(i,typeof r!="symbol"?r+"":r,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _e=require("async_hooks"),Le=require("fs"),De=require("worker_threads"),G=[];for(let i=0;i<256;++i)G.push((i+256).toString(16).slice(1));let ee;const xe=new Uint8Array(16),ue={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function E(i,r,s){if(ue.randomUUID&&!i)return ue.randomUUID();const g=(i=i||{}).random??i.rng?.()??(function(){if(!ee){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ee=crypto.getRandomValues.bind(crypto)}return ee(xe)})();if(g.length<16)throw new Error("Random bytes length must be >= 16");return g[6]=15&g[6]|64,g[8]=63&g[8]|128,(function(a,t=0){return(G[a[t+0]]+G[a[t+1]]+G[a[t+2]]+G[a[t+3]]+"-"+G[a[t+4]]+G[a[t+5]]+"-"+G[a[t+6]]+G[a[t+7]]+"-"+G[a[t+8]]+G[a[t+9]]+"-"+G[a[t+10]]+G[a[t+11]]+G[a[t+12]]+G[a[t+13]]+G[a[t+14]]+G[a[t+15]]).toLowerCase()})(g)}class Oe{constructor(r){y(this,"apiKey");y(this,"apiGraphqlEndpoint");y(this,"sfDebug");y(this,"serviceIdentifier");y(this,"serviceVersion");y(this,"serviceUUID");y(this,"serviceAdditionalMetadata");y(this,"profilingModeEnabled");y(this,"profilingMaxDepth");y(this,"profilingMaxVariableSizeKb");y(this,"domainsToNotPropagateHeadersTo");y(this,"nodeModulesToCollectLocalVariablesOn");y(this,"printConfigurationStatuses");y(this,"logLevel");y(this,"stackDepthLocals");y(this,"stackDepthCodeTraceDepth");y(this,"packageLibraryType");y(this,"version");y(this,"gitSha");y(this,"_serviceIdentificationReceived",!1);this.apiKey=r.apiKey,this.apiGraphqlEndpoint=r?.apiGraphqlEndpoint||process.env.SAILFISH_GRAPHQL_ENDPOINT||"https://api-service.sailfishqa.com/graphql/",this.sfDebug=r?.debug===!0||process.env.SF_DEBUG==="true",this.serviceIdentifier=r?.serviceIdentifier||process.env.SERVICE_IDENTIFIER,this.serviceUUID=E(),this.serviceVersion=r?.serviceVersion||process.env.SERVICE_VERSION,this.gitSha=r?.gitSha||process.env.GIT_SHA||process.env.VERCEL_GIT_COMMIT_SHA,this.serviceAdditionalMetadata=r?.serviceAdditionalMetadata||{},this.profilingModeEnabled=r?.profilingModeEnabled??!1,this.profilingMaxDepth=r?.profilingMaxDepth??5,this.profilingMaxVariableSizeKb=r?.profilingMaxVariableSizeKb??25,this.domainsToNotPropagateHeadersTo=r?.domainsToNotPropagateHeadersTo||[],this.nodeModulesToCollectLocalVariablesOn=r?.nodeModulesToCollectLocalVariablesOn||["_all_"],this.printConfigurationStatuses=process.env.PRINT_CONFIGURATION_STATUSES||"true",this.logLevel=process.env.LOG_LEVEL||"INFO",this.stackDepthLocals=process.env.SAILFISH_EXCEPTION_STACK_DEPTH_LOCALS!==void 0?parseInt(process.env.SAILFISH_EXCEPTION_STACK_DEPTH_LOCALS,10):5,isNaN(this.stackDepthLocals)&&(this.stackDepthLocals=-1),this.stackDepthCodeTraceDepth=process.env.SAILFISH_EXCEPTION_STACK_DEPTH_CODE_TRACE_DEPTH!==void 0?parseInt(process.env.SAILFISH_EXCEPTION_STACK_DEPTH_CODE_TRACE_DEPTH,10):-1,isNaN(this.stackDepthCodeTraceDepth)&&(this.stackDepthCodeTraceDepth=-1),this.packageLibraryType="JS/TS BACKEND",this.version=this.getPackageVersion()}getPackageVersion(){return"0.1.15"}get serviceIdentificationReceived(){return this._serviceIdentificationReceived}setServiceIdentificationReceived(r){this._serviceIdentificationReceived=r}}const Ye=Symbol.for("sailfish.sf_config");function Ke(){return globalThis[Ye]}function ze(i){const r=Ke();if(r)return{config:r};const s=new Oe(i);return(function(g){globalThis[Ye]=g})(s),s.sfDebug&&console.log("[[getOrCreateConfig]] Created global config:",s),{config:s}}function A(){const i=Ke();if(!i)throw new Error("Configuration has not been initialized. Call getOrCreateConfig(options) first.");return i}const de=Symbol.for("sf.ctx.storeAls"),V=globalThis,te=V[de]??(V[de]=new _e.AsyncLocalStorage),Ue=["identitytoolkit.googleapis.com","t.co","*.twitter.com","*.gravatar.com","*.googleapis.com","*.amazonaws.com","*.smooch.io","*.zendesk.com"],Ie=Symbol.for("sf.ctx.als"),J=V[Ie]??(V[Ie]=new _e.AsyncLocalStorage),pe=Symbol.for("sf.ctx.sessionRegistry"),K=V[pe]??(V[pe]=new Map),O={handledExceptions:new Set,reentrancyGuardLoggingActive:!1,reentrancyGuardLoggingPreActive:!1,reentrancyGuardPrintActive:!1,reentrancyGuardPrintPreActive:!1,reentrancyGuardExceptionActive:!1,reentrancyGuardExceptionPreActive:!1,excludedDomains:new Set(Ue),supportedDomains:new Set},_=class _{constructor(){}current(){return te.getStore()}ensureStore(){const r=this.current();if(r)return r;const s=new Map;return te.enterWith(s),s}runWith(r,s){const g=this.current()??new Map,a=new Map(g);for(const[t,o]of Object.entries(r))a.set(t,o);return te.run(a,s)}static getInstance(){return V[_.GLOBAL_MANAGER_SYMBOL]||(V[_.GLOBAL_MANAGER_SYMBOL]=new _),V[_.GLOBAL_MANAGER_SYMBOL]}getCurrentContext(){return J.getStore()||O}setCurrentContext(r){const s=J.getStore()||O;J.enterWith({...s,...r})}ensureSession(r){let s=K.get(r);return s||(s={...O},K.set(r,s)),s}getContextFor(r){return K.get(r)??O}updateContextFor(r,s){const g=this.ensureSession(r);K.set(r,{...g,...s})}runWithSession(r,s){const g={...this.ensureSession(r)};return J.run(g,s)}deleteSession(r){K.delete(r)}getTraceId(){return this.getCurrentContext().traceId}getPageVisitUUID(){return this.getCurrentContext().pageVisitUUID}setTraceId(r){this.setCurrentContext({traceId:r})}setPageVisitUUID(r){this.setCurrentContext({pageVisitUUID:r})}getOrSetSfTraceId(r,s=!1){let g=this.getTraceId();return g||(g=r||(s?E():`nonsession-applogs-v3/${A().apiKey}/${E()}`),this.setTraceId(g),A().sfDebug&&console.log(" Created new trace ID:",g),g)}getOrSetPageVisitUUID(){let r=this.getPageVisitUUID();return r||(r=E(),this.setPageVisitUUID(r),A().sfDebug&&console.log(" Created new page visit UUID:",r),r)}getHandledExceptions(){return this.getCurrentContext().handledExceptions}markExceptionHandled(r){const s=this.getHandledExceptions();s.add(r),this.setCurrentContext({handledExceptions:s})}hasHandledException(r){return this.getHandledExceptions().has(r)}resetHandledExceptions(){this.setCurrentContext({handledExceptions:new Set})}getExcludedDomains(){return this.getCurrentContext().excludedDomains}getSupportedDomains(){return this.getCurrentContext().supportedDomains}addSupportedDomains(r){this.getCurrentContext().supportedDomains.add(r.toLowerCase().trim())}setTraceIdFor(r,s){this.updateContextFor(r,{traceId:s})}setPageVisitUUIDFor(r,s){this.updateContextFor(r,{pageVisitUUID:s})}};y(_,"GLOBAL_MANAGER_SYMBOL",Symbol.for("sf.ctx.manager"));let w=_;class L{constructor(){y(this,"apiKey");y(this,"endpoint");y(this,"queryType","mutation");y(this,"operationName","");y(this,"serviceUUID",A().serviceUUID);y(this,"contextManager");this.apiKey=A().apiKey,this.endpoint=A().apiGraphqlEndpoint,this.contextManager=w.getInstance()}get queryName(){return this.operationName?this.operationName.charAt(0).toLowerCase()+this.operationName.slice(1):""}getDefaultVariables(){const r=Date.now().toString(),s=this.contextManager.getOrSetSfTraceId();return{apiKey:this.apiKey,serviceUuid:this.serviceUUID,sessionId:s,timestampMs:r}}getVariables(r={}){return{...this.getDefaultVariables(),...r}}setOperationName(r){this.operationName=r}setEndpoint(r){this.endpoint=r}setServiceUUID(r){this.serviceUUID=r}}const ke=fetch;async function H(i,r,s,g){try{const a=A();let t;try{t=JSON.stringify({query:s,variables:g,operationName:r})}catch{t=JSON.stringify({query:s,operationName:r})}ke(i,{method:"POST",headers:{"Content-Type":"application/json"},body:t}).then(async o=>{if(!o.ok)return void(a.sfDebug&&console.error(`GraphQL request failed with status ${o.status} for ${r}`));const c=await o.json();c.errors?.length?(function(I,p,C){const l=I&&typeof I=="object"&&!Array.isArray(I)?Object.keys(I)[0]:void 0;console.error(l==="identifyServiceDetails"?`IdentifyServiceDetails NOT sent successfully for service: UUID=${C.serviceUUID}`:`GraphQL request failed with errors: ${JSON.stringify(p)} for operation key ${l}`)})(c.data,c.errors,a):a.sfDebug&&(function(I,p,C){const l=I&&typeof I=="object"&&!Array.isArray(I)?Object.keys(I)[0]:void 0,d=I[l]||!1;l==="identifyServiceDetails"&&(C.setServiceIdentificationReceived(d),A().sfDebug&&console.log(`IdentifyServiceDetails sent successfully for service: UUID=${C.serviceUUID}; serviceIdentificationReceived=${l==="identifyServiceDetails"?d:"N/A"}`))})(c.data,0,a)}).catch(o=>{a.sfDebug&&console.error("Fetch error:",o)})}catch(a){A().sfDebug&&console.error("Error sending data to GraphQL server:",a)}}class M extends L{constructor(){super(),this.setOperationName("IdentifyServiceDetails")}async doSend(r){if(!A().serviceIdentificationReceived)try{this.send()}catch(s){A().sfDebug&&console.error(" Error during service identification:",s)}}async send(){const r=`
|
|
2
2
|
${this.queryType} ${this.operationName}(
|
|
3
3
|
$apiKey: String!,
|
|
4
4
|
$timestampMs: String!,
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
$serviceAdditionalMetadata: JSON,
|
|
9
9
|
$library: String!,
|
|
10
10
|
$version: String!,
|
|
11
|
+
$gitSha: String!,
|
|
11
12
|
) {
|
|
12
13
|
${this.queryName}(
|
|
13
14
|
apiKey: $apiKey,
|
|
@@ -18,25 +19,26 @@
|
|
|
18
19
|
serviceAdditionalMetadata: $serviceAdditionalMetadata,
|
|
19
20
|
library: $library,
|
|
20
21
|
version: $version,
|
|
22
|
+
gitSha: $gitSha,
|
|
21
23
|
)
|
|
22
24
|
}
|
|
23
|
-
`,
|
|
25
|
+
`,s=this.getVariables({serviceIdentifier:A().serviceIdentifier,serviceVersion:A().serviceVersion,library:A().packageLibraryType,version:A().version,serviceAdditionalMetadata:A().serviceAdditionalMetadata,gitSha:A().gitSha||""});H(this.endpoint,this.operationName,r,s)}}function $e(i){try{return JSON.stringify(i),!0}catch{return!1}}class Pe extends L{constructor(){super();y(this,"serviceIdentifier",new M);this.setOperationName("CollectMetadata")}async sendAppIdentifier(){this.serviceIdentifier.doSend({})}async doSend(s,g,a,t){this.sendAppIdentifier(),this.send(s,g,a,t)}async send(s,g,a,t){if(!g&&!t)throw new Error('Must pass in either traits or traits_json to "add_or_update_traits"');let o=[];if(!t){const I=(function(p){const C={},l=[];if(p)for(const[d,e]of Object.entries(p))$e(e)?C[d]=e:l.push(d);return{traitsJson:JSON.stringify(C),excludedFields:l}})(g);t=I.traitsJson,o=I.excludedFields}const c=this.getVariables({userId:s,traitsJson:t,excludedFields:o,override:a,library:A().packageLibraryType,version:A().version});H(this.endpoint,this.operationName,this.getQuery(),c)}getQuery(){return`
|
|
24
26
|
mutation ${this.operationName}($apiKey: String!, $serviceUuid: String!, $sessionId: String!, $userId: String!, $traitsJson: String!, $excludedFields: [String!]!, $library: String!, $timestampMs: String!, $version: String!, $override: Boolean!) {
|
|
25
27
|
${this.queryName}(apiKey: $apiKey, serviceUuid: $serviceUuid, sessionId: $sessionId, userId: $userId, traitsJson: $traitsJson, excludedFields: $excludedFields, library: $library, timestampMs: $timestampMs, version: $version, override: $override)
|
|
26
28
|
}
|
|
27
|
-
`}}class
|
|
29
|
+
`}}class he{constructor(r){y(this,"metadataTransmitter");this.apiKey=r,this.metadataTransmitter=new Pe}identify(r,s,g,a=!1){s||g?this.addOrUpdateMetadata(r,s,g,a):this.addOrUpdateMetadata(r,{},void 0,a)}addOrUpdateMetadata(r,s={},g,a=!1){if(!s&&!g)throw new Error('Must pass in either traits or traitsJson to "addOrUpdateMetadata"');A().sfDebug&&console.log(" [[DEBUG - addOrUpdateMetadata]] Starting operation"),A().sfDebug&&console.log(" addOrUpdateMetadata...SENDING DATA...",r,s,g),this.metadataTransmitter.doSend(r,s,a,g)}}class le extends L{constructor(){super();y(this,"serviceIdentifier",new M)}async sendAppIdentifier(){this.serviceIdentifier.doSend({})}async doSend(s){this.sendAppIdentifier(),this.send(s)}async send(s){try{const g=Array.isArray(s)?s:[s,"default"],a=this.getVariables({contents:g[0],level:g[1]});H(this.endpoint,this.operationName,this.getQuery(),a)}catch(g){A().sfDebug&&console.error("🚨 Error in send():",g)}}getQuery(){return`
|
|
28
30
|
${this.queryType} ${this.operationName}($apiKey: String!, $serviceUuid: String!, $sessionId: String!, $timestampMs: String!, $level: String!, $contents: String!) {
|
|
29
31
|
${this.queryName}(apiKey: $apiKey, serviceUuid: $serviceUuid, sessionId: $sessionId, timestampMs: $timestampMs, level: $level, contents: $contents)
|
|
30
32
|
}
|
|
31
|
-
`}}var ue,de,F={},q={},D={},M={};function De(){if(ue)return M;ue=1;var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return M.encode=function(r){if(0<=r&&r<s.length)return s[r];throw new TypeError("Must be between 0 and 63: "+r)},M.decode=function(r){return 65<=r&&r<=90?r-65:97<=r&&r<=122?r-97+26:48<=r&&r<=57?r-48+52:r==43?62:r==47?63:-1},M}function Ve(){if(de)return D;de=1;var s=De();return D.encode=function(r){var l,u="",o=function(n){return n<0?1+(-n<<1):0+(n<<1)}(r);do l=31&o,(o>>>=5)>0&&(l|=32),u+=s.encode(l);while(o>0);return u},D.decode=function(r,l,u){var o,n,t,a,I=r.length,C=0,h=0;do{if(l>=I)throw new Error("Expected more digits in base 64 VLQ value.");if((n=s.decode(r.charCodeAt(l++)))===-1)throw new Error("Invalid base64 digit: "+r.charAt(l-1));o=!!(32&n),C+=(n&=31)<<h,h+=5}while(o);u.value=(a=(t=C)>>1,1&~t?a:-a),u.rest=l},D}var Ie,pe={};function J(){return Ie||(Ie=1,function(s){s.getArg=function(e,i,p){if(i in e)return e[i];if(arguments.length===3)return p;throw new Error('"'+i+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,l=/^data:.+\,.+$/;function u(e){var i=e.match(r);return i?{scheme:i[1],auth:i[2],host:i[3],port:i[4],path:i[5]}:null}function o(e){var i="";return e.scheme&&(i+=e.scheme+":"),i+="//",e.auth&&(i+=e.auth+"@"),e.host&&(i+=e.host),e.port&&(i+=":"+e.port),e.path&&(i+=e.path),i}s.urlParse=u,s.urlGenerate=o;var n,t,a=(n=function(e){var i=e,p=u(e);if(p){if(!p.path)return e;i=p.path}for(var g=s.isAbsolute(i),m=[],f=0,y=0;;){if(f=y,(y=i.indexOf("/",f))===-1){m.push(i.slice(f));break}for(m.push(i.slice(f,y));y<i.length&&i[y]==="/";)y++}var G,v=0;for(y=m.length-1;y>=0;y--)(G=m[y])==="."?m.splice(y,1):G===".."?v++:v>0&&(G===""?(m.splice(y+1,v),v=0):(m.splice(y,2),v--));return(i=m.join("/"))===""&&(i=g?"/":"."),p?(p.path=i,o(p)):i},t=[],function(e){for(var i=0;i<t.length;i++)if(t[i].input===e){var p=t[0];return t[0]=t[i],t[i]=p,t[0].result}var g=n(e);return t.unshift({input:e,result:g}),t.length>32&&t.pop(),g});function I(e,i){e===""&&(e="."),i===""&&(i=".");var p=u(i),g=u(e);if(g&&(e=g.path||"/"),p&&!p.scheme)return g&&(p.scheme=g.scheme),o(p);if(p||i.match(l))return i;if(g&&!g.host&&!g.path)return g.host=i,o(g);var m=i.charAt(0)==="/"?i:a(e.replace(/\/+$/,"")+"/"+i);return g?(g.path=m,o(g)):m}s.normalize=a,s.join=I,s.isAbsolute=function(e){return e.charAt(0)==="/"||r.test(e)},s.relative=function(e,i){e===""&&(e="."),e=e.replace(/\/$/,"");for(var p=0;i.indexOf(e+"/")!==0;){var g=e.lastIndexOf("/");if(g<0||(e=e.slice(0,g)).match(/^([^\/]+:\/)?\/*$/))return i;++p}return Array(p+1).join("../")+i.substr(e.length+1)};var C=!("__proto__"in Object.create(null));function h(e){return e}function c(e){if(!e)return!1;var i=e.length;if(i<9||e.charCodeAt(i-1)!==95||e.charCodeAt(i-2)!==95||e.charCodeAt(i-3)!==111||e.charCodeAt(i-4)!==116||e.charCodeAt(i-5)!==111||e.charCodeAt(i-6)!==114||e.charCodeAt(i-7)!==112||e.charCodeAt(i-8)!==95||e.charCodeAt(i-9)!==95)return!1;for(var p=i-10;p>=0;p--)if(e.charCodeAt(p)!==36)return!1;return!0}function d(e,i){return e===i?0:e===null?1:i===null?-1:e>i?1:-1}s.toSetString=C?h:function(e){return c(e)?"$"+e:e},s.fromSetString=C?h:function(e){return c(e)?e.slice(1):e},s.compareByOriginalPositions=function(e,i,p){var g=d(e.source,i.source);return g!==0||(g=e.originalLine-i.originalLine)!==0||(g=e.originalColumn-i.originalColumn)!==0||p||(g=e.generatedColumn-i.generatedColumn)!==0||(g=e.generatedLine-i.generatedLine)!==0?g:d(e.name,i.name)},s.compareByOriginalPositionsNoSource=function(e,i,p){var g;return(g=e.originalLine-i.originalLine)!==0||(g=e.originalColumn-i.originalColumn)!==0||p||(g=e.generatedColumn-i.generatedColumn)!==0||(g=e.generatedLine-i.generatedLine)!==0?g:d(e.name,i.name)},s.compareByGeneratedPositionsDeflated=function(e,i,p){var g=e.generatedLine-i.generatedLine;return g!==0||(g=e.generatedColumn-i.generatedColumn)!==0||p||(g=d(e.source,i.source))!==0||(g=e.originalLine-i.originalLine)!==0||(g=e.originalColumn-i.originalColumn)!==0?g:d(e.name,i.name)},s.compareByGeneratedPositionsDeflatedNoLine=function(e,i,p){var g=e.generatedColumn-i.generatedColumn;return g!==0||p||(g=d(e.source,i.source))!==0||(g=e.originalLine-i.originalLine)!==0||(g=e.originalColumn-i.originalColumn)!==0?g:d(e.name,i.name)},s.compareByGeneratedPositionsInflated=function(e,i){var p=e.generatedLine-i.generatedLine;return p!==0||(p=e.generatedColumn-i.generatedColumn)!==0||(p=d(e.source,i.source))!==0||(p=e.originalLine-i.originalLine)!==0||(p=e.originalColumn-i.originalColumn)!==0?p:d(e.name,i.name)},s.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},s.computeSourceURL=function(e,i,p){if(i=i||"",e&&(e[e.length-1]!=="/"&&i[0]!=="/"&&(e+="/"),i=e+i),p){var g=u(p);if(!g)throw new Error("sourceMapURL could not be parsed");if(g.path){var m=g.path.lastIndexOf("/");m>=0&&(g.path=g.path.substring(0,m+1))}i=I(o(g),i)}return a(i)}}(pe)),pe}var Ce,ee={};function Re(){if(Ce)return ee;Ce=1;var s=J(),r=Object.prototype.hasOwnProperty,l=typeof Map<"u";function u(){this._array=[],this._set=l?new Map:Object.create(null)}return u.fromArray=function(o,n){for(var t=new u,a=0,I=o.length;a<I;a++)t.add(o[a],n);return t},u.prototype.size=function(){return l?this._set.size:Object.getOwnPropertyNames(this._set).length},u.prototype.add=function(o,n){var t=l?o:s.toSetString(o),a=l?this.has(o):r.call(this._set,t),I=this._array.length;a&&!n||this._array.push(o),a||(l?this._set.set(o,I):this._set[t]=I)},u.prototype.has=function(o){if(l)return this._set.has(o);var n=s.toSetString(o);return r.call(this._set,n)},u.prototype.indexOf=function(o){if(l){var n=this._set.get(o);if(n>=0)return n}else{var t=s.toSetString(o);if(r.call(this._set,t))return this._set[t]}throw new Error('"'+o+'" is not in the set.')},u.prototype.at=function(o){if(o>=0&&o<this._array.length)return this._array[o];throw new Error("No element indexed by "+o)},u.prototype.toArray=function(){return this._array.slice()},ee.ArraySet=u,ee}var he,me,ne={};function Me(){if(he)return ne;he=1;var s=J();function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return r.prototype.unsortedForEach=function(l,u){this._array.forEach(l,u)},r.prototype.add=function(l){var u,o,n,t,a,I;u=this._last,o=l,n=u.generatedLine,t=o.generatedLine,a=u.generatedColumn,I=o.generatedColumn,t>n||t==n&&I>=a||s.compareByGeneratedPositionsInflated(u,o)<=0?(this._last=l,this._array.push(l)):(this._sorted=!1,this._array.push(l))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(s.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},ne.MappingList=r,ne}function Ae(){if(me)return q;me=1;var s=Ve(),r=J(),l=Re().ArraySet,u=Me().MappingList;function o(n){n||(n={}),this._file=r.getArg(n,"file",null),this._sourceRoot=r.getArg(n,"sourceRoot",null),this._skipValidation=r.getArg(n,"skipValidation",!1),this._ignoreInvalidMapping=r.getArg(n,"ignoreInvalidMapping",!1),this._sources=new l,this._names=new l,this._mappings=new u,this._sourcesContents=null}return o.prototype._version=3,o.fromSourceMap=function(n,t){var a=n.sourceRoot,I=new o(Object.assign(t||{},{file:n.file,sourceRoot:a}));return n.eachMapping(function(C){var h={generated:{line:C.generatedLine,column:C.generatedColumn}};C.source!=null&&(h.source=C.source,a!=null&&(h.source=r.relative(a,h.source)),h.original={line:C.originalLine,column:C.originalColumn},C.name!=null&&(h.name=C.name)),I.addMapping(h)}),n.sources.forEach(function(C){var h=C;a!==null&&(h=r.relative(a,C)),I._sources.has(h)||I._sources.add(h);var c=n.sourceContentFor(C);c!=null&&I.setSourceContent(C,c)}),I},o.prototype.addMapping=function(n){var t=r.getArg(n,"generated"),a=r.getArg(n,"original",null),I=r.getArg(n,"source",null),C=r.getArg(n,"name",null);(this._skipValidation||this._validateMapping(t,a,I,C)!==!1)&&(I!=null&&(I=String(I),this._sources.has(I)||this._sources.add(I)),C!=null&&(C=String(C),this._names.has(C)||this._names.add(C)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:a!=null&&a.line,originalColumn:a!=null&&a.column,source:I,name:C}))},o.prototype.setSourceContent=function(n,t){var a=n;this._sourceRoot!=null&&(a=r.relative(this._sourceRoot,a)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[r.toSetString(a)]=t):this._sourcesContents&&(delete this._sourcesContents[r.toSetString(a)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},o.prototype.applySourceMap=function(n,t,a){var I=t;if(t==null){if(n.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);I=n.file}var C=this._sourceRoot;C!=null&&(I=r.relative(C,I));var h=new l,c=new l;this._mappings.unsortedForEach(function(d){if(d.source===I&&d.originalLine!=null){var e=n.originalPositionFor({line:d.originalLine,column:d.originalColumn});e.source!=null&&(d.source=e.source,a!=null&&(d.source=r.join(a,d.source)),C!=null&&(d.source=r.relative(C,d.source)),d.originalLine=e.line,d.originalColumn=e.column,e.name!=null&&(d.name=e.name))}var i=d.source;i==null||h.has(i)||h.add(i);var p=d.name;p==null||c.has(p)||c.add(p)},this),this._sources=h,this._names=c,n.sources.forEach(function(d){var e=n.sourceContentFor(d);e!=null&&(a!=null&&(d=r.join(a,d)),C!=null&&(d=r.relative(C,d)),this.setSourceContent(d,e))},this)},o.prototype._validateMapping=function(n,t,a,I){if(t&&typeof t.line!="number"&&typeof t.column!="number"){var C="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(C),!1;throw new Error(C)}if((!(n&&"line"in n&&"column"in n&&n.line>0&&n.column>=0)||t||a||I)&&!(n&&"line"in n&&"column"in n&&t&&"line"in t&&"column"in t&&n.line>0&&n.column>=0&&t.line>0&&t.column>=0&&a)){if(C="Invalid mapping: "+JSON.stringify({generated:n,source:a,original:t,name:I}),this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(C),!1;throw new Error(C)}},o.prototype._serializeMappings=function(){for(var n,t,a,I,C=0,h=1,c=0,d=0,e=0,i=0,p="",g=this._mappings.toArray(),m=0,f=g.length;m<f;m++){if(n="",(t=g[m]).generatedLine!==h)for(C=0;t.generatedLine!==h;)n+=";",h++;else if(m>0){if(!r.compareByGeneratedPositionsInflated(t,g[m-1]))continue;n+=","}n+=s.encode(t.generatedColumn-C),C=t.generatedColumn,t.source!=null&&(I=this._sources.indexOf(t.source),n+=s.encode(I-i),i=I,n+=s.encode(t.originalLine-1-d),d=t.originalLine-1,n+=s.encode(t.originalColumn-c),c=t.originalColumn,t.name!=null&&(a=this._names.indexOf(t.name),n+=s.encode(a-e),e=a)),p+=n}return p},o.prototype._generateSourcesContent=function(n,t){return n.map(function(a){if(!this._sourcesContents)return null;t!=null&&(a=r.relative(t,a));var I=r.toSetString(a);return Object.prototype.hasOwnProperty.call(this._sourcesContents,I)?this._sourcesContents[I]:null},this)},o.prototype.toJSON=function(){var n={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(n.file=this._file),this._sourceRoot!=null&&(n.sourceRoot=this._sourceRoot),this._sourcesContents&&(n.sourcesContent=this._generateSourcesContent(n.sources,n.sourceRoot)),n},o.prototype.toString=function(){return JSON.stringify(this.toJSON())},q.SourceMapGenerator=o,q}var fe,_={},be={};function Te(){return fe||(fe=1,function(s){function r(l,u,o,n,t,a){var I=Math.floor((u-l)/2)+l,C=t(o,n[I],!0);return C===0?I:C>0?u-I>1?r(I,u,o,n,t,a):a==s.LEAST_UPPER_BOUND?u<n.length?u:-1:I:I-l>1?r(l,I,o,n,t,a):a==s.LEAST_UPPER_BOUND?I:l<0?-1:l}s.GREATEST_LOWER_BOUND=1,s.LEAST_UPPER_BOUND=2,s.search=function(l,u,o,n){if(u.length===0)return-1;var t=r(-1,u.length,l,u,o,n||s.GREATEST_LOWER_BOUND);if(t<0)return-1;for(;t-1>=0&&o(u[t],u[t-1],!0)===0;)--t;return t}}(be)),be}var ye,ve,te={};function xe(){if(ye)return te;function s(l){function u(o,n,t){var a=o[n];o[n]=o[t],o[t]=a}return function o(n,t,a,I){if(a<I){var C=a-1;u(n,(e=a,i=I,Math.round(e+Math.random()*(i-e))),I);for(var h=n[I],c=a;c<I;c++)t(n[c],h,!1)<=0&&u(n,C+=1,c);u(n,C+1,c);var d=C+1;o(n,t,a,d-1),o(n,t,d+1,I)}var e,i}}ye=1;let r=new WeakMap;return te.quickSort=function(l,u,o=0){let n=r.get(u);n===void 0&&(n=function(t){let a=s.toString();return new Function(`return ${a}`)()(t)}(u),r.set(u,n)),n(l,u,o,l.length-1)},te}var Ge,Ze,ie={},He=(Ze||(Ze=1,F.SourceMapGenerator=Ae().SourceMapGenerator,F.SourceMapConsumer=function(){if(ve)return _;ve=1;var s=J(),r=Te(),l=Re().ArraySet,u=Ve(),o=xe().quickSort;function n(c,d){var e=c;return typeof c=="string"&&(e=s.parseSourceMapInput(c)),e.sections!=null?new h(e,d):new t(e,d)}function t(c,d){var e=c;typeof c=="string"&&(e=s.parseSourceMapInput(c));var i=s.getArg(e,"version"),p=s.getArg(e,"sources"),g=s.getArg(e,"names",[]),m=s.getArg(e,"sourceRoot",null),f=s.getArg(e,"sourcesContent",null),y=s.getArg(e,"mappings"),G=s.getArg(e,"file",null);if(i!=this._version)throw new Error("Unsupported version: "+i);m&&(m=s.normalize(m)),p=p.map(String).map(s.normalize).map(function(v){return m&&s.isAbsolute(m)&&s.isAbsolute(v)?s.relative(m,v):v}),this._names=l.fromArray(g.map(String),!0),this._sources=l.fromArray(p,!0),this._absoluteSources=this._sources.toArray().map(function(v){return s.computeSourceURL(m,v,d)}),this.sourceRoot=m,this.sourcesContent=f,this._mappings=y,this._sourceMapURL=d,this.file=G}function a(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}n.fromSourceMap=function(c,d){return t.fromSourceMap(c,d)},n.prototype._version=3,n.prototype.__generatedMappings=null,Object.defineProperty(n.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),n.prototype.__originalMappings=null,Object.defineProperty(n.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),n.prototype._charIsMappingSeparator=function(c,d){var e=c.charAt(d);return e===";"||e===","},n.prototype._parseMappings=function(c,d){throw new Error("Subclasses must implement _parseMappings")},n.GENERATED_ORDER=1,n.ORIGINAL_ORDER=2,n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.prototype.eachMapping=function(c,d,e){var i,p=d||null;switch(e||n.GENERATED_ORDER){case n.GENERATED_ORDER:i=this._generatedMappings;break;case n.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var g=this.sourceRoot,m=c.bind(p),f=this._names,y=this._sources,G=this._sourceMapURL,v=0,B=i.length;v<B;v++){var W=i[v],S=W.source===null?null:y.at(W.source);S!==null&&(S=s.computeSourceURL(g,S,G)),m({source:S,generatedLine:W.generatedLine,generatedColumn:W.generatedColumn,originalLine:W.originalLine,originalColumn:W.originalColumn,name:W.name===null?null:f.at(W.name)})}},n.prototype.allGeneratedPositionsFor=function(c){var d=s.getArg(c,"line"),e={source:s.getArg(c,"source"),originalLine:d,originalColumn:s.getArg(c,"column",0)};if(e.source=this._findSourceIndex(e.source),e.source<0)return[];var i=[],p=this._findMapping(e,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,r.LEAST_UPPER_BOUND);if(p>=0){var g=this._originalMappings[p];if(c.column===void 0)for(var m=g.originalLine;g&&g.originalLine===m;)i.push({line:s.getArg(g,"generatedLine",null),column:s.getArg(g,"generatedColumn",null),lastColumn:s.getArg(g,"lastGeneratedColumn",null)}),g=this._originalMappings[++p];else for(var f=g.originalColumn;g&&g.originalLine===d&&g.originalColumn==f;)i.push({line:s.getArg(g,"generatedLine",null),column:s.getArg(g,"generatedColumn",null),lastColumn:s.getArg(g,"lastGeneratedColumn",null)}),g=this._originalMappings[++p]}return i},_.SourceMapConsumer=n,t.prototype=Object.create(n.prototype),t.prototype.consumer=n,t.prototype._findSourceIndex=function(c){var d,e=c;if(this.sourceRoot!=null&&(e=s.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);for(d=0;d<this._absoluteSources.length;++d)if(this._absoluteSources[d]==c)return d;return-1},t.fromSourceMap=function(c,d){var e=Object.create(t.prototype),i=e._names=l.fromArray(c._names.toArray(),!0),p=e._sources=l.fromArray(c._sources.toArray(),!0);e.sourceRoot=c._sourceRoot,e.sourcesContent=c._generateSourcesContent(e._sources.toArray(),e.sourceRoot),e.file=c._file,e._sourceMapURL=d,e._absoluteSources=e._sources.toArray().map(function(W){return s.computeSourceURL(e.sourceRoot,W,d)});for(var g=c._mappings.toArray().slice(),m=e.__generatedMappings=[],f=e.__originalMappings=[],y=0,G=g.length;y<G;y++){var v=g[y],B=new a;B.generatedLine=v.generatedLine,B.generatedColumn=v.generatedColumn,v.source&&(B.source=p.indexOf(v.source),B.originalLine=v.originalLine,B.originalColumn=v.originalColumn,v.name&&(B.name=i.indexOf(v.name)),f.push(B)),m.push(B)}return o(e.__originalMappings,s.compareByOriginalPositions),e},t.prototype._version=3,Object.defineProperty(t.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});const I=s.compareByGeneratedPositionsDeflatedNoLine;function C(c,d){let e=c.length,i=c.length-d;if(!(i<=1))if(i==2){let p=c[d],g=c[d+1];I(p,g)>0&&(c[d]=g,c[d+1]=p)}else if(i<20)for(let p=d;p<e;p++)for(let g=p;g>d;g--){let m=c[g-1],f=c[g];if(I(m,f)<=0)break;c[g-1]=f,c[g]=m}else o(c,I,d)}function h(c,d){var e=c;typeof c=="string"&&(e=s.parseSourceMapInput(c));var i=s.getArg(e,"version"),p=s.getArg(e,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new l,this._names=new l;var g={line:-1,column:0};this._sections=p.map(function(m){if(m.url)throw new Error("Support for url field in sections not implemented.");var f=s.getArg(m,"offset"),y=s.getArg(f,"line"),G=s.getArg(f,"column");if(y<g.line||y===g.line&&G<g.column)throw new Error("Section offsets must be ordered and non-overlapping.");return g=f,{generatedOffset:{generatedLine:y+1,generatedColumn:G+1},consumer:new n(s.getArg(m,"map"),d)}})}return t.prototype._parseMappings=function(c,d){var e,i,p,g,m=1,f=0,y=0,G=0,v=0,B=0,W=c.length,S=0,$={},w=[],H=[];let P=0;for(;S<W;)if(c.charAt(S)===";")m++,S++,f=0,C(H,P),P=H.length;else if(c.charAt(S)===",")S++;else{for((e=new a).generatedLine=m,p=S;p<W&&!this._charIsMappingSeparator(c,p);p++);for(c.slice(S,p),i=[];S<p;)u.decode(c,S,$),g=$.value,S=$.rest,i.push(g);if(i.length===2)throw new Error("Found a source, but no line and column");if(i.length===3)throw new Error("Found a source and line, but no column");if(e.generatedColumn=f+i[0],f=e.generatedColumn,i.length>1&&(e.source=v+i[1],v+=i[1],e.originalLine=y+i[2],y=e.originalLine,e.originalLine+=1,e.originalColumn=G+i[3],G=e.originalColumn,i.length>4&&(e.name=B+i[4],B+=i[4])),H.push(e),typeof e.originalLine=="number"){let E=e.source;for(;w.length<=E;)w.push(null);w[E]===null&&(w[E]=[]),w[E].push(e)}}C(H,P),this.__generatedMappings=H;for(var U=0;U<w.length;U++)w[U]!=null&&o(w[U],s.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...w)},t.prototype._findMapping=function(c,d,e,i,p,g){if(c[e]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+c[e]);if(c[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+c[i]);return r.search(c,d,p,g)},t.prototype.computeColumnSpans=function(){for(var c=0;c<this._generatedMappings.length;++c){var d=this._generatedMappings[c];if(c+1<this._generatedMappings.length){var e=this._generatedMappings[c+1];if(d.generatedLine===e.generatedLine){d.lastGeneratedColumn=e.generatedColumn-1;continue}}d.lastGeneratedColumn=1/0}},t.prototype.originalPositionFor=function(c){var d={generatedLine:s.getArg(c,"line"),generatedColumn:s.getArg(c,"column")},e=this._findMapping(d,this._generatedMappings,"generatedLine","generatedColumn",s.compareByGeneratedPositionsDeflated,s.getArg(c,"bias",n.GREATEST_LOWER_BOUND));if(e>=0){var i=this._generatedMappings[e];if(i.generatedLine===d.generatedLine){var p=s.getArg(i,"source",null);p!==null&&(p=this._sources.at(p),p=s.computeSourceURL(this.sourceRoot,p,this._sourceMapURL));var g=s.getArg(i,"name",null);return g!==null&&(g=this._names.at(g)),{source:p,line:s.getArg(i,"originalLine",null),column:s.getArg(i,"originalColumn",null),name:g}}}return{source:null,line:null,column:null,name:null}},t.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(c){return c==null})},t.prototype.sourceContentFor=function(c,d){if(!this.sourcesContent)return null;var e=this._findSourceIndex(c);if(e>=0)return this.sourcesContent[e];var i,p=c;if(this.sourceRoot!=null&&(p=s.relative(this.sourceRoot,p)),this.sourceRoot!=null&&(i=s.urlParse(this.sourceRoot))){var g=p.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(g))return this.sourcesContent[this._sources.indexOf(g)];if((!i.path||i.path=="/")&&this._sources.has("/"+p))return this.sourcesContent[this._sources.indexOf("/"+p)]}if(d)return null;throw new Error('"'+p+'" is not in the SourceMap.')},t.prototype.generatedPositionFor=function(c){var d=s.getArg(c,"source");if((d=this._findSourceIndex(d))<0)return{line:null,column:null,lastColumn:null};var e={source:d,originalLine:s.getArg(c,"line"),originalColumn:s.getArg(c,"column")},i=this._findMapping(e,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(c,"bias",n.GREATEST_LOWER_BOUND));if(i>=0){var p=this._originalMappings[i];if(p.source===e.source)return{line:s.getArg(p,"generatedLine",null),column:s.getArg(p,"generatedColumn",null),lastColumn:s.getArg(p,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},_.BasicSourceMapConsumer=t,h.prototype=Object.create(n.prototype),h.prototype.constructor=n,h.prototype._version=3,Object.defineProperty(h.prototype,"sources",{get:function(){for(var c=[],d=0;d<this._sections.length;d++)for(var e=0;e<this._sections[d].consumer.sources.length;e++)c.push(this._sections[d].consumer.sources[e]);return c}}),h.prototype.originalPositionFor=function(c){var d={generatedLine:s.getArg(c,"line"),generatedColumn:s.getArg(c,"column")},e=r.search(d,this._sections,function(p,g){return p.generatedLine-g.generatedOffset.generatedLine||p.generatedColumn-g.generatedOffset.generatedColumn}),i=this._sections[e];return i?i.consumer.originalPositionFor({line:d.generatedLine-(i.generatedOffset.generatedLine-1),column:d.generatedColumn-(i.generatedOffset.generatedLine===d.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:c.bias}):{source:null,line:null,column:null,name:null}},h.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(c){return c.consumer.hasContentsOfAllSources()})},h.prototype.sourceContentFor=function(c,d){for(var e=0;e<this._sections.length;e++){var i=this._sections[e].consumer.sourceContentFor(c,!0);if(i||i==="")return i}if(d)return null;throw new Error('"'+c+'" is not in the SourceMap.')},h.prototype.generatedPositionFor=function(c){for(var d=0;d<this._sections.length;d++){var e=this._sections[d];if(e.consumer._findSourceIndex(s.getArg(c,"source"))!==-1){var i=e.consumer.generatedPositionFor(c);if(i)return{line:i.line+(e.generatedOffset.generatedLine-1),column:i.column+(e.generatedOffset.generatedLine===i.line?e.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},h.prototype._parseMappings=function(c,d){this.__generatedMappings=[],this.__originalMappings=[];for(var e=0;e<this._sections.length;e++)for(var i=this._sections[e],p=i.consumer._generatedMappings,g=0;g<p.length;g++){var m=p[g],f=i.consumer._sources.at(m.source);f!==null&&(f=s.computeSourceURL(i.consumer.sourceRoot,f,this._sourceMapURL)),this._sources.add(f),f=this._sources.indexOf(f);var y=null;m.name&&(y=i.consumer._names.at(m.name),this._names.add(y),y=this._names.indexOf(y));var G={source:f,generatedLine:m.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:m.generatedColumn+(i.generatedOffset.generatedLine===m.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:m.originalLine,originalColumn:m.originalColumn,name:y};this.__generatedMappings.push(G),typeof G.originalLine=="number"&&this.__originalMappings.push(G)}o(this.__generatedMappings,s.compareByGeneratedPositionsDeflated),o(this.__originalMappings,s.compareByOriginalPositions)},_.IndexedSourceMapConsumer=h,_}().SourceMapConsumer,F.SourceNode=function(){if(Ge)return ie;Ge=1;var s=Ae().SourceMapGenerator,r=J(),l=/(\r?\n)/,u="$$$isSourceNode$$$";function o(n,t,a,I,C){this.children=[],this.sourceContents={},this.line=n??null,this.column=t??null,this.source=a??null,this.name=C??null,this[u]=!0,I!=null&&this.add(I)}return o.fromStringWithSourceMap=function(n,t,a){var I=new o,C=n.split(l),h=0,c=function(){return g()+(g()||"");function g(){return h<C.length?C[h++]:void 0}},d=1,e=0,i=null;return t.eachMapping(function(g){if(i!==null){if(!(d<g.generatedLine)){var m=(f=C[h]||"").substr(0,g.generatedColumn-e);return C[h]=f.substr(g.generatedColumn-e),e=g.generatedColumn,p(i,m),void(i=g)}p(i,c()),d++,e=0}for(;d<g.generatedLine;)I.add(c()),d++;if(e<g.generatedColumn){var f=C[h]||"";I.add(f.substr(0,g.generatedColumn)),C[h]=f.substr(g.generatedColumn),e=g.generatedColumn}i=g},this),h<C.length&&(i&&p(i,c()),I.add(C.splice(h).join(""))),t.sources.forEach(function(g){var m=t.sourceContentFor(g);m!=null&&(a!=null&&(g=r.join(a,g)),I.setSourceContent(g,m))}),I;function p(g,m){if(g===null||g.source===void 0)I.add(m);else{var f=a?r.join(a,g.source):g.source;I.add(new o(g.originalLine,g.originalColumn,f,m,g.name))}}},o.prototype.add=function(n){if(Array.isArray(n))n.forEach(function(t){this.add(t)},this);else{if(!n[u]&&typeof n!="string")throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);n&&this.children.push(n)}return this},o.prototype.prepend=function(n){if(Array.isArray(n))for(var t=n.length-1;t>=0;t--)this.prepend(n[t]);else{if(!n[u]&&typeof n!="string")throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);this.children.unshift(n)}return this},o.prototype.walk=function(n){for(var t,a=0,I=this.children.length;a<I;a++)(t=this.children[a])[u]?t.walk(n):t!==""&&n(t,{source:this.source,line:this.line,column:this.column,name:this.name})},o.prototype.join=function(n){var t,a,I=this.children.length;if(I>0){for(t=[],a=0;a<I-1;a++)t.push(this.children[a]),t.push(n);t.push(this.children[a]),this.children=t}return this},o.prototype.replaceRight=function(n,t){var a=this.children[this.children.length-1];return a[u]?a.replaceRight(n,t):typeof a=="string"?this.children[this.children.length-1]=a.replace(n,t):this.children.push("".replace(n,t)),this},o.prototype.setSourceContent=function(n,t){this.sourceContents[r.toSetString(n)]=t},o.prototype.walkSourceContents=function(n){for(var t=0,a=this.children.length;t<a;t++)this.children[t][u]&&this.children[t].walkSourceContents(n);var I=Object.keys(this.sourceContents);for(t=0,a=I.length;t<a;t++)n(r.fromSetString(I[t]),this.sourceContents[I[t]])},o.prototype.toString=function(){var n="";return this.walk(function(t){n+=t}),n},o.prototype.toStringWithSourceMap=function(n){var t={code:"",line:1,column:0},a=new s(n),I=!1,C=null,h=null,c=null,d=null;return this.walk(function(e,i){t.code+=e,i.source!==null&&i.line!==null&&i.column!==null?(C===i.source&&h===i.line&&c===i.column&&d===i.name||a.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name}),C=i.source,h=i.line,c=i.column,d=i.name,I=!0):I&&(a.addMapping({generated:{line:t.line,column:t.column}}),C=null,I=!1);for(var p=0,g=e.length;p<g;p++)e.charCodeAt(p)===10?(t.line++,t.column=0,p+1===g?(C=null,I=!1):I&&a.addMapping({source:i.source,original:{line:i.line,column:i.column},generated:{line:t.line,column:t.column},name:i.name})):t.column++}),this.walkSourceContents(function(e,i){a.setSourceContent(e,i)}),{code:t.code,map:a}},ie.SourceNode=o,ie}().SourceNode),F);class X{constructor({file:r,line:l,function:u,code:o,locals:n={},offender:t=!1,column:a}){b(this,"file");b(this,"line");b(this,"function");b(this,"code");b(this,"locals");b(this,"offender");b(this,"column");this.file=r,this.line=l,this.function=u,this.code=o,this.locals=n,this.offender=t,this.column=a}toDict(){const r={file:this.file,line:this.line,function:this.function,code:this.code,locals:Object.fromEntries(Object.entries(this.locals).map(([l,u])=>[l,String(u)]))};return this.offender&&(r.offender=this.offender),this.column!==void 0&&(r.column=this.column),r}toJson(){return JSON.stringify(this.toDict())}}class O{static encode(r){return r instanceof X?r.toDict():Array.isArray(r)?r.map(l=>O.encode(l)):typeof r=="object"&&r!==null?JSON.stringify(r):r}static stringify(r){return JSON.stringify(O.encode(r),(l,u)=>u instanceof X?u.toDict():u)}}let Y=0;function ze(s){A().sfDebug&&console.log("Initializing Exception Interceptor...");const r=new Xe.Worker(new URL("data:application/javascript;base64,aW1wb3J0IHsgU2Vzc2lvbiB9IGZyb20gImluc3BlY3Rvci9wcm9taXNlcyI7CmltcG9ydCB7IHBhcmVudFBvcnQsIHdvcmtlckRhdGEgfSBmcm9tICJ3b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AgY29uc3Qgc2NyaXB0SWQgPSBsb2NhdGlvbi5zY3JpcHRJZDsKICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgIGNvbnN0IHsgc2NyaXB0U291cmNlIH0gPSBhd2FpdCBzZXNzaW9uLnBvc3QoCiAgICAgICAgICAgICAgIkRlYnVnZ2VyLmdldFNjcmlwdFNvdXJjZSIsCiAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgc2NyaXB0SWQsCiAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgKTsKICAgICAgICAgICAgY29uc3Qgc291cmNlTGluZXMgPSBzY3JpcHRTb3VyY2Uuc3BsaXQoIlxuIik7CiAgICAgICAgICAgIGNvZGUgPSBzb3VyY2VMaW5lc1tsb2NhdGlvbi5saW5lTnVtYmVyXSB8fCAiPG5vdCBjYXB0dXJlZD4iOwogICAgICAgICAgfSBjYXRjaCAoZXJyKSB7CiAgICAgICAgICAgIGlmIChnbG9iYWwuc2ZEZWJ1ZykgewogICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoIltXb3JrZXJdIEZhaWxlZCB0byBmZXRjaCBzY3JpcHQgc291cmNlOiIsIGVycik7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIC8vIEZldGNoIGxvY2FsIHZhcmlhYmxlcyBpZiB0aGVyZSdzIGFuIG9iamVjdElkCiAgICAgICAgY29uc3QgbG9jYWxzID0gbG9jYWxTY29wZT8ub2JqZWN0Py5vYmplY3RJZAogICAgICAgICAgPyBhd2FpdCBmZXRjaExvY2FsVmFyaWFibGVzKHNlc3Npb24sIGxvY2FsU2NvcGUub2JqZWN0Lm9iamVjdElkKQogICAgICAgICAgOiB7fTsKCiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgIGZ1bmN0aW9uOiBmdW5jdGlvbk5hbWUgfHwgIjxhbm9ueW1vdXM+IiwKICAgICAgICAgIGxvY2FscywKICAgICAgICAgIGZpbGUsCiAgICAgICAgICBsaW5lOiB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kRlYnVnKSB7CiAgICAgIGNvbnNvbGUuZXJyb3IoIltXb3JrZXJdIEZhaWxlZCB0byBmZXRjaCBsb2NhbCB2YXJpYWJsZXM6IiwgZXJyKTsKICAgIH0KICAgIHJldHVybiB7fTsKICB9Cn0KCnN0YXJ0RGVidWdnZXIoKS5jYXRjaCgoZXJyb3IpID0+IHsKICBpZiAoZ2xvYmFsLnNmRGVidWcpIHsKICAgIGNvbnNvbGUuZXJyb3IoIltXb3JrZXJdIEZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlcjoiLCBlcnJvcik7CiAgfQp9KTsKCi8vIEtlZXAgdGhlIHdvcmtlciBhbGl2ZQpzZXRJbnRlcnZhbCgoKSA9PiB7fSwgMTAwMDApOwo="),{workerData:{captureAllExceptions:!0}});let l=null;r.on("message",t=>{if(typeof t=="string"&&A().sfDebug&&console.log(`[Worker] ${t}`),t.readyToGetParameters&&r.postMessage({sfDebug:A().sfDebug,stackDepthLocals:A().stackDepthLocals,nodeModulesToCollectLocalVariablesOn:A().nodeModulesToCollectLocalVariablesOn}),t.type==="exception"){const{frames:a}=t,I=l;if(!I)return;const C=function(c){return c?c.split(`
|
|
32
|
-
`).slice(1).map(
|
|
33
|
-
`)[1]?.trim()}`;
|
|
34
|
-
`).slice(
|
|
35
|
-
`),name:
|
|
33
|
+
`}}var Ce,me,z={},ne={},k={},$={};function je(){if(Ce)return $;Ce=1;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return $.encode=function(r){if(0<=r&&r<i.length)return i[r];throw new TypeError("Must be between 0 and 63: "+r)},$.decode=function(r){return 65<=r&&r<=90?r-65:97<=r&&r<=122?r-97+26:48<=r&&r<=57?r-48+52:r==43?62:r==47?63:-1},$}function Xe(){if(me)return k;me=1;var i=je();return k.encode=function(r){var s,g="",a=(function(t){return t<0?1+(-t<<1):0+(t<<1)})(r);do s=31&a,(a>>>=5)>0&&(s|=32),g+=i.encode(s);while(a>0);return g},k.decode=function(r,s,g){var a,t,o,c,I=r.length,p=0,C=0;do{if(s>=I)throw new Error("Expected more digits in base 64 VLQ value.");if((t=i.decode(r.charCodeAt(s++)))===-1)throw new Error("Invalid base64 digit: "+r.charAt(s-1));a=!!(32&t),p+=(t&=31)<<C,C+=5}while(a);g.value=(c=(o=p)>>1,1&~o?c:-c),g.rest=s},k}var Ae,fe={};function T(){return Ae||(Ae=1,(function(i){i.getArg=function(e,n,h){if(n in e)return e[n];if(arguments.length===3)return h;throw new Error('"'+n+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,s=/^data:.+\,.+$/;function g(e){var n=e.match(r);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function a(e){var n="";return e.scheme&&(n+=e.scheme+":"),n+="//",e.auth&&(n+=e.auth+"@"),e.host&&(n+=e.host),e.port&&(n+=":"+e.port),e.path&&(n+=e.path),n}i.urlParse=g,i.urlGenerate=a;var t,o,c=(t=function(e){var n=e,h=g(e);if(h){if(!h.path)return e;n=h.path}for(var u=i.isAbsolute(n),m=[],f=0,b=0;;){if(f=b,(b=n.indexOf("/",f))===-1){m.push(n.slice(f));break}for(m.push(n.slice(f,b));b<n.length&&n[b]==="/";)b++}var v,S=0;for(b=m.length-1;b>=0;b--)(v=m[b])==="."?m.splice(b,1):v===".."?S++:S>0&&(v===""?(m.splice(b+1,S),S=0):(m.splice(b,2),S--));return(n=m.join("/"))===""&&(n=u?"/":"."),h?(h.path=n,a(h)):n},o=[],function(e){for(var n=0;n<o.length;n++)if(o[n].input===e){var h=o[0];return o[0]=o[n],o[n]=h,o[0].result}var u=t(e);return o.unshift({input:e,result:u}),o.length>32&&o.pop(),u});function I(e,n){e===""&&(e="."),n===""&&(n=".");var h=g(n),u=g(e);if(u&&(e=u.path||"/"),h&&!h.scheme)return u&&(h.scheme=u.scheme),a(h);if(h||n.match(s))return n;if(u&&!u.host&&!u.path)return u.host=n,a(u);var m=n.charAt(0)==="/"?n:c(e.replace(/\/+$/,"")+"/"+n);return u?(u.path=m,a(u)):m}i.normalize=c,i.join=I,i.isAbsolute=function(e){return e.charAt(0)==="/"||r.test(e)},i.relative=function(e,n){e===""&&(e="."),e=e.replace(/\/$/,"");for(var h=0;n.indexOf(e+"/")!==0;){var u=e.lastIndexOf("/");if(u<0||(e=e.slice(0,u)).match(/^([^\/]+:\/)?\/*$/))return n;++h}return Array(h+1).join("../")+n.substr(e.length+1)};var p=!("__proto__"in Object.create(null));function C(e){return e}function l(e){if(!e)return!1;var n=e.length;if(n<9||e.charCodeAt(n-1)!==95||e.charCodeAt(n-2)!==95||e.charCodeAt(n-3)!==111||e.charCodeAt(n-4)!==116||e.charCodeAt(n-5)!==111||e.charCodeAt(n-6)!==114||e.charCodeAt(n-7)!==112||e.charCodeAt(n-8)!==95||e.charCodeAt(n-9)!==95)return!1;for(var h=n-10;h>=0;h--)if(e.charCodeAt(h)!==36)return!1;return!0}function d(e,n){return e===n?0:e===null?1:n===null?-1:e>n?1:-1}i.toSetString=p?C:function(e){return l(e)?"$"+e:e},i.fromSetString=p?C:function(e){return l(e)?e.slice(1):e},i.compareByOriginalPositions=function(e,n,h){var u=d(e.source,n.source);return u!==0||(u=e.originalLine-n.originalLine)!==0||(u=e.originalColumn-n.originalColumn)!==0||h||(u=e.generatedColumn-n.generatedColumn)!==0||(u=e.generatedLine-n.generatedLine)!==0?u:d(e.name,n.name)},i.compareByOriginalPositionsNoSource=function(e,n,h){var u;return(u=e.originalLine-n.originalLine)!==0||(u=e.originalColumn-n.originalColumn)!==0||h||(u=e.generatedColumn-n.generatedColumn)!==0||(u=e.generatedLine-n.generatedLine)!==0?u:d(e.name,n.name)},i.compareByGeneratedPositionsDeflated=function(e,n,h){var u=e.generatedLine-n.generatedLine;return u!==0||(u=e.generatedColumn-n.generatedColumn)!==0||h||(u=d(e.source,n.source))!==0||(u=e.originalLine-n.originalLine)!==0||(u=e.originalColumn-n.originalColumn)!==0?u:d(e.name,n.name)},i.compareByGeneratedPositionsDeflatedNoLine=function(e,n,h){var u=e.generatedColumn-n.generatedColumn;return u!==0||h||(u=d(e.source,n.source))!==0||(u=e.originalLine-n.originalLine)!==0||(u=e.originalColumn-n.originalColumn)!==0?u:d(e.name,n.name)},i.compareByGeneratedPositionsInflated=function(e,n){var h=e.generatedLine-n.generatedLine;return h!==0||(h=e.generatedColumn-n.generatedColumn)!==0||(h=d(e.source,n.source))!==0||(h=e.originalLine-n.originalLine)!==0||(h=e.originalColumn-n.originalColumn)!==0?h:d(e.name,n.name)},i.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},i.computeSourceURL=function(e,n,h){if(n=n||"",e&&(e[e.length-1]!=="/"&&n[0]!=="/"&&(e+="/"),n=e+n),h){var u=g(h);if(!u)throw new Error("sourceMapURL could not be parsed");if(u.path){var m=u.path.lastIndexOf("/");m>=0&&(u.path=u.path.substring(0,m+1))}n=I(a(u),n)}return c(n)}})(fe)),fe}var be,re={};function Je(){if(be)return re;be=1;var i=T(),r=Object.prototype.hasOwnProperty,s=typeof Map<"u";function g(){this._array=[],this._set=s?new Map:Object.create(null)}return g.fromArray=function(a,t){for(var o=new g,c=0,I=a.length;c<I;c++)o.add(a[c],t);return o},g.prototype.size=function(){return s?this._set.size:Object.getOwnPropertyNames(this._set).length},g.prototype.add=function(a,t){var o=s?a:i.toSetString(a),c=s?this.has(a):r.call(this._set,o),I=this._array.length;c&&!t||this._array.push(a),c||(s?this._set.set(a,I):this._set[o]=I)},g.prototype.has=function(a){if(s)return this._set.has(a);var t=i.toSetString(a);return r.call(this._set,t)},g.prototype.indexOf=function(a){if(s){var t=this._set.get(a);if(t>=0)return t}else{var o=i.toSetString(a);if(r.call(this._set,o))return this._set[o]}throw new Error('"'+a+'" is not in the set.')},g.prototype.at=function(a){if(a>=0&&a<this._array.length)return this._array[a];throw new Error("No element indexed by "+a)},g.prototype.toArray=function(){return this._array.slice()},re.ArraySet=g,re}var ye,ve,oe={};function Qe(){if(ye)return oe;ye=1;var i=T();function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return r.prototype.unsortedForEach=function(s,g){this._array.forEach(s,g)},r.prototype.add=function(s){var g,a,t,o,c,I;g=this._last,a=s,t=g.generatedLine,o=a.generatedLine,c=g.generatedColumn,I=a.generatedColumn,o>t||o==t&&I>=c||i.compareByGeneratedPositionsInflated(g,a)<=0?(this._last=s,this._array.push(s)):(this._sorted=!1,this._array.push(s))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},oe.MappingList=r,oe}function Se(){if(ve)return ne;ve=1;var i=Xe(),r=T(),s=Je().ArraySet,g=Qe().MappingList;function a(t){t||(t={}),this._file=r.getArg(t,"file",null),this._sourceRoot=r.getArg(t,"sourceRoot",null),this._skipValidation=r.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=r.getArg(t,"ignoreInvalidMapping",!1),this._sources=new s,this._names=new s,this._mappings=new g,this._sourcesContents=null}return a.prototype._version=3,a.fromSourceMap=function(t,o){var c=t.sourceRoot,I=new a(Object.assign(o||{},{file:t.file,sourceRoot:c}));return t.eachMapping(function(p){var C={generated:{line:p.generatedLine,column:p.generatedColumn}};p.source!=null&&(C.source=p.source,c!=null&&(C.source=r.relative(c,C.source)),C.original={line:p.originalLine,column:p.originalColumn},p.name!=null&&(C.name=p.name)),I.addMapping(C)}),t.sources.forEach(function(p){var C=p;c!==null&&(C=r.relative(c,p)),I._sources.has(C)||I._sources.add(C);var l=t.sourceContentFor(p);l!=null&&I.setSourceContent(p,l)}),I},a.prototype.addMapping=function(t){var o=r.getArg(t,"generated"),c=r.getArg(t,"original",null),I=r.getArg(t,"source",null),p=r.getArg(t,"name",null);(this._skipValidation||this._validateMapping(o,c,I,p)!==!1)&&(I!=null&&(I=String(I),this._sources.has(I)||this._sources.add(I)),p!=null&&(p=String(p),this._names.has(p)||this._names.add(p)),this._mappings.add({generatedLine:o.line,generatedColumn:o.column,originalLine:c!=null&&c.line,originalColumn:c!=null&&c.column,source:I,name:p}))},a.prototype.setSourceContent=function(t,o){var c=t;this._sourceRoot!=null&&(c=r.relative(this._sourceRoot,c)),o!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[r.toSetString(c)]=o):this._sourcesContents&&(delete this._sourcesContents[r.toSetString(c)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},a.prototype.applySourceMap=function(t,o,c){var I=o;if(o==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);I=t.file}var p=this._sourceRoot;p!=null&&(I=r.relative(p,I));var C=new s,l=new s;this._mappings.unsortedForEach(function(d){if(d.source===I&&d.originalLine!=null){var e=t.originalPositionFor({line:d.originalLine,column:d.originalColumn});e.source!=null&&(d.source=e.source,c!=null&&(d.source=r.join(c,d.source)),p!=null&&(d.source=r.relative(p,d.source)),d.originalLine=e.line,d.originalColumn=e.column,e.name!=null&&(d.name=e.name))}var n=d.source;n==null||C.has(n)||C.add(n);var h=d.name;h==null||l.has(h)||l.add(h)},this),this._sources=C,this._names=l,t.sources.forEach(function(d){var e=t.sourceContentFor(d);e!=null&&(c!=null&&(d=r.join(c,d)),p!=null&&(d=r.relative(p,d)),this.setSourceContent(d,e))},this)},a.prototype._validateMapping=function(t,o,c,I){if(o&&typeof o.line!="number"&&typeof o.column!="number"){var p="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(p),!1;throw new Error(p)}if((!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0)||o||c||I)&&!(t&&"line"in t&&"column"in t&&o&&"line"in o&&"column"in o&&t.line>0&&t.column>=0&&o.line>0&&o.column>=0&&c)){if(p="Invalid mapping: "+JSON.stringify({generated:t,source:c,original:o,name:I}),this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(p),!1;throw new Error(p)}},a.prototype._serializeMappings=function(){for(var t,o,c,I,p=0,C=1,l=0,d=0,e=0,n=0,h="",u=this._mappings.toArray(),m=0,f=u.length;m<f;m++){if(t="",(o=u[m]).generatedLine!==C)for(p=0;o.generatedLine!==C;)t+=";",C++;else if(m>0){if(!r.compareByGeneratedPositionsInflated(o,u[m-1]))continue;t+=","}t+=i.encode(o.generatedColumn-p),p=o.generatedColumn,o.source!=null&&(I=this._sources.indexOf(o.source),t+=i.encode(I-n),n=I,t+=i.encode(o.originalLine-1-d),d=o.originalLine-1,t+=i.encode(o.originalColumn-l),l=o.originalColumn,o.name!=null&&(c=this._names.indexOf(o.name),t+=i.encode(c-e),e=c)),h+=t}return h},a.prototype._generateSourcesContent=function(t,o){return t.map(function(c){if(!this._sourcesContents)return null;o!=null&&(c=r.relative(o,c));var I=r.toSetString(c);return Object.prototype.hasOwnProperty.call(this._sourcesContents,I)?this._sourcesContents[I]:null},this)},a.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},ne.SourceMapGenerator=a,ne}var Ge,U={},Ze={};function qe(){return Ge||(Ge=1,(function(i){function r(s,g,a,t,o,c){var I=Math.floor((g-s)/2)+s,p=o(a,t[I],!0);return p===0?I:p>0?g-I>1?r(I,g,a,t,o,c):c==i.LEAST_UPPER_BOUND?g<t.length?g:-1:I:I-s>1?r(s,I,a,t,o,c):c==i.LEAST_UPPER_BOUND?I:s<0?-1:s}i.GREATEST_LOWER_BOUND=1,i.LEAST_UPPER_BOUND=2,i.search=function(s,g,a,t){if(g.length===0)return-1;var o=r(-1,g.length,s,g,a,t||i.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&a(g[o],g[o-1],!0)===0;)--o;return o}})(Ze)),Ze}var Be,We,ie={};function et(){if(Be)return ie;function i(s){function g(a,t,o){var c=a[t];a[t]=a[o],a[o]=c}return function a(t,o,c,I){if(c<I){var p=c-1;g(t,(e=c,n=I,Math.round(e+Math.random()*(n-e))),I);for(var C=t[I],l=c;l<I;l++)o(t[l],C,!1)<=0&&g(t,p+=1,l);g(t,p+1,l);var d=p+1;a(t,o,c,d-1),a(t,o,d+1,I)}var e,n}}Be=1;let r=new WeakMap;return ie.quickSort=function(s,g,a=0){let t=r.get(g);t===void 0&&(t=(function(o){let c=i.toString();return new Function(`return ${c}`)()(o)})(g),r.set(g,t)),t(s,g,a,s.length-1)},ie}var we,Ne,se={},Ee=(Ne||(Ne=1,z.SourceMapGenerator=Se().SourceMapGenerator,z.SourceMapConsumer=(function(){if(We)return U;We=1;var i=T(),r=qe(),s=Je().ArraySet,g=Xe(),a=et().quickSort;function t(l,d){var e=l;return typeof l=="string"&&(e=i.parseSourceMapInput(l)),e.sections!=null?new C(e,d):new o(e,d)}function o(l,d){var e=l;typeof l=="string"&&(e=i.parseSourceMapInput(l));var n=i.getArg(e,"version"),h=i.getArg(e,"sources"),u=i.getArg(e,"names",[]),m=i.getArg(e,"sourceRoot",null),f=i.getArg(e,"sourcesContent",null),b=i.getArg(e,"mappings"),v=i.getArg(e,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);m&&(m=i.normalize(m)),h=h.map(String).map(i.normalize).map(function(S){return m&&i.isAbsolute(m)&&i.isAbsolute(S)?i.relative(m,S):S}),this._names=s.fromArray(u.map(String),!0),this._sources=s.fromArray(h,!0),this._absoluteSources=this._sources.toArray().map(function(S){return i.computeSourceURL(m,S,d)}),this.sourceRoot=m,this.sourcesContent=f,this._mappings=b,this._sourceMapURL=d,this.file=v}function c(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}t.fromSourceMap=function(l,d){return o.fromSourceMap(l,d)},t.prototype._version=3,t.prototype.__generatedMappings=null,Object.defineProperty(t.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),t.prototype.__originalMappings=null,Object.defineProperty(t.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),t.prototype._charIsMappingSeparator=function(l,d){var e=l.charAt(d);return e===";"||e===","},t.prototype._parseMappings=function(l,d){throw new Error("Subclasses must implement _parseMappings")},t.GENERATED_ORDER=1,t.ORIGINAL_ORDER=2,t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.prototype.eachMapping=function(l,d,e){var n,h=d||null;switch(e||t.GENERATED_ORDER){case t.GENERATED_ORDER:n=this._generatedMappings;break;case t.ORIGINAL_ORDER:n=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var u=this.sourceRoot,m=l.bind(h),f=this._names,b=this._sources,v=this._sourceMapURL,S=0,B=n.length;S<B;S++){var W=n[S],Z=W.source===null?null:b.at(W.source);Z!==null&&(Z=i.computeSourceURL(u,Z,v)),m({source:Z,generatedLine:W.generatedLine,generatedColumn:W.generatedColumn,originalLine:W.originalLine,originalColumn:W.originalColumn,name:W.name===null?null:f.at(W.name)})}},t.prototype.allGeneratedPositionsFor=function(l){var d=i.getArg(l,"line"),e={source:i.getArg(l,"source"),originalLine:d,originalColumn:i.getArg(l,"column",0)};if(e.source=this._findSourceIndex(e.source),e.source<0)return[];var n=[],h=this._findMapping(e,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,r.LEAST_UPPER_BOUND);if(h>=0){var u=this._originalMappings[h];if(l.column===void 0)for(var m=u.originalLine;u&&u.originalLine===m;)n.push({line:i.getArg(u,"generatedLine",null),column:i.getArg(u,"generatedColumn",null),lastColumn:i.getArg(u,"lastGeneratedColumn",null)}),u=this._originalMappings[++h];else for(var f=u.originalColumn;u&&u.originalLine===d&&u.originalColumn==f;)n.push({line:i.getArg(u,"generatedLine",null),column:i.getArg(u,"generatedColumn",null),lastColumn:i.getArg(u,"lastGeneratedColumn",null)}),u=this._originalMappings[++h]}return n},U.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.prototype._findSourceIndex=function(l){var d,e=l;if(this.sourceRoot!=null&&(e=i.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);for(d=0;d<this._absoluteSources.length;++d)if(this._absoluteSources[d]==l)return d;return-1},o.fromSourceMap=function(l,d){var e=Object.create(o.prototype),n=e._names=s.fromArray(l._names.toArray(),!0),h=e._sources=s.fromArray(l._sources.toArray(),!0);e.sourceRoot=l._sourceRoot,e.sourcesContent=l._generateSourcesContent(e._sources.toArray(),e.sourceRoot),e.file=l._file,e._sourceMapURL=d,e._absoluteSources=e._sources.toArray().map(function(W){return i.computeSourceURL(e.sourceRoot,W,d)});for(var u=l._mappings.toArray().slice(),m=e.__generatedMappings=[],f=e.__originalMappings=[],b=0,v=u.length;b<v;b++){var S=u[b],B=new c;B.generatedLine=S.generatedLine,B.generatedColumn=S.generatedColumn,S.source&&(B.source=h.indexOf(S.source),B.originalLine=S.originalLine,B.originalColumn=S.originalColumn,S.name&&(B.name=n.indexOf(S.name)),f.push(B)),m.push(B)}return a(e.__originalMappings,i.compareByOriginalPositions),e},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});const I=i.compareByGeneratedPositionsDeflatedNoLine;function p(l,d){let e=l.length,n=l.length-d;if(!(n<=1))if(n==2){let h=l[d],u=l[d+1];I(h,u)>0&&(l[d]=u,l[d+1]=h)}else if(n<20)for(let h=d;h<e;h++)for(let u=h;u>d;u--){let m=l[u-1],f=l[u];if(I(m,f)<=0)break;l[u-1]=f,l[u]=m}else a(l,I,d)}function C(l,d){var e=l;typeof l=="string"&&(e=i.parseSourceMapInput(l));var n=i.getArg(e,"version"),h=i.getArg(e,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new s,this._names=new s;var u={line:-1,column:0};this._sections=h.map(function(m){if(m.url)throw new Error("Support for url field in sections not implemented.");var f=i.getArg(m,"offset"),b=i.getArg(f,"line"),v=i.getArg(f,"column");if(b<u.line||b===u.line&&v<u.column)throw new Error("Section offsets must be ordered and non-overlapping.");return u=f,{generatedOffset:{generatedLine:b+1,generatedColumn:v+1},consumer:new t(i.getArg(m,"map"),d)}})}return o.prototype._parseMappings=function(l,d){var e,n,h,u,m=1,f=0,b=0,v=0,S=0,B=0,W=l.length,Z=0,Q={},N=[],Y=[];let q=0;for(;Z<W;)if(l.charAt(Z)===";")m++,Z++,f=0,p(Y,q),q=Y.length;else if(l.charAt(Z)===",")Z++;else{for((e=new c).generatedLine=m,h=Z;h<W&&!this._charIsMappingSeparator(l,h);h++);for(l.slice(Z,h),n=[];Z<h;)g.decode(l,Z,Q),u=Q.value,Z=Q.rest,n.push(u);if(n.length===2)throw new Error("Found a source, but no line and column");if(n.length===3)throw new Error("Found a source and line, but no column");if(e.generatedColumn=f+n[0],f=e.generatedColumn,n.length>1&&(e.source=S+n[1],S+=n[1],e.originalLine=b+n[2],b=e.originalLine,e.originalLine+=1,e.originalColumn=v+n[3],v=e.originalColumn,n.length>4&&(e.name=B+n[4],B+=n[4])),Y.push(e),typeof e.originalLine=="number"){let x=e.source;for(;N.length<=x;)N.push(null);N[x]===null&&(N[x]=[]),N[x].push(e)}}p(Y,q),this.__generatedMappings=Y;for(var D=0;D<N.length;D++)N[D]!=null&&a(N[D],i.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...N)},o.prototype._findMapping=function(l,d,e,n,h,u){if(l[e]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+l[e]);if(l[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+l[n]);return r.search(l,d,h,u)},o.prototype.computeColumnSpans=function(){for(var l=0;l<this._generatedMappings.length;++l){var d=this._generatedMappings[l];if(l+1<this._generatedMappings.length){var e=this._generatedMappings[l+1];if(d.generatedLine===e.generatedLine){d.lastGeneratedColumn=e.generatedColumn-1;continue}}d.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(l){var d={generatedLine:i.getArg(l,"line"),generatedColumn:i.getArg(l,"column")},e=this._findMapping(d,this._generatedMappings,"generatedLine","generatedColumn",i.compareByGeneratedPositionsDeflated,i.getArg(l,"bias",t.GREATEST_LOWER_BOUND));if(e>=0){var n=this._generatedMappings[e];if(n.generatedLine===d.generatedLine){var h=i.getArg(n,"source",null);h!==null&&(h=this._sources.at(h),h=i.computeSourceURL(this.sourceRoot,h,this._sourceMapURL));var u=i.getArg(n,"name",null);return u!==null&&(u=this._names.at(u)),{source:h,line:i.getArg(n,"originalLine",null),column:i.getArg(n,"originalColumn",null),name:u}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(l){return l==null})},o.prototype.sourceContentFor=function(l,d){if(!this.sourcesContent)return null;var e=this._findSourceIndex(l);if(e>=0)return this.sourcesContent[e];var n,h=l;if(this.sourceRoot!=null&&(h=i.relative(this.sourceRoot,h)),this.sourceRoot!=null&&(n=i.urlParse(this.sourceRoot))){var u=h.replace(/^file:\/\//,"");if(n.scheme=="file"&&this._sources.has(u))return this.sourcesContent[this._sources.indexOf(u)];if((!n.path||n.path=="/")&&this._sources.has("/"+h))return this.sourcesContent[this._sources.indexOf("/"+h)]}if(d)return null;throw new Error('"'+h+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(l){var d=i.getArg(l,"source");if((d=this._findSourceIndex(d))<0)return{line:null,column:null,lastColumn:null};var e={source:d,originalLine:i.getArg(l,"line"),originalColumn:i.getArg(l,"column")},n=this._findMapping(e,this._originalMappings,"originalLine","originalColumn",i.compareByOriginalPositions,i.getArg(l,"bias",t.GREATEST_LOWER_BOUND));if(n>=0){var h=this._originalMappings[n];if(h.source===e.source)return{line:i.getArg(h,"generatedLine",null),column:i.getArg(h,"generatedColumn",null),lastColumn:i.getArg(h,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},U.BasicSourceMapConsumer=o,C.prototype=Object.create(t.prototype),C.prototype.constructor=t,C.prototype._version=3,Object.defineProperty(C.prototype,"sources",{get:function(){for(var l=[],d=0;d<this._sections.length;d++)for(var e=0;e<this._sections[d].consumer.sources.length;e++)l.push(this._sections[d].consumer.sources[e]);return l}}),C.prototype.originalPositionFor=function(l){var d={generatedLine:i.getArg(l,"line"),generatedColumn:i.getArg(l,"column")},e=r.search(d,this._sections,function(h,u){return h.generatedLine-u.generatedOffset.generatedLine||h.generatedColumn-u.generatedOffset.generatedColumn}),n=this._sections[e];return n?n.consumer.originalPositionFor({line:d.generatedLine-(n.generatedOffset.generatedLine-1),column:d.generatedColumn-(n.generatedOffset.generatedLine===d.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:l.bias}):{source:null,line:null,column:null,name:null}},C.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(l){return l.consumer.hasContentsOfAllSources()})},C.prototype.sourceContentFor=function(l,d){for(var e=0;e<this._sections.length;e++){var n=this._sections[e].consumer.sourceContentFor(l,!0);if(n||n==="")return n}if(d)return null;throw new Error('"'+l+'" is not in the SourceMap.')},C.prototype.generatedPositionFor=function(l){for(var d=0;d<this._sections.length;d++){var e=this._sections[d];if(e.consumer._findSourceIndex(i.getArg(l,"source"))!==-1){var n=e.consumer.generatedPositionFor(l);if(n)return{line:n.line+(e.generatedOffset.generatedLine-1),column:n.column+(e.generatedOffset.generatedLine===n.line?e.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},C.prototype._parseMappings=function(l,d){this.__generatedMappings=[],this.__originalMappings=[];for(var e=0;e<this._sections.length;e++)for(var n=this._sections[e],h=n.consumer._generatedMappings,u=0;u<h.length;u++){var m=h[u],f=n.consumer._sources.at(m.source);f!==null&&(f=i.computeSourceURL(n.consumer.sourceRoot,f,this._sourceMapURL)),this._sources.add(f),f=this._sources.indexOf(f);var b=null;m.name&&(b=n.consumer._names.at(m.name),this._names.add(b),b=this._names.indexOf(b));var v={source:f,generatedLine:m.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:m.generatedColumn+(n.generatedOffset.generatedLine===m.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:m.originalLine,originalColumn:m.originalColumn,name:b};this.__generatedMappings.push(v),typeof v.originalLine=="number"&&this.__originalMappings.push(v)}a(this.__generatedMappings,i.compareByGeneratedPositionsDeflated),a(this.__originalMappings,i.compareByOriginalPositions)},U.IndexedSourceMapConsumer=C,U})().SourceMapConsumer,z.SourceNode=(function(){if(we)return se;we=1;var i=Se().SourceMapGenerator,r=T(),s=/(\r?\n)/,g="$$$isSourceNode$$$";function a(t,o,c,I,p){this.children=[],this.sourceContents={},this.line=t??null,this.column=o??null,this.source=c??null,this.name=p??null,this[g]=!0,I!=null&&this.add(I)}return a.fromStringWithSourceMap=function(t,o,c){var I=new a,p=t.split(s),C=0,l=function(){return u()+(u()||"");function u(){return C<p.length?p[C++]:void 0}},d=1,e=0,n=null;return o.eachMapping(function(u){if(n!==null){if(!(d<u.generatedLine)){var m=(f=p[C]||"").substr(0,u.generatedColumn-e);return p[C]=f.substr(u.generatedColumn-e),e=u.generatedColumn,h(n,m),void(n=u)}h(n,l()),d++,e=0}for(;d<u.generatedLine;)I.add(l()),d++;if(e<u.generatedColumn){var f=p[C]||"";I.add(f.substr(0,u.generatedColumn)),p[C]=f.substr(u.generatedColumn),e=u.generatedColumn}n=u},this),C<p.length&&(n&&h(n,l()),I.add(p.splice(C).join(""))),o.sources.forEach(function(u){var m=o.sourceContentFor(u);m!=null&&(c!=null&&(u=r.join(c,u)),I.setSourceContent(u,m))}),I;function h(u,m){if(u===null||u.source===void 0)I.add(m);else{var f=c?r.join(c,u.source):u.source;I.add(new a(u.originalLine,u.originalColumn,f,m,u.name))}}},a.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(o){this.add(o)},this);else{if(!t[g]&&typeof t!="string")throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);t&&this.children.push(t)}return this},a.prototype.prepend=function(t){if(Array.isArray(t))for(var o=t.length-1;o>=0;o--)this.prepend(t[o]);else{if(!t[g]&&typeof t!="string")throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this},a.prototype.walk=function(t){for(var o,c=0,I=this.children.length;c<I;c++)(o=this.children[c])[g]?o.walk(t):o!==""&&t(o,{source:this.source,line:this.line,column:this.column,name:this.name})},a.prototype.join=function(t){var o,c,I=this.children.length;if(I>0){for(o=[],c=0;c<I-1;c++)o.push(this.children[c]),o.push(t);o.push(this.children[c]),this.children=o}return this},a.prototype.replaceRight=function(t,o){var c=this.children[this.children.length-1];return c[g]?c.replaceRight(t,o):typeof c=="string"?this.children[this.children.length-1]=c.replace(t,o):this.children.push("".replace(t,o)),this},a.prototype.setSourceContent=function(t,o){this.sourceContents[r.toSetString(t)]=o},a.prototype.walkSourceContents=function(t){for(var o=0,c=this.children.length;o<c;o++)this.children[o][g]&&this.children[o].walkSourceContents(t);var I=Object.keys(this.sourceContents);for(o=0,c=I.length;o<c;o++)t(r.fromSetString(I[o]),this.sourceContents[I[o]])},a.prototype.toString=function(){var t="";return this.walk(function(o){t+=o}),t},a.prototype.toStringWithSourceMap=function(t){var o={code:"",line:1,column:0},c=new i(t),I=!1,p=null,C=null,l=null,d=null;return this.walk(function(e,n){o.code+=e,n.source!==null&&n.line!==null&&n.column!==null?(p===n.source&&C===n.line&&l===n.column&&d===n.name||c.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:o.line,column:o.column},name:n.name}),p=n.source,C=n.line,l=n.column,d=n.name,I=!0):I&&(c.addMapping({generated:{line:o.line,column:o.column}}),p=null,I=!1);for(var h=0,u=e.length;h<u;h++)e.charCodeAt(h)===10?(o.line++,o.column=0,h+1===u?(p=null,I=!1):I&&c.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:o.line,column:o.column},name:n.name})):o.column++}),this.walkSourceContents(function(e,n){c.setSourceContent(e,n)}),{code:o.code,map:c}},se.SourceNode=a,se})().SourceNode),z);class F{constructor({file:r,line:s,function:g,code:a,locals:t={},offender:o=!1,column:c}){y(this,"file");y(this,"line");y(this,"function");y(this,"code");y(this,"locals");y(this,"offender");y(this,"column");this.file=r,this.line=s,this.function=g,this.code=a,this.locals=t,this.offender=o,this.column=c}toDict(){const r={file:this.file,line:this.line,function:this.function,code:this.code,locals:Object.fromEntries(Object.entries(this.locals).map(([s,g])=>[s,String(g)]))};return this.offender&&(r.offender=this.offender),this.column!==void 0&&(r.column=this.column),r}toJson(){return JSON.stringify(this.toDict())}}class j{static encode(r){return r instanceof F?r.toDict():Array.isArray(r)?r.map(s=>j.encode(s)):typeof r=="object"&&r!==null?JSON.stringify(r):r}static stringify(r){return JSON.stringify(j.encode(r),(s,g)=>g instanceof F?g.toDict():g)}}let X=0;function tt(i){A().sfDebug&&console.log("Initializing Exception Interceptor...");const r=new De.Worker(new URL("data:application/javascript;base64,aW1wb3J0IHsgU2Vzc2lvbiB9IGZyb20gImluc3BlY3Rvci9wcm9taXNlcyI7CmltcG9ydCB7IHBhcmVudFBvcnQsIHdvcmtlckRhdGEgfSBmcm9tICJ3b3JrZXJfdGhyZWFkcyI7CgpnbG9iYWwuc2ZEZWJ1ZyA9IHVuZGVmaW5lZDsKZ2xvYmFsLnN0YWNrRGVwdGhMb2NhbHMgPSB1bmRlZmluZWQ7Cmdsb2JhbC5ub2RlTW9kdWxlc1RvQ29sbGVjdExvY2FsVmFyaWFibGVzT24gPSB1bmRlZmluZWQ7CgovKioKICogUHJvY2Vzc2VzIGNhbGwgZnJhbWVzIGZyb20gYW4gZXhjZXB0aW9uIGFuZCBwb3N0cyB0aGVtIHZpYSB0aGUgV29ya2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Y29uc3Qgc291cmNlTGluZXMgPSBzY3JpcHRTb3VyY2Uuc3BsaXQoIlxuIik7CiAgICAgICAgICAgIGNvZGUgPSBzb3VyY2VMaW5lc1tsb2NhdGlvbi5saW5lTnVtYmVyXSB8fCAiPG5vdCBjYXB0dXJlZD4iOwogICAgICAgICAgfSBjYXRjaCAoZXJyKSB7CiAgICAgICAgICAgIGlmIChnbG9iYWwuc2ZEZWJ1ZykgewogICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoIltXb3JrZXJdIEZhaWxlZCB0byBmZXRjaCBzY3JpcHQgc291cmNlOiIsIGVycik7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIC8vIEZldGNoIGxvY2FsIHZhcmlhYmxlcyBpZiB0aGVyZSdzIGFuIG9iamVjdElkCiAgICAgICAgY29uc3QgbG9jYWxzID0gbG9jYWxTY29wZT8ub2JqZWN0Py5vYmplY3RJZAogICAgICAgICAgPyBhd2FpdCBmZXRjaExvY2FsVmFyaWFibGVzKHNlc3Npb24sIGxvY2FsU2NvcGUub2JqZWN0Lm9iamVjdElkKQogICAgICAgICAgOiB7fTsKCiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgIGZ1bmN0aW9uOiBmdW5jdGlvbk5hbWUgfHwgIjxhbm9ueW1vdXM+IiwKICAgICAgICAgIGxvY2FscywKICAgICAgICAgIGZpbGUsCiAgICAgICAgICBsaW5lOiBsb2NhdGlvbj8ubGluZU51bWJlciB8fCAwLAogICAgICAgICAgY29kZSwKICAgICAgICB9OwogICAgICB9IGNhdGNoIChlcnJvcikgewogICAgICAgIGlmIChnbG9iYWwuc2ZEZWJ1ZykgewogICAgICAgICAgY29uc29sZS5lcnJvcigiW1dvcmtlcl0gRXJyb3IgcHJvY2Vzc2luZyBjYWxsIGZyYW1lOiIsIGVycm9yKTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgIGZ1bmN0aW9uOiAiPGVycm9yPiIsCi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ICBpZiAoIWlzRnJvbUFsbG93ZWROb2RlTW9kdWxlKSB7CiAgICAgICAgICAvLyBOb3QgZnJvbSBhbiBhbGxvd2VkIG5vZGUgbW9kdWxlID0+IHJldHVybiBlYXJseQogICAgICAgICAgaWYgKGdsb2JhbC5zZkRlYnVnKSB7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKAogICAgICAgICAgICAgICJbV29ya2VyXSBFcnJvciBhcHBlYXJzIHRvIGJlIHRyaWdnZXJlZCBmcm9tIG5vbi1hcHBsaWNhdGlvbiBzb3VyY2VzOyBpZ25vcmluZy4iLAogICAgICAgICAgICApOwogICAgICAgICAgfQogICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICAvLyBPdGhlcndpc2UsIGl0J3MgZnJvbSBhbiBhbGxvd2VkIG5vZGUgbW9kdWxlLCBzbyBjb250aW51ZQogICAgICB9IGVsc2UgewogICAgICAgIC8vIElmIHRoZSBsaXN0IGlzIGVtcHR5LCBwcmVzZXJ2ZSBleGlzdGluZyBiZWhhdmlvciBhbmQgaWdub3JlIG5vbi1hcHBsaWNhdGlvbiBlcnJvcnMKICAgICAgICBpZiAoZ2xvYmFsLnNmRGVidWcpIHsKICAgICAgICAgIGNvbnNvbGUubG9nKAogICAgICAgICAgICAiW1dvcmtlcl0gRXJyb3IgYXBwZWFycyB0byBiZSB0cmlnZ2VyZWQgZnJvbSBub24tYXBwbGljYXRpb24gc291cmNlczsgaWdub3JpbmcuIiwKICAgICAgICAgICk7CiAgICAgICAgfQogICAgICAgIHJldHVybjsKICAgICAgfQogICAgfQoKICAgIC8vIElmIHdlIHJlYWNoIHRoaXMgcG9pbnQsIHRoZSBlcnJvciBpcyBlaXRoZXIgZnJvbSBhcHAgY29kZSwgb3IgZnJvbSBhIG5vZGUgbW9kdWxlIGFsbG93ZWQgYnkgdGhlIGxpc3QKICAgIC8vID0+IFByb2NlZWQgd2l0aCBjYXB0dXJpbmcgbG9jYWwgdmFyaWFibGVzLCBldGMuCiAg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iLCBlcnJvcik7CiAgfQp9KTsKCi8vIEtlZXAgdGhlIHdvcmtlciBhbGl2ZQpzZXRJbnRlcnZhbCgoKSA9PiB7fSwgMTAwMDApOwo="),{workerData:{captureAllExceptions:!0}});let s=null;const g=new WeakMap;r.on("message",c=>{if(typeof c=="string"&&A().sfDebug&&console.log(`[Worker] ${c}`),c.readyToGetParameters&&r.postMessage({sfDebug:A().sfDebug,stackDepthLocals:A().stackDepthLocals,nodeModulesToCollectLocalVariablesOn:A().nodeModulesToCollectLocalVariablesOn}),c.type==="exception"){const{frames:I}=c,p=s;if(!p)return;const C=g.get(p),l=(function(e){return e?e.split(`
|
|
34
|
+
`).slice(1).map(n=>{const h=/at (.+?) \((.+):(\d+):(\d+)\)/.exec(n)||/at (.+):(\d+):(\d+)/.exec(n);if(h){const[,u,m,f,b]=h;return new F({function:u||"<anonymous>",locals:{},file:m||"<unknown>",line:parseInt(f,10)||0,code:"<not captured>",column:parseInt(b)||0})}return new F({function:"<unknown>",locals:{},file:"<unknown>",line:0,code:"<not captured>",column:0})}):[]})(p.stack),d=(function(e,n){const h=[];let u=-1,m=-1;for(let f=0;f<e.length;f++){const b=rt(e[f].file);if(m=f,b!=="<unknown>"){for(let v=0;v<n.length;v++){const S=n[v];if(Fe(S,b)||typeof S.file=="string"&&S.file.includes(b)){u=v,X=0,A().sfDebug&&console.log(`✅ Matched Frame Found: ${b} @ Debugger Frame ${v}`);break}}if(u!==-1)break}}if(u===-1)return X===10?(X=0,e):(++X,A().sfDebug&&console.log(`"❌ No matching frame found. Checking once again, Attempt N ${X}"`),[]);A().sfDebug&&console.log(`🔄 Merging from matched index ${u} onward...`);for(let f=0;f<n.length;f++){const b=e[m+f],v=n[u+f];h.push(new F({function:v?.function||b?.function||"<anonymous>",locals:v?.locals||b?.locals||{},file:b?.file||v?.file||"<unknown>",line:v?.line||b?.line||0,code:v?.code||b?.code||"<not captured>"}))}return h})(l,I||[]);if(d.length!==0){s=null;const e=A().stackDepthCodeTraceDepth,n=e===-1?d:d.slice(0,e+1),h=Math.min(n.length,l.length);for(let b=0;b<h;b++)(async()=>{const v=nt(n[b].file,l[b].line,l[b].column);v&&(v.content!=null&&(n[b].code=v.content),v.file!=null&&(n[b].file=v.file))})();i.setOperationName("CollectExceptions");const u=p.message?`${p.name}: ${p.message}`:p.name;A().sfDebug&&console.log("error message is : ",u);const m=w.getInstance(),f=g.get(p);f?(m.setTraceIdFor(f,f),m.runWithSession(f,()=>{m.setTraceId(f),i.doSend(u,n)})):i.doSend(u,n),C?w.getInstance().runWithSession(C,()=>{i.doSend(u,n)}):i.doSend(u,n)}}}),r.on("error",c=>{console.error("[Worker Error]",c)}),r.on("exit",c=>{console.error(`[Worker] Exited with code ${c}`)}),r.unref();const a=Error,t=new Set;function o(...c){const I=Reflect.construct(a,c);Reflect.setPrototypeOf(I,o.prototype);try{const C=w.getInstance().getTraceId();g.set(I,C)}catch{}a.captureStackTrace&&a.captureStackTrace(I,o);const p=`${I.message}:${I.stack?.split(`
|
|
35
|
+
`)[1]?.trim()}`;if(!t.has(p)){t.add(p),s=I;const C=w.getInstance().getTraceId();g.set(I,C),r.postMessage({type:"processException",error:I.message})}return I}o.prototype=Object.create(a.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(o,a),globalThis.Error=o}function Ve(i){return i=(i=(i=i.replace(/^webpack:\/\/[^\/]+\/\.?\//,"")).replace(/^.*\/pages\//,"pages/")).replace(/\.(js|ts)$/,"")}function nt(i,r,s){const g=(function(t){t.startsWith("at ")&&(t=t.slice(3).trim());const o=t.match(/^(.*?)(:\d+)+(\.map)?$/);return o?o[1]:t})(i);if(!g||g==="<unknown>")return null;const a=g+".map";try{const t=Le.readFileSync(a,"utf-8");if(t){const o=JSON.parse(t);let c=new Ee.SourceMapConsumer(o).originalPositionFor({line:r,column:s});if(g&&c.source){const I=Ve(g),p=o.sources.findIndex(C=>Ve(C)===I);if(p===-1)A().sfDebug&&console.log(`Source file "${g}" not found in the source map.`);else{const C=o.sourcesContent[p],l=o.names.join(",");if(C)return{content:C.split(`
|
|
36
|
+
`).slice(c.line-1,c.line+20).join(`
|
|
37
|
+
`),name:l,file:c.source};A().sfDebug&&console.log(`No source content available for file "${g}".`)}}return{content:o.sourcesContent[0],name:o.names[0],file:o.file}}}catch(t){A().sfDebug&&console.log(`Cant read/parse "${a}: Error - ".`,t)}return null}function rt(i){return i?.split("/").pop()||"<unknown>"}function Fe(i,r){if(!i||typeof i!="object")return!1;for(const s of Object.values(i))if(typeof s=="string"&&s.includes(r)||typeof s=="object"&&Fe(s,r))return!0;return!1}class ot extends L{constructor(){super();y(this,"serviceIdentifier",new M);this.setOperationName("CollectExceptions")}async sendAppIdentifier(){this.serviceIdentifier.doSend({})}async doSend(s,g){this.sendAppIdentifier(),this.send(s,g)}async send(s,g){A().sfDebug&&console.log(" SENDING EXCEPTION...");const a=JSON.stringify(j.encode(g)),t=this.getVariables({exceptionMessage:s,traceJson:a,reentrancyGuardPreactive:!1,library:A().packageLibraryType,version:A().version});H(this.endpoint,this.operationName,this.getQuery(),t)}getQuery(){return`
|
|
36
38
|
mutation ${this.operationName}($apiKey: String!, $serviceUuid: String!, $sessionId: String!, $exceptionMessage: String!, $traceJson: String!, $reentrancyGuardPreactive: Boolean!, $library: String!, $timestampMs: String!, $version: String!) {
|
|
37
39
|
${this.queryName}(apiKey: $apiKey, serviceUuid: $serviceUuid, sessionId: $sessionId, exceptionMessage: $exceptionMessage, traceJson: $traceJson, reentrancyGuardPreactive: $reentrancyGuardPreactive, library: $library, timestampMs: $timestampMs, version: $version)
|
|
38
40
|
}
|
|
39
|
-
`}}const
|
|
41
|
+
`}}const Re="getting request source code";var P=(i=>(i.UNKNOWN="unknown",i.ANONYMOUS="anonymous",i.NOT_CAPTURED="not captured",i))(P||{});const ae="http:",ce="https:";let He=!1;function it(){const i=A().sfDebug;if(He)return void(i&&console.log("[patchNodeHttpInbound] Already installed, skipping."));let r;He=!0;try{r=require("node:http"),i&&console.log("[patchNodeHttpInbound] node:http required successfully.")}catch(a){return void console.error("Failed to require node:http:",a)}if(!r?.Server?.prototype)return void(i&&console.log("[patchNodeHttpInbound] http.Server.prototype not found."));const s=r.Server.prototype,g=s.emit;g&&!s.__sf_inbound_patched__?(Object.defineProperty(s,"__sf_inbound_patched__",{value:!0,enumerable:!1,configurable:!1,writable:!1}),i&&console.log("[patchNodeHttpInbound] Patching http.Server.prototype.emit."),s.emit=function(a,...t){if(a!=="request")return i&&console.log(`[patchNodeHttpInbound] Passing through event: ${a}`),g.call(this,a,...t);const o=t[0],c=t[1],I=(function(d){const e={};if(!d)return e;for(const[n,h]of Object.entries(d))h!=null&&(Array.isArray(h)?e[n.toLowerCase()]=h.join(", "):e[n.toLowerCase()]=String(h));return e})(o?.headers),p=I["x-sf3-rid"];i&&(console.log("[patchNodeHttpInbound] Intercepted request event."),console.log("[patchNodeHttpInbound] Inbound headers:",I),console.log("[patchNodeHttpInbound] Trace header:",p));const C=w.getInstance();C.setTraceId(p);const l=C.getTraceId();return i&&console.log("[patchNodeHttpInbound] Context traceId set:",l),C.runWith({inboundHeaders:I,...p?{traceId:p}:{}},()=>{p&&C.setTraceId(p),i&&console.log("[patchNodeHttpInbound] Running request handler in context.");const d=()=>{i&&console.log("[patchNodeHttpInbound] Response finished/closed for traceId:",C.getTraceId())};return c.on("finish",d),c.on("close",d),g.call(this,a,o,c)})}):i&&console.log("[patchNodeHttpInbound] Already patched, skipping.")}const R={};class st extends le{constructor(){super(),this.setOperationName("DomainsToNotPassHeaderTo")}async doSend(r){this.sendAppIdentifier(),this.send(r)}async send(r){const s=`
|
|
40
42
|
${this.queryType} ${this.operationName}(
|
|
41
43
|
$apiKey: String!,
|
|
42
44
|
$serviceUuid: String!,
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
domains: $domains
|
|
49
51
|
)
|
|
50
52
|
}
|
|
51
|
-
`,
|
|
53
|
+
`,g={apiKey:this.apiKey,serviceUuid:this.serviceUUID,domains:r};H(this.endpoint,this.operationName,s,g)}}class at extends L{constructor(){super();y(this,"serviceIdentifier",new M);this.setOperationName("CollectNetworkHops")}async sendAppIdentifier(){this.serviceIdentifier.doSend({})}async doSend(s){this.sendAppIdentifier(),this.send(s)}async send(s){const{name:g,column:a,line:t,entrypoint:o,retryWithoutTraceId:c}=s,I=this.getVariables({name:g,column:a,line:t,entrypoint:o,retryWithoutTraceId:c});H(this.endpoint,this.operationName,this.getQuery(),I)}getQuery(){return`
|
|
52
54
|
mutation ${this.operationName}(
|
|
53
55
|
$apiKey: String!,
|
|
54
56
|
$sessionId: String!,
|
|
@@ -58,6 +60,7 @@
|
|
|
58
60
|
$name: String!,
|
|
59
61
|
$entrypoint: String!,
|
|
60
62
|
$serviceUuid: String
|
|
63
|
+
${this.operationName==="CollectNetworkHops"?", $retryWithoutTraceId: Boolean":""}
|
|
61
64
|
) {
|
|
62
65
|
${this.queryName}(
|
|
63
66
|
apiKey: $apiKey,
|
|
@@ -68,10 +71,18 @@
|
|
|
68
71
|
name: $name,
|
|
69
72
|
entrypoint: $entrypoint,
|
|
70
73
|
serviceUuid: $serviceUuid
|
|
74
|
+
${this.operationName==="CollectNetworkHops"?", retryWithoutTraceId: $retryWithoutTraceId":""}
|
|
71
75
|
)
|
|
72
76
|
}
|
|
73
|
-
`}}
|
|
74
|
-
|
|
77
|
+
`}}class ct extends L{constructor(){super();y(this,"serviceIdentifier",new M);this.setOperationName("CollectNetworkRequest")}async sendAppIdentifier(){this.serviceIdentifier.doSend({})}async doSend(s){this.sendAppIdentifier(),this.send(s)}getQuery(){return`
|
|
78
|
+
mutation ${this.operationName}(
|
|
79
|
+
$data: NetworkRequestInput!
|
|
80
|
+
) {
|
|
81
|
+
${this.queryName}(
|
|
82
|
+
data: $data)
|
|
83
|
+
}
|
|
84
|
+
`}async send(s){const g={data:{...s}};await H(this.endpoint,this.operationName,this.getQuery(),g)}}const ge=[400,403];class gt{constructor(r=[]){y(this,"HEADER_TRACING","X-Sf3-Rid");y(this,"HEADER_LOG_GUARD","reentrancy_guard_logging_preactive");y(this,"HEADER_PRINT_GUARD","reentrancy_guard_print_preactive");y(this,"HEADER_EXCEPTION_GUARD","reentrancy_guard_exception_preactive");y(this,"contextManager");this.contextManager=w.getInstance(),r?.forEach(s=>{typeof s=="string"&&s.trim()&&this.contextManager.getExcludedDomains().add(s)}),A().sfDebug&&console.log("[RequestInterceptor] Initialized with static excluded domains.")}extractIdsFromTraceHeader(r,s=this.HEADER_TRACING){let g;if(r instanceof Headers)g=r.get(s)??void 0;else{const t=s.toLowerCase();for(const[o,c]of Object.entries(r))if(o.toLowerCase()===t){g=c;break}}if(!g)return{};const a=g.split("/").filter(Boolean);return a.length<3?{}:{sessionId:a[0],pageVisitId:a[1],requestId:a[a.length-1]}}parseStackFrame(r){const s=/\((.*):(\d+):(\d+)\)$/.exec(r.trim());if(!s)return null;const[,g,a,t]=s;return{filePath:g,line:parseInt(a,10),column:parseInt(t,10)}}async getOriginalPosition(r,s,g){let a={source:r,line:s,column:g,name:null};const t=r+".map";try{const o=JSON.parse(Le.readFileSync(t,"utf-8"));let c=(await new Ee.SourceMapConsumer(o)).originalPositionFor({line:s,column:g});c.source&&(a=c)}catch(o){A().sfDebug&&console.error(`Could not read/parse map file at ${t}:`,o)}return{originalPos:a}}captureFirstUserLines(r,s=10,g=!1){const a=A().sfDebug?10:s,t=Error.stackTraceLimit;Error.stackTraceLimit=Math.max(t,a);const o=new Error(Re);Re in Error&&Error.captureStackTrace(o,this.captureFirstUserLines);const c=o.stack||"";Error.stackTraceLimit=t;const I=c.split(`
|
|
85
|
+
`).slice(1),p=[];for(const C of I)if(!(C.includes("node:internal")||C.includes("internal/modules")||C.includes("internal/process")||C.includes("node_modules")||C.includes(".next/server/chunks")||C.includes("RequestInterceptor")||C.includes("contextManager")||C.includes("setupConfig"))&&(p.push(C.trim()),p.length>=s))break;for(const C of p){const l=this.parseStackFrame(C);l?(async()=>{const{originalPos:d}=await this.getOriginalPosition(l.filePath,l.line,l.column);if(d){A().sfDebug&&console.log("[RequestInterceptor] First user code line:",d);const e={line:d.line?.toString()||P.UNKNOWN,column:d.column?.toString()||P.NOT_CAPTURED,name:d.name||P.NOT_CAPTURED,entrypoint:d.source,retryWithoutTraceId:g};r.doSend(e)}})():A().sfDebug&&console.error("Could not parse stack line:",C)}}addReentrancyGuardHeaders(r){r.set(this.HEADER_LOG_GUARD,"true"),r.set(this.HEADER_PRINT_GUARD,"true"),r.set(this.HEADER_EXCEPTION_GUARD,"true")}shouldPropagateHeaders(r){return!Ue.some(s=>new RegExp(`^${s.replace(/\*/g,".*")}$`).test(r))}addTracingHeaders(r,s){const g=new URL(s).hostname,a=this.shouldPropagateHeaders(g);return a?this.addTracingHeader(r,s):A().sfDebug&&console.error(`[RequestInterceptor] Excluded domain: ${g}`),a}addTracingHeader(r,s){const g=this.contextManager.getOrSetSfTraceId(),a=this.contextManager.getOrSetPageVisitUUID(),t=E();r.set(this.HEADER_TRACING,`${g}/${a}/${t}`),A().sfDebug&&console.log(`[RequestInterceptor] Added tracing header for ${s}`)}patchFetch(r,s){const g=globalThis.fetch;typeof g=="function"?globalThis.fetch=async(a,t)=>{this.captureFirstUserLines(r);const o=Date.now(),c=new Headers(t?.headers);let I;typeof a=="string"||a instanceof URL?I=a.toString():a instanceof Request?(I=a.url,a.headers.forEach((n,h)=>{c.set(h,n)})):A().sfDebug&&console.error("[Sailfish RequestInterceptor] Invalid fetch input."),A().sfDebug&&console.log("[RequestInterceptor] Fetching request to:",I);const p=new URL(I).hostname,C=new Headers(c),l=this.addTracingHeaders(c,I),d={...t,headers:c};let e;try{let n=!1;this.addTracingHeaders(C,I),e=await g(I,d),l&&ge.includes(e.status)?(e=await g(I,{...t,headers:C}),n=!0,this.captureFirstUserLines(r,10,n)):this.contextManager.addSupportedDomains(p);const h=Date.now();A().sfDebug&&console.log(`[RequestInterceptor] Fetch completed: ${I}, Status: ${e.status}, Duration: ${h-o}ms`);const{sessionId:u,pageVisitId:m,requestId:f}=this.extractIdsFromTraceHeader(c);return s.doSend({apiKey:A().apiKey,requestId:f,pageVisitId:m,recordingSessionId:u,serviceUuid:A().serviceUUID,timestampStart:o.toString(),timestampEnd:h.toString(),responseCode:e.status,success:!0,error:null,url:I,method:d.method||"GET",retryWithoutTraceId:n}),e}catch(n){const h=Date.now();A().sfDebug&&console.error(`[RequestInterceptor] Fetch failed: ${I}, Error: ${n}, Duration: ${h-o}ms`)}}:A().sfDebug&&console.error("[RequestInterceptor] Fetch not available.")}patchHttp(r,s){if(A().sfDebug&&console.log("[RequestInterceptor] Initializing HTTP/HTTPS request patch..."),!R||typeof R.request!="function")return void(A().sfDebug&&console.log("[RequestInterceptor] HTTP/HTTPS not available."));const g=R.request.bind(R),a=R.request.bind(R);R.request=function(t,o){let c;try{if(typeof t=="string"){const p=new URL(t);c={protocol:p.protocol||ae,hostname:p.hostname,path:p.pathname+p.search,headers:{}}}else t instanceof URL?c={protocol:t.protocol||ae,hostname:t.hostname,path:t.pathname+t.search,headers:{}}:(c={...t},c.protocol||(c.protocol=ae));if(c.headers){const p=`${c.protocol}//${c.hostname}`;this.addTracingHeaders(c.headers,p),this.captureFirstUserLines(r)}else A().sfDebug&&console.warn("[RequestInterceptor] No headers found in HTTP request options. Skipping header addition.")}catch(p){throw A().sfDebug&&console.error("[RequestInterceptor] Error while processing HTTP request options:",p),p}let I=!1;return g(c,p=>{const C=`${c.protocol}//${c.hostname}`;if(c.headers&&this.shouldPropagateHeaders(new URL(C).hostname)&&ge.includes(p.statusCode||0)){c.hostname;const n={...c,headers:{...c.headers}};delete n.headers[this.HEADER_TRACING],g(n,o),I=!0,this.captureFirstUserLines(r,10,I)}const{sessionId:l,pageVisitId:d,requestId:e}=this.extractIdsFromTraceHeader(c.headers);s.doSend({apiKey:A().apiKey,requestId:e,pageVisitId:d,recordingSessionId:l,serviceUuid:A().serviceUUID,timestampStart:Date.now().toString(),timestampEnd:Date.now().toString(),responseCode:p.statusCode||0,success:!!p.statusCode&&p.statusCode<400,error:null,url:C,method:c.method||"GET",retryWithoutTraceId:I}),o?.(p)})},R.request=function(t,o){let c;try{if(typeof t=="string"){const p=new URL(t);c={protocol:p.protocol||ce,hostname:p.hostname,path:p.pathname+p.search,headers:{}}}else t instanceof URL?c={protocol:t.protocol||ce,hostname:t.hostname,path:t.pathname+t.search,headers:{}}:(c={...t},c.protocol||(c.protocol=ce));if(c.headers){const p=`${c.protocol}//${c.hostname}`;this.addTracingHeaders(c.headers,p)}else A().sfDebug&&console.warn("[RequestInterceptor] No headers found in HTTPS request options. Skipping header addition.")}catch(p){throw A().sfDebug&&console.error("[RequestInterceptor] Error while processing HTTPS request options:",p),p}let I=!1;return a(c,p=>{const C=`${c.protocol}//${c.hostname}`;if(c.headers&&this.shouldPropagateHeaders(new URL(C).hostname)&&ge.includes(p.statusCode||0)){const n={...c,headers:{...c.headers}};delete n.headers[this.HEADER_TRACING],a(n,o),I=!0,this.captureFirstUserLines(r,10,I)}const{sessionId:l,pageVisitId:d,requestId:e}=this.extractIdsFromTraceHeader(c.headers);s.doSend({apiKey:A().apiKey,requestId:e,pageVisitId:d,recordingSessionId:l,serviceUuid:A().serviceUUID,timestampStart:Date.now().toString(),timestampEnd:Date.now().toString(),responseCode:p.statusCode||0,success:!!p.statusCode&&p.statusCode<400,error:null,url:C,method:c.method||"GET",retryWithoutTraceId:I}),o?.(p)})},A().sfDebug&&console.log("✅ HTTP and HTTPS request methods patched globally.")}tryPatch(r,s){try{require.resolve(s),r(),console.log(`[RequestInterceptor] Patched ${s}`)}catch(g){console.warn(`[RequestInterceptor] Could not patch ${s}: ${g.message}`)}}getExcludedDomains(){return[...this.contextManager.getExcludedDomains()]}}class lt extends le{constructor(){super(),this.setOperationName("UpdateServiceDetails")}async doSend(){this.sendAppIdentifier(),this.send()}async send(){const r=`
|
|
75
86
|
${this.queryType} ${this.operationName}(
|
|
76
87
|
$apiKey: String!,
|
|
77
88
|
$serviceUuid: String!,
|
|
@@ -91,4 +102,4 @@
|
|
|
91
102
|
|
|
92
103
|
)
|
|
93
104
|
}
|
|
94
|
-
`,
|
|
105
|
+
`,s=this.getVariables({serviceIdentifier:A().serviceIdentifier,serviceVersion:A().serviceVersion,serviceAdditionalMetadata:A().serviceAdditionalMetadata});H(this.endpoint,this.operationName,r,s)}}exports.ContextManager=w,exports.addOrUpdateMetadata=function(i,r={},s,g=!1){const a=A();new he(a.apiKey).addOrUpdateMetadata(i,r,s,g)},exports.identify=function(i,r,s,g=!1){const a=A();new he(a.apiKey).identify(i,r,s,g)},exports.runWithContext=function(i){const r={...w.getInstance().getCurrentContext()};J.run(r,()=>{i()})},exports.setupInterceptors=function(i){if(!i||!i.apiKey){const a=`The required API Key is not provided: ${JSON.stringify(i)}`;console.error(a)}const{config:r}=ze(i);if(r.sfDebug&&console.log("Updated configuration after applying options:",r),!r.apiKey||!r.apiGraphqlEndpoint){const a=`The required config is not provided: ${JSON.stringify(r)}`;throw console.error(a),new Error(a)}const s=new le;s.setServiceUUID(r.serviceUUID),(function(a){function t(l,d){a.setOperationName("CollectLogs"),a.doSend([d,l])}const o=console.log.bind(console),c=console.error.bind(console),I=console.warn.bind(console),p=console.info.bind(console),C=console.debug.bind(console);console.log=(...l)=>{t("INFO",l.join(" ")),o(...l)},console.error=(...l)=>{t("ERROR",l.join(" ")),c(...l)},console.warn=(...l)=>{t("WARN",l.join(" ")),I(...l)},console.info=(...l)=>{t("INFO",l.join(" ")),p(...l)},A().logLevel==="DEBUG"&&(console.debug=(...l)=>{t("DEBUG",l.join(" ")),C(...l)})})(s),(function(a=[]){const t=new gt(a);new st().doSend(t.getExcludedDomains());const o=new at,c=new ct;t.patchFetch(o,c),t.patchHttp(o,c)})(r.domainsToNotPropagateHeadersTo);const g=new ot;g.setServiceUUID(r.serviceUUID),tt(g),it(),new lt().send()};
|