@yuuvis/client-framework 3.8.1 → 3.8.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"yuuvis-client-framework-smart-search.mjs","sources":["../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.interface.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.query.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.tree.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search-edit.controller.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search-group.component.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search-group.component.html","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.component.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.component.html","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.module.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/yuuvis-client-framework-smart-search.ts"],"sourcesContent":["/**\n * A single committed `field operator value` condition (e.g. `name LIKE 'foo'`).\n * The `*Label` fields are display strings for the chip; `fieldId`, `operator` and\n * `value` are what actually drive the CMIS clause. `value` is a `string[]` for\n * multi-value operators (which render as `IN (...)`), a string otherwise.\n */\nexport interface FieldCondition {\n /** The queryable property id (or bare column id inside a table). */\n fieldId: string;\n /** The field's internal form-element type (e.g. `string`, `datetime`, `string:catalog`). */\n internalType: string;\n /** Localized field label shown on the chip. */\n fieldLabel: string;\n /** Operator id (e.g. `eq`, `like`, `gt`, `empty`, `date:today`). */\n operator: string;\n /** Display label for the operator (symbol or translated text). */\n operatorLabel: string;\n /** The comparison value; an array for multi-value `IN`-style conditions. */\n value: string | string[];\n /** Full human-readable label for the chip (`\"Name like foo\"`). */\n conditionLabel: string;\n /**\n * Marked by the user as a *dynamic* condition: it is surfaced in the generated\n * fill-out form (see form mode) so its value can be supplied/overridden at run time\n * without rebuilding the query. Purely a builder annotation — it does not affect the\n * emitted query on its own.\n */\n dynamic?: boolean;\n}\n\n/**\n * A parenthesized sub-expression with its own AND/OR combinator. Groups can\n * hold conditions and further groups recursively, allowing deeply nested\n * boolean expressions.\n */\nexport interface ConditionGroup {\n kind: 'group';\n conditions: ConditionNode[];\n combinator: Combinator;\n}\n\n/**\n * A condition on a queryable `table`-type property. A table has no operator of its own;\n * instead it holds column conditions directly — `FieldCondition`s targeting the table's\n * columns, joined by `combinator` and matched against any row. Maps to\n * `tableField[*].(col op val AND/OR …)` in CMIS (`[*]` = any row).\n */\nexport interface TableCondition {\n kind: 'table';\n /** The table property id. */\n fieldId: string;\n fieldLabel: string;\n /** Column conditions (`FieldCondition`s targeting the table's columns). */\n conditions: ConditionNode[];\n /** How the column conditions combine (AND/OR). */\n combinator: Combinator;\n}\n\n/** A child of a `SearchBlock` or `ConditionGroup`. */\nexport type ConditionNode = FieldCondition | ConditionGroup | TableCondition;\n\nexport function isConditionGroup(node: ConditionNode | SearchBlock): node is ConditionGroup {\n return (node as ConditionGroup).kind === 'group';\n}\n\nexport function isTableCondition(node: ConditionNode | SearchBlock): node is TableCondition {\n return (node as TableCondition).kind === 'table';\n}\n\nexport function isFieldCondition(node: ConditionNode): node is FieldCondition {\n return !isConditionGroup(node) && !isTableCondition(node);\n}\n\n/** One target object type within a (potentially multi-type) search block. */\nexport interface SearchBlockType {\n id: string;\n label: string;\n isSot?: boolean;\n}\n\nexport interface SearchBlock {\n /** Stable key for `@for` tracking — generated, not derived from a type id. */\n id: string;\n /** The object types this block targets. Conditions apply to their shared fields. */\n types: SearchBlockType[];\n conditions: ConditionNode[];\n conditionCombinator: Combinator;\n}\n\n/**\n * A container whose `conditions` can be mutated by the edit flow. A `TableCondition` is a\n * container too: its children are row-groups; each row-group's children are column conditions.\n */\nexport type ConditionContainer = SearchBlock | ConditionGroup | TableCondition;\n\n/**\n * Where a full-text search looks. Maps to the column-qualified CONTAINS forms:\n * `all` → `CONTAINS('q')` (metadata + content), `content` → `system:content CONTAINS('q')`,\n * `metadata` → `system:metadata CONTAINS('q')`.\n */\nexport type FulltextScope = 'all' | 'content' | 'metadata';\n\n/**\n * The whole-object full-text search unit. Independent of the condition blocks: it carries its own\n * target types and renders a single `CONTAINS` predicate.\n */\nexport interface FulltextSearch {\n term: string;\n scope: FulltextScope;\n types: SearchBlockType[];\n}\n\nexport type Combinator = 'AND' | 'OR';\n\nexport type BuildStep = 'type' | 'field' | 'operator' | 'value';\n\nexport interface SuggestionItem {\n kind: 'type' | 'field' | 'operator' | 'date-preset';\n id: string;\n label: string;\n internalType?: string;\n /** Set when a field has been paired with an operator while building a condition. */\n operator?: string;\n}\n\n/**\n * Serializable snapshot of a SmartSearch query.\n *\n * Capture via {@link SmartSearchComponent.getState} and restore via\n * {@link SmartSearchComponent.loadState}. Safe for `JSON.stringify` /\n * `JSON.parse` roundtrips (plain data, no class instances or signals).\n */\nexport interface SmartSearchState {\n blocks: SearchBlock[];\n combinator: Combinator;\n /** Optional so states saved before full-text support remain loadable. */\n fulltext?: FulltextSearch;\n}\n","import {\n Combinator,\n ConditionNode,\n FieldCondition,\n FulltextScope,\n FulltextSearch,\n SearchBlock,\n SearchBlockType,\n TableCondition,\n isConditionGroup,\n isTableCondition\n} from './smart-search.interface';\n\nconst DATE_PREFIX_LEN = 5;\n\nfunction escapeCmis(value: string): string {\n return value.replace(/'/g, \"''\").replace(/\\\\/g, '\\\\\\\\');\n}\n\n/**\n * Escape a value for use inside a CMIS `LIKE` pattern. The wildcard characters\n * `%` and `_` are backslash-escaped so a user-typed `%`/`_` matches literally\n * instead of acting as a wildcard. The backslash itself is escaped first (so an\n * existing `\\` can't turn the following character into an escape sequence), then\n * single quotes are doubled as everywhere else.\n */\nfunction escapeCmisLike(value: string): string {\n return value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/%/g, '\\\\%')\n .replace(/_/g, '\\\\_')\n .replace(/'/g, \"''\");\n}\n\nfunction isNumericType(internalType: string): boolean {\n return internalType === 'integer' || internalType === 'decimal';\n}\n\nfunction isBooleanType(internalType: string): boolean {\n return internalType === 'boolean' || internalType.startsWith('boolean:');\n}\n\nfunction isFiniteNumberLiteral(value: string): boolean {\n return value.trim() !== '' && Number.isFinite(Number(value));\n}\n\n/**\n * Render a scalar value as a CMIS literal, driven by the field's internal type.\n * Strings and datetimes are quoted and escaped. Numbers and booleans are emitted\n * bare — but ONLY when the value really is a finite number / a `true|false`\n * boolean; any other value for a non-string field is quoted-and-escaped as a\n * fallback so a malformed or hostile value (e.g. `1 OR 1=1` on an integer field)\n * can never break out of the literal.\n */\nfunction renderScalarLiteral(value: string, internalType: string): string {\n if (internalType.startsWith('string') || internalType === 'datetime') {\n return `'${escapeCmis(value)}'`;\n }\n if (isNumericType(internalType) && isFiniteNumberLiteral(value)) {\n return value;\n }\n if (isBooleanType(internalType) && (value === 'true' || value === 'false')) {\n return value;\n }\n // Unknown type, or a value that doesn't match its declared type: never emit it\n // bare (injection / malformed-SQL guard).\n return `'${escapeCmis(value)}'`;\n}\n\n/**\n * Serialize a single raw form-control value to its CMIS string form.\n * `Date` → ISO 8601; everything else → trimmed string.\n */\nfunction serializeScalar(value: unknown): string {\n if (value === null || value === undefined) return '';\n if (typeof value === 'string') return value.trim();\n if (value instanceof Date) return value.toISOString();\n return String(value);\n}\n\n/**\n * Type-aware \"the user actually entered something\" check. The metadata value\n * editor emits strings, numbers, dates and arrays depending on the field type,\n * so a plain truthiness/`.trim()` test is wrong (`0` and `false` are valid).\n */\nexport function isValuePresent(value: unknown): boolean {\n if (value === null || value === undefined) return false;\n if (typeof value === 'string') return value.trim().length > 0;\n if (typeof value === 'number') return !Number.isNaN(value);\n if (typeof value === 'boolean') return true;\n if (value instanceof Date) return !Number.isNaN(value.getTime());\n if (Array.isArray(value)) return value.some(isValuePresent);\n return true; // objects (e.g. RangeValue) — present if non-null\n}\n\n/**\n * Normalize a raw form-control value into what we store in `FieldCondition.value`.\n * Arrays are kept as a cleaned `string[]` (drives IN-clauses); everything else\n * collapses to a single string.\n */\nexport function normalizeConditionValue(value: unknown): string | string[] {\n if (Array.isArray(value)) {\n return value.map((entry) => serializeScalar(entry)).filter((entry) => entry.length > 0);\n }\n return serializeScalar(value);\n}\n\n/* eslint-disable id-length */\nconst CMIS_OPERATOR: Record<string, string> = {\n eq: '=',\n neq: '<>',\n gt: '>',\n gte: '>=',\n lt: '<',\n lte: '<='\n};\n/* eslint-enable id-length */\n\n/**\n * Operators that carry their own meaning and need no value step: date presets,\n * the boolean `= true/false` shortcuts, and the null checks (`empty`/`not_empty`).\n * The build flow commits these immediately instead of advancing to the value editor.\n */\nexport function isValuelessOperator(operator: string): boolean {\n return (\n operator.startsWith('date:') ||\n operator === 'eq_true' ||\n operator === 'eq_false' ||\n operator === 'empty' ||\n operator === 'not_empty'\n );\n}\n\n/**\n * Whether a condition is an *unset placeholder*: it uses a value-requiring operator\n * (eq / like / gt / …) but carries no value yet. Such conditions are kept in the tree\n * — so a saved query can act as a fill-in template — but contribute nothing to the\n * emitted CMIS query. An empty value is unambiguously \"unset\" here because null-checks\n * have their own `empty` / `not_empty` operators (offered on every queryable type).\n */\nexport function isConditionUnset(cond: FieldCondition): boolean {\n return !isValuelessOperator(cond.operator) && !isValuePresent(cond.value);\n}\n\n/**\n * Produce a copy of `blocks` with the values of the conditions in `overrides` replaced.\n * Used by form mode to overlay the user's fill-out values onto the (untouched) template\n * before building the query, so the saved template stays reusable. Conditions are matched\n * by reference — the keys are the dynamic-condition references captured when form mode was\n * entered. Returns the original array unchanged when there is nothing to overlay.\n */\nexport function overlayConditionValues(\n blocks: SearchBlock[],\n overrides: ReadonlyMap<FieldCondition, string | string[]>\n): SearchBlock[] {\n if (overrides.size === 0) return blocks;\n const mapNode = (node: ConditionNode): ConditionNode => {\n if (isConditionGroup(node) || isTableCondition(node)) {\n return { ...node, conditions: node.conditions.map(mapNode) };\n }\n return overrides.has(node) ? { ...node, value: overrides.get(node) as string | string[] } : node;\n };\n return blocks.map((block) => ({ ...block, conditions: block.conditions.map(mapNode) }));\n}\n\n/* eslint-disable id-length */\n/**\n * Calendar-day arithmetic. Using `new Date(y, m, d ± n)` (rather than\n * adding milliseconds) keeps boundaries aligned to local midnight across\n * DST transitions where a day is not exactly 24h.\n *\n * Week starts on Monday (ISO 8601 / European default).\n */\nexport function datePresetToRange(preset: string): { from: string; to: string } {\n const now = new Date();\n const year = now.getFullYear();\n const month = now.getMonth();\n const date = now.getDate();\n let from: Date;\n let to: Date;\n switch (preset) {\n case 'today':\n from = new Date(year, month, date);\n to = new Date(year, month, date + 1);\n break;\n case 'thisWeek': {\n // getDay(): 0=Sun, 1=Mon … 6=Sat. Shift so Mon=0 … Sun=6.\n const dayFromMonday = (now.getDay() + 6) % 7;\n from = new Date(year, month, date - dayFromMonday);\n to = new Date(year, month, date - dayFromMonday + 7);\n break;\n }\n case 'thisMonth':\n from = new Date(year, month, 1);\n to = new Date(year, month + 1, 1);\n break;\n case 'thisYear':\n default:\n from = new Date(year, 0, 1);\n to = new Date(year + 1, 0, 1);\n break;\n }\n return { from: from.toISOString(), to: to.toISOString() };\n}\n/* eslint-enable id-length */\n\n/**\n * Render a single {@link FieldCondition} as a CMIS predicate. Handles the null\n * checks (`IS NULL` / `IS NOT NULL`), multi-value `IN` / `NOT IN`, `LIKE`\n * (with wildcard-escaped, `%`-wrapped pattern), date-preset ranges\n * (`>= from AND < to`), and the comparison operators (`=`, `<>`, `>`, …).\n */\nexport function buildConditionClause(cond: FieldCondition): string {\n const operator = cond.operator;\n // Unset placeholders (value-requiring operator, no value yet) contribute nothing —\n // this also guards against `LIKE '%%'`, `= ''` and `IN ()` for empty input.\n if (isConditionUnset(cond)) return '';\n // Valueless null checks short-circuit before any value handling.\n if (operator === 'empty') return `${cond.fieldId} IS NULL`;\n if (operator === 'not_empty') return `${cond.fieldId} IS NOT NULL`;\n // Multi-value (e.g. multi-select catalog): `eq` → IN (...), `neq` → NOT IN (...).\n if (Array.isArray(cond.value)) {\n const list = cond.value.map((entry) => renderScalarLiteral(entry, cond.internalType)).join(', ');\n const inOperator = operator === 'neq' ? 'NOT IN' : 'IN';\n return `${cond.fieldId} ${inOperator} (${list})`;\n }\n const value = serializeScalar(cond.value);\n if (operator === 'like') {\n return `${cond.fieldId} LIKE '%${escapeCmisLike(value)}%'`;\n }\n if (operator.startsWith('date:')) {\n // eslint-disable-next-line id-length\n const { from, to } = datePresetToRange(operator.slice(DATE_PREFIX_LEN));\n return `${cond.fieldId} >= '${from}' AND ${cond.fieldId} < '${to}'`;\n }\n const cmisOp = CMIS_OPERATOR[operator] ?? '=';\n return `${cond.fieldId} ${cmisOp} ${renderScalarLiteral(value, cond.internalType)}`;\n}\n\n/**\n * Render a queryable-table condition as `tableField[*].(col op val AND/OR …)`.\n * `[*]` matches any row; the parenthesized column predicates join with the\n * table's combinator. Empty tables contribute nothing.\n *\n * Column predicates reuse {@link buildConditionClause}: a column condition's\n * `fieldId` is the bare column id (no table prefix), which is exactly what\n * belongs inside the parentheses.\n */\nexport function buildTableClause(table: TableCondition): string {\n const cols = table.conditions.map(buildNodeClause).filter((part) => part !== '');\n if (cols.length === 0) return '';\n return `${table.fieldId}[*].(${cols.join(` ${table.combinator} `)})`;\n}\n\n/**\n * Recursively render a condition node. Groups produce parenthesized\n * sub-expressions; empty groups contribute nothing; single-child groups\n * collapse their redundant parens. Table conditions delegate to\n * {@link buildTableClause}.\n */\nexport function buildNodeClause(node: ConditionNode): string {\n if (isTableCondition(node)) {\n return buildTableClause(node);\n }\n if (isConditionGroup(node)) {\n const parts = node.conditions.map(buildNodeClause).filter((part) => part !== '');\n if (parts.length === 0) return '';\n if (parts.length === 1) return parts[0];\n return `(${parts.join(` ${node.combinator} `)})`;\n }\n return buildConditionClause(node);\n}\n\n/**\n * Build the type-matching clause for a block. Primary object types collapse to\n * `objectTypeId = 'x'` (single) or `objectTypeId IN (...)` (multiple); secondary\n * object types use `system:secondaryObjectTypeIds IN (...)`. A block mixing both\n * flavors OR-combines the two clauses inside parentheses.\n */\nexport function buildTypeClause(types: SearchBlockType[]): string {\n const quote = (id: string): string => `'${escapeCmis(id)}'`;\n const primaries = types.filter((type) => !type.isSot).map((type) => type.id);\n const sots = types.filter((type) => type.isSot).map((type) => type.id);\n\n const parts: string[] = [];\n if (primaries.length > 0) {\n parts.push(\n primaries.length === 1\n ? `objectTypeId = ${quote(primaries[0])}`\n : `objectTypeId IN (${primaries.map(quote).join(', ')})`\n );\n }\n if (sots.length > 0) {\n parts.push(`system:secondaryObjectTypeIds IN (${sots.map(quote).join(', ')})`);\n }\n\n if (parts.length === 0) return '';\n return parts.length === 1 ? parts[0] : `(${parts.join(' OR ')})`;\n}\n\n/**\n * The column qualifier that scopes a full-text CONTAINS. `all` searches metadata + content (no\n * qualifier); `content` / `metadata` restrict to that virtual full-text column.\n */\nconst FULLTEXT_SCOPE_COLUMN: Record<FulltextScope, string> = {\n all: '',\n content: 'system:content',\n metadata: 'system:metadata'\n};\n\n/**\n * Build the whole-object full-text clause: a single `CONTAINS('term')` predicate, optionally scoped\n * to a column and AND-ed with a type restriction. Returns `''` when the term is blank.\n */\nexport function buildFulltextClause(fulltext: FulltextSearch): string {\n const term = fulltext.term.trim();\n if (!term) return '';\n\n const column = FULLTEXT_SCOPE_COLUMN[fulltext.scope];\n const contains = column ? `${column} CONTAINS('${escapeCmis(term)}')` : `CONTAINS('${escapeCmis(term)}')`;\n\n const typeCond = buildTypeClause(fulltext.types);\n return typeCond ? `(${typeCond} AND ${contains})` : contains;\n}\n\n/**\n * Assemble the full CMIS statement from the search state. Each unit — the\n * full-text clause plus every type block (type restriction `AND`-ed with its\n * conditions) — is parenthesized and joined by `combinator`. Returns `''` when\n * nothing contributes a clause, so an empty search yields no query.\n *\n * @param blocks The type blocks with their conditions.\n * @param combinator How the top-level units combine (`AND` / `OR`).\n * @param fulltext Optional whole-object full-text unit.\n * @returns A `SELECT * FROM system:object WHERE …` statement, or `''`.\n */\nexport function buildCmisQuery(blocks: SearchBlock[], combinator: Combinator, fulltext?: FulltextSearch): string {\n const units: string[] = [];\n\n const fulltextClause = fulltext ? buildFulltextClause(fulltext) : '';\n if (fulltextClause !== '') units.push(fulltextClause);\n\n for (const block of blocks) {\n const condJoin = ` ${block.conditionCombinator} `;\n const typeCond = buildTypeClause(block.types);\n\n const condParts: string[] = [];\n for (const node of block.conditions) {\n const clause = buildNodeClause(node);\n if (clause !== '') condParts.push(clause);\n }\n // Conditions combine with the user-chosen combinator; the type restriction\n // is always AND-ed with them so a block matches the chosen type(s) *and*\n // satisfies the condition expression.\n const condsClause = condParts.length === 0 ? '' : condParts.length === 1 ? condParts[0] : `(${condParts.join(condJoin)})`;\n\n const blockParts: string[] = [];\n if (typeCond !== '') blockParts.push(typeCond);\n if (condsClause !== '') blockParts.push(condsClause);\n if (blockParts.length === 0) continue;\n\n units.push(blockParts.length === 1 ? blockParts[0] : `(${blockParts.join(' AND ')})`);\n }\n\n if (units.length === 0) return '';\n\n const joined = units.length === 1 ? units[0] : units.join(` ${combinator} `);\n return `SELECT * FROM system:object WHERE ${joined}`;\n}\n","import {\n ConditionContainer,\n ConditionGroup,\n ConditionNode,\n SearchBlock,\n TableCondition,\n isConditionGroup,\n isTableCondition\n} from './smart-search.interface';\n\n/**\n * Walk the block tree and return a new `blocks` array where `target` has been\n * replaced by `updater(target)`. Identity is by reference equality.\n *\n * Returns the original array reference if the target is not found, so callers\n * can detect a no-op via reference equality.\n */\n/**\n * Rebuild a container with a new `conditions` array while preserving its\n * discriminated kind (`SearchBlock` / `ConditionGroup` / `TableCondition`).\n *\n * The cast is sound: every caller only ever produces conditions that are valid\n * for the container's kind (e.g. a table only receives row-groups). TypeScript\n * cannot verify that across a union spread — `{ ...target, conditions }` widens\n * a `TableCondition`'s `conditions` from `ConditionGroup[]` to `ConditionNode[]`\n * and so fails to narrow back to the input type.\n */\nexport function withConditions<T extends ConditionContainer>(container: T, conditions: ConditionNode[]): T {\n return { ...container, conditions } as T;\n}\n\nexport function updateContainer<T extends ConditionContainer>(\n blocks: SearchBlock[],\n target: T,\n updater: (container: T) => T\n): SearchBlock[] {\n let changed = false;\n\n const walk = (node: ConditionNode): ConditionNode => {\n if (node === (target as unknown as ConditionNode)) {\n changed = true;\n return updater(node as unknown as T) as unknown as ConditionNode;\n }\n if (isConditionGroup(node) || isTableCondition(node)) {\n const next = node.conditions.map(walk);\n if (next.some((child, idx) => child !== node.conditions[idx])) {\n return withConditions(node, next);\n }\n }\n return node;\n };\n\n const nextBlocks = blocks.map((block) => {\n if ((block as unknown) === (target as unknown)) {\n changed = true;\n return updater(block as unknown as T) as unknown as SearchBlock;\n }\n const nextConditions = block.conditions.map(walk);\n if (nextConditions.some((child, idx) => child !== block.conditions[idx])) {\n return { ...block, conditions: nextConditions };\n }\n return block;\n });\n\n return changed ? nextBlocks : blocks;\n}\n\n/**\n * Remove `target` from its parent container. If the parent is a\n * `ConditionGroup` and becomes empty as a result, the parent is also removed\n * (recursively up the chain). Top-level `SearchBlock`s are never auto-pruned.\n *\n * Returns the original array reference if the target is not found.\n */\nexport function removeNode(blocks: SearchBlock[], target: ConditionNode): SearchBlock[] {\n let changed = false;\n\n // A group or table that loses its last child is pruned, cascading up the chain.\n const pruneContainer = <T extends ConditionGroup | TableCondition>(container: T): T | null => {\n const kids = container.conditions;\n const next = kids.map(walk).filter((node): node is ConditionNode => node !== null);\n if (next.length === 0) return null;\n if (next.length === kids.length && next.every((child, idx) => child === kids[idx])) {\n return container;\n }\n return withConditions(container, next);\n };\n\n const walk = (node: ConditionNode): ConditionNode | null => {\n if (node === target) {\n changed = true;\n return null;\n }\n if (isConditionGroup(node) || isTableCondition(node)) {\n return pruneContainer(node);\n }\n return node;\n };\n\n const nextBlocks = blocks\n .map((block) => {\n if ((block as unknown as ConditionNode) === target) {\n changed = true;\n return null;\n }\n const nextConditions = block.conditions.map(walk).filter((node): node is ConditionNode => node !== null);\n if (\n nextConditions.length === block.conditions.length &&\n nextConditions.every((child, idx) => child === block.conditions[idx])\n ) {\n return block;\n }\n return { ...block, conditions: nextConditions };\n })\n .filter((block): block is SearchBlock => block !== null);\n\n return changed ? nextBlocks : blocks;\n}\n\n/**\n * Find the top-level `SearchBlock` that contains `container` (directly or\n * transitively). Returns `container` itself when it already is a `SearchBlock`.\n * Returns `null` if not found in the tree.\n */\nexport function findOwningBlock(blocks: SearchBlock[], container: ConditionContainer): SearchBlock | null {\n // A SearchBlock is its own owner; only groups and tables need a tree walk.\n if (!isConditionGroup(container) && !isTableCondition(container)) {\n return blocks.includes(container as SearchBlock) ? (container as SearchBlock) : null;\n }\n\n const contains = (node: ConditionNode, needle: ConditionContainer): boolean => {\n if ((node as ConditionContainer) === needle) return true;\n if (isConditionGroup(node) || isTableCondition(node)) {\n return node.conditions.some((child) => contains(child, needle));\n }\n return false;\n };\n\n for (const block of blocks) {\n if (block.conditions.some((child) => contains(child, container))) return block;\n }\n return null;\n}\n","import { Injectable, computed, inject, signal } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport {\n BaseObjectTypeField,\n GenericObjectType,\n ObjectTypeField,\n SchemaResponseFieldDefinition,\n SystemService,\n TranslateService\n} from '@yuuvis/client-core';\nimport {\n BuildStep,\n Combinator,\n ConditionContainer,\n ConditionGroup,\n ConditionNode,\n FieldCondition,\n FulltextScope,\n FulltextSearch,\n SearchBlock,\n SearchBlockType,\n SmartSearchState,\n SuggestionItem,\n TableCondition,\n isConditionGroup,\n isTableCondition\n} from './smart-search.interface';\nimport { buildCmisQuery, isValuelessOperator, normalizeConditionValue, overlayConditionValues } from './smart-search.query';\nimport { findOwningBlock, removeNode, updateContainer, withConditions } from './smart-search.tree';\n\nconst DATE_PREFIX_LEN = 5;\n\n/**\n * A single row of the generated fill-out form: the dynamic condition it edits, its\n * resolved value-editor field definition (or `null` to fall back to a plain text input)\n * and the `FormControl` bound to the value widget.\n */\nexport interface DynamicFormField {\n condition: FieldCondition;\n def: ObjectTypeField | null;\n control: FormControl;\n}\n\n/**\n * A block's worth of dynamic form rows. The generated fill-out form mirrors the builder's\n * block layout: each block contributes a muted header listing its target types, followed by\n * the dynamic conditions ({@link DynamicFormField}s) collected from anywhere within that block.\n * Blocks with no dynamic conditions are omitted.\n */\nexport interface DynamicFormBlock {\n block: SearchBlock;\n fields: DynamicFormField[];\n}\n\n/* eslint-disable id-length */\nconst OPERATOR_LABEL_KEYS: Record<string, string> = {\n like: 'yuv.smart-search.operator.like',\n empty: 'yuv.smart-search.operator.empty',\n not_empty: 'yuv.smart-search.operator.not-empty'\n};\n\nconst OPERATOR_SYMBOLS: Record<string, string> = {\n eq: '=',\n neq: '≠',\n gt: '>',\n gte: '>=',\n lt: '<',\n lte: '<='\n};\n/* eslint-enable id-length */\n\nconst DATE_PRESETS: { id: string; labelKey: string }[] = [\n { id: 'today', labelKey: 'yuv.smart-search.date-preset.today' },\n { id: 'thisWeek', labelKey: 'yuv.smart-search.date-preset.this-week' },\n { id: 'thisMonth', labelKey: 'yuv.smart-search.date-preset.this-month' },\n { id: 'thisYear', labelKey: 'yuv.smart-search.date-preset.this-year' }\n];\n\n/**\n * State + mutators for SmartSearch, shared between the host component and the\n * recursive `SmartSearchGroupComponent`. Provided at the host component level\n * so each `<yuv-smart-search>` instance gets its own controller.\n *\n * UI concerns (focus management, autocomplete plumbing, blur suppression) stay\n * in the host component; this controller is purely about data.\n */\n@Injectable()\nexport class SmartSearchEditController {\n #system = inject(SystemService);\n #translate = inject(TranslateService);\n\n /** The set of object type IDs that can be used as search blocks. */\n allowedTypes = signal<string[]>([]);\n\n /** ObjectTypeField IDs to exclude from the field-step autocomplete suggestions. */\n skipProperties = signal<string[]>([]);\n\n // ── Persistent form controls (one per step) ──────────────────────────────\n fieldCtrl = new FormControl('');\n operatorCtrl = new FormControl('');\n // Untyped value: the metadata renderer for the picked field may write a\n // string, number, Date or string[] (see normalizeConditionValue).\n valueCtrl = new FormControl<unknown>('');\n\n // ── State signals ─────────────────────────────────────────────────────────\n /** Current input step */\n step = signal<BuildStep>('type');\n /** The owning top-level block (drives field suggestions for the active edit) */\n activeBlock = signal<SearchBlock | null>(null);\n /** The immediate parent container the new condition will land in */\n activeContainer = signal<ConditionContainer | null>(null);\n /** Field selected waiting for operator/value */\n pendingField = signal<SuggestionItem | null>(null);\n /** Operator label for the pending operator (displayed as a pill) */\n pendingOperatorLabel = signal<string>('');\n /** The accumulated search blocks */\n blocks = signal<SearchBlock[]>([]);\n /** Types staged in the multi-select before the block is committed (type step). */\n draftTypes = signal<SearchBlockType[]>([]);\n /** Index of the condition being edited (-1 = new condition) */\n editingConditionIndex = signal<number>(-1);\n /** Snapshot of the condition under edit, used to restore on cancel */\n #editingSnapshot: FieldCondition | null = null;\n /** Monotonic counter for generating stable block ids. */\n #blockSeq = 0;\n /**\n * How to combine the top-level units (full-text unit + type blocks). These are\n * type-scoped, so they always join with OR (\"this as well as that\"); the UI no\n * longer exposes a toggle. Kept as a signal so saved states still round-trip.\n */\n combinator = signal<Combinator>('OR');\n /** The current filter term for autocomplete suggestions */\n inputTerm = signal('');\n\n /** The whole-object full-text search unit (independent of the condition blocks). */\n fulltext = signal<FulltextSearch>({ term: '', scope: 'all', types: [] });\n\n /** Whether the dynamic-conditions feature is enabled (mirrors the host `supportDynamicConditions` input). */\n supportDynamic = signal(false);\n\n /**\n * Form mode: replace the builder with a generated form of the user-marked dynamic\n * conditions. View state only — the template ({@link blocks}) is never mutated; the\n * form's values are overlaid onto the dynamic conditions to drive {@link cmisQuery},\n * so the template stays reusable.\n */\n formMode = signal(false);\n\n /** The dynamic conditions surfaced as form rows; rebuilt on each {@link enterFormMode}. */\n formFields = signal<DynamicFormField[]>([]);\n\n /**\n * The dynamic form rows grouped by their owning block (each carrying a muted header of\n * target types); rebuilt on each {@link enterFormMode}. Blocks combine with `OR`\n * (\"as well as\"), matching the builder.\n */\n formBlocks = signal<DynamicFormBlock[]>([]);\n\n /** Overlay values entered in the form, keyed by the dynamic condition's reference (refs are stable while form mode is active). */\n #formValues = signal<Map<FieldCondition, string | string[]>>(new Map());\n\n /** Whether any condition is marked dynamic (gates the form-mode toggle). */\n hasDynamicConditions = computed(() => this.blocks().some((block) => this.#anyDynamic(block.conditions)));\n\n objectTypes = computed<GenericObjectType[]>(() =>\n this.#system.getObjectTypes(true, 'search').filter((type) => this.allowedTypes().includes(type.id))\n );\n\n /** Fields for the active top-level block, used by the field-step suggestions. */\n activeBlockFields = computed<SuggestionItem[]>(() => this.#sharedFields(this.activeBlock()?.types ?? []));\n\n /**\n * When the active edit is scoped inside a table, the resolved column definitions\n * of that table (as full `ObjectTypeField`s with `_internalType`). `null` when\n * not editing inside a table.\n */\n activeTableColumns = computed<ObjectTypeField[] | null>(() => {\n const container = this.activeContainer();\n return container && isTableCondition(container) ? this.#tableColumns(container) : null;\n });\n\n /**\n * The fields offered at the field step: a table's **columns** when editing\n * inside a table, otherwise the active block's shared fields.\n */\n activeFields = computed<SuggestionItem[]>(() => {\n const columns = this.activeTableColumns();\n if (columns) return this.#columnSuggestions(columns);\n return this.activeBlockFields();\n });\n\n suggestions = computed<SuggestionItem[]>(() => {\n const step = this.step();\n const term = this.inputTerm().toLowerCase();\n\n if (step === 'type') {\n // Only hide types already staged in the *current* draft block. Types used by\n // other blocks stay available — a new block may target the same type again.\n const stagedIds = new Set(this.draftTypes().map((type) => type.id));\n const all: SuggestionItem[] = this.objectTypes()\n .filter((type) => !stagedIds.has(type.id))\n .map((type) => ({ kind: 'type' as const, id: type.id, label: type.label ?? type.id }))\n .sort((a, b) => a.label.localeCompare(b.label));\n return term ? all.filter((item) => item.label.toLowerCase().includes(term)) : all;\n }\n\n if (step === 'field') {\n const all = [...this.activeFields()].sort((a, b) => a.label.localeCompare(b.label));\n return term\n ? all.filter((item) => item.label.toLowerCase().includes(term) || item.id.toLowerCase().includes(term))\n : all;\n }\n\n if (step === 'operator') {\n const field = this.pendingField();\n if (!field) return [];\n const all = this.#operatorsForInternalType(field.internalType ?? 'string');\n return term ? all.filter((item) => item.label.toLowerCase().includes(term)) : all;\n }\n\n return [];\n });\n\n /** Number of top-level query units: the full-text unit (when it has a term) plus each block. */\n unitCount = computed(() => (this.fulltext().term.trim() ? 1 : 0) + this.blocks().length);\n\n showCombinator = computed(() => this.unitCount() >= 2);\n\n cmisQuery = computed(() => {\n // In form mode, overlay the form's entered values onto the (untouched) template so\n // the emitted query reflects the user's fill-out without mutating the saved blocks.\n const blocks = this.formMode() ? overlayConditionValues(this.blocks(), this.#formValues()) : this.blocks();\n return buildCmisQuery(blocks, this.combinator(), this.fulltext());\n });\n\n /** The active input control for the current step. */\n activeCtrl = computed(() => {\n switch (this.step()) {\n case 'field':\n return this.fieldCtrl;\n case 'operator':\n return this.operatorCtrl;\n case 'value':\n return this.valueCtrl;\n default:\n return this.fieldCtrl;\n }\n });\n\n // ── State save / restore ──────────────────────────────────────────────────\n\n /** Deep-clone the current blocks, combinator and full-text unit into a serializable {@link SmartSearchState}. */\n getState(): SmartSearchState {\n return {\n blocks: JSON.parse(JSON.stringify(this.blocks())) as SearchBlock[],\n combinator: this.combinator(),\n fulltext: JSON.parse(JSON.stringify(this.fulltext())) as FulltextSearch\n };\n }\n\n /** Replace the current state with a saved one, normalizing legacy blocks and cancelling any in-progress edit. */\n loadState(state: SmartSearchState): void {\n this.cancelPending();\n // Form-mode overlay keys reference the old tree; drop form mode on reload.\n this.exitFormMode();\n this.blocks.set(state.blocks.map((block) => this.#normalizeBlock(block)));\n this.combinator.set(state.combinator);\n this.fulltext.set(state.fulltext ?? { term: '', scope: 'all', types: [] });\n }\n\n /** Reset all search state back to its initial empty values. */\n reset(): void {\n this.cancelPending();\n this.blocks.set([]);\n this.combinator.set('OR');\n this.fulltext.set({ term: '', scope: 'all', types: [] });\n this.exitFormMode();\n }\n\n // ── Dynamic conditions + form mode ────────────────────────────────────────\n\n /** Mark or unmark a condition as dynamic (immutably replaces the node in its container). */\n setConditionDynamic(container: ConditionContainer, condition: FieldCondition, dynamic: boolean): void {\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) =>\n withConditions(\n target,\n target.conditions.map((node) => (node === condition ? { ...condition, dynamic } : node))\n )\n )\n );\n }\n\n /**\n * Enter form mode: collect every dynamic condition, resolve its value editor and seed a\n * `FormControl` with its current value. The blocks themselves are left untouched — the\n * form's edits are overlaid via {@link setFormValue} / {@link cmisQuery}.\n */\n enterFormMode(): void {\n if (!this.supportDynamic()) return;\n const allFields: DynamicFormField[] = [];\n const formBlocks: DynamicFormBlock[] = [];\n for (const block of this.blocks()) {\n const fields: DynamicFormField[] = [];\n const walk = (nodes: readonly ConditionNode[], table: TableCondition | null): void => {\n for (const node of nodes) {\n if (isTableCondition(node)) walk(node.conditions, node);\n else if (isConditionGroup(node)) walk(node.conditions, table);\n else if (node.dynamic && !isValuelessOperator(node.operator)) {\n const field: DynamicFormField = {\n condition: node,\n def: this.#resolveDynamicFieldDef(block, table, node.fieldId),\n control: new FormControl(node.value)\n };\n fields.push(field);\n allFields.push(field);\n }\n }\n };\n walk(block.conditions, null);\n // Only blocks that actually contribute a fillable row get a header in the form.\n if (fields.length) formBlocks.push({ block, fields });\n }\n this.formFields.set(allFields);\n this.formBlocks.set(formBlocks);\n this.#formValues.set(new Map());\n this.formMode.set(true);\n }\n\n /** Leave form mode and discard the transient form state (the template is untouched). */\n exitFormMode(): void {\n this.formMode.set(false);\n this.formFields.set([]);\n this.formBlocks.set([]);\n this.#formValues.set(new Map());\n }\n\n /** Toggle form mode (rebuilds the form rows on each entry). */\n toggleFormMode(): void {\n if (this.formMode()) this.exitFormMode();\n else this.enterFormMode();\n }\n\n /** Record a value entered in the form for a dynamic condition (drives the overlaid {@link cmisQuery}). */\n setFormValue(condition: FieldCondition, raw: unknown): void {\n this.#formValues.update((current) => new Map(current).set(condition, normalizeConditionValue(raw)));\n }\n\n /** Whether any condition in `nodes` (recursively) is marked dynamic and has a fillable value. */\n #anyDynamic(nodes: readonly ConditionNode[]): boolean {\n return nodes.some((node) =>\n isConditionGroup(node) || isTableCondition(node)\n ? this.#anyDynamic(node.conditions)\n : !!node.dynamic && !isValuelessOperator(node.operator)\n );\n }\n\n /** Resolve the value-editor field definition for a dynamic condition, honouring its table context. */\n #resolveDynamicFieldDef(block: SearchBlock, table: TableCondition | null, fieldId: string): ObjectTypeField | null {\n if (table) {\n return this.#tableColumns(table, block).find((col) => col.id === fieldId) ?? null;\n }\n return this.resolveFieldDefinition(block.types, fieldId);\n }\n\n // ── Full-text unit ────────────────────────────────────────────────────────\n\n /** Set the full-text search term. */\n setFulltextTerm(term: string): void {\n this.fulltext.update((current) => ({ ...current, term }));\n }\n\n /** Set the full-text search scope (`all` / `metadata` / `content`). */\n setFulltextScope(scope: FulltextScope): void {\n this.fulltext.update((current) => ({ ...current, scope }));\n }\n\n /** Add a target type to the full-text unit (no-op if already present). */\n addFulltextType(type: GenericObjectType, label: string): void {\n this.fulltext.update((current) =>\n current.types.some((picked) => picked.id === type.id)\n ? current\n : { ...current, types: [...current.types, { id: type.id, label, isSot: type.isSot }] }\n );\n }\n\n /** Remove a target type from the full-text unit by id. */\n removeFulltextType(id: string): void {\n this.fulltext.update((current) => ({ ...current, types: current.types.filter((type) => type.id !== id) }));\n }\n\n /** Replace the full-text target types from a list of object-type ids (unknown ids are dropped). */\n setFulltextTypes(ids: string[]): void {\n const types = ids\n .map((id) => this.objectTypes().find((objectType) => objectType.id === id))\n .filter((objectType): objectType is GenericObjectType => !!objectType)\n .map((objectType) => ({ id: objectType.id, label: objectType.label ?? objectType.id, isSot: objectType.isSot }));\n this.fulltext.update((current) => ({ ...current, types }));\n }\n\n // ── Type draft (multi-select) ─────────────────────────────────────────────\n\n /** Stage a type in the draft multi-select (no-op if already staged). */\n addDraftType(type: GenericObjectType, label: string): void {\n if (this.draftTypes().some((draft) => draft.id === type.id)) return;\n this.draftTypes.update((draft) => [...draft, { id: type.id, label, isSot: type.isSot }]);\n }\n\n /** Remove a staged type from the draft multi-select. */\n removeDraftType(id: string): void {\n this.draftTypes.update((draft) => draft.filter((type) => type.id !== id));\n }\n\n /**\n * Commit the staged draft types into a new block and clear the draft.\n * Returns the created block, or `null` when the draft is empty.\n */\n confirmDraftTypes(): SearchBlock | null {\n const types = this.draftTypes();\n if (types.length === 0) return null;\n const newBlock: SearchBlock = {\n id: this.#nextId(),\n types: [...types],\n conditions: [],\n conditionCombinator: 'AND'\n };\n this.blocks.update((blocks) => [...blocks, newBlock]);\n this.draftTypes.set([]);\n return newBlock;\n }\n\n // ── Block + group + condition mutators ───────────────────────────────────\n\n /** Remove a whole block; cancels the in-progress edit if it belonged to that block. */\n removeBlock(block: SearchBlock): void {\n this.blocks.update((blocks) => blocks.filter((blk) => blk !== block));\n if (this.activeBlock() === block) {\n this.cancelPending();\n }\n }\n\n /** Append an empty `ConditionGroup` to a container and start adding inside it. */\n addGroup(parent: ConditionContainer): ConditionGroup {\n const newGroup: ConditionGroup = { kind: 'group', conditions: [], combinator: 'AND' };\n this.blocks.update((blocks) =>\n updateContainer(blocks, parent, (container) => withConditions(container, [...container.conditions, newGroup]))\n );\n // The new group's reference is stable across the update because we appended\n // its literal — safe to use directly as the active container.\n this.startAddCondition(newGroup);\n return newGroup;\n }\n\n /**\n * Remove a group from its parent container. If the parent group becomes\n * empty, it is also removed (cascading up). Top-level blocks are preserved.\n */\n removeGroup(group: ConditionGroup): void {\n this.blocks.update((blocks) => removeNode(blocks, group));\n if (this.activeContainer() === group) {\n this.cancelPending();\n }\n }\n\n /** Remove a condition from the tree; empty parent groups/tables are pruned by the cascade. */\n removeCondition(_container: ConditionContainer, condition: FieldCondition): void {\n // While an *existing* condition is being edited it is temporarily pulled out\n // of the tree (see editCondition). Removing the last remaining sibling would\n // empty — and thus prune — the shared container, losing the in-flight edit.\n // Re-home the snapshot first so it survives, then end the edit cleanly.\n if (this.editingConditionIndex() >= 0 && this.#editingSnapshot) {\n this.restoreEditingSnapshot();\n this.cancelPending();\n }\n this.blocks.update((blocks) => removeNode(blocks, condition));\n // If the active container itself was pruned by the cascade, drop the edit.\n const active = this.activeContainer();\n if (active && !this.#containerExists(active)) {\n this.cancelPending();\n }\n }\n\n /** Set the top-level combinator joining the query units (full-text unit + blocks). */\n setCombinator(value: Combinator): void {\n this.combinator.set(value);\n }\n\n /** Set the AND/OR combinator of a single container (block, group or table). */\n setContainerCombinator(container: ConditionContainer, value: Combinator): void {\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) =>\n isConditionGroup(target) || isTableCondition(target)\n ? { ...target, combinator: value }\n : { ...target, conditionCombinator: value }\n )\n );\n }\n\n /**\n * The picked field resolves to a queryable `table` type. A table has no operator\n * of its own; instead it holds column conditions directly. Insert an empty\n * {@link TableCondition} and scope the edit into it so the user picks a column next.\n */\n addTableCondition(field: SuggestionItem): void {\n const container = this.activeContainer();\n if (!container) return;\n const table: TableCondition = {\n kind: 'table',\n fieldId: field.id,\n fieldLabel: field.label,\n conditions: [],\n // Columns are row-scoped and always join with OR (\"a row that has colA as\n // well as colB\"); the UI shows a static \"as well as\" label, not a toggle.\n combinator: 'OR'\n };\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) => withConditions(target, [...target.conditions, table]))\n );\n // `table`'s reference is stable across the update (we appended its literal).\n this.startAddCondition(table);\n }\n\n // ── Inline-edit flow ──────────────────────────────────────────────────────\n\n /** Begin adding a condition inside `container`. */\n startAddCondition(container: ConditionContainer): void {\n const owningBlock = findOwningBlock(this.blocks(), container);\n if (!owningBlock) return;\n this.activeBlock.set(owningBlock);\n this.activeContainer.set(container);\n this.pendingField.set(null);\n this.pendingOperatorLabel.set('');\n this.editingConditionIndex.set(-1);\n this.#editingSnapshot = null;\n this.fieldCtrl.setValue('', { emitEvent: false });\n this.operatorCtrl.setValue('', { emitEvent: false });\n this.valueCtrl.setValue('', { emitEvent: false });\n this.step.set('field');\n }\n\n /** Begin editing an existing condition inside `container`. */\n editCondition(container: ConditionContainer, condition: FieldCondition, index: number): void {\n this.#editingSnapshot = { ...condition };\n // Remove the condition from the tree so the inline editor takes its slot,\n // and capture the new container reference produced by the immutable update.\n let refreshed: ConditionContainer = container;\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) => {\n const next = withConditions(\n target,\n target.conditions.filter((node) => node !== condition)\n );\n refreshed = next;\n return next;\n })\n );\n const owningBlock = findOwningBlock(this.blocks(), refreshed);\n if (!owningBlock) return;\n this.activeBlock.set(owningBlock);\n this.activeContainer.set(refreshed);\n this.editingConditionIndex.set(index);\n\n const fieldItem: SuggestionItem = {\n kind: 'field',\n id: condition.fieldId,\n label: condition.fieldLabel,\n internalType: condition.internalType,\n operator: condition.operator\n };\n this.pendingField.set(fieldItem);\n this.pendingOperatorLabel.set(this.operatorLabel(condition.operator));\n\n this.fieldCtrl.setValue(condition.fieldLabel, { emitEvent: false });\n this.operatorCtrl.setValue(this.operatorLabel(condition.operator), { emitEvent: false });\n\n this.step.set(isValuelessOperator(condition.operator) ? 'operator' : 'value');\n }\n\n /** Jump back to the field step and clear the input so the user can re-type. */\n editField(): void {\n this.fieldCtrl.setValue('', { emitEvent: false });\n this.step.set('field');\n this.inputTerm.set('');\n }\n\n /** Jump back to the operator step and clear the input so the user can re-type. */\n editOperator(): void {\n this.operatorCtrl.setValue('', { emitEvent: false });\n this.step.set('operator');\n this.inputTerm.set('');\n }\n\n /** Abandon the in-progress edit, restoring state and pruning any empty container created for it. */\n cancelPending(): void {\n // Prune empty containers created via addGroup / addTableCondition and never\n // committed into. removeNode cascades up, so an empty parent is removed too.\n const container = this.activeContainer();\n if (\n container &&\n (isConditionGroup(container) || isTableCondition(container)) &&\n container.conditions.length === 0\n ) {\n this.blocks.update((blocks) => removeNode(blocks, container));\n }\n\n this.activeBlock.set(null);\n this.activeContainer.set(null);\n this.pendingField.set(null);\n this.pendingOperatorLabel.set('');\n this.editingConditionIndex.set(-1);\n this.#editingSnapshot = null;\n this.draftTypes.set([]);\n this.step.set('type');\n this.fieldCtrl.setValue('', { emitEvent: false });\n this.operatorCtrl.setValue('', { emitEvent: false });\n this.valueCtrl.setValue('', { emitEvent: false });\n this.inputTerm.set('');\n }\n\n /** Insert (or, when editing, re-insert at its original index) the finished condition into the active container. */\n commitCondition(condition: FieldCondition): void {\n const container = this.activeContainer();\n if (!container) return;\n const idx = this.editingConditionIndex();\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) => {\n const conditions = [...target.conditions];\n if (idx >= 0 && idx <= conditions.length) {\n conditions.splice(idx, 0, condition);\n } else {\n conditions.push(condition);\n }\n return withConditions(target, conditions);\n })\n );\n this.activeBlock.set(null);\n this.activeContainer.set(null);\n this.pendingField.set(null);\n this.pendingOperatorLabel.set('');\n this.editingConditionIndex.set(-1);\n this.#editingSnapshot = null;\n this.step.set('type');\n this.fieldCtrl.setValue('', { emitEvent: false });\n this.operatorCtrl.setValue('', { emitEvent: false });\n this.valueCtrl.setValue('', { emitEvent: false });\n this.inputTerm.set('');\n }\n\n /**\n * On blur with an incomplete edit of an existing condition, reinsert the\n * original verbatim at its original index.\n */\n restoreEditingSnapshot(): void {\n const idx = this.editingConditionIndex();\n const container = this.activeContainer();\n const snapshot = this.#editingSnapshot;\n if (idx < 0 || !container || !snapshot) return;\n\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) => {\n const conditions = [...target.conditions];\n conditions.splice(idx, 0, snapshot);\n return withConditions(target, conditions);\n })\n );\n }\n\n /**\n * Whether the in-progress condition has all parts needed to be committed. A value\n * is *not* required: a field + operator with a blank value commits as an unset\n * placeholder (see {@link isConditionUnset}).\n */\n isConditionComplete(): boolean {\n const field = this.pendingField();\n if (!field) return false;\n return (field.operator ?? '') !== '';\n }\n\n /** The operators available for a field's internal type, as autocomplete items. */\n operatorsForField(field: SuggestionItem): SuggestionItem[] {\n return this.#operatorsForInternalType(field.internalType ?? 'string');\n }\n\n /** Human-readable label for an operator id: a math symbol (`=`, `≠`, …), a translated key, or the id itself. */\n operatorLabel(operator: string): string {\n const symbol = OPERATOR_SYMBOLS[operator];\n if (symbol) return symbol;\n const key = OPERATOR_LABEL_KEYS[operator];\n return key ? this.#translate.instant(key) : operator;\n }\n\n /** Build a condition record from a date preset / boolean operator / value. */\n buildCommitCondition(\n field: SuggestionItem,\n operatorId: string,\n operatorLabelText: string,\n value: string | string[],\n internalTypeOverride?: string\n ): FieldCondition {\n if (operatorId.startsWith('date:')) {\n return {\n fieldId: field.id,\n internalType: internalTypeOverride ?? field.internalType ?? 'datetime',\n fieldLabel: field.label,\n operator: operatorId,\n operatorLabel: operatorLabelText,\n value: operatorId.slice(DATE_PREFIX_LEN),\n conditionLabel: `${field.label} ${operatorLabelText}`\n };\n }\n if (operatorId === 'empty' || operatorId === 'not_empty') {\n return {\n fieldId: field.id,\n internalType: internalTypeOverride ?? field.internalType ?? 'string',\n fieldLabel: field.label,\n operator: operatorId,\n operatorLabel: operatorLabelText,\n value: '',\n conditionLabel: `${field.label} ${operatorLabelText}`\n };\n }\n if (operatorId === 'eq_true' || operatorId === 'eq_false') {\n const val = operatorId === 'eq_true' ? 'true' : 'false';\n return {\n fieldId: field.id,\n internalType: internalTypeOverride ?? field.internalType ?? 'boolean',\n fieldLabel: field.label,\n operator: 'eq',\n operatorLabel: '=',\n value: val,\n conditionLabel: `${field.label} = ${val}`\n };\n }\n const valueLabel = Array.isArray(value) ? value.join(', ') : value;\n return {\n fieldId: field.id,\n internalType: internalTypeOverride ?? field.internalType ?? 'string',\n fieldLabel: field.label,\n operator: operatorId,\n operatorLabel: operatorLabelText,\n value,\n // Omit the value segment for an unset placeholder so the chip/aria label reads\n // cleanly (\"Name like\") instead of carrying a trailing space.\n conditionLabel: valueLabel ? `${field.label} ${operatorLabelText} ${valueLabel}` : `${field.label} ${operatorLabelText}`\n };\n }\n\n /**\n * Resolve a field definition by id across the given block types, falling back to\n * the universal base fields. Used by the host to render the value editor for a\n * picked field (including inherited base fields not present on any type).\n */\n resolveFieldDefinition(types: SearchBlockType[], fieldId: string): ObjectTypeField | null {\n // When editing inside a table row, the field is one of the table's columns.\n const column = this.activeTableColumns()?.find((col) => col.id === fieldId);\n if (column) return column;\n return this.#resolveTypeField(types, fieldId);\n }\n\n /** Resolve a field by id from the block types, falling back to base/system fields. */\n #resolveTypeField(types: SearchBlockType[], fieldId: string): ObjectTypeField | null {\n for (const type of types) {\n const objectType = this.objectTypes().find((candidate) => candidate.id === type.id);\n const field = objectType?.fields.find((typeField) => typeField.id === fieldId);\n if (field) return this.#withInternalType(field);\n }\n const baseField = this.#baseFields().find((field) => field.id === fieldId);\n return baseField ? this.#withInternalType(baseField) : null;\n }\n\n /**\n * Re-derive `_internalType` from the field's full classification — including its\n * `catalog` reference. The schema-baked `_internalType` omits `catalog`, so a\n * dynamic catalog would otherwise be misrendered as a static (empty) catalog.\n * Mirrors how object-form / renderer.service resolve the element type.\n */\n #withInternalType(field: ObjectTypeField): ObjectTypeField {\n return {\n ...field,\n _internalType: this.#system.getInternalFormElementType(field.propertyType, field.classifications, field.catalog)\n };\n }\n\n // ── Internals ─────────────────────────────────────────────────────────────\n\n #nextId(): string {\n this.#blockSeq += 1;\n return `blk-${this.#blockSeq}`;\n }\n\n /**\n * Keep the id sequence ahead of any id already in the tree (e.g. ids carried in\n * by a loaded state). Without this, `#blockSeq` stays at 0 after `loadState` and\n * the next generated id (`blk-1`) collides with a restored `blk-1`, breaking the\n * `@for` track-by on block id.\n */\n #trackSeq(id: string): void {\n const match = /^blk-(\\d+)$/.exec(id);\n if (match) this.#blockSeq = Math.max(this.#blockSeq, Number(match[1]));\n }\n\n /**\n * Normalize a block coming from a loaded state. Ensures an `id`, and migrates\n * legacy single-type blocks (`typeId`/`typeLabel`/`isSot`) into the `types[]`\n * shape so older saved states remain loadable.\n */\n #normalizeBlock(block: SearchBlock): SearchBlock {\n const legacy = block as SearchBlock & { typeId?: string; typeLabel?: string; isSot?: boolean };\n const types = Array.isArray(legacy.types)\n ? legacy.types\n : [{ id: legacy.typeId ?? '', label: legacy.typeLabel ?? legacy.typeId ?? '', isSot: legacy.isSot }];\n const id = legacy.id ?? this.#nextId();\n this.#trackSeq(id);\n return {\n id,\n types,\n conditions: legacy.conditions ?? [],\n conditionCombinator: legacy.conditionCombinator ?? 'AND'\n };\n }\n\n /**\n * Fields shared by *all* given types (the intersection by field id), shaped as\n * field suggestions. A field must be `queryable`, not in `skipProperties`, and\n * present on every type. Field metadata (label, internalType) is taken from the\n * first type that declares it.\n *\n * Each type's own fields are unioned with the universal base/system fields so\n * inherited properties (e.g. `system:creationDate`) become selectable too.\n */\n #sharedFields(types: SearchBlockType[]): SuggestionItem[] {\n if (types.length === 0) return [];\n const objectTypes = types\n .map((type) => this.objectTypes().find((objectType) => objectType.id === type.id))\n .filter((objectType): objectType is GenericObjectType => !!objectType);\n if (objectTypes.length !== types.length) return [];\n\n const skip = new Set(this.skipProperties());\n const [first, ...rest] = objectTypes;\n const restFieldIds = rest.map((objectType) => new Set(this.#resolveFields(objectType).map((field) => field.id)));\n\n return this.#resolveFields(first)\n .filter((field) => field.queryable !== false && !skip.has(field.id))\n .filter((field) => restFieldIds.every((ids) => ids.has(field.id)))\n .map((field) => ({\n kind: 'field' as const,\n id: field.id,\n label: this.#system.getLocalizedLabel(field.id) || field.label || field.name || field.id,\n internalType: this.#system.getInternalFormElementType(field.propertyType, field.classifications, field.catalog)\n }));\n }\n\n /**\n * The universal base/system fields (`system:creationDate`, `system:createdBy`, …)\n * resolved from the global property definitions. These are inherited by every\n * object type but are not part of any concrete type's resolved `fields`.\n */\n #baseFields(): ObjectTypeField[] {\n return Object.values(BaseObjectTypeField)\n .map((id) => this.#system.getObjectTypeField(id))\n .filter((field): field is ObjectTypeField => !!field);\n }\n\n /** A type's own fields unioned with the base fields, de-duplicated by id (own wins). */\n #resolveFields(objectType: GenericObjectType): ObjectTypeField[] {\n return this.#dedupeById([...objectType.fields, ...this.#baseFields()]);\n }\n\n #dedupeById(fields: ObjectTypeField[]): ObjectTypeField[] {\n const seen = new Set<string>();\n return fields.filter((field) => (seen.has(field.id) ? false : seen.add(field.id) && true));\n }\n\n // ── Table columns ──────────────────────────────────────────────────────────\n\n /**\n * Resolve a table field's `columnDefinitions` into full `ObjectTypeField`s. Defaults to\n * the active block (the inline-edit case); form mode passes the owning block explicitly.\n */\n #tableColumns(table: TableCondition, block: SearchBlock | null = this.activeBlock()): ObjectTypeField[] {\n if (!block) return [];\n const tableField = this.#resolveTypeField(block.types, table.fieldId);\n return (tableField?.columnDefinitions ?? []).map((col) => this.#columnToField(col));\n }\n\n /**\n * Map a table column definition to an `ObjectTypeField` with a re-derived\n * `_internalType` (so the value editor renders the right widget). Column defs may\n * carry `classification` (schema) or `classifications` (base shape) — accept both.\n */\n #columnToField(col: SchemaResponseFieldDefinition): ObjectTypeField {\n const classifications = col.classifications ?? col.classification;\n return {\n ...col,\n name: col.name ?? col.id,\n label: this.#system.getLocalizedLabel(col.id) || col.id,\n classifications,\n _internalType: this.#system.getInternalFormElementType(col.propertyType, classifications, col.catalog)\n } as ObjectTypeField;\n }\n\n /** Shape resolved table columns as field-step suggestions. */\n #columnSuggestions(columns: ObjectTypeField[]): SuggestionItem[] {\n const skip = new Set(this.skipProperties());\n return columns\n .filter((col) => col.queryable !== false && !skip.has(col.id))\n .map((col) => ({\n kind: 'field' as const,\n id: col.id,\n label: this.#system.getLocalizedLabel(col.id) || col.label || col.name || col.id,\n internalType: col._internalType\n }));\n }\n\n /** Check whether a container (block, group or table) still exists in the current tree by reference. */\n #containerExists(container: ConditionContainer): boolean {\n if (!isConditionGroup(container) && !isTableCondition(container)) {\n return this.blocks().includes(container as SearchBlock);\n }\n return this.#containsRef(\n this.blocks().flatMap((block) => block.conditions),\n container as ConditionNode\n );\n }\n\n #containsRef(nodes: readonly ConditionNode[], needle: ConditionNode): boolean {\n for (const node of nodes) {\n if (node === needle) return true;\n if ((isConditionGroup(node) || isTableCondition(node)) && this.#containsRef(node.conditions, needle)) return true;\n }\n return false;\n }\n\n #operatorsForInternalType(internalType: string): SuggestionItem[] {\n const base = (ids: string[]): SuggestionItem[] =>\n ids.map((id) => ({ kind: 'operator', id, label: this.operatorLabel(id) }));\n // Null checks are offered on every queryable type.\n const empty = (): SuggestionItem[] => base(['empty', 'not_empty']);\n\n switch (internalType) {\n case 'integer':\n case 'decimal':\n return [...base(['eq', 'neq', 'gt', 'gte', 'lt', 'lte']), ...empty()];\n case 'datetime':\n return [\n ...base(['eq', 'neq', 'gt', 'gte', 'lt', 'lte']),\n ...DATE_PRESETS.map((preset) => ({\n kind: 'date-preset' as const,\n id: `date:${preset.id}`,\n label: this.#translate.instant(preset.labelKey)\n })),\n ...empty()\n ];\n case 'boolean':\n case 'boolean:switch':\n return [\n { kind: 'operator', id: 'eq_true', label: this.#translate.instant('yuv.smart-search.operator.eq-true') },\n { kind: 'operator', id: 'eq_false', label: this.#translate.instant('yuv.smart-search.operator.eq-false') },\n ...empty()\n ];\n case 'string:catalog':\n case 'string:catalog:i18n':\n case 'string:catalog:dynamic':\n case 'string:organization':\n case 'string:organization:set':\n case 'string:reference':\n return [...base(['eq', 'neq']), ...empty()];\n case 'table':\n return [];\n default:\n return [...base(['like', 'eq', 'neq']), ...empty()];\n }\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, TemplateRef, computed, inject, input } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { TranslatePipe } from '@yuuvis/client-core';\nimport { YmtIconButtonDirective } from '@yuuvis/material';\nimport { SmartSearchEditController } from './smart-search-edit.controller';\nimport {\n Combinator,\n ConditionContainer,\n ConditionGroup,\n ConditionNode,\n FieldCondition,\n TableCondition,\n isConditionGroup,\n isTableCondition\n} from './smart-search.interface';\n\n/**\n * Renders a single `ConditionContainer` (block body, nested group, or table).\n *\n * - When `bare=true`, the panel wrapper (combinator header + remove button) is\n * omitted; used by the host for the top-level `SearchBlock` body where the\n * block already has its own type header.\n * - When `bare=false` (default), renders the full nested-group panel with a\n * group-scoped combinator toggle and an X to remove the group.\n * - A `TableCondition` renders as a labelled panel whose children are column\n * conditions; like a block/group it offers \"Add condition\", but no \"Add group\".\n *\n * Chip and inline-editor markup is supplied by the host as `TemplateRef`s so\n * Material plumbing (FormControls, autocomplete) stays in one place.\n *\n * This is an internal building block of {@link SmartSearchComponent} and is\n * rendered recursively for nested groups and tables — it is not meant to be used\n * standalone. The host shares its {@link SmartSearchEditController} instance with it.\n *\n * @example\n * ```html\n * <yuv-smart-search-group\n * [group]=\"block\"\n * [bare]=\"true\"\n * [chipTpl]=\"chipTpl\"\n * [editorTpl]=\"editorTpl\"\n * />\n * ```\n */\n@Component({\n selector: 'yuv-smart-search-group',\n imports: [\n NgTemplateOutlet,\n MatButtonModule,\n YmtIconButtonDirective,\n MatIconModule,\n MatTooltipModule,\n YmtIconButtonDirective,\n TranslatePipe\n ],\n templateUrl: './smart-search-group.component.html',\n styleUrl: './smart-search-group.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SmartSearchGroupComponent {\n /** The container to render: a top-level block body, a nested group, or a table condition. */\n group = input.required<ConditionContainer>();\n\n /**\n * When `true`, omit the panel wrapper (combinator header + remove button) and\n * render only the children. Used for the top-level block body, which already\n * carries its own type header. Defaults to `false` (full nested-group panel).\n */\n bare = input<boolean>(false);\n\n /** Host-supplied template for a committed condition chip. */\n chipTpl = input.required<TemplateRef<{ $implicit: FieldCondition; container: ConditionContainer; index: number }>>();\n\n /** Host-supplied template for the inline condition editor. */\n editorTpl = input.required<TemplateRef<{ $implicit: ConditionContainer }>>();\n\n ctrl = inject(SmartSearchEditController);\n\n isGroup = isConditionGroup;\n isTable = isTableCondition;\n\n /** True when this container is a `TableCondition` (its children are column conditions). */\n isTableContainer = computed(() => isTableCondition(this.group()));\n\n /** Label shown in the table panel header. */\n tableLabel = computed(() => {\n const container = this.group();\n return isTableCondition(container) ? container.fieldLabel : '';\n });\n\n /** Combinator value irrespective of whether this is a block, group or table. */\n containerCombinator = computed<Combinator>(() => {\n const container = this.group();\n if (isConditionGroup(container) || isTableCondition(container)) return container.combinator;\n return container.conditionCombinator;\n });\n\n isActive = computed(() => this.ctrl.activeContainer() === this.group());\n\n /** Set this container's AND/OR combinator. */\n setCombinator(value: Combinator): void {\n this.ctrl.setContainerCombinator(this.group(), value);\n }\n\n /** Remove this container when it is a nested group (no-op for blocks and tables). */\n removeGroup(): void {\n const container = this.group();\n if (isConditionGroup(container)) {\n this.ctrl.removeGroup(container);\n }\n }\n\n /** Begin adding a condition inside this container. */\n startAddCondition(): void {\n this.ctrl.startAddCondition(this.group());\n }\n\n /** Add a nested condition group inside this container. */\n addGroup(): void {\n this.ctrl.addGroup(this.group());\n }\n\n /** Narrow a child node to a {@link ConditionGroup} for the template (guarded by `isGroup`). */\n asGroup(node: ConditionNode): ConditionGroup {\n return node as ConditionGroup;\n }\n\n /** Narrow a child node to a {@link TableCondition} for the template (guarded by `isTable`). */\n asTable(node: ConditionNode): TableCondition {\n return node as TableCondition;\n }\n\n /** Narrow a child node to a {@link FieldCondition} for the template (the remaining case). */\n asCondition(node: ConditionNode): FieldCondition {\n return node as FieldCondition;\n }\n}\n","@if (bare()) {\n <ng-container *ngTemplateOutlet=\"body\" />\n} @else {\n <div class=\"group\" [class.group--active]=\"isActive()\" [class.group--table]=\"isTableContainer()\">\n @if (isTableContainer()) {\n <div class=\"group__header\">\n <span class=\"group__table-label\">{{ tableLabel() }}</span>\n <!-- Pseudo-operator: a table reads like a normal condition — \"Agent has …\".\n It is the only operator a table offers, so it is applied implicitly. -->\n <span class=\"group__table-op\">{{ 'yuv.smart-search.operator.has' | translate }}</span>\n </div>\n }\n <div class=\"group__body\">\n <ng-container *ngTemplateOutlet=\"body\" />\n </div>\n </div>\n}\n\n<ng-template #body>\n @for (node of group().conditions; track node; let i = $index) {\n <div class=\"condition-row\">\n @if (isTable(node)) {\n <yuv-smart-search-group [group]=\"asTable(node)\" [chipTpl]=\"chipTpl()\" [editorTpl]=\"editorTpl()\" />\n } @else if (isGroup(node)) {\n <yuv-smart-search-group [group]=\"asGroup(node)\" [chipTpl]=\"chipTpl()\" [editorTpl]=\"editorTpl()\" />\n } @else {\n <ng-container\n *ngTemplateOutlet=\"chipTpl(); context: { $implicit: asCondition(node), container: group(), index: i }\"\n />\n }\n @if (!$last) {\n <div class=\"condition-combinator\">\n <!-- Table columns are row-scoped and always combine with OR (\"a row that\n has this as well as that\"), so they show a static label instead of a\n toggle. Groups and blocks keep their AND/OR toggle. -->\n @if (isTableContainer()) {\n <span class=\"combinator__label\">{{ 'yuv.smart-search.combinator.as-well-as' | translate }}</span>\n } @else {\n <button\n class=\"combinator__btn\"\n [class.combinator__btn--active]=\"containerCombinator() === 'AND'\"\n (click)=\"setCombinator('AND')\"\n >\n {{ 'yuv.smart-search.combinator.and' | translate }}\n </button>\n <button\n class=\"combinator__btn\"\n [class.combinator__btn--active]=\"containerCombinator() === 'OR'\"\n (click)=\"setCombinator('OR')\"\n >\n {{ 'yuv.smart-search.combinator.or' | translate }}\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (isActive()) {\n <ng-container *ngTemplateOutlet=\"editorTpl(); context: { $implicit: group() }\" />\n } @else {\n <div class=\"add-btns\">\n <button\n ymtIconButton\n icon-button-size=\"small\"\n class=\"add-condition-btn\"\n [matTooltip]=\"'yuv.smart-search.add-condition' | translate\"\n (click)=\"startAddCondition()\"\n >\n <mat-icon>add</mat-icon>\n </button>\n <!-- Tables hold column conditions directly — no grouping inside them. -->\n @if (!isTableContainer()) {\n <button\n ymtIconButton\n icon-button-size=\"small\"\n class=\"add-condition-btn\"\n [matTooltip]=\"'yuv.smart-search.add-group' | translate\"\n (click)=\"addGroup()\"\n >\n <mat-icon>data_array</mat-icon>\n </button>\n }\n </div>\n }\n</ng-template>\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n computed,\n effect,\n inject,\n input,\n output,\n viewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport {\n MatAutocomplete,\n MatAutocompleteModule,\n MatAutocompleteSelectedEvent,\n MatAutocompleteTrigger\n} from '@angular/material/autocomplete';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { ObjectTypeField, TranslatePipe } from '@yuuvis/client-core';\nimport { MetadataFormFieldComponent } from '@yuuvis/client-framework/metadata-form';\nimport { RendererDirective, RendererDirectiveInput } from '@yuuvis/client-framework/renderer';\nimport { YmtIconButtonDirective } from '@yuuvis/material';\nimport { Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { SmartSearchEditController } from './smart-search-edit.controller';\nimport { SmartSearchGroupComponent } from './smart-search-group.component';\nimport {\n Combinator,\n ConditionContainer,\n FieldCondition,\n FulltextScope,\n SearchBlock,\n SmartSearchState,\n SuggestionItem\n} from './smart-search.interface';\n\nimport { isConditionUnset, isValuePresent, isValuelessOperator, normalizeConditionValue } from './smart-search.query';\n\nexport { buildCmisQuery, buildFulltextClause, buildNodeClause } from './smart-search.query';\n\nconst DEBOUNCE_MS = 150;\nconst DATE_PREFIX_LEN = 5;\n\n/**\n * Visual query builder that turns guided, chip-based user input into a CMIS query.\n *\n * The user composes a search in two independent parts:\n * - a **full-text bar** (`CONTAINS`) with a scope (all / metadata / content) and an\n * optional object-type restriction, and\n * - one or more **type blocks**, each targeting one or more object types and holding\n * field conditions, nested groups and table-column conditions.\n *\n * Conditions are built step by step (type → field → operator → value) with an inline\n * autocomplete editor; the value step renders the field's real metadata widget\n * (datepicker, catalog select, organization picker, …). The resulting CMIS query is\n * emitted through {@link queryChange} on every change and can be saved/restored as a\n * plain-data {@link SmartSearchState} via {@link getState} / {@link loadState}.\n *\n * State and mutators live in {@link SmartSearchEditController} (provided per instance);\n * this component owns only the UI concerns (focus, autocomplete plumbing, blur handling).\n *\n * @example\n * ```html\n * <!-- Restrict the picker to two object types and skip a noisy property -->\n * <yuv-smart-search\n * [types]=\"['document', 'invoice']\"\n * [skipProperties]=\"['system:traceId']\"\n * (queryChange)=\"onQuery($event)\"\n * />\n * ```\n *\n * @example\n * ```ts\n * // Save and restore the builder state (e.g. a stored search)\n * const search = viewChild.required(SmartSearchComponent);\n *\n * onQuery(cmisQuery: string) {\n * // empty string means \"no query\" — treat it as a cleared search\n * this.results.set(cmisQuery ? this.backend.search(cmisQuery) : []);\n * }\n *\n * persist() {\n * localStorage.setItem('search', JSON.stringify(this.search().getState()));\n * }\n *\n * restore() {\n * const state = localStorage.getItem('search');\n * if (state) this.search().loadState(JSON.parse(state));\n * }\n * ```\n */\n@Component({\n selector: 'yuv-smart-search',\n imports: [\n ReactiveFormsModule,\n MatAutocompleteModule,\n MatInputModule,\n MatIconModule,\n MatButtonModule,\n MatChipsModule,\n MatSelectModule,\n YmtIconButtonDirective,\n MatTooltipModule,\n MetadataFormFieldComponent,\n RendererDirective,\n SmartSearchGroupComponent,\n TranslatePipe\n ],\n providers: [SmartSearchEditController],\n templateUrl: './smart-search.component.html',\n styleUrl: './smart-search.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SmartSearchComponent {\n #host = inject(ElementRef<HTMLElement>);\n ctrl = inject(SmartSearchEditController);\n\n /**\n * Object-type ids that may be searched. Restricts the type picker (both the\n * full-text type filter and the type-block multi-select) to these types. When\n * empty, no type is offered — set at least one id to enable building blocks.\n */\n types = input<string[]>([]);\n\n /**\n * Field ids to hide from the field-step autocomplete (e.g. internal/system\n * properties that should not be user-queryable). Applies to block fields and\n * table columns alike.\n */\n skipProperties = input<string[]>([]);\n\n /**\n * Enables the **dynamic conditions** feature. When `true`, each committed condition can\n * be marked dynamic and a form-mode toggle appears that swaps the builder for a generated\n * fill-out form of those conditions. Off by default — the builder then behaves exactly as\n * it does without the feature.\n */\n supportDynamicConditions = input<boolean>(false);\n\n /**\n * Emits the current CMIS query string whenever the search changes. An empty\n * string is emitted for an empty search (including the initial seed), so\n * consumers should treat `''` as \"no query\" rather than expecting only\n * non-empty values.\n */\n queryChange = output<string>();\n\n auto = viewChild.required<MatAutocomplete>('auto');\n /** Trigger of the currently-focused autocomplete input — used to re-open the\n * panel after a type pick so the multi-select stays open. */\n trigger = viewChild(MatAutocompleteTrigger);\n\n /** Term control for the full-text bar (independent of the build-step controls). */\n fulltextTermCtrl = new FormControl('');\n\n /** Sentinel option value representing \"no type restriction\" in the type multi-select. */\n readonly ALL_TYPES = '__all__';\n\n /**\n * Guard that prevents `onInlineBlur` from cancelling the pending condition\n * when we programmatically open the inline editor.\n */\n _suppressNextBlur = false;\n\n /** Prevents the valueChanges subscriber from overwriting inputTerm during programmatic setValue */\n _suppressInputTerm = false;\n\n /**\n * Set when a type is staged via the autocomplete so the ENTER that triggered the\n * selection does not also fall through to `confirmTypes()`. Cleared on the next\n * tick. Needed because the chip-input directive changes the keydown listener order,\n * so `onTypeEnter` can run *after* the autocomplete has already closed its panel.\n */\n _suppressTypeConfirm = false;\n\n /**\n * Set while an autocomplete option is being applied so the panel's `closed`\n * event (which Material emits synchronously right after `optionSelected`) is not\n * mistaken for the user abandoning an empty property picker. Consumed\n * synchronously in `onPickerClosed`.\n */\n _pickerJustSelected = false;\n\n /** Previous activeContainer value — used to detect transitions for focus management. */\n #prevActiveContainer: ConditionContainer | null = null;\n\n // ── Public API (proxies onto the controller) ─────────────────────────────\n\n readonly blocks = this.ctrl.blocks;\n readonly draftTypes = this.ctrl.draftTypes;\n readonly combinator = this.ctrl.combinator;\n readonly step = this.ctrl.step;\n readonly activeBlock = this.ctrl.activeBlock;\n readonly activeContainer = this.ctrl.activeContainer;\n readonly pendingField = this.ctrl.pendingField;\n readonly pendingOperatorLabel = this.ctrl.pendingOperatorLabel;\n readonly editingConditionIndex = this.ctrl.editingConditionIndex;\n readonly inputTerm = this.ctrl.inputTerm;\n readonly cmisQuery = this.ctrl.cmisQuery;\n readonly showCombinator = this.ctrl.showCombinator;\n readonly suggestions = this.ctrl.suggestions;\n readonly fulltext = this.ctrl.fulltext;\n readonly objectTypes = this.ctrl.objectTypes;\n readonly activeBlockFields = this.ctrl.activeBlockFields;\n readonly formMode = this.ctrl.formMode;\n readonly formFields = this.ctrl.formFields;\n readonly formBlocks = this.ctrl.formBlocks;\n readonly hasDynamicConditions = this.ctrl.hasDynamicConditions;\n\n /** Whether a committed condition is an unset placeholder (drives the chip's \"fill me\" affordance). */\n isUnset = isConditionUnset;\n\n /**\n * Whether an operator carries its own meaning and has no value input (`is empty`,\n * `is not empty`, date presets). Such conditions can't be made dynamic — there is\n * nothing to fill out in the form.\n */\n isValueless = isValuelessOperator;\n\n /**\n * Selected ids for the type multi-select. Falls back to the `ALL_TYPES`\n * sentinel when no concrete type is picked (empty selection = no restriction).\n */\n readonly fulltextTypeSelection = computed(() => {\n const ids = this.fulltext().types.map((type) => type.id);\n return ids.length ? ids : [this.ALL_TYPES];\n });\n readonly fieldCtrl = this.ctrl.fieldCtrl;\n readonly operatorCtrl = this.ctrl.operatorCtrl;\n readonly valueCtrl = this.ctrl.valueCtrl;\n\n /**\n * Field definition driving the value-step editor. Memoized so the `[field]`\n * reference stays stable across change-detection cycles — re-resolving on every\n * CD (via a template method call) would re-create the editor and reset widgets\n * like the catalog select before their options render.\n */\n readonly valueFieldDef = computed(() => this.getObjectTypeField(this.ctrl.pendingField()));\n\n constructor() {\n // Mirror the `types` input into the controller signal so it can compute\n // available object types and filter the type suggestions.\n effect(() => {\n this.ctrl.allowedTypes.set(this.types());\n });\n\n effect(() => {\n this.ctrl.skipProperties.set(this.skipProperties());\n });\n\n // Mirror the dynamic-conditions opt-in into the controller; leaving the feature\n // disabled also forces form mode off.\n effect(() => {\n const enabled = this.supportDynamicConditions();\n this.ctrl.supportDynamic.set(enabled);\n if (!enabled) this.ctrl.exitFormMode();\n });\n\n // Bind each generated form row's control to the controller's overlay values. The\n // form-field set is rebuilt on every enterFormMode, so re-subscribe on change and\n // tear the previous subscriptions down via the effect's cleanup.\n effect((onCleanup) => {\n const fields = this.ctrl.formFields();\n const sub = new Subscription();\n for (const field of fields) {\n sub.add(\n field.control.valueChanges\n .pipe(debounceTime(DEBOUNCE_MS))\n .subscribe((val) => this.ctrl.setFormValue(field.condition, val))\n );\n }\n onCleanup(() => sub.unsubscribe());\n });\n\n // Drive inputTerm from whichever control is active for the current step\n this.ctrl.fieldCtrl.valueChanges.pipe(debounceTime(DEBOUNCE_MS), takeUntilDestroyed()).subscribe((val) => {\n const step = this.ctrl.step();\n if (step === 'field' || step === 'type') {\n this.ctrl.inputTerm.set(typeof val === 'string' ? val : '');\n }\n });\n\n this.ctrl.operatorCtrl.valueChanges.pipe(debounceTime(DEBOUNCE_MS), takeUntilDestroyed()).subscribe((val) => {\n if (this.ctrl.step() === 'operator') this.ctrl.inputTerm.set(typeof val === 'string' ? val : '');\n });\n\n this.ctrl.valueCtrl.valueChanges.pipe(debounceTime(DEBOUNCE_MS), takeUntilDestroyed()).subscribe((val) => {\n if (this._suppressInputTerm) return;\n if (this.ctrl.step() === 'value') this.ctrl.inputTerm.set(typeof val === 'string' ? val : '');\n });\n\n // Drive the full-text term (independent of the build steps).\n this.fulltextTermCtrl.valueChanges.pipe(debounceTime(DEBOUNCE_MS), takeUntilDestroyed()).subscribe((val) => {\n this.ctrl.setFulltextTerm(typeof val === 'string' ? val : '');\n });\n\n // Emits the seed empty query on first run too — consumers should treat\n // an empty string as \"no query\" rather than expecting only non-empty values.\n effect(() => {\n this.queryChange.emit(this.ctrl.cmisQuery());\n });\n\n // Focus the inline editor whenever a new container becomes active. Covers\n // \"Add condition\" / \"Add group\" clicks coming from any nesting depth —\n // those go straight through the controller without touching the host.\n effect(() => {\n const container = this.ctrl.activeContainer();\n if (!container) {\n this.#prevActiveContainer = null;\n return;\n }\n if (container === this.#prevActiveContainer) return;\n this.#prevActiveContainer = container;\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n });\n\n }\n\n /** Set the AND/OR combinator that joins the conditions within a single container (block, group or table). */\n setConditionCombinator(container: ConditionContainer, value: Combinator): void {\n this.ctrl.setContainerCombinator(container, value);\n }\n\n /**\n * Capture the current search as a serializable snapshot. Safe for\n * `JSON.stringify`/`JSON.parse` roundtrips — use it to persist a search and\n * later restore it with {@link loadState}.\n */\n getState(): SmartSearchState {\n return this.ctrl.getState();\n }\n\n /** Restore a previously {@link getState saved} search, replacing the current one. */\n loadState(state: SmartSearchState): void {\n this.ctrl.loadState(state);\n // The full-text term input is a local control, not bound to the signal (scope and\n // types are). Sync it from the restored state so the term box reflects the load.\n this.fulltextTermCtrl.setValue(this.ctrl.fulltext().term, { emitEvent: false });\n }\n\n /** Clear the whole search: discard all blocks, conditions and the full-text term. */\n clear(): void {\n this.fulltextTermCtrl.setValue('', { emitEvent: false });\n this.trigger()?.closePanel();\n this.ctrl.reset();\n }\n\n /**\n * Toggle form mode: swap the builder for a generated fill-out form of the user-marked\n * dynamic conditions. The template is left intact — the form's values are overlaid onto\n * the query. No-op unless {@link supportDynamicConditions} is set.\n */\n toggleFormMode(): void {\n this.ctrl.toggleFormMode();\n }\n\n /** Enter form mode (\"Essentials\") — generated fill-out form of the dynamic conditions. */\n enterFormMode(): void {\n this.ctrl.enterFormMode();\n }\n\n /** Leave form mode (\"Full Form\") — back to the full builder search. */\n exitFormMode(): void {\n this.ctrl.exitFormMode();\n }\n\n /** Mark/unmark a committed condition as dynamic (surfaced in the fill-out form). */\n toggleDynamic(container: ConditionContainer, condition: FieldCondition): void {\n this.ctrl.setConditionDynamic(container, condition, !condition.dynamic);\n }\n\n /**\n * Set the top-level combinator joining the query units (the full-text unit and\n * the type blocks). Kept for state round-tripping; the UI currently always\n * joins units with `OR`.\n */\n setCombinator(value: Combinator): void {\n this.ctrl.setCombinator(value);\n }\n\n /** Remove an entire type block and all of its conditions. */\n removeBlock(block: SearchBlock): void {\n this.ctrl.removeBlock(block);\n }\n\n /** Commit the staged draft types into a new block and reset the type input. */\n confirmTypes(): void {\n const block = this.ctrl.confirmDraftTypes();\n if (!block) return;\n this.trigger()?.closePanel();\n this.ctrl.fieldCtrl.setValue('', { emitEvent: false });\n this.ctrl.inputTerm.set('');\n setTimeout(() => this.#focusAddCondition(block.id));\n }\n\n /** Start adding a new condition inside the given container and focus the inline editor. */\n startAddCondition(block: SearchBlock): void {\n this.ctrl.startAddCondition(block);\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n }\n\n /** Add a nested condition group inside the given container and focus the inline editor. */\n addGroup(block: SearchBlock): void {\n this.ctrl.addGroup(block);\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n }\n\n /**\n * `displayWith` for the shared autocomplete. Suggestions are objects but the\n * input text is driven by the form controls, so a picked option must not write\n * a label back into the field — return the raw string, or empty otherwise.\n */\n displayFn = (item: SuggestionItem | string | null): string => {\n if (typeof item === 'string') return item;\n return '';\n };\n\n // ── Full-text bar ───────────────────────────────────────────────────────────\n\n /** Set where the full-text search looks: `all` (metadata + content), `metadata`, or `content`. */\n setFulltextScope(scope: FulltextScope): void {\n this.ctrl.setFulltextScope(scope);\n }\n\n /**\n * Reconcile the type multi-select with the \"All types\" sentinel. Picking\n * \"All types\" while concrete types are selected clears the restriction;\n * picking any concrete type drops the sentinel.\n */\n onFulltextTypesChange(ids: string[]): void {\n const hadAll = this.fulltext().types.length === 0;\n // User just clicked \"All types\" while specific types were selected → clear restriction.\n if (ids.includes(this.ALL_TYPES) && !hadAll) {\n this.ctrl.setFulltextTypes([]);\n return;\n }\n // Otherwise keep only the concrete ids (an empty array also means \"all\").\n this.ctrl.setFulltextTypes(ids.filter((id) => id !== this.ALL_TYPES));\n }\n\n // ── Inline-editor coordination ─────────────────────────────────────────────\n\n /**\n * Handle a pick from the shared autocomplete panel. Branches on the current\n * build step: stages a type (keeping the panel open for more), advances a\n * field to its operator (or opens a table container), or applies a chosen\n * operator. Single-operator fields and valueless operators commit immediately.\n */\n onSuggestionSelected(event: MatAutocompleteSelectedEvent): void {\n const item: SuggestionItem = event.option.value;\n\n // The panel closes (and emits `closed`) as a side effect of this selection.\n // Flag it so `onPickerClosed` doesn't treat that close as an abandoned edit —\n // matters for the table branch below, which leaves `step` at 'field'.\n this._pickerJustSelected = true;\n setTimeout(() => (this._pickerJustSelected = false));\n\n switch (this.ctrl.step()) {\n case 'type': {\n const objectType = this.ctrl.objectTypes().find((type) => type.id === item.id);\n if (!objectType) break;\n // Stage the type and keep the panel open so more types can be picked.\n this.ctrl.addDraftType(objectType, item.label);\n this.ctrl.fieldCtrl.setValue('', { emitEvent: false });\n this.ctrl.inputTerm.set('');\n this._suppressNextBlur = true;\n this._suppressTypeConfirm = true;\n setTimeout(() => {\n this.#focusInput();\n this.trigger()?.openPanel();\n this._suppressNextBlur = false;\n this._suppressTypeConfirm = false;\n });\n break;\n }\n case 'field': {\n // A table field has no operator of its own: open a table container with a\n // first row and scope the edit into that row so the user picks a column next.\n if ((item.internalType ?? '') === 'table') {\n this.ctrl.addTableCondition(item);\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n break;\n }\n\n this.ctrl.pendingField.set(item);\n this.ctrl.fieldCtrl.setValue(item.label, { emitEvent: false });\n this.ctrl.operatorCtrl.setValue('', { emitEvent: false });\n // Clear the field-step filter term so the operator suggestions aren't\n // filtered by the text typed to find the field — otherwise the operator\n // panel has no matching options and never opens.\n this.ctrl.inputTerm.set('');\n\n // If the field's type allows exactly one operator, skip the operator\n // picker and apply it immediately.\n const operators = this.ctrl.operatorsForField(item);\n if (operators.length === 1) {\n this.#applyOperator(item, operators[0]);\n break;\n }\n\n this.ctrl.step.set('operator');\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n break;\n }\n case 'operator': {\n const field = this.ctrl.pendingField();\n if (!field) break;\n this.#applyOperator(field, item);\n break;\n }\n }\n }\n\n /**\n * Enter in the add-type input. When the input is empty there's no option to\n * pick, so Enter commits the staged types — even while the autocomplete panel\n * is open. While the user is typing a filter term, Enter is left to the\n * autocomplete so it can select the highlighted option.\n */\n onTypeEnter(): void {\n // The ENTER that selected an autocomplete option must not also confirm the\n // block — regardless of whether this handler runs before or after the\n // autocomplete closes its panel.\n if (this._suppressTypeConfirm) return;\n const term = this.ctrl.fieldCtrl.value;\n if (typeof term === 'string' && term.trim()) return;\n if (this.ctrl.draftTypes().length === 0) return;\n this.confirmTypes();\n }\n\n /**\n * Enter / confirm-button handler for the value step. Commits the in-progress\n * condition when a value is present. No-op while the autocomplete panel is open\n * (Enter selects the highlighted option there) or before the value step.\n */\n onEnter(): void {\n if (this.auto().isOpen) return;\n if (this.ctrl.step() !== 'value') return;\n\n // No value guard: a blank value commits an unset placeholder (fill-in template).\n const raw = this.ctrl.valueCtrl.value;\n\n const field = this.ctrl.pendingField();\n const fieldOp = field?.operator ?? '';\n if (!field || !fieldOp) return;\n\n this.ctrl.commitCondition(\n this.ctrl.buildCommitCondition(field, fieldOp, this.ctrl.operatorLabel(fieldOp), normalizeConditionValue(raw))\n );\n }\n\n /**\n * Called when the inline-input wrapper loses focus.\n * Commits the condition if complete, discards it if incomplete.\n *\n * Deferred via setTimeout(0): raw value renderers (datepicker dialog,\n * mat-select panel, mat-autocomplete panel) mount their UI in the\n * .cdk-overlay-container, which is OUTSIDE the wrapper. Reading\n * document.activeElement on the next task lets us detect that focus\n * is still in our logical scope.\n */\n onInlineBlur(event: FocusEvent): void {\n if (this._suppressNextBlur) return;\n const wrapper = event.currentTarget as HTMLElement;\n\n setTimeout(() => {\n if (this._suppressNextBlur) return;\n if (!this.ctrl.activeContainer()) return;\n if (this.auto().isOpen) return;\n\n const active = document.activeElement as HTMLElement | null;\n if (active && wrapper.contains(active)) return;\n if (active?.closest('.cdk-overlay-container')) return;\n // Backdrop dismissal: focus is briefly on <body> while an overlay pane is still mounted.\n if (document.querySelector('.cdk-overlay-container .cdk-overlay-pane')) return;\n\n if (this.ctrl.isConditionComplete()) {\n this.#commitFromBlur();\n } else {\n this.ctrl.restoreEditingSnapshot();\n this.ctrl.cancelPending();\n }\n });\n }\n\n /**\n * Fired when the shared autocomplete panel closes. Starting a condition opens\n * the property picker; if the user dismisses it (outside click, Escape) without\n * choosing a field, there's an empty editor with nothing to commit — drop it.\n *\n * Only the field step is handled here: operator/value abandonment is already\n * covered by `onInlineBlur` (those steps don't auto-open a picker the user can\n * dismiss while keeping focus). Restores the original when editing an existing\n * condition, mirroring the blur path.\n */\n onPickerClosed(): void {\n // `closed` fires synchronously right after `optionSelected`, so consume the\n // flag here (not in a deferred task) to stay ahead of the focus timers.\n const justSelected = this._pickerJustSelected;\n this._pickerJustSelected = false;\n if (justSelected) return;\n\n setTimeout(() => {\n if (this._suppressNextBlur) return;\n if (this.auto().isOpen) return;\n if (this.ctrl.step() !== 'field') return;\n if (!this.ctrl.activeContainer()) return;\n // A non-empty filter term means the user is still picking a field.\n const term = this.ctrl.fieldCtrl.value;\n if (typeof term === 'string' && term.trim()) return;\n\n this.ctrl.restoreEditingSnapshot();\n this.ctrl.cancelPending();\n });\n }\n\n /** Abandon the in-progress condition edit, discarding any partial input. */\n cancelPending(): void {\n this.ctrl.cancelPending();\n }\n\n /** Jump the inline editor back to the field step so the user can re-pick the field. */\n editField(): void {\n this.ctrl.editField();\n setTimeout(() => this.#focusInput());\n }\n\n /** Jump the inline editor back to the operator step so the user can re-pick the operator. */\n editOperator(): void {\n this.ctrl.editOperator();\n setTimeout(() => this.#focusInput());\n }\n\n /**\n * Open an already-committed condition for editing in place. The condition is\n * pulled out of the tree into the inline editor at its original index, pre-set\n * to the appropriate step (value, or operator for valueless operators).\n */\n editCondition(container: ConditionContainer, condition: FieldCondition, index: number): void {\n this.ctrl.editCondition(container, condition, index);\n this._suppressNextBlur = true;\n if (this.ctrl.step() === 'value') {\n this._suppressInputTerm = true;\n setTimeout(() => {\n this.ctrl.valueCtrl.setValue(condition.value);\n this._suppressInputTerm = false;\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n } else {\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n }\n }\n\n /** Remove a committed condition from its container. */\n removeCondition(container: ConditionContainer, condition: FieldCondition): void {\n this.ctrl.removeCondition(container, condition);\n }\n\n /**\n * Renderer input for a committed condition's value, or `null` when the value\n * should render as plain text. id-based fields (e.g. organization) store an\n * opaque id as the query value; routing it through the property renderer\n * resolves it to a human-readable label for the chip. Valueless operators\n * (empty/not_empty, date presets) and booleans keep their plain text: their\n * stored value is synthetic/serialized, not the shape those renderers expect.\n */\n valueRendererInput(condition: FieldCondition): RendererDirectiveInput | null {\n if (isValuelessOperator(condition.operator)) return null;\n const internalType = condition.internalType ?? '';\n if (internalType.startsWith('boolean')) return null;\n if (!isValuePresent(condition.value)) return null;\n return { propertyName: condition.fieldId, rendererType: internalType, value: condition.value };\n }\n\n /**\n * Resolve the full {@link ObjectTypeField} definition for a suggestion item in\n * the active block, or `null` when none applies. Drives the value-step metadata\n * widget so the right editor (datepicker, catalog, …) is rendered.\n */\n getObjectTypeField(item: SuggestionItem | null): ObjectTypeField | null {\n const block = this.ctrl.activeBlock();\n if (!item || !block) return null;\n // The field is shared across all of the block's types — take the definition\n // from the first type that declares it, falling back to the universal base fields.\n return this.ctrl.resolveFieldDefinition(block.types, item.id);\n }\n\n // ── Internals ─────────────────────────────────────────────────────────────\n\n /**\n * Apply a chosen operator to the pending field: commit straight away for\n * date-preset / boolean operators (which carry their own value), otherwise\n * advance to the value step.\n */\n #applyOperator(field: SuggestionItem, item: SuggestionItem): void {\n if (item.kind === 'date-preset') {\n this.ctrl.commitCondition({\n fieldId: field.id,\n internalType: field.internalType ?? 'datetime',\n fieldLabel: field.label,\n operator: item.id,\n operatorLabel: item.label,\n value: item.id.slice(DATE_PREFIX_LEN),\n conditionLabel: `${field.label} ${item.label}`\n });\n } else if (item.id === 'eq_true' || item.id === 'eq_false') {\n const val = item.id === 'eq_true' ? 'true' : 'false';\n this.ctrl.commitCondition({\n fieldId: field.id,\n internalType: field.internalType ?? 'boolean',\n fieldLabel: field.label,\n operator: 'eq',\n operatorLabel: '=',\n value: val,\n conditionLabel: `${field.label} = ${val}`\n });\n } else if (item.id === 'empty' || item.id === 'not_empty') {\n this.ctrl.commitCondition(this.ctrl.buildCommitCondition(field, item.id, item.label, ''));\n } else {\n this.ctrl.pendingField.set({ ...field, operator: item.id });\n this.ctrl.pendingOperatorLabel.set(item.label);\n this.ctrl.operatorCtrl.setValue(item.label, { emitEvent: false });\n this.ctrl.inputTerm.set('');\n this.ctrl.step.set('value');\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n }\n }\n\n #commitFromBlur(): void {\n const field = this.ctrl.pendingField();\n if (!field) return;\n const operator = field.operator ?? '';\n if (!operator) return;\n const raw = this.ctrl.valueCtrl.value;\n\n this.ctrl.commitCondition(\n this.ctrl.buildCommitCondition(field, operator, this.ctrl.operatorLabel(operator), normalizeConditionValue(raw))\n );\n }\n\n #focusInput(): void {\n (this.#host.nativeElement.querySelector('.inline-input input') as HTMLInputElement | null)?.focus();\n }\n\n /** Focus the \"Add condition\" (+) button of a block — used after confirming its types. */\n #focusAddCondition(blockId: string): void {\n (\n this.#host.nativeElement.querySelector(\n `.block[data-block-id=\"${blockId}\"] .add-condition-btn`\n ) as HTMLButtonElement | null\n )?.focus();\n }\n}\n","<div class=\"smart-search\" halo-container halo-container-skip=\"true\">\n <!-- Condition chip template — passed down into the recursive group component. -->\n <ng-template #chipTpl let-condition let-container=\"container\" let-i=\"index\">\n <div\n class=\"condition-chip\"\n [class.condition-chip--unset]=\"isUnset(condition)\"\n [class.condition-chip--dynamic]=\"condition.dynamic\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"'yuv.smart-search.condition.edit-aria' | translate: { label: condition.conditionLabel }\"\n (click)=\"editCondition(container, condition, i)\"\n (keydown.space)=\"$event.preventDefault(); editCondition(container, condition, i)\"\n (keydown.enter)=\"$event.preventDefault(); editCondition(container, condition, i)\"\n >\n @if (supportDynamicConditions() && !isValueless(condition.operator)) {\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"condition-chip__dynamic\"\n tabindex=\"-1\"\n [attr.aria-pressed]=\"!!condition.dynamic\"\n [matTooltip]=\"\n (condition.dynamic\n ? 'yuv.smart-search.condition.unmark-dynamic'\n : 'yuv.smart-search.condition.mark-dynamic'\n ) | translate\n \"\n (click)=\"$event.stopPropagation(); toggleDynamic(container, condition)\"\n >\n <mat-icon>bolt</mat-icon>\n </button>\n }\n\n <span class=\"condition-chip__part condition-chip__field\">\n <!-- <mat-icon>tune</mat-icon> -->\n {{ condition.fieldLabel }}\n </span>\n <span class=\"condition-chip__part condition-chip__op\">{{ condition.operatorLabel }}</span>\n <span class=\"condition-chip__part condition-chip__value\">\n @if (isUnset(condition)) {\n <span class=\"condition-chip__placeholder\">{{ 'yuv.smart-search.condition.unset-value' | translate }}</span>\n } @else if (valueRendererInput(condition); as rendererInput) {\n <ng-container *yuvRenderer=\"rendererInput\" />\n } @else {\n {{ condition.value }}\n }\n </span>\n <!-- @if (supportDynamicConditions() && !isValueless(condition.operator)) {\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"condition-chip__dynamic\"\n tabindex=\"-1\"\n [attr.aria-pressed]=\"!!condition.dynamic\"\n [matTooltip]=\"\n (condition.dynamic\n ? 'yuv.smart-search.condition.unmark-dynamic'\n : 'yuv.smart-search.condition.mark-dynamic'\n ) | translate\n \"\n (click)=\"$event.stopPropagation(); toggleDynamic(container, condition)\"\n >\n <mat-icon>bolt</mat-icon>\n </button>\n } -->\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"condition-chip__remove\"\n tabindex=\"-1\"\n [attr.aria-label]=\"'yuv.smart-search.condition.remove' | translate\"\n (click)=\"$event.stopPropagation(); removeCondition(container, condition)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </ng-template>\n\n <!-- Inline editor template — rendered inside whichever container is active. -->\n <ng-template #editorTpl>\n <div class=\"inline-input\" tabindex=\"-1\" (focusout)=\"onInlineBlur($event)\" (keydown.escape)=\"cancelPending()\">\n @if (ctrl.step() !== 'field' && ctrl.pendingField()) {\n <button\n class=\"part-pill\"\n [class.part-pill--active]=\"ctrl.step() === 'field'\"\n (click)=\"editField()\"\n [matTooltip]=\"'yuv.smart-search.field.change' | translate\"\n >\n {{ ctrl.pendingField()?.label }}\n </button>\n }\n\n @if (ctrl.step() === 'value' && ctrl.operatorCtrl.value) {\n <button\n class=\"part-pill\"\n [class.part-pill--active]=\"ctrl.step() === 'operator'\"\n (click)=\"editOperator()\"\n [matTooltip]=\"'yuv.smart-search.operator.change' | translate\"\n >\n {{ ctrl.operatorCtrl.value }}\n </button>\n }\n\n @if (ctrl.step() === 'field') {\n <input\n [formControl]=\"ctrl.fieldCtrl\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"'yuv.smart-search.field.pick' | translate\"\n (keydown.enter)=\"onEnter()\"\n />\n } @else if (ctrl.step() === 'operator') {\n <input\n [formControl]=\"ctrl.operatorCtrl\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"'yuv.smart-search.operator.select' | translate\"\n (keydown.enter)=\"onEnter()\"\n />\n } @else if (ctrl.step() === 'value') {\n @let otf = valueFieldDef();\n @if (otf) {\n <yuv-metadata-form-field variant=\"raw\" [field]=\"otf\" situation=\"EDIT\" [formControl]=\"ctrl.valueCtrl\" />\n } @else {\n <input\n [formControl]=\"ctrl.valueCtrl\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"'yuv.smart-search.value.enter' | translate\"\n (keydown.enter)=\"onEnter()\"\n />\n }\n }\n\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"confirm-btn\"\n [disabled]=\"!ctrl.isConditionComplete()\"\n (click)=\"onEnter()\"\n [matTooltip]=\"'yuv.smart-search.confirm' | translate\"\n >\n <mat-icon>check</mat-icon>\n </button>\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"cancel-btn\"\n (click)=\"cancelPending()\"\n [matTooltip]=\"'yuv.smart-search.cancel' | translate\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </ng-template>\n\n <!-- ── Toolbar: Essentials ⇄ Full Form mode switch (only when the dynamic feature is enabled) ── -->\n @if (supportDynamicConditions() && (hasDynamicConditions() || formMode())) {\n <div class=\"toolbar\">\n <div class=\"toolbar__mode\" role=\"group\" [attr.aria-label]=\"'yuv.smart-search.mode.label' | translate\">\n <button\n type=\"button\"\n class=\"toolbar__mode-btn\"\n [class.toolbar__mode-btn--active]=\"formMode()\"\n [attr.aria-pressed]=\"formMode()\"\n (click)=\"enterFormMode()\"\n >\n {{ 'yuv.smart-search.mode.essentials' | translate }}\n </button>\n <button\n type=\"button\"\n class=\"toolbar__mode-btn\"\n [class.toolbar__mode-btn--active]=\"!formMode()\"\n [attr.aria-pressed]=\"!formMode()\"\n (click)=\"exitFormMode()\"\n >\n {{ 'yuv.smart-search.mode.full' | translate }}\n </button>\n </div>\n </div>\n }\n\n <!-- ── Generated fill-out form of the dynamic conditions ─────────────── -->\n @if (formMode()) {\n <div class=\"dynamic-form\">\n @for (grp of formBlocks(); track grp.block.id; let last = $last) {\n <div class=\"dynamic-form__block\">\n <!-- Muted header listing the block's target types (a block matches any of them). -->\n <div class=\"dynamic-form__block-header\">\n @for (t of grp.block.types; track t.id) {\n @if (!$first) {\n <span class=\"dynamic-form__type-sep\">{{ 'yuv.smart-search.combinator.or' | translate }}</span>\n }\n <span class=\"dynamic-form__type\">{{ t.label }}</span>\n }\n </div>\n\n <div class=\"dynamic-form__rows\">\n @for (f of grp.fields; track f.condition) {\n <div class=\"dynamic-form__row\">\n <span class=\"dynamic-form__label\">{{ f.condition.fieldLabel }}</span>\n <span class=\"dynamic-form__op\">{{ f.condition.operatorLabel }}</span>\n <div class=\"dynamic-form__value\">\n @if (f.def) {\n <yuv-metadata-form-field variant=\"raw\" [field]=\"f.def\" situation=\"EDIT\" [formControl]=\"f.control\" />\n } @else {\n <input [formControl]=\"f.control\" [placeholder]=\"'yuv.smart-search.value.enter' | translate\" />\n }\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Blocks are type-scoped and always combine with OR (\"this type as well as that type\"). -->\n @if (!last) {\n <div class=\"combinator\">\n <span class=\"combinator__label\">{{ 'yuv.smart-search.combinator.as-well-as' | translate }}</span>\n </div>\n }\n } @empty {\n <span class=\"dynamic-form__empty\">{{ 'yuv.smart-search.mode.empty' | translate }}</span>\n }\n </div>\n } @else {\n <!-- ── Full-text search bar ──────────────────────────────────────── -->\n <div class=\"fulltext\" [class.muted]=\"!fulltext().term.trim() && ctrl.blocks().length\">\n <!-- Row 1: full-width term -->\n <div class=\"fulltext__term\">\n <mat-icon class=\"fulltext__icon\">search</mat-icon>\n <input\n class=\"fulltext__input\"\n [formControl]=\"fulltextTermCtrl\"\n [placeholder]=\"'yuv.smart-search.fulltext.placeholder' | translate\"\n />\n </div>\n\n <!-- Row 2: scope (single) + types (multiple) -->\n <div class=\"fulltext__filters\">\n <mat-select\n class=\"fulltext__scope\"\n [panelWidth]=\"null\"\n panelClass=\"smart-search-select-panel\"\n [value]=\"fulltext().scope\"\n (selectionChange)=\"setFulltextScope($event.value)\"\n [aria-label]=\"'yuv.smart-search.fulltext.scope.label' | translate\"\n >\n <mat-option value=\"all\">{{ 'yuv.smart-search.fulltext.scope.all' | translate }}</mat-option>\n <mat-option value=\"metadata\">{{ 'yuv.smart-search.fulltext.scope.metadata' | translate }}</mat-option>\n <mat-option value=\"content\">{{ 'yuv.smart-search.fulltext.scope.content' | translate }}</mat-option>\n </mat-select>\n\n <mat-select\n class=\"fulltext__types\"\n multiple\n [panelWidth]=\"null\"\n panelClass=\"smart-search-select-panel\"\n [value]=\"fulltextTypeSelection()\"\n (selectionChange)=\"onFulltextTypesChange($event.value)\"\n [aria-label]=\"'yuv.smart-search.fulltext.types.label' | translate\"\n >\n <mat-option [value]=\"ALL_TYPES\">{{ 'yuv.smart-search.fulltext.types.all' | translate }}</mat-option>\n @for (t of objectTypes(); track t.id) {\n <mat-option [value]=\"t.id\">{{ t.label ?? t.id }}</mat-option>\n }\n </mat-select>\n </div>\n </div>\n\n <!-- Joiner between the full-text unit and the condition blocks. Top-level units\n always combine with OR (\"looking for this as well as that\"), so this is a\n static label rather than a toggle. -->\n @if (fulltext().term.trim() && ctrl.blocks().length) {\n <div class=\"combinator\">\n <span class=\"combinator__label\">{{ 'yuv.smart-search.combinator.as-well-as' | translate }}</span>\n </div>\n }\n\n <!-- ── Step 1: Type blocks ─────────────────────────────────────────── -->\n @for (block of ctrl.blocks(); track block.id) {\n <div class=\"block\" [attr.data-block-id]=\"block.id\" [class.block--active]=\"ctrl.activeBlock() === block\">\n <div class=\"block__header\">\n <div class=\"block__types\">\n @for (t of block.types; track t.id) {\n @if (!$first) {\n <span class=\"block__type-sep\">{{ 'yuv.smart-search.combinator.or' | translate }}</span>\n }\n <span class=\"block__type\">\n <span class=\"block__type-label\">{{ t.label }}</span>\n </span>\n }\n </div>\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"block__remove\"\n (click)=\"removeBlock(block)\"\n [matTooltip]=\"'yuv.smart-search.type.remove' | translate\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n\n <div class=\"block__conditions\">\n <yuv-smart-search-group [group]=\"block\" [bare]=\"true\" [chipTpl]=\"chipTpl\" [editorTpl]=\"editorTpl\" />\n </div>\n </div>\n\n <!-- Static joiner between blocks — blocks are type-scoped, so they always\n combine with OR (\"this type as well as that type\"). -->\n @if (!$last && ctrl.showCombinator()) {\n <div class=\"combinator\">\n <span class=\"combinator__label\">{{ 'yuv.smart-search.combinator.as-well-as' | translate }}</span>\n </div>\n }\n }\n\n <!-- ── Step 1 input: add a type block (multi-select) ──────────────── -->\n @if (ctrl.step() === 'type') {\n <div class=\"add-type-row\">\n <button\n type=\"button\"\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"add-type-row__icon\"\n (click)=\"typeInput.focus()\"\n [attr.aria-label]=\"'yuv.smart-search.add-type' | translate\"\n >\n <mat-icon>add_circle_outline</mat-icon>\n </button>\n\n <!-- Staged draft types as removable Material chips -->\n <mat-chip-grid\n #typeChipGrid\n class=\"add-type-row__chips\"\n [attr.aria-label]=\"'yuv.smart-search.add-type' | translate\"\n >\n @for (t of ctrl.draftTypes(); track t.id) {\n <mat-chip-row (removed)=\"ctrl.removeDraftType(t.id)\">\n {{ t.label }}\n <button matChipRemove [attr.aria-label]=\"'yuv.smart-search.type.remove-draft' | translate\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-chip-row>\n }\n <input\n #typeInput\n [formControl]=\"ctrl.fieldCtrl\"\n [placeholder]=\"'yuv.smart-search.add-type' | translate\"\n [matAutocomplete]=\"auto\"\n [matChipInputFor]=\"typeChipGrid\"\n (keydown.enter)=\"onTypeEnter()\"\n (keydown.escape)=\"cancelPending()\"\n />\n </mat-chip-grid>\n\n @if (ctrl.draftTypes().length) {\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"add-type-row__confirm\"\n (click)=\"confirmTypes()\"\n [matTooltip]=\"'yuv.smart-search.type.confirm' | translate\"\n >\n <mat-icon>check</mat-icon>\n </button>\n }\n </div>\n }\n }\n\n <!-- ── Shared autocomplete panel ──────────────────────────────────── -->\n <mat-autocomplete\n #auto\n panelWidth=\"auto\"\n [displayWith]=\"displayFn\"\n (optionSelected)=\"onSuggestionSelected($event)\"\n (closed)=\"onPickerClosed()\"\n >\n @for (s of ctrl.suggestions(); track s.id) {\n <mat-option [value]=\"s\">\n <div class=\"suggestion\">\n @if (s.kind !== 'type') {\n <mat-icon class=\"suggestion__icon\">\n @switch (s.kind) {\n @case ('field') {\n tune\n }\n @case ('date-preset') {\n calendar_today\n }\n @default {\n manage_search\n }\n }\n </mat-icon>\n }\n <span class=\"suggestion__label\">{{ s.label }}</span>\n </div>\n </mat-option>\n }\n </mat-autocomplete>\n</div>\n","import { NgModule } from '@angular/core';\nimport { SmartSearchComponent } from './smart-search.component';\n\n/**\n * Convenience NgModule that imports and re-exports {@link SmartSearchComponent}.\n *\n * The component is standalone — prefer importing `SmartSearchComponent` directly.\n * This module exists only for consumers still organized around NgModules.\n */\nconst cmp = [SmartSearchComponent];\n\n@NgModule({\n imports: cmp,\n exports: cmp\n})\nexport class YuvSmartSearchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["DATE_PREFIX_LEN","i1","i2","i3","i6"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6DM,SAAU,gBAAgB,CAAC,IAAiC,EAAA;AAChE,IAAA,OAAQ,IAAuB,CAAC,IAAI,KAAK,OAAO;AAClD;AAEM,SAAU,gBAAgB,CAAC,IAAiC,EAAA;AAChE,IAAA,OAAQ,IAAuB,CAAC,IAAI,KAAK,OAAO;AAClD;AAEM,SAAU,gBAAgB,CAAC,IAAmB,EAAA;IAClD,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;AAC3D;;AC1DA,MAAMA,iBAAe,GAAG,CAAC;AAEzB,SAAS,UAAU,CAAC,KAAa,EAAA;AAC/B,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;AACzD;AAEA;;;;;;AAMG;AACH,SAAS,cAAc,CAAC,KAAa,EAAA;AACnC,IAAA,OAAO;AACJ,SAAA,OAAO,CAAC,KAAK,EAAE,MAAM;AACrB,SAAA,OAAO,CAAC,IAAI,EAAE,KAAK;AACnB,SAAA,OAAO,CAAC,IAAI,EAAE,KAAK;AACnB,SAAA,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;AACxB;AAEA,SAAS,aAAa,CAAC,YAAoB,EAAA;AACzC,IAAA,OAAO,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS;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A,OAAA,EAAA,CANpB,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAApB,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAMpB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,YAHtB,GAAG,CAAA,EAAA,CAAA,CAAA;;4FAGD,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAJhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,GAAG;AACZ,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACdD;;AAEG;;;;"}
1
+ {"version":3,"file":"yuuvis-client-framework-smart-search.mjs","sources":["../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.interface.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.query.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.tree.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search-edit.controller.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search-group.component.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search-group.component.html","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.component.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.component.html","../../../../../libs/yuuvis/client-framework/smart-search/src/lib/smart-search.module.ts","../../../../../libs/yuuvis/client-framework/smart-search/src/yuuvis-client-framework-smart-search.ts"],"sourcesContent":["/**\n * A single committed `field operator value` condition (e.g. `name LIKE 'foo'`).\n * The `*Label` fields are display strings for the chip; `fieldId`, `operator` and\n * `value` are what actually drive the CMIS clause. `value` is a `string[]` for\n * multi-value operators (which render as `IN (...)`), a string otherwise.\n */\nexport interface FieldCondition {\n /** The queryable property id (or bare column id inside a table). */\n fieldId: string;\n /** The field's internal form-element type (e.g. `string`, `datetime`, `string:catalog`). */\n internalType: string;\n /** Localized field label shown on the chip. */\n fieldLabel: string;\n /** Operator id (e.g. `eq`, `like`, `gt`, `empty`, `date:today`). */\n operator: string;\n /** Display label for the operator (symbol or translated text). */\n operatorLabel: string;\n /** The comparison value; an array for multi-value `IN`-style conditions. */\n value: string | string[];\n /** Full human-readable label for the chip (`\"Name like foo\"`). */\n conditionLabel: string;\n /**\n * Marked by the user as a *dynamic* condition: it is surfaced in the generated\n * fill-out form (see form mode) so its value can be supplied/overridden at run time\n * without rebuilding the query. Purely a builder annotation — it does not affect the\n * emitted query on its own.\n */\n dynamic?: boolean;\n}\n\n/**\n * A parenthesized sub-expression with its own AND/OR combinator. Groups can\n * hold conditions and further groups recursively, allowing deeply nested\n * boolean expressions.\n */\nexport interface ConditionGroup {\n kind: 'group';\n conditions: ConditionNode[];\n combinator: Combinator;\n}\n\n/**\n * A condition on a queryable `table`-type property. A table has no operator of its own;\n * instead it holds column conditions directly — `FieldCondition`s targeting the table's\n * columns, joined by `combinator` and matched against any row. Maps to\n * `tableField[*].(col op val AND/OR …)` in CMIS (`[*]` = any row).\n */\nexport interface TableCondition {\n kind: 'table';\n /** The table property id. */\n fieldId: string;\n fieldLabel: string;\n /** Column conditions (`FieldCondition`s targeting the table's columns). */\n conditions: ConditionNode[];\n /** How the column conditions combine (AND/OR). */\n combinator: Combinator;\n}\n\n/** A child of a `SearchBlock` or `ConditionGroup`. */\nexport type ConditionNode = FieldCondition | ConditionGroup | TableCondition;\n\nexport function isConditionGroup(node: ConditionNode | SearchBlock): node is ConditionGroup {\n return (node as ConditionGroup).kind === 'group';\n}\n\nexport function isTableCondition(node: ConditionNode | SearchBlock): node is TableCondition {\n return (node as TableCondition).kind === 'table';\n}\n\nexport function isFieldCondition(node: ConditionNode): node is FieldCondition {\n return !isConditionGroup(node) && !isTableCondition(node);\n}\n\n/** One target object type within a (potentially multi-type) search block. */\nexport interface SearchBlockType {\n id: string;\n label: string;\n isSot?: boolean;\n}\n\nexport interface SearchBlock {\n /** Stable key for `@for` tracking — generated, not derived from a type id. */\n id: string;\n /** The object types this block targets. Conditions apply to their shared fields. */\n types: SearchBlockType[];\n conditions: ConditionNode[];\n conditionCombinator: Combinator;\n}\n\n/**\n * A container whose `conditions` can be mutated by the edit flow. A `TableCondition` is a\n * container too: its children are row-groups; each row-group's children are column conditions.\n */\nexport type ConditionContainer = SearchBlock | ConditionGroup | TableCondition;\n\n/**\n * Where a full-text search looks. Maps to the column-qualified CONTAINS forms:\n * `all` → `CONTAINS('q')` (metadata + content), `content` → `system:content CONTAINS('q')`,\n * `metadata` → `system:metadata CONTAINS('q')`.\n */\nexport type FulltextScope = 'all' | 'content' | 'metadata';\n\n/**\n * The whole-object full-text search unit. Independent of the condition blocks: it carries its own\n * target types and renders a single `CONTAINS` predicate.\n */\nexport interface FulltextSearch {\n term: string;\n scope: FulltextScope;\n types: SearchBlockType[];\n}\n\nexport type Combinator = 'AND' | 'OR';\n\nexport type BuildStep = 'type' | 'field' | 'operator' | 'value';\n\nexport interface SuggestionItem {\n kind: 'type' | 'field' | 'operator' | 'date-preset';\n id: string;\n label: string;\n internalType?: string;\n /** Set when a field has been paired with an operator while building a condition. */\n operator?: string;\n}\n\n/**\n * Serializable snapshot of a SmartSearch query.\n *\n * Capture via {@link SmartSearchComponent.getState} and restore via\n * {@link SmartSearchComponent.loadState}. Safe for `JSON.stringify` /\n * `JSON.parse` roundtrips (plain data, no class instances or signals).\n */\nexport interface SmartSearchState {\n blocks: SearchBlock[];\n combinator: Combinator;\n /** Optional so states saved before full-text support remain loadable. */\n fulltext?: FulltextSearch;\n}\n","import {\n Combinator,\n ConditionNode,\n FieldCondition,\n FulltextScope,\n FulltextSearch,\n SearchBlock,\n SearchBlockType,\n TableCondition,\n isConditionGroup,\n isTableCondition\n} from './smart-search.interface';\n\nconst DATE_PREFIX_LEN = 5;\n\nfunction escapeCmis(value: string): string {\n return value.replace(/'/g, \"''\").replace(/\\\\/g, '\\\\\\\\');\n}\n\n/**\n * Escape a value for use inside a CMIS `LIKE` pattern. The wildcard characters\n * `%` and `_` are backslash-escaped so a user-typed `%`/`_` matches literally\n * instead of acting as a wildcard. The backslash itself is escaped first (so an\n * existing `\\` can't turn the following character into an escape sequence), then\n * single quotes are doubled as everywhere else.\n */\nfunction escapeCmisLike(value: string): string {\n return value\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/%/g, '\\\\%')\n .replace(/_/g, '\\\\_')\n .replace(/'/g, \"''\");\n}\n\nfunction isNumericType(internalType: string): boolean {\n return internalType === 'integer' || internalType === 'decimal';\n}\n\nfunction isBooleanType(internalType: string): boolean {\n return internalType === 'boolean' || internalType.startsWith('boolean:');\n}\n\nfunction isFiniteNumberLiteral(value: string): boolean {\n return value.trim() !== '' && Number.isFinite(Number(value));\n}\n\n/**\n * Render a scalar value as a CMIS literal, driven by the field's internal type.\n * Strings and datetimes are quoted and escaped. Numbers and booleans are emitted\n * bare — but ONLY when the value really is a finite number / a `true|false`\n * boolean; any other value for a non-string field is quoted-and-escaped as a\n * fallback so a malformed or hostile value (e.g. `1 OR 1=1` on an integer field)\n * can never break out of the literal.\n */\nfunction renderScalarLiteral(value: string, internalType: string): string {\n if (internalType.startsWith('string') || internalType === 'datetime') {\n return `'${escapeCmis(value)}'`;\n }\n if (isNumericType(internalType) && isFiniteNumberLiteral(value)) {\n return value;\n }\n if (isBooleanType(internalType) && (value === 'true' || value === 'false')) {\n return value;\n }\n // Unknown type, or a value that doesn't match its declared type: never emit it\n // bare (injection / malformed-SQL guard).\n return `'${escapeCmis(value)}'`;\n}\n\n/**\n * Serialize a single raw form-control value to its CMIS string form.\n * `Date` → ISO 8601; everything else → trimmed string.\n */\nfunction serializeScalar(value: unknown): string {\n if (value === null || value === undefined) return '';\n if (typeof value === 'string') return value.trim();\n if (value instanceof Date) return value.toISOString();\n return String(value);\n}\n\n/**\n * Type-aware \"the user actually entered something\" check. The metadata value\n * editor emits strings, numbers, dates and arrays depending on the field type,\n * so a plain truthiness/`.trim()` test is wrong (`0` and `false` are valid).\n */\nexport function isValuePresent(value: unknown): boolean {\n if (value === null || value === undefined) return false;\n if (typeof value === 'string') return value.trim().length > 0;\n if (typeof value === 'number') return !Number.isNaN(value);\n if (typeof value === 'boolean') return true;\n if (value instanceof Date) return !Number.isNaN(value.getTime());\n if (Array.isArray(value)) return value.some(isValuePresent);\n return true; // objects (e.g. RangeValue) — present if non-null\n}\n\n/**\n * Normalize a raw form-control value into what we store in `FieldCondition.value`.\n * Arrays are kept as a cleaned `string[]` (drives IN-clauses); everything else\n * collapses to a single string.\n */\nexport function normalizeConditionValue(value: unknown): string | string[] {\n if (Array.isArray(value)) {\n return value.map((entry) => serializeScalar(entry)).filter((entry) => entry.length > 0);\n }\n return serializeScalar(value);\n}\n\n/* eslint-disable id-length */\nconst CMIS_OPERATOR: Record<string, string> = {\n eq: '=',\n neq: '<>',\n gt: '>',\n gte: '>=',\n lt: '<',\n lte: '<='\n};\n/* eslint-enable id-length */\n\n/**\n * Operators that carry their own meaning and need no value step: date presets,\n * the boolean `= true/false` shortcuts, and the null checks (`empty`/`not_empty`).\n * The build flow commits these immediately instead of advancing to the value editor.\n */\nexport function isValuelessOperator(operator: string): boolean {\n return (\n operator.startsWith('date:') ||\n operator === 'eq_true' ||\n operator === 'eq_false' ||\n operator === 'empty' ||\n operator === 'not_empty'\n );\n}\n\n/**\n * Whether a condition is an *unset placeholder*: it uses a value-requiring operator\n * (eq / like / gt / …) but carries no value yet. Such conditions are kept in the tree\n * — so a saved query can act as a fill-in template — but contribute nothing to the\n * emitted CMIS query. An empty value is unambiguously \"unset\" here because null-checks\n * have their own `empty` / `not_empty` operators (offered on every queryable type).\n */\nexport function isConditionUnset(cond: FieldCondition): boolean {\n return !isValuelessOperator(cond.operator) && !isValuePresent(cond.value);\n}\n\n/**\n * Produce a copy of `blocks` with the values of the conditions in `overrides` replaced.\n * Used by form mode to overlay the user's fill-out values onto the (untouched) template\n * before building the query, so the saved template stays reusable. Conditions are matched\n * by reference — the keys are the dynamic-condition references captured when form mode was\n * entered. Returns the original array unchanged when there is nothing to overlay.\n */\nexport function overlayConditionValues(\n blocks: SearchBlock[],\n overrides: ReadonlyMap<FieldCondition, string | string[]>\n): SearchBlock[] {\n if (overrides.size === 0) return blocks;\n const mapNode = (node: ConditionNode): ConditionNode => {\n if (isConditionGroup(node) || isTableCondition(node)) {\n return { ...node, conditions: node.conditions.map(mapNode) };\n }\n return overrides.has(node) ? { ...node, value: overrides.get(node) as string | string[] } : node;\n };\n return blocks.map((block) => ({ ...block, conditions: block.conditions.map(mapNode) }));\n}\n\n/* eslint-disable id-length */\n/**\n * Calendar-day arithmetic. Using `new Date(y, m, d ± n)` (rather than\n * adding milliseconds) keeps boundaries aligned to local midnight across\n * DST transitions where a day is not exactly 24h.\n *\n * Week starts on Monday (ISO 8601 / European default).\n */\nexport function datePresetToRange(preset: string): { from: string; to: string } {\n const now = new Date();\n const year = now.getFullYear();\n const month = now.getMonth();\n const date = now.getDate();\n let from: Date;\n let to: Date;\n switch (preset) {\n case 'today':\n from = new Date(year, month, date);\n to = new Date(year, month, date + 1);\n break;\n case 'thisWeek': {\n // getDay(): 0=Sun, 1=Mon … 6=Sat. Shift so Mon=0 … Sun=6.\n const dayFromMonday = (now.getDay() + 6) % 7;\n from = new Date(year, month, date - dayFromMonday);\n to = new Date(year, month, date - dayFromMonday + 7);\n break;\n }\n case 'thisMonth':\n from = new Date(year, month, 1);\n to = new Date(year, month + 1, 1);\n break;\n case 'thisYear':\n default:\n from = new Date(year, 0, 1);\n to = new Date(year + 1, 0, 1);\n break;\n }\n return { from: from.toISOString(), to: to.toISOString() };\n}\n/* eslint-enable id-length */\n\n/**\n * Render a single {@link FieldCondition} as a CMIS predicate. Handles the null\n * checks (`IS NULL` / `IS NOT NULL`), multi-value `IN` / `NOT IN`, `LIKE`\n * (with wildcard-escaped, `%`-wrapped pattern), date-preset ranges\n * (`>= from AND < to`), and the comparison operators (`=`, `<>`, `>`, …).\n */\nexport function buildConditionClause(cond: FieldCondition): string {\n const operator = cond.operator;\n // Unset placeholders (value-requiring operator, no value yet) contribute nothing —\n // this also guards against `LIKE '%%'`, `= ''` and `IN ()` for empty input.\n if (isConditionUnset(cond)) return '';\n // Valueless null checks short-circuit before any value handling.\n if (operator === 'empty') return `${cond.fieldId} IS NULL`;\n if (operator === 'not_empty') return `${cond.fieldId} IS NOT NULL`;\n // Multi-value (e.g. multi-select catalog): `eq` → IN (...), `neq` → NOT IN (...).\n if (Array.isArray(cond.value)) {\n const list = cond.value.map((entry) => renderScalarLiteral(entry, cond.internalType)).join(', ');\n const inOperator = operator === 'neq' ? 'NOT IN' : 'IN';\n return `${cond.fieldId} ${inOperator} (${list})`;\n }\n const value = serializeScalar(cond.value);\n if (operator === 'like') {\n return `${cond.fieldId} LIKE '%${escapeCmisLike(value)}%'`;\n }\n if (operator.startsWith('date:')) {\n // eslint-disable-next-line id-length\n const { from, to } = datePresetToRange(operator.slice(DATE_PREFIX_LEN));\n return `${cond.fieldId} >= '${from}' AND ${cond.fieldId} < '${to}'`;\n }\n const cmisOp = CMIS_OPERATOR[operator] ?? '=';\n return `${cond.fieldId} ${cmisOp} ${renderScalarLiteral(value, cond.internalType)}`;\n}\n\n/**\n * Render a queryable-table condition as `tableField[*].(col op val AND/OR …)`.\n * `[*]` matches any row; the parenthesized column predicates join with the\n * table's combinator. Empty tables contribute nothing.\n *\n * Column predicates reuse {@link buildConditionClause}: a column condition's\n * `fieldId` is the bare column id (no table prefix), which is exactly what\n * belongs inside the parentheses.\n */\nexport function buildTableClause(table: TableCondition): string {\n const cols = table.conditions.map(buildNodeClause).filter((part) => part !== '');\n if (cols.length === 0) return '';\n return `${table.fieldId}[*].(${cols.join(` ${table.combinator} `)})`;\n}\n\n/**\n * Recursively render a condition node. Groups produce parenthesized\n * sub-expressions; empty groups contribute nothing; single-child groups\n * collapse their redundant parens. Table conditions delegate to\n * {@link buildTableClause}.\n */\nexport function buildNodeClause(node: ConditionNode): string {\n if (isTableCondition(node)) {\n return buildTableClause(node);\n }\n if (isConditionGroup(node)) {\n const parts = node.conditions.map(buildNodeClause).filter((part) => part !== '');\n if (parts.length === 0) return '';\n if (parts.length === 1) return parts[0];\n return `(${parts.join(` ${node.combinator} `)})`;\n }\n return buildConditionClause(node);\n}\n\n/**\n * Build the type-matching clause for a block. Primary object types collapse to\n * `objectTypeId = 'x'` (single) or `objectTypeId IN (...)` (multiple); secondary\n * object types use `system:secondaryObjectTypeIds IN (...)`. A block mixing both\n * flavors OR-combines the two clauses inside parentheses.\n */\nexport function buildTypeClause(types: SearchBlockType[]): string {\n const quote = (id: string): string => `'${escapeCmis(id)}'`;\n const primaries = types.filter((type) => !type.isSot).map((type) => type.id);\n const sots = types.filter((type) => type.isSot).map((type) => type.id);\n\n const parts: string[] = [];\n if (primaries.length > 0) {\n parts.push(\n primaries.length === 1\n ? `objectTypeId = ${quote(primaries[0])}`\n : `objectTypeId IN (${primaries.map(quote).join(', ')})`\n );\n }\n if (sots.length > 0) {\n parts.push(`system:secondaryObjectTypeIds IN (${sots.map(quote).join(', ')})`);\n }\n\n if (parts.length === 0) return '';\n return parts.length === 1 ? parts[0] : `(${parts.join(' OR ')})`;\n}\n\n/**\n * The column qualifier that scopes a full-text CONTAINS. `all` searches metadata + content (no\n * qualifier); `content` / `metadata` restrict to that virtual full-text column.\n */\nconst FULLTEXT_SCOPE_COLUMN: Record<FulltextScope, string> = {\n all: '',\n content: 'system:content',\n metadata: 'system:metadata'\n};\n\n/**\n * Build the whole-object full-text clause: a single `CONTAINS('term')` predicate, optionally scoped\n * to a column and AND-ed with a type restriction. Returns `''` when the term is blank.\n */\nexport function buildFulltextClause(fulltext: FulltextSearch): string {\n const term = fulltext.term.trim();\n if (!term) return '';\n\n const column = FULLTEXT_SCOPE_COLUMN[fulltext.scope];\n const contains = column ? `${column} CONTAINS('${escapeCmis(term)}')` : `CONTAINS('${escapeCmis(term)}')`;\n\n const typeCond = buildTypeClause(fulltext.types);\n return typeCond ? `(${typeCond} AND ${contains})` : contains;\n}\n\n/**\n * Assemble the full CMIS statement from the search state. Each unit — the\n * full-text clause plus every type block (type restriction `AND`-ed with its\n * conditions) — is parenthesized and joined by `combinator`. Returns `''` when\n * nothing contributes a clause, so an empty search yields no query.\n *\n * @param blocks The type blocks with their conditions.\n * @param combinator How the top-level units combine (`AND` / `OR`).\n * @param fulltext Optional whole-object full-text unit.\n * @returns A `SELECT * FROM system:object WHERE …` statement, or `''`.\n */\nexport function buildCmisQuery(blocks: SearchBlock[], combinator: Combinator, fulltext?: FulltextSearch): string {\n const units: string[] = [];\n\n const fulltextClause = fulltext ? buildFulltextClause(fulltext) : '';\n if (fulltextClause !== '') units.push(fulltextClause);\n\n for (const block of blocks) {\n const condJoin = ` ${block.conditionCombinator} `;\n const typeCond = buildTypeClause(block.types);\n\n const condParts: string[] = [];\n for (const node of block.conditions) {\n const clause = buildNodeClause(node);\n if (clause !== '') condParts.push(clause);\n }\n // Conditions combine with the user-chosen combinator; the type restriction\n // is always AND-ed with them so a block matches the chosen type(s) *and*\n // satisfies the condition expression.\n const condsClause = condParts.length === 0 ? '' : condParts.length === 1 ? condParts[0] : `(${condParts.join(condJoin)})`;\n\n const blockParts: string[] = [];\n if (typeCond !== '') blockParts.push(typeCond);\n if (condsClause !== '') blockParts.push(condsClause);\n if (blockParts.length === 0) continue;\n\n units.push(blockParts.length === 1 ? blockParts[0] : `(${blockParts.join(' AND ')})`);\n }\n\n if (units.length === 0) return '';\n\n const joined = units.length === 1 ? units[0] : units.join(` ${combinator} `);\n return `SELECT * FROM system:object WHERE ${joined}`;\n}\n","import {\n ConditionContainer,\n ConditionGroup,\n ConditionNode,\n SearchBlock,\n TableCondition,\n isConditionGroup,\n isTableCondition\n} from './smart-search.interface';\n\n/**\n * Walk the block tree and return a new `blocks` array where `target` has been\n * replaced by `updater(target)`. Identity is by reference equality.\n *\n * Returns the original array reference if the target is not found, so callers\n * can detect a no-op via reference equality.\n */\n/**\n * Rebuild a container with a new `conditions` array while preserving its\n * discriminated kind (`SearchBlock` / `ConditionGroup` / `TableCondition`).\n *\n * The cast is sound: every caller only ever produces conditions that are valid\n * for the container's kind (e.g. a table only receives row-groups). TypeScript\n * cannot verify that across a union spread — `{ ...target, conditions }` widens\n * a `TableCondition`'s `conditions` from `ConditionGroup[]` to `ConditionNode[]`\n * and so fails to narrow back to the input type.\n */\nexport function withConditions<T extends ConditionContainer>(container: T, conditions: ConditionNode[]): T {\n return { ...container, conditions } as T;\n}\n\nexport function updateContainer<T extends ConditionContainer>(\n blocks: SearchBlock[],\n target: T,\n updater: (container: T) => T\n): SearchBlock[] {\n let changed = false;\n\n const walk = (node: ConditionNode): ConditionNode => {\n if (node === (target as unknown as ConditionNode)) {\n changed = true;\n return updater(node as unknown as T) as unknown as ConditionNode;\n }\n if (isConditionGroup(node) || isTableCondition(node)) {\n const next = node.conditions.map(walk);\n if (next.some((child, idx) => child !== node.conditions[idx])) {\n return withConditions(node, next);\n }\n }\n return node;\n };\n\n const nextBlocks = blocks.map((block) => {\n if ((block as unknown) === (target as unknown)) {\n changed = true;\n return updater(block as unknown as T) as unknown as SearchBlock;\n }\n const nextConditions = block.conditions.map(walk);\n if (nextConditions.some((child, idx) => child !== block.conditions[idx])) {\n return { ...block, conditions: nextConditions };\n }\n return block;\n });\n\n return changed ? nextBlocks : blocks;\n}\n\n/**\n * Remove `target` from its parent container. If the parent is a\n * `ConditionGroup` and becomes empty as a result, the parent is also removed\n * (recursively up the chain). Top-level `SearchBlock`s are never auto-pruned.\n *\n * Returns the original array reference if the target is not found.\n */\nexport function removeNode(blocks: SearchBlock[], target: ConditionNode): SearchBlock[] {\n let changed = false;\n\n // A group or table that loses its last child is pruned, cascading up the chain.\n const pruneContainer = <T extends ConditionGroup | TableCondition>(container: T): T | null => {\n const kids = container.conditions;\n const next = kids.map(walk).filter((node): node is ConditionNode => node !== null);\n if (next.length === 0) return null;\n if (next.length === kids.length && next.every((child, idx) => child === kids[idx])) {\n return container;\n }\n return withConditions(container, next);\n };\n\n const walk = (node: ConditionNode): ConditionNode | null => {\n if (node === target) {\n changed = true;\n return null;\n }\n if (isConditionGroup(node) || isTableCondition(node)) {\n return pruneContainer(node);\n }\n return node;\n };\n\n const nextBlocks = blocks\n .map((block) => {\n if ((block as unknown as ConditionNode) === target) {\n changed = true;\n return null;\n }\n const nextConditions = block.conditions.map(walk).filter((node): node is ConditionNode => node !== null);\n if (\n nextConditions.length === block.conditions.length &&\n nextConditions.every((child, idx) => child === block.conditions[idx])\n ) {\n return block;\n }\n return { ...block, conditions: nextConditions };\n })\n .filter((block): block is SearchBlock => block !== null);\n\n return changed ? nextBlocks : blocks;\n}\n\n/**\n * Find the top-level `SearchBlock` that contains `container` (directly or\n * transitively). Returns `container` itself when it already is a `SearchBlock`.\n * Returns `null` if not found in the tree.\n */\nexport function findOwningBlock(blocks: SearchBlock[], container: ConditionContainer): SearchBlock | null {\n // A SearchBlock is its own owner; only groups and tables need a tree walk.\n if (!isConditionGroup(container) && !isTableCondition(container)) {\n return blocks.includes(container as SearchBlock) ? (container as SearchBlock) : null;\n }\n\n const contains = (node: ConditionNode, needle: ConditionContainer): boolean => {\n if ((node as ConditionContainer) === needle) return true;\n if (isConditionGroup(node) || isTableCondition(node)) {\n return node.conditions.some((child) => contains(child, needle));\n }\n return false;\n };\n\n for (const block of blocks) {\n if (block.conditions.some((child) => contains(child, container))) return block;\n }\n return null;\n}\n","import { Injectable, computed, inject, signal } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { _ as marker } from '@ngx-translate/core';\nimport {\n BaseObjectTypeField,\n GenericObjectType,\n ObjectTypeField,\n SchemaResponseFieldDefinition,\n SystemService,\n TranslateService\n} from '@yuuvis/client-core';\nimport {\n BuildStep,\n Combinator,\n ConditionContainer,\n ConditionGroup,\n ConditionNode,\n FieldCondition,\n FulltextScope,\n FulltextSearch,\n SearchBlock,\n SearchBlockType,\n SmartSearchState,\n SuggestionItem,\n TableCondition,\n isConditionGroup,\n isTableCondition\n} from './smart-search.interface';\nimport {\n buildCmisQuery,\n isValuelessOperator,\n normalizeConditionValue,\n overlayConditionValues\n} from './smart-search.query';\nimport { findOwningBlock, removeNode, updateContainer, withConditions } from './smart-search.tree';\n\nconst DATE_PREFIX_LEN = 5;\n\nmarker('yuv.smart-search.date-preset.this-month');\nmarker('yuv.smart-search.date-preset.this-week');\nmarker('yuv.smart-search.date-preset.today');\nmarker('yuv.smart-search.date-preset.this-year');\n\nmarker('yuv.smart-search.operator.like');\nmarker('yuv.smart-search.operator.empty');\nmarker('yuv.smart-search.operator.not-empty');\n\n/**\n * A single row of the generated fill-out form: the dynamic condition it edits, its\n * resolved value-editor field definition (or `null` to fall back to a plain text input)\n * and the `FormControl` bound to the value widget.\n */\nexport interface DynamicFormField {\n condition: FieldCondition;\n def: ObjectTypeField | null;\n control: FormControl;\n}\n\n/**\n * A block's worth of dynamic form rows. The generated fill-out form mirrors the builder's\n * block layout: each block contributes a muted header listing its target types, followed by\n * the dynamic conditions ({@link DynamicFormField}s) collected from anywhere within that block.\n * Blocks with no dynamic conditions are omitted.\n */\nexport interface DynamicFormBlock {\n block: SearchBlock;\n fields: DynamicFormField[];\n}\n\n/* eslint-disable id-length */\nconst OPERATOR_LABEL_KEYS: Record<string, string> = {\n like: 'yuv.smart-search.operator.like',\n empty: 'yuv.smart-search.operator.empty',\n not_empty: 'yuv.smart-search.operator.not-empty'\n};\n\nconst OPERATOR_SYMBOLS: Record<string, string> = {\n eq: '=',\n neq: '≠',\n gt: '>',\n gte: '>=',\n lt: '<',\n lte: '<='\n};\n/* eslint-enable id-length */\n\nconst DATE_PRESETS: { id: string; labelKey: string }[] = [\n { id: 'today', labelKey: 'yuv.smart-search.date-preset.today' },\n { id: 'thisWeek', labelKey: 'yuv.smart-search.date-preset.this-week' },\n { id: 'thisMonth', labelKey: 'yuv.smart-search.date-preset.this-month' },\n { id: 'thisYear', labelKey: 'yuv.smart-search.date-preset.this-year' }\n];\n\n/**\n * State + mutators for SmartSearch, shared between the host component and the\n * recursive `SmartSearchGroupComponent`. Provided at the host component level\n * so each `<yuv-smart-search>` instance gets its own controller.\n *\n * UI concerns (focus management, autocomplete plumbing, blur suppression) stay\n * in the host component; this controller is purely about data.\n */\n@Injectable()\nexport class SmartSearchEditController {\n #system = inject(SystemService);\n #translate = inject(TranslateService);\n\n /** The set of object type IDs that can be used as search blocks. */\n allowedTypes = signal<string[]>([]);\n\n /** ObjectTypeField IDs to exclude from the field-step autocomplete suggestions. */\n skipProperties = signal<string[]>([]);\n\n // ── Persistent form controls (one per step) ──────────────────────────────\n fieldCtrl = new FormControl('');\n operatorCtrl = new FormControl('');\n // Untyped value: the metadata renderer for the picked field may write a\n // string, number, Date or string[] (see normalizeConditionValue).\n valueCtrl = new FormControl<unknown>('');\n\n // ── State signals ─────────────────────────────────────────────────────────\n /** Current input step */\n step = signal<BuildStep>('type');\n /** The owning top-level block (drives field suggestions for the active edit) */\n activeBlock = signal<SearchBlock | null>(null);\n /** The immediate parent container the new condition will land in */\n activeContainer = signal<ConditionContainer | null>(null);\n /** Field selected waiting for operator/value */\n pendingField = signal<SuggestionItem | null>(null);\n /** Operator label for the pending operator (displayed as a pill) */\n pendingOperatorLabel = signal<string>('');\n /** The accumulated search blocks */\n blocks = signal<SearchBlock[]>([]);\n /** Types staged in the multi-select before the block is committed (type step). */\n draftTypes = signal<SearchBlockType[]>([]);\n /** Index of the condition being edited (-1 = new condition) */\n editingConditionIndex = signal<number>(-1);\n /** Snapshot of the condition under edit, used to restore on cancel */\n #editingSnapshot: FieldCondition | null = null;\n /** Monotonic counter for generating stable block ids. */\n #blockSeq = 0;\n /**\n * How to combine the top-level units (full-text unit + type blocks). These are\n * type-scoped, so they always join with OR (\"this as well as that\"); the UI no\n * longer exposes a toggle. Kept as a signal so saved states still round-trip.\n */\n combinator = signal<Combinator>('OR');\n /** The current filter term for autocomplete suggestions */\n inputTerm = signal('');\n\n /** The whole-object full-text search unit (independent of the condition blocks). */\n fulltext = signal<FulltextSearch>({ term: '', scope: 'all', types: [] });\n\n /** Whether the dynamic-conditions feature is enabled (mirrors the host `supportDynamicConditions` input). */\n supportDynamic = signal(false);\n\n /**\n * Form mode: replace the builder with a generated form of the user-marked dynamic\n * conditions. View state only — the template ({@link blocks}) is never mutated; the\n * form's values are overlaid onto the dynamic conditions to drive {@link cmisQuery},\n * so the template stays reusable.\n */\n formMode = signal(false);\n\n /** The dynamic conditions surfaced as form rows; rebuilt on each {@link enterFormMode}. */\n formFields = signal<DynamicFormField[]>([]);\n\n /**\n * The dynamic form rows grouped by their owning block (each carrying a muted header of\n * target types); rebuilt on each {@link enterFormMode}. Blocks combine with `OR`\n * (\"as well as\"), matching the builder.\n */\n formBlocks = signal<DynamicFormBlock[]>([]);\n\n /** Overlay values entered in the form, keyed by the dynamic condition's reference (refs are stable while form mode is active). */\n #formValues = signal<Map<FieldCondition, string | string[]>>(new Map());\n\n /** Whether any condition is marked dynamic (gates the form-mode toggle). */\n hasDynamicConditions = computed(() => this.blocks().some((block) => this.#anyDynamic(block.conditions)));\n\n objectTypes = computed<GenericObjectType[]>(() =>\n this.#system.getObjectTypes(true, 'search').filter((type) => this.allowedTypes().includes(type.id))\n );\n\n /** Fields for the active top-level block, used by the field-step suggestions. */\n activeBlockFields = computed<SuggestionItem[]>(() => this.#sharedFields(this.activeBlock()?.types ?? []));\n\n /**\n * When the active edit is scoped inside a table, the resolved column definitions\n * of that table (as full `ObjectTypeField`s with `_internalType`). `null` when\n * not editing inside a table.\n */\n activeTableColumns = computed<ObjectTypeField[] | null>(() => {\n const container = this.activeContainer();\n return container && isTableCondition(container) ? this.#tableColumns(container) : null;\n });\n\n /**\n * The fields offered at the field step: a table's **columns** when editing\n * inside a table, otherwise the active block's shared fields.\n */\n activeFields = computed<SuggestionItem[]>(() => {\n const columns = this.activeTableColumns();\n if (columns) return this.#columnSuggestions(columns);\n return this.activeBlockFields();\n });\n\n suggestions = computed<SuggestionItem[]>(() => {\n const step = this.step();\n const term = this.inputTerm().toLowerCase();\n\n if (step === 'type') {\n // Only hide types already staged in the *current* draft block. Types used by\n // other blocks stay available — a new block may target the same type again.\n const stagedIds = new Set(this.draftTypes().map((type) => type.id));\n const all: SuggestionItem[] = this.objectTypes()\n .filter((type) => !stagedIds.has(type.id))\n .map((type) => ({ kind: 'type' as const, id: type.id, label: type.label ?? type.id }))\n .sort((a, b) => a.label.localeCompare(b.label));\n return term ? all.filter((item) => item.label.toLowerCase().includes(term)) : all;\n }\n\n if (step === 'field') {\n const all = [...this.activeFields()].sort((a, b) => a.label.localeCompare(b.label));\n return term\n ? all.filter((item) => item.label.toLowerCase().includes(term) || item.id.toLowerCase().includes(term))\n : all;\n }\n\n if (step === 'operator') {\n const field = this.pendingField();\n if (!field) return [];\n const all = this.#operatorsForInternalType(field.internalType ?? 'string');\n return term ? all.filter((item) => item.label.toLowerCase().includes(term)) : all;\n }\n\n return [];\n });\n\n /** Number of top-level query units: the full-text unit (when it has a term) plus each block. */\n unitCount = computed(() => (this.fulltext().term.trim() ? 1 : 0) + this.blocks().length);\n\n showCombinator = computed(() => this.unitCount() >= 2);\n\n cmisQuery = computed(() => {\n // In form mode, overlay the form's entered values onto the (untouched) template so\n // the emitted query reflects the user's fill-out without mutating the saved blocks.\n const blocks = this.formMode() ? overlayConditionValues(this.blocks(), this.#formValues()) : this.blocks();\n return buildCmisQuery(blocks, this.combinator(), this.fulltext());\n });\n\n /** The active input control for the current step. */\n activeCtrl = computed(() => {\n switch (this.step()) {\n case 'field':\n return this.fieldCtrl;\n case 'operator':\n return this.operatorCtrl;\n case 'value':\n return this.valueCtrl;\n default:\n return this.fieldCtrl;\n }\n });\n\n // ── State save / restore ──────────────────────────────────────────────────\n\n /** Deep-clone the current blocks, combinator and full-text unit into a serializable {@link SmartSearchState}. */\n getState(): SmartSearchState {\n return {\n blocks: JSON.parse(JSON.stringify(this.blocks())) as SearchBlock[],\n combinator: this.combinator(),\n fulltext: JSON.parse(JSON.stringify(this.fulltext())) as FulltextSearch\n };\n }\n\n /** Replace the current state with a saved one, normalizing legacy blocks and cancelling any in-progress edit. */\n loadState(state: SmartSearchState): void {\n this.cancelPending();\n // Form-mode overlay keys reference the old tree; drop form mode on reload.\n this.exitFormMode();\n this.blocks.set(state.blocks.map((block) => this.#normalizeBlock(block)));\n this.combinator.set(state.combinator);\n this.fulltext.set(state.fulltext ?? { term: '', scope: 'all', types: [] });\n }\n\n /** Reset all search state back to its initial empty values. */\n reset(): void {\n this.cancelPending();\n this.blocks.set([]);\n this.combinator.set('OR');\n this.fulltext.set({ term: '', scope: 'all', types: [] });\n this.exitFormMode();\n }\n\n // ── Dynamic conditions + form mode ────────────────────────────────────────\n\n /** Mark or unmark a condition as dynamic (immutably replaces the node in its container). */\n setConditionDynamic(container: ConditionContainer, condition: FieldCondition, dynamic: boolean): void {\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) =>\n withConditions(\n target,\n target.conditions.map((node) => (node === condition ? { ...condition, dynamic } : node))\n )\n )\n );\n }\n\n /**\n * Enter form mode: collect every dynamic condition, resolve its value editor and seed a\n * `FormControl` with its current value. The blocks themselves are left untouched — the\n * form's edits are overlaid via {@link setFormValue} / {@link cmisQuery}.\n */\n enterFormMode(): void {\n if (!this.supportDynamic()) return;\n const allFields: DynamicFormField[] = [];\n const formBlocks: DynamicFormBlock[] = [];\n for (const block of this.blocks()) {\n const fields: DynamicFormField[] = [];\n const walk = (nodes: readonly ConditionNode[], table: TableCondition | null): void => {\n for (const node of nodes) {\n if (isTableCondition(node)) walk(node.conditions, node);\n else if (isConditionGroup(node)) walk(node.conditions, table);\n else if (node.dynamic && !isValuelessOperator(node.operator)) {\n const field: DynamicFormField = {\n condition: node,\n def: this.#resolveDynamicFieldDef(block, table, node.fieldId),\n control: new FormControl(node.value)\n };\n fields.push(field);\n allFields.push(field);\n }\n }\n };\n walk(block.conditions, null);\n // Only blocks that actually contribute a fillable row get a header in the form.\n if (fields.length) formBlocks.push({ block, fields });\n }\n this.formFields.set(allFields);\n this.formBlocks.set(formBlocks);\n this.#formValues.set(new Map());\n this.formMode.set(true);\n }\n\n /** Leave form mode and discard the transient form state (the template is untouched). */\n exitFormMode(): void {\n this.formMode.set(false);\n this.formFields.set([]);\n this.formBlocks.set([]);\n this.#formValues.set(new Map());\n }\n\n /** Toggle form mode (rebuilds the form rows on each entry). */\n toggleFormMode(): void {\n if (this.formMode()) this.exitFormMode();\n else this.enterFormMode();\n }\n\n /** Record a value entered in the form for a dynamic condition (drives the overlaid {@link cmisQuery}). */\n setFormValue(condition: FieldCondition, raw: unknown): void {\n this.#formValues.update((current) => new Map(current).set(condition, normalizeConditionValue(raw)));\n }\n\n /** Whether any condition in `nodes` (recursively) is marked dynamic and has a fillable value. */\n #anyDynamic(nodes: readonly ConditionNode[]): boolean {\n return nodes.some((node) =>\n isConditionGroup(node) || isTableCondition(node)\n ? this.#anyDynamic(node.conditions)\n : !!node.dynamic && !isValuelessOperator(node.operator)\n );\n }\n\n /** Resolve the value-editor field definition for a dynamic condition, honouring its table context. */\n #resolveDynamicFieldDef(block: SearchBlock, table: TableCondition | null, fieldId: string): ObjectTypeField | null {\n if (table) {\n return this.#tableColumns(table, block).find((col) => col.id === fieldId) ?? null;\n }\n return this.resolveFieldDefinition(block.types, fieldId);\n }\n\n // ── Full-text unit ────────────────────────────────────────────────────────\n\n /** Set the full-text search term. */\n setFulltextTerm(term: string): void {\n this.fulltext.update((current) => ({ ...current, term }));\n }\n\n /** Set the full-text search scope (`all` / `metadata` / `content`). */\n setFulltextScope(scope: FulltextScope): void {\n this.fulltext.update((current) => ({ ...current, scope }));\n }\n\n /** Add a target type to the full-text unit (no-op if already present). */\n addFulltextType(type: GenericObjectType, label: string): void {\n this.fulltext.update((current) =>\n current.types.some((picked) => picked.id === type.id)\n ? current\n : { ...current, types: [...current.types, { id: type.id, label, isSot: type.isSot }] }\n );\n }\n\n /** Remove a target type from the full-text unit by id. */\n removeFulltextType(id: string): void {\n this.fulltext.update((current) => ({ ...current, types: current.types.filter((type) => type.id !== id) }));\n }\n\n /** Replace the full-text target types from a list of object-type ids (unknown ids are dropped). */\n setFulltextTypes(ids: string[]): void {\n const types = ids\n .map((id) => this.objectTypes().find((objectType) => objectType.id === id))\n .filter((objectType): objectType is GenericObjectType => !!objectType)\n .map((objectType) => ({ id: objectType.id, label: objectType.label ?? objectType.id, isSot: objectType.isSot }));\n this.fulltext.update((current) => ({ ...current, types }));\n }\n\n // ── Type draft (multi-select) ─────────────────────────────────────────────\n\n /** Stage a type in the draft multi-select (no-op if already staged). */\n addDraftType(type: GenericObjectType, label: string): void {\n if (this.draftTypes().some((draft) => draft.id === type.id)) return;\n this.draftTypes.update((draft) => [...draft, { id: type.id, label, isSot: type.isSot }]);\n }\n\n /** Remove a staged type from the draft multi-select. */\n removeDraftType(id: string): void {\n this.draftTypes.update((draft) => draft.filter((type) => type.id !== id));\n }\n\n /**\n * Commit the staged draft types into a new block and clear the draft.\n * Returns the created block, or `null` when the draft is empty.\n */\n confirmDraftTypes(): SearchBlock | null {\n const types = this.draftTypes();\n if (types.length === 0) return null;\n const newBlock: SearchBlock = {\n id: this.#nextId(),\n types: [...types],\n conditions: [],\n conditionCombinator: 'AND'\n };\n this.blocks.update((blocks) => [...blocks, newBlock]);\n this.draftTypes.set([]);\n return newBlock;\n }\n\n // ── Block + group + condition mutators ───────────────────────────────────\n\n /** Remove a whole block; cancels the in-progress edit if it belonged to that block. */\n removeBlock(block: SearchBlock): void {\n this.blocks.update((blocks) => blocks.filter((blk) => blk !== block));\n if (this.activeBlock() === block) {\n this.cancelPending();\n }\n }\n\n /** Append an empty `ConditionGroup` to a container and start adding inside it. */\n addGroup(parent: ConditionContainer): ConditionGroup {\n const newGroup: ConditionGroup = { kind: 'group', conditions: [], combinator: 'AND' };\n this.blocks.update((blocks) =>\n updateContainer(blocks, parent, (container) => withConditions(container, [...container.conditions, newGroup]))\n );\n // The new group's reference is stable across the update because we appended\n // its literal — safe to use directly as the active container.\n this.startAddCondition(newGroup);\n return newGroup;\n }\n\n /**\n * Remove a group from its parent container. If the parent group becomes\n * empty, it is also removed (cascading up). Top-level blocks are preserved.\n */\n removeGroup(group: ConditionGroup): void {\n this.blocks.update((blocks) => removeNode(blocks, group));\n if (this.activeContainer() === group) {\n this.cancelPending();\n }\n }\n\n /** Remove a condition from the tree; empty parent groups/tables are pruned by the cascade. */\n removeCondition(_container: ConditionContainer, condition: FieldCondition): void {\n // While an *existing* condition is being edited it is temporarily pulled out\n // of the tree (see editCondition). Removing the last remaining sibling would\n // empty — and thus prune — the shared container, losing the in-flight edit.\n // Re-home the snapshot first so it survives, then end the edit cleanly.\n if (this.editingConditionIndex() >= 0 && this.#editingSnapshot) {\n this.restoreEditingSnapshot();\n this.cancelPending();\n }\n this.blocks.update((blocks) => removeNode(blocks, condition));\n // If the active container itself was pruned by the cascade, drop the edit.\n const active = this.activeContainer();\n if (active && !this.#containerExists(active)) {\n this.cancelPending();\n }\n }\n\n /** Set the top-level combinator joining the query units (full-text unit + blocks). */\n setCombinator(value: Combinator): void {\n this.combinator.set(value);\n }\n\n /** Set the AND/OR combinator of a single container (block, group or table). */\n setContainerCombinator(container: ConditionContainer, value: Combinator): void {\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) =>\n isConditionGroup(target) || isTableCondition(target)\n ? { ...target, combinator: value }\n : { ...target, conditionCombinator: value }\n )\n );\n }\n\n /**\n * The picked field resolves to a queryable `table` type. A table has no operator\n * of its own; instead it holds column conditions directly. Insert an empty\n * {@link TableCondition} and scope the edit into it so the user picks a column next.\n */\n addTableCondition(field: SuggestionItem): void {\n const container = this.activeContainer();\n if (!container) return;\n const table: TableCondition = {\n kind: 'table',\n fieldId: field.id,\n fieldLabel: field.label,\n conditions: [],\n // Columns are row-scoped and always join with OR (\"a row that has colA as\n // well as colB\"); the UI shows a static \"as well as\" label, not a toggle.\n combinator: 'OR'\n };\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) => withConditions(target, [...target.conditions, table]))\n );\n // `table`'s reference is stable across the update (we appended its literal).\n this.startAddCondition(table);\n }\n\n // ── Inline-edit flow ──────────────────────────────────────────────────────\n\n /** Begin adding a condition inside `container`. */\n startAddCondition(container: ConditionContainer): void {\n const owningBlock = findOwningBlock(this.blocks(), container);\n if (!owningBlock) return;\n this.activeBlock.set(owningBlock);\n this.activeContainer.set(container);\n this.pendingField.set(null);\n this.pendingOperatorLabel.set('');\n this.editingConditionIndex.set(-1);\n this.#editingSnapshot = null;\n this.fieldCtrl.setValue('', { emitEvent: false });\n this.operatorCtrl.setValue('', { emitEvent: false });\n this.valueCtrl.setValue('', { emitEvent: false });\n this.step.set('field');\n }\n\n /** Begin editing an existing condition inside `container`. */\n editCondition(container: ConditionContainer, condition: FieldCondition, index: number): void {\n this.#editingSnapshot = { ...condition };\n // Remove the condition from the tree so the inline editor takes its slot,\n // and capture the new container reference produced by the immutable update.\n let refreshed: ConditionContainer = container;\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) => {\n const next = withConditions(\n target,\n target.conditions.filter((node) => node !== condition)\n );\n refreshed = next;\n return next;\n })\n );\n const owningBlock = findOwningBlock(this.blocks(), refreshed);\n if (!owningBlock) return;\n this.activeBlock.set(owningBlock);\n this.activeContainer.set(refreshed);\n this.editingConditionIndex.set(index);\n\n const fieldItem: SuggestionItem = {\n kind: 'field',\n id: condition.fieldId,\n label: condition.fieldLabel,\n internalType: condition.internalType,\n operator: condition.operator\n };\n this.pendingField.set(fieldItem);\n this.pendingOperatorLabel.set(this.operatorLabel(condition.operator));\n\n this.fieldCtrl.setValue(condition.fieldLabel, { emitEvent: false });\n this.operatorCtrl.setValue(this.operatorLabel(condition.operator), { emitEvent: false });\n\n this.step.set(isValuelessOperator(condition.operator) ? 'operator' : 'value');\n }\n\n /** Jump back to the field step and clear the input so the user can re-type. */\n editField(): void {\n this.fieldCtrl.setValue('', { emitEvent: false });\n this.step.set('field');\n this.inputTerm.set('');\n }\n\n /** Jump back to the operator step and clear the input so the user can re-type. */\n editOperator(): void {\n this.operatorCtrl.setValue('', { emitEvent: false });\n this.step.set('operator');\n this.inputTerm.set('');\n }\n\n /** Abandon the in-progress edit, restoring state and pruning any empty container created for it. */\n cancelPending(): void {\n // Prune empty containers created via addGroup / addTableCondition and never\n // committed into. removeNode cascades up, so an empty parent is removed too.\n const container = this.activeContainer();\n if (\n container &&\n (isConditionGroup(container) || isTableCondition(container)) &&\n container.conditions.length === 0\n ) {\n this.blocks.update((blocks) => removeNode(blocks, container));\n }\n\n this.activeBlock.set(null);\n this.activeContainer.set(null);\n this.pendingField.set(null);\n this.pendingOperatorLabel.set('');\n this.editingConditionIndex.set(-1);\n this.#editingSnapshot = null;\n this.draftTypes.set([]);\n this.step.set('type');\n this.fieldCtrl.setValue('', { emitEvent: false });\n this.operatorCtrl.setValue('', { emitEvent: false });\n this.valueCtrl.setValue('', { emitEvent: false });\n this.inputTerm.set('');\n }\n\n /** Insert (or, when editing, re-insert at its original index) the finished condition into the active container. */\n commitCondition(condition: FieldCondition): void {\n const container = this.activeContainer();\n if (!container) return;\n const idx = this.editingConditionIndex();\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) => {\n const conditions = [...target.conditions];\n if (idx >= 0 && idx <= conditions.length) {\n conditions.splice(idx, 0, condition);\n } else {\n conditions.push(condition);\n }\n return withConditions(target, conditions);\n })\n );\n this.activeBlock.set(null);\n this.activeContainer.set(null);\n this.pendingField.set(null);\n this.pendingOperatorLabel.set('');\n this.editingConditionIndex.set(-1);\n this.#editingSnapshot = null;\n this.step.set('type');\n this.fieldCtrl.setValue('', { emitEvent: false });\n this.operatorCtrl.setValue('', { emitEvent: false });\n this.valueCtrl.setValue('', { emitEvent: false });\n this.inputTerm.set('');\n }\n\n /**\n * On blur with an incomplete edit of an existing condition, reinsert the\n * original verbatim at its original index.\n */\n restoreEditingSnapshot(): void {\n const idx = this.editingConditionIndex();\n const container = this.activeContainer();\n const snapshot = this.#editingSnapshot;\n if (idx < 0 || !container || !snapshot) return;\n\n this.blocks.update((blocks) =>\n updateContainer(blocks, container, (target) => {\n const conditions = [...target.conditions];\n conditions.splice(idx, 0, snapshot);\n return withConditions(target, conditions);\n })\n );\n }\n\n /**\n * Whether the in-progress condition has all parts needed to be committed. A value\n * is *not* required: a field + operator with a blank value commits as an unset\n * placeholder (see {@link isConditionUnset}).\n */\n isConditionComplete(): boolean {\n const field = this.pendingField();\n if (!field) return false;\n return (field.operator ?? '') !== '';\n }\n\n /** The operators available for a field's internal type, as autocomplete items. */\n operatorsForField(field: SuggestionItem): SuggestionItem[] {\n return this.#operatorsForInternalType(field.internalType ?? 'string');\n }\n\n /** Human-readable label for an operator id: a math symbol (`=`, `≠`, …), a translated key, or the id itself. */\n operatorLabel(operator: string): string {\n const symbol = OPERATOR_SYMBOLS[operator];\n if (symbol) return symbol;\n const key = OPERATOR_LABEL_KEYS[operator];\n return key ? this.#translate.instant(key) : operator;\n }\n\n /** Build a condition record from a date preset / boolean operator / value. */\n buildCommitCondition(\n field: SuggestionItem,\n operatorId: string,\n operatorLabelText: string,\n value: string | string[],\n internalTypeOverride?: string\n ): FieldCondition {\n if (operatorId.startsWith('date:')) {\n return {\n fieldId: field.id,\n internalType: internalTypeOverride ?? field.internalType ?? 'datetime',\n fieldLabel: field.label,\n operator: operatorId,\n operatorLabel: operatorLabelText,\n value: operatorId.slice(DATE_PREFIX_LEN),\n conditionLabel: `${field.label} ${operatorLabelText}`\n };\n }\n if (operatorId === 'empty' || operatorId === 'not_empty') {\n return {\n fieldId: field.id,\n internalType: internalTypeOverride ?? field.internalType ?? 'string',\n fieldLabel: field.label,\n operator: operatorId,\n operatorLabel: operatorLabelText,\n value: '',\n conditionLabel: `${field.label} ${operatorLabelText}`\n };\n }\n if (operatorId === 'eq_true' || operatorId === 'eq_false') {\n const val = operatorId === 'eq_true' ? 'true' : 'false';\n return {\n fieldId: field.id,\n internalType: internalTypeOverride ?? field.internalType ?? 'boolean',\n fieldLabel: field.label,\n operator: 'eq',\n operatorLabel: '=',\n value: val,\n conditionLabel: `${field.label} = ${val}`\n };\n }\n const valueLabel = Array.isArray(value) ? value.join(', ') : value;\n return {\n fieldId: field.id,\n internalType: internalTypeOverride ?? field.internalType ?? 'string',\n fieldLabel: field.label,\n operator: operatorId,\n operatorLabel: operatorLabelText,\n value,\n // Omit the value segment for an unset placeholder so the chip/aria label reads\n // cleanly (\"Name like\") instead of carrying a trailing space.\n conditionLabel: valueLabel\n ? `${field.label} ${operatorLabelText} ${valueLabel}`\n : `${field.label} ${operatorLabelText}`\n };\n }\n\n /**\n * Resolve a field definition by id across the given block types, falling back to\n * the universal base fields. Used by the host to render the value editor for a\n * picked field (including inherited base fields not present on any type).\n */\n resolveFieldDefinition(types: SearchBlockType[], fieldId: string): ObjectTypeField | null {\n // When editing inside a table row, the field is one of the table's columns.\n const column = this.activeTableColumns()?.find((col) => col.id === fieldId);\n if (column) return column;\n return this.#resolveTypeField(types, fieldId);\n }\n\n /** Resolve a field by id from the block types, falling back to base/system fields. */\n #resolveTypeField(types: SearchBlockType[], fieldId: string): ObjectTypeField | null {\n for (const type of types) {\n const objectType = this.objectTypes().find((candidate) => candidate.id === type.id);\n const field = objectType?.fields.find((typeField) => typeField.id === fieldId);\n if (field) return this.#withInternalType(field);\n }\n const baseField = this.#baseFields().find((field) => field.id === fieldId);\n return baseField ? this.#withInternalType(baseField) : null;\n }\n\n /**\n * Re-derive `_internalType` from the field's full classification — including its\n * `catalog` reference. The schema-baked `_internalType` omits `catalog`, so a\n * dynamic catalog would otherwise be misrendered as a static (empty) catalog.\n * Mirrors how object-form / renderer.service resolve the element type.\n */\n #withInternalType(field: ObjectTypeField): ObjectTypeField {\n return {\n ...field,\n _internalType: this.#system.getInternalFormElementType(field.propertyType, field.classifications, field.catalog)\n };\n }\n\n // ── Internals ─────────────────────────────────────────────────────────────\n\n #nextId(): string {\n this.#blockSeq += 1;\n return `blk-${this.#blockSeq}`;\n }\n\n /**\n * Keep the id sequence ahead of any id already in the tree (e.g. ids carried in\n * by a loaded state). Without this, `#blockSeq` stays at 0 after `loadState` and\n * the next generated id (`blk-1`) collides with a restored `blk-1`, breaking the\n * `@for` track-by on block id.\n */\n #trackSeq(id: string): void {\n const match = /^blk-(\\d+)$/.exec(id);\n if (match) this.#blockSeq = Math.max(this.#blockSeq, Number(match[1]));\n }\n\n /**\n * Normalize a block coming from a loaded state. Ensures an `id`, and migrates\n * legacy single-type blocks (`typeId`/`typeLabel`/`isSot`) into the `types[]`\n * shape so older saved states remain loadable.\n */\n #normalizeBlock(block: SearchBlock): SearchBlock {\n const legacy = block as SearchBlock & { typeId?: string; typeLabel?: string; isSot?: boolean };\n const types = Array.isArray(legacy.types)\n ? legacy.types\n : [{ id: legacy.typeId ?? '', label: legacy.typeLabel ?? legacy.typeId ?? '', isSot: legacy.isSot }];\n const id = legacy.id ?? this.#nextId();\n this.#trackSeq(id);\n return {\n id,\n types,\n conditions: legacy.conditions ?? [],\n conditionCombinator: legacy.conditionCombinator ?? 'AND'\n };\n }\n\n /**\n * Fields shared by *all* given types (the intersection by field id), shaped as\n * field suggestions. A field must be `queryable`, not in `skipProperties`, and\n * present on every type. Field metadata (label, internalType) is taken from the\n * first type that declares it.\n *\n * Each type's own fields are unioned with the universal base/system fields so\n * inherited properties (e.g. `system:creationDate`) become selectable too.\n */\n #sharedFields(types: SearchBlockType[]): SuggestionItem[] {\n if (types.length === 0) return [];\n const objectTypes = types\n .map((type) => this.objectTypes().find((objectType) => objectType.id === type.id))\n .filter((objectType): objectType is GenericObjectType => !!objectType);\n if (objectTypes.length !== types.length) return [];\n\n const skip = new Set(this.skipProperties());\n const [first, ...rest] = objectTypes;\n const restFieldIds = rest.map((objectType) => new Set(this.#resolveFields(objectType).map((field) => field.id)));\n\n return this.#resolveFields(first)\n .filter((field) => field.queryable !== false && !skip.has(field.id))\n .filter((field) => restFieldIds.every((ids) => ids.has(field.id)))\n .map((field) => ({\n kind: 'field' as const,\n id: field.id,\n label: this.#system.getLocalizedLabel(field.id) || field.label || field.name || field.id,\n internalType: this.#system.getInternalFormElementType(field.propertyType, field.classifications, field.catalog)\n }));\n }\n\n /**\n * The universal base/system fields (`system:creationDate`, `system:createdBy`, …)\n * resolved from the global property definitions. These are inherited by every\n * object type but are not part of any concrete type's resolved `fields`.\n */\n #baseFields(): ObjectTypeField[] {\n return Object.values(BaseObjectTypeField)\n .map((id) => this.#system.getObjectTypeField(id))\n .filter((field): field is ObjectTypeField => !!field);\n }\n\n /** A type's own fields unioned with the base fields, de-duplicated by id (own wins). */\n #resolveFields(objectType: GenericObjectType): ObjectTypeField[] {\n return this.#dedupeById([...objectType.fields, ...this.#baseFields()]);\n }\n\n #dedupeById(fields: ObjectTypeField[]): ObjectTypeField[] {\n const seen = new Set<string>();\n return fields.filter((field) => (seen.has(field.id) ? false : seen.add(field.id) && true));\n }\n\n // ── Table columns ──────────────────────────────────────────────────────────\n\n /**\n * Resolve a table field's `columnDefinitions` into full `ObjectTypeField`s. Defaults to\n * the active block (the inline-edit case); form mode passes the owning block explicitly.\n */\n #tableColumns(table: TableCondition, block: SearchBlock | null = this.activeBlock()): ObjectTypeField[] {\n if (!block) return [];\n const tableField = this.#resolveTypeField(block.types, table.fieldId);\n return (tableField?.columnDefinitions ?? []).map((col) => this.#columnToField(col));\n }\n\n /**\n * Map a table column definition to an `ObjectTypeField` with a re-derived\n * `_internalType` (so the value editor renders the right widget). Column defs may\n * carry `classification` (schema) or `classifications` (base shape) — accept both.\n */\n #columnToField(col: SchemaResponseFieldDefinition): ObjectTypeField {\n const classifications = col.classifications ?? col.classification;\n return {\n ...col,\n name: col.name ?? col.id,\n label: this.#system.getLocalizedLabel(col.id) || col.id,\n classifications,\n _internalType: this.#system.getInternalFormElementType(col.propertyType, classifications, col.catalog)\n } as ObjectTypeField;\n }\n\n /** Shape resolved table columns as field-step suggestions. */\n #columnSuggestions(columns: ObjectTypeField[]): SuggestionItem[] {\n const skip = new Set(this.skipProperties());\n return columns\n .filter((col) => col.queryable !== false && !skip.has(col.id))\n .map((col) => ({\n kind: 'field' as const,\n id: col.id,\n label: this.#system.getLocalizedLabel(col.id) || col.label || col.name || col.id,\n internalType: col._internalType\n }));\n }\n\n /** Check whether a container (block, group or table) still exists in the current tree by reference. */\n #containerExists(container: ConditionContainer): boolean {\n if (!isConditionGroup(container) && !isTableCondition(container)) {\n return this.blocks().includes(container as SearchBlock);\n }\n return this.#containsRef(\n this.blocks().flatMap((block) => block.conditions),\n container as ConditionNode\n );\n }\n\n #containsRef(nodes: readonly ConditionNode[], needle: ConditionNode): boolean {\n for (const node of nodes) {\n if (node === needle) return true;\n if ((isConditionGroup(node) || isTableCondition(node)) && this.#containsRef(node.conditions, needle)) return true;\n }\n return false;\n }\n\n #operatorsForInternalType(internalType: string): SuggestionItem[] {\n const base = (ids: string[]): SuggestionItem[] =>\n ids.map((id) => ({ kind: 'operator', id, label: this.operatorLabel(id) }));\n // Null checks are offered on every queryable type.\n const empty = (): SuggestionItem[] => base(['empty', 'not_empty']);\n\n switch (internalType) {\n case 'integer':\n case 'decimal':\n return [...base(['eq', 'neq', 'gt', 'gte', 'lt', 'lte']), ...empty()];\n case 'datetime':\n return [\n ...base(['eq', 'neq', 'gt', 'gte', 'lt', 'lte']),\n ...DATE_PRESETS.map((preset) => ({\n kind: 'date-preset' as const,\n id: `date:${preset.id}`,\n label: this.#translate.instant(preset.labelKey)\n })),\n ...empty()\n ];\n case 'boolean':\n case 'boolean:switch':\n return [\n { kind: 'operator', id: 'eq_true', label: this.#translate.instant('yuv.smart-search.operator.eq-true') },\n { kind: 'operator', id: 'eq_false', label: this.#translate.instant('yuv.smart-search.operator.eq-false') },\n ...empty()\n ];\n case 'string:catalog':\n case 'string:catalog:i18n':\n case 'string:catalog:dynamic':\n case 'string:organization':\n case 'string:organization:set':\n case 'string:reference':\n return [...base(['eq', 'neq']), ...empty()];\n case 'table':\n return [];\n default:\n return [...base(['like', 'eq', 'neq']), ...empty()];\n }\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, TemplateRef, computed, inject, input } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { TranslatePipe } from '@yuuvis/client-core';\nimport { YmtIconButtonDirective } from '@yuuvis/material';\nimport { SmartSearchEditController } from './smart-search-edit.controller';\nimport {\n Combinator,\n ConditionContainer,\n ConditionGroup,\n ConditionNode,\n FieldCondition,\n TableCondition,\n isConditionGroup,\n isTableCondition\n} from './smart-search.interface';\n\n/**\n * Renders a single `ConditionContainer` (block body, nested group, or table).\n *\n * - When `bare=true`, the panel wrapper (combinator header + remove button) is\n * omitted; used by the host for the top-level `SearchBlock` body where the\n * block already has its own type header.\n * - When `bare=false` (default), renders the full nested-group panel with a\n * group-scoped combinator toggle and an X to remove the group.\n * - A `TableCondition` renders as a labelled panel whose children are column\n * conditions; like a block/group it offers \"Add condition\", but no \"Add group\".\n *\n * Chip and inline-editor markup is supplied by the host as `TemplateRef`s so\n * Material plumbing (FormControls, autocomplete) stays in one place.\n *\n * This is an internal building block of {@link SmartSearchComponent} and is\n * rendered recursively for nested groups and tables — it is not meant to be used\n * standalone. The host shares its {@link SmartSearchEditController} instance with it.\n *\n * @example\n * ```html\n * <yuv-smart-search-group\n * [group]=\"block\"\n * [bare]=\"true\"\n * [chipTpl]=\"chipTpl\"\n * [editorTpl]=\"editorTpl\"\n * />\n * ```\n */\n@Component({\n selector: 'yuv-smart-search-group',\n imports: [\n NgTemplateOutlet,\n MatButtonModule,\n YmtIconButtonDirective,\n MatIconModule,\n MatTooltipModule,\n YmtIconButtonDirective,\n TranslatePipe\n ],\n templateUrl: './smart-search-group.component.html',\n styleUrl: './smart-search-group.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SmartSearchGroupComponent {\n /** The container to render: a top-level block body, a nested group, or a table condition. */\n group = input.required<ConditionContainer>();\n\n /**\n * When `true`, omit the panel wrapper (combinator header + remove button) and\n * render only the children. Used for the top-level block body, which already\n * carries its own type header. Defaults to `false` (full nested-group panel).\n */\n bare = input<boolean>(false);\n\n /** Host-supplied template for a committed condition chip. */\n chipTpl = input.required<TemplateRef<{ $implicit: FieldCondition; container: ConditionContainer; index: number }>>();\n\n /** Host-supplied template for the inline condition editor. */\n editorTpl = input.required<TemplateRef<{ $implicit: ConditionContainer }>>();\n\n ctrl = inject(SmartSearchEditController);\n\n isGroup = isConditionGroup;\n isTable = isTableCondition;\n\n /** True when this container is a `TableCondition` (its children are column conditions). */\n isTableContainer = computed(() => isTableCondition(this.group()));\n\n /** Label shown in the table panel header. */\n tableLabel = computed(() => {\n const container = this.group();\n return isTableCondition(container) ? container.fieldLabel : '';\n });\n\n /** Combinator value irrespective of whether this is a block, group or table. */\n containerCombinator = computed<Combinator>(() => {\n const container = this.group();\n if (isConditionGroup(container) || isTableCondition(container)) return container.combinator;\n return container.conditionCombinator;\n });\n\n isActive = computed(() => this.ctrl.activeContainer() === this.group());\n\n /** Set this container's AND/OR combinator. */\n setCombinator(value: Combinator): void {\n this.ctrl.setContainerCombinator(this.group(), value);\n }\n\n /** Remove this container when it is a nested group (no-op for blocks and tables). */\n removeGroup(): void {\n const container = this.group();\n if (isConditionGroup(container)) {\n this.ctrl.removeGroup(container);\n }\n }\n\n /** Begin adding a condition inside this container. */\n startAddCondition(): void {\n this.ctrl.startAddCondition(this.group());\n }\n\n /** Add a nested condition group inside this container. */\n addGroup(): void {\n this.ctrl.addGroup(this.group());\n }\n\n /** Narrow a child node to a {@link ConditionGroup} for the template (guarded by `isGroup`). */\n asGroup(node: ConditionNode): ConditionGroup {\n return node as ConditionGroup;\n }\n\n /** Narrow a child node to a {@link TableCondition} for the template (guarded by `isTable`). */\n asTable(node: ConditionNode): TableCondition {\n return node as TableCondition;\n }\n\n /** Narrow a child node to a {@link FieldCondition} for the template (the remaining case). */\n asCondition(node: ConditionNode): FieldCondition {\n return node as FieldCondition;\n }\n}\n","@if (bare()) {\n <ng-container *ngTemplateOutlet=\"body\" />\n} @else {\n <div class=\"group\" [class.group--active]=\"isActive()\" [class.group--table]=\"isTableContainer()\">\n @if (isTableContainer()) {\n <div class=\"group__header\">\n <span class=\"group__table-label\">{{ tableLabel() }}</span>\n <!-- Pseudo-operator: a table reads like a normal condition — \"Agent has …\".\n It is the only operator a table offers, so it is applied implicitly. -->\n <span class=\"group__table-op\">{{ 'yuv.smart-search.operator.has' | translate }}</span>\n </div>\n }\n <div class=\"group__body\">\n <ng-container *ngTemplateOutlet=\"body\" />\n </div>\n </div>\n}\n\n<ng-template #body>\n @for (node of group().conditions; track node; let i = $index) {\n <div class=\"condition-row\">\n @if (isTable(node)) {\n <yuv-smart-search-group [group]=\"asTable(node)\" [chipTpl]=\"chipTpl()\" [editorTpl]=\"editorTpl()\" />\n } @else if (isGroup(node)) {\n <yuv-smart-search-group [group]=\"asGroup(node)\" [chipTpl]=\"chipTpl()\" [editorTpl]=\"editorTpl()\" />\n } @else {\n <ng-container\n *ngTemplateOutlet=\"chipTpl(); context: { $implicit: asCondition(node), container: group(), index: i }\"\n />\n }\n @if (!$last) {\n <div class=\"condition-combinator\">\n <!-- Table columns are row-scoped and always combine with OR (\"a row that\n has this as well as that\"), so they show a static label instead of a\n toggle. Groups and blocks keep their AND/OR toggle. -->\n @if (isTableContainer()) {\n <span class=\"combinator__label\">{{ 'yuv.smart-search.combinator.as-well-as' | translate }}</span>\n } @else {\n <button\n class=\"combinator__btn\"\n [class.combinator__btn--active]=\"containerCombinator() === 'AND'\"\n (click)=\"setCombinator('AND')\"\n >\n {{ 'yuv.smart-search.combinator.and' | translate }}\n </button>\n <button\n class=\"combinator__btn\"\n [class.combinator__btn--active]=\"containerCombinator() === 'OR'\"\n (click)=\"setCombinator('OR')\"\n >\n {{ 'yuv.smart-search.combinator.or' | translate }}\n </button>\n }\n </div>\n }\n </div>\n }\n\n @if (isActive()) {\n <ng-container *ngTemplateOutlet=\"editorTpl(); context: { $implicit: group() }\" />\n } @else {\n <div class=\"add-btns\">\n <button\n ymtIconButton\n icon-button-size=\"small\"\n class=\"add-condition-btn\"\n [matTooltip]=\"'yuv.smart-search.add-condition' | translate\"\n (click)=\"startAddCondition()\"\n >\n <mat-icon>add</mat-icon>\n </button>\n <!-- Tables hold column conditions directly — no grouping inside them. -->\n @if (!isTableContainer()) {\n <button\n ymtIconButton\n icon-button-size=\"small\"\n class=\"add-condition-btn\"\n [matTooltip]=\"'yuv.smart-search.add-group' | translate\"\n (click)=\"addGroup()\"\n >\n <mat-icon>data_array</mat-icon>\n </button>\n }\n </div>\n }\n</ng-template>\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n computed,\n effect,\n inject,\n input,\n output,\n viewChild\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport {\n MatAutocomplete,\n MatAutocompleteModule,\n MatAutocompleteSelectedEvent,\n MatAutocompleteTrigger\n} from '@angular/material/autocomplete';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatChipsModule } from '@angular/material/chips';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { ObjectTypeField, TranslatePipe } from '@yuuvis/client-core';\nimport { MetadataFormFieldComponent } from '@yuuvis/client-framework/metadata-form';\nimport { RendererDirective, RendererDirectiveInput } from '@yuuvis/client-framework/renderer';\nimport { YmtIconButtonDirective } from '@yuuvis/material';\nimport { Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { SmartSearchEditController } from './smart-search-edit.controller';\nimport { SmartSearchGroupComponent } from './smart-search-group.component';\nimport {\n Combinator,\n ConditionContainer,\n FieldCondition,\n FulltextScope,\n SearchBlock,\n SmartSearchState,\n SuggestionItem\n} from './smart-search.interface';\n\nimport { isConditionUnset, isValuePresent, isValuelessOperator, normalizeConditionValue } from './smart-search.query';\n\nexport { buildCmisQuery, buildFulltextClause, buildNodeClause } from './smart-search.query';\n\nconst DEBOUNCE_MS = 150;\nconst DATE_PREFIX_LEN = 5;\n\n/**\n * Visual query builder that turns guided, chip-based user input into a CMIS query.\n *\n * The user composes a search in two independent parts:\n * - a **full-text bar** (`CONTAINS`) with a scope (all / metadata / content) and an\n * optional object-type restriction, and\n * - one or more **type blocks**, each targeting one or more object types and holding\n * field conditions, nested groups and table-column conditions.\n *\n * Conditions are built step by step (type → field → operator → value) with an inline\n * autocomplete editor; the value step renders the field's real metadata widget\n * (datepicker, catalog select, organization picker, …). The resulting CMIS query is\n * emitted through {@link queryChange} on every change and can be saved/restored as a\n * plain-data {@link SmartSearchState} via {@link getState} / {@link loadState}.\n *\n * State and mutators live in {@link SmartSearchEditController} (provided per instance);\n * this component owns only the UI concerns (focus, autocomplete plumbing, blur handling).\n *\n * @example\n * ```html\n * <!-- Restrict the picker to two object types and skip a noisy property -->\n * <yuv-smart-search\n * [types]=\"['document', 'invoice']\"\n * [skipProperties]=\"['system:traceId']\"\n * (queryChange)=\"onQuery($event)\"\n * />\n * ```\n *\n * @example\n * ```ts\n * // Save and restore the builder state (e.g. a stored search)\n * const search = viewChild.required(SmartSearchComponent);\n *\n * onQuery(cmisQuery: string) {\n * // empty string means \"no query\" — treat it as a cleared search\n * this.results.set(cmisQuery ? this.backend.search(cmisQuery) : []);\n * }\n *\n * persist() {\n * localStorage.setItem('search', JSON.stringify(this.search().getState()));\n * }\n *\n * restore() {\n * const state = localStorage.getItem('search');\n * if (state) this.search().loadState(JSON.parse(state));\n * }\n * ```\n */\n@Component({\n selector: 'yuv-smart-search',\n imports: [\n ReactiveFormsModule,\n MatAutocompleteModule,\n MatInputModule,\n MatIconModule,\n MatButtonModule,\n MatChipsModule,\n MatSelectModule,\n YmtIconButtonDirective,\n MatTooltipModule,\n MetadataFormFieldComponent,\n RendererDirective,\n SmartSearchGroupComponent,\n TranslatePipe\n ],\n providers: [SmartSearchEditController],\n templateUrl: './smart-search.component.html',\n styleUrl: './smart-search.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SmartSearchComponent {\n #host = inject(ElementRef<HTMLElement>);\n ctrl = inject(SmartSearchEditController);\n\n /**\n * Object-type ids that may be searched. Restricts the type picker (both the\n * full-text type filter and the type-block multi-select) to these types. When\n * empty, no type is offered — set at least one id to enable building blocks.\n */\n types = input<string[]>([]);\n\n /**\n * Field ids to hide from the field-step autocomplete (e.g. internal/system\n * properties that should not be user-queryable). Applies to block fields and\n * table columns alike.\n */\n skipProperties = input<string[]>([]);\n\n /**\n * Enables the **dynamic conditions** feature. When `true`, each committed condition can\n * be marked dynamic and a form-mode toggle appears that swaps the builder for a generated\n * fill-out form of those conditions. Off by default — the builder then behaves exactly as\n * it does without the feature.\n */\n supportDynamicConditions = input<boolean>(false);\n\n /**\n * Emits the current CMIS query string whenever the search changes. An empty\n * string is emitted for an empty search (including the initial seed), so\n * consumers should treat `''` as \"no query\" rather than expecting only\n * non-empty values.\n */\n queryChange = output<string>();\n\n auto = viewChild.required<MatAutocomplete>('auto');\n /** Trigger of the currently-focused autocomplete input — used to re-open the\n * panel after a type pick so the multi-select stays open. */\n trigger = viewChild(MatAutocompleteTrigger);\n\n /** Term control for the full-text bar (independent of the build-step controls). */\n fulltextTermCtrl = new FormControl('');\n\n /** Sentinel option value representing \"no type restriction\" in the type multi-select. */\n readonly ALL_TYPES = '__all__';\n\n /**\n * Guard that prevents `onInlineBlur` from cancelling the pending condition\n * when we programmatically open the inline editor.\n */\n _suppressNextBlur = false;\n\n /** Prevents the valueChanges subscriber from overwriting inputTerm during programmatic setValue */\n _suppressInputTerm = false;\n\n /**\n * Set when a type is staged via the autocomplete so the ENTER that triggered the\n * selection does not also fall through to `confirmTypes()`. Cleared on the next\n * tick. Needed because the chip-input directive changes the keydown listener order,\n * so `onTypeEnter` can run *after* the autocomplete has already closed its panel.\n */\n _suppressTypeConfirm = false;\n\n /**\n * Set while an autocomplete option is being applied so the panel's `closed`\n * event (which Material emits synchronously right after `optionSelected`) is not\n * mistaken for the user abandoning an empty property picker. Consumed\n * synchronously in `onPickerClosed`.\n */\n _pickerJustSelected = false;\n\n /** Previous activeContainer value — used to detect transitions for focus management. */\n #prevActiveContainer: ConditionContainer | null = null;\n\n // ── Public API (proxies onto the controller) ─────────────────────────────\n\n readonly blocks = this.ctrl.blocks;\n readonly draftTypes = this.ctrl.draftTypes;\n readonly combinator = this.ctrl.combinator;\n readonly step = this.ctrl.step;\n readonly activeBlock = this.ctrl.activeBlock;\n readonly activeContainer = this.ctrl.activeContainer;\n readonly pendingField = this.ctrl.pendingField;\n readonly pendingOperatorLabel = this.ctrl.pendingOperatorLabel;\n readonly editingConditionIndex = this.ctrl.editingConditionIndex;\n readonly inputTerm = this.ctrl.inputTerm;\n readonly cmisQuery = this.ctrl.cmisQuery;\n readonly showCombinator = this.ctrl.showCombinator;\n readonly suggestions = this.ctrl.suggestions;\n readonly fulltext = this.ctrl.fulltext;\n readonly objectTypes = this.ctrl.objectTypes;\n readonly activeBlockFields = this.ctrl.activeBlockFields;\n readonly formMode = this.ctrl.formMode;\n readonly formFields = this.ctrl.formFields;\n readonly formBlocks = this.ctrl.formBlocks;\n readonly hasDynamicConditions = this.ctrl.hasDynamicConditions;\n\n /** Whether a committed condition is an unset placeholder (drives the chip's \"fill me\" affordance). */\n isUnset = isConditionUnset;\n\n /**\n * Whether an operator carries its own meaning and has no value input (`is empty`,\n * `is not empty`, date presets). Such conditions can't be made dynamic — there is\n * nothing to fill out in the form.\n */\n isValueless = isValuelessOperator;\n\n /**\n * Selected ids for the type multi-select. Falls back to the `ALL_TYPES`\n * sentinel when no concrete type is picked (empty selection = no restriction).\n */\n readonly fulltextTypeSelection = computed(() => {\n const ids = this.fulltext().types.map((type) => type.id);\n return ids.length ? ids : [this.ALL_TYPES];\n });\n readonly fieldCtrl = this.ctrl.fieldCtrl;\n readonly operatorCtrl = this.ctrl.operatorCtrl;\n readonly valueCtrl = this.ctrl.valueCtrl;\n\n /**\n * Field definition driving the value-step editor. Memoized so the `[field]`\n * reference stays stable across change-detection cycles — re-resolving on every\n * CD (via a template method call) would re-create the editor and reset widgets\n * like the catalog select before their options render.\n */\n readonly valueFieldDef = computed(() => this.getObjectTypeField(this.ctrl.pendingField()));\n\n constructor() {\n // Mirror the `types` input into the controller signal so it can compute\n // available object types and filter the type suggestions.\n effect(() => {\n this.ctrl.allowedTypes.set(this.types());\n });\n\n effect(() => {\n this.ctrl.skipProperties.set(this.skipProperties());\n });\n\n // Mirror the dynamic-conditions opt-in into the controller; leaving the feature\n // disabled also forces form mode off.\n effect(() => {\n const enabled = this.supportDynamicConditions();\n this.ctrl.supportDynamic.set(enabled);\n if (!enabled) this.ctrl.exitFormMode();\n });\n\n // Bind each generated form row's control to the controller's overlay values. The\n // form-field set is rebuilt on every enterFormMode, so re-subscribe on change and\n // tear the previous subscriptions down via the effect's cleanup.\n effect((onCleanup) => {\n const fields = this.ctrl.formFields();\n const sub = new Subscription();\n for (const field of fields) {\n sub.add(\n field.control.valueChanges\n .pipe(debounceTime(DEBOUNCE_MS))\n .subscribe((val) => this.ctrl.setFormValue(field.condition, val))\n );\n }\n onCleanup(() => sub.unsubscribe());\n });\n\n // Drive inputTerm from whichever control is active for the current step\n this.ctrl.fieldCtrl.valueChanges.pipe(debounceTime(DEBOUNCE_MS), takeUntilDestroyed()).subscribe((val) => {\n const step = this.ctrl.step();\n if (step === 'field' || step === 'type') {\n this.ctrl.inputTerm.set(typeof val === 'string' ? val : '');\n }\n });\n\n this.ctrl.operatorCtrl.valueChanges.pipe(debounceTime(DEBOUNCE_MS), takeUntilDestroyed()).subscribe((val) => {\n if (this.ctrl.step() === 'operator') this.ctrl.inputTerm.set(typeof val === 'string' ? val : '');\n });\n\n this.ctrl.valueCtrl.valueChanges.pipe(debounceTime(DEBOUNCE_MS), takeUntilDestroyed()).subscribe((val) => {\n if (this._suppressInputTerm) return;\n if (this.ctrl.step() === 'value') this.ctrl.inputTerm.set(typeof val === 'string' ? val : '');\n });\n\n // Drive the full-text term (independent of the build steps).\n this.fulltextTermCtrl.valueChanges.pipe(debounceTime(DEBOUNCE_MS), takeUntilDestroyed()).subscribe((val) => {\n this.ctrl.setFulltextTerm(typeof val === 'string' ? val : '');\n });\n\n // Emits the seed empty query on first run too — consumers should treat\n // an empty string as \"no query\" rather than expecting only non-empty values.\n effect(() => {\n this.queryChange.emit(this.ctrl.cmisQuery());\n });\n\n // Focus the inline editor whenever a new container becomes active. Covers\n // \"Add condition\" / \"Add group\" clicks coming from any nesting depth —\n // those go straight through the controller without touching the host.\n effect(() => {\n const container = this.ctrl.activeContainer();\n if (!container) {\n this.#prevActiveContainer = null;\n return;\n }\n if (container === this.#prevActiveContainer) return;\n this.#prevActiveContainer = container;\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n });\n\n }\n\n /** Set the AND/OR combinator that joins the conditions within a single container (block, group or table). */\n setConditionCombinator(container: ConditionContainer, value: Combinator): void {\n this.ctrl.setContainerCombinator(container, value);\n }\n\n /**\n * Capture the current search as a serializable snapshot. Safe for\n * `JSON.stringify`/`JSON.parse` roundtrips — use it to persist a search and\n * later restore it with {@link loadState}.\n */\n getState(): SmartSearchState {\n return this.ctrl.getState();\n }\n\n /** Restore a previously {@link getState saved} search, replacing the current one. */\n loadState(state: SmartSearchState): void {\n this.ctrl.loadState(state);\n // The full-text term input is a local control, not bound to the signal (scope and\n // types are). Sync it from the restored state so the term box reflects the load.\n this.fulltextTermCtrl.setValue(this.ctrl.fulltext().term, { emitEvent: false });\n }\n\n /** Clear the whole search: discard all blocks, conditions and the full-text term. */\n clear(): void {\n this.fulltextTermCtrl.setValue('', { emitEvent: false });\n this.trigger()?.closePanel();\n this.ctrl.reset();\n }\n\n /**\n * Toggle form mode: swap the builder for a generated fill-out form of the user-marked\n * dynamic conditions. The template is left intact — the form's values are overlaid onto\n * the query. No-op unless {@link supportDynamicConditions} is set.\n */\n toggleFormMode(): void {\n this.ctrl.toggleFormMode();\n }\n\n /** Enter form mode (\"Essentials\") — generated fill-out form of the dynamic conditions. */\n enterFormMode(): void {\n this.ctrl.enterFormMode();\n }\n\n /** Leave form mode (\"Full Form\") — back to the full builder search. */\n exitFormMode(): void {\n this.ctrl.exitFormMode();\n }\n\n /** Mark/unmark a committed condition as dynamic (surfaced in the fill-out form). */\n toggleDynamic(container: ConditionContainer, condition: FieldCondition): void {\n this.ctrl.setConditionDynamic(container, condition, !condition.dynamic);\n }\n\n /**\n * Set the top-level combinator joining the query units (the full-text unit and\n * the type blocks). Kept for state round-tripping; the UI currently always\n * joins units with `OR`.\n */\n setCombinator(value: Combinator): void {\n this.ctrl.setCombinator(value);\n }\n\n /** Remove an entire type block and all of its conditions. */\n removeBlock(block: SearchBlock): void {\n this.ctrl.removeBlock(block);\n }\n\n /** Commit the staged draft types into a new block and reset the type input. */\n confirmTypes(): void {\n const block = this.ctrl.confirmDraftTypes();\n if (!block) return;\n this.trigger()?.closePanel();\n this.ctrl.fieldCtrl.setValue('', { emitEvent: false });\n this.ctrl.inputTerm.set('');\n setTimeout(() => this.#focusAddCondition(block.id));\n }\n\n /** Start adding a new condition inside the given container and focus the inline editor. */\n startAddCondition(block: SearchBlock): void {\n this.ctrl.startAddCondition(block);\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n }\n\n /** Add a nested condition group inside the given container and focus the inline editor. */\n addGroup(block: SearchBlock): void {\n this.ctrl.addGroup(block);\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n }\n\n /**\n * `displayWith` for the shared autocomplete. Suggestions are objects but the\n * input text is driven by the form controls, so a picked option must not write\n * a label back into the field — return the raw string, or empty otherwise.\n */\n displayFn = (item: SuggestionItem | string | null): string => {\n if (typeof item === 'string') return item;\n return '';\n };\n\n // ── Full-text bar ───────────────────────────────────────────────────────────\n\n /** Set where the full-text search looks: `all` (metadata + content), `metadata`, or `content`. */\n setFulltextScope(scope: FulltextScope): void {\n this.ctrl.setFulltextScope(scope);\n }\n\n /**\n * Reconcile the type multi-select with the \"All types\" sentinel. Picking\n * \"All types\" while concrete types are selected clears the restriction;\n * picking any concrete type drops the sentinel.\n */\n onFulltextTypesChange(ids: string[]): void {\n const hadAll = this.fulltext().types.length === 0;\n // User just clicked \"All types\" while specific types were selected → clear restriction.\n if (ids.includes(this.ALL_TYPES) && !hadAll) {\n this.ctrl.setFulltextTypes([]);\n return;\n }\n // Otherwise keep only the concrete ids (an empty array also means \"all\").\n this.ctrl.setFulltextTypes(ids.filter((id) => id !== this.ALL_TYPES));\n }\n\n // ── Inline-editor coordination ─────────────────────────────────────────────\n\n /**\n * Handle a pick from the shared autocomplete panel. Branches on the current\n * build step: stages a type (keeping the panel open for more), advances a\n * field to its operator (or opens a table container), or applies a chosen\n * operator. Single-operator fields and valueless operators commit immediately.\n */\n onSuggestionSelected(event: MatAutocompleteSelectedEvent): void {\n const item: SuggestionItem = event.option.value;\n\n // The panel closes (and emits `closed`) as a side effect of this selection.\n // Flag it so `onPickerClosed` doesn't treat that close as an abandoned edit —\n // matters for the table branch below, which leaves `step` at 'field'.\n this._pickerJustSelected = true;\n setTimeout(() => (this._pickerJustSelected = false));\n\n switch (this.ctrl.step()) {\n case 'type': {\n const objectType = this.ctrl.objectTypes().find((type) => type.id === item.id);\n if (!objectType) break;\n // Stage the type and keep the panel open so more types can be picked.\n this.ctrl.addDraftType(objectType, item.label);\n this.ctrl.fieldCtrl.setValue('', { emitEvent: false });\n this.ctrl.inputTerm.set('');\n this._suppressNextBlur = true;\n this._suppressTypeConfirm = true;\n setTimeout(() => {\n this.#focusInput();\n this.trigger()?.openPanel();\n this._suppressNextBlur = false;\n this._suppressTypeConfirm = false;\n });\n break;\n }\n case 'field': {\n // A table field has no operator of its own: open a table container with a\n // first row and scope the edit into that row so the user picks a column next.\n if ((item.internalType ?? '') === 'table') {\n this.ctrl.addTableCondition(item);\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n break;\n }\n\n this.ctrl.pendingField.set(item);\n this.ctrl.fieldCtrl.setValue(item.label, { emitEvent: false });\n this.ctrl.operatorCtrl.setValue('', { emitEvent: false });\n // Clear the field-step filter term so the operator suggestions aren't\n // filtered by the text typed to find the field — otherwise the operator\n // panel has no matching options and never opens.\n this.ctrl.inputTerm.set('');\n\n // If the field's type allows exactly one operator, skip the operator\n // picker and apply it immediately.\n const operators = this.ctrl.operatorsForField(item);\n if (operators.length === 1) {\n this.#applyOperator(item, operators[0]);\n break;\n }\n\n this.ctrl.step.set('operator');\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n break;\n }\n case 'operator': {\n const field = this.ctrl.pendingField();\n if (!field) break;\n this.#applyOperator(field, item);\n break;\n }\n }\n }\n\n /**\n * Enter in the add-type input. When the input is empty there's no option to\n * pick, so Enter commits the staged types — even while the autocomplete panel\n * is open. While the user is typing a filter term, Enter is left to the\n * autocomplete so it can select the highlighted option.\n */\n onTypeEnter(): void {\n // The ENTER that selected an autocomplete option must not also confirm the\n // block — regardless of whether this handler runs before or after the\n // autocomplete closes its panel.\n if (this._suppressTypeConfirm) return;\n const term = this.ctrl.fieldCtrl.value;\n if (typeof term === 'string' && term.trim()) return;\n if (this.ctrl.draftTypes().length === 0) return;\n this.confirmTypes();\n }\n\n /**\n * Enter / confirm-button handler for the value step. Commits the in-progress\n * condition when a value is present. No-op while the autocomplete panel is open\n * (Enter selects the highlighted option there) or before the value step.\n */\n onEnter(): void {\n if (this.auto().isOpen) return;\n if (this.ctrl.step() !== 'value') return;\n\n // No value guard: a blank value commits an unset placeholder (fill-in template).\n const raw = this.ctrl.valueCtrl.value;\n\n const field = this.ctrl.pendingField();\n const fieldOp = field?.operator ?? '';\n if (!field || !fieldOp) return;\n\n this.ctrl.commitCondition(\n this.ctrl.buildCommitCondition(field, fieldOp, this.ctrl.operatorLabel(fieldOp), normalizeConditionValue(raw))\n );\n }\n\n /**\n * Called when the inline-input wrapper loses focus.\n * Commits the condition if complete, discards it if incomplete.\n *\n * Deferred via setTimeout(0): raw value renderers (datepicker dialog,\n * mat-select panel, mat-autocomplete panel) mount their UI in the\n * .cdk-overlay-container, which is OUTSIDE the wrapper. Reading\n * document.activeElement on the next task lets us detect that focus\n * is still in our logical scope.\n */\n onInlineBlur(event: FocusEvent): void {\n if (this._suppressNextBlur) return;\n const wrapper = event.currentTarget as HTMLElement;\n\n setTimeout(() => {\n if (this._suppressNextBlur) return;\n if (!this.ctrl.activeContainer()) return;\n if (this.auto().isOpen) return;\n\n const active = document.activeElement as HTMLElement | null;\n if (active && wrapper.contains(active)) return;\n if (active?.closest('.cdk-overlay-container')) return;\n // Backdrop dismissal: focus is briefly on <body> while an overlay pane is still mounted.\n if (document.querySelector('.cdk-overlay-container .cdk-overlay-pane')) return;\n\n if (this.ctrl.isConditionComplete()) {\n this.#commitFromBlur();\n } else {\n this.ctrl.restoreEditingSnapshot();\n this.ctrl.cancelPending();\n }\n });\n }\n\n /**\n * Fired when the shared autocomplete panel closes. Starting a condition opens\n * the property picker; if the user dismisses it (outside click, Escape) without\n * choosing a field, there's an empty editor with nothing to commit — drop it.\n *\n * Only the field step is handled here: operator/value abandonment is already\n * covered by `onInlineBlur` (those steps don't auto-open a picker the user can\n * dismiss while keeping focus). Restores the original when editing an existing\n * condition, mirroring the blur path.\n */\n onPickerClosed(): void {\n // `closed` fires synchronously right after `optionSelected`, so consume the\n // flag here (not in a deferred task) to stay ahead of the focus timers.\n const justSelected = this._pickerJustSelected;\n this._pickerJustSelected = false;\n if (justSelected) return;\n\n setTimeout(() => {\n if (this._suppressNextBlur) return;\n if (this.auto().isOpen) return;\n if (this.ctrl.step() !== 'field') return;\n if (!this.ctrl.activeContainer()) return;\n // A non-empty filter term means the user is still picking a field.\n const term = this.ctrl.fieldCtrl.value;\n if (typeof term === 'string' && term.trim()) return;\n\n this.ctrl.restoreEditingSnapshot();\n this.ctrl.cancelPending();\n });\n }\n\n /** Abandon the in-progress condition edit, discarding any partial input. */\n cancelPending(): void {\n this.ctrl.cancelPending();\n }\n\n /** Jump the inline editor back to the field step so the user can re-pick the field. */\n editField(): void {\n this.ctrl.editField();\n setTimeout(() => this.#focusInput());\n }\n\n /** Jump the inline editor back to the operator step so the user can re-pick the operator. */\n editOperator(): void {\n this.ctrl.editOperator();\n setTimeout(() => this.#focusInput());\n }\n\n /**\n * Open an already-committed condition for editing in place. The condition is\n * pulled out of the tree into the inline editor at its original index, pre-set\n * to the appropriate step (value, or operator for valueless operators).\n */\n editCondition(container: ConditionContainer, condition: FieldCondition, index: number): void {\n this.ctrl.editCondition(container, condition, index);\n this._suppressNextBlur = true;\n if (this.ctrl.step() === 'value') {\n this._suppressInputTerm = true;\n setTimeout(() => {\n this.ctrl.valueCtrl.setValue(condition.value);\n this._suppressInputTerm = false;\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n } else {\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n }\n }\n\n /** Remove a committed condition from its container. */\n removeCondition(container: ConditionContainer, condition: FieldCondition): void {\n this.ctrl.removeCondition(container, condition);\n }\n\n /**\n * Renderer input for a committed condition's value, or `null` when the value\n * should render as plain text. id-based fields (e.g. organization) store an\n * opaque id as the query value; routing it through the property renderer\n * resolves it to a human-readable label for the chip. Valueless operators\n * (empty/not_empty, date presets) and booleans keep their plain text: their\n * stored value is synthetic/serialized, not the shape those renderers expect.\n */\n valueRendererInput(condition: FieldCondition): RendererDirectiveInput | null {\n if (isValuelessOperator(condition.operator)) return null;\n const internalType = condition.internalType ?? '';\n if (internalType.startsWith('boolean')) return null;\n if (!isValuePresent(condition.value)) return null;\n return { propertyName: condition.fieldId, rendererType: internalType, value: condition.value };\n }\n\n /**\n * Resolve the full {@link ObjectTypeField} definition for a suggestion item in\n * the active block, or `null` when none applies. Drives the value-step metadata\n * widget so the right editor (datepicker, catalog, …) is rendered.\n */\n getObjectTypeField(item: SuggestionItem | null): ObjectTypeField | null {\n const block = this.ctrl.activeBlock();\n if (!item || !block) return null;\n // The field is shared across all of the block's types — take the definition\n // from the first type that declares it, falling back to the universal base fields.\n return this.ctrl.resolveFieldDefinition(block.types, item.id);\n }\n\n // ── Internals ─────────────────────────────────────────────────────────────\n\n /**\n * Apply a chosen operator to the pending field: commit straight away for\n * date-preset / boolean operators (which carry their own value), otherwise\n * advance to the value step.\n */\n #applyOperator(field: SuggestionItem, item: SuggestionItem): void {\n if (item.kind === 'date-preset') {\n this.ctrl.commitCondition({\n fieldId: field.id,\n internalType: field.internalType ?? 'datetime',\n fieldLabel: field.label,\n operator: item.id,\n operatorLabel: item.label,\n value: item.id.slice(DATE_PREFIX_LEN),\n conditionLabel: `${field.label} ${item.label}`\n });\n } else if (item.id === 'eq_true' || item.id === 'eq_false') {\n const val = item.id === 'eq_true' ? 'true' : 'false';\n this.ctrl.commitCondition({\n fieldId: field.id,\n internalType: field.internalType ?? 'boolean',\n fieldLabel: field.label,\n operator: 'eq',\n operatorLabel: '=',\n value: val,\n conditionLabel: `${field.label} = ${val}`\n });\n } else if (item.id === 'empty' || item.id === 'not_empty') {\n this.ctrl.commitCondition(this.ctrl.buildCommitCondition(field, item.id, item.label, ''));\n } else {\n this.ctrl.pendingField.set({ ...field, operator: item.id });\n this.ctrl.pendingOperatorLabel.set(item.label);\n this.ctrl.operatorCtrl.setValue(item.label, { emitEvent: false });\n this.ctrl.inputTerm.set('');\n this.ctrl.step.set('value');\n this._suppressNextBlur = true;\n setTimeout(() => {\n this.#focusInput();\n this._suppressNextBlur = false;\n });\n }\n }\n\n #commitFromBlur(): void {\n const field = this.ctrl.pendingField();\n if (!field) return;\n const operator = field.operator ?? '';\n if (!operator) return;\n const raw = this.ctrl.valueCtrl.value;\n\n this.ctrl.commitCondition(\n this.ctrl.buildCommitCondition(field, operator, this.ctrl.operatorLabel(operator), normalizeConditionValue(raw))\n );\n }\n\n #focusInput(): void {\n (this.#host.nativeElement.querySelector('.inline-input input') as HTMLInputElement | null)?.focus();\n }\n\n /** Focus the \"Add condition\" (+) button of a block — used after confirming its types. */\n #focusAddCondition(blockId: string): void {\n (\n this.#host.nativeElement.querySelector(\n `.block[data-block-id=\"${blockId}\"] .add-condition-btn`\n ) as HTMLButtonElement | null\n )?.focus();\n }\n}\n","<div class=\"smart-search\" halo-container halo-container-skip=\"true\">\n <!-- Condition chip template — passed down into the recursive group component. -->\n <ng-template #chipTpl let-condition let-container=\"container\" let-i=\"index\">\n <div\n class=\"condition-chip\"\n [class.condition-chip--unset]=\"isUnset(condition)\"\n [class.condition-chip--dynamic]=\"condition.dynamic\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"'yuv.smart-search.condition.edit-aria' | translate: { label: condition.conditionLabel }\"\n (click)=\"editCondition(container, condition, i)\"\n (keydown.space)=\"$event.preventDefault(); editCondition(container, condition, i)\"\n (keydown.enter)=\"$event.preventDefault(); editCondition(container, condition, i)\"\n >\n @if (supportDynamicConditions() && !isValueless(condition.operator)) {\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"condition-chip__dynamic\"\n tabindex=\"-1\"\n [attr.aria-pressed]=\"!!condition.dynamic\"\n [matTooltip]=\"\n (condition.dynamic\n ? 'yuv.smart-search.condition.unmark-dynamic'\n : 'yuv.smart-search.condition.mark-dynamic'\n ) | translate\n \"\n (click)=\"$event.stopPropagation(); toggleDynamic(container, condition)\"\n >\n <mat-icon>bolt</mat-icon>\n </button>\n }\n\n <span class=\"condition-chip__part condition-chip__field\">\n <!-- <mat-icon>tune</mat-icon> -->\n {{ condition.fieldLabel }}\n </span>\n <span class=\"condition-chip__part condition-chip__op\">{{ condition.operatorLabel }}</span>\n <span class=\"condition-chip__part condition-chip__value\">\n @if (isUnset(condition)) {\n <span class=\"condition-chip__placeholder\">{{ 'yuv.smart-search.condition.unset-value' | translate }}</span>\n } @else if (valueRendererInput(condition); as rendererInput) {\n <ng-container *yuvRenderer=\"rendererInput\" />\n } @else {\n {{ condition.value }}\n }\n </span>\n <!-- @if (supportDynamicConditions() && !isValueless(condition.operator)) {\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"condition-chip__dynamic\"\n tabindex=\"-1\"\n [attr.aria-pressed]=\"!!condition.dynamic\"\n [matTooltip]=\"\n (condition.dynamic\n ? 'yuv.smart-search.condition.unmark-dynamic'\n : 'yuv.smart-search.condition.mark-dynamic'\n ) | translate\n \"\n (click)=\"$event.stopPropagation(); toggleDynamic(container, condition)\"\n >\n <mat-icon>bolt</mat-icon>\n </button>\n } -->\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"condition-chip__remove\"\n tabindex=\"-1\"\n [attr.aria-label]=\"'yuv.smart-search.condition.remove' | translate\"\n (click)=\"$event.stopPropagation(); removeCondition(container, condition)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </ng-template>\n\n <!-- Inline editor template — rendered inside whichever container is active. -->\n <ng-template #editorTpl>\n <div class=\"inline-input\" tabindex=\"-1\" (focusout)=\"onInlineBlur($event)\" (keydown.escape)=\"cancelPending()\">\n @if (ctrl.step() !== 'field' && ctrl.pendingField()) {\n <button\n class=\"part-pill\"\n [class.part-pill--active]=\"ctrl.step() === 'field'\"\n (click)=\"editField()\"\n [matTooltip]=\"'yuv.smart-search.field.change' | translate\"\n >\n {{ ctrl.pendingField()?.label }}\n </button>\n }\n\n @if (ctrl.step() === 'value' && ctrl.operatorCtrl.value) {\n <button\n class=\"part-pill\"\n [class.part-pill--active]=\"ctrl.step() === 'operator'\"\n (click)=\"editOperator()\"\n [matTooltip]=\"'yuv.smart-search.operator.change' | translate\"\n >\n {{ ctrl.operatorCtrl.value }}\n </button>\n }\n\n @if (ctrl.step() === 'field') {\n <input\n [formControl]=\"ctrl.fieldCtrl\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"'yuv.smart-search.field.pick' | translate\"\n (keydown.enter)=\"onEnter()\"\n />\n } @else if (ctrl.step() === 'operator') {\n <input\n [formControl]=\"ctrl.operatorCtrl\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"'yuv.smart-search.operator.select' | translate\"\n (keydown.enter)=\"onEnter()\"\n />\n } @else if (ctrl.step() === 'value') {\n @let otf = valueFieldDef();\n @if (otf) {\n <yuv-metadata-form-field variant=\"raw\" [field]=\"otf\" situation=\"EDIT\" [formControl]=\"ctrl.valueCtrl\" />\n } @else {\n <input\n [formControl]=\"ctrl.valueCtrl\"\n [matAutocomplete]=\"auto\"\n [placeholder]=\"'yuv.smart-search.value.enter' | translate\"\n (keydown.enter)=\"onEnter()\"\n />\n }\n }\n\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"confirm-btn\"\n [disabled]=\"!ctrl.isConditionComplete()\"\n (click)=\"onEnter()\"\n [matTooltip]=\"'yuv.smart-search.confirm' | translate\"\n >\n <mat-icon>check</mat-icon>\n </button>\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"cancel-btn\"\n (click)=\"cancelPending()\"\n [matTooltip]=\"'yuv.smart-search.cancel' | translate\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </ng-template>\n\n <!-- ── Toolbar: Essentials ⇄ Full Form mode switch (only when the dynamic feature is enabled) ── -->\n @if (supportDynamicConditions() && (hasDynamicConditions() || formMode())) {\n <div class=\"toolbar\">\n <div class=\"toolbar__mode\" role=\"group\" [attr.aria-label]=\"'yuv.smart-search.mode.label' | translate\">\n <button\n type=\"button\"\n class=\"toolbar__mode-btn\"\n [class.toolbar__mode-btn--active]=\"formMode()\"\n [attr.aria-pressed]=\"formMode()\"\n (click)=\"enterFormMode()\"\n >\n {{ 'yuv.smart-search.mode.essentials' | translate }}\n </button>\n <button\n type=\"button\"\n class=\"toolbar__mode-btn\"\n [class.toolbar__mode-btn--active]=\"!formMode()\"\n [attr.aria-pressed]=\"!formMode()\"\n (click)=\"exitFormMode()\"\n >\n {{ 'yuv.smart-search.mode.full' | translate }}\n </button>\n </div>\n </div>\n }\n\n <!-- ── Generated fill-out form of the dynamic conditions ─────────────── -->\n @if (formMode()) {\n <div class=\"dynamic-form\">\n @for (grp of formBlocks(); track grp.block.id; let last = $last) {\n <div class=\"dynamic-form__block\">\n <!-- Muted header listing the block's target types (a block matches any of them). -->\n <div class=\"dynamic-form__block-header\">\n @for (t of grp.block.types; track t.id) {\n @if (!$first) {\n <span class=\"dynamic-form__type-sep\">{{ 'yuv.smart-search.combinator.or' | translate }}</span>\n }\n <span class=\"dynamic-form__type\">{{ t.label }}</span>\n }\n </div>\n\n <div class=\"dynamic-form__rows\">\n @for (f of grp.fields; track f.condition) {\n <div class=\"dynamic-form__row\">\n <span class=\"dynamic-form__label\">{{ f.condition.fieldLabel }}</span>\n <span class=\"dynamic-form__op\">{{ f.condition.operatorLabel }}</span>\n <div class=\"dynamic-form__value\">\n @if (f.def) {\n <yuv-metadata-form-field variant=\"raw\" [field]=\"f.def\" situation=\"EDIT\" [formControl]=\"f.control\" />\n } @else {\n <input [formControl]=\"f.control\" [placeholder]=\"'yuv.smart-search.value.enter' | translate\" />\n }\n </div>\n </div>\n }\n </div>\n </div>\n\n <!-- Blocks are type-scoped and always combine with OR (\"this type as well as that type\"). -->\n @if (!last) {\n <div class=\"combinator\">\n <span class=\"combinator__label\">{{ 'yuv.smart-search.combinator.as-well-as' | translate }}</span>\n </div>\n }\n } @empty {\n <span class=\"dynamic-form__empty\">{{ 'yuv.smart-search.mode.empty' | translate }}</span>\n }\n </div>\n } @else {\n <!-- ── Full-text search bar ──────────────────────────────────────── -->\n <div class=\"fulltext\" [class.muted]=\"!fulltext().term.trim() && ctrl.blocks().length\">\n <!-- Row 1: full-width term -->\n <div class=\"fulltext__term\">\n <mat-icon class=\"fulltext__icon\">search</mat-icon>\n <input\n class=\"fulltext__input\"\n [formControl]=\"fulltextTermCtrl\"\n [placeholder]=\"'yuv.smart-search.fulltext.placeholder' | translate\"\n />\n </div>\n\n <!-- Row 2: scope (single) + types (multiple) -->\n <div class=\"fulltext__filters\">\n <mat-select\n class=\"fulltext__scope\"\n [panelWidth]=\"null\"\n panelClass=\"smart-search-select-panel\"\n [value]=\"fulltext().scope\"\n (selectionChange)=\"setFulltextScope($event.value)\"\n [aria-label]=\"'yuv.smart-search.fulltext.scope.label' | translate\"\n >\n <mat-option value=\"all\">{{ 'yuv.smart-search.fulltext.scope.all' | translate }}</mat-option>\n <mat-option value=\"metadata\">{{ 'yuv.smart-search.fulltext.scope.metadata' | translate }}</mat-option>\n <mat-option value=\"content\">{{ 'yuv.smart-search.fulltext.scope.content' | translate }}</mat-option>\n </mat-select>\n\n <mat-select\n class=\"fulltext__types\"\n multiple\n [panelWidth]=\"null\"\n panelClass=\"smart-search-select-panel\"\n [value]=\"fulltextTypeSelection()\"\n (selectionChange)=\"onFulltextTypesChange($event.value)\"\n [aria-label]=\"'yuv.smart-search.fulltext.types.label' | translate\"\n >\n <mat-option [value]=\"ALL_TYPES\">{{ 'yuv.smart-search.fulltext.types.all' | translate }}</mat-option>\n @for (t of objectTypes(); track t.id) {\n <mat-option [value]=\"t.id\">{{ t.label ?? t.id }}</mat-option>\n }\n </mat-select>\n </div>\n </div>\n\n <!-- Joiner between the full-text unit and the condition blocks. Top-level units\n always combine with OR (\"looking for this as well as that\"), so this is a\n static label rather than a toggle. -->\n @if (fulltext().term.trim() && ctrl.blocks().length) {\n <div class=\"combinator\">\n <span class=\"combinator__label\">{{ 'yuv.smart-search.combinator.as-well-as' | translate }}</span>\n </div>\n }\n\n <!-- ── Step 1: Type blocks ─────────────────────────────────────────── -->\n @for (block of ctrl.blocks(); track block.id) {\n <div class=\"block\" [attr.data-block-id]=\"block.id\" [class.block--active]=\"ctrl.activeBlock() === block\">\n <div class=\"block__header\">\n <div class=\"block__types\">\n @for (t of block.types; track t.id) {\n @if (!$first) {\n <span class=\"block__type-sep\">{{ 'yuv.smart-search.combinator.or' | translate }}</span>\n }\n <span class=\"block__type\">\n <span class=\"block__type-label\">{{ t.label }}</span>\n </span>\n }\n </div>\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"block__remove\"\n (click)=\"removeBlock(block)\"\n [matTooltip]=\"'yuv.smart-search.type.remove' | translate\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n\n <div class=\"block__conditions\">\n <yuv-smart-search-group [group]=\"block\" [bare]=\"true\" [chipTpl]=\"chipTpl\" [editorTpl]=\"editorTpl\" />\n </div>\n </div>\n\n <!-- Static joiner between blocks — blocks are type-scoped, so they always\n combine with OR (\"this type as well as that type\"). -->\n @if (!$last && ctrl.showCombinator()) {\n <div class=\"combinator\">\n <span class=\"combinator__label\">{{ 'yuv.smart-search.combinator.as-well-as' | translate }}</span>\n </div>\n }\n }\n\n <!-- ── Step 1 input: add a type block (multi-select) ──────────────── -->\n @if (ctrl.step() === 'type') {\n <div class=\"add-type-row\">\n <button\n type=\"button\"\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"add-type-row__icon\"\n (click)=\"typeInput.focus()\"\n [attr.aria-label]=\"'yuv.smart-search.add-type' | translate\"\n >\n <mat-icon>add_circle_outline</mat-icon>\n </button>\n\n <!-- Staged draft types as removable Material chips -->\n <mat-chip-grid\n #typeChipGrid\n class=\"add-type-row__chips\"\n [attr.aria-label]=\"'yuv.smart-search.add-type' | translate\"\n >\n @for (t of ctrl.draftTypes(); track t.id) {\n <mat-chip-row (removed)=\"ctrl.removeDraftType(t.id)\">\n {{ t.label }}\n <button matChipRemove [attr.aria-label]=\"'yuv.smart-search.type.remove-draft' | translate\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-chip-row>\n }\n <input\n #typeInput\n [formControl]=\"ctrl.fieldCtrl\"\n [placeholder]=\"'yuv.smart-search.add-type' | translate\"\n [matAutocomplete]=\"auto\"\n [matChipInputFor]=\"typeChipGrid\"\n (keydown.enter)=\"onTypeEnter()\"\n (keydown.escape)=\"cancelPending()\"\n />\n </mat-chip-grid>\n\n @if (ctrl.draftTypes().length) {\n <button\n ymtIconButton\n icon-button-size=\"extra-small\"\n class=\"add-type-row__confirm\"\n (click)=\"confirmTypes()\"\n [matTooltip]=\"'yuv.smart-search.type.confirm' | translate\"\n >\n <mat-icon>check</mat-icon>\n </button>\n }\n </div>\n }\n }\n\n <!-- ── Shared autocomplete panel ──────────────────────────────────── -->\n <mat-autocomplete\n #auto\n panelWidth=\"auto\"\n [displayWith]=\"displayFn\"\n (optionSelected)=\"onSuggestionSelected($event)\"\n (closed)=\"onPickerClosed()\"\n >\n @for (s of ctrl.suggestions(); track s.id) {\n <mat-option [value]=\"s\">\n <div class=\"suggestion\">\n @if (s.kind !== 'type') {\n <mat-icon class=\"suggestion__icon\">\n @switch (s.kind) {\n @case ('field') {\n tune\n }\n @case ('date-preset') {\n calendar_today\n }\n @default {\n manage_search\n }\n }\n </mat-icon>\n }\n <span class=\"suggestion__label\">{{ s.label }}</span>\n </div>\n </mat-option>\n }\n </mat-autocomplete>\n</div>\n","import { NgModule } from '@angular/core';\nimport { SmartSearchComponent } from './smart-search.component';\n\n/**\n * Convenience NgModule that imports and re-exports {@link SmartSearchComponent}.\n *\n * The component is standalone — prefer importing `SmartSearchComponent` directly.\n * This module exists only for consumers still organized around NgModules.\n */\nconst cmp = [SmartSearchComponent];\n\n@NgModule({\n imports: cmp,\n exports: cmp\n})\nexport class YuvSmartSearchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["DATE_PREFIX_LEN","marker","i1","i2","i3","i6"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6DM,SAAU,gBAAgB,CAAC,IAAiC,EAAA;AAChE,IAAA,OAAQ,IAAuB,CAAC,IAAI,KAAK,OAAO;AAClD;AAEM,SAAU,gBAAgB,CAAC,IAAiC,EAAA;AAChE,IAAA,OAAQ,IAAuB,CAAC,IAAI,KAAK,OAAO;AAClD;AAEM,SAAU,gBAAgB,CAAC,IAAmB,EAAA;IAClD,OAAO,CAAC,gBAAgB,CAAC,IAAI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