81 lines
1.8 KiB
TypeScript
81 lines
1.8 KiB
TypeScript
// Metro module 10117 (f10118).
|
|
import { v4 } from "../../../_bundle/Module514";
|
|
import { getSearchContextId } from "../SearchUtils";
|
|
class AbstractSearchSessionAnalyticsManager {
|
|
constructor() {
|
|
return {
|
|
__proto__: new.target.prototype,
|
|
sessions: new Map()
|
|
};
|
|
}
|
|
getSession(a0) {
|
|
let r12 = this.sessions.get(getSearchContextId(a0));
|
|
if (r12 == null) {
|
|
r12 = null;
|
|
}
|
|
return r12;
|
|
}
|
|
setSession(a0, a1) {
|
|
const searchContextId = getSearchContextId(a0);
|
|
let r15 = this.sessions.get(searchContextId);
|
|
if (r15 == null) {
|
|
r15 = {
|
|
sessionId: v4(),
|
|
searchQueryId: null
|
|
};
|
|
}
|
|
this.sessions.set(searchContextId, {
|
|
...r15,
|
|
...a1
|
|
});
|
|
}
|
|
deleteSession(a0) {
|
|
this.sessions.delete(getSearchContextId(a0));
|
|
}
|
|
getSessionId(a0) {
|
|
let r6 = this.getSession(a0)?.sessionId;
|
|
if (r6 == null) {
|
|
r6 = null;
|
|
}
|
|
return r6;
|
|
}
|
|
getQueryId(a0) {
|
|
let r6 = this.getSession(a0)?.searchQueryId;
|
|
if (r6 == null) {
|
|
r6 = null;
|
|
}
|
|
return r6;
|
|
}
|
|
refreshQueryId(a0) {
|
|
this.setSession(a0, {
|
|
searchQueryId: v4()
|
|
});
|
|
}
|
|
initialize(a0) {
|
|
this._initialize.apply(this, [a0, ...Array.prototype.slice.call(arguments, 1)]);
|
|
this.setSession(a0, {
|
|
sessionId: v4(),
|
|
searchQueryId: null
|
|
});
|
|
}
|
|
terminate(a0) {
|
|
this._terminate(a0);
|
|
this.deleteSession(a0);
|
|
}
|
|
transferSession(a0, a1) {
|
|
this._transferSession(a0, a1);
|
|
let r14 = this.getSession(a0);
|
|
const sessions = this.sessions;
|
|
const searchContextId = getSearchContextId(a1);
|
|
if (r14 == null) {
|
|
r14 = {
|
|
sessionId: v4(),
|
|
searchQueryId: null
|
|
};
|
|
}
|
|
sessions.set(searchContextId, r14);
|
|
this.deleteSession(a0);
|
|
}
|
|
}
|
|
export default AbstractSearchSessionAnalyticsManager;
|