@datagrok-libraries/statistics
Advanced tools
Comparing version 1.2.13 to 1.3.0
@@ -25,2 +25,3 @@ { | ||
"linebreak-style": "off", | ||
"brace-style": "off", | ||
"curly": [ | ||
@@ -27,0 +28,0 @@ "error", |
# statistics changelog | ||
## 1.3.0 (2024-05-11) | ||
### Features | ||
* [#2797](https://github.com/datagrok-ai/public/issues/2797): Changed optimizer for fitting | ||
## 1.2.13 (2024-04-18) | ||
@@ -4,0 +10,0 @@ |
@@ -7,3 +7,3 @@ { | ||
"friendlyName": "statistics", | ||
"version": "1.2.13", | ||
"version": "1.3.0", | ||
"description": "Statistics utilities", | ||
@@ -10,0 +10,0 @@ "dependencies": { |
# statistics | ||
Statistics provides fitting support for all kind of processes along with statistical features. | ||
Library uses optimization [lbfgs](https://github.com/mimno/jsLBFGS) algorithm. |
@@ -95,2 +95,2 @@ /** | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29ycmVsYXRpb24tY29lZmZpY2llbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb3JyZWxhdGlvbi1jb2VmZmljaWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQTs7Ozs7O0dBTUc7QUFDSCxTQUFTLEdBQUcsQ0FBQyxDQUFTO0lBQ3BCLE1BQU0sR0FBRyxHQUFHLENBQUMsQ0FBQyxrQkFBa0IsRUFBRSxxQkFBcUIsRUFBRSxxQkFBcUI7UUFDNUUsQ0FBQyxvQkFBb0IsRUFBRSxDQUFDLG1CQUFtQixFQUFFLG1CQUFtQjtRQUNoRSxrQkFBa0IsRUFBRSxDQUFDLGtCQUFrQixFQUFFLENBQUMsaUJBQWlCO1FBQzNELGlCQUFpQixFQUFFLGVBQWUsRUFBRSxDQUFDLGVBQWU7UUFDcEQsY0FBYyxFQUFFLGNBQWMsRUFBRSxDQUFDLGNBQWM7UUFDL0MsQ0FBQyxjQUFjLEVBQUUsYUFBYSxFQ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B7XG4gIGxldCBuMSA9IDA7XG4gIGxldCBuMiA9IDA7XG4gIGxldCBpc3MgPSAwO1xuICBmb3IgKGxldCBqID0gMDsgaiA8IHgubGVuZ3RoIC0gMTsgaisrKSB7XG4gICAgZm9yIChsZXQgayA9IGogKyAxOyBrIDwgeS5sZW5ndGg7IGsrKykge1xuICAgICAgY29uc3QgYTEgPSB4W2pdIC0geFtrXTtcbiAgICAgIGNvbnN0IGEyID0geVtqXSAtIHlba107XG4gICAgICBjb25zdCBhYSA9IGExICogYTI7XG4gICAgICBpZiAoYWEpIHtcbiAgICAgICAgLy8gbmVpdGhlciBhcnJheSBoYXMgYSB0aWVcbiAgICAgICAgbjEgPSBuMSArIDE7XG4gICAgICAgIG4yID0gbjIgKyAxO1xuICAgICAgICBpZiAoYWEgPiAwKVxuICAgICAgICAgIGlzcyA9IGlzcyArIDE7XG4gICAgICAgIGVsc2VcbiAgICAgICAgICBpc3MgPSBpc3MgLSAxO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKGExKVxuICAgICAgICAgIG4xID0gbjEgKyAxO1xuXG4gICAgICAgIGlmIChhMilcbiAgICAgICAgICBuMiA9IG4yICsgMTtcbiAgICAgIH1cbiAgICB9XG4gIH1cbiAgY29uc3QgdGF1ID0gaXNzIC8gTWF0aC5zcXJ0KG4xICogbjIpO1xuICBjb25zdCBzdmFyID0gKDQuMCAqIHgubGVuZ3RoICsgMTAuMCkgLyAoOS4wICogeC5sZW5ndGggKiAoeC5sZW5ndGggLSAxKSk7XG4gIGNvbnN0IHogPSB0YXUgLyBNYXRoLnNxcnQoc3Zhcik7XG4gIGNvbnN0IHByb2IgPSBlcmZjKE1hdGguYWJzKHopIC8gMS40MTQyMTM2KTtcbiAgcmV0dXJuIHt0ZXN0OiB0YXUsIHo6IHosIHByb2I6IHByb2J9O1xufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29ycmVsYXRpb24tY29lZm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uMiA9IG4yICsgMTtcbiAgICAgIH1cbiAgICB9XG4gIH1cbiAgY29uc3QgdGF1ID0gaXNzIC8gTWF0aC5zcXJ0KG4xICogbjIpO1xuICBjb25zdCBzdmFyID0gKDQuMCAqIHgubGVuZ3RoICsgMTAuMCkgLyAoOS4wICogeC5sZW5ndGggKiAoeC5sZW5ndGggLSAxKSk7XG4gIGNvbnN0IHogPSB0YXUgLyBNYXRoLnNxcnQoc3Zhcik7XG4gIGNvbnN0IHByb2IgPSBlcmZjKE1hdGguYWJzKHopIC8gMS40MTQyMTM2KTtcbiAgcmV0dXJuIHt0ZXN0OiB0YXUsIHo6IHosIHByb2I6IHByb2J9O1xufVxuIl19 |
@@ -5,2 +5,3 @@ import * as DG from 'datagrok-api/dg'; | ||
PROPORTIONAL: string; | ||
COMBINED: string; | ||
}; | ||
@@ -21,3 +22,3 @@ export declare type FitParamBounds = { | ||
fittedCurve: (x: number) => number; | ||
parameters: number[]; | ||
parameters: Float32Array; | ||
}; | ||
@@ -31,7 +32,7 @@ export declare type FitConfidenceIntervals = { | ||
auc?: number; | ||
interceptX: number; | ||
interceptY: number; | ||
slope: number; | ||
top: number; | ||
bottom: number; | ||
interceptX?: number; | ||
interceptY?: number; | ||
slope?: number; | ||
top?: number; | ||
bottom?: number; | ||
}; | ||
@@ -43,36 +44,5 @@ export declare type FitInvertedFunctions = { | ||
}; | ||
/** | ||
* Datagrok curve fitting | ||
* | ||
* - Fitting: computing parameters of the specified function to best fit the data | ||
* - Uses BFGS optimization algorithm (multi-threading for performance). | ||
* For dose-response curves, we are typically fitting the sigmoid function | ||
* - Ability to dynamically register custom fitting functions | ||
* - Automatic fit function determination | ||
* - Caching of custom fitting functions | ||
* - Ability to get fitting performance characteristics (r-squared, classification, etc) | ||
* - Deep integration with the Datagrok grid | ||
* - Either fitting on the fly, or using the supplied function + parameters | ||
* - Multiple series in one cell | ||
* - Candlesticks, confidence intervals, and droplines drawing | ||
* - Ability to define chart, marker, or fitting options (such as fit function or marker color) | ||
* on the column level, with the ability to override it on a grid cell or point level | ||
* - Clicking a point in a chart within a grid makes it an outlier -> curve is re-fitted on the fly | ||
* - Ability to specify a chart as "reference" so that it is shown on every other chart for comparison | ||
* - Ability to overlay curves from multiple grid cells (special viewer) | ||
* - Work with series stored in multiple formats (binary for performance, json for flexibility, etc) | ||
*/ | ||
export declare const FIT_SEM_TYPE = "fit"; | ||
export declare const FIT_CELL_TYPE = "fit"; | ||
export declare const TAG_FIT = ".fit"; | ||
export declare const CONFIDENCE_INTERVAL_STROKE_COLOR = "rgba(255,191,63,0.4)"; | ||
export declare const CONFIDENCE_INTERVAL_FILL_COLOR = "rgba(255,238,204,0.3)"; | ||
export declare const CURVE_CONFIDENCE_INTERVAL_BOUNDS: { | ||
TOP: string; | ||
BOTTOM: string; | ||
}; | ||
export declare const DROPLINES: string[]; | ||
export declare type FitMarkerType = 'asterisk' | 'circle' | 'cross border' | 'diamond' | 'square' | 'star' | 'triangle bottom' | 'triangle left' | 'triangle right' | 'triangle top'; | ||
export declare type FitLineStyle = 'solid' | 'dotted' | 'dashed' | 'dashdotted'; | ||
export declare type FitErrorModelType = 'constant' | 'proportional'; | ||
export declare type FitErrorModelType = 'constant' | 'proportional' | 'combined'; | ||
/** A point in the fit series. Only x and y are required. Can override some fields defined in IFitSeriesOptions. */ | ||
@@ -153,12 +123,2 @@ export interface IFitPoint { | ||
} | ||
/** Properties that describe {@link FitStatistics}. Useful for editing, initialization, transformations, etc. */ | ||
export declare const statisticsProperties: DG.Property[]; | ||
/** Properties that describe {@link IFitChartOptions}. Useful for editing, initialization, transformations, etc. */ | ||
export declare const fitChartDataProperties: DG.Property[]; | ||
/** Properties that describe {@link IFitSeriesOptions}. Useful for editing, initialization, transformations, etc. */ | ||
export declare const fitSeriesProperties: DG.Property[]; | ||
export declare const FIT_FUNCTION_SIGMOID = "sigmoid"; | ||
export declare const FIT_FUNCTION_LINEAR = "linear"; | ||
export declare const FIT_STATS_RSQUARED = "rSquared"; | ||
export declare const FIT_STATS_AUC = "auc"; | ||
/** Class for the fit functions */ | ||
@@ -168,4 +128,4 @@ export declare abstract class FitFunction { | ||
abstract get parameterNames(): string[]; | ||
abstract y(params: number[], x: number): number; | ||
abstract getInitialParameters(x: number[], y: number[]): number[]; | ||
abstract y(params: Float32Array, x: number): number; | ||
abstract getInitialParameters(x: number[], y: number[]): Float32Array; | ||
} | ||
@@ -176,4 +136,4 @@ /** Class that implements the linear function */ | ||
get parameterNames(): string[]; | ||
y(params: number[], x: number): number; | ||
getInitialParameters(x: number[], y: number[]): number[]; | ||
y(params: Float32Array, x: number): number; | ||
getInitialParameters(x: number[], y: number[]): Float32Array; | ||
} | ||
@@ -184,4 +144,4 @@ /** Class that implements the sigmoid function */ | ||
get parameterNames(): string[]; | ||
y(params: number[], x: number): number; | ||
getInitialParameters(x: number[], y: number[]): number[]; | ||
y(params: Float32Array, x: number): number; | ||
getInitialParameters(x: number[], y: number[]): Float32Array; | ||
} | ||
@@ -192,7 +152,7 @@ /** Class that implements user JS functions */ | ||
private _parameterNames; | ||
constructor(name: string, yFunc: (params: number[], x: number) => number, getInitParamsFunc: (x: number[], y: number[]) => number[], parameterNames: string[]); | ||
constructor(name: string, yFunc: (params: Float32Array, x: number) => number, getInitParamsFunc: (x: number[], y: number[]) => Float32Array, parameterNames: string[]); | ||
get name(): string; | ||
get parameterNames(): string[]; | ||
y(params: number[], x: number): number; | ||
getInitialParameters(x: number[], y: number[]): number[]; | ||
y(params: Float32Array, x: number): number; | ||
getInitialParameters(x: number[], y: number[]): Float32Array; | ||
} | ||
@@ -202,7 +162,12 @@ export declare const fitFunctions: { | ||
}; | ||
export interface IFitOptions { | ||
errorModel: FitErrorModelType; | ||
confidenceLevel: number; | ||
statistics: boolean; | ||
} | ||
/** Properties that describe {@link FitStatistics}. Useful for editing, initialization, transformations, etc. */ | ||
export declare const statisticsProperties: DG.Property[]; | ||
/** Properties that describe {@link IFitChartOptions}. Useful for editing, initialization, transformations, etc. */ | ||
export declare const fitChartDataProperties: DG.Property[]; | ||
/** Properties that describe {@link IFitSeriesOptions}. Useful for editing, initialization, transformations, etc. */ | ||
export declare const fitSeriesProperties: DG.Property[]; | ||
export declare const FIT_FUNCTION_SIGMOID = "sigmoid"; | ||
export declare const FIT_FUNCTION_LINEAR = "linear"; | ||
export declare const FIT_STATS_RSQUARED = "rSquared"; | ||
export declare const FIT_STATS_AUC = "auc"; | ||
export declare function getOrCreateFitFunction(seriesFitFunc: string | IFitFunctionDescription): FitFunction; | ||
@@ -213,11 +178,11 @@ export declare function fitData(data: { | ||
}, fitFunction: FitFunction, errorModel: FitErrorModelType, parameterBounds?: FitParamBounds[]): FitCurve; | ||
export declare function getFittedCurve(curveFunction: (params: number[], x: number) => number, paramValues: number[]): (x: number) => number; | ||
export declare function getFittedCurve(curveFunction: (params: Float32Array, x: number) => number, paramValues: Float32Array): (x: number) => number; | ||
export declare function getCurveConfidenceIntervals(data: { | ||
x: number[]; | ||
y: number[]; | ||
}, paramValues: number[], curveFunction: (params: number[], x: number) => number, confidenceLevel: number | undefined, errorModel: FitErrorModelType): FitConfidenceIntervals; | ||
}, paramValues: Float32Array, curveFunction: (params: Float32Array, x: number) => number, confidenceLevel: number | undefined, errorModel: FitErrorModelType): FitConfidenceIntervals; | ||
export declare function getStatistics(data: { | ||
x: number[]; | ||
y: number[]; | ||
}, paramValues: number[], curveFunction: (params: number[], x: number) => number, statistics?: boolean): FitStatistics; | ||
}, paramValues: Float32Array, curveFunction: (params: Float32Array, x: number) => number, statistics?: boolean): FitStatistics; | ||
export declare function getInvertedFunctions(data: { | ||
@@ -227,4 +192,4 @@ x: number[]; | ||
}, paramValues: number[], confidenceLevel?: number, statistics?: boolean): FitInvertedFunctions | null; | ||
export declare function sigmoid(params: number[], x: number): number; | ||
export declare function linear(params: number[], x: number): number; | ||
export declare function sigmoid(params: Float32Array, x: number): number; | ||
export declare function linear(params: Float32Array, x: number): number; | ||
export declare function getAuc(fittedCurve: (x: number) => number, data: { | ||
@@ -231,0 +196,0 @@ x: number[]; |
@@ -9,6 +9,2 @@ import * as DG from 'datagrok-api/dg'; | ||
export declare function createDefaultChartData(): IFitChartData; | ||
/** Returns existing, or creates new dataframe default chart options. */ | ||
export declare function getDataFrameChartOptions(df: DG.DataFrame): IFitChartData; | ||
/** Returns existing, or creates new column default chart options. */ | ||
export declare function getColumnChartOptions(column: DG.Column): IFitChartData; | ||
/** Returns points arrays from {@link IFitPoint} array */ | ||
@@ -15,0 +11,0 @@ export declare function getPointsArrays(points: IFitPoint[]): { |
/* eslint-disable valid-jsdoc */ | ||
import * as DG from 'datagrok-api/dg'; | ||
import { FitErrorModel, fitData, getCurveConfidenceIntervals, getStatistics, getFittedCurve, getOrCreateFitFunction, fitSeriesProperties, fitChartDataProperties, TAG_FIT, } from './fit-curve'; | ||
import { FitErrorModel, fitData, getCurveConfidenceIntervals, getStatistics, getFittedCurve, getOrCreateFitFunction, fitSeriesProperties, fitChartDataProperties, } from './fit-curve'; | ||
/** Creates new object with the default values specified in {@link properties} */ | ||
@@ -21,14 +21,2 @@ function createFromProperties(properties) { | ||
} | ||
/** Returns existing, or creates new dataframe default chart options. */ | ||
export function getDataFrameChartOptions(df) { | ||
var _a; | ||
var _b; | ||
return JSON.parse((_a = (_b = df.tags)[TAG_FIT]) !== null && _a !== void 0 ? _a : (_b[TAG_FIT] = JSON.stringify(createDefaultChartData()))); | ||
} | ||
/** Returns existing, or creates new column default chart options. */ | ||
export function getColumnChartOptions(column) { | ||
var _a; | ||
var _b; | ||
return JSON.parse((_a = (_b = column.tags)[TAG_FIT]) !== null && _a !== void 0 ? _a : (_b[TAG_FIT] = JSON.stringify(createDefaultChartData()))); | ||
} | ||
/** Returns points arrays from {@link IFitPoint} array */ | ||
@@ -131,3 +119,6 @@ export function getPointsArrays(points) { | ||
export function getCurve(series, fitFunc) { | ||
return getFittedCurve(fitFunc.y, series.parameters); | ||
var _a; | ||
const params = new Float32Array((_a = series.parameters) === null || _a === void 0 ? void 0 : _a.length); | ||
params.set(series.parameters); | ||
return getFittedCurve(fitFunc.y, params); | ||
} | ||
@@ -145,3 +136,3 @@ /** Fits the series data according to the series fitting settings */ | ||
export function getSeriesConfidenceInterval(series, fitFunc, userParamsFlag, logOptions) { | ||
var _a; | ||
var _a, _b; | ||
const data = userParamsFlag ? { x: series.points.map((p) => (logOptions === null || logOptions === void 0 ? void 0 : logOptions.logX) ? Math.log10(p.x) : p.x), | ||
@@ -151,14 +142,23 @@ y: series.points.map((p) => (logOptions === null || logOptions === void 0 ? void 0 : logOptions.logY) ? Math.log10(p.y) : p.y) } : | ||
y: series.points.filter((p) => !p.outlier).map((p) => (logOptions === null || logOptions === void 0 ? void 0 : logOptions.logY) ? Math.log10(p.y) : p.y) }; | ||
if (!series.parameters) | ||
series.parameters = fitSeries(series, fitFunc).parameters; | ||
return getCurveConfidenceIntervals(data, series.parameters, fitFunc.y, 0.05, (_a = series.errorModel) !== null && _a !== void 0 ? _a : FitErrorModel.CONSTANT); | ||
if (!series.parameters) { | ||
const params = fitSeries(series, fitFunc).parameters; | ||
series.parameters = [...params]; | ||
} | ||
const params = new Float32Array((_a = series.parameters) === null || _a === void 0 ? void 0 : _a.length); | ||
params.set(series.parameters); | ||
return getCurveConfidenceIntervals(data, params, fitFunc.y, 0.05, (_b = series.errorModel) !== null && _b !== void 0 ? _b : FitErrorModel.CONSTANT); | ||
} | ||
/** Returns series statistics */ | ||
export function getSeriesStatistics(series, fitFunc, logOptions) { | ||
var _a; | ||
const data = { x: series.points.filter((p) => !p.outlier).map((p) => (logOptions === null || logOptions === void 0 ? void 0 : logOptions.logX) ? Math.log10(p.x) : p.x), | ||
y: series.points.filter((p) => !p.outlier).map((p) => (logOptions === null || logOptions === void 0 ? void 0 : logOptions.logY) ? Math.log10(p.y) : p.y) }; | ||
if (!series.parameters) | ||
series.parameters = fitSeries(series, fitFunc).parameters; | ||
return getStatistics(data, series.parameters, fitFunc.y, true); | ||
if (!series.parameters) { | ||
const params = fitSeries(series, fitFunc).parameters; | ||
series.parameters = [...params]; | ||
} | ||
const params = new Float32Array((_a = series.parameters) === null || _a === void 0 ? void 0 : _a.length); | ||
params.set(series.parameters); | ||
return getStatistics(data, params, fitFunc.y, true); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZml0LWRhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJmaXQtZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxnQ0FBZ0M7QUFDaEMsT0FBTyxLQUFLLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUV0QyxPQUFPLEVBQ0wsYUFBYSxFQUNiLE9BQU8sRUFDUCwyQkFBMkIsRUFDM0IsYUFBYSxFQUViLGNBQWMsRUFJZCxzQkFBc0IsRUFJdEIsbUJBQW1CLEVBQ25CLHNCQUFzQixFQUN0QixPQUFPLEdBSVIsTUFBTSxhQUFhLENBQUM7QUFRckIsaUZBQWlGO0FBQ2pGLFNBQVMsb0JBQW9CLENBQUMsVUFBeUI7SUFDckQsTUFBTSxDQUFDLEdBQVEsRUFBRSxDQUFDO0lBQ2xCLEtBQUssTUFBTSxDQUFDLElBQUksVUFBVSxFQUFFO1FBQzFCLElBQUksQ0FBQyxDQUFDLFlBQVksS0FBSyxJQUFJO1lBQ3pCLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLFlBQVksQ0FBQztLQUM5QjtJQUNELE9BQU8sQ0FBQyxDQUFDO0FBQ1gsQ0FBQztBQUVELHFIQUFxSDtBQUNySCxtREFBbUQ7QUFDbkQsTUFBTSxVQUFVLHNCQUFzQjtJQUNwQyxPQUFPO1FBQ0wsWUFBWSxFQUFFLG9CQUFvQixDQUFDLHNCQUFzQixDQUFDO1FBQzFELGFBQWEsRUFBRSxvQkFBb0IsQ0FBQyxtQkFBbUIsQ0FBQztLQUN6RCxDQUFDO0FBQ0osQ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IHNlcmllcy5wYXJhbWV0ZXJzID0gZml0U2VyaWVzKHNlcmllcywgZml0RnVuYykucGFyYW1ldGVycztcbiAgcmV0dXJuIGdldEN1cnZlQ29uZmlkZW5jZUludGVydmFscyhkYXRhLCBzZXJpZXMucGFyYW1ldGVycywgZml0RnVuYy55LCAwLjA1LFxuICAgIHNlcmllcy5lcnJvck1vZGVsID8/IEZpdEVycm9yTW9kZWwuQ09OU1RBTlQgYXMgRml0RXJyb3JNb2RlbFR5cGUpO1xufVxuXG4vKiogUmV0dXJucyBzZXJpZXMgc3RhdGlzdGljcyAqL1xuZXhwb3J0IGZ1bmN0aW9uIGdldFNlcmllc1N0YXRpc3RpY3Moc2VyaWVzOiBJRml0U2VyaWVzLCBmaXRGdW5jOiBGaXRGdW5jdGlvbiwgbG9nT3B0aW9ucz86IExvZ09wdGlvbnMpOiBGaXRTdGF0aXN0aWNzIHtcbiAgY29uc3QgZGF0YSA9IHt4OiBzZXJpZXMucG9pbnRzLmZpbHRlcigocCkgPT4gIXAub3V0bGllcikubWFwKChwKSA9PiBsb2dPcHRpb25zPy5sb2dYID8gTWF0aC5sb2cxMChwLngpIDogcC54KSxcbiAgICB5OiBzZXJpZXMucG9pbnRzLmZpbHRlcigocCkgPT4gIXAub3V0bGllcikubWFwKChwKSA9PiBsb2dPcHRpb25zPy5sb2dZID8gTWF0aC5sb2cxMChwLnkpIDogcC55KX07XG4gIGlmICghc2VyaWVzLnBhcmFtZXRlcnMpXG4gICAgc2VyaWVzLnBhcmFtZXRlcnMgPSBmaXRTZXJpZXMoc2VyaWVzLCBmaXRGdW5jKS5wYXJhbWV0ZXJzO1xuICByZXR1cm4gZ2V0U3RhdGlzdGljcyhkYXRhLCBzZXJpZXMucGFyYW1ldGVycywgZml0RnVuYy55LCB0cnVlKTtcbn1cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZml0LWRhdGEuanMiLCJzb3VyY2VSb290IjoiIiw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HNlcmllczogSUZpdFNlcmllcywgZml0RnVuYzogRml0RnVuY3Rpb24sIGxvZ09wdGlvbnM/OiBMb2dPcHRpb25zKTogRml0U3RhdGlzdGljcyB7XG4gIGNvbnN0IGRhdGEgPSB7eDogc2VyaWVzLnBvaW50cy5maWx0ZXIoKHApID0+ICFwLm91dGxpZXIpLm1hcCgocCkgPT4gbG9nT3B0aW9ucz8ubG9nWCA/IE1hdGgubG9nMTAocC54KSA6IHAueCksXG4gICAgeTogc2VyaWVzLnBvaW50cy5maWx0ZXIoKHApID0+ICFwLm91dGxpZXIpLm1hcCgocCkgPT4gbG9nT3B0aW9ucz8ubG9nWSA/IE1hdGgubG9nMTAocC55KSA6IHAueSl9O1xuICBpZiAoIXNlcmllcy5wYXJhbWV0ZXJzKSB7XG4gICAgY29uc3QgcGFyYW1zID0gZml0U2VyaWVzKHNlcmllcywgZml0RnVuYykucGFyYW1ldGVycztcbiAgICBzZXJpZXMucGFyYW1ldGVycyA9IFsuLi5wYXJhbXNdO1xuICB9XG4gIGNvbnN0IHBhcmFtcyA9IG5ldyBGbG9hdDMyQXJyYXkoc2VyaWVzLnBhcmFtZXRlcnM/Lmxlbmd0aCEpO1xuICBwYXJhbXMuc2V0KHNlcmllcy5wYXJhbWV0ZXJzISk7XG4gIHJldHVybiBnZXRTdGF0aXN0aWNzKGRhdGEsIHBhcmFtcywgZml0RnVuYy55LCB0cnVlKTtcbn1cbiJdfQ== |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
39
279478
1702
4