Commit iniziale
This commit is contained in:
35
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceClient.d.ts
generated
vendored
Normal file
35
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceClient.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import { InProgressPerformanceEvent, IPerformanceClient, PerformanceClient, PerformanceEvents } from "@azure/msal-common/browser";
|
||||
import { Configuration } from "../config/Configuration.js";
|
||||
export declare class BrowserPerformanceClient extends PerformanceClient implements IPerformanceClient {
|
||||
constructor(configuration: Configuration, intFields?: Set<string>, abbreviations?: Map<string, string>);
|
||||
generateId(): string;
|
||||
private getPageVisibility;
|
||||
private deleteIncompleteSubMeasurements;
|
||||
/**
|
||||
* Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
|
||||
* Also captures browser page visibilityState.
|
||||
*
|
||||
* @param {PerformanceEvents} measureName
|
||||
* @param {?string} [correlationId]
|
||||
* @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}
|
||||
*/
|
||||
startMeasurement(measureName: string, correlationId?: string): InProgressPerformanceEvent;
|
||||
/**
|
||||
* Adds pre-queue time to preQueueTimeByCorrelationId map.
|
||||
* @param {PerformanceEvents} eventName
|
||||
* @param {?string} correlationId
|
||||
* @returns
|
||||
*/
|
||||
setPreQueueTime(eventName: PerformanceEvents, correlationId?: string): void;
|
||||
/**
|
||||
* Calculates and adds queue time measurement for given performance event.
|
||||
*
|
||||
* @param {PerformanceEvents} eventName
|
||||
* @param {?string} correlationId
|
||||
* @param {?number} queueTime
|
||||
* @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements
|
||||
* @returns
|
||||
*/
|
||||
addQueueMeasurement(eventName: string, correlationId?: string, queueTime?: number, manuallyCompleted?: boolean): void;
|
||||
}
|
||||
//# sourceMappingURL=BrowserPerformanceClient.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceClient.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceClient.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BrowserPerformanceClient.d.ts","sourceRoot":"","sources":["../../src/telemetry/BrowserPerformanceClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,0BAA0B,EAC1B,kBAAkB,EAElB,iBAAiB,EAEjB,iBAAiB,EAGpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAmD3D,qBAAa,wBACT,SAAQ,iBACR,YAAW,kBAAkB;gBAGzB,aAAa,EAAE,aAAa,EAC5B,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EACvB,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAqBvC,UAAU,IAAI,MAAM;IAIpB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,+BAA+B;IA0BvC;;;;;;;OAOG;IACH,gBAAgB,CACZ,WAAW,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,MAAM,GACvB,0BAA0B;IAuD7B;;;;;OAKG;IACH,eAAe,CACX,SAAS,EAAE,iBAAiB,EAC5B,aAAa,CAAC,EAAE,MAAM,GACvB,IAAI;IAuCP;;;;;;;;OAQG;IACH,mBAAmB,CACf,SAAS,EAAE,MAAM,EACjB,aAAa,CAAC,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,OAAO,GAC5B,IAAI;CA+BV"}
|
||||
172
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceClient.mjs
generated
vendored
Normal file
172
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceClient.mjs
generated
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { PerformanceClient, Constants, Logger } from '@azure/msal-common/browser';
|
||||
import { name, version } from '../packageMetadata.mjs';
|
||||
import { BrowserCacheLocation, BROWSER_PERF_ENABLED_KEY } from '../utils/BrowserConstants.mjs';
|
||||
import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* Returns browser performance measurement module if session flag is enabled. Returns undefined otherwise.
|
||||
*/
|
||||
function getPerfMeasurementModule() {
|
||||
let sessionStorage;
|
||||
try {
|
||||
sessionStorage = window[BrowserCacheLocation.SessionStorage];
|
||||
const perfEnabled = sessionStorage?.getItem(BROWSER_PERF_ENABLED_KEY);
|
||||
if (Number(perfEnabled) === 1) {
|
||||
return import('./BrowserPerformanceMeasurement.mjs');
|
||||
}
|
||||
// Mute errors if it's a non-browser environment or cookies are blocked.
|
||||
}
|
||||
catch (e) { }
|
||||
return undefined;
|
||||
}
|
||||
/**
|
||||
* Returns boolean, indicating whether browser supports window.performance.now() function.
|
||||
*/
|
||||
function supportsBrowserPerformanceNow() {
|
||||
return (typeof window !== "undefined" &&
|
||||
typeof window.performance !== "undefined" &&
|
||||
typeof window.performance.now === "function");
|
||||
}
|
||||
/**
|
||||
* Returns event duration in milliseconds using window performance API if available. Returns undefined otherwise.
|
||||
* @param startTime {DOMHighResTimeStamp | undefined}
|
||||
* @returns {number | undefined}
|
||||
*/
|
||||
function getPerfDurationMs(startTime) {
|
||||
if (!startTime || !supportsBrowserPerformanceNow()) {
|
||||
return undefined;
|
||||
}
|
||||
return Math.round(window.performance.now() - startTime);
|
||||
}
|
||||
class BrowserPerformanceClient extends PerformanceClient {
|
||||
constructor(configuration, intFields, abbreviations) {
|
||||
super(configuration.auth.clientId, configuration.auth.authority || `${Constants.DEFAULT_AUTHORITY}`, new Logger(configuration.system?.loggerOptions || {}, name, version), name, version, configuration.telemetry?.application || {
|
||||
appName: "",
|
||||
appVersion: "",
|
||||
}, intFields, abbreviations);
|
||||
}
|
||||
generateId() {
|
||||
return createNewGuid();
|
||||
}
|
||||
getPageVisibility() {
|
||||
return document.visibilityState?.toString() || null;
|
||||
}
|
||||
deleteIncompleteSubMeasurements(inProgressEvent) {
|
||||
void getPerfMeasurementModule()?.then((module) => {
|
||||
const rootEvent = this.eventsByCorrelationId.get(inProgressEvent.event.correlationId);
|
||||
const isRootEvent = rootEvent &&
|
||||
rootEvent.eventId === inProgressEvent.event.eventId;
|
||||
const incompleteMeasurements = [];
|
||||
if (isRootEvent && rootEvent?.incompleteSubMeasurements) {
|
||||
rootEvent.incompleteSubMeasurements.forEach((subMeasurement) => {
|
||||
incompleteMeasurements.push({ ...subMeasurement });
|
||||
});
|
||||
}
|
||||
// Clean up remaining marks for incomplete sub-measurements
|
||||
module.BrowserPerformanceMeasurement.flushMeasurements(inProgressEvent.event.correlationId, incompleteMeasurements);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
|
||||
* Also captures browser page visibilityState.
|
||||
*
|
||||
* @param {PerformanceEvents} measureName
|
||||
* @param {?string} [correlationId]
|
||||
* @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}
|
||||
*/
|
||||
startMeasurement(measureName, correlationId) {
|
||||
// Capture page visibilityState and then invoke start/end measurement
|
||||
const startPageVisibility = this.getPageVisibility();
|
||||
const inProgressEvent = super.startMeasurement(measureName, correlationId);
|
||||
const startTime = supportsBrowserPerformanceNow()
|
||||
? window.performance.now()
|
||||
: undefined;
|
||||
const browserMeasurement = getPerfMeasurementModule()?.then((module) => {
|
||||
return new module.BrowserPerformanceMeasurement(measureName, inProgressEvent.event.correlationId);
|
||||
});
|
||||
void browserMeasurement?.then((measurement) => measurement.startMeasurement());
|
||||
return {
|
||||
...inProgressEvent,
|
||||
end: (event, error) => {
|
||||
const res = inProgressEvent.end({
|
||||
...event,
|
||||
startPageVisibility,
|
||||
endPageVisibility: this.getPageVisibility(),
|
||||
durationMs: getPerfDurationMs(startTime),
|
||||
}, error);
|
||||
void browserMeasurement?.then((measurement) => measurement.endMeasurement());
|
||||
this.deleteIncompleteSubMeasurements(inProgressEvent);
|
||||
return res;
|
||||
},
|
||||
discard: () => {
|
||||
inProgressEvent.discard();
|
||||
void browserMeasurement?.then((measurement) => measurement.flushMeasurement());
|
||||
this.deleteIncompleteSubMeasurements(inProgressEvent);
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Adds pre-queue time to preQueueTimeByCorrelationId map.
|
||||
* @param {PerformanceEvents} eventName
|
||||
* @param {?string} correlationId
|
||||
* @returns
|
||||
*/
|
||||
setPreQueueTime(eventName, correlationId) {
|
||||
if (!supportsBrowserPerformanceNow()) {
|
||||
this.logger.trace(`BrowserPerformanceClient: window performance API not available, unable to set telemetry queue time for ${eventName}`);
|
||||
return;
|
||||
}
|
||||
if (!correlationId) {
|
||||
this.logger.trace(`BrowserPerformanceClient: correlationId for ${eventName} not provided, unable to set telemetry queue time`);
|
||||
return;
|
||||
}
|
||||
const preQueueEvent = this.preQueueTimeByCorrelationId.get(correlationId);
|
||||
/**
|
||||
* Manually complete queue measurement if there is an incomplete pre-queue event.
|
||||
* Incomplete pre-queue events are instrumentation bugs that should be fixed.
|
||||
*/
|
||||
if (preQueueEvent) {
|
||||
this.logger.trace(`BrowserPerformanceClient: Incomplete pre-queue ${preQueueEvent.name} found`, correlationId);
|
||||
this.addQueueMeasurement(preQueueEvent.name, correlationId, undefined, true);
|
||||
}
|
||||
this.preQueueTimeByCorrelationId.set(correlationId, {
|
||||
name: eventName,
|
||||
time: window.performance.now(),
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Calculates and adds queue time measurement for given performance event.
|
||||
*
|
||||
* @param {PerformanceEvents} eventName
|
||||
* @param {?string} correlationId
|
||||
* @param {?number} queueTime
|
||||
* @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements
|
||||
* @returns
|
||||
*/
|
||||
addQueueMeasurement(eventName, correlationId, queueTime, manuallyCompleted) {
|
||||
if (!supportsBrowserPerformanceNow()) {
|
||||
this.logger.trace(`BrowserPerformanceClient: window performance API not available, unable to add queue measurement for ${eventName}`);
|
||||
return;
|
||||
}
|
||||
if (!correlationId) {
|
||||
this.logger.trace(`BrowserPerformanceClient: correlationId for ${eventName} not provided, unable to add queue measurement`);
|
||||
return;
|
||||
}
|
||||
const preQueueTime = super.getPreQueueTime(eventName, correlationId);
|
||||
if (!preQueueTime) {
|
||||
return;
|
||||
}
|
||||
const currentTime = window.performance.now();
|
||||
const resQueueTime = queueTime || super.calculateQueuedTime(preQueueTime, currentTime);
|
||||
return super.addQueueMeasurement(eventName, correlationId, resQueueTime, manuallyCompleted);
|
||||
}
|
||||
}
|
||||
|
||||
export { BrowserPerformanceClient };
|
||||
//# sourceMappingURL=BrowserPerformanceClient.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceClient.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceClient.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BrowserPerformanceClient.mjs","sources":["../../src/telemetry/BrowserPerformanceClient.ts"],"sourcesContent":[null],"names":["BrowserCrypto.createNewGuid"],"mappings":";;;;;;;AAAA;;;AAGG;AAqBH;;AAEG;AACH,SAAS,wBAAwB,GAAA;AAC7B,IAAA,IAAI,cAAmC,CAAC;IACxC,IAAI;AACA,QAAA,cAAc,GAAG,MAAM,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;QAC7D,MAAM,WAAW,GAAG,cAAc,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACtE,QAAA,IAAI,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE;AAC3B,YAAA,OAAO,OAAO,qCAAoC,CAAC,CAAC;AACvD,SAAA;;AAEJ,KAAA;IAAC,OAAO,CAAC,EAAE,GAAE;AAEd,IAAA,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;AAEG;AACH,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
22
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceMeasurement.d.ts
generated
vendored
Normal file
22
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceMeasurement.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { IPerformanceMeasurement, SubMeasurement } from "@azure/msal-common/browser";
|
||||
export declare class BrowserPerformanceMeasurement implements IPerformanceMeasurement {
|
||||
private readonly measureName;
|
||||
private readonly correlationId;
|
||||
private readonly startMark;
|
||||
private readonly endMark;
|
||||
constructor(name: string, correlationId: string);
|
||||
private static makeMeasureName;
|
||||
private static makeStartMark;
|
||||
private static makeEndMark;
|
||||
static supportsBrowserPerformance(): boolean;
|
||||
/**
|
||||
* Flush browser marks and measurements.
|
||||
* @param {string} correlationId
|
||||
* @param {SubMeasurement} measurements
|
||||
*/
|
||||
static flushMeasurements(correlationId: string, measurements: SubMeasurement[]): void;
|
||||
startMeasurement(): void;
|
||||
endMeasurement(): void;
|
||||
flushMeasurement(): number | null;
|
||||
}
|
||||
//# sourceMappingURL=BrowserPerformanceMeasurement.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceMeasurement.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceMeasurement.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BrowserPerformanceMeasurement.d.ts","sourceRoot":"","sources":["../../src/telemetry/BrowserPerformanceMeasurement.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,uBAAuB,EACvB,cAAc,EACjB,MAAM,4BAA4B,CAAC;AAEpC,qBAAa,6BAA8B,YAAW,uBAAuB;IACzE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;IAgB/C,OAAO,CAAC,MAAM,CAAC,eAAe;IAI9B,OAAO,CAAC,MAAM,CAAC,aAAa;IAI5B,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B,MAAM,CAAC,0BAA0B,IAAI,OAAO;IAY5C;;;;OAIG;WACW,iBAAiB,CAC3B,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,cAAc,EAAE,GAC/B,IAAI;IAoCP,gBAAgB,IAAI,IAAI;IAUxB,cAAc,IAAI,IAAI;IAetB,gBAAgB,IAAI,MAAM,GAAG,IAAI;CAqBpC"}
|
||||
97
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceMeasurement.mjs
generated
vendored
Normal file
97
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceMeasurement.mjs
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
class BrowserPerformanceMeasurement {
|
||||
constructor(name, correlationId) {
|
||||
this.correlationId = correlationId;
|
||||
this.measureName = BrowserPerformanceMeasurement.makeMeasureName(name, correlationId);
|
||||
this.startMark = BrowserPerformanceMeasurement.makeStartMark(name, correlationId);
|
||||
this.endMark = BrowserPerformanceMeasurement.makeEndMark(name, correlationId);
|
||||
}
|
||||
static makeMeasureName(name, correlationId) {
|
||||
return `msal.measure.${name}.${correlationId}`;
|
||||
}
|
||||
static makeStartMark(name, correlationId) {
|
||||
return `msal.start.${name}.${correlationId}`;
|
||||
}
|
||||
static makeEndMark(name, correlationId) {
|
||||
return `msal.end.${name}.${correlationId}`;
|
||||
}
|
||||
static supportsBrowserPerformance() {
|
||||
return (typeof window !== "undefined" &&
|
||||
typeof window.performance !== "undefined" &&
|
||||
typeof window.performance.mark === "function" &&
|
||||
typeof window.performance.measure === "function" &&
|
||||
typeof window.performance.clearMarks === "function" &&
|
||||
typeof window.performance.clearMeasures === "function" &&
|
||||
typeof window.performance.getEntriesByName === "function");
|
||||
}
|
||||
/**
|
||||
* Flush browser marks and measurements.
|
||||
* @param {string} correlationId
|
||||
* @param {SubMeasurement} measurements
|
||||
*/
|
||||
static flushMeasurements(correlationId, measurements) {
|
||||
if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
|
||||
try {
|
||||
measurements.forEach((measurement) => {
|
||||
const measureName = BrowserPerformanceMeasurement.makeMeasureName(measurement.name, correlationId);
|
||||
const entriesForMeasurement = window.performance.getEntriesByName(measureName, "measure");
|
||||
if (entriesForMeasurement.length > 0) {
|
||||
window.performance.clearMeasures(measureName);
|
||||
window.performance.clearMarks(BrowserPerformanceMeasurement.makeStartMark(measureName, correlationId));
|
||||
window.performance.clearMarks(BrowserPerformanceMeasurement.makeEndMark(measureName, correlationId));
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
// Silently catch and return null
|
||||
}
|
||||
}
|
||||
}
|
||||
startMeasurement() {
|
||||
if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
|
||||
try {
|
||||
window.performance.mark(this.startMark);
|
||||
}
|
||||
catch (e) {
|
||||
// Silently catch
|
||||
}
|
||||
}
|
||||
}
|
||||
endMeasurement() {
|
||||
if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
|
||||
try {
|
||||
window.performance.mark(this.endMark);
|
||||
window.performance.measure(this.measureName, this.startMark, this.endMark);
|
||||
}
|
||||
catch (e) {
|
||||
// Silently catch
|
||||
}
|
||||
}
|
||||
}
|
||||
flushMeasurement() {
|
||||
if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
|
||||
try {
|
||||
const entriesForMeasurement = window.performance.getEntriesByName(this.measureName, "measure");
|
||||
if (entriesForMeasurement.length > 0) {
|
||||
const durationMs = entriesForMeasurement[0].duration;
|
||||
window.performance.clearMeasures(this.measureName);
|
||||
window.performance.clearMarks(this.startMark);
|
||||
window.performance.clearMarks(this.endMark);
|
||||
return durationMs;
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
// Silently catch and return null
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export { BrowserPerformanceMeasurement };
|
||||
//# sourceMappingURL=BrowserPerformanceMeasurement.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceMeasurement.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceMeasurement.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BrowserPerformanceMeasurement.mjs","sources":["../../src/telemetry/BrowserPerformanceMeasurement.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;MAOU,6BAA6B,CAAA;IAMtC,WAAY,CAAA,IAAY,EAAE,aAAqB,EAAA;AAC3C,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,6BAA6B,CAAC,eAAe,CAC5D,IAAI,EACJ,aAAa,CAChB,CAAC;QACF,IAAI,CAAC,SAAS,GAAG,6BAA6B,CAAC,aAAa,CACxD,IAAI,EACJ,aAAa,CAChB,CAAC;QACF,IAAI,CAAC,OAAO,GAAG,6BAA6B,CAAC,WAAW,CACpD,IAAI,EACJ,aAAa,CAChB,CAAC;KACL;AAEO,IAAA,OAAO,eAAe,CAAC,IAAY,EAAE,aAAqB,EAAA;AAC9D,QAAA,OAAO,CAAgB,aAAA,EAAA,IAAI,CAAI,CAAA,EAAA,aAAa,EAAE,CAAC;KAClD;AAEO,IAAA,OAAO,aAAa,CAAC,IAAY,EAAE,aAAqB,EAAA;AAC5D,QAAA,OAAO,CAAc,WAAA,EAAA,IAAI,CAAI,CAAA,EAAA,aAAa,EAAE,CAAC;KAChD;AAEO,IAAA,OAAO,WAAW,CAAC,IAAY,EAAE,aAAqB,EAAA;AA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