@milaboratories/pl-model-common 1.15.9 → 1.16.1

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 (47) hide show
  1. package/dist/{base32-encode.d.ts → base32_encode.d.ts} +1 -1
  2. package/dist/{base32-encode.d.ts.map → base32_encode.d.ts.map} +1 -1
  3. package/dist/bmodel/block_config.d.ts +42 -0
  4. package/dist/bmodel/block_config.d.ts.map +1 -0
  5. package/dist/bmodel/code.d.ts +11 -0
  6. package/dist/bmodel/code.d.ts.map +1 -0
  7. package/dist/bmodel/container.d.ts +46 -0
  8. package/dist/bmodel/container.d.ts.map +1 -0
  9. package/dist/bmodel/index.d.ts +6 -0
  10. package/dist/bmodel/index.d.ts.map +1 -0
  11. package/dist/bmodel/normalization.d.ts +10 -0
  12. package/dist/bmodel/normalization.d.ts.map +1 -0
  13. package/dist/{block.d.ts → bmodel/types.d.ts} +1 -1
  14. package/dist/bmodel/types.d.ts.map +1 -0
  15. package/dist/drivers/pframe/table_calculate.d.ts +8 -2
  16. package/dist/drivers/pframe/table_calculate.d.ts.map +1 -1
  17. package/dist/flags/block_flags.d.ts +20 -0
  18. package/dist/flags/block_flags.d.ts.map +1 -0
  19. package/dist/flags/flag_utils.d.ts +56 -0
  20. package/dist/flags/flag_utils.d.ts.map +1 -0
  21. package/dist/flags/index.d.ts +4 -0
  22. package/dist/flags/index.d.ts.map +1 -0
  23. package/dist/flags/type_utils.d.ts +35 -0
  24. package/dist/flags/type_utils.d.ts.map +1 -0
  25. package/dist/index.d.ts +3 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +732 -577
  30. package/dist/index.mjs.map +1 -1
  31. package/package.json +3 -3
  32. package/src/bmodel/block_config.ts +69 -0
  33. package/src/bmodel/code.ts +12 -0
  34. package/src/bmodel/container.ts +58 -0
  35. package/src/bmodel/index.ts +5 -0
  36. package/src/bmodel/normalization.ts +111 -0
  37. package/src/drivers/pframe/table_calculate.ts +10 -1
  38. package/src/flags/block_flags.ts +43 -0
  39. package/src/flags/flag_utils.test.ts +162 -0
  40. package/src/flags/flag_utils.ts +104 -0
  41. package/src/flags/index.ts +3 -0
  42. package/src/flags/type_utils.ts +43 -0
  43. package/src/index.ts +3 -1
  44. package/src/plid.ts +1 -1
  45. package/dist/block.d.ts.map +0 -1
  46. /package/src/{base32-encode.ts → base32_encode.ts} +0 -0
  47. /package/src/{block.ts → bmodel/types.ts} +0 -0
@@ -5,4 +5,4 @@ interface Options {
5
5
  }
6
6
  export declare function base32Encode(data: Data, variant: 'RFC3548' | 'RFC4648' | 'RFC4648-HEX' | 'Crockford', options?: Options): string;
7
7
  export {};
