df-script 1.9.0 → 2.0.0

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.
Files changed (59) hide show
  1. package/README.md +148 -235
  2. package/dist/api.d.ts +41 -36
  3. package/dist/columnExpressions/ColumnExpr.d.ts +5 -8
  4. package/dist/columnExpressions/functions/all.d.ts +13 -13
  5. package/dist/columnExpressions/functions/coalesce.d.ts +2 -2
  6. package/dist/columnExpressions/functions/duration.d.ts +16 -21
  7. package/dist/columnExpressions/functions/element.d.ts +10 -10
  8. package/dist/columnExpressions/functions/exclude.d.ts +14 -14
  9. package/dist/columnExpressions/functions/implode.d.ts +7 -7
  10. package/dist/columnExpressions/functions/lit.d.ts +9 -9
  11. package/dist/columnExpressions/functions/seqRange.d.ts +69 -0
  12. package/dist/columnExpressions/functions/struct.d.ts +6 -6
  13. package/dist/columnExpressions/functions/when.d.ts +25 -28
  14. package/dist/columnExpressions/index.d.ts +3 -7
  15. package/dist/columnExpressions/mixins/AggregationExpr.d.ts +550 -221
  16. package/dist/columnExpressions/mixins/ArithmeticExpr.d.ts +701 -327
  17. package/dist/columnExpressions/mixins/ArrayExpr.d.ts +508 -212
  18. package/dist/columnExpressions/mixins/ComparisonExpr.d.ts +398 -201
  19. package/dist/columnExpressions/mixins/LogicalExpr.d.ts +59 -29
  20. package/dist/columnExpressions/mixins/ManipulationExpr.d.ts +23 -9
  21. package/dist/columnExpressions/mixins/StandardExpr.d.ts +3234 -0
  22. package/dist/columnExpressions/mixins/StringExpr.d.ts +1163 -524
  23. package/dist/columnExpressions/mixins/StructExpr.d.ts +67 -25
  24. package/dist/columnExpressions/mixins/TemporalExpr.d.ts +518 -212
  25. package/dist/columnExpressions/mixins/WindowExpr.d.ts +270 -102
  26. package/dist/columnExpressions/typeInference.d.ts +3 -3
  27. package/dist/columnExpressions/types.d.ts +5 -0
  28. package/dist/columnExpressions/utils.d.ts +7 -0
  29. package/dist/constants.d.ts +11 -2
  30. package/dist/dataframe/dataframe.d.ts +755 -592
  31. package/dist/dataframe/grouped/grouped.d.ts +24 -6
  32. package/dist/dataframe/grouped.d.ts +70 -0
  33. package/dist/dataframe/index.d.ts +1 -1
  34. package/dist/dataframe/lazy.d.ts +37 -0
  35. package/dist/dataframe/types.d.ts +46 -22
  36. package/dist/dataframe/utils.d.ts +10 -4
  37. package/dist/datatypes/index.d.ts +11 -4
  38. package/dist/expressions.js +1 -0
  39. package/dist/expressions.mjs +1 -0
  40. package/dist/functions/concat.d.ts +68 -16
  41. package/dist/functions/index.d.ts +2 -2
  42. package/dist/functions/readCsv.d.ts +35 -0
  43. package/dist/functions/readJson.d.ts +33 -0
  44. package/dist/index.js +5 -6
  45. package/dist/index.mjs +5 -6
  46. package/dist/types.d.ts +42 -9
  47. package/dist/utils/array.d.ts +17 -14
  48. package/dist/utils/csv.d.ts +4 -1
  49. package/dist/utils/date.d.ts +3 -19
  50. package/dist/utils/duration.d.ts +7 -5
  51. package/dist/utils/json.d.ts +5 -3
  52. package/dist/utils/object.d.ts +0 -18
  53. package/dist/utils/string.d.ts +5 -0
  54. package/dist/utils.js +4 -0
  55. package/dist/utils.mjs +4 -0
  56. package/package.json +29 -8
  57. package/dist/assets/index-DBhGK6Tp.css +0 -1
  58. package/dist/assets/index-DEJEV_tU.js +0 -195
  59. package/dist/index.html +0 -17
@@ -5,7 +5,7 @@ import type { IExpr, ColumnDict, RowRecord, DataFrameSchema } from "../../types"
5
5
  * Represents a DataFrame grouped by key columns, supporting aggregation operations.
6
6
  * @namespace df
7
7
  * @category DataFrame
8
- * @syntax df.groupby(...).{symbol}(...)
8
+ * @syntax df.groupBy(...).{symbol}(...)
9
9
  */
10
10
  export declare class GroupedData<T, K extends keyof T> {
11
11
  private _groups;
@@ -19,8 +19,17 @@ export declare class GroupedData<T, K extends keyof T> {
19
19
  * Converts group keys back into a single distinct DataFrame without aggregations.
20
20
  * @returns DataFrame
21
21
  * @example
22
- * >>> const df = $df.data({ group: ["A", "A", "B"], val: [1, 2, 3] })
23
- * >>> df.groupby("group").to_dataframe()
22
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
23
+ * >>> df
24
+ * shape: (3, 2)
25
+ * ┌───────┬─────┐
26
+ * │ group │ val │
27
+ * ├───────┼─────┤
28
+ * │ A │ 10 │
29
+ * │ A │ 20 │
30
+ * │ B │ 30 │
31
+ * └───────┴─────┘
32
+ * >>> df.groupBy("group").toDataframe()
24
33
  * shape: (2, 1)
25
34
  * ┌───────┐
26
35
  * │ group │
@@ -29,14 +38,23 @@ export declare class GroupedData<T, K extends keyof T> {
29
38
  * │ B │
30
39
  * └───────┘
31
40
  */
32
- to_dataframe<U extends RowRecord = any>(): DataFrame<U>;
41
+ toDataframe<U extends RowRecord = any>(): DataFrame<U>;
33
42
  /**
34
43
  * Aggregates grouped partitions using aggregation column expressions.
35
44
  * @param exprs One or more aggregation column expressions.
36
45
  * @returns DataFrame
37
46
  * @example
38
- * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
39
- * >>> df.groupby("group").agg($df.col("val").sum().alias("sum_val"))
47
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
48
+ * >>> df
49
+ * shape: (3, 2)
50
+ * ┌───────┬─────┐
51
+ * │ group │ val │
52
+ * ├───────┼─────┤
53
+ * │ A │ 10 │
54
+ * │ A │ 20 │
55
+ * │ B │ 30 │
56
+ * └───────┴─────┘
57
+ * >>> df.groupBy("group").agg($df.col("val").sum().alias("sum_val"))
40
58
  * shape: (2, 2)
41
59
  * ┌───────┬─────────┐
42
60
  * │ group │ sum_val │
@@ -0,0 +1,70 @@
1
+ import { DataFrame } from "./dataframe";
2
+ import type { GroupMap } from "./types";
3
+ import type { IExpr, ColumnDict, RowRecord, DataFrameSchema } from "../types";
4
+ /**
5
+ * Represents a DataFrame grouped by key columns, supporting aggregation operations.
6
+ * @namespace df
7
+ * @category DataFrame
8
+ * @syntax df.groupBy(...).{symbol}(...)
9
+ */
10
+ export declare class GroupedData<T, K extends keyof T> {
11
+ private _groups;
12
+ private _keys;
13
+ private _allKeys;
14
+ private _parentColumns;
15
+ private _parentHeight;
16
+ private _parentSchema;
17
+ private _synthesizedColumns?;
18
+ constructor(groups: GroupMap, keys: K[], allKeys: (keyof T)[], parentColumns: ColumnDict, parentHeight: number, parentSchema: DataFrameSchema, synthesizedColumns?: Record<string, any[]>);
19
+ private _materializeKeyColumns;
20
+ private _toStringKeys;
21
+ /**
22
+ * Converts group keys back into a single distinct DataFrame without aggregations.
23
+ * @returns DataFrame
24
+ * @example
25
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
26
+ * >>> df
27
+ * shape: (3, 2)
28
+ * ┌───────┬─────┐
29
+ * │ group │ val │
30
+ * ├───────┼─────┤
31
+ * │ A │ 10 │
32
+ * │ A │ 20 │
33
+ * │ B │ 30 │
34
+ * └───────┴─────┘
35
+ * >>> df.groupBy("group").toDataframe()
36
+ * shape: (2, 1)
37
+ * ┌───────┐
38
+ * │ group │
39
+ * ├───────┤
40
+ * │ A │
41
+ * │ B │
42
+ * └───────┘
43
+ */
44
+ toDataframe<U extends RowRecord = any>(): DataFrame<U>;
45
+ /**
46
+ * Aggregates grouped partitions using aggregation column expressions.
47
+ * @param exprs One or more aggregation column expressions.
48
+ * @returns DataFrame
49
+ * @example
50
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
51
+ * >>> df
52
+ * shape: (3, 2)
53
+ * ┌───────┬─────┐
54
+ * │ group │ val │
55
+ * ├───────┼─────┤
56
+ * │ A │ 10 │
57
+ * │ A │ 20 │
58
+ * │ B │ 30 │
59
+ * └───────┴─────┘
60
+ * >>> df.groupBy("group").agg($df.col("val").sum().alias("sum_val"))
61
+ * shape: (2, 2)
62
+ * ┌───────┬─────────┐
63
+ * │ group │ sum_val │
64
+ * ├───────┼─────────┤
65
+ * │ A │ 30 │
66
+ * │ B │ 30 │
67
+ * └───────┴─────────┘
68
+ */
69
+ agg<U extends RowRecord = any>(...exprs: (IExpr | any)[]): DataFrame<U>;
70
+ }
@@ -1,4 +1,4 @@
1
1
  export * from "./dataframe";
2
2
  export * from "./utils";
3
3
  export * from "./types";
4
- export * from "./grouped/grouped";
4
+ export * from "./grouped";
@@ -0,0 +1,37 @@
1
+ /** @internalfile */
2
+ import type { DataFrame } from "./dataframe";
3
+ import type { ExplainOptions, PlanNode } from "./types";
4
+ import type { RowRecord, DataFrameSchema } from "../types";
5
+ /**
6
+ * Represents a deferred, lazily-evaluated query execution plan.
7
+ * Query plans can be inspected with `.explain()` and materialized into
8
+ * a concrete `DataFrame` with `.collect()`.
9
+ *
10
+ * Uses a dynamic Proxy handler to automatically capture DataFrame transformation
11
+ * methods without manually re-declaring them.
12
+ */
13
+ export declare class LazyFrame<T extends RowRecord = any> {
14
+ readonly _plan: PlanNode[];
15
+ constructor(initialPlan: PlanNode[]);
16
+ /**
17
+ * Executes the query plan DAG and returns a concrete `DataFrame`.
18
+ * Applies query optimizations (predicate pushdown, projection pushdown) before execution.
19
+ * @returns Concrete DataFrame resulting from query plan evaluation.
20
+ */
21
+ collect(): DataFrame<T>;
22
+ /**
23
+ * Resolves and returns the resulting DataFrame schema for the query plan.
24
+ * @returns DataFrameSchema mapping of column names to DataType.
25
+ */
26
+ collectSchema(): DataFrameSchema;
27
+ /**
28
+ * Formats and returns a text representation of the query plan DAG.
29
+ * @param options Explain options.
30
+ * @param options.optimized Whether to show the optimized plan (default `true`).
31
+ * @returns ASCII tree visualization of the query plan.
32
+ */
33
+ explain({ optimized }?: ExplainOptions): string;
34
+ }
35
+ export interface LazyFrame<T extends RowRecord = any> {
36
+ [key: string]: any;
37
+ }
@@ -1,8 +1,6 @@
1
- /** @typefile */
2
- import type { IExpr, AggFn, RowRecord, DataFrameSchema, JSONFormat } from "../types";
3
- import type { DataFrame } from "./dataframe";
1
+ import type { AggFn, RowRecord, DataFrameSchema, JSONFormat, SortArrayOptions, SortOptions } from "../types";
4
2
  import type { JSONParseOptions, SafeJsonReplacerOptions, NDJSONParseOptions } from "../utils";
5
- export type { JSONParseOptions, SafeJsonReplacerOptions, NDJSONParseOptions };
3
+ export type { JSONParseOptions, SafeJsonReplacerOptions, NDJSONParseOptions, SortArrayOptions, SortOptions };
6
4
  export type JoinType = "inner" | "outer" | "left" | "right" | "semi" | "anti" | "cross";
7
5
  export type JoinMaintainOrder = "none" | "left" | "right" | "left_right" | "right_left";
8
6
  export type LimitPosition = "start" | "end";
@@ -11,12 +9,6 @@ export interface LimitOptions {
11
9
  offset?: number;
12
10
  from?: LimitPosition;
13
11
  }
14
- export interface SortOptions<T> {
15
- by: keyof T | (keyof T)[] | IExpr | IExpr[];
16
- descending?: boolean | boolean[];
17
- nullsLast?: boolean;
18
- custom?: Partial<Record<keyof T, (a: any, b: any) => number>>;
19
- }
20
12
  export interface PivotOptions<T> {
21
13
  index: (keyof T) | (keyof T)[];
22
14
  columns: keyof T;
@@ -24,31 +16,63 @@ export interface PivotOptions<T> {
24
16
  agg?: AggFn<any> | string;
25
17
  }
26
18
  export interface JoinOptions<T = any, U extends RowRecord = any> {
27
- other: DataFrame<U>;
28
19
  on?: (keyof T & keyof U) | (keyof T & keyof U)[];
29
20
  leftOn?: (keyof T) | (keyof T)[];
30
21
  rightOn?: (keyof U) | (keyof U)[];
31
22
  how?: JoinType;
32
23
  suffixes?: [string, string];
33
- join_nulls?: boolean;
24
+ joinNulls?: boolean;
34
25
  coalesce?: boolean;
35
- maintain_order?: JoinMaintainOrder | boolean;
26
+ maintainOrder?: JoinMaintainOrder | boolean;
36
27
  }
37
- export type AsofJoinStrategy = "backward" | "forward" | "nearest";
38
- export interface AsofJoinOptions<T = any, U extends RowRecord = any> {
39
- other: DataFrame<U>;
28
+ export type JoinAsofStrategy = "backward" | "forward" | "nearest";
29
+ export interface JoinAsofOptions<T = any, U extends RowRecord = any> {
40
30
  on?: (keyof T & keyof U);
41
31
  leftOn?: (keyof T);
42
32
  rightOn?: (keyof U);
43
33
  by?: (keyof T & keyof U) | (keyof T & keyof U)[];
44
34
  leftBy?: (keyof T) | (keyof T)[];
45
35
  rightBy?: (keyof U) | (keyof U)[];
46
- strategy?: AsofJoinStrategy;
36
+ strategy?: JoinAsofStrategy;
47
37
  tolerance?: number | string;
48
- allow_exact_matches?: boolean;
38
+ allowExactMatches?: boolean;
49
39
  suffixes?: [string, string];
50
40
  coalesce?: boolean;
51
- check_sorted?: boolean;
41
+ checkSorted?: boolean;
42
+ }
43
+ export type JoinWhereStrategy = "inner" | "left" | "right";
44
+ export interface JoinWhereOptions {
45
+ /** Join strategy: "inner", "left", or "right". Default "inner". */
46
+ how?: JoinWhereStrategy;
47
+ /** Column name suffixes [leftSuffix, rightSuffix] to resolve duplicate column names. Default ["", "_right"]. */
48
+ suffixes?: [string, string];
49
+ }
50
+ export type DynamicClosed = "left" | "right" | "both" | "none";
51
+ export type DynamicLabel = "left" | "right" | "datapoint";
52
+ export type DynamicStartBy = "window" | "datapoint" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday";
53
+ export interface GroupByDynamicOptions<T = any> {
54
+ /** Time interval window period (e.g. "1d", "1h", 1000). Defaults to every if not specified. */
55
+ every: string | number;
56
+ /** Time period duration window width. Defaults to every if omitted. */
57
+ period?: string | number;
58
+ /** Offset window start by a duration. Defaults to 0. */
59
+ offset?: string | number;
60
+ /** Truncate the index column values to the window start. Default: true */
61
+ truncate?: boolean;
62
+ /** Include the lower and upper window boundaries (_lower_boundary, _upper_boundary). Default: false */
63
+ includeBoundaries?: boolean;
64
+ /** Which boundary of the window interval is closed ("left", "right", "both", "none"). Default: "left" */
65
+ closed?: DynamicClosed;
66
+ /** Which window boundary to use as the timestamp label ("left", "right", "data_point"). Default: "left" */
67
+ label?: DynamicLabel;
68
+ /** Additional columns to partition / group by before dynamic windowing */
69
+ by?: (keyof T) | (keyof T)[];
70
+ /** Polars alias for by */
71
+ groupBy?: (keyof T) | (keyof T)[];
72
+ /** Strategy to determine window start ("window", "datapoint", or day of week). Default: "window" */
73
+ startBy?: DynamicStartBy;
74
+ /** Verify whether index column is sorted in ascending order. Default: true */
75
+ checkSorted?: boolean;
52
76
  }
53
77
  export interface UnpivotOptions<T> {
54
78
  idVars: (keyof T) | (keyof T)[];
@@ -57,9 +81,9 @@ export interface UnpivotOptions<T> {
57
81
  valueName?: string;
58
82
  }
59
83
  export interface TransposeOptions {
60
- include_header?: boolean;
61
- header_name?: string;
62
- column_names?: string | Iterable<string>;
84
+ includeHeader?: boolean;
85
+ headerName?: string;
86
+ columnNames?: string | Iterable<string>;
63
87
  }
64
88
  export interface ReadJSONOptions extends JSONParseOptions {
65
89
  /**
@@ -1,16 +1,18 @@
1
1
  /** @internalfile */
2
2
  import type { IExpr, ColumnData, ColumnDict, RegisteredDataType, DataFrameSchema, RowRecord } from "../types";
3
- import type { JoinOptions, AsofJoinOptions } from "./types";
3
+ import type { JoinOptions, JoinAsofOptions, JoinWhereOptions } from "./types";
4
4
  import { DataFrame } from "./dataframe";
5
5
  export declare function resolveWindowExpr(expr: IExpr, columns: ColumnDict, height: number): ColumnData;
6
6
  export declare function rowsToColumns(rows: any[]): {
7
7
  columns: ColumnDict;
8
8
  height: number;
9
9
  };
10
- export declare function columnsToRows(columns: ColumnDict, height: number): any[];
11
10
  export declare function getRowFromColumns(columns: ColumnDict, idx: number, keys: string[]): any;
11
+ export declare function columnsToRows(columns: ColumnDict, height: number): any[];
12
12
  export declare function inferColumnType(col: ColumnData): RegisteredDataType;
13
- export declare function gatherColumnsByIndices(columns: ColumnDict, indices: number[]): ColumnDict;
13
+ export declare function gatherColumnByIndices(col: ColumnData, indices: (number | null)[], unmatchedSentinel?: number): ColumnData;
14
+ export declare function gatherColumnsByIndices(columns: ColumnDict, indices: (number | null)[], unmatchedSentinel?: number): ColumnDict;
15
+ export declare function buildGroupMap(columns: ColumnDict, keys: string[], height: number): Map<string, number[]>;
14
16
  /**
15
17
  * Computes a hash string for a row at the given index, using one or more column keys.
16
18
  * Includes a single-key fast path to avoid array allocation and join overhead.
@@ -29,7 +31,11 @@ export declare function alignKeyIndices(leftCols: ColumnDict, rightCols: ColumnD
29
31
  leftIndices: number[];
30
32
  rightIndices: (number | null)[];
31
33
  };
32
- export declare function alignAsofIndices(leftCols: ColumnDict, rightCols: ColumnDict, leftHeight: number, rightHeight: number, leftOnKey: string, rightOnKey: string, leftByKeys: string[], rightByKeys: string[], options?: AsofJoinOptions): {
34
+ export declare function alignAsofIndices(leftCols: ColumnDict, rightCols: ColumnDict, leftHeight: number, rightHeight: number, leftOnKey: string, rightOnKey: string, leftByKeys: string[], rightByKeys: string[], options?: JoinAsofOptions): {
35
+ leftIndices: number[];
36
+ rightIndices: (number | null)[];
37
+ };
38
+ export declare function alignWhereIndices(leftCols: ColumnDict, rightCols: ColumnDict, leftHeight: number, rightHeight: number, predicates: IExpr[], options?: JoinWhereOptions): {
33
39
  leftIndices: number[];
34
40
  rightIndices: (number | null)[];
35
41
  };
@@ -1,6 +1,9 @@
1
- import { DataType as BaseDataType } from "./DataType";
1
+ import { DataType as BaseDataType, NumericDataType, IntegerDataType, SignedIntegerType, UnsignedIntegerType, FloatDataType, TemporalDataType, NestedDataType } from "./DataType";
2
2
  import { DecimalType, BooleanDataType as Boolean, DateDataType as Date, ObjectDataType as Object, ArrayDataType as Array } from "./types";
3
3
  export { BaseDataType as DataType };
4
+ export { Boolean, Date, Object, Array };
5
+ export * from "./types";
6
+ export * from "./DataType";
4
7
  export declare const DataTypeRegistry: {
5
8
  Int8: import("./types").Int8Type;
6
9
  Int16: import("./types").Int16Type;
@@ -24,7 +27,11 @@ export declare const DataTypeRegistry: {
24
27
  Null: import("./types").NullType;
25
28
  Array: <TInner>(inner: import("./types").RegisteredDataType & BaseDataType<TInner>) => import("./types").ArrayType<TInner>;
26
29
  Struct: <TFields extends import("..").RowRecord>(fields: { [K in keyof TFields]: import("./types").RegisteredDataType & BaseDataType<TFields[K]>; }) => import("./types").StructType<TFields>;
30
+ Numeric: typeof NumericDataType;
31
+ Integer: typeof IntegerDataType;
32
+ SignedInteger: typeof SignedIntegerType;
33
+ UnsignedInteger: typeof UnsignedIntegerType;
34
+ Float: typeof FloatDataType;
35
+ Temporal: typeof TemporalDataType;
36
+ Nested: typeof NestedDataType;
27
37
  };
28
- export { Boolean, Date, Object, Array };
29
- export * from "./types";
30
- export * from "./DataType";
@@ -0,0 +1 @@
1
+ "use strict";var An=Object.defineProperty;var as=Object.getOwnPropertyDescriptor;var ls=Object.getOwnPropertyNames;var us=Object.prototype.hasOwnProperty;var cs=(e,t,n)=>t in e?An(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var O=(e,t)=>()=>(e&&(t=e(e=0)),t);var le=(e,t)=>{for(var n in t)An(e,n,{get:t[n],enumerable:!0})},fs=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ls(t))!us.call(e,o)&&o!==n&&An(e,o,{get:()=>t[o],enumerable:!(r=as(t,o))||r.enumerable});return e};var ue=e=>fs(An({},"__esModule",{value:!0}),e);var x=(e,t,n)=>cs(e,typeof t!="symbol"?t+"":t,n);var Tt,ce,fe,Ot,pe,ps,me,gt=O(()=>{"use strict";Tt="*",ce="*literal*",fe="*coalesce*",Ot="*element*",pe="*struct*",ps="*duration*",me="*when*"});var Ar=O(()=>{"use strict"});function C(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Vt(e){if(!C(e))return!1;try{if(!Object.prototype.hasOwnProperty.call(e,Symbol.toStringTag)&&Object.prototype.toString.call(e)!==Ss)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;if(Object.getPrototypeOf(t)!==null||!Object.prototype.hasOwnProperty.call(t,"isPrototypeOf"))return!1;let n=Object.getOwnPropertyDescriptor(t,"toString");if(!n||typeof n.value!="function")return!1;let r=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r!="function"?!1:Function.prototype.toString.call(r)===Gs}catch{return!1}}function Nr(e){if(typeof e!="function")return!1;try{let t=Function.prototype.toString.call(e),n=t.replace(/^(?:\s+|\/\*[\s\S]*?\*\/|\/\/[^\r\n]*)+/,"");if(/^(?:@[\w$.]+(?:\([^)]*\))?\s+)*class\b/.test(n))return!0;let r=Object.getOwnPropertyDescriptor(e,"prototype");if(r&&!r.writable&&t.includes("[native code]")){let o=Dr.length;for(let i=0;i<o;i++)try{return Reflect.construct(e,Dr[i],Xs),!0}catch{}}}catch{return!1}return!1}function lt(e,t,n,r){if(!C(e))return!1;if(n)try{let o=n.call(e);return r!==void 0?o===r:!0}catch{return!1}try{return Object.prototype.hasOwnProperty.call(e,Symbol.toStringTag)?!1:Object.prototype.toString.call(e)===t}catch{return!1}}function M(e){if(!C(e))return!1;if(Or)try{return!Number.isNaN(Or.call(e))}catch{return!1}try{return Object.prototype.hasOwnProperty.call(e,Symbol.toStringTag)?!1:Object.prototype.toString.call(e)===ms&&!Number.isNaN(e.getTime())}catch{return!1}}function K(e){return lt(e,ds,Ms)}function wn(e){return lt(e,ys,ks)}function En(e){return lt(e,gs,Us)}function Mr(e){if(!C(e))return!1;if(_r)try{return _r.call(e,"key"),!0}catch{return!1}return lt(e,bs,void 0)}function kr(e){if(!C(e))return!1;try{if(e instanceof Error)return!0;let t=e;for(;t!==null;){if(!Object.prototype.hasOwnProperty.call(t,Symbol.toStringTag)&&Object.prototype.toString.call(t)===hs)return!0;t=Object.getPrototypeOf(t)}}catch{return!1}return!1}function In(e){if(!C(e))return!1;try{let t=ArrayBuffer.isView(e)?e.buffer:e;return Tn(t)||!Sn(t)?!1:"detached"in t&&t.detached!==void 0?t.detached===!0:(Bs?.call(t,0,0),!1)}catch{return!0}}function Sn(e){return lt(e,ws,Fs)}function Tn(e){return lt(e,Es,js)}function Ur(e){return lt(e,Is,Ps)}function ye(e){return lt(e,xs,ht,"Uint8Array")}function Fr(e){return lt(e,As,ht,"Uint8ClampedArray")}function L(e){if(!C(e))return e;let t=Rr.length;for(let n=0;n<t;n++){let r=Rr[n];if(r)try{return r.call(e)}catch{}}return e}var ms,ds,ys,gs,hs,bs,xs,As,ws,Es,Is,Ss,Ts,wr,Er,Ir,Os,_s,Ds,Rs,Cs,Ns,Ms,ks,Us,de,Sr,Tr,ht,Fs,Bs,js,Ps,Or,_r,Vs,Ls,vs,$s,qs,Gs,Cr,Xs,Js,Dr,Rr,ut=O(()=>{"use strict";ms="[object Date]",ds="[object RegExp]",ys="[object Set]",gs="[object Map]",hs="[object Error]",bs="[object URLSearchParams]",xs="[object Uint8Array]",As="[object Uint8ClampedArray]",ws="[object ArrayBuffer]",Es="[object SharedArrayBuffer]",Is="[object DataView]",Ss="[object Object]",Ts=typeof Date=="function"?Date.prototype:void 0,wr=typeof RegExp=="function"?RegExp.prototype:void 0,Er=typeof Set=="function"?Set.prototype:void 0,Ir=typeof Map=="function"?Map.prototype:void 0,Os=typeof URLSearchParams=="function"?URLSearchParams.prototype:void 0,_s=typeof String=="function"?String.prototype:void 0,Ds=typeof Number=="function"?Number.prototype:void 0,Rs=typeof Boolean=="function"?Boolean.prototype:void 0,Cs=typeof BigInt=="function"?BigInt.prototype:void 0,Ns=typeof Symbol=="function"?Symbol.prototype:void 0,Ms=wr?Object.getOwnPropertyDescriptor(wr,"source")?.get:void 0,ks=Er?Object.getOwnPropertyDescriptor(Er,"size")?.get:void 0,Us=Ir?Object.getOwnPropertyDescriptor(Ir,"size")?.get:void 0,de=typeof ArrayBuffer=="function"?ArrayBuffer.prototype:void 0,Sr=typeof SharedArrayBuffer=="function"?SharedArrayBuffer.prototype:void 0,Tr=typeof DataView=="function"?DataView.prototype:void 0,ht=typeof Uint8Array=="function"?Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),Symbol.toStringTag)?.get:void 0,Fs=de?Object.getOwnPropertyDescriptor(de,"byteLength")?.get:void 0,Bs=de?.slice,js=Sr?Object.getOwnPropertyDescriptor(Sr,"byteLength")?.get:void 0,Ps=Tr?Object.getOwnPropertyDescriptor(Tr,"byteLength")?.get:void 0,Or=Ts?.valueOf,_r=Os?.has,Vs=_s?.valueOf,Ls=Ds?.valueOf,vs=Rs?.valueOf,$s=Cs?.valueOf,qs=Ns?.valueOf,Gs=Function.prototype.toString.call(Object);Cr=function(){},Xs=new Proxy(Cr,{construct(){return this}}),Js=typeof ArrayBuffer=="function"?new ArrayBuffer(0):void 0,Dr=[[],[Cr],[Js],[{}]];Rr=[Ls,Vs,vs,$s,qs]});var Br,bt,ge,he,On,xt,nn,it,tt,_n,Lt,Dn,en,rn,be,xe,el,on,sn,Ws,jr,Pr,Vr,Lr,vr,$r,qr,Gr,Xr,Jr,Wr,Kr,zr,Yr,Zr,Hr,Qr,to,Ae,no,eo,we,Ee,ro,st=O(()=>{"use strict";Br="\\r\\n|\\n|\\r",bt=new TextEncoder,ge=new TextDecoder("utf-8"),he=new TextDecoder("utf-8",{fatal:!0}),On=6048e5,xt=864e5,nn=36e5,it=6e4,tt=1e3,_n=1,Lt=.001,Dn=1e-6,en=1e3,rn=1e6,be=1000n,xe=1000000n,el=Object.freeze({sunday:0,monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6}),on="\0",sn="",Ws=4294967295,jr=-9223372036854775808n,Pr=9223372036854775807n,Vr=0n,Lr=18446744073709551615n,vr=-2147483648,$r=2147483647,qr=0,Gr=Ws,Xr=-32768,Jr=32767,Wr=0,Kr=65535,zr=-128,Yr=127,Zr=0,Hr=255,Qr=31,to=127,Ae=55296,no=56319,eo=56320,we=57343,Ee=Object.freeze({9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r"}),ro=Object.freeze({b:"\b",0:"\0",...Object.fromEntries(Object.entries(Ee).map(([e,t])=>[t.slice(1),String.fromCharCode(Number(e))]))})});function _(e,t){return typeof e!="number"?!1:Number.isNaN(e)?t?.allowNaN??t?.allowNonFiniteNumbers??!1:Number.isFinite(e)?!0:t?.allowNonFiniteNumbers??!1}function oo(e){for(let t=1;t<e.length;t++)if(e[t].length!==3)return!1;return!0}function uo(e,t){if(Ks.test(e))return null;let n=e.trim();if(n==="")return null;n.startsWith("(")&&n.endsWith(")")&&(n="-"+n.slice(1,-1).trim());let r=n[n.length-1];(r==="-"||r==="+")&&n.length>1&&(n=r+n.slice(0,-1).trim()),t||(n=n.replace(zs,""));let o=n.includes("."),i=n.includes(",");if(o&&i){let a=n.lastIndexOf("."),s=n.lastIndexOf(","),l=s>a,c=l?".":",",u=l?s:a,f=n.slice(0,u).split(c);return f.length>1&&!oo(f)||f[0].replace(io,"").length>3?null:l?n.replace(so,"").replace(Rn,"."):n.replace(Rn,"")}if(i||o){let a=i?",":".",s=n.split(a);if(s.length>2||a===","&&s.length===2&&s[1].length===3){let l=s[0].replace(io,"").length;if(l===0){if(a===","||s.length>2)return null}else return l>3?null:oo(s)?n.replace(i?Rn:so,""):null}if(i)return n.replace(Rn,".")}return n}function B(e,{allowNonFiniteNumbers:t=!1,strictNumericString:n=!1,floatScientific:r=!0}={}){if(e==null||typeof e=="symbol")return null;switch(e=L(e),typeof e){case"number":return _(e,{allowNonFiniteNumbers:t})?e:null;case"boolean":return e?1:0;case"bigint":{let o=Number(e);return _(o,{allowNonFiniteNumbers:t})?o:null}case"object":{if(M(e)){let o=e.getTime();return _(o,{allowNonFiniteNumbers:t})?o:null}return null}case"string":{let o=uo(e,n);if(o===null)return null;if(t){let s=o.toLowerCase();if(s==="nan"||s==="-nan"||s==="+nan")return NaN;if(s==="infinity"||s==="+infinity")return 1/0;if(s==="-infinity")return-1/0}if(lo.test(o)&&!r||!ao.test(o))return null;let a=Number(o);return _(a,{allowNonFiniteNumbers:t})?a:null}default:return null}}function Ie(e,{floatPrecision:t="Float64",allowNonFiniteNumbers:n=!0,floatScientific:r=!0,strictNumericString:o=!1}={}){let i=B(e,{allowNonFiniteNumbers:n,floatScientific:r,strictNumericString:o});return i===null||(t==="Float32"&&(i=Math.fround(i)),!_(i,{allowNonFiniteNumbers:n}))?null:i}function Cn(e,t,n){if(!e)return null;let r=typeof e=="string"?t[e]:e;return r&&typeof r.min===n&&typeof r.max===n?r:null}function nt(e,{range:t="Int32"}={}){if(!_(e)||!Number.isInteger(e))return!1;let n=Cn(t,co,"number");return n!=null&&e>=n.min&&e<=n.max}function W(e,{range:t="Int32",coerce:n="truncate"}={}){let r=B(e);if(r===null)return null;switch(n){case"round":r=Math.round(r);break;case"floor":r=Math.floor(r);break;case"ceil":r=Math.ceil(r);break;case"truncate":r=Math.trunc(r);break}let o=Cn(t,co,"number");return o!=null?at(r,{min:o.min,max:o.max}):null}function vt(e,{range:t="Int64"}={}){let n=L(e);if(typeof n!="bigint")return!1;let r=Cn(t,fo,"bigint");return r!=null&&n>=r.min&&n<=r.max}function $t(e,{range:t="Int64",truncate:n=!1}={}){if(e==null||typeof e=="symbol")return null;try{e=L(e)}catch{return null}let r=null;if(typeof e=="bigint")r=e;else if(typeof e=="string"){let i=uo(e,!1);if(i===null||!ao.test(i))return null;if(lo.test(i)){let a=i.search(/[eE]/),s=i.slice(0,a),l=i.slice(a+1),c=parseInt(l,10);if(Number.isNaN(c)||c>1e5||c<-1e5)return null;let u=s.startsWith("-");(u||s.startsWith("+"))&&(s=s.slice(1));let f=s.indexOf("."),p=s,m=0;f!==-1&&(m=s.length-f-1,p=s.slice(0,f)+s.slice(f+1)),p=p.replace(/^0+/,"")||"0";try{let d=BigInt(p);u&&(d=-d);let y=c-m;if(y>=0)r=d*10n**BigInt(y);else{let b=10n**BigInt(-y),h=d%b;if(!n&&h!==0n)return null;r=d/b}}catch{return null}}else{let a=i.indexOf(".");if(a!==-1){if(!n&&/[^0]/.test(i.slice(a+1)))return null;i=i.slice(0,a)}try{r=BigInt(i)}catch{return null}}}else{let i=B(e);if(i===null||!n&&!Number.isInteger(i))return null;r=BigInt(Math.trunc(i))}let o=Cn(t,fo,"bigint");return!o||r<o.min||r>o.max?null:r}function Ys(e,t){let n=e-t;if(n<0||t<0)return null;if(n>15)return Number.K;let r=at(t,{min:0,max:16}),o=Math.pow(10,n)-Math.pow(10,-r);return o>0?o:null}function Se(e,t){if(!Number.isFinite(e))return e;let n=e.toString();if(n.includes("e")){let r=Math.pow(10,t);return Math.round(e*r)/r}return+(Math.round(+(n+"e"+t))+"e"+-t)}function Nn(e,{precision:t,scale:n}={}){let r=B(e);if(r===null)return null;let o=r;if(n!==void 0&&(o=Se(o,n)),t!==void 0){let a=Ys(t,n??0);a!==null&&(o=at(o,{min:-a,max:a}))}return o}function at(e,t){if(!t)return e;let{min:n=null,max:r=null,safe:o=!0}=t;if(n!==null&&r!==null&&n>r)return n;let i=e;if(o&&typeof i=="number"){if(Number.isNaN(i))return n!==null?n:r!==null?r:e;if(i===1/0)return r!==null?r:e;if(i===-1/0)return n!==null?n:e}return n!==null&&i<n?n:r!==null&&i>r?r:i}function po(e){let t=e|0;return function(){let n=t=t+1831565813|0;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}var ao,Ks,zs,lo,io,so,Rn,co,fo,_t=O(()=>{"use strict";ut();st();ao=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,Ks=/0[xobXOB]/,zs=/[\s_\u200B-\u200D\uFEFF]/g,lo=/[eE]/;io=/^[+-]/,so=/\./g,Rn=/,/g;co={Int8:{min:zr,max:Yr},Int16:{min:Xr,max:Jr},Int32:{min:vr,max:$r},UInt8:{min:Zr,max:Hr},UInt16:{min:Wr,max:Kr},UInt32:{min:qr,max:Gr}};fo={Int64:{min:jr,max:Pr},UInt64:{min:Vr,max:Lr}}});function et(e){if(!ArrayBuffer.isView(e))return!1;if(ht)return ht.call(e)!==void 0;let t=Object.prototype.toString.call(e);return t!=="[object DataView]"&&t.endsWith("Array]")}function R(e){return Array.isArray(e)||et(e)}function Dt(e){return e==null?[]:Array.isArray(e)?[...e]:et(e)?Array.from(e):[e]}function qt(e,t,n){let r=e.length,o=t<-r||t>=r;if(o&&!n)throw new z(`Index ${t} is out of bounds for array of length ${r}`);return o?null:e.at(t)??null}function Zs(e){if(typeof e=="function"){let t=Nr(e);return{check:t?n=>n instanceof e:n=>!!e(n),coerce:n=>{if(t)return n instanceof e?n:null;let r=e(n);return typeof r=="boolean"?r?n:null:r}}}switch(e){case"string":return{check:t=>typeof t=="string",coerce:t=>String(t)};case"number":return{check:_,coerce:t=>B(t)??NaN};case"boolean":return{check:t=>typeof t=="boolean",coerce:Boolean};case"bigint":return{check:vt,coerce:t=>$t(t)};case"date":return{check:M,coerce:t=>P(t)};case"object":return{check:C,coerce:t=>C(t)?t:null};case"plainObject":return{check:Vt,coerce:t=>Vt(t)?t:null};case"null":return{check:t=>t===null,coerce:()=>null};case"undefined":return{check:t=>t===void 0,coerce:()=>{}};case"nullish":return{check:t=>t==null,coerce:()=>null};default:return{check:()=>!0,coerce:t=>t}}}function v(e,t,{mode:n="every",allowNulls:r=!1,allowEmpty:o=!0}={}){if(!R(e))return!1;let i=e,a=i.length;if(a===0)return o?n==="every":!1;let{check:s}=Zs(t);if(n==="every"){for(let l=0;l<a;l++){let c=i[l];if(!(r&&c==null)&&!s(c))return!1}return!0}for(let l=0;l<a;l++){let c=i[l];if(r&&c==null||s(c))return!0}return!1}function Hs(e,t,{descending:n=!1,nullsLast:r=!0,customComp:o}={}){let a=!!(Array.isArray(n)?n[0]:n)?-1:1;if(typeof o=="function")return o(e,t)*a;if(Object.is(e,t)||e==null&&t==null)return 0;if(e==null||t==null)return(e==null?1:-1)*(r?1:-1);let s=M(e),l=M(t);if(s!==l)return s?-1:1;if(s&&l)return(e.getTime()<t.getTime()?-1:e.getTime()>t.getTime()?1:0)*a;let c=typeof e,u=typeof t,f=c==="number"||c==="bigint",p=u==="number"||u==="bigint",m=Number.isNaN(e),d=Number.isNaN(t);return m&&d?0:m||d?(m?1:-1)*(r?1:-1):f&&p?(e<t?-1:e>t?1:0)*a:c!==u?c<u?-1:1:c==="string"?e.localeCompare(t)*a:(e<t?-1:e>t?1:0)*a}function an(e,{descending:t=!1,nullsLast:n=!0,customComp:r}={}){if(!R(e))return[];let o=e,i=o.length;if(i<=1)return et(e)?Array.from(o):i===0?[]:[o[0]];let a=!!(Array.isArray(t)?t[0]:t),s=e instanceof Float32Array||e instanceof Float64Array;if(et(e)&&!r&&n&&(!s||!a)){let c=o.slice().sort();return a&&c.reverse(),Array.from(c)}let l=new Array(i);for(let c=0;c<i;c++)l[c]=o[c];return l.sort((c,u)=>Hs(c,u,{descending:t,nullsLast:n,customComp:r}))}function D(e){if(!R(e))return mo;let t=e.length;if(t===0)return mo;let n=null,r=null,o=null,i=null,a=0,s=0,l=0,c=0,u=0,f=1,p=0,m=0;for(let b=0;b<t;b++){let h=e[b];if(h==null){s++;continue}if(typeof h=="number"&&Number.isNaN(h)){l++,s++;continue}(n==null||h<n)&&(n=h,o=b),(r==null||h>r)&&(r=h,i=b);let w=B(h);if(w!==null){let A=c+w;Math.abs(c)>=Math.abs(w)?u+=c-A+w:u+=w-A+c,c=A,f*=w,a++;let T=w-p;p+=T/a;let I=w-p;m+=T*I}}let d=a>1?m/(a-1):0,y=l>0;return{sum:a>0?c+u:null,product:a>0?f:null,count:a,min:n,max:r,nanMin:y?NaN:n,nanMax:y?NaN:r,minIdx:o,maxIdx:i,mean:a>0?(c+u)/a:null,variance:d,std:Math.sqrt(d),nullCount:s,nanCount:l,len:t,hasNulls:s>0,isNumeric:a>0&&a===t-s}}function At(e,{strict:t=!1,keySelector:n}={}){let r=Array.from(e),o=new Map;if(t){let a=n??V,s=new Map,l=r.length;for(let u=0;u<l;u++){let f=r[u],p=a(f),m=s.get(p);m===void 0?s.set(p,{val:f,count:1}):m.count++}let c=[];for(let u of s.values())c.push(u.val);for(let u=0;u<l;u++){let f=r[u],p=a(f),m=s.get(p);o.set(f,m.count)}return{values:c,count:c.length,frequencies:o}}let i=r.length;for(let a=0;a<i;a++){let s=r[a];o.set(s,(o.get(s)??0)+1)}return{values:Array.from(o.keys()),count:o.size,frequencies:o}}function Mn(e,{step:t=1,offsetStart:n=0,offsetEnd:r,maxItemsGathered:o,nullOnOob:i=!0}={}){if(e==null)return null;if(o!==void 0&&o<=0)return[];if(t===0)throw new k("Step size step cannot be zero");let a=e.length;if(a===0?n!==0:n>=a||n<-a){if(!i)throw new z(`Start offset ${n} is out of bounds for array of length ${a}`);return null}let l=n<0?a+n:n,c=r!==void 0?r<0?a+r:r:t>0?a:-1,u=[];if(t>0)for(let f=l;f<c&&f<a&&!(f>=0&&(u.push(e[f]),o!==void 0&&u.length>=o));f+=t);else for(let f=l;f>c&&f>=0&&!(f<a&&(u.push(e[f]),o!==void 0&&u.length>=o));f+=t);return u}function kn(e,t=",",{ignoreNulls:n=!1,nullValue:r="",prefix:o="",suffix:i="",limit:a,truncationMarker:s="...",valueFormatter:l}={}){let c=e.length,u=[],f=at(a??c,{min:0}),p=!1;for(let m=0;m<c;m++){if(u.length>=f){p=!0;break}let d=e[m];d!=null?u.push(l?l(d,m):String(d)):n||u.push(r)}return o+u.join(t)+(p?s:"")+i}function go(e,t,n={}){let r=e.length,{mode:o="cumulative",step:i=1,coerce:a=y=>y,condition:s,reverse:l=!1,startIndex:c=l?r-1:0,endIndex:u=l?-1:r}=n,f=l?-1:1,p=c,m=u,d=(y,b)=>{(!s||s(e[y],y,e))&&(e[y]=a(b))};if(o==="constant"){let y=a(t);for(let b=p;l?b>m:b<m;b+=f)d(b,y)}else if(o==="independent")if(typeof i=="function"){let y=0;for(let b=p;l?b>m:b<m;b+=f)d(b,i({index:y,initialValue:t,originalValue:e[b],absoluteIndex:b,targetArray:e})),y++}else for(let y=p;l?y>m:y<m;y+=f)d(y,t+y*i);else{let y=t,b=!0,h=0;for(let w=p;l?w>m:w<m;w+=f)b?(d(w,y),b=!1):(typeof i=="function"?y=i({prev:y,index:h,originalValue:e[w],absoluteIndex:w,targetArray:e}):y=y+i,d(w,y)),h++}}function Qs(e){let t=e.length,n=0,r=new Float64Array(t);for(let i=0;i<t;i++){let a=e[i],s=B(a,{allowNonFiniteNumbers:!0});s!==null&&_(s,{allowNonFiniteNumbers:!0,allowNaN:!1})&&(r[n++]=s)}if(n===0)return null;let o=r.subarray(0,n);return o.sort(),o}function Rt(e,t){if(t<0||t>1)return null;let n=Qs(e);if(!n)return null;let r=n.length,o=t*(r-1),i=Math.floor(o),a=Math.ceil(o);return i===a?n[i]:n[i]+(o-i)*(n[a]-n[i])}function Un(e){if(!R(e)||e.length===0)return null;let t=new Map,n=e.length,r=0,o=[];for(let i=0;i<n;i++){let a=e[i];if(a==null||typeof a=="number"&&!_(a,{allowNonFiniteNumbers:!0,allowNaN:!1}))continue;let s=(t.get(a)??0)+1;t.set(a,s),s>r?(r=s,o=[a]):s===r&&o.push(a)}return o.length===0?null:an(o)}function ho(e,t){let n=e.length;if(n===0)return[];let r=Math.trunc(t);if(isNaN(r)||r===0)return Dt(e);let o=Math.abs(r);if(o>=n)return new Array(n).fill(null);let i=new Array(n);if(r>0){i.fill(null,0,r);for(let a=r;a<n;a++){let s=e[a-r];i[a]=s??null}}else{let a=n-o;for(let s=0;s<a;s++){let l=e[s+o];i[s]=l??null}i.fill(null,a,n)}return i}function bo(e){let t=e.length,n=new Float64Array(t),r=new Float64Array(t),o=0;for(let i=0;i<t;i++){let a=e[i];if(!a)continue;let s=B(a[0]),l=B(a[1]);s===null||l===null||(n[o]=s,r[o]=l,o++)}return{xArr:n,yArr:r,count:o}}function xo(e,t,n){if(n<2)return null;let r=0,o=0,i=0,a=0,s=0;for(let f=0;f<n;f++){let p=e[f],m=t[f],d=p-r;r+=d/(f+1);let y=p-r,b=m-o;o+=b/(f+1);let h=m-o;s+=d*h,i+=d*y,a+=b*h}let l=s/(n-1);if(i===0||a===0)return{covariance:l,correlation:null};let c=Math.sqrt(i*a);if(c===0||Number.isNaN(c))return{covariance:l,correlation:null};let u=at(s/c,{min:-1,max:1});return{covariance:l,correlation:u}}function Te(e){let{xArr:t,yArr:n,count:r}=bo(e);return r<2?{covariance:null,correlation:null}:xo(t,n,r)??{covariance:null,correlation:null}}function yo(e){let t=e.length,n=new Int32Array(t);for(let i=0;i<t;i++)n[i]=i;n.sort((i,a)=>e[i]-e[a]);let r=new Float64Array(t),o=0;for(;o<t;){let i=o+1;for(;i<t&&e[n[i]]===e[n[o]];)i++;let a=(o+1+i)/2;for(let s=o;s<i;s++)r[n[s]]=a;o=i}return r}function ta(e,t,n){let r=xo(e,t,n);return r?r.correlation:null}function Ao(e){let{xArr:t,yArr:n,count:r}=bo(e);if(r<2)return null;let o=yo(t.subarray(0,r)),i=yo(n.subarray(0,r));return ta(o,i,r)}function wo(e){let t=e.length,n=0,r=0;for(let o=0;o<t;o++){let i=e[o];if(!i)continue;let a=B(i[0]),s=B(i[1]);a===null||s===null||(n+=a*s,r++)}return r>0?n:null}function Eo(e){let t=e.length,n=0,r=0,o=0;for(let i=0;i<t;i++){let a=e[i];if(!a)continue;let s=B(a[0]),l=B(a[1]);s===null||l===null||(n+=s*l,r+=l,o++)}return o===0||Math.abs(r)<1e-12?null:n/r}function Io(e){if(!R(e))return null;let{mean:t,count:n}=D(e);if(n<2||t===null)return null;let r=0,o=0,i=0,a=e.length;for(let s=0;s<a;s++){let l=B(e[s]);if(l===null)continue;let c=l-t,u=c*c;r+=u,o+=u*c,i+=u*u}return r<=0?null:{count:n,mean:t,m2Sum:r,m3Sum:o,m4Sum:i}}function So(e,t={}){let n=Io(e);if(!n)return null;let{count:r,m2Sum:o,m3Sum:i}=n,a=o/r,l=i/r/Math.pow(a,1.5);if(t?.bias??!0)return _(l)?l:null;if(r<3)return null;let u=Math.sqrt(r*(r-1))/(r-2)*l;return _(u)?u:null}function To(e,t={}){let n=Io(e);if(!n)return null;let{count:r,m2Sum:o,m4Sum:i}=n,a=o/r,l=i/r/(a*a),c=l-3,u=t?.fisher??!0;if(t?.bias??!0){let d=u?c:l;return _(d)?d:null}if(r<4)return null;let p=(r-1)/((r-2)*(r-3))*((r+1)*c+6),m=u?p:p+3;return _(m)?m:null}function Oo(e,t={}){if(!e||e.length===0)return null;let{base:n=Math.E,normalize:r=!0}=t;if(n<=0||n===1)return null;let o=e.length,i=Math.log(n);if(r){let a=new Map,s=0;for(let c=0;c<o;c++){let u=e[c];if(u==null||Number.isNaN(u))continue;let f=V(u);a.set(f,(a.get(f)||0)+1),s++}if(s===0)return null;let l=0;for(let c of a.values()){let u=c/s;u>0&&(l-=u*(Math.log(u)/i))}return _(l)?((l<0||Object.is(l,-0))&&(l=0),l):null}else{let a=[],s=0;for(let u=0;u<o;u++){let f=e[u];if(f==null||Number.isNaN(f))continue;let p=Number(f);if(!_(p)||p<0)return null;p>0&&(a.push(p),s+=p)}if(a.length===0||s<=0)return null;let l=0,c=a.length;for(let u=0;u<c;u++){let f=a[u]/s;f>0&&(l-=f*(Math.log(f)/i))}return _(l)?((l<0||Object.is(l,-0))&&(l=0),l):null}}function Fn(e,t){if(!e||e.length===0)return null;let n=null,r=e.length;for(let o=0;o<r;o++){let i=$t(e[o],{range:"Int64"});i!==null&&(n=n===null?i:t(n,i))}return n===null?null:n>=Number.At&&n<=Number.K?Number(n):n}function Oe(e,t){if(!e||e.length===0)return null;let n=e.length,r=new Array(n),o=new Array(n);for(let a=0;a<n;a++){let s=e[a];r[a]=s?.[0],o[a]=s?.[1]}let i=D(o)[t];return i!==null?r[i]:null}function Bn(e,t,n={}){if(!e||e.length===0)return[];let r=e.length,{nullify:o=!1}=n,i=R(t);if(!i&&!t)return o?new Array(r).fill(null):[];let a=[];for(let s=0;s<r;s++)(i?t[s]:t)?a.push(e[s]):o&&a.push(null);return a}var mo,ln=O(()=>{"use strict";ut();_t();_e();Gt();$();mo={sum:null,product:null,count:0,min:null,max:null,nanMin:null,nanMax:null,minIdx:null,maxIdx:null,mean:null,variance:0,std:0,nullCount:0,nanCount:0,len:0,hasNulls:!1,isNumeric:!1}});function Do(e,t={}){let n=t?.trim?rt(e)??"":e,r=n.length;if(r<2)return!1;let o=n[0],i=n[r-1];return o==="{"&&i==="}"||o==="["&&i==="]"}function Re(e,t={}){let n="fallback"in t?t.fallback:e;if(typeof e!="string")return n;let{format:r="json",allowPrimitives:o=!1,trimBeforeParse:i=!1,reviver:a,ndjson:s={},guard:l,onError:c}=t,u=i?e.trim():e;try{let f;if(r==="ndjson"){let{skipInvalidLines:p=!1,maxLines:m,skipLines:d=0}=s,y=[],b=new RegExp(Br,"g"),h=0,w=0;for(;m===void 0||y.length<m;){let T=b.exec(u),I=(T?u.substring(h,T.index):u.substring(h)).trim();if(T&&(h=b.lastIndex),I===""){if(!T)break;continue}if(w++,w<=d){if(!T)break;continue}if(!o&&!Do(I)){if(!p)throw new k("NDJSON line is not wrapped and primitives are disallowed");if(!T)break;continue}try{y.push(JSON.parse(I,a))}catch(F){if(!p)throw F}if(!T)break}let A=w>d;if(y.length===0&&A&&m!==0)throw new un("No valid NDJSON lines processed");f=y}else{if(!o&&!Do(u,{trim:!i}))throw new k("JSON string is not wrapped and primitives are disallowed");f=JSON.parse(u,a)}if(l&&!l(f))throw new k("Parsed value failed guard validation");return f}catch(f){try{c?.(f)}catch{}return n}}function Ce(e={}){let t=e.bigintStrategy??"string",n=e.handleCircular?new WeakSet:null,r=Array.isArray(e.replacer)?e.replacer.map(String):null;return function(i,a){let s=a;if(typeof e.replacer=="function")s=e.replacer.call(this,i,a);else if(r&&i!==""&&!Array.isArray(this)&&!r.includes(i))return;if(s===void 0)return;let l=s===a&&this!=null?this[i]:s;if(typeof e.onCustom=="function"){let f=e.onCustom.call(this,i,l);if(f!==l||f===void 0&&l!==void 0)return f}let c=s!==null&&typeof s=="object"||typeof s=="bigint"?s:l,u=C(c)?L(c):c;if(u!==null&&typeof u!="object"&&typeof u!="bigint")return s;if(n&&(C(u)||Array.isArray(u))){if(i===""&&(n=new WeakSet),n.has(u))return e.onCircular?e.onCircular.call(this,i,u):"[Circular]";n.add(u)}return typeof u=="bigint"?e.voidBigIntReplacement?s:e.onBigInt?e.onBigInt(u):t==="number"&&vt(u,{range:{min:BigInt(Number.At),max:BigInt(Number.K)}})?Number(u):u.toString():et(u)?e.voidTypedArrayReplacement?s:e.onTypedArray?e.onTypedArray(u):Array.from(u):wn(u)?e.voidSetReplacement?s:e.onSet?e.onSet(u):Array.from(u):En(u)?e.voidMapReplacement?s:e.onMap?e.onMap(u):Array.from(u.entries()):K(u)?e.voidRegExpReplacement?s:e.onRegExp?e.onRegExp(u):u.toString():M(u)?e.voidDateReplacement?s:e.onDate?e.onDate(u):e.formatDate?e.formatDate(u):u.toISOString():kr(u)?e.onError?e.onError(u):{name:u.name,message:u.message,stack:u.stack}:Mr(u)?e.onURLSearchParams?e.onURLSearchParams(u):u.toString():s}}function na(e){let t=e.trim().replace(/^\$/,"");if(!t)return[];let n=[],r=/\.\.\[\s*(?:'((?:\\.|[^'])*)'|"((?:\\.|[^"])*)"|(\*))\s*\]|\.\.([^\.\[]+)|\.([\w$-]+|\*)|\[\s*(?:'((?:\\.|[^'])*)'|"((?:\\.|[^"])*)"|(\*)|(-?\d*(?::-?\d*){0,2}))\s*\]/g,o,i=0;for(;(o=r.exec(t))!==null;){if(o.index!==i)return null;i=r.lastIndex;let[,a,s,l,c,u,f,p,m,d]=o,y=a??s,b=f??p;if(y!==void 0)n.push({type:"rec",key:Ro(y)});else if(l!==void 0)n.push({type:"rec",key:De});else if(c!==void 0)n.push({type:"rec",key:c});else if(u!==void 0)n.push(u===De?{type:"wildcard"}:{type:"prop",key:u});else if(b!==void 0)n.push({type:"prop",key:Ro(b)});else if(m!==void 0)n.push({type:"wildcard"});else if(d!==void 0)if(d.includes(":")){let[h,w,A]=d.split(":");n.push({type:"slice",start:W(h)??void 0,end:W(w)??void 0,step:W(A)??1})}else{let h=W(d);if(h===null)return null;n.push({type:"idx",idx:h})}}return i===t.length?n:null}function No(e,t,n,r=new Set){if(e==null||!Co(t.key)||typeof e!="object"||r.has(e))return;r.add(e);let o=Array.isArray(e);if(!o&&!C(e))return;t.key===De?Mo(e,{type:"wildcard"},n):!o&&Object.prototype.hasOwnProperty.call(e,t.key)&&n.push(e[t.key]);let i=o?e:Object.values(e);for(let a=0;a<i.length;a++)No(i[a],t,n,r)}function Mo(e,t,n){if(e!=null)switch(t.type){case"prop":C(e)&&Co(t.key)&&Object.prototype.hasOwnProperty.call(e,t.key)&&n.push(e[t.key]);break;case"idx":{if(!Array.isArray(e))break;let r=t.idx<0?e.length+t.idx:t.idx;r>=0&&r<e.length&&n.push(e[r]);break}case"slice":{if(!Array.isArray(e)||t.step===0)break;let r=t.step??1,o=t.start??(r>0?0:e.length-1),i=Mn(e,{step:r,offsetStart:o,offsetEnd:t.end,nullOnOob:!0});if(i)for(let a=0;a<i.length;a++)n.push(i[a]);break}case"wildcard":{let r=Array.isArray(e)?e:C(e)?Object.values(e):null;if(r)for(let o=0;o<r.length;o++)n.push(r[o]);break}case"rec":No(e,t,n);break}}function ko(e,t){if(e==null||Uo(t))return null;let n=e;if(typeof e=="string"){let a=e.trim();if(a==="")return null;let s=Re(a,{allowPrimitives:!0,fallback:_o});if(s===_o)throw new k(`Invalid JSON string encountered in jsonPathMatch: "${e}"`);n=s}let r=na(t);if(r===null)return null;let o=[n];for(let a=0;a<r.length;a++){if(o.length===0)return null;let s=[];for(let l=0;l<o.length;l++)Mo(o[l],r[a],s);o=s}if(o.length===0||o[0]==null)return null;let i=o[0];if(C(i)||Array.isArray(i))try{return JSON.stringify(i,Ce({handleCircular:!0}))}catch{return null}return String(i)}var _o,De,Ro,Co,Ne=O(()=>{"use strict";ln();ut();_t();Gt();$();st();_o=Symbol("invalid");De="*",Ro=e=>e.replace(/\\(.)/g,(t,n)=>ro[n]??n),Co=e=>e!==void 0&&e!=="__proto__"&&e!=="constructor"&&e!=="prototype"});function ea(e){return!C(e)||In(e)?!1:ArrayBuffer.isView(e)?ye(e)||Fr(e)||Ur(e):Sn(e)||Tn(e)}function Bo(e,t){if(e==null)return!1;try{if(ea(e))return!0;if(t?.strict)return!1;if(typeof e=="string")return!0;if(ArrayBuffer.isView(e))return!In(e);if(Array.isArray(e))return v(e,Fo)}catch{return!1}return!1}function jn(e,t){if(e==null)return null;try{if(ye(e))return e;if(In(e))return null;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Sn(e)||Tn(e))return new Uint8Array(e);if(t?.strict)return null;if(typeof e=="string")return bt.encode(e);if(Array.isArray(e)&&v(e,Fo))return Uint8Array.from(e)}catch{return null}return null}var ra,Fo,Me=O(()=>{"use strict";ut();_t();ln();st();ra={range:"UInt8"},Fo=e=>nt(e,ra)});function Uo(e){let t=L(e);return typeof t=="string"?t.trim().length===0:!1}function jo(e,t="both"){return t==="start"?e.trimStart():t==="end"?e.trimEnd():e.trim()}function rt(e,t=null,n={}){let{mode:r="both",returnStringOnNull:o=!1,maxScanStart:i=1,maxScanEnd:a=1,maxMatchesStart:s=1,maxMatchesEnd:l=1,trimFirst:c=!1,stringOptions:u}=n;if(e==null)return o?"":null;let f=J=>o||J.length>0?J:null;if(t==null)return f(jo(e,r));let p=c?jo(e,r):e,m=p.length;if(m===0)return o?"":null;let d=K(t);if(!d&&typeof t!="string"||typeof t=="string"&&t.length===0)return f(p);let{literal:y=!1,caseInsensitive:b=!1}=u??{},h=d?t:y?Y(t):`[${Y(t)}]+`,w=d&&t.ignoreCase||b,A=Wo(p,h,0,{asciiCaseInsensitive:w},()=>null),T=A.length;if(T===0)return f(p);let I=new Uint8Array(m),F=!1,yt=(J,ee,xn)=>{if(xn===0)return;let xr=0,re=J?0:m,oe=0,os=J?0:T-1,is=J?T:-1,ss=J?1:-1;for(let ie=os;ie!==is;ie+=ss){let Pt=A[ie],se=J?Pt.start-re:re-Pt.end;if(se>0&&(xr+=se,ee!==null&&ee>=0&&xr>=ee)||((se>0||y||oe===0)&&oe++,xn!==null&&xn>=0&&oe>xn))break;for(let ae=Pt.start;ae<Pt.end;ae++)I[ae]=1;F=!0,re=J?Pt.end:Pt.start}};if((r==="both"||r==="start")&&yt(!0,i,s),(r==="both"||r==="end")&&yt(!1,a,l),!F)return f(p);let br="";for(let J=0;J<m;J++)I[J]===0&&(br+=p[J]);return f(br)}function V(e,{depth:t=0,maxDepth:n=50}={}){if(t>n)return"v:circular";if(e===null)return"v:null";if(e===void 0)return"v:undefined";if(e=L(e),M(e))return`d:${e.getTime()}`;if(et(e)){let o=e.toString();return`u:${e.constructor.name}:${o.length}:${o}`}if(Array.isArray(e)){let o=e.length,i=new Array(o),a={depth:t+1,maxDepth:n};for(let s=0;s<o;s++)i[s]=V(e[s],a);return`a:[${i.join(sn)}]`}if(wn(e)){let o=Array.from(e),i=o.length,a=new Array(i),s={depth:t+1,maxDepth:n};for(let l=0;l<i;l++)a[l]=V(o[l],s);return a.sort(),`set:[${a.join(sn)}]`}if(En(e)){let o=Array.from(e.keys()),i=o.length,a=new Array(i),s={depth:t+1,maxDepth:n};for(let l=0;l<i;l++){let c=o[l],u;try{u=e.get(c)}catch{u="v:error"}a[l]=`${V(c,s)}${on}${V(u,s)}`}return a.sort(),`map:{${a.join(sn)}}`}if(typeof e=="object"&&typeof e.toJSON=="function")try{let o=e.toJSON();if(o!==e)return`j:${V(o,{depth:t+1,maxDepth:n})}`}catch{}if(K(e)){let o=e.toString();return`r:${o.length}:${o}`}if(Vt(e)){let o=Object.keys(e).sort(),i=o.length,a=new Array(i),s={depth:t+1,maxDepth:n};for(let l=0;l<i;l++){let c=o[l],u;try{u=e[c]}catch{u="v:error"}a[l]=`${V(c,s)}${on}${V(u,s)}`}return`o:{${a.join(sn)}}`}if(typeof e=="function"){let o=e.toString();return`f:${o.length}:${o}`}if(typeof e=="string")return`s:${e.length}:${e}`;if(typeof e=="symbol"){let o=e.toString();return`y:${o.length}:${o}`}if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return`${typeof e}:${e}`;let r=String(e);return`${typeof e}:${r.length}:${r}`}function aa(e){if(e==null)return[];let t=String(e);if(!t)return[];let r=t.normalize("NFC").replace(oa,"$1").match(ia)||[],o=[];for(let i=0;i<r.length;i++){let a=r[i];sa.has(a)||o.push(a)}return o}function ke(e,t=0){let n=e.codePointAt(t);return n!=null&&n>65535?2:1}function Jt(e,t){let n=aa(e),r=n.length;if(r===0)return"";let{format:o}=t??{};if(o==="camel"||o==="pascal"||o==="title"){let i=o==="title"?" ":"",a=new Array(r);for(let s=0;s<r;s++){let l=n[s];if(s===0&&o==="camel")a[s]=l.toLowerCase();else{let c=ke(l,0);a[s]=l.slice(0,c).toUpperCase()+l.slice(c).toLowerCase()}}return a.join(i)}if(o==="kebab"||o==="snake"){let i=o==="kebab"?"-":"_",a=new Array(r);for(let s=0;s<r;s++)a[s]=n[s].toLowerCase();return a.join(i)}return n.join(" ")}function qo(e){return typeof e!="string"&&(e=String(e)),bt.encode(e)}function ma(e){let t=jn(e);if(!t)return"";if(vo&&typeof Uint8Array.prototype.toBase64=="function")return t.toBase64();if(Pn)return cn.from(t).toString("base64");let n="",r=t.length;for(let o=0;o<r;o+=Po){let i=t.subarray(o,o+Po);n+=String.fromCharCode.apply(null,i)}return btoa(n)}function da(e){if(typeof e!="string"&&(e=String(e)),Pn)return cn.from(e,"utf-8").toString("hex");let t=qo(e),n=t.length,r="";for(let o=0;o<n;o++)r+=$o[t[o]];return r}function ya(e){typeof e!="string"&&(e=String(e));let t=qo(e);return ma(t)}function Go(e,t){if(e==null)return null;let n=ga[t];if(!n)throw new Error(`Unsupported encoding: '${t}'. Supported encodings are 'hex' and 'base64'.`);return n(String(e))}function ha(e){typeof e!="string"&&(e=String(e));let t=e.replace(ca,r=>ua[r]),n=t.length%4;return n===0?t:t.padEnd(t.length+(4-n),"=")}function ba(e,t=!0){if(typeof e!="string"&&(e=String(e)),e!==""&&(e.length%4!==0||!fa.test(e)))throw new Error("Invalid base64 encoding format");if(vo)return Uint8Array.fromBase64(e,{strict:t});if(Pn)return new Uint8Array(cn.from(e,"base64"));let n=atob(e),r=n.length,o=new Uint8Array(r);for(let i=0;i<r;i++)o[i]=n.charCodeAt(i);return o}function xa(e){typeof e!="string"&&(e=String(e));let t=e.trim();if(t.length%2!==0||!pa.test(t))throw new Error("Invalid hex string format");if(la)return Uint8Array.fromHex(t);if(Pn){let r=cn.from(t,"hex");if(r.length!==t.length/2)throw new Error("Invalid hex string format");return new Uint8Array(r)}let n=new Uint8Array(t.length/2);for(let r=0;r<n.length;r++){let o=parseInt(t.substring(r*2,r*2+2),16);if(Number.isNaN(o))throw new Error("Invalid hex string format");n[r]=o}return n}function Aa(e,t=!0){if(e==null)return null;try{let n=xa(e);return(t?he:ge).decode(n)}catch(n){if(t)throw n;return null}}function wa(e,t=!0){if(e==null)return null;try{let n=typeof e=="string"?e.trim():String(e).trim(),r=ha(n),o=ba(r,t);return(t?he:ge).decode(o)}catch(n){if(t)throw n;return null}}function Xo(e,t,n={}){if(e==null)return null;let r=Ea[t];if(!r)throw new Error(`Unsupported encoding: '${t}'. Supported encodings are 'hex' and 'base64'.`);let o=typeof n=="boolean"?n:n.strict??!0;return r(String(e),o)}function Oa(e,t={}){if(!nt(e,{range:"UInt16"}))return!1;let{type:n="all"}=t;switch(n){case"high":return e>=Ae&&e<=no;case"low":return e>=eo&&e<=we;case"all":return e>=Ae&&e<=we;default:return!1}}function Vo(e){let t=e.codePointAt(0),n=t<=Qr||t===to,r=e.length===1&&Oa(t);if(n||r){let o=Ee[t];if(o)return o;let i=t.toString(16);return n?`\\x${i.padStart(2,"0")}`:`\\u${i.padStart(4,"0")}`}return"\\"+e}function Y(e,t){let n=L(e);if(n==null)return"";let r=K(n)?n.source:typeof n=="string"?n:String(n);return(t?.mode??"tc39")==="tc39"?typeof RegExp.escape=="function"&&!Ia.test(r)?RegExp.escape(r):r.replace(Sa,Vo):r.replace(Ta,Vo)}function Ct(e,t,n){if(e==null||t==null)return null;let r=typeof e=="string"?e:String(e),o=n?.global??!1;try{let i=K(t),a=i?t.source:typeof t=="string"?t:String(t),s=i?t.flags.replace(/y/g,""):"";if(o?s.includes("g")||(s+="g"):s=s.replace(/g/g,""),n?.asciiCaseInsensitive!==void 0&&(s=n.asciiCaseInsensitive?s.includes("i")?s:s+"i":s.replace(/i/g,"")),(a.includes("\\p{")||a.includes("\\P{"))&&!s.includes("u")&&!s.includes("v"))try{let c=new RegExp(a,s+"u");return c.lastIndex=0,{reg:c,input:r}}catch{try{let c=new RegExp(a,s+"v");return c.lastIndex=0,{reg:c,input:r}}catch{}}let l=new RegExp(a,s);return l.lastIndex=0,{reg:l,input:r}}catch{return null}}function Lo(e){let t=Object.create(null);e.index!==void 0&&Object.defineProperty(t,"_index",{value:String(e.index),writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"_length",{value:e.length,writable:!0,enumerable:!1,configurable:!0});for(let n=0;n<e.length;n++)t[String(n)]=e[n]!==void 0?e[n]:null;if(e.groups)for(let n in e.groups){let r=e.groups[n];t[n]=r!==void 0?r:null}return t}function Ue(e,t){if(typeof t=="string")return t in e?e[t]:null;let n=Number(t);if(Number.isNaN(n))return null;let r=Math.trunc(n);if(r>=0)return e[String(r)]??null;let i=(e.Dt??0)+r;return i>=1?e[String(i)]??null:null}function Wo(e,t,n,r,o){let{literal:i=!1,mode:a,asciiCaseInsensitive:s=!1}=r??{},l=i?Y(t,{mode:a}):t,u=Ct(e,l,{global:!0,asciiCaseInsensitive:s})?.reg??null;if(!u)return[];let f=[];u.lastIndex=0;let p;for(;(p=u.exec(e))!==null;){let m=p.index,d=u.lastIndex,y=o(p,m,d);if(f.push({start:m,end:d,patternIndex:n,payload:y}),m===d){if(m===e.length)break;u.lastIndex=m+ke(e,m)}}return f}function Ko(e){if(e.length<=1)return e;e.sort((o,i)=>{if(o.start!==i.start)return o.start-i.start;let a=o.patternIndex??o.i??0,s=i.patternIndex??i.i??0;return a-s});let t=[],n=0,r=e.length;for(let o=0;o<r;o++){let i=e[o];i.start>=n&&(t.push(i),n=i.end)}return t}function zo(e,t,n,r,o){let{overlapping:i=!1,leftmost:a,...s}=n??{},l=a??!0;if(i&&a)throw new k("Cannot specify both 'overlapping' and 'leftmost' as true.");if(e==null||t==null)return null;let c=Dt(t),u=c.length;if(u===0)return[];if(i){let m=new Array(u);for(let d=0;d<u;d++)m[d]=r(c[d]);return m}let f=[];for(let m=0;m<u;m++){let d=Vn(e,c[m],{...s,global:!1});if(d&&d[0]&&d[0].St!=null){let y=Number(d[0].St),b=d[0][0]?.length??0;f.push({i:m,start:y,end:y+b,payload:o(d[0],y)})}}let p=new Array(u).fill(null);if(f.length===0)return p;if(l){let m=Ko(f);for(let d=0;d<m.length;d++){let y=m[d];p[y.i]=y.payload}}else{let m=[];f.sort((b,h)=>b.i-h.i);let d=f.length;for(let b=0;b<d;b++){let h=f[b],w=!1,A=m.length;for(let T=0;T<A;T++){let I=m[T],F=!1;if(h.start===h.end&&I.start===I.end?F=h.start===I.start:I.start===I.end?F=I.start>=h.start&&I.start<h.end:h.start===h.end?F=h.start>=I.start&&h.start<I.end:F=h.start<I.end&&h.end>I.start,F){w=!0;break}}w||m.push(h)}let y=m.length;for(let b=0;b<y;b++){let h=m[b];p[h.i]=h.payload}}return p}function Vn(e,t,n){let r=Ct(e,t,n);if(!r)return null;if(!n?.global){let a=r.input.match(r.reg);return a?[Lo(a)]:null}let o=Array.from(r.input.matchAll(r.reg));if(o.length===0)return null;let i=new Array(o.length);for(let a=0;a<o.length;a++)i[a]=Lo(o[a]);return i}function Fe(e,t,n){let r=Vn(e,t,n);return r?Ue(r[0],n?.groupIndex??1):null}function Yo(e,t,n){let r=Vn(e,t,{...n,global:!0});if(!r)return null;let o=n?.groupIndex??0,i=new Array(r.length);for(let a=0;a<r.length;a++)i[a]=Ue(r[a],o);return i}function Zo(e,t,n){return Vn(e,t,n)?.[0]??null}function Ho(e,t,n){let r=n?.groupIndex??0;return zo(e,t,n,o=>Fe(e,o,{...n,groupIndex:r}),o=>Ue(o,r))}function Be(e,t){return K(e)?new RegExp(Y(e,{mode:t}),e.flags):Y(e,{mode:t})}function Xt(e,t,n){if(e==null||t==null)return null;let{literal:r=!1,mode:o,...i}=n??{},a=r?Be(t,o):t,s=Ct(e,a,{...i,global:!1});if(!s)return null;let l=s.input.match(s.reg);return!l||l.index==null?null:bt.encode(s.input.slice(0,l.index)).length}function Qo(e,t,n){if(n?.literal){if(e==null||t==null)return null;let r=Dt(t),o=new Array(r.length);for(let i=0;i<r.length;i++)o[i]=Xt(e,r[i],n);return o}return zo(e,t,n,r=>Xt(e,r,n),(r,o)=>bt.encode(e.slice(0,o)).length)}function ti(e,t,n){if(e==null||t==null)return null;let{literal:r=!0,inclusive:o=!1,limit:i,exact:a=!1,strict:s=!1,mode:l,...c}=n??{},u=r?Be(t,l):t,f=Ct(e,u,{...c,global:!0});if(!f)return null;let{reg:p}=f;p.lastIndex=0;let m=[],d=0,y=0,b=i!=null&&i>=0?i:1/0,h;for(;y<b&&(h=p.exec(e))!==null;){let A=h.index,T=p.lastIndex;if(A===T){if(A===e.length||A>0&&A>=d&&(m.push(e.slice(d,A)),y++,d=A,y>=b))break;p.lastIndex=A+ke(e,A);continue}m.push(e.slice(d,o?T:A)),d=T,y++}if(m.push(e.slice(d)),i==null||i<0)return m;let w=i+1;if(s&&m.length<w)throw new k(`split exact error: expected string to split into at least ${w} parts, but got ${m.length}`);if(a)for(;m.length<w;)m.push(null);return m}function ni(e,t,n,r,o,i){return e.includes("$")?e.replace(/\$\$|\$([$'`&]|\d{1,2}|<[^>]+>)/g,(a,s)=>{if(a==="$$"||s==="$")return"$";if(!s)return a;if(s==="&")return t;if(s==="`")return r.slice(0,n);if(s==="'")return r.slice(n+t.length);if(s.startsWith("<"))return i?i[s.slice(1,-1)]??"":a;let l=Number(s);if(l>0&&l<=o.length)return o[l-1]??"";if(s.length===2){let c=Number(s[0]);if(c>0&&c<=o.length)return(o[c-1]??"")+s[1]}return a}):e}function je(e,t,n,r){if(e==null||t==null||n==null)return null;let o=typeof e=="string"?e:String(e),{literal:i=!1,n:a,mode:s,...l}=r??{},c=a??(l?.global?1/0:1),u=_(c,{allowNonFiniteNumbers:!0,allowNaN:!1})?Math.trunc(c):1;if(u===0)return o;let f=i?Be(t,s):t,p=Ct(o,f,{...l,global:l?.global??u!==1});if(!p)return o;let{reg:m}=p,d=typeof n=="function";if(u===1||u<0||u===1/0){if(i&&!d){let h=String(n);return o.replace(m,()=>h)}return o.replace(m,n)}let y=0,b=d?"":String(n);return o.replace(m,(...h)=>{if(y++>=u)return h[0];if(d)return String(n(...h));if(i)return b;let w=h.length,A=typeof h[w-1]=="object"&&h[w-1]!==null,T=A?h[w-1]:void 0,I=A?h[w-3]:h[w-2],F=h.slice(1,A?w-3:w-2);return ni(b,h[0],I,o,F,T)})}function ei(e,t,n,r){if(e==null||t==null)return null;let o=typeof e=="string"?e:String(e),i=Vt(t);if(!i&&!Array.isArray(t))return o;let a=i?Object.keys(t):t,s=a.length;if(s===0)return o;let l=null,c=null;if(i)l=Object.values(t);else if(Array.isArray(n))if(n.length===1&&s>1)c=n[0];else{if(n.length!==s)throw new k(`replaceMany length mismatch: expected ${s} replacement strings, got ${n.length}`);l=n}else if(n!=null)c=n;else return o;let u=[];for(let y=0;y<s;y++){let b=a[y],h=l?l[y]:c;if(b==null||h==null)continue;let w=Wo(o,b,y,r,(A,T)=>{let I=Array.prototype.slice.call(A,1);if(typeof h=="function"){let yt=[A[0],...I,T,o];return A.groups!==void 0&&yt.push(A.groups),String(h(...yt))}let F=String(h);return r?.literal?F:ni(F,A[0],T,o,I,A.groups)});for(let A=0;A<w.length;A++)u.push(w[A])}if(u.length===0)return o;let f=Ko(u),p="",m=0,d=f.length;for(let y=0;y<d;y++){let b=f[y];p+=o.slice(m,b.start)+b.payload,m=b.end}return p+=o.slice(m),p}var oa,ia,sa,cn,Pn,la,vo,Po,$o,ua,ca,fa,pa,Ml,ga,Ea,Ia,Jo,Sa,Ta,Gt=O(()=>{"use strict";ut();ln();Ne();Me();_t();st();$();oa=/(\p{L})['’]+(?=\p{L})/gu,ia=new RegExp(["[\\p{Lu}\\p{M}]+s(?![\\p{Ll}\\p{M}])","[\\p{Lu}\\p{M}]+(?=[\\p{Lu}\\p{M}][\\p{Ll}\\p{M}])","[\\p{Lu}\\p{M}]+[\\p{Ll}\\p{M}]*","[\\p{Ll}\\p{M}]+","\\p{N}+","[\\p{L}\\p{M}]+"].join("|"),"gu"),sa=new Set(["__proto__","proto","constructor","prototype"]);cn=typeof globalThis<"u"?globalThis.Buffer:void 0,Pn=typeof cn<"u",la=typeof Uint8Array<"u"&&typeof Uint8Array.fromHex=="function",vo=typeof Uint8Array<"u"&&typeof Uint8Array.fromBase64=="function",Po=8192,$o=new Array(256);for(let e=0;e<256;e++)$o[e]=e.toString(16).padStart(2,"0");ua={"-":"+",_:"/"},ca=/[-_]/g,fa=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,pa=/^[0-9a-fA-F]*$/,Ml=Ce({handleCircular:!0});ga={hex:da,base64:ya};Ea={hex:Aa,base64:wa};Ia=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Jo="\\x00-\\x1F\\x7F\\u{D800}-\\u{DFFF}",Sa=new RegExp(`[${Jo}\\\\^$*+?.()|[\\]{}/#,=<>&!%:;@~'"\`-]`,"gu"),Ta=new RegExp(`[${Jo}]|[\\x20-\\x2F\\x3A-\\x40\\x5B-\\x5E\\x5F\\x60\\x7B-\\x7E]`,"gu")});function Ra(e){let t=ri.get(e);return t||(t=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}),ri.set(e,t)),t}function Ca(e,t){let n=`${e}_${t}`,r=oi.get(n);return r||(r=new Intl.DateTimeFormat(e,{timeZoneName:"short",timeZone:t}),oi.set(n,r)),r}function Na(e){let t=ii.get(e);if(t===void 0){try{Intl.DateTimeFormat(void 0,{timeZone:e}),t=!0}catch{t=!1}ii.set(e,t)}return t}function vn(e){let t=!e||e==="local"?Intl.DateTimeFormat().resolvedOptions().timeZone:e;return Na(t)?t:"UTC"}function q(e,t=0,n=1,r=0,o=0,i=0,a=0){let s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(r,o,i,a),s}function $n(e,t){let n=vn(t);if(n.toUpperCase()==="UTC")return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),ms:e.getUTCMilliseconds(),dayOfWeek:e.getUTCDay(),timeZone:"UTC"};let o=Ra(n).formatToParts(e),i={year:"0",month:"0",day:"0",hour:"0",minute:"0",second:"0",fractionalSecond:"0"};for(let p=0,m=o.length;p<m;p++){let d=o[p];d.type in i&&(i[d.type]=d.value)}let a=parseInt(i.year,10),s=parseInt(i.month,10),l=parseInt(i.day,10),c=parseInt(i.hour,10);c===24&&(c=0);let u=Math.round(parseFloat("0."+i.fractionalSecond)*1e3)||0,f=q(a,s-1,l).getUTCDay();return{year:a,month:s,day:l,hour:c,minute:parseInt(i.minute,10),second:parseInt(i.second,10),ms:u,dayOfWeek:f,timeZone:n}}function fn(e,t){if(t.toUpperCase()==="UTC")return 0;let n=$n(e,t),r=q(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.ms).getTime();return Math.round((r-e.getTime())/it)}function P(e,t){let n=L(e);if(n==null)return null;let r=null;if(M(n))r=n;else if(typeof n=="number"||typeof n=="bigint")r=new Date(Ma(n));else if(typeof n=="string"){let o=n.trim();if(o.length===0)return null;r=new Date(o)}return!r||!M(r)?null:t?.dateOnly?q(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()):r}function qn(e){let t=L(e);if(t==null)return null;let n=null;if(typeof t=="string"){let o=t.trim();if(_a.test(o)){let i=Da.test(o);n=P(`1970-01-01T${o}${i?"":"Z"}`)}}let r=n??P(t);return r?Ve(r,{format:"%H:%M:%S.%ms"}):null}function ai(e,t="ms"){let n=e.getTime();switch(t){case"s":return Math.floor(n/tt);case"ms":return n;case"us":return BigInt(n)*be;case"ns":return BigInt(n)*xe}}function Ma(e){if(typeof e=="bigint"){let n=e<0n?-e:e;return n<=30000000000n?Number(e)*tt:n<=100000000000000n?Number(e):n<=100000000000000000n?Number(e/be):Number(e/xe)}let t=Math.abs(e);return t<=3e10?e*tt:t<=1e14?e:t<=1e17?Math.floor(e/en):Math.floor(e/rn)}function li(e){if(!M(e))return null;let t=q(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()).getTime(),n=q(e.getUTCFullYear(),0,1).getTime();return Math.floor((t-n)/xt)+1}function si(e,t,n,r="week"){let o=q(e,t-1,n);if(o.setUTCDate(o.getUTCDate()+4-(o.getUTCDay()||7)),r==="year")return o.getUTCFullYear();let i=li(o);return i!=null?Math.floor((i-1)/7)+1:null}function ci(e){return e.replace(/%[FTRDh]/g,t=>Ua[t]||t)}function Ve(e,{format:t,locale:n,timeZone:r="UTC"}){if(!M(e)||typeof t!="string")return"";let o=vn(r),i=n&&n.trim()||Intl.DateTimeFormat().resolvedOptions().locale||"en-US",a=ci(t),s=null,l=()=>s??(s=$n(e,o));return a.replace(ui,(c,u)=>{if(u==="%")return"%";let f=Pe[u];return f?f.c(e,i,o,l()):c})}function Fa(e){let t=e.replace(":",""),n=t[0]==="+"?1:-1,r=parseInt(t.slice(1,3),10)||0,o=parseInt(t.slice(3,5),10)||0;return n*(r*60+o)}function fi(e,{format:t,strict:n=!0,defaultTimeZone:r="UTC"}){if(typeof e!="string"||typeof t!="string")return null;let o=ci(t),i=[],a=0,s="";o.replace(ui,(m,d,y)=>{if(s+=Y(o.slice(a,y)),a=y+m.length,d==="%")return s+="%",m;let b=Pe[d];return b?.g?(i.push(b),s+=`(${b.g})`):s+=Y(m),m}),s+=Y(o.slice(a));let l=e.match(new RegExp(`^\\s*${s}\\s*$`));if(!l)return n?null:P(e);let c={year:1970,month:1,day:1,hour:0,minute:0,second:0,ms:0,offset:null},u=null,f=!1;for(let m=0,d=i.length;m<d;m++){let y=l[m+1],b=i[m],h=b.I?b.I(y):parseInt(y,10);b.u==="j"&&(f=!0),b.x==="ampm"?u=h:b.x==="offset"?c.offset=h:b.x&&(c[b.x]=h)}if(u==="PM"&&c.hour<12&&(c.hour+=12),u==="AM"&&c.hour===12&&(c.hour=0),f){if(c.day<1)return null;let m=q(c.year,0,c.day);if(m.getUTCFullYear()!==c.year)return null;c.month=m.getUTCMonth()+1,c.day=m.getUTCDate()}let p=q(c.year,c.month-1,c.day,c.hour,c.minute,c.second,c.ms);if(!M(p)||p.getUTCFullYear()!==c.year||p.getUTCMonth()+1!==c.month||p.getUTCDate()!==c.day||p.getUTCHours()!==c.hour||p.getUTCMinutes()!==c.minute||p.getUTCSeconds()!==c.second||p.getUTCMilliseconds()!==c.ms)return null;if(c.offset)p=new Date(p.getTime()-Fa(c.offset)*it);else if(r.toUpperCase()!=="UTC"){let m=vn(r);p=new Date(p.getTime()-fn(p,m)*it)}return M(p)?p:null}function pi(e,t=[]){let n=new Set;if(!e)return n;let r=t.length>0;for(let o of e){let i=P(o,{dateOnly:!0});!i||r&&t.includes(i.getUTCDay())||n.add(i.getTime())}return n}function Ln(e,t,n){return t.length>0&&t.includes(e.getUTCDay())||n.has(e.getTime())}function mi(e,t,{excludeWeekdays:n=[],holidays:r=[],roll:o}={}){if(!nt(t))throw new z(`The offset parameter 'n' must be a whole integer. Received: ${t}`);let i=pi(r,n);if(n.length===0&&i.size===0&&!o)return t;if(7-n.length<=0)throw new z("All weekdays are excluded; cannot offset.");let a=q(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),s=new Date(a.getTime());if(o&&Ln(s,n,i)){if(o==="raise")throw new z("Start date falls on an excluded day or holiday.");let l=o==="forward"?1:-1;for(;Ln(s,n,i);)s.setUTCDate(s.getUTCDate()+l)}if(t!==0){let l=t>0?1:-1,c=Math.abs(t),u=0;for(;u<c;)s.setUTCDate(s.getUTCDate()+l),Ln(s,n,i)||u++}return Math.round((s.getTime()-a.getTime())/xt)}function di(e,t={}){if(!M(e))return null;let n=t.excludeWeekdays??[0,6],r=pi(t.holidays,n),o=q(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return!Ln(o,n,r)}function Le(e,t,n){let r=vn(t),o=n?.type??"total",i;if(o==="total")i=fn(e,r);else{let p=$n(e,r).year,m=fn(q(p,0,1),r),d=fn(q(p,6,1),r),y=Math.min(m,d);i=o==="daylightSavingTime"?fn(e,r)-y:y}let a=n?.format??"milliseconds";if(a==="minutes")return i;if(a==="hours")return i/60;if(a==="milliseconds")return i*it;let s=i>=0?"+":"-",l=Math.abs(i),c=String(Math.floor(l/60)).padStart(2,"0"),u=String(l%60).padStart(2,"0");return a==="iso"?`${s}${c}:${u}`:`${s}${c}${u}`}function Wt(e,t,n,r=!1){let o=e??t;return o<0?n+(r?1:0)+o:o}function yi(e,t={}){let n=$n(e,t?.timeZone??void 0),r=t?.year??n.year,o=Wt(t?.month,n.month,12,!0)-1,i=q(r,o+1,0).getUTCDate(),a=Wt(t?.day,n.day,i,!0),s=Wt(t?.hour,n.hour,24),l=Wt(t?.minute,n.minute,60),c=Wt(t?.second,n.second,60),u=Wt(t?.ms,n.ms,1e3);return q(r,o,a,s,l,c,u)}var _a,Da,ri,oi,ii,Pe,ka,ui,Ua,_e=O(()=>{"use strict";Gt();$();ut();_t();st();_a=/^\d{2}:\d{2}/,Da=/(?:Z|[+-]\d{2}(?::?\d{2})?)$/i,ri=new Map;oi=new Map;ii=new Map;Pe={Y:{u:"Y",c:(e,t,n,r)=>{let o=r.year;return o>=0?String(o).padStart(4,"0"):"-"+String(Math.abs(o)).padStart(4,"0")},g:"[+-]?\\d{4,}",x:"year"},y:{u:"y",c:(e,t,n,r)=>String(Math.abs(r.year)%100).padStart(2,"0"),g:"\\d{2}",x:"year",I:e=>{let t=parseInt(e,10);return t+(t>=69?1900:2e3)}},m:{u:"m",c:(e,t,n,r)=>String(r.month).padStart(2,"0"),g:"\\d{2}",x:"month"},d:{u:"d",c:(e,t,n,r)=>String(r.day).padStart(2,"0"),g:"\\d{2}",x:"day"},e:{u:"e",c:(e,t,n,r)=>String(r.day).padStart(2," "),g:"\\s?\\d{1,2}",x:"day"},H:{u:"H",c:(e,t,n,r)=>String(r.hour).padStart(2,"0"),g:"\\d{2}",x:"hour"},I:{u:"I",c:(e,t,n,r)=>String(r.hour%12||12).padStart(2,"0"),g:"\\d{2}",x:"hour"},p:{u:"p",c:(e,t,n,r)=>r.hour>=12?"PM":"AM",g:"AM|PM|am|pm",x:"ampm",I:e=>e.toUpperCase()},M:{u:"M",c:(e,t,n,r)=>String(r.minute).padStart(2,"0"),g:"\\d{2}",x:"minute"},S:{u:"S",c:(e,t,n,r)=>String(r.second).padStart(2,"0"),g:"\\d{2}",x:"second"},A:{u:"A",c:(e,t,n)=>e.toLocaleDateString(t,{weekday:"long",timeZone:n})},a:{u:"a",c:(e,t,n)=>e.toLocaleDateString(t,{weekday:"short",timeZone:n})},B:{u:"B",c:(e,t,n)=>e.toLocaleDateString(t,{month:"long",timeZone:n})},b:{u:"b",c:(e,t,n)=>e.toLocaleDateString(t,{month:"short",timeZone:n})},j:{u:"j",c:(e,t,n,r)=>String(li(q(r.year,r.month-1,r.day))??1).padStart(3,"0"),g:"\\d{3}",x:"day",I:e=>parseInt(e,10)},u:{u:"u",c:(e,t,n,r)=>String(r.dayOfWeek||7)},w:{u:"w",c:(e,t,n,r)=>String(r.dayOfWeek)},V:{u:"V",c:(e,t,n,r)=>String(si(r.year,r.month,r.day,"week")??1).padStart(2,"0"),g:"\\d{2}",I:e=>parseInt(e,10)},G:{u:"G",c:(e,t,n,r)=>String(si(r.year,r.month,r.day,"year")??r.year).padStart(4,"0"),g:"[+-]?\\d{4,}",I:e=>parseInt(e,10)},Z:{u:"Z",c:(e,t,n)=>{if(n.toUpperCase()==="UTC")return"UTC";let r=Ca(t,n).formatToParts(e);for(let o=0,i=r.length;o<i;o++)if(r[o].type==="timeZoneName")return r[o].value;return"UTC"}},z:{u:"z",c:(e,t,n)=>Le(e,n,{format:"basic"}),g:"[+-]\\d{2}(?::?\\d{2})?",x:"offset",I:e=>e.replace(":","")},ms:{u:"ms",c:(e,t,n,r)=>String(r.ms).padStart(3,"0"),g:"\\d{1,3}",x:"ms",I:e=>parseInt(e.padEnd(3,"0").slice(0,3),10)},f:{u:"f",c:(e,t,n,r)=>String(r.ms).padStart(3,"0").padEnd(6,"0"),g:"\\d{1,9}",x:"ms",I:e=>parseInt(e.padEnd(6,"0").slice(0,3),10)}},ka=Object.keys(Pe).concat("%").sort((e,t)=>t.length-e.length),ui=new RegExp("%("+ka.join("|")+")","g"),Ua={"%F":"%Y-%m-%d","%T":"%H:%M:%S","%R":"%H:%M","%D":"%m/%d/%y","%h":"%b"}});var j,wt,Kt,ct,ft,Nt,pt,Mt,Gn=O(()=>{"use strict";j=class e{matches(t){if(t==null)return!1;if(t instanceof e)return!!(this.equals(t)||this.name.startsWith("Decimal")&&t.name.startsWith("Decimal")&&t.precision===void 0&&t.scale===void 0);if(typeof t=="function"){if(t.prototype instanceof e)return this instanceof t;if(t.name==="Struct"||t.name==="StructType")return this.name==="Struct";if(t.name==="ArrayDataType"||t.name==="ArrayType"||t===Array)return this.name==="Array";try{let n=t();if(n instanceof e)return this.constructor===n.constructor}catch{}}return!1}get isNumeric(){return!1}get isInteger(){return!1}get isFloat(){return!1}get isSigned(){return!1}get isUnsigned(){return!1}get isTemporal(){return!1}get isNested(){return!1}get isBoolean(){return!1}get isString(){return!1}get isUtf8(){return!1}get isObject(){return!1}get isNull(){return!1}get isBinary(){return!1}},wt=class extends j{get isNumeric(){return!0}},Kt=class extends wt{get isInteger(){return!0}},ct=class extends Kt{get isSigned(){return!0}},ft=class extends Kt{get isUnsigned(){return!0}},Nt=class extends wt{get isFloat(){return!0}},pt=class extends j{get isTemporal(){return!0}},Mt=class extends j{get isNested(){return!0}}});var ve,gi,$e,hi,qe,G,Ge,bi,Xe,xi,Je,Ai,We,wi,Ke,Ei,zt,Ii,Yt,Si,Et,ze,Xn,Ye,Ti,Ze,Oi,He,_i,Qe,Di,tr,Ri,mt,Ci,nr,Ni,Z,Mi,Zt,ki,pn,Ui,Ht=O(()=>{"use strict";Gn();H();ve=class extends ct{constructor(){super(...arguments);x(this,"name","Int8")}coerce(n){return W(n,{range:"Int8"})}equals(n){return n.name==="Int8"}allocate(n){return new Int8Array(n)}},gi=new ve,$e=class extends ct{constructor(){super(...arguments);x(this,"name","Int16")}coerce(n){return W(n,{range:"Int16"})}equals(n){return n.name==="Int16"}allocate(n){return new Int16Array(n)}},hi=new $e,qe=class extends ct{constructor(){super(...arguments);x(this,"name","Int32")}coerce(n){return W(n,{range:"Int32"})}equals(n){return n.name==="Int32"}allocate(n){return new Int32Array(n)}},G=new qe,Ge=class extends ct{constructor(){super(...arguments);x(this,"name","Int64")}coerce(n){return $t(n,{truncate:!0})}equals(n){return n.name==="Int64"}allocate(n){return new BigInt64Array(n)}},bi=new Ge,Xe=class extends ft{constructor(){super(...arguments);x(this,"name","UInt8")}coerce(n){return W(n,{range:"UInt8"})}equals(n){return n.name==="UInt8"}allocate(n){return new Uint8Array(n)}},xi=new Xe,Je=class extends ft{constructor(){super(...arguments);x(this,"name","UInt16")}coerce(n){return W(n,{range:"UInt16"})}equals(n){return n.name==="UInt16"}allocate(n){return new Uint16Array(n)}},Ai=new Je,We=class extends ft{constructor(){super(...arguments);x(this,"name","UInt32")}coerce(n){return W(n,{range:"UInt32"})}equals(n){return n.name==="UInt32"}allocate(n){return new Uint32Array(n)}},wi=new We,Ke=class extends ft{constructor(){super(...arguments);x(this,"name","UInt64")}coerce(n){return $t(n,{range:"UInt64"})}equals(n){return n.name==="UInt64"}allocate(n){return new BigUint64Array(n)}},Ei=new Ke,zt=class extends Nt{constructor(){super(...arguments);x(this,"name","Float32")}coerce(n){return Ie(n,{floatPrecision:"Float32"})}equals(n){return n.name==="Float32"}allocate(n){return new Float32Array(n)}},Ii=new zt,Yt=class extends Nt{constructor(){super(...arguments);x(this,"name","Float64")}coerce(n){return Ie(n,{floatPrecision:"Float64"})}equals(n){return n.name==="Float64"}allocate(n){return new Float64Array(n)}},Si=new Yt,Et=class e extends wt{constructor(n,r){super();x(this,"precision",n);x(this,"scale",r);x(this,"name");this.name=n!==void 0&&r!==void 0?`Decimal(${n}, ${r})`:"Decimal"}coerce(n){return Nn(n,{precision:this.precision,scale:this.scale})}equals(n){return n instanceof e&&this.precision===n.precision&&this.scale===n.scale}allocate(n){return new Array(n).fill(null)}},ze=class extends j{constructor(){super(...arguments);x(this,"name","Boolean")}get isBoolean(){return!0}coerce(n){return n==null?null:!!n}equals(n){return n.name==="Boolean"}allocate(n){return new Array(n).fill(null)}},Xn=new ze,Ye=class extends j{constructor(){super(...arguments);x(this,"name","Utf8")}get isString(){return!0}get isUtf8(){return!0}coerce(n){return n==null?null:String(n)}equals(n){return n.name==="Utf8"}allocate(n){return new Array(n).fill(null)}},Ti=new Ye,Ze=class extends j{constructor(){super(...arguments);x(this,"name","Binary")}get isBinary(){return!0}coerce(n){return jn(n)}equals(n){return n.name==="Binary"}allocate(n){return new Array(n).fill(null)}},Oi=new Ze,He=class extends j{constructor(){super(...arguments);x(this,"name","Null")}get isNull(){return!0}coerce(n){return null}equals(n){return n.name==="Null"}allocate(n){return new Array(n).fill(null)}},_i=new He,Qe=class extends j{constructor(){super(...arguments);x(this,"name","Object")}get isObject(){return!0}coerce(n){return n===void 0?null:n}equals(n){return n.name==="Object"}allocate(n){return new Array(n).fill(null)}},Di=new Qe,tr=class extends pt{constructor(){super(...arguments);x(this,"name","Date")}coerce(n){return P(n,{dateOnly:!0})}equals(n){return n.name==="Date"}allocate(n){return new Array(n).fill(null)}},Ri=new tr,mt=class e extends pt{constructor(n="ms",r=null){super();x(this,"name","Datetime");x(this,"timeUnit");x(this,"timeZone");this.timeUnit=n,this.timeZone=r}coerce(n){return P(n)}equals(n){return n instanceof e&&n.timeUnit===this.timeUnit&&n.timeZone===this.timeZone}allocate(n){return new Array(n).fill(null)}},Ci=new mt,nr=class extends pt{constructor(){super(...arguments);x(this,"name","Time")}coerce(n){return qn(n)}equals(n){return n.name==="Time"}allocate(n){return new Array(n).fill(null)}},Ni=new nr,Z=class e extends pt{constructor(n="ms"){super();x(this,"name","Duration");x(this,"timeUnit");this.timeUnit=n}coerce(n){return B(n)}equals(n){return n instanceof e&&n.timeUnit===this.timeUnit}allocate(n){return new Array(n).fill(null)}},Mi=new Z,Zt=class e extends Mt{constructor(n){super();x(this,"innerType",n);x(this,"name","Array")}coerce(n){if(n==null)return null;let r=R(n)?Array.from(n):[n],o=r.length,i=new Array(o);for(let a=0;a<o;a++)i[a]=this.innerType.coerce(r[a]);return i}equals(n){return n instanceof e&&this.innerType.equals(n.innerType)}allocate(n){return new Array(n).fill(null)}},ki=e=>new Zt(e),pn=class e extends Mt{constructor(n){super();x(this,"fields",n);x(this,"name","Struct")}coerce(n){if(!C(n))return null;let r={},o=Object.keys(this.fields),i=o.length;for(let a=0;a<i;a++){let s=o[a],l=this.fields[s];r[s]=l.coerce(n[s])}return r}equals(n){if(!(n instanceof e))return!1;let r=Object.keys(this.fields),o=Object.keys(n.fields);if(r.length!==o.length)return!1;for(let i=0;i<r.length;i++){let a=r[i];if(!this.fields[a].equals(n.fields[a]))return!1}return!0}allocate(n){return new Array(n).fill(null)}},Ui=e=>new pn(e)});var S,er=O(()=>{"use strict";Gn();Ht();Ht();Gn();S={Int8:gi,Int16:hi,Int32:G,Int64:bi,UInt8:xi,UInt16:Ai,UInt32:wi,UInt64:Ei,Float32:Ii,Float64:Si,Decimal:(e,t)=>new Et(e,t),Boolean:Xn,Utf8:Ti,Binary:Oi,Date:Ri,Datetime:Ci,Time:Ni,Duration:Mi,Object:Di,Null:_i,Array:ki,Struct:Ui,Numeric:wt,Integer:Kt,SignedInteger:ct,UnsignedInteger:ft,Float:Nt,Temporal:pt,Nested:Mt}});var Fi=O(()=>{"use strict"});function ja(e){let t=rt(e);if(!t)throw new Error(`Invalid duration string: "${e}"`);let n=t.startsWith("-")||t.startsWith("+"),r=t.startsWith("-")?-1:1,o=n?rt(t.slice(1))??"":t;if(!o||Xt(o,Ba)!==null)throw new Error(`Cannot parse duration string: "${e}"`);rr.lastIndex=0;let i,a=0,s=0,l=0,c=0,u=!1,f=!1,p=!1,m=0,d=!1,y=0;for(;(i=rr.exec(o))!==null;){m++;let b=i[1],h=i[2];h||(d=!0);let w=parseFloat(b)*r,A=h!==void 0?h:"ms",T=A.toLowerCase();if(y=rr.lastIndex,A==="i"){f=!0,c+=w;continue}let I=Bi[A]??Bi[T];if(I){u=!0,p=!0,I.kind==="month"?a+=w*I.factor:s+=w*I.factor;continue}let F=Qt[A]??Qt[T];if(F===void 0)throw new Error(`Unknown duration unit: "${h}" in "${e}"`);p=!0,l+=w*F}if(m===0||y!==o.length||d&&m>1)throw new Error(`Cannot parse duration string: "${e}"`);if(f&&p)throw new Error(`Cannot combine index unit 'i' with temporal duration units in "${e}"`);return{months:a,days:s,ms:l,indexUnits:c,isCalendar:u,isIndex:f}}function ji(e,t={}){let n=t.to??"ms",r=Qt[n]??Qt[n.toLowerCase()];if(r===void 0)throw new Error(`Unknown target duration unit: "${n}"`);let o=ja(e);if(o.isCalendar&&o.months!==0)throw new Error(`Cannot convert calendar duration containing months/years to a fixed duration without an anchor date: "${e}"`);if(o.isIndex){let s=o.indexUnits/r;return Object.is(s,-0)?0:s}let a=(o.ms+o.days*xt)/r;return Object.is(a,-0)?0:a}var Bi,Qt,rr,Ba,Pi=O(()=>{"use strict";Gt();st();Bi=Object.freeze({M:{kind:"month",factor:1},mo:{kind:"month",factor:1},month:{kind:"month",factor:1},months:{kind:"month",factor:1},q:{kind:"month",factor:3},quarter:{kind:"month",factor:3},quarters:{kind:"month",factor:3},y:{kind:"month",factor:12},yr:{kind:"month",factor:12},year:{kind:"month",factor:12},years:{kind:"month",factor:12},d:{kind:"day",factor:1},day:{kind:"day",factor:1},days:{kind:"day",factor:1},w:{kind:"day",factor:7},week:{kind:"day",factor:7},weeks:{kind:"day",factor:7}}),Qt=Object.freeze({ns:Dn,nanosecond:Dn,nanoseconds:Dn,us:Lt,\u00B5s:Lt,\u03BCs:Lt,microsecond:Lt,microseconds:Lt,ms:_n,millisecond:_n,milliseconds:_n,s:tt,sec:tt,second:tt,seconds:tt,m:it,min:it,minute:it,minutes:it,h:nn,hr:nn,hour:nn,hours:nn,d:xt,day:xt,days:xt,w:On,week:On,weeks:On,i:1}),rr=/(?:^|\s*,\s*|\s+)((?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?)\s*([a-zA-Zµμ]+)?/gy,Ba=/^,|,[\s]*,|,$|(?<![eE])[+-]|[a-zA-Zµμ]\./});var H=O(()=>{"use strict";ut();_t();_e();ln();Gt();Ne();Fi();Me();Pi()});function Vi(e,t,n,r=""){if(!(e in t))throw new tn(e,`${n} "${e}" does not exist${r}`)}function Jn(e,t="Value cannot be null or undefined"){if(e==null)throw new k(t);return e}var Li=O(()=>{"use strict";$()});var It,or,tn,Wn,z,kt,k,un,$=O(()=>{"use strict";Li();It=class extends Error{constructor(t){super(t),this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},or=class extends It{},tn=class extends or{constructor(t,n){super(n||`Column "${t}" does not exist in the DataFrame.`)}},Wn=class extends It{},z=class extends It{},kt=class extends It{},k=class extends It{},un=class extends It{}});function Pa(e,t,n){let r=n.length,o={},i=new Array(r);for(let a=0;a<r;a++){let s=n[a];if(typeof s=="string")Vi(s,e,"Partition key"," in the DataFrame."),o[s]=e[s],i[a]=s;else{let l=`__part_${a}`;o[l]=s.evaluate(e,t),i[a]=l}}return Va(o,i,t)}function vi(e,t,n){let r=new Array(n);if(n===0)return r;let o=e.D||[],i=Pa(t,n,o),a=e.W(e.U,t,n);for(let s of i.values()){let l=s.length,c=new Array(l);for(let u=0;u<l;u++)c[u]=a[s[u]];if(e._){for(let u=0;u<l;u++)r[s[u]]=e._(c,s,u);continue}if(e.S){let u=e.S(c);for(let f=0;f<l;f++)r[s[f]]=u;continue}for(let u=0;u<l;u++)r[s[u]]=a[s[u]]}return e.tt(e.U,r,t)}function Va(e,t,n){let r=new Map;for(let o=0;o<n;o++){let i=La(e,t,o),a=r.get(i);a===void 0&&r.set(i,a=[]),a.push(o)}return r}function La(e,t,n){let r=t.length;if(r===1)return V(e[t[0]][n]);let o=new Array(r);for(let i=0;i<r;i++)o[i]=V(e[t[i]][n]);return o.join(on)}var $i=O(()=>{"use strict";st();H();$()});function qi(e,t){if(e==null)return null;let n=M(e)?e.getTime():e;return t(n)}function ir(e,t,n){if(e==null||t==null)return null;let r=M(e)?e.getTime():e,o=M(t)?t.getTime():t;return n(r,o)}function ot(e,t,n){return e.Ot?vi(e,t,n):e.evaluate(t,n)}function Ut(e,t,n){return typeof e=="object"&&e!==null&&"_ops"in e?ot(e,t||{},n):typeof e=="string"&&t!=null&&e in t?t[e]:e}function Ft(e,t,n,r){return!R(t)||t.length!==r?!1:typeof e=="object"&&e!==null&&"_ops"in e||typeof e=="string"&&n!=null&&e in n}function sr(e){let t=new Set,n=R(e)?e:[e];for(let r=0;r<n.length;r++)t.add(V(n[r]));return t}function ar(e,t,n){let r=e.length,o=n&&typeof n=="object"&&"evaluate"in n,i=o?n.evaluate(t,r):null,a=o?null:sr(n),s=new Array(r);for(let l=0;l<r;l++){let c=e[l];if(c==null){s[l]=null;continue}let u=a??sr(i[l]);s[l]=u.has(V(c))}return s}function lr(e,t){let n=e.length,r=R(t),o=new Array(n);for(let i=0;i<n;i++){let a=e[i],s=r?t[i]:t;a==null||s==null?o[i]=a==null&&s==null:o[i]=a===s}return o}function Kn(e,t,n={}){if(t==null)return null;let r=n.dense?"_denseRankCache":"_rankCache",o=e[r];if(!o){let i=e;if(n.ignoreNulls){i=[];let l=e.length;for(let c=0;c<l;c++)e[c]!=null&&i.push(e[c])}n.dense&&(i=Array.from(new Set(i)));let a=an(i);o=new Map;let s=a.length;for(let l=0;l<s;l++){let c=a[l];o.has(c)||o.set(c,l+1)}e[r]=o}return o.get(t)??null}var E,U,dt=O(()=>{"use strict";H();ut();$i();E=e=>t=>{let n=t.length,r=new Array(n);for(let o=0;o<n;o++)r[o]=qi(t[o],e);return r},U=(e,t,n)=>{let r=(o,i)=>{let a=o.length,s=e.P(t,i,a),l=new Array(a);if(R(s))for(let c=0;c<a;c++)l[c]=ir(o[c],s[c],n);else for(let c=0;c<a;c++)l[c]=ir(o[c],s,n);return l};return r.C={left:e,right:t},r}});var g,X,St=O(()=>{"use strict";$();dt();g=(e,t)=>{let n=e.constructor,r=e.z||e.f||"",o=new n(r);return Object.assign(o,e),o.p=t?[...e.p,t]:[...e.p],t&&t.C&&(o.C=t.C),o},X=class e{constructor(){x(this,"p",[]);x(this,"O","");x(this,"B");x(this,"V");x(this,"S",null);x(this,"N");x(this,"C");x(this,"R");x(this,"U");x(this,"D",null);x(this,"_");x(this,"F");x(this,"et");x(this,"rt")}tt(t,n,r){let o=this.p,i=t!==void 0?t:o.length,a=n;for(let s=i;s<o.length;s++)a=o[s](a,r);return a}W(t,n,r){let o=this.Tt(n,r),i=this.p,a=t!==void 0?t:i.length;for(let s=0;s<a;s++)o=i[s](o,n);return o}Tt(t,n){let r=this.f;if(r&&r!=="*"&&!r.startsWith("*")&&!(r in t))throw new tn(r);return(r&&r!=="*"?t[r]:null)||new Array(n).fill(null)}P(t,n,r){return t instanceof e?t.B&&t.p.length===1?t.V:ot(t,n,r):t}alias(t){let n=g(this);return n.O=t,n}cast(t){let n=g(this,E(r=>t.coerce(r)));return n.N=t,n}debug(t){return g(this,n=>n)}evaluate(t,n){return this.W(void 0,t,n)}}});var mn,ur=O(()=>{"use strict";St();dt();$();H();mn=class extends X{L(t,n,r,o){return this.j(function(i,a,s){let l=n,c=!1,u=t?s:0,f=t?i.length-1:s;for(let p=u;p<=f;p++){let m=i[p];m!=null&&(l=r(l,m),c=!0)}return o?o(l,c):l})}o(t){let n=g(this);return n.S=t,n.R=this.p.length,n.U=this.p.length,n}k(t,n){let r=g(this,U(this,t,(o,i)=>[o,i])).o(n);return r.C=void 0,r}get Ot(){return this.D!==null||this._!==void 0||this.S!==null}j(t){let n=g(this);return n.U=this.p.length,n.R=this.p.length,n._=t,n}abs(){return g(this,E(Math.abs))}add(t){return g(this,U(this,t,(n,r)=>n+r))}all(){return this.o(t=>v(t,n=>!!n,{mode:"every"}))}allNull(){return this.o(t=>v(t,"nullish",{mode:"every"}))}and(t){return g(this,(n,r)=>{let o=n.length,i=this.P(t,r,o),a=R(i),s=new Array(o);for(let l=0;l<o;l++){let c=n[l],u=a?i[l]:i;c===!1||u===!1?s[l]=!1:c==null||u==null?s[l]=null:s[l]=!0}return s})}any(){return this.o(t=>v(t,n=>!!n,{mode:"some"}))}anyNull(){return this.o(t=>v(t,"nullish",{mode:"some"}))}arccos(){return g(this,E(t=>t<-1||t>1?null:Math.acos(t)))}arccosh(){return g(this,E(t=>t<1?null:Math.acosh(t)))}arcsin(){return g(this,E(t=>t<-1||t>1?null:Math.asin(t)))}arcsinh(){return g(this,E(Math.asinh))}arctan(){return g(this,E(Math.atan))}arctan2(t){return g(this,U(this,t,Math.atan2))}arctanh(){return g(this,E(t=>t<=-1||t>=1?null:Math.atanh(t)))}argMax(){return this.o(t=>D(t).maxIdx)}argMin(){return this.o(t=>D(t).minIdx)}avg(){return this.o(t=>D(t).mean)}between(t,n,r="both"){let o=r==="both"||r==="left"?this.ge(t):this.gt(t),i=r==="both"||r==="right"?this.le(n):this.lt(n);return o.and(i)}bitwiseAnd(){return this.o(t=>Fn(t,(n,r)=>n&r))}bitwiseOr(){return this.o(t=>Fn(t,(n,r)=>n|r))}bitwiseXor(){return this.o(t=>Fn(t,(n,r)=>n^r))}cbrt(){return g(this,E(Math.cbrt))}ceil(){return g(this,E(Math.ceil))}clip(t=null,n=null){return g(this,E(r=>at(r,{min:t,max:n})))}copysign(t){return g(this,U(this,t,(n,r)=>Math.abs(n)*(r>=0?1:-1)))}corr(t){return this.k(t,n=>Te(n)?.correlation??null)}cos(){return g(this,E(Math.cos))}cosh(){return g(this,E(Math.cosh))}cot(){return g(this,E(t=>{if(Number.isNaN(t))return NaN;if(!_(t))return null;let n=Math.tan(t);return n===0?null:1/n}))}count(t={}){return t.includeNulls?this.o(n=>n.length):this.o(n=>D(n).count)}cov(t){return this.k(t,n=>Te(n)?.covariance??null)}cumCount(t=!1){return this.L(t,0,n=>n+1)}cumMax(t=!1){return this.L(t,null,(n,r)=>n===null||r>n?r:n)}cumMin(t=!1){return this.L(t,null,(n,r)=>n===null||r<n?r:n)}cumProd(t=!1){return this.L(t,1,(n,r)=>n*r,(n,r)=>r?n:null)}cumSum(t=!1){return this.L(t,0,(n,r)=>n+r)}degrees(){return g(this,E(t=>t*(180/Math.PI)))}denseRank(){return this.rank({dense:!0})}div(t){return g(this,U(this,t,(n,r)=>r===0?null:n/r))}dot(t){return this.k(t,n=>wo(n))}entropy(t={base:Math.E,normalize:!0}){return this.o(n=>Oo(n,t))}eq(t){return g(this,U(this,t,(n,r)=>n===r))}eqMissing(t){return g(this,(n,r)=>{let o=this.P(t,r,n.length);return lr(n,o)})}exp(){return g(this,E(Math.exp))}expm1(){return g(this,E(Math.expm1))}fillNull({value:t=void 0,strategy:n=void 0,limit:r=void 0}={}){return n==="zero"?t=0:n==="one"&&(t=1),g(this,(o,i)=>{let a=o.length,s=Array.from(o);if(t!==void 0){let l=this.P(t,i,a),c=R(l);for(let u=0;u<a;u++)s[u]==null&&(s[u]=c?l[u]:l);return s}if(n==="min"||n==="max"||n==="mean"){let l=D(o)[n];for(let c=0;c<a;c++)s[c]==null&&(s[c]=l);return s}if(n==="forward"||n==="backward"){let l=n==="backward",c=null,u=0;for(let f=0;f<a;f++){let p=l?a-1-f:f,m=s[p];if(m!=null){c=m,u=0;continue}c!==null&&(r===void 0||u<r)&&(s[p]=c,u++)}return s}if(n!==void 0)throw new k(`Unsupported fillNull strategy: "${n}"`);return s})}filter(t){return g(this,(n,r)=>{let o=ot(t,r,n.length);return Bn(n,o,{nullify:!0})})}first(){return this.o(t=>t[0]??null)}floor(){return g(this,E(Math.floor))}floordiv(t){return g(this,U(this,t,(n,r)=>r===0?null:Math.floor(n/r)))}ge(t){return g(this,U(this,t,(n,r)=>n>=r))}gt(t){return g(this,U(this,t,(n,r)=>n>r))}hasNulls(){return this.anyNull()}hypot(t){return g(this,U(this,t,Math.hypot))}implode(){return this.o(t=>t)}isClose(t,{absTol:n=1e-8,relTol:r=1e-8,nansEqual:o=!1}={}){return g(this,U(this,t,(i,a)=>{if(_(i)&&_(a)){let s=Math.abs(i-a),l=Math.max(r*Math.max(Math.abs(i),Math.abs(a)),n);return s<=l}return Number.isNaN(i)&&Number.isNaN(a)?o:i===a}))}isDuplicated(){return g(this,t=>{let{frequencies:n}=At(t,{strict:!0}),r=t.length,o=new Array(r);for(let i=0;i<r;i++)o[i]=(n.get(t[i])||0)>1;return o})}isFinite(){return g(this,E(Number.isFinite))}isIn(t){return g(this,(n,r)=>ar(n,r,t))}isInfinite(){return g(this,E(t=>t===1/0||t===-1/0))}isNan(){return g(this,E(Number.isNaN))}isNDistinct(t,n=!0){return g(this,(r,o)=>{let{values:i}=At(r,{strict:!0}),a=qt(i,t,n);return this.eq(a).evaluate(o,r.length)})}isNotNan(){return this.isNan().not()}isNotNull(){return this.isNull().not()}isNull(){return this.eqMissing(null)}isUnique(){return this.isDuplicated().not()}kurtosis(t={}){return this.o(n=>To(n,t))}lag(t=1,n=null){return this.j(function(r,o,i){let a=n;return i-t>=0&&(a=r[i-t]),a})}last(){return this.o(t=>t[t.length-1]??null)}le(t){return g(this,U(this,t,(n,r)=>n<=r))}lead(t=1,n=null){return this.j(function(r,o,i){let a=n;return i+t<r.length&&(a=r[i+t]),a})}log(t=Math.E){return g(this,E(n=>n<=0?null:t===Math.E?Math.log(n):Math.log(n)/Math.log(t)))}log1p(){return g(this,E(t=>t<=-1?null:Math.log1p(t)))}lt(t){return g(this,U(this,t,(n,r)=>n<r))}max(){return this.o(t=>D(t).max)}maxBy(t){return this.k(t,n=>Oe(n,"maxIdx"))}mean(){return this.avg()}median(){return this.o(t=>Rt(t,.5))}min(){return this.o(t=>D(t).min)}minBy(t){return this.k(t,n=>Oe(n,"minIdx"))}mod(t){return g(this,U(this,t,(n,r)=>r===0?null:n%r))}mode(){return this.o(t=>Un(t))}mul(t){return g(this,U(this,t,(n,r)=>n*r))}nanMax(){return this.o(t=>D(t).nanMax)}nanMin(){return this.o(t=>D(t).nanMin)}ne(t){return this.eq(t).not()}negate(){return g(this,E(t=>-t))}neMissing(t){return this.eqMissing(t).not()}not(){return g(this,E(t=>!t))}notIn(t){return this.isIn(t).not()}nullCount(){return this.o(t=>D(t).nullCount)}nUnique(t={}){return this.o(n=>At(n,t).count)}or(t){return g(this,(n,r)=>{let o=n.length,i=this.P(t,r,o),a=R(i),s=new Array(o);for(let l=0;l<o;l++){let c=n[l],u=a?i[l]:i;c===!0||u===!0?s[l]=!0:c==null||u==null?s[l]=null:s[l]=!1}return s})}over(t){let n=g(this),r=Array.isArray(t)?t:[t];return n.D=r,n}pow(t){return g(this,U(this,t,Math.pow))}product(){return this.o(t=>D(t).product)}quantile(t){if(t<0||t>1)throw new z("Quantile q must be between 0 and 1");return this.o(n=>Rt(n,t))}radians(){return g(this,E(t=>t*(Math.PI/180)))}rand(t,{min:n=0,max:r=1,integer:o=!1}={}){return g(this,i=>{let a=i.length,s=new Float64Array(a),l=t!==void 0?po(t):Math.random,c=r-n;for(let u=0;u<a;u++){let f=l();s[u]=o?Math.floor(f*(c+1))+n:f*c+n}return s})}rank(t={}){return this.j(function(n,r,o){return Kn(n,n[o],t)})}reverse(){return g(this,t=>t.slice().reverse())}rolling(t,n){let r=typeof t=="number"?t:t?.windowSize??NaN;if(!Number.isFinite(r)||r<1)throw new k("rolling: windowSize must be a positive number >= 1");if(!n||typeof n!="function"&&typeof n.evaluate!="function")throw new k("rolling: second argument must be a reducer function or ColumnExpression");let o=Math.floor(r),i=n.f||this.f||"val",a=typeof n=="function"?n:n.S??(s=>{let l=ot(n,{[i]:s},s.length);return Array.isArray(l)?l[l.length-1]:l});return this.j(function(s,l,c){let u=Math.max(0,c-o+1),f=c+1;return a(s.slice(u,f))})}rollingMax(t){return this.rolling(t,n=>D(n).max)}rollingMean(t){return this.rolling(t,n=>D(n).mean)}rollingMedian(t){return this.rolling(t,n=>Rt(n,.5))}rollingMin(t){return this.rolling(t,n=>D(n).min)}rollingQuantile(t,n){return this.rolling(n,r=>Rt(r,t))}rollingRank(t){return this.rolling(t,n=>Kn(n,n[n.length-1],{ignoreNulls:!0}))}rollingStd(t){return this.rolling(t,n=>D(n).std)}rollingSum(t){return this.rolling(t,n=>D(n).sum)}round(t=0){return g(this,E(n=>Se(n,t)))}roundSigFigs(t){return g(this,E(n=>_(n)?Number(n.toPrecision(t)):n))}rowNumber(){let t=this.j(function(n,r,o){return o+1});return t.O="row_number",t}sign(){return g(this,E(Math.sign))}sin(){return g(this,E(Math.sin))}sinh(){return g(this,E(Math.sinh))}skew(t={}){return this.o(n=>So(n,t))}spearmanCorr(t){return this.k(t,n=>Ao(n))}sqrt(){return g(this,E(t=>t<0?null:Math.sqrt(t)))}std(){return this.o(t=>D(t).std)}sub(t){return g(this,U(this,t,(n,r)=>n-r))}sum(){return this.o(t=>D(t).sum)}tan(){return g(this,E(Math.tan))}tanh(){return g(this,E(Math.tanh))}trunc(){return g(this,E(Math.trunc))}variance(){return this.o(t=>D(t).variance)}wAvg(t){return this.k(t,n=>Eo(n))}xor(t){return g(this,U(this,t,(n,r)=>!!n!=!!r))}}});var zn,dn,cr=O(()=>{"use strict";St();dt();H();gt();$();zn=class{constructor(t){x(this,"expr",t)}l(t){return g(this.expr,E(n=>R(n)?t(n):null))}ht(t,n){let r=g(this.expr,U(this.expr,t,(o,i)=>R(o)?n(o,i):null));return r.C=void 0,r}agg(t){return g(this.expr,(n,r)=>{let o=n.length,i=new Array(o),a=Object.create(r);for(let s=0;s<o;s++){let l=n[s];if(!R(l)){i[s]=null;continue}let c=l.length;a[Ot]=l;let u=ot(t,a,c);i[s]=R(u)?u[0]??null:u}return i})}all(){return this.l(t=>v(t,n=>!!n,{mode:"every"}))}any(){return this.l(t=>v(t,n=>!!n,{mode:"some"}))}argMax(){return this.l(t=>D(t).maxIdx)}argMin(){return this.l(t=>D(t).minIdx)}contains(t){return this.ht(t,(n,r)=>Array.prototype.includes.call(n,r))}containsAll(t){return this.l(n=>v(t,r=>Array.prototype.includes.call(n,r),{mode:"every"}))}containsAny(t){return this.l(n=>v(t,r=>Array.prototype.includes.call(n,r),{mode:"some"}))}countMatches(t,n={}){return this.ht(t,(r,o)=>At(r,n).frequencies.get(o)??0)}filter(t){return g(this.expr,(n,r)=>{let o=n.length,i=new Array(o),a=Object.create(r);for(let s=0;s<o;s++){let l=n[s];if(!R(l)){i[s]=null;continue}let c=l.length;a[Ot]=l;let u=ot(t,a,c);i[s]=Bn(l,u)}return i})}explode({emptyAsNull:t=!0,keepNulls:n=!0}={}){return g(this.expr,r=>{let o=r.length,i=0;for(let c=0;c<o;c++){let u=r[c];if(R(u)){i+=u.length||(t?1:0);continue}if(u!=null){i+=1;continue}n&&(i+=1)}let a=new Array(i),s=new Int32Array(i),l=0;for(let c=0;c<o;c++){let u=r[c];if(R(u)){let f=u.length;if(f>0){for(let p=0;p<f;p++)s[l]=c,a[l++]=u[p];continue}t&&(s[l]=c,a[l++]=null);continue}if(u!=null){s[l]=c,a[l++]=u;continue}n&&(s[l]=c,a[l++]=null)}return a.rowMap=s,a})}first(t=!0){return this.get(0,t)}gather(t,n=!0){return this.l(r=>{let o=typeof t=="number"?[t]:t,i=o.length,a=new Array(i);for(let s=0;s<i;s++)a[s]=qt(r,o[s],n);return a})}gatherEvery(t={}){return this.l(n=>Mn(n,t))}get(t,n=!0){return this.l(r=>qt(r,t,n))}join(t=",",n={}){return this.l(r=>kn(r,t,n))}last(t=!0){return this.get(-1,t)}len(){return this.lengths()}lengths(){return this.l(t=>t.length)}max(){return this.l(t=>D(t).max)}mean(){return this.l(t=>D(t).mean)}median(){return this.l(t=>Rt(t,.5))}min(){return this.l(t=>D(t).min)}mode(){return this.l(t=>Un(t))}nUnique(t={}){return this.l(n=>At(n,t).count)}reverse(){return this.l(t=>t.slice().reverse())}shift(t=1){return this.l(n=>ho(n,t))}slice(t,n){return this.l(r=>r.slice(t,n))}splice(t,n,...r){return this.l(o=>{let i=[...o];return i.splice(t,n??i.length,...r),i})}sort(t){return this.l(n=>an(n,t))}std(){return this.l(t=>D(t).std)}sum(){return this.l(t=>D(t).sum)}toStruct({upperBound:t,fields:n}={}){return g(this.expr,r=>{let o=r.length,i=new Array(o),a=0;if(Array.isArray(n))a=n.length;else if(typeof t=="number")a=t;else for(let l=0;l<o;l++){let c=r[l];R(c)&&c.length>a&&(a=c.length)}if(a===0)throw new z("toStruct cannot be evaluated: struct width is 0. Provide an upperBound, non-empty fields names, or non-empty lists.");let s=new Array(a);for(let l=0;l<a;l++)typeof n=="function"?s[l]=n(l):s[l]=(Array.isArray(n)?n[l]:null)??`field_${l}`;for(let l=0;l<o;l++){let c=r[l];if(!R(c)){i[l]=null;continue}let u={};for(let f=0;f<a;f++)u[s[f]]=qt(c,f,!0);i[l]=u}return i})}unique(t={}){return this.l(n=>At(n,t).values)}variance(){return this.l(t=>D(t).variance)}eval(t){return g(this.expr,(n,r)=>{let o=n.length,i=new Array(o),a=Object.create(r);for(let s=0;s<o;s++){let l=n[s];if(!R(l)){i[s]=null;continue}let c=l.length;if(a[Ot]=l,t.S!=null&&(t.D==null||t.D.length===0)){let f=t.R!==void 0?t.R:t.p.length,p=t.W(f,a,c),m=t.S(Array.from(p));i[s]=t.tt(f,[m],a)}else i[s]=ot(t,a,c)}return i})}},dn=class extends X{get arr(){return new zn(this)}}});var Yn,yn,fr=O(()=>{"use strict";St();dt();st();H();Yn=class{constructor(t){x(this,"expr",t)}e(t){return g(this.expr,E(n=>t(String(n))))}T(t,n){return t==null?g(this.expr,r=>new Array(r.length).fill(null)):n()}bt(t,n){return n==null?!1:K(n)?(n.lastIndex=0,n.test(t)):t.includes(n)}concat(t){return g(this.expr,U(this.expr,t,(n,r)=>String(n)+String(r)))}contains(t){return this.T(t,()=>this.e(n=>this.bt(n,t)))}containsAny(t){return this.T(t,()=>{let n=Dt(t),r=n.length;return this.e(o=>{for(let i=0;i<r;i++)if(this.bt(o,n[i]))return!0;return!1})})}countMatches(t,n={}){let r=typeof n=="boolean"?n:n?.literal??!1;return this.T(t,()=>this.e(o=>{let i=r?Y(t):t,a=Ct(o,i,{global:!0});if(!a)return 0;let s=a.input.match(a.reg);return s?s.length:0}))}escapeRegex(t={}){return this.e(n=>Y(n,t))}decode(t){return this.e(n=>Xo(n,t.encoding,t))}encode(t){return this.e(n=>Go(n,t.encoding))}decodeUriComponent(){return this.e(t=>{try{return decodeURIComponent(t)}catch{return t}})}encodeUriComponent(){return this.e(t=>{try{return encodeURIComponent(t)}catch{return t}})}endsWith(t){return this.e(n=>n.endsWith(t))}explode(){return this.e(t=>t.split(""))}extract(t,n){return this.T(t,()=>this.e(r=>Fe(r,t,n)))}extractAll(t,n){return this.T(t,()=>this.e(r=>Yo(r,t,n)??[]))}extractGroups(t,n={}){return this.T(t,()=>this.e(r=>Zo(r,t,n)))}extractMany(t,n={}){return this.T(t,()=>this.e(r=>Ho(r,t,n)))}find(t,n={}){return this.T(t,()=>this.e(r=>Xt(r,t,n)))}findMany(t,n={}){return this.T(t,()=>this.e(r=>Qo(r,t,n)))}head(t=1){return this.slice(0,t)}join(t="",n={}){return g(this.expr,E(r=>{let o=Dt(r);return o==null?null:kn(o,t,n)}))}jsonDecode(t={}){return this.e(n=>Re(n,t))}jsonPathMatch(t){return this.e(n=>ko(n,t))}len(){return this.lenChars()}lenBytes(){return this.e(t=>bt.encode(t).length)}lenChars(){return this.e(t=>t.length)}lower(){return this.e(t=>t.toLowerCase())}lpad(t,n=" "){return this.e(r=>r.padStart(t,n))}normalize(t){return this.e(n=>n.normalize(t))}padEnd(t,n=" "){return this.rpad(t,n)}padStart(t,n=" "){return this.lpad(t,n)}replace(t,n,r){return this.T(t,()=>this.e(o=>je(o,t,n,{n:1,...r})??o))}replaceAll(t,n,r){return this.T(t,()=>this.e(o=>je(o,t,n,{...r,n:-1})??o))}replaceMany(t,n,r){return this.T(t,()=>this.e(o=>ei(o,t,n,r)??o))}reverse(){return this.e(t=>t.split("").reverse().join(""))}rpad(t,n=" "){return this.e(r=>r.padEnd(t,n))}slice(t,n){return this.e(r=>{let o=t<0?r.length+t:t,i=n!==void 0?o+n:void 0;return r.slice(o,i)})}split(t,n){return this.e(r=>ti(r,t,n))}startsWith(t){return this.e(n=>n.startsWith(t))}stripChars(t,n){return this.e(r=>rt(r,t,{mode:"both",...n}))}stripCharsEnd(t,n){return this.e(r=>rt(r,t,{mode:"end",...n}))}stripCharsStart(t,n){return this.e(r=>rt(r,t,{mode:"start",...n}))}stripPrefix(t){return this.e(n=>rt(n,t,{mode:"start",maxScanStart:1,maxMatchesStart:1,returnStringOnNull:!0,stringOptions:{literal:!0}}))}stripSuffix(t){return this.e(n=>rt(n,t,{mode:"end",maxScanEnd:1,maxMatchesEnd:1,returnStringOnNull:!0,stringOptions:{literal:!0}}))}tail(t=1){return this.slice(-t)}strptime(t){return this.e(n=>fi(n,t))}toCamelCase(){return this.e(t=>Jt(t,{format:"camel"}))}toDate(){return this.e(t=>P(t,{dateOnly:!0}))}toDatetime(){return this.e(P)}toDecimal(t,n){return this.e(r=>Nn(r,{precision:t,scale:n}))}toInteger(){return this.e(t=>W(t))}toKebabCase(){return this.e(t=>Jt(t,{format:"kebab"}))}toLowerCase(){return this.lower()}toPascalCase(){return this.e(t=>Jt(t,{format:"pascal"}))}toSnakeCase(){return this.e(t=>Jt(t,{format:"snake"}))}toTime(){return this.e(qn)}toTitleCase(){return this.e(t=>Jt(t,{format:"title"}))}toUpperCase(){return this.upper()}trim(){return this.stripChars()}trimEnd(){return this.stripCharsEnd()}trimStart(){return this.stripCharsStart()}upper(){return this.e(t=>t.toUpperCase())}zfill(t){return this.e(n=>n.padStart(t,"0"))}},yn=class extends X{get str(){return new Yn(this)}}});function Gi(e){return Jn(e,"Column reference cannot be null or undefined."),Zn||(Zn=(Q(),ue(Xi)).ColumnExpr),Zn.isColExpr(e)?e:new Zn(e)}var Zn,Hn,gn,pr=O(()=>{"use strict";St();$();Zn=null;Hn=class{constructor(t){x(this,"expr",t);return new Proxy(this,{get(n,r,o){return r in n?Reflect.get(n,r,o):typeof r=="string"?n.field(r):Reflect.get(n,r,o)}})}field(t){let n=g(this.expr,r=>{let o=r.length,i=new Array(o);for(let a=0;a<o;a++){let s=r[a];i[a]=s!=null&&typeof s=="object"?s[t]:null}return i});return n.F=this.expr,n.et=t,n.alias(t)}renameFields(t){return g(this.expr,n=>{let r=n.length,o=new Array(r),i=Object.keys(t),a=i.length;for(let s=0;s<r;s++){let l=n[s];if(l==null||typeof l!="object"){o[s]=null;continue}let c={},u=Object.keys(l),f=u.length;for(let p=0;p<f;p++){let m=u[p];c[m]=l[m]}for(let p=0;p<a;p++){let m=i[p];if(m in c){let d=t[m];c[d]=c[m],delete c[m]}}o[s]=c}return o})}withFields(t){return g(this.expr,(n,r)=>{let o=n.length,i=new Array(o),a=[];if(Array.isArray(t)){let c=t.length;for(let u=0;u<c;u++){let f=t[u],p=Gi(f),m=p.O||p.f;if(!m)throw new k("Expressions passed to struct.withFields must have a name/alias.");a.push({name:m,expr:p})}}else if(t&&typeof t=="object"){let c=Object.keys(t),u=c.length;for(let f=0;f<u;f++){let p=c[f],m=Gi(t[p]);a.push({name:p,expr:m})}}let s=a.length,l=new Array(s);for(let c=0;c<s;c++)l[c]=a[c].expr.evaluate(r,o);for(let c=0;c<o;c++){let u=n[c];if(u==null||typeof u!="object"){i[c]=null;continue}let f={},p=Object.keys(u),m=p.length;for(let d=0;d<m;d++){let y=p[d];f[y]=u[y]}for(let d=0;d<s;d++)f[a[d].name]=l[d][c];i[c]=f}return i})}unnest(){let t=g(this.expr);return t.rt=!0,t.F=this.expr,t}},gn=class extends X{get struct(){return new Hn(this)}}});var Xi={};le(Xi,{ColumnExpr:()=>N,resolveColumnSelectors:()=>Ji});function va(e,t){for(let n of t)for(let r of Object.getOwnPropertyNames(n.prototype))r!=="constructor"&&Object.defineProperty(e.prototype,r,Object.getOwnPropertyDescriptor(n.prototype,r)||Object.create(null))}function $a(e,t,n,r){if(e instanceof N&&e.z?.length)return e.z;if(!(e instanceof N)&&(!C(e)||!("evaluate"in e)||e.f))return null;let o;if(!(e instanceof N))o=()=>!0;else if(e.f==="*"){let s=new Set(e.xt);o=l=>!s.has(l)}else if(e.Y?.length){let s=e.Y,l=s.length;o=c=>{for(let u=0;u<l;u++)if(s[u].lastIndex=0,s[u].test(c))return!0;return!1}}else if(e.X?.length){if(!r)throw new Wn("Cannot resolve DataType column selector without DataFrame schema.");let s=e.X,l=s.length;o=c=>{let u=r[c];if(!u)return!1;for(let f=0;f<l;f++)if(u.matches(s[f]))return!0;return!1}}else return null;let i=[],a=t.length;for(let s=0;s<a;s++){let l=t[s];!n.has(l)&&o(l)&&i.push(l)}return i}function Ji(e,t,n,r,o){let i=[],a=n?new Set(n):new Set;for(let s=0;s<e.length;s++){let l=e[s];if(typeof l=="string"){i.push(new N(l));continue}if(C(l)&&l.rt&&l.F){let u=l.F,f=[],p=l.f;if(typeof p=="string"&&r&&r[p]&&r[p].name==="Struct"&&(f=Object.keys(r[p].fields)),f.length===0&&o){let y=Object.keys(o)[0],b=y?o[y].length:0,h=u.evaluate(o,b),w=h.length;for(let A=0;A<w;A++){let T=h[A];if(T!=null&&typeof T=="object"){f=Object.keys(T);break}}}let m=f.length;if(m>0){for(let d=0;d<m;d++){let y=f[d],b=u.struct.field(y);i.push(b)}continue}}let c=$a(l,t,a,r);if(c!==null)for(let u=0;u<c.length;u++){let f=new N(c[u]);f.p=[...l.p||[]],f.S=l.S,f.U=l.U,f.R=l.R,f.D=l.D,l._&&(f._=l._),l.O&&l.O!=="*"&&(f.O=l.O),i.push(f)}else i.push(l)}return i}var N,Q=O(()=>{"use strict";St();ur();fr();mr();cr();pr();H();er();$();N=class e extends X{constructor(n){super();x(this,"f","");x(this,"z");x(this,"xt",[]);x(this,"wt");x(this,"X");x(this,"Ct");x(this,"Y");if(K(n)){this.Y=[n];return}if(n instanceof j||typeof n=="function"){this.X=[n];return}if(!Array.isArray(n)){this.f=String(n),this.O=this.f;return}if(v(n,a=>a instanceof j||typeof a=="function",{mode:"some"})){this.X=n;return}let r=n.length,o=[],i;for(let a=0;a<r;a++){let s=n[a];K(s)?(i??(i=[])).push(s):o.push(String(s))}i&&(this.Y=i),o.length>0&&(this.z=o)}static isColExpr(n){if(!C(n))return!1;try{return"evaluate"in n&&typeof n.evaluate=="function"}catch{return!1}}static toColExpr(n){return Jn(n,"Column reference cannot be null or undefined."),e.isColExpr(n)?n:new e(n)}};va(N,[mn,yn,hn,dn,gn])});function dr(e,t={strict:!0}){let n=t,r=new N(ce);return r.V=e,n.name&&(r.O=n.name),r.p.push(o=>{let i=o.length,a=n.strict!==!1,s=(h,w)=>h===void 0?w:at(h<0?i+h:h,{min:0,max:i}),l=s(n.startIndex,0),c=s(n.endIndex,i),u=Math.max(0,c-l),f=n.n!==void 0?n.n:u;if(a){if(f!==i)throw new kt(`Column height mismatch: seqRange length ${f} does not match DataFrame height ${i}`)}else{let h=n.pad??!1,w=n.truncate??!1;if(h&&!w&&f>u)throw new kt(`Cannot pad seqRange output: specified length ${f} starting at index ${l} exceeds slice width ${u} (requires truncation).`);if(w&&!h&&f<u)throw new kt(`Cannot truncate seqRange output: specified length ${f} starting at index ${l} is less than slice width ${u} (requires padding).`)}let p=n.mode||"cumulative",m=n.step!==void 0?n.step:1,d=n.dtype?h=>n.dtype.coerce(h):h=>h,y=d(!a&&n.padValue!==void 0?n.padValue:null),b=a&&n.dtype?.allocate?n.dtype.allocate(i):new Array(i).fill(y);return go(b,e,{mode:p,step:m,coerce:d,startIndex:a?0:l,endIndex:a?i:Math.min(l+f,c)}),b}),r}var yr=O(()=>{"use strict";Q();gt();$();H()});function Bt(e,t={}){let n=dr(e,{...t,mode:"constant"});return n.B=!0,n}var Qn=O(()=>{"use strict";yr()});var Ki={};le(Ki,{duration:()=>Wi});function Wi(e={}){if(typeof e=="string"){let a=ji(e,{to:"ms"}),s=Bt(a).alias("duration");return s.N=new Z("ms"),s}let t=0,n=null,r=!1,o=e;for(let a in o){let s=Qt[a];if(s===void 0)continue;let l=o[a];if(l==null)continue;if(r=!0,_(l)){t+=l*s;continue}let c=N.toColExpr(l).mul(s);n=n?n.add(c):c}if(!r)throw new k("At least one duration component must be specified for $df.duration().");let i=n?t!==0?n.add(Bt(t)):n:Bt(t);return i.N=new Z("ms"),i.alias("duration")}var gr=O(()=>{"use strict";Q();Qn();Ht();$();H()});var te,hn,mr=O(()=>{"use strict";Ht();$();St();dt();H();st();te=class{constructor(t){x(this,"expr",t)}ot(){let t=this.expr.N;return t instanceof mt?t.timeZone:null}It(){let t=this.expr.N;return t instanceof mt?t.timeUnit:null}it(t){return g(this.expr,E(n=>{let r=P(n);return r?t(r):null}))}castTimeUnit(t){return this.expr.cast(new mt(t,this.ot()))}century(t){return this.year(t).sub(1).floordiv(100).add(1)}convertTimeZone(t){let n=this.ot();if(this.expr.N instanceof mt&&n===null)throw new k('convertTimeZone() requires a timezone-aware Datetime column. Use .dt.replace({ timeZone: "..." }) to assign a timezone first.');return this.expr.cast(new mt(this.It()??"ms",t))}date(){return this.replace({hour:0,minute:0,second:0,ms:0})}day(t){return this.strftime({format:"%d",timeZone:t}).cast(G)}daysInMonth(t){return this.monthEnd().dt.day(t)}epoch(t="ms"){return this.it(n=>ai(n,t))}hour(t){return this.strftime({format:"%H",timeZone:t}).cast(G)}isBusinessDay(t={}){return this.it(n=>di(n,t))}isLeapYear(t){let n=this.year(t);return n.mod(4).eq(0).and(n.mod(100).ne(0)).or(n.mod(400).eq(0)).cast(Xn)}isoWeek(t){return this.strftime({format:"%V",timeZone:t}).cast(G)}isoYear(t){return this.strftime({format:"%G",timeZone:t}).cast(G)}microsecond(t){return this.strftime({format:"%f",timeZone:t}).cast(G)}millennium(t){return this.year(t).sub(1).floordiv(1e3).add(1)}millisecond(t){return this.strftime({format:"%ms",timeZone:t}).cast(G)}minute(t){return this.strftime({format:"%M",timeZone:t}).cast(G)}month(t){return this.strftime({format:"%m",timeZone:t}).cast(G)}monthEnd(){return this.replace({day:-1,hour:0,minute:0,second:0,ms:0})}monthStart(){return this.replace({day:1,hour:0,minute:0,second:0,ms:0})}nanosecond(t){return this.microsecond(t).mul(1e3)}offsetDay(t,n={}){let o=n?.excludeWeekdays?.length||n?.holidays||n?.roll?g(this.expr,U(this.expr,t,(a,s)=>{let l=P(a);return l?mi(l,s,n):null})):t,{duration:i}=(gr(),ue(Ki));return this.expr.add(i({days:o}))}ordinalDay(t){return this.strftime({format:"%j",timeZone:t}).cast(G)}quarter(t){return this.month(t).div(3).ceil()}replace(t){return g(this.expr,E(n=>{let r=P(n);return r?yi(r,t):null}))}second(){return this.strftime({format:"%S",timeZone:"UTC"}).cast(G)}strftime(t){let n=this.ot(),r=n&&!t.timeZone?{...t,timeZone:n}:t;return this.it(o=>Ve(o,r))}time(){return this.strftime({format:"%H:%M:%S.%ms",timeZone:"UTC"})}timestamp(t="ms"){return this.epoch(t)}totalDays(){return this.totalHours().div(24)}totalHours(){return this.totalMinutes().div(60)}totalMicroseconds(){return this.totalMilliseconds().mul(en)}totalMilliseconds(){return this.expr}totalMinutes(){return this.totalSeconds().div(60)}totalNanoseconds(){return this.totalMilliseconds().mul(rn)}totalSeconds(){return this.totalMilliseconds().div(tt)}utcOffset(t,n={}){return g(this.expr,E(r=>{let o=P(r);return o?Le(o,t,n):null}))}week(t){return this.isoWeek(t)}weekday(t){return this.strftime({format:"%u",timeZone:t}).cast(G)}year(t){return this.strftime({format:"%Y",timeZone:t}).cast(G)}},hn=class extends X{get dt(){return new te(this)}}});function qa(){return new N("*")}var zi=O(()=>{"use strict";Q()});function Ga(e){let t=new N("*");return t.xt=Array.isArray(e)?e:[e],t}var Yi=O(()=>{"use strict";Q()});function Xa(...e){let t=e.length===1&&Array.isArray(e[0])?e[0]:e,n=new N(fe);return n.p.push((r,o)=>{let i=r.length,a=t.length,s=new Array(a),l=new Array(a);for(let u=0;u<a;u++){let f=t[u],p=Ut(f,o,i);s[u]=p,l[u]=Ft(f,p,o,i)}let c=new Array(i);for(let u=0;u<i;u++){let f=null;for(let p=0;p<a;p++){let m=s[p],d=l[p]?m[u]:m;if(d!=null){f=d;break}}c[u]=f}return c}),n}var Zi=O(()=>{"use strict";Q();dt();gt()});function Ja(e){return new bn([e])}var bn,ne,Hi=O(()=>{"use strict";Q();dt();gt();bn=class{constructor(t,n=[]){x(this,"_predicates",t);x(this,"_values",n)}then(t){return new ne(this.st,[...this.$,t])}},ne=class e extends N{constructor(n=[],r=[],o=null){super(me);x(this,"_predicates",n);x(this,"_values",r);x(this,"_otherwise",o);this.p=[(i,a)=>{let s=i.length,l=this.st,c=this.$,u=l.length,f=new Array(u),p=new Array(u),m=new Array(u),d=new Array(u);for(let A=0;A<u;A++){let T=l[A],I=c[A],F=Ut(T,a,s),yt=Ut(I,a,s);f[A]=F,p[A]=yt,m[A]=Ft(T,F,a,s),d[A]=Ft(I,yt,a,s)}let y=this.ut,b=Ut(y,a,s),h=Ft(y,b,a,s),w=new Array(s);for(let A=0;A<s;A++){let T=!1;for(let I=0;I<u;I++)if((m[I]?f[I][A]:f[I])===!0){w[A]=d[I]?p[I][A]:p[I],T=!0;break}T||(w[A]=h?b[A]:b)}return w}]}get Rt(){return this.ut}get ct(){return this.ut!=null?[...this.$,this.ut]:this.$}when(n){return new bn([...this.st,n],this.$)}otherwise(n){return new e(this.st,this.$,n)}}});function Wa(e){return N.toColExpr(e).implode()}var Qi=O(()=>{"use strict";Q()});function Ka(){return new N(Ot)}var ts=O(()=>{"use strict";Q();gt()});function za(e,...t){let n;Array.isArray(e)||e&&typeof e=="object"&&!N.isColExpr(e)?n=e:n=[e,...t];let r=Bt({}).struct.withFields(n);return delete r.B,delete r.V,r.f=pe,r.alias("struct")}var ns=O(()=>{"use strict";Q();Qn();gt()});function jt(e,t){if(e==null)return;if(e instanceof j)return e;if(typeof e=="object"&&("_ops"in e||"_literalValue"in e||"_targetType"in e))return es(e,t);let n=L(e);if(typeof n=="string")return t[n]??S.Utf8;if(typeof n=="boolean")return S.Boolean;if(typeof n=="bigint")return vt(n,{range:"Int64"})?S.Int64:S.UInt64;if(_(n))return nt(n,{range:"Int32"})?S.Int32:Number.isInteger(n)?S.Int64:S.Float64;if(M(n))return S.Datetime;if(Bo(n,{strict:!0}))return S.Binary;if(Array.isArray(n)){let r,o=n.length;for(let i=0;i<o;i++){let a=n[i];if(a!=null&&(r=jt(a,t)))break}return S.Array(r??S.Utf8)}if(et(n)){let r=ht?ht.call(n):n.constructor.name,o=Ya[r];return o?S.Array(o):S.Binary}if(C(n))return S.Object}function hr(e,t,n){if(!e||!t)return;if(n&&n.length>0){let s=!1;for(let l=0;l<n.length;l++){let c=n[l];if(c!=null){if(typeof c!="boolean"){s=!1;break}s=!0}}if(s)return S.Boolean}let r=e instanceof Z,o=t instanceof Z,i=e.isTemporal&&!r,a=t.isTemporal&&!o;if(i||a){if(i&&a){let s=e.timeUnit||t.timeUnit||"ms";return new Z(s)}return i?e:t}if(r||o)return r?e:t;if(e.isUtf8||t.isUtf8)return S.Utf8;if(e.isNumeric&&t.isNumeric){let s=e instanceof Yt||t instanceof Yt,l=e instanceof zt||t instanceof zt,c=e instanceof Et||t instanceof Et;if(s||l&&c)return S.Float64;if(l)return S.Float32;if(c)return e instanceof Et?e:t;if(n!==void 0){let p={range:{min:-1/0,max:1/0}},m=n.length;for(let d=0;d<m;d++){let y=n[d];if(_(y)&&!nt(y,p))return S.Float64}}if(e===t)return e;let u=e.name,f=t.name;return u.endsWith("64")||f.endsWith("64")?S.Int64:u.endsWith("32")||f.endsWith("32")?u==="UInt32"&&f==="UInt32"?S.UInt32:S.Int32:u.endsWith("16")||f.endsWith("16")?u==="UInt16"&&f==="UInt16"?S.UInt16:S.Int16:u==="UInt8"&&f==="UInt8"?S.UInt8:S.Int8}}function es(e,t,n){if(!e)return;if(e.N)return e.N;if(e.wt instanceof j)return e.wt;if(e.B&&e.V!==void 0)return jt(e.V,t);if(e.C)return hr(jt(e.C.left,t),jt(e.C.right,t),n);if(e.ct){let a,s=e.ct.length;for(let l=0;l<s;l++){let c=jt(e.ct[l],t);c&&(a?a!==c&&a.isNumeric&&c.isNumeric&&(a=hr(a,c,n)??a):a=c)}if(a)return a}if(e.F&&e.et){let a=jt(e.F,t);if(a instanceof pn)return a.fields?.[e.et]}let r=e.f?t[e.f]:void 0,o=n?.[0],i=(!e.p||e.p.length===0)&&!e.S&&!e._;if(r){if(r instanceof Zt&&(e.rt||n?.rowMap))return r.innerType;if(!(r instanceof Zt)&&Array.isArray(o))return S.Array(r);if(i||r.isTemporal&&e.S&&(M(o)||typeof o=="string")||r instanceof Z&&e.S&&_(o))return r}if(e.S&&_(o))return!Number.isInteger(o)||r?.isNumeric&&!(r instanceof Z)?S.Float64:S.Int32}var Ya,rs=O(()=>{"use strict";Ht();er();H();Ya={Int8Array:S.Int8,Uint8Array:S.UInt8,Uint8ClampedArray:S.UInt8,Int16Array:S.Int16,Uint16Array:S.UInt16,Int32Array:S.Int32,Uint32Array:S.UInt32,BigInt64Array:S.Int64,BigUint64Array:S.UInt64,Float32Array:S.Float32,Float64Array:S.Float64}});var Za={};le(Za,{ALL_COLUMNS_MARKER:()=>Tt,ArrayExpr:()=>dn,ArrayExprNamespace:()=>zn,COALESCE_MARKER:()=>fe,ColumnExpr:()=>N,DURATION_MARKER:()=>ps,DateTimeExprNamespace:()=>te,ELEMENT_MARKER:()=>Ot,ExprBase:()=>X,LITERAL_MARKER:()=>ce,STRUCT_MARKER:()=>pe,StandardExpr:()=>mn,StringExpr:()=>yn,StringExprNamespace:()=>Yn,StructExpr:()=>gn,StructExprNamespace:()=>Hn,TemporalExpr:()=>hn,WHEN_MARKER:()=>me,When:()=>bn,WhenThen:()=>ne,WhenThenChain:()=>bn,all:()=>qa,buildCanonicalSet:()=>sr,coalesce:()=>Xa,compareMissing:()=>lr,computeIsIn:()=>ar,computeRank:()=>Kn,deduceBinaryType:()=>hr,derive:()=>g,duration:()=>Wi,element:()=>Ka,evalBinaryOp:()=>ir,evalUnaryOp:()=>qi,evaluateArg:()=>Ut,evaluateExpression:()=>ot,exclude:()=>Ga,implode:()=>Wa,isEvaluatedColumn:()=>Ft,kleeneBinary:()=>U,kleeneUnary:()=>E,lit:()=>Bt,resolveColumnSelectors:()=>Ji,resolveExprOutputType:()=>es,resolveOperandType:()=>jt,seqRange:()=>dr,struct:()=>za,when:()=>Ja});module.exports=ue(Za);var Ha=O(()=>{gt();Ar();St();ur();cr();fr();mr();pr();Q();Qn();zi();Yi();Zi();Hi();Qi();yr();ts();ns();gr();rs();dt()});Ha();0&&(module.exports={ALL_COLUMNS_MARKER,ArrayExpr,ArrayExprNamespace,COALESCE_MARKER,ColumnExpr,DURATION_MARKER,DateTimeExprNamespace,ELEMENT_MARKER,ExprBase,LITERAL_MARKER,STRUCT_MARKER,StandardExpr,StringExpr,StringExprNamespace,StructExpr,StructExprNamespace,TemporalExpr,WHEN_MARKER,When,WhenThen,WhenThenChain,all,buildCanonicalSet,coalesce,compareMissing,computeIsIn,computeRank,deduceBinaryType,derive,duration,element,evalBinaryOp,evalUnaryOp,evaluateArg,evaluateExpression,exclude,implode,isEvaluatedColumn,kleeneBinary,kleeneUnary,lit,resolveColumnSelectors,resolveExprOutputType,resolveOperandType,seqRange,struct,when});