{"version":3,"file":"column.cjs","names":["ColumnRecipe","DataColumn","DataColumnImpl","ColumnFilteredRecipe","ColumnDiscoveredRecipe","ColumnOverriddenRecipe"],"sources":["../../src/columns/column.ts"],"sourcesContent":["import {\n  type ColumnUniversalId,\n  type LeafEntry,\n  type PColumn,\n  type PlRef,\n  type PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport type { GlobalCfgRenderCtx } from \"../render/internal\";\nimport type { TreeNodeAccessor } from \"../render\";\nimport { DataColumn, DataColumnRecipe, DataColumnImpl, type ColumnData } from \"./data_column\";\nimport {\n  ColumnDiscoveredRecipe,\n  ColumnFilteredRecipe,\n  ColumnOverriddenRecipe,\n  ColumnRecipe,\n  ColumnRecipeId,\n} from \"./column_recipes\";\n\nexport type ColumnSource =\n  | PObjectId\n  | ColumnUniversalId\n  | PlRef\n  | LeafEntry<TreeNodeAccessor>\n  | PColumn<ColumnData>\n  | DataColumnRecipe<PObjectId>;\n\n/**\n * Unified entry point — routes between the two top-level dispatchers:\n *   - string id (`PObjectId` / `ColumnUniversalId`) → {@link ColumnRecipe}\n *   - object source (`PlRef` / `LeafEntry` / `PColumn` / `DataColumnRecipe`) → {@link DataColumnRecipe}\n *\n * `DataColumnRecipe` is itself a `ColumnRecipe<PObjectId>`, so the return type is\n * the common `ColumnRecipe`.\n */\nexport function Column(\n  source: ColumnSource,\n  opts?: { ctx?: GlobalCfgRenderCtx },\n): undefined | ColumnRecipe {\n  if (typeof source === \"string\") return ColumnRecipe(source, opts);\n  return DataColumn(source, opts);\n}\n\nexport type Column<ID extends ColumnRecipeId = ColumnRecipeId> = ColumnRecipe<ID>;\n\n/**\n * Type-guard for the `Column` type — currently aliased to `ColumnRecipe`, so\n * this is equivalent to {@link isColumnRecipe}. Kept as a separate export to\n * mirror the `Column` / `ColumnRecipe` / `DataColumnRecipe` factory triple.\n */\nexport function isColumn(value: unknown): value is Column {\n  return (\n    value instanceof DataColumnImpl ||\n    value instanceof ColumnFilteredRecipe ||\n    value instanceof ColumnDiscoveredRecipe ||\n    value instanceof ColumnOverriddenRecipe\n  );\n}\n"],"mappings":";;;;;;;;;;;;;;AAkCA,SAAgB,OACd,QACA,MAC0B;CAC1B,IAAI,OAAO,WAAW,UAAU,OAAOA,cAAAA,aAAa,QAAQ,IAAI;CAChE,OAAOC,oBAAAA,WAAW,QAAQ,IAAI;AAChC;;;;;;AASA,SAAgB,SAAS,OAAiC;CACxD,OACE,iBAAiBC,oBAAAA,kBACjB,iBAAiBC,+BAAAA,wBACjB,iBAAiBC,iCAAAA,0BACjB,iBAAiBC,gCAAAA;AAErB"}