8
- //# sourceMappingURL=base32-encode.d.ts.map
8
+ //# sourceMappingURL=base32_encode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base32-encode.d.ts","sourceRoot":"","sources":["../src/base32-encode.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG,SAAS,GAAG,UAAU,GAAG,iBAAiB,GAAG,WAAW,CAAC;AAarE,UAAU,OAAO;IACf,2HAA2H;IAC3H,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAMD,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,EAC5D,OAAO,CAAC,EAAE,OAAO,UAgDlB"}
1
+ {"version":3,"file":"base32_encode.d.ts","sourceRoot":"","sources":["../src/base32_encode.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG,SAAS,GAAG,UAAU,GAAG,iBAAiB,GAAG,WAAW,CAAC;AAarE,UAAU,OAAO;IACf,2HAA2H;IAC3H,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAMD,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,EAC5D,OAAO,CAAC,EAAE,OAAO,UAgDlB"}
@@ -0,0 +1,42 @@
1
+ import { BlockCodeFeatureFlags } from '../flags';
2
+ import { BlockCodeWithInfo, Code } from './code';
3
+ import { BlockRenderingMode } from './types';
4
+ /**
5
+ * BroadActiveHandleDescriptor = TypedConfigOrConfigLambda,
6
+ * NarrowActiveHandleDescriptor = ConfigRenderLambda
7
+ */
8
+ export type BlockConfigV3Generic<Args = unknown, UiState = unknown, BroadActiveHandleDescriptor = unknown, NarrowActiveHandleDescriptor extends BroadActiveHandleDescriptor = BroadActiveHandleDescriptor, Outputs extends Record<string, BroadActiveHandleDescriptor> = Record<string, BroadActiveHandleDescriptor>> = {
9
+ /** SDK version used by the block */
10
+ readonly sdkVersion: string;
11
+ /** Main rendering mode for the block */
12
+ readonly renderingMode: BlockRenderingMode;
13
+ /** Initial value for the args when block is added to the project */
14
+ readonly initialArgs: Args;
15
+ /** Initial value for the args when block is added to the project */
16
+ readonly initialUiState: UiState;
17
+ /**
18
+ * Config to determine whether the block can be executed with current
19
+ * arguments.
20
+ *
21
+ * Optional to support earlier SDK version configs.
22
+ * */
23
+ readonly inputsValid: BroadActiveHandleDescriptor;
24
+ /** Configuration to derive list of section for the left overview panel */
25
+ readonly sections: BroadActiveHandleDescriptor;
26
+ /** Lambda to derive block title */
27
+ readonly title?: NarrowActiveHandleDescriptor;
28
+ /**
29
+ * Lambda returning list of upstream blocks this block enriches with its exports,
30
+ * influences dependency graph construction
31
+ * */
32
+ readonly enrichmentTargets?: NarrowActiveHandleDescriptor;
33
+ /** Configuration for the output cells */
34
+ readonly outputs: Outputs;
35
+ /** Config code bundle */
36
+ readonly code?: Code;
37
+ /** Feature flags for the block Model and UI code. */
38
+ readonly featureFlags?: BlockCodeFeatureFlags;
39
+ };
40
+ export type BlockConfigGeneric = BlockConfigV3Generic;
41
+ export declare function extractCodeWithInfo(cfg: BlockConfigV3Generic): BlockCodeWithInfo | undefined;
42
+ //# sourceMapping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qBAAqB,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEtD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,oBAAoB,GAAG,iBAAiB,GAAG,SAAS,CAO5F"}
@@ -0,0 +1,11 @@
1
+ import { BlockCodeFeatureFlags } from '../flags';
2
+ export type Code = {
3
+ type: 'plain';
4
+ content: string;
5
+ };
6
+ export type BlockCodeWithInfo = {
7
+ readonly code: Code;
8
+ readonly sdkVersion: string;
9
+ readonly featureFlags: BlockCodeFeatureFlags | undefined;
10
+ };
11
+ //# sourceMappingURL=code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../src/bmodel/code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC1D,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { BlockConfigV3Generic } from './block_config';
2
+ import { Code } from './code';
3
+ import { BlockRenderingMode } from './types';
4
+ /** Container simplifying maintenance of forward and backward compatibility */
5
+ export type BlockConfigContainer = {
6
+ /** Actual config */
7
+ readonly v3: Omit<BlockConfigV3Generic, 'code'>;
8
+ /** Config code bundle */
9
+ readonly code?: Code;
10
+ /**
11
+ * For backward compatibility
12
+ * @deprecated
13
+ */
14
+ readonly sdkVersion?: string;
15
+ /**
16
+ * For backward compatibility
17
+ * @deprecated
18
+ */
19
+ readonly renderingMode?: BlockRenderingMode;
20
+ /**
21
+ * For backward compatibility
22
+ * @deprecated
23
+ */
24
+ readonly initialArgs?: unknown;
25
+ /**
26
+ * For backward compatibility
27
+ * @deprecated
28
+ */
29
+ readonly canRun?: unknown;
30
+ /**
31
+ * For backward compatibility
32
+ * @deprecated
33
+ */
34
+ readonly inputsValid?: unknown;
35
+ /**
36
+ * For backward compatibility
37
+ * @deprecated
38
+ */
39
+ readonly sections?: unknown;
40
+ /**
41
+ * For backward compatibility
42
+ * @deprecated
43
+ */
44
+ readonly outputs?: Record<string, unknown>;
45
+ };
46
+ //# sourceMappingURL=container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/bmodel/container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,8EAA8E;AAC9E,MAAM,MAAM,oBAAoB,GAAG;IACjC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;IAEhD,yBAAyB;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IAMrB;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAE5C;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAE/B;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAE/B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './block_config';
2
+ export * from './code';
3
+ export * from './types';
4
+ export * from './container';
5
+ export * from './normalization';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bmodel/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { BlockConfigGeneric } from './block_config';
2
+ import { BlockConfigContainer } from './container';
3
+ /**
4
+ * Takes universal config, and converts it into latest config structure.
5
+ *
6
+ * **Important**: This operation is not meant to be executed recusively.
7
+ * In no circumstance result of this function should be persisted!
8
+ * */
9
+ export declare function extractConfigGeneric(cfg: BlockConfigContainer): BlockConfigGeneric;
10
+ //# sourceMappingURL=normalization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalization.d.ts","sourceRoot":"","sources":["../../src/bmodel/normalization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAcxD;;;;;KAKK;AACL,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,oBAAoB,GAAG,kBAAkB,CAyFlF"}
@@ -1,2 +1,2 @@
1
1
  export type BlockRenderingMode = 'Light' | 'Heavy' | 'DualContextHeavy';
2
- //# sourceMappingURL=block.d.ts.map
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bmodel/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,kBAAkB,CAAC"}
@@ -106,6 +106,12 @@ export interface SingleValueEqualPredicate {
106
106
  /** Reference value, NA values will not match */
107
107
  readonly reference: string | number;
108
108
  }
109
+ export interface SingleValueInSetPredicate {
110
+ /** Comparison operator */
111
+ readonly operator: 'InSet';
112
+ /** Reference values, NA values will not match */
113
+ readonly references: (string | number)[];
114
+ }
109
115
  export interface SingleValueIEqualPredicate {
110
116
  /** Comparison operator (case insensitive) */
111
117
  readonly operator: 'IEqual';
@@ -221,7 +227,7 @@ export interface SingleValueOrPredicateV2 {
221
227
  readonly operands: SingleValuePredicateV2[];
222
228
  }
223
229
  /** Filtering predicate for a single axis or column value */
224
- export type SingleValuePredicateV2 = SingleValueIsNAPredicate | SingleValueEqualPredicate | SingleValueLessPredicate | SingleValueLessOrEqualPredicate | SingleValueGreaterPredicate | SingleValueGreaterOrEqualPredicate | SingleValueStringContainsPredicate | SingleValueMatchesPredicate | SingleValueStringContainsFuzzyPredicate | SingleValueNotPredicateV2 | SingleValueAndPredicateV2 | SingleValueOrPredicateV2 | SingleValueIEqualPredicate | SingleValueStringIContainsPredicate | SingleValueStringIContainsFuzzyPredicate;
230
+ export type SingleValuePredicateV2 = SingleValueIsNAPredicate | SingleValueEqualPredicate | SingleValueInSetPredicate | SingleValueLessPredicate | SingleValueLessOrEqualPredicate | SingleValueGreaterPredicate | SingleValueGreaterOrEqualPredicate | SingleValueStringContainsPredicate | SingleValueMatchesPredicate | SingleValueStringContainsFuzzyPredicate | SingleValueNotPredicateV2 | SingleValueAndPredicateV2 | SingleValueOrPredicateV2 | SingleValueIEqualPredicate | SingleValueStringIContainsPredicate | SingleValueStringIContainsFuzzyPredicate;
225
231
  /**
226
232
  * Filter PTable records based on specific axis or column value. If this is an
227
233
  * axis value filter and the axis is part of a partitioning key in some of the
@@ -252,7 +258,7 @@ export interface PTableDef<Col> {
252
258
  /** Join tree to populate the PTable */
253
259
  readonly src: JoinEntry<Col>;
254
260
  /** Partition filters */
255
- readonly partitionFilters: PTableRecordSingleValueFilterV2[];
261
+ readonly partitionFilters: PTableRecordFilter[];
256
262
  /** Record filters */
257
263
  readonly filters: PTableRecordFilter[];
258
264
  /** Table sorting */
@@ -1 +1 @@
1
- {"version":3,"file":"table_calculate.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/table_calculate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,8DAA8D;AAC9D,MAAM,WAAW,eAAe,CAAC,GAAG;IAClC,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAExB,mBAAmB;IACnB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;CACtB;AAED;;;KAGK;AACL,MAAM,WAAW,kBAAkB;IACjC,gCAAgC;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAE1B,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CACpC;AAED,8DAA8D;AAC9D,MAAM,WAAW,qBAAqB,CAAC,GAAG;IACxC,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAE9B,mBAAmB;IACnB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IAErB,oBAAoB;IACpB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAE1B,qCAAqC;IACrC,QAAQ,CAAC,WAAW,EAAE,kBAAkB,EAA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AC,CAAC;IAE7B,qBAAqB;IACrB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAEvC,oBAAoB;IACpB,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,CAAC;CACnC,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,0BAA0B,GAAG,oBAAoB,EAAE,CAAC;AAEhE,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,EACjC,GAAG,EAAE,SAAS,CAAC,EAAE,CAAC,EAClB,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,GAChB,SAAS,CAAC,EAAE,CAAC,CAEf;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,EACjC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC,EACpB,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,GAChB,SAAS,CAAC,EAAE,CAAC,CA+Bf"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Block-specific feature flags. Define flags that are interpreted by the desktop app to select
3
+ * appropriate API to expose into Model and UI runtimes.
4
+ *
5
+ * Flags are split into two categories:
6
+ * - supports... - those flags tells the desktop app that the block supports certain APIs, but can without them as well
7
+ * - requires... - those flags tells the desktop app that the block requires certain APIs, and if desktop app doesn't support it, it can't be used in the block
8
+ */
9
+ export type BlockCodeFeatureFlags = Record<`supports${string}`, boolean | number | undefined> & Record<`requires${string}`, boolean | number | undefined>;
10
+ /**
11
+ * Known block flags. Flags are set during model compilation, see `BlockModel.create` for more details and for initial values.
12
+ */
13
+ export type BlockCodeKnownFeatureFlags = {
14
+ readonly supportsLazyState?: boolean;
15
+ readonly requiresModelAPIVersion?: number;
16
+ readonly requiresUIAPIVersion?: number;
17
+ };
18
+ export declare const AllSupportsFeatureFlags: readonly ["supportsLazyState"];
19
+ export declare const AllRequiresFeatureFlags: readonly ["requiresUIAPIVersion", "requiresModelAPIVersion"];
20
+ //# sourceMappingURL=block_flags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block_flags.d.ts","sourceRoot":"","sources":["../../src/flags/block_flags.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,WAAW,MAAM,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAAC,WAAW,MAAM,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAE1J;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,uBAAuB,gCACF,CAAC;AAEnC,eAAO,MAAM,uBAAuB,8DAC4B,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { BlockCodeFeatureFlags, BlockCodeKnownFeatureFlags } from './block_flags';
2
+ import { FilterKeysByPrefix } from './type_utils';
3
+ export declare function checkBlockFlag(flags: BlockCodeFeatureFlags | undefined, flag: keyof BlockCodeKnownFeatureFlags, flagValue?: boolean | number): boolean;
4
+ /**
5
+ * Extracts all requirements from the feature flags.
6
+ * @param flags - The feature flags.
7
+ * @returns A set of requirements.
8
+ */
9
+ export declare function extractAllRequirements(flags: BlockCodeFeatureFlags | undefined): Set<`requires${string}`>;
10
+ /**
11
+ * Extracts all supports from the feature flags.
12
+ * @param flags - The feature flags.
13
+ * @returns A set of supports.
14
+ */
15
+ export declare function extractAllSupports(flags: BlockCodeFeatureFlags | undefined): Set<`supports${string}`>;
16
+ export declare class IncompatibleFlagsError extends Error {
17
+ readonly incompatibleFlags: Map<`requires${string}`, number | boolean>;
18
+ name: string;
19
+ constructor(incompatibleFlags: Map<`requires${string}`, number | boolean>);
20
+ }
21
+ /**
22
+ * A type that represents a supported requirement.
23
+ * @remarks
24
+ * This type is used to represent a supported requirement.
25
+ * It is a subtype of `BlockCodeKnownFeatureFlags` and is used to represent a supported requirement.
26
+ * It is used to represent a supported requirement.
27
+ */
28
+ export type SupportedRequirement = FilterKeysByPrefix<BlockCodeKnownFeatureFlags, 'requires'>;
29
+ export declare class RuntimeCapabilities {
30
+ private readonly supportedRequirements;
31
+ /**
32
+ * Adds a supported requirement to the runtime capabilities.
33
+ * @param requirement - The requirement.
34
+ * @param value - The value of the requirement. If not provided, defaults to true.
35
+ */
36
+ addSupportedRequirement(requirement: SupportedRequirement, value?: number | boolean): this;
37
+ /**
38
+ * Returns a map of incompatible flags. If the block flags are compatible, returns undefined.
39
+ * @param blockFlags - The block flags.
40
+ * @returns A map of incompatible flags, or undefined if the block flags are compatible.
41
+ */
42
+ getIncompatibleFlags(blockFlags: BlockCodeFeatureFlags | undefined): Map<`requires${string}`, number | boolean> | undefined;
43
+ /**
44
+ * Checks if the block flags are compatible with the runtime capabilities.
45
+ * @param blockFlags - The block flags.
46
+ * @returns True if the block flags are compatible, false otherwise.
47
+ */
48
+ checkCompatibility(blockFlags: BlockCodeFeatureFlags | undefined): boolean;
49
+ /**
50
+ * Throws an error if the block flags are incompatible with the runtime capabilities.
51
+ * @param blockFlags - The block flags.
52
+ * @throws IncompatibleFlagsError if the block flags are incompatible with the runtime capabilities.
53
+ */
54
+ throwIfIncompatible(blockFlags: BlockCodeFeatureFlags | undefined): void;
55
+ }
56
+ //# sourceMappingURL=flag_utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flag_utils.d.ts","sourceRoot":"","sources":["../../src/flags/flag_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,wBAAgB,cAAc,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,EAAE,IAA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0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/flags/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Helper to filter keys of a type by a prefix.
3
+ */
4
+ export type FilterKeysByPrefix<T, P extends string> = keyof {
5
+ [K in keyof T as K extends `${P}${string}` ? K : never]: T[K];
6
+ };
7
+ /**
8
+ * Helper to assert that two types are equal. This will cause a compile-time error if they are not.
9
+ * We use this to ensure all feature flags are accounted for in the arrays below.
10
+ */
11
+ export type AssertKeysEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? unknown : {
12
+ error: 'Feature flag definitions are out of sync';
13
+ expected: T;
14
+ actual: U;
15
+ };
16
+ /**
17
+ * Checks if two types are exactly equal.
18
+ * Returns 'true' if they are, 'false' otherwise.
19
+ */
20
+ export type Is<T, U> = (<G>() => G extends T ? 1 : 2) extends <G>() => G extends U ? 1 : 2 ? true : false;
21
+ /**
22
+ * Checks if T is a subtype of U.
23
+ * Returns 'true' if it is, 'false' otherwise.
24
+ */
25
+ export type IsSubtypeOf<T, U> = T extends U ? true : false;
26
+ /**
27
+ * Asserts that a condition is true at compile time.
28
+ * Causes a compile error if T is not 'true'.
29
+ */
30
+ export type Assert<T extends true> = T;
31
+ /**
32
+ * Helper to create a union type of two array value types.
33
+ */
34
+ export type ArrayTypeUnion<T extends readonly any[], U extends readonly any[]> = T[number] extends never ? U[number] : U[number] extends never ? T[number] : T[number] | U[number];
35
+ //# sourceMappingURL=type_utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type_utils.d.ts","sourceRoot":"","sources":["../../src/flags/type_utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,MAAM;KACzD,CAA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ANGED
@@ -1,4 +1,4 @@
1
- export * from './block';
1
+ export * from './bmodel';
2
2
  export * from './block_state';
3
3
  export * from './utag';
4
4
  export * from './drivers';
@@ -11,4 +11,6 @@ export * from './value_or_error';
11
11
  export * from './plid';
12
12
  export * from './json';
13
13
  export * from './errors';
14
+ export * from './flags';
15
+ export * from './bmodel';
14
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var re=Object.defineProperty;var oe=(e,n,t)=>n in e?re(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var m=(e,n,t)=>oe(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("zod"),h=require("canonicalize"),ie=d.z.object({from:d.z.number(),to:d.z.number()});function ae(e,n){if(!(e==null||n==null))return{from:e,to:n}}function se(e,n){if(e.from<0||e.to<0||e.from>=e.to)throw new Error(`${n}: invalid bytes range: ${e}`)}function ue(e){return e!==void 0&&e.startsWith("log+live://log/")}function E(e){throw new Error("Unexpected object: "+e)}const D="upload://upload/",$="index://index/";function R(e){return e.startsWith(D)}function v(e){return e.startsWith($)}function B(e){if(v(e)){const n=e.slice($.length);return JSON.parse(decodeURIComponent(n)).path}else if(R(e)){const n=e.slice(D.length);return JSON.parse(decodeURIComponent(n)).localPath}E(e)}function ce(e){return e.replace(/^.*[\\/]/,"")}function fe(e){return ce(B(e))}function de(e){if(!e||typeof e!="object")return!1;const n=e;if(!("type"in n))return!1;switch(n.type){case"Json":return typeof n.keyLength=="number"&&n.data!==void 0&&typeof n.data=="object";case"JsonPartitioned":return typeof n.partitionKeyLength=="number"&&n.parts!==void 0&&typeof n.parts=="object";case"BinaryPartitioned":return typeof n.partitionKeyLength=="number"&&n.parts!==void 0&&typeof n.parts=="object";default:return!1}}function le(e,n){if(e!==void 0)switch(e.type){case"Json":return e;case"JsonPartitioned":{const t={};for(const[r,o]of Object.entries(e.parts))t[r]=n(o);return{...e,parts:t}}case"BinaryPartitioned":{const t={};for(const[r,o]of Object.entries(e.parts))t[r]={index:n(o.index),values:n(o.values)};return{...e,parts:t}}}}function L(e){if(!e||typeof e!="object")return!1;const n=e;if(!("type"in n))return!1;switch(n.type){case"Json":return typeof n.keyLength=="number"&&Array.isArray(n.data);case"JsonPartitioned":return typeof n.partitionKeyLength=="number"&&Array.isArray(n.parts);case"BinaryPartitioned":return typeof n.partitionKeyLength=="number"&&Array.isArray(n.parts);default:return!1}}function me(e){return L(e)?e.type==="JsonPartitioned"||e.type==="BinaryPartitioned":!1}function pe(e){switch(e.type){case"Json":{const n=Object.entries(e.data).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"Json",keyLength:e.keyLength,data:n}}case"JsonPartitioned":{const n=Object.entries(e.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}case"BinaryPartitioned":{const n=Object.entries(e.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}}}function ye(e){switch(e.type){case"Json":{const n={};for(const t of e.data)n[JSON.stringify(t.key)]=t.value;return{type:"Json",keyLength:e.keyLength,data:n}}case"JsonPartitioned":{const n={};for(const t of e.parts)n[JSON.stringify(t.key)]=t.value;return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}case"BinaryPartitioned":{const n={};for(const t of e.parts)n[JSON.stringify(t.key)]=t.value;return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}}}function he(e,n){if(e!==void 0)switch(e.type){case"Json":return e;case"JsonPartitioned":{const t=e.parts.map(r=>({key:r.key,value:n(r.value)}));return{...e,parts:t}}case"BinaryPartitioned":{const t=e.parts.map(r=>({key:r.key,value:{index:n(r.value.index),values:n(r.value.values)}}));return{...e,parts:t}}}}const F=-2147483648,P=-9007199254740991n,ge=NaN,be=NaN,j=null,z=null;function g(e,n){switch(n){case"Int":return e===F;case"Long":return e===Number(P)||e===P;case"Float":return Number.isNaN(e);case"Double":return Number.isNaN(e);case"String":return e===j;case"Bytes":return e===z;default:throw Error(`unsupported data type: ${n}`)}}function we(e){if(!T(e))throw new Error(`Expected not-NA PValue, got ${e}`);return e}function T(e,n){if(!n)return typeof e=="string"||typeof e=="number"&&isFinite(e)||typeof e=="bigint";if(g(e,n))return!1;switch(n){case"Int":return typeof e=="number";case"Long":return typeof e=="number"||typeof e=="bigint";case"Float":return typeof e=="number";case"Double":return typeof e=="number";case"String":return typeof e=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${n}`)}}function U(e,n){if(!n)return e===null||typeof e=="string"||typeof e=="number"||typeof e=="bigint";if(g(e,n))return!0;switch(n){case"Int":return typeof e=="number";case"Long":return typeof e=="number"||typeof e=="bigint";case"Float":return typeof e=="number";case"Double":return typeof e=="number";case"String":return typeof e=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${n}`)}}function Pe(e){if(e===null||typeof e=="string"||typeof e=="number")return e;if(typeof e=="bigint")return{bigint:e.toString()};throw new Error(`Type ${typeof e} (value ${e}) not yet supported.`)}function K(e,n){if(e===null||typeof e=="string"||typeof e=="number"||typeof e=="bigint"){if(n&&!g(e,n)&&!U(e,n))throw new Error(`Unexpected value type, got ${typeof e}, expected ${n}`);return e}if(typeof e=="object"&&e!==null&&"bigint"in e&&typeof e.bigint=="string"){if(n&&n!=="Long")throw new Error(`Unexpected value type, got serialized bigint, expected ${n}`);return BigInt(e.bigint)}throw new Error(`Unsupported type ${typeof e} (value ${e}).`)}function Ae(e){if(e=M(e),e===null)throw new Error("Value is null");return e}function M(e){if(e=K(e),e===null)return null;if(typeof e=="string")return e;if(typeof e=="number"){if(!isFinite(e))throw new Error(`Value is not finite (${e})`);return e}if(typeof e=="bigint")return Number(e);throw new Error(`Unexpected value type: ${typeof e}`)}function _(e,n){const t=Math.floor(n/8),r=1<<7-n%8;return(e[t]&r)>0}const H={type:"absent"},q=null;function xe(e){return typeof e=="object"&&e!==null&&e.type==="absent"}function Ee(e,n,t={}){if(_(e.absent,n))return t.absent===void 0?H:t.absent;const r=e.data[n],o=e.type;if(g(r,o))return t.na===void 0?q:t.na;switch(o){case"Int":return r;case"Long":return Number(r);case"Float":return r;case"Double":return r;case"String":return r;case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${o}`)}}function ke(e){return{kind:e.kind,valueType:e.valueType,name:e.name,domain:e.domain,parentAxes:e.parentAxes,axesId:k(e.axesSpec)}}function Ne(e){return{columnId:e.id,spec:e.spec}}function p(e){const{type:n,name:t,domain:r}=e,o={type:n,name:t};return r&&Object.entries(r).length>0&&Object.assign(o,{domain:r}),o}function k(e){return e.map(p)}function Se(e){return h(p(e))}function Ie(e,n){if(e===void 0)return n===void 0;if(n===void 0)return!0;for(const t in n)if(e[t]!==n[t])return!1;return!0}function W(e,n){return e.name===n.name&&Ie(e.domain,n.domain)}function Ce(e,n){return{...e,src:y(e.src,n)}}function y(e,n){switch(e.type){case"column":return{type:"column",column:n(e.column)};case"slicedColumn":return{type:"slicedColumn",column:n(e.column),newId:e.newId,axisFilters:e.axisFilters};case"inlineColumn":return e;case"inner":case"full":return{type:e.type,entries:e.entries.map(t=>y(t,n))};case"outer":return{type:"outer",primary:y(e.primary,n),secondary:e.secondary.map(t=>y(t,n))};default:E(e)}}function Ve(e){switch(e.type){case"axis":return{type:"axis",id:e.id};case"column":return{type:"column",id:e.id}}}function X(e){return h(e)}function Oe(e){return JSON.parse(e)}function O(e){return h(p(e))}function J(e,n){return JSON.stringify([e,n])}class Je{constructor(n){m(this,"domains",new Map);m(this,"axes",new Map);m(this,"domainPacks",[]);m(this,"domainPackToAnchor",new Map);this.anchors=n;const t=Object.entries(n);t.sort((r,o)=>r[0].localeCompare(o[0]));for(const[r,o]of t){for(let a=0;a<o.axesSpec.length;a++){const s=o.axesSpec[a],i=O(s);this.axes.set(i,{anchor:r,idx:a})}if(o.domain!==void 0){const a=Object.entries(o.domain);a.sort((s,i)=>s[0].localeCompare(i[0])),this.domainPackToAnchor.set(JSON.stringify(a),r),this.domainPacks.push(a.map(([s])=>s));for(const[s,i]of a){const u=J(s,i);this.domains.set(u,r)}}}}derive(n,t){const r={name:n.name,axes:[]};let o;if(n.domain!==void 0)e:for(const s of this.domainPacks){const i=[];for(const c of s){const l=n.domain[c];if(l!==void 0)i.push([c,l]);else break e}const u=this.domainPackToAnchor.get(JSON.stringify(i));if(u!==void 0){r.domainAnchor=u,o=new Set(s);break}}for(const[s,i]of Object.entries(n.domain??{})){if(o!==void 0&&o.has(s))continue;const u=J(s,i),c=this.domains.get(u);r.domain??(r.domain={}),r.domain[s]=c?{anchor:c}:i}if(r.axes=n.axesSpec.map(s=>{const i=O(s),u=this.axes.get(i);return u===void 0?p(s):u}),!t||t.length===0)return r;const a=[];for(const s of t){const[i,u]=s;if(typeof i=="number"){if(i<0||i>=n.axesSpec.length)throw new Error(`Axis index ${i} is out of bounds (0-${n.axesSpec.length-1})`);a.push([i,u])}else{const c=n.axesSpec.findIndex(l=>l.name===i);if(c===-1)throw new Error(`Axis with name "${i}" not found in the column specification`);a.push([c,u])}}return a.sort((s,i)=>s[0]-i[0]),{source:r,axisFilters:a}}deriveS(n,t){return X(this.derive(n,t))}}function De(e,n,t){const r={...n},o=(t==null?void 0:t.ignoreMissingDomains)??!1;if(r.domainAnchor!==void 0){const a=e[r.domainAnchor];if(!a)throw new Error(`Anchor "${r.domainAnchor}" not found`);const s=a.domain||{};r.domain={...s,...r.domain},delete r.domainAnchor}if(r.domain){const a={};for(const[s,i]of Object.entries(r.domain))if(typeof i=="string")a[s]=i;else{const u=e[i.anchor];if(!u)throw new Error(`Anchor "${i.anchor}" not found for domain key "${s}"`);if(!u.domain||u.domain[s]===void 0){if(!o)throw new Error(`Domain key "${s}" not found in anchor "${i.anchor}"`);continue}a[s]=u.domain[s]}r.domain=a}return r.axes&&(r.axes=r.axes.map(a=>$e(e,a))),r}function $e(e,n){if(!Re(n))return n;const t=n.anchor,r=e[t];if(!r)throw new Error(`Anchor "${t}" not found for axis reference`);if("idx"in n){if(n.idx<0||n.idx>=r.axesSpec.length)throw new Error(`Axis index ${n.idx} out of bounds for anchor "${t}"`);return r.axesSpec[n.idx]}else if("name"in n){const o=r.axesSpec.filter(a=>a.name===n.name);if(o.length>1)throw new Error(`Multiple axes with name "${n.name}" found in anchor "${t}"`);if(o.length===0)throw new Error(`Axis with name "${n.name}" not found in anchor "${t}"`);return o[0]}else if("id"in n){const o=r.axesSpec.filter(a=>W(n.id,p(a)));if(o.length>1)throw new Error(`Multiple matching axes found for matcher in anchor "${t}"`);if(o.length===0)throw new Error(`No matching axis found for matcher in anchor "${t}"`);return o[0]}throw new Error("Unsupported axis reference type")}function Re(e){return typeof e=="object"&&"anchor"in e}function ve(e){return typeof e=="object"&&e!==null&&"source"in e&&"axisFilters"in e}function f(e){return e.kind==="PColumn"}function G(e){return f(e.spec)}function Be(e){return f(e.obj)}function Le(e){return f(e.obj.spec)}function Fe(e){if(!G(e))throw new Error(`not a PColumn (kind = ${e.spec.kind})`);return e}function je(e,n){return e===void 0?void 0:{...e,data:n(e.data)}}function ze(e){const n=new Map,t=r=>{switch(r.type){case"column":n.set(r.column.id,r.column);return;case"slicedColumn":n.set(r.column.id,r.column);return;case"inlineColumn":return;case"full":case"inner":for(const o of r.entries)t(o);return;case"outer":t(r.primary);for(const o of r.secondary)t(o);return;default:E(r)}};return t(e),[...n.values()]}function Te(e){throw new Error("Unexpected object: "+e)}function b(e,n){switch(e.type){case"and":for(const t of e.operands)if(!b(t,n))return!1;return!0;case"or":for(const t of e.operands)if(b(t,n))return!0;return!1;case"not":return!b(e.operand,n);case"name":return f(n)&&n.name===e.name;case"name_pattern":return f(n)&&!!n.name.match(e.pattern);case"annotation":return f(n)&&n.annotations!==void 0&&n.annotations[e.annotation]===e.value;case"annotation_pattern":return f(n)&&n.annotations!==void 0&&n.annotations[e.annotation]!==void 0&&!!n.annotations[e.annotation].match(e.pattern);case"has_axes":return f(n)&&e.axes.every(t=>n.axesSpec.some(r=>(t.type===void 0||t.type===r.type)&&(t.name===void 0||t.name===r.name)&&(t.domain===void 0||Object.keys(t.domain).length===0||r.domain!==void 0&&Object.entries(t.domain).every(([o,a])=>r.domain[o]===a))));default:Te(e)}}function A(e,n){if(e.name!==void 0&&e.name!==n.name)return!1;if(e.type!==void 0){if(Array.isArray(e.type)){if(!e.type.includes(n.type))return!1}else if(e.type!==n.type)return!1}if(e.domain!==void 0){const t=n.domain||{};for(const[r,o]of Object.entries(e.domain))if(t[r]!==o)return!1}return!0}function x(e,n){if(n.name!==void 0&&e.name!==n.name||n.namePattern!==void 0&&!new RegExp(n.namePattern).test(e.name))return!1;if(n.type!==void 0){if(Array.isArray(n.type)){if(!n.type.includes(e.valueType))return!1}else if(n.type!==e.valueType)return!1}if(n.domain!==void 0){const t=e.domain||{};for(const[r,o]of Object.entries(n.domain))if(t[r]!==o)return!1}if(n.axes!==void 0){const t=e.axesSpec.map(p);if(n.partialAxesMatch){for(const r of n.axes)if(!t.some(o=>A(r,o)))return!1}else{if(t.length!==n.axes.length)return!1;for(let r=0;r<n.axes.length;r++)if(!A(n.axes[r],t[r]))return!1}}if(n.annotations!==void 0){const t=e.annotations||{};for(const[r,o]of Object.entries(n.annotations))if(t[r]!==o)return!1}if(n.annotationPatterns!==void 0){const t=e.annotations||{};for(const[r,o]of Object.entries(n.annotationPatterns)){const a=t[r];if(a===void 0||!new RegExp(o).test(a))return!1}}return!0}function Ue(e){return Array.isArray(e)?n=>e.some(t=>f(n)&&x(n,t)):n=>f(n)&&x(n,e)}function Ke(e){const n={kind:e.kind,name:e.name};return e.domain!==void 0&&(n.domain=e.domain),f(e)&&(n.axesSpec=k(e.axesSpec)),h(n)}const Me={href:"/"},_e=d.z.object({__isRef:d.z.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:d.z.string().describe("Upstream block id"),name:d.z.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:d.z.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();function He(e){return typeof e=="object"&&e!==null&&"__isRef"in e&&e.__isRef===!0&&"blockId"in e&&"name"in e}function qe(e,n,t=!1){return t?{__isRef:!0,blockId:e,name:n,requireEnrichments:!0}:{__isRef:!0,blockId:e,name:n}}function We(e,n=!0){if(n)return{...e,requireEnrichments:!0};{const{requireEnrichments:t,...r}=e;return r}}function Xe(e,n,t=!1){return e.blockId===n.blockId&&e.name===n.name&&(t||e.requireEnrichments===n.requireEnrichments)}function Ge(e,n){return e.ok?{ok:!0,value:n(e.value)}:e}function Qe(e){if(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray)return new DataView(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new DataView(e);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}const Ye="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Ze="0123456789ABCDEFGHIJKLMNOPQRSTUV",en="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Q(e,n,t){t=t||{};let r,o;switch(n){case"RFC3548":case"RFC4648":r=Ye,o=!0;break;case"RFC4648-HEX":r=Ze,o=!0;break;case"Crockford":r=en,o=!1;break;default:throw new Error("Unknown base32 variant: "+String(n))}const a=t.padding!==void 0?t.padding:o,s=Qe(e);let i=0,u=0,c="";for(let l=0;l<s.byteLength;l++)for(u=u<<8|s.getUint8(l),i+=8;i>=5;)c+=r[u>>>i-5&31],i-=5;if(i>0&&(c+=r[u<<5-i&31]),a)for(;c.length%8!==0;)c+="=";return c}const N=15,Y=24,S=d.z.string().length(Y).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function nn(){const e=new Uint8Array(N);return crypto.getRandomValues(e),S.parse(Q(e,"RFC4648"))}function Z(e){if(e.length!==N)throw new Error(`Wrong number of bytes: ${e.length}`);return S.parse(Q(e,"RFC4648"))}async function tn(e){const n=new TextEncoder,t=await crypto.subtle.digest("SHA-256",n.encode(e));return Z(new Uint8Array(t.slice(0,15)))}function rn(e){return JSON.stringify(e)}function on(e){return h(e)}function an(e){return JSON.parse(e)}class sn extends Error{constructor(){super(...arguments);m(this,"name","AbortError")}}class un extends Error{constructor(){super(...arguments);m(this,"name","UiError")}}function cn(e){return e instanceof Error&&e.name==="AbortError"}function ee(e){return e instanceof Error?e.name==="AbortError"||ee(e.cause):!1}function fn(e){return e instanceof Error&&e.name==="AggregateError"}function dn(e){if(typeof e=="string")return`String value was thrown: ${e}`;if(e&&typeof e=="object")try{return`Plain object was thrown: ${JSON.stringify(e)}`}catch(n){return`Non-serializable object was thrown (JSON.stringify failed: ${n instanceof Error?n.message:String(n)}): ${String(e)}`}return`Non-Error value (${typeof e}) was thrown: ${e}`}function w(e){return e instanceof Error?e:new Error(dn(e))}function I(e){const n=e.cause?I(e.cause):void 0,t=new Error(e.message,n!==void 0?{cause:n}:void 0);return t.name=e.name||"Error",t.stack=e.stack,t}function C(e){const n=w(e),t=n.cause?C(n.cause):void 0;return{name:n.name,message:n.message,stack:n.stack,...n.cause!==void 0&&{cause:t}}}function ln(e){if(e.error)throw e.error;return e.value}function V(e){return e.error?{error:C(e.error)}:{value:e.value}}function mn(e){return e.error?{error:I(e.error)}:{value:e.value}}function ne(e){try{return{value:e()}}catch(n){return{error:w(n)}}}async function te(e){try{return{value:await e()}}catch(n){return{error:w(n)}}}function pn(e){const n=ne(e);return V(n)}async function yn(e){const n=await te(e);return V(n)}exports.AbortError=sn;exports.AnchoredIdDeriver=Je;exports.DefaultNavigationState=Me;exports.PTableAbsent=H;exports.PTableNA=q;exports.PValueBytesNA=z;exports.PValueDoubleNA=be;exports.PValueFloatNA=ge;exports.PValueIntNA=F;exports.PValueLongNA=P;exports.PValueStringNA=j;exports.PlId=S;exports.PlIdBytes=N;exports.PlIdLength=Y;exports.PlRef=_e;exports.RangeBytes=ie;exports.UiError=un;exports.canonicalizeAxisId=Se;exports.canonicalizeJson=on;exports.createPlRef=qe;exports.dataInfoToEntries=pe;exports.deriveNativeId=Ke;exports.deserializeError=I;exports.deserializeResult=mn;exports.digestPlId=tn;exports.ensureError=w;exports.ensureNotNAPValue=we;exports.ensurePColumn=Fe;exports.entriesToDataInfo=ye;exports.executePSpecPredicate=b;exports.extractAllColumns=ze;exports.getAxesId=k;exports.getAxisId=p;exports.getColumnIdAndSpec=Ne;exports.getFileNameFromHandle=fe;exports.getFilePathFromHandle=B;exports.getPColumnSpecId=ke;exports.getPTableColumnId=Ve;exports.hasAbortError=ee;exports.isAbortError=cn;exports.isAggregateError=fn;exports.isDataInfo=de;exports.isDataInfoEntries=L;exports.isFilteredPColumn=ve;exports.isImportFileHandleIndex=v;exports.isImportFileHandleUpload=R;exports.isLiveLog=ue;exports.isNotNAPValue=T;exports.isPColumn=G;exports.isPColumnResult=Le;exports.isPColumnSpec=f;exports.isPColumnSpecResult=Be;exports.isPTableAbsent=xe;exports.isPValue=U;exports.isPartitionedDataInfoEntries=me;exports.isPlRef=He;exports.isValueAbsent=_;exports.isValueNA=g;exports.mapDataInfo=le;exports.mapDataInfoEntries=he;exports.mapJoinEntry=y;exports.mapPObjectData=je;exports.mapPTableDef=Ce;exports.mapValueInVOE=Ge;exports.matchAxis=A;exports.matchAxisId=W;exports.matchPColumn=x;exports.newRangeBytesOpt=ae;exports.pTableValue=Ee;exports.pValueToStringOrNumber=Ae;exports.pValueToStringOrNumberOrNull=M;exports.parseColumnId=Oe;exports.parseJson=an;exports.plId=Z;exports.plRefsEqual=Xe;exports.resolveAnchors=De;exports.safeConvertToPValue=K;exports.selectorsToPredicate=Ue;exports.serializeError=C;exports.serializeResult=V;exports.stringifyColumnId=X;exports.stringifyJson=rn;exports.toJsonSafePValue=Pe;exports.uniquePlId=nn;exports.unwrapResult=ln;exports.validateRangeBytes=se;exports.withEnrichments=We;exports.wrapAndSerialize=pn;exports.wrapAndSerializeAsync=yn;exports.wrapAsyncCallback=te;exports.wrapCallback=ne;
1
+ "use strict";var se=Object.defineProperty;var ae=(e,n,t)=>n in e?se(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var l=(e,n,t)=>ae(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("zod"),g=require("canonicalize");function ue(e){if(e.code!==void 0)return{code:e.code,sdkVersion:e.sdkVersion,featureFlags:e.featureFlags}}function y(e){if(e!==void 0)return typeof e=="string"?{__renderLambda:!0,handle:e,retentive:!1}:e}function ce(e){if(e.v3!==void 0){const{initialArgs:n,initialUiState:t,inputsValid:r,outputs:o,renderingMode:i,sdkVersion:a,featureFlags:s,sections:u,title:c,enrichmentTargets:f}=e.v3,{code:ie}=e;return{initialArgs:n,initialUiState:t,inputsValid:r,outputs:o,renderingMode:i,sdkVersion:a,featureFlags:s,sections:u,title:c,code:ie,enrichmentTargets:f}}else if(e.inputsValid!==void 0){const{sdkVersion:n,renderingMode:t,outputs:r,inputsValid:o,sections:i,initialArgs:a,code:s}=e,u=Object.keys(e);if(n===void 0||t===void 0||r===void 0||o===void 0||i===void 0||a===void 0)throw new Error(`Malformed config v2. SDK version ${n}; Fields = ${u.join(", ")}`);return{sdkVersion:n,renderingMode:t,initialArgs:a,outputs:Object.fromEntries(Object.entries(r).map(([c,f])=>[c,y(f)])),inputsValid:y(o),sections:y(i),initialUiState:void 0,code:s}}else if(e.renderingMode!==void 0){const{sdkVersion:n,canRun:t,renderingMode:r,outputs:o,sections:i,initialArgs:a,code:s}=e,u=Object.keys(e);if(r===void 0||o===void 0||t===void 0||i===void 0||a===void 0)throw new Error(`Malformed config v1. SDK version ${n}; Fields = ${u.join(", ")}`);return{sdkVersion:n??"unknown",renderingMode:r,initialArgs:a,outputs:Object.fromEntries(Object.entries(o).map(([c,f])=>[c,y(f)])),inputsValid:y(t),sections:y(i),initialUiState:void 0,code:s}}else{const{sdkVersion:n}=e,t=Object.keys(e);throw new Error(`Config format not supported: SDK = ${n}; Fields = ${t.join(", ")}`)}}const fe=p.z.object({from:p.z.number(),to:p.z.number()});function de(e,n){if(!(e==null||n==null))return{from:e,to:n}}function le(e,n){if(e.from<0||e.to<0||e.from>=e.to)throw new Error(`${n}: invalid bytes range: ${e}`)}function pe(e){return e!==void 0&&e.startsWith("log+live://log/")}function k(e){throw new Error("Unexpected object: "+e)}const R="upload://upload/",$="index://index/";function J(e){return e.startsWith(R)}function j(e){return e.startsWith($)}function D(e){if(j(e)){const n=e.slice($.length);return JSON.parse(decodeURIComponent(n)).path}else if(J(e)){const n=e.slice(R.length);return JSON.parse(decodeURIComponent(n)).localPath}k(e)}function me(e){return e.replace(/^.*[\\/]/,"")}function ye(e){return me(D(e))}function he(e){if(!e||typeof e!="object")return!1;const n=e;if(!("type"in n))return!1;switch(n.type){case"Json":return typeof n.keyLength=="number"&&n.data!==void 0&&typeof n.data=="object";case"JsonPartitioned":return typeof n.partitionKeyLength=="number"&&n.parts!==void 0&&typeof n.parts=="object";case"BinaryPartitioned":return typeof n.partitionKeyLength=="number"&&n.parts!==void 0&&typeof n.parts=="object";default:return!1}}function ge(e,n){if(e!==void 0)switch(e.type){case"Json":return e;case"JsonPartitioned":{const t={};for(const[r,o]of Object.entries(e.parts))t[r]=n(o);return{...e,parts:t}}case"BinaryPartitioned":{const t={};for(const[r,o]of Object.entries(e.parts))t[r]={index:n(o.index),values:n(o.values)};return{...e,parts:t}}}}function L(e){if(!e||typeof e!="object")return!1;const n=e;if(!("type"in n))return!1;switch(n.type){case"Json":return typeof n.keyLength=="number"&&Array.isArray(n.data);case"JsonPartitioned":return typeof n.partitionKeyLength=="number"&&Array.isArray(n.parts);case"BinaryPartitioned":return typeof n.partitionKeyLength=="number"&&Array.isArray(n.parts);default:return!1}}function be(e){return L(e)?e.type==="JsonPartitioned"||e.type==="BinaryPartitioned":!1}function we(e){switch(e.type){case"Json":{const n=Object.entries(e.data).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"Json",keyLength:e.keyLength,data:n}}case"JsonPartitioned":{const n=Object.entries(e.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}case"BinaryPartitioned":{const n=Object.entries(e.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}}}function Ae(e){switch(e.type){case"Json":{const n={};for(const t of e.data)n[JSON.stringify(t.key)]=t.value;return{type:"Json",keyLength:e.keyLength,data:n}}case"JsonPartitioned":{const n={};for(const t of e.parts)n[JSON.stringify(t.key)]=t.value;return{type:"JsonPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}case"BinaryPartitioned":{const n={};for(const t of e.parts)n[JSON.stringify(t.key)]=t.value;return{type:"BinaryPartitioned",partitionKeyLength:e.partitionKeyLength,parts:n}}}}function Pe(e,n){if(e!==void 0)switch(e.type){case"Json":return e;case"JsonPartitioned":{const t=e.parts.map(r=>({key:r.key,value:n(r.value)}));return{...e,parts:t}}case"BinaryPartitioned":{const t=e.parts.map(r=>({key:r.key,value:{index:n(r.value.index),values:n(r.value.values)}}));return{...e,parts:t}}}}const B=-2147483648,P=-9007199254740991n,xe=NaN,Ee=NaN,z=null,U=null;function b(e,n){switch(n){case"Int":return e===B;case"Long":return e===Number(P)||e===P;case"Float":return Number.isNaN(e);case"Double":return Number.isNaN(e);case"String":return e===z;case"Bytes":return e===U;default:throw Error(`unsupported data type: ${n}`)}}function ke(e){if(!T(e))throw new Error(`Expected not-NA PValue, got ${e}`);return e}function T(e,n){if(!n)return typeof e=="string"||typeof e=="number"&&isFinite(e)||typeof e=="bigint";if(b(e,n))return!1;switch(n){case"Int":return typeof e=="number";case"Long":return typeof e=="number"||typeof e=="bigint";case"Float":return typeof e=="number";case"Double":return typeof e=="number";case"String":return typeof e=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${n}`)}}function M(e,n){if(!n)return e===null||typeof e=="string"||typeof e=="number"||typeof e=="bigint";if(b(e,n))return!0;switch(n){case"Int":return typeof e=="number";case"Long":return typeof e=="number"||typeof e=="bigint";case"Float":return typeof e=="number";case"Double":return typeof e=="number";case"String":return typeof e=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${n}`)}}function Se(e){if(e===null||typeof e=="string"||typeof e=="number")return e;if(typeof e=="bigint")return{bigint:e.toString()};throw new Error(`Type ${typeof e} (value ${e}) not yet supported.`)}function K(e,n){if(e===null||typeof e=="string"||typeof e=="number"||typeof e=="bigint"){if(n&&!b(e,n)&&!M(e,n))throw new Error(`Unexpected value type, got ${typeof e}, expected ${n}`);return e}if(typeof e=="object"&&e!==null&&"bigint"in e&&typeof e.bigint=="string"){if(n&&n!=="Long")throw new Error(`Unexpected value type, got serialized bigint, expected ${n}`);return BigInt(e.bigint)}throw new Error(`Unsupported type ${typeof e} (value ${e}).`)}function Ie(e){if(e=q(e),e===null)throw new Error("Value is null");return e}function q(e){if(e=K(e),e===null)return null;if(typeof e=="string")return e;if(typeof e=="number"){if(!isFinite(e))throw new Error(`Value is not finite (${e})`);return e}if(typeof e=="bigint")return Number(e);throw new Error(`Unexpected value type: ${typeof e}`)}function _(e,n){const t=Math.floor(n/8),r=1<<7-n%8;return(e[t]&r)>0}const H={type:"absent"},W=null;function Ne(e){return typeof e=="object"&&e!==null&&e.type==="absent"}function ve(e,n,t={}){if(_(e.absent,n))return t.absent===void 0?H:t.absent;const r=e.data[n],o=e.type;if(b(r,o))return t.na===void 0?W:t.na;switch(o){case"Int":return r;case"Long":return Number(r);case"Float":return r;case"Double":return r;case"String":return r;case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${o}`)}}function Ce(e){return{kind:e.kind,valueType:e.valueType,name:e.name,domain:e.domain,parentAxes:e.parentAxes,axesId:S(e.axesSpec)}}function Ve(e){return{columnId:e.id,spec:e.spec}}function m(e){const{type:n,name:t,domain:r}=e,o={type:n,name:t};return r&&Object.entries(r).length>0&&Object.assign(o,{domain:r}),o}function S(e){return e.map(m)}function Oe(e){return g(m(e))}function Fe(e,n){if(e===void 0)return n===void 0;if(n===void 0)return!0;for(const t in n)if(e[t]!==n[t])return!1;return!0}function G(e,n){return e.name===n.name&&Fe(e.domain,n.domain)}function Re(e,n){return{...e,src:h(e.src,n)}}function h(e,n){switch(e.type){case"column":return{type:"column",column:n(e.column)};case"slicedColumn":return{type:"slicedColumn",column:n(e.column),newId:e.newId,axisFilters:e.axisFilters};case"inlineColumn":return e;case"inner":case"full":return{type:e.type,entries:e.entries.map(t=>h(t,n))};case"outer":return{type:"outer",primary:h(e.primary,n),secondary:e.secondary.map(t=>h(t,n))};default:k(e)}}function $e(e){switch(e.type){case"axis":return{type:"axis",id:e.id};case"column":return{type:"column",id:e.id}}}function X(e){return g(e)}function Je(e){return JSON.parse(e)}function O(e){return g(m(e))}function F(e,n){return JSON.stringify([e,n])}class je{constructor(n){l(this,"domains",new Map);l(this,"axes",new Map);l(this,"domainPacks",[]);l(this,"domainPackToAnchor",new Map);this.anchors=n;const t=Object.entries(n);t.sort((r,o)=>r[0].localeCompare(o[0]));for(const[r,o]of t){for(let i=0;i<o.axesSpec.length;i++){const a=o.axesSpec[i],s=O(a);this.axes.set(s,{anchor:r,idx:i})}if(o.domain!==void 0){const i=Object.entries(o.domain);i.sort((a,s)=>a[0].localeCompare(s[0])),this.domainPackToAnchor.set(JSON.stringify(i),r),this.domainPacks.push(i.map(([a])=>a));for(const[a,s]of i){const u=F(a,s);this.domains.set(u,r)}}}}derive(n,t){const r={name:n.name,axes:[]};let o;if(n.domain!==void 0)e:for(const a of this.domainPacks){const s=[];for(const c of a){const f=n.domain[c];if(f!==void 0)s.push([c,f]);else break e}const u=this.domainPackToAnchor.get(JSON.stringify(s));if(u!==void 0){r.domainAnchor=u,o=new Set(a);break}}for(const[a,s]of Object.entries(n.domain??{})){if(o!==void 0&&o.has(a))continue;const u=F(a,s),c=this.domains.get(u);r.domain??(r.domain={}),r.domain[a]=c?{anchor:c}:s}if(r.axes=n.axesSpec.map(a=>{const s=O(a),u=this.axes.get(s);return u===void 0?m(a):u}),!t||t.length===0)return r;const i=[];for(const a of t){const[s,u]=a;if(typeof s=="number"){if(s<0||s>=n.axesSpec.length)throw new Error(`Axis index ${s} is out of bounds (0-${n.axesSpec.length-1})`);i.push([s,u])}else{const c=n.axesSpec.findIndex(f=>f.name===s);if(c===-1)throw new Error(`Axis with name "${s}" not found in the column specification`);i.push([c,u])}}return i.sort((a,s)=>a[0]-s[0]),{source:r,axisFilters:i}}deriveS(n,t){return X(this.derive(n,t))}}function De(e,n,t){const r={...n},o=(t==null?void 0:t.ignoreMissingDomains)??!1;if(r.domainAnchor!==void 0){const i=e[r.domainAnchor];if(!i)throw new Error(`Anchor "${r.domainAnchor}" not found`);const a=i.domain||{};r.domain={...a,...r.domain},delete r.domainAnchor}if(r.domain){const i={};for(const[a,s]of Object.entries(r.domain))if(typeof s=="string")i[a]=s;else{const u=e[s.anchor];if(!u)throw new Error(`Anchor "${s.anchor}" not found for domain key "${a}"`);if(!u.domain||u.domain[a]===void 0){if(!o)throw new Error(`Domain key "${a}" not found in anchor "${s.anchor}"`);continue}i[a]=u.domain[a]}r.domain=i}return r.axes&&(r.axes=r.axes.map(i=>Le(e,i))),r}function Le(e,n){if(!Be(n))return n;const t=n.anchor,r=e[t];if(!r)throw new Error(`Anchor "${t}" not found for axis reference`);if("idx"in n){if(n.idx<0||n.idx>=r.axesSpec.length)throw new Error(`Axis index ${n.idx} out of bounds for anchor "${t}"`);return r.axesSpec[n.idx]}else if("name"in n){const o=r.axesSpec.filter(i=>i.name===n.name);if(o.length>1)throw new Error(`Multiple axes with name "${n.name}" found in anchor "${t}"`);if(o.length===0)throw new Error(`Axis with name "${n.name}" not found in anchor "${t}"`);return o[0]}else if("id"in n){const o=r.axesSpec.filter(i=>G(n.id,m(i)));if(o.length>1)throw new Error(`Multiple matching axes found for matcher in anchor "${t}"`);if(o.length===0)throw new Error(`No matching axis found for matcher in anchor "${t}"`);return o[0]}throw new Error("Unsupported axis reference type")}function Be(e){return typeof e=="object"&&"anchor"in e}function ze(e){return typeof e=="object"&&e!==null&&"source"in e&&"axisFilters"in e}function d(e){return e.kind==="PColumn"}function Q(e){return d(e.spec)}function Ue(e){return d(e.obj)}function Te(e){return d(e.obj.spec)}function Me(e){if(!Q(e))throw new Error(`not a PColumn (kind = ${e.spec.kind})`);return e}function Ke(e,n){return e===void 0?void 0:{...e,data:n(e.data)}}function qe(e){const n=new Map,t=r=>{switch(r.type){case"column":n.set(r.column.id,r.column);return;case"slicedColumn":n.set(r.column.id,r.column);return;case"inlineColumn":return;case"full":case"inner":for(const o of r.entries)t(o);return;case"outer":t(r.primary);for(const o of r.secondary)t(o);return;default:k(r)}};return t(e),[...n.values()]}function _e(e){throw new Error("Unexpected object: "+e)}function w(e,n){switch(e.type){case"and":for(const t of e.operands)if(!w(t,n))return!1;return!0;case"or":for(const t of e.operands)if(w(t,n))return!0;return!1;case"not":return!w(e.operand,n);case"name":return d(n)&&n.name===e.name;case"name_pattern":return d(n)&&!!n.name.match(e.pattern);case"annotation":return d(n)&&n.annotations!==void 0&&n.annotations[e.annotation]===e.value;case"annotation_pattern":return d(n)&&n.annotations!==void 0&&n.annotations[e.annotation]!==void 0&&!!n.annotations[e.annotation].match(e.pattern);case"has_axes":return d(n)&&e.axes.every(t=>n.axesSpec.some(r=>(t.type===void 0||t.type===r.type)&&(t.name===void 0||t.name===r.name)&&(t.domain===void 0||Object.keys(t.domain).length===0||r.domain!==void 0&&Object.entries(t.domain).every(([o,i])=>r.domain[o]===i))));default:_e(e)}}function x(e,n){if(e.name!==void 0&&e.name!==n.name)return!1;if(e.type!==void 0){if(Array.isArray(e.type)){if(!e.type.includes(n.type))return!1}else if(e.type!==n.type)return!1}if(e.domain!==void 0){const t=n.domain||{};for(const[r,o]of Object.entries(e.domain))if(t[r]!==o)return!1}return!0}function E(e,n){if(n.name!==void 0&&e.name!==n.name||n.namePattern!==void 0&&!new RegExp(n.namePattern).test(e.name))return!1;if(n.type!==void 0){if(Array.isArray(n.type)){if(!n.type.includes(e.valueType))return!1}else if(n.type!==e.valueType)return!1}if(n.domain!==void 0){const t=e.domain||{};for(const[r,o]of Object.entries(n.domain))if(t[r]!==o)return!1}if(n.axes!==void 0){const t=e.axesSpec.map(m);if(n.partialAxesMatch){for(const r of n.axes)if(!t.some(o=>x(r,o)))return!1}else{if(t.length!==n.axes.length)return!1;for(let r=0;r<n.axes.length;r++)if(!x(n.axes[r],t[r]))return!1}}if(n.annotations!==void 0){const t=e.annotations||{};for(const[r,o]of Object.entries(n.annotations))if(t[r]!==o)return!1}if(n.annotationPatterns!==void 0){const t=e.annotations||{};for(const[r,o]of Object.entries(n.annotationPatterns)){const i=t[r];if(i===void 0||!new RegExp(o).test(i))return!1}}return!0}function He(e){return Array.isArray(e)?n=>e.some(t=>d(n)&&E(n,t)):n=>d(n)&&E(n,e)}function We(e){const n={kind:e.kind,name:e.name};return e.domain!==void 0&&(n.domain=e.domain),d(e)&&(n.axesSpec=S(e.axesSpec)),g(n)}const Ge={href:"/"},Xe=p.z.object({__isRef:p.z.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:p.z.string().describe("Upstream block id"),name:p.z.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:p.z.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();function Qe(e){return typeof e=="object"&&e!==null&&"__isRef"in e&&e.__isRef===!0&&"blockId"in e&&"name"in e}function Ye(e,n,t=!1){return t?{__isRef:!0,blockId:e,name:n,requireEnrichments:!0}:{__isRef:!0,blockId:e,name:n}}function Ze(e,n=!0){if(n)return{...e,requireEnrichments:!0};{const{requireEnrichments:t,...r}=e;return r}}function en(e,n,t=!1){return e.blockId===n.blockId&&e.name===n.name&&(t||e.requireEnrichments===n.requireEnrichments)}function nn(e,n){return e.ok?{ok:!0,value:n(e.value)}:e}function tn(e){if(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray)return new DataView(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new DataView(e);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}const rn="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",on="0123456789ABCDEFGHIJKLMNOPQRSTUV",sn="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Y(e,n,t){t=t||{};let r,o;switch(n){case"RFC3548":case"RFC4648":r=rn,o=!0;break;case"RFC4648-HEX":r=on,o=!0;break;case"Crockford":r=sn,o=!1;break;default:throw new Error("Unknown base32 variant: "+String(n))}const i=t.padding!==void 0?t.padding:o,a=tn(e);let s=0,u=0,c="";for(let f=0;f<a.byteLength;f++)for(u=u<<8|a.getUint8(f),s+=8;s>=5;)c+=r[u>>>s-5&31],s-=5;if(s>0&&(c+=r[u<<5-s&31]),i)for(;c.length%8!==0;)c+="=";return c}const I=15,Z=24,N=p.z.string().length(Z).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function an(){const e=new Uint8Array(I);return crypto.getRandomValues(e),N.parse(Y(e,"RFC4648"))}function ee(e){if(e.length!==I)throw new Error(`Wrong number of bytes: ${e.length}`);return N.parse(Y(e,"RFC4648"))}async function un(e){const n=new TextEncoder,t=await crypto.subtle.digest("SHA-256",n.encode(e));return ee(new Uint8Array(t.slice(0,15)))}function cn(e){return JSON.stringify(e)}function fn(e){return g(e)}function dn(e){return JSON.parse(e)}class ln extends Error{constructor(){super(...arguments);l(this,"name","AbortError")}}class pn extends Error{constructor(){super(...arguments);l(this,"name","UiError")}}function mn(e){return e instanceof Error&&e.name==="AbortError"}function ne(e){return e instanceof Error?e.name==="AbortError"||ne(e.cause):!1}function yn(e){return e instanceof Error&&e.name==="AggregateError"}function hn(e){if(typeof e=="string")return`String value was thrown: ${e}`;if(e&&typeof e=="object")try{return`Plain object was thrown: ${JSON.stringify(e)}`}catch(n){return`Non-serializable object was thrown (JSON.stringify failed: ${n instanceof Error?n.message:String(n)}): ${String(e)}`}return`Non-Error value (${typeof e}) was thrown: ${e}`}function A(e){return e instanceof Error?e:new Error(hn(e))}function v(e){const n=e.cause?v(e.cause):void 0,t=new Error(e.message,n!==void 0?{cause:n}:void 0);return t.name=e.name||"Error",t.stack=e.stack,t}function C(e){const n=A(e),t=n.cause?C(n.cause):void 0;return{name:n.name,message:n.message,stack:n.stack,...n.cause!==void 0&&{cause:t}}}function gn(e){if(e.error)throw e.error;return e.value}function V(e){return e.error?{error:C(e.error)}:{value:e.value}}function bn(e){return e.error?{error:v(e.error)}:{value:e.value}}function te(e){try{return{value:e()}}catch(n){return{error:A(n)}}}async function re(e){try{return{value:await e()}}catch(n){return{error:A(n)}}}function wn(e){const n=te(e);return V(n)}async function An(e){const n=await re(e);return V(n)}const Pn=["supportsLazyState"],xn=["requiresUIAPIVersion","requiresModelAPIVersion"];function En(e,n,t=!0){return e===void 0?!1:e[n]===t}function kn(e){return e===void 0?new Set:new Set(Object.entries(e).filter(([n,t])=>n.startsWith("requires")&&t===!0).map(([n])=>n))}function Sn(e){return e===void 0?new Set:new Set(Object.entries(e).filter(([n,t])=>n.startsWith("supports")&&t===!0).map(([n])=>n))}class oe extends Error{constructor(t){super(`Some of the block requirements are not supported by the runtime: ${Array.from(t.entries()).map(([r,o])=>`${r}: ${o}`).join(", ")}`);l(this,"name","IncompatibleFlagsError");this.incompatibleFlags=t}}class In{constructor(){l(this,"supportedRequirements",new Map)}addSupportedRequirement(n,t=!0){return this.supportedRequirements.has(n)||this.supportedRequirements.set(n,new Set),this.supportedRequirements.get(n).add(t),this}getIncompatibleFlags(n){if(n===void 0)return;const t=new Map;for(const[r,o]of Object.entries(n))if(r.startsWith("requires")){if(o===void 0)continue;const i=this.supportedRequirements.get(r);(i===void 0||!i.has(o))&&t.set(r,o)}return t.size===0?void 0:t}checkCompatibility(n){return this.getIncompatibleFlags(n)===void 0}throwIfIncompatible(n){const t=this.getIncompatibleFlags(n);if(t!==void 0)throw new oe(t)}}exports.AbortError=ln;exports.AllRequiresFeatureFlags=xn;exports.AllSupportsFeatureFlags=Pn;exports.AnchoredIdDeriver=je;exports.DefaultNavigationState=Ge;exports.IncompatibleFlagsError=oe;exports.PTableAbsent=H;exports.PTableNA=W;exports.PValueBytesNA=U;exports.PValueDoubleNA=Ee;exports.PValueFloatNA=xe;exports.PValueIntNA=B;exports.PValueLongNA=P;exports.PValueStringNA=z;exports.PlId=N;exports.PlIdBytes=I;exports.PlIdLength=Z;exports.PlRef=Xe;exports.RangeBytes=fe;exports.RuntimeCapabilities=In;exports.UiError=pn;exports.canonicalizeAxisId=Oe;exports.canonicalizeJson=fn;exports.checkBlockFlag=En;exports.createPlRef=Ye;exports.dataInfoToEntries=we;exports.deriveNativeId=We;exports.deserializeError=v;exports.deserializeResult=bn;exports.digestPlId=un;exports.ensureError=A;exports.ensureNotNAPValue=ke;exports.ensurePColumn=Me;exports.entriesToDataInfo=Ae;exports.executePSpecPredicate=w;exports.extractAllColumns=qe;exports.extractAllRequirements=kn;exports.extractAllSupports=Sn;exports.extractCodeWithInfo=ue;exports.extractConfigGeneric=ce;exports.getAxesId=S;exports.getAxisId=m;exports.getColumnIdAndSpec=Ve;exports.getFileNameFromHandle=ye;exports.getFilePathFromHandle=D;exports.getPColumnSpecId=Ce;exports.getPTableColumnId=$e;exports.hasAbortError=ne;exports.isAbortError=mn;exports.isAggregateError=yn;exports.isDataInfo=he;exports.isDataInfoEntries=L;exports.isFilteredPColumn=ze;exports.isImportFileHandleIndex=j;exports.isImportFileHandleUpload=J;exports.isLiveLog=pe;exports.isNotNAPValue=T;exports.isPColumn=Q;exports.isPColumnResult=Te;exports.isPColumnSpec=d;exports.isPColumnSpecResult=Ue;exports.isPTableAbsent=Ne;exports.isPValue=M;exports.isPartitionedDataInfoEntries=be;exports.isPlRef=Qe;exports.isValueAbsent=_;exports.isValueNA=b;exports.mapDataInfo=ge;exports.mapDataInfoEntries=Pe;exports.mapJoinEntry=h;exports.mapPObjectData=Ke;exports.mapPTableDef=Re;exports.mapValueInVOE=nn;exports.matchAxis=x;exports.matchAxisId=G;exports.matchPColumn=E;exports.newRangeBytesOpt=de;exports.pTableValue=ve;exports.pValueToStringOrNumber=Ie;exports.pValueToStringOrNumberOrNull=q;exports.parseColumnId=Je;exports.parseJson=dn;exports.plId=ee;exports.plRefsEqual=en;exports.resolveAnchors=De;exports.safeConvertToPValue=K;exports.selectorsToPredicate=He;exports.serializeError=C;exports.serializeResult=V;exports.stringifyColumnId=X;exports.stringifyJson=cn;exports.toJsonSafePValue=Se;exports.uniquePlId=an;exports.unwrapResult=gn;exports.validateRangeBytes=le;exports.withEnrichments=Ze;exports.wrapAndSerialize=wn;exports.wrapAndSerializeAsync=An;exports.wrapAsyncCallback=re;exports.wrapCallback=te;
2
2
  //# sourceMappingURL=index.js.map