@conduction/nextcloud-vue 2.145.0 → 2.147.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/esm/components/CnAiCompanion/CnAiChatPanel.vue2.js.map +1 -1
  2. package/dist/esm/components/CnAiCompanion/CnAiChatPanel.vue3.js.map +1 -1
  3. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
  4. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
  5. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
  6. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +12 -2
  7. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
  8. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +42 -30
  9. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
  10. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +22 -0
  11. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  12. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +2 -1
  13. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  14. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue.js +1 -1
  15. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue2.js.map +1 -1
  16. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue3.js.map +1 -1
  17. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  18. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +112 -15
  19. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  20. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +40 -16
  21. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  22. package/dist/esm/components/CnNotesCard/CnNotesCard.vue.js +1 -1
  23. package/dist/esm/components/CnNotesCard/CnNotesCard.vue2.js.map +1 -1
  24. package/dist/esm/components/CnNotesCard/CnNotesCard.vue3.js +1 -0
  25. package/dist/esm/components/CnNotesCard/CnNotesCard.vue3.js.map +1 -1
  26. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue.js +1 -1
  27. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js +21 -2
  28. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js.map +1 -1
  29. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js.map +1 -1
  30. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
  31. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +2 -2
  32. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
  33. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
  34. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  35. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  36. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  37. package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue.js +1 -1
  38. package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue2.js.map +1 -1
  39. package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue3.js.map +1 -1
  40. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
  41. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
  42. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
  43. package/dist/esm/library-style.js +1 -1
  44. package/dist/esm/nextcloud-vue.css +634 -301
  45. package/dist/esm/utils/detailObjectContext.js +7 -2
  46. package/dist/esm/utils/detailObjectContext.js.map +1 -1
  47. package/dist/esm/utils/objectParties.js +30 -1
  48. package/dist/esm/utils/objectParties.js.map +1 -1
  49. package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
  50. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  51. package/dist/esm/utils/visibleWhen.js +6 -0
  52. package/dist/esm/utils/visibleWhen.js.map +1 -1
  53. package/dist/nextcloud-vue.cjs.js +362 -138
  54. package/dist/nextcloud-vue.cjs.js.map +2 -2
  55. package/dist/nextcloud-vue.css +634 -301
  56. package/package.json +1 -1
  57. package/src/components/CnAiCompanion/CnAiChatPanel.vue +3 -0
  58. package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +4 -2
  59. package/src/components/CnDataTable/CnDataTable.vue +19 -2
  60. package/src/components/CnDetailPage/CnDetailPage.md +1 -0
  61. package/src/components/CnDetailPage/CnDetailPage.vue +23 -0
  62. package/src/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue +1 -0
  63. package/src/components/CnFactsWidget/CnFactsWidget.vue +168 -16
  64. package/src/components/CnNotesCard/CnNotesCard.vue +7 -2
  65. package/src/components/CnNotificationMatrix/CnNotificationMatrix.vue +21 -2
  66. package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +2 -1
  67. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +1 -0
  68. package/src/components/CnRetentionWidget/CnRetentionWidget.vue +2 -0
  69. package/src/components/CnTabsWidget/CnTabsWidget.vue +6 -1
  70. package/src/css/dialog.css +7 -0
  71. package/src/css/look-board-detail.css +152 -8
  72. package/src/css/look-board-index.css +78 -0
  73. package/src/css/look-board.css +33 -3
  74. package/src/css/table.css +9 -0
  75. package/src/schemas/app-manifest-v2.schema.json +2 -2
  76. package/src/utils/detailObjectContext.js +7 -2
  77. package/src/utils/objectParties.js +29 -0
  78. package/src/utils/validateManifestV2.compiled.js +2 -2
  79. package/src/utils/visibleWhen.js +6 -0
@@ -47,8 +47,10 @@ function unwrap(v) {
47
47
  *
48
48
  * @param {object|null} objectCtx The `cnObjectContext` inject (ref or plain object).
49
49
  * @param {object|null} detailCtx The `cnDetailObjectContext` inject (`{ value }` holder).
50
- * @return {{objectId: (string|number|null), object: (object|null), register: string, schema: (string|object)}|null}
51
- * The merged context, or null when neither inject resolves.
50
+ * @return {{objectId: (string|number|null), object: (object|null), register: string, schema: (string|object), context?: object}|null}
51
+ * The merged context, or null when neither inject resolves. `context` is the
52
+ * records the page's conditions name (`@context.<name>`), when the primary
53
+ * inject carries them.
52
54
  */
53
55
  function resolveObjectTokenContext(objectCtx, detailCtx) {
54
56
  const primary = unwrap(objectCtx);
@@ -81,6 +83,9 @@ function resolveObjectTokenContext(objectCtx, detailCtx) {
81
83
  if (primary.schema) {
82
84
  out.schema = primary.schema;
83
85
  }
86
+ if (primary.context && typeof primary.context === 'object') {
87
+ out.context = primary.context;
88
+ }
84
89
  }
85
90
  return out
86
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"detailObjectContext.js","sources":["../../../src/utils/detailObjectContext.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * detailObjectContext — resolve the object token context (`{ objectId,\n * object, register, schema }`) for `@objectId` / `@object.<field>` token\n * resolution from EITHER detail-surface provider, in the same order the\n * Wave-1 audit-trail widget established:\n *\n * 1. `cnObjectContext` — provided by CnDetailPage's config grid (a\n * reactive `{ objectId, object, register, schema }` ref, kept current\n * as the object loads) and by CnAddWidgetModal's data sub-form.\n * 2. `cnDetailObjectContext` — provided by CnPageRenderer for the v2\n * slot grid (a `{ value: { objectData, schema, objectType, objectId,\n * register, store } | null }` holder; note the object lives under\n * `objectData` there).\n *\n * The holder's fields BACKFILL whatever the primary inject leaves null,\n * so a widget mounted where both providers exist never loses `@object.*`\n * resolution to a not-yet-loaded primary context. Returns `null` when\n * neither surface provides anything (dashboards without object scope).\n *\n * Internal helper (not a public export) — used by the endpoint-bound\n * widgets (chart / stat / delta / object-table) so ZGW-style sidebar tabs\n * can interpolate the parent object into endpoint params + source filters\n * (#91 Wave 3).\n *\n * @module utils/detailObjectContext\n */\n\n/**\n * Unwrap a value that may be a plain object, a Vue ref, or a `{ value }`\n * holder.\n *\n * @param {unknown} v The injected value.\n * @return {object|null} The unwrapped bag, or null.\n */\nfunction unwrap(v) {\n\tif (!v || typeof v !== 'object') {\n\t\treturn null\n\t}\n\treturn ('value' in v) ? (v.value || null) : v\n}\n\n/**\n * Build the object token context from the two detail-surface injects.\n *\n * @param {object|null} objectCtx The `cnObjectContext` inject (ref or plain object).\n * @param {object|null} detailCtx The `cnDetailObjectContext` inject (`{ value }` holder).\n * @return {{objectId: (string|number|null), object: (object|null), register: string, schema: (string|object)}|null}\n * The merged context, or null when neither inject resolves.\n */\nexport function resolveObjectTokenContext(objectCtx, detailCtx) {\n\tconst primary = unwrap(objectCtx)\n\tconst holder = unwrap(detailCtx)\n\tif (!primary && !holder) {\n\t\treturn null\n\t}\n\tconst fromHolder = holder\n\t\t? {\n\t\t\t\tobjectId: holder.objectId ?? null,\n\t\t\t\t// CnPageRenderer's holder carries the loaded object as `objectData`.\n\t\t\t\tobject: holder.object || holder.objectData || null,\n\t\t\t\tregister: holder.register || '',\n\t\t\t\tschema: holder.schema || '',\n\t\t\t}\n\t\t: {}\n\tconst out = { objectId: null, object: null, register: '', schema: '', ...fromHolder }\n\tif (primary) {\n\t\t// The primary (CnDetailPage) context wins per field, but its null /\n\t\t// empty fields fall back to the holder's values.\n\t\tif (primary.objectId !== undefined && primary.objectId !== null) {\n\t\t\tout.objectId = primary.objectId\n\t\t}\n\t\tif (primary.object) {\n\t\t\tout.object = primary.object\n\t\t}\n\t\tif (primary.register) {\n\t\t\tout.register = primary.register\n\t\t}\n\t\tif (primary.schema) {\n\t\t\tout.schema = primary.schema\n\t\t}\n\t}\n\treturn out\n}\n"],"names":[],"mappings":"AAAA;AACA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IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,EAAE;AACnE,GAAG,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,SAAQ;AAClC,GAAG;AACH,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE;AACtB,GAAG,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,OAAM;AAC9B,GAAG;AACH,EAAE,IAAI,OAAO,CAAC,QAAQ,EAAE;AACxB,GAAG,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,SAAQ;AAClC,GAAG;AACH,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE;AACtB,GAAG,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,OAAM;AAC9B,GAAG;AACH,EAAE;AACF,CAAC,OAAO,GAAG;AACX;;;;"}
1
+ {"version":3,"file":"detailObjectContext.js","sources":["../../../src/utils/detailObjectContext.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * detailObjectContext — resolve the object token context (`{ objectId,\n * object, register, schema }`) for `@objectId` / `@object.<field>` token\n * resolution from EITHER detail-surface provider, in the same order the\n * Wave-1 audit-trail widget established:\n *\n * 1. `cnObjectContext` — provided by CnDetailPage's config grid (a\n * reactive `{ objectId, object, register, schema }` ref, kept current\n * as the object loads) and by CnAddWidgetModal's data sub-form.\n * 2. `cnDetailObjectContext` — provided by CnPageRenderer for the v2\n * slot grid (a `{ value: { objectData, schema, objectType, objectId,\n * register, store } | null }` holder; note the object lives under\n * `objectData` there).\n *\n * The holder's fields BACKFILL whatever the primary inject leaves null,\n * so a widget mounted where both providers exist never loses `@object.*`\n * resolution to a not-yet-loaded primary context. Returns `null` when\n * neither surface provides anything (dashboards without object scope).\n *\n * Internal helper (not a public export) — used by the endpoint-bound\n * widgets (chart / stat / delta / object-table) so ZGW-style sidebar tabs\n * can interpolate the parent object into endpoint params + source filters\n * (#91 Wave 3).\n *\n * @module utils/detailObjectContext\n */\n\n/**\n * Unwrap a value that may be a plain object, a Vue ref, or a `{ value }`\n * holder.\n *\n * @param {unknown} v The injected value.\n * @return {object|null} The unwrapped bag, or null.\n */\nfunction unwrap(v) {\n\tif (!v || typeof v !== 'object') {\n\t\treturn null\n\t}\n\treturn ('value' in v) ? (v.value || null) : v\n}\n\n/**\n * Build the object token context from the two detail-surface injects.\n *\n * @param {object|null} objectCtx The `cnObjectContext` inject (ref or plain object).\n * @param {object|null} detailCtx The `cnDetailObjectContext` inject (`{ value }` holder).\n * @return {{objectId: (string|number|null), object: (object|null), register: string, schema: (string|object), context?: object}|null}\n * The merged context, or null when neither inject resolves. `context` is the\n * records the page's conditions name (`@context.<name>`), when the primary\n * inject carries them.\n */\nexport function resolveObjectTokenContext(objectCtx, detailCtx) {\n\tconst primary = unwrap(objectCtx)\n\tconst holder = unwrap(detailCtx)\n\tif (!primary && !holder) {\n\t\treturn null\n\t}\n\tconst fromHolder = holder\n\t\t? {\n\t\t\t\tobjectId: holder.objectId ?? null,\n\t\t\t\t// CnPageRenderer's holder carries the loaded object as `objectData`.\n\t\t\t\tobject: holder.object || holder.objectData || null,\n\t\t\t\tregister: holder.register || '',\n\t\t\t\tschema: holder.schema || '',\n\t\t\t}\n\t\t: {}\n\tconst out = { objectId: null, object: null, register: '', schema: '', ...fromHolder }\n\tif (primary) {\n\t\t// The primary (CnDetailPage) context wins per field, but its null /\n\t\t// empty fields fall back to the holder's values.\n\t\tif (primary.objectId !== undefined && primary.objectId !== null) {\n\t\t\tout.objectId = primary.objectId\n\t\t}\n\t\tif (primary.object) {\n\t\t\tout.object = primary.object\n\t\t}\n\t\tif (primary.register) {\n\t\t\tout.register = primary.register\n\t\t}\n\t\tif (primary.schema) {\n\t\t\tout.schema = primary.schema\n\t\t}\n\t\tif (primary.context && typeof primary.context === 'object') {\n\t\t\tout.context = primary.context\n\t\t}\n\t}\n\treturn out\n}\n"],"names":[],"mappings":"AAAA;AACA;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A,EAAE,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,EAAE;AACnE,GAAG,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,SAAQ;AAClC,GAAG;AACH,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE;AACtB,GAAG,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,OAAM;AAC9B,GAAG;AACH,EAAE,IAAI,OAAO,CAAC,QAAQ,EAAE;AACxB,GAAG,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,SAAQ;AAClC,GAAG;AACH,EAAE,IAAI,OAAO,CAAC,MAAM,EAAE;AACtB,GAAG,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,OAAM;AAC9B,GAAG;AACH,EAAE,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE;AAC9D,GAAG,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,QAAO;AAChC,GAAG;AACH,EAAE;AACF,CAAC,OAAO,GAAG;AACX;;;;"}
@@ -177,6 +177,35 @@ function kindCode(kind) {
177
177
  return String(kind?.code || kind?.key || '')
178
178
  }
179
179
 
180
+ /**
181
+ * Whether a party's kind is among the kinds a record accepts. Two
182
+ * vocabularies meet here: the party's kind is its schema's (`person`,
183
+ * `organisation`, `colleague`), while the accepted kinds may be role kinds
184
+ * that name the identity shapes they take (pipelinq's `aanvrager` with
185
+ * `identityShapes: ["naturalPerson", "organization"]`). When the accepted
186
+ * kinds name shapes, the party's own kind is matched by the shapes the
187
+ * listing gives it; a kind that names none cannot be judged and passes.
188
+ * Otherwise the codes are compared.
189
+ *
190
+ * @param {string} partyKind The party's kind key.
191
+ * @param {Array<object>} accepted The accepted kinds.
192
+ * @param {Array<object>} own The listing's own kinds (`{ key, identityShapes? }`).
193
+ * @return {boolean} False only when the party is known not to fit.
194
+ * @spec openspec/changes/parties-accepted-kinds-by-shape/specs/object-parties/spec.md#requirement-a-party-is-checked-against-the-accepted-kinds-in-one-vocabulary
195
+ */
196
+ function partyKindAccepted(partyKind, accepted, own) {
197
+ const kinds = Array.isArray(accepted) ? accepted : [];
198
+ const shapes = new Set(kinds.flatMap((kind) => (Array.isArray(kind?.identityShapes) ? kind.identityShapes : [])));
199
+ if (shapes.size === 0) {
200
+ return kinds.some((kind) => kindCode(kind) === partyKind)
201
+ }
202
+ const mine = (Array.isArray(own) ? own : []).find((kind) => kindCode(kind) === partyKind)?.identityShapes;
203
+ if (!Array.isArray(mine) || mine.length === 0) {
204
+ return true
205
+ }
206
+ return mine.some((shape) => shapes.has(shape))
207
+ }
208
+
180
209
  /**
181
210
  * Write a value at a dotted path, creating the objects on the way.
182
211
  *
@@ -254,5 +283,5 @@ function savedUuid(saved) {
254
283
  return String(saved?.['@self']?.id || saved?.uuid || saved?.id || '')
255
284
  }
256
285
 
257
- export { documentsOfParty, indicatorVerdict, indicatorsOf, kindCode, newPartyRecord, partiesInOrder, representedByMap, roleLabel, rolesInOrder, savedUuid };
286
+ export { documentsOfParty, indicatorVerdict, indicatorsOf, kindCode, newPartyRecord, partiesInOrder, partyKindAccepted, representedByMap, roleLabel, rolesInOrder, savedUuid };
258
287
  //# sourceMappingURL=objectParties.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"objectParties.js","sources":["../../../src/utils/objectParties.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * objectParties — reading the parties of a record as OpenRegister's party\n * model answers them (`GET .../objects/{register}/{schema}/{id}/parties`:\n * `{ primary, roles, kinds, byRole, results }`, and `GET .../parties/{uuid}`\n * for one party with its indicators).\n *\n * Pure functions, so CnObjectPartiesWidget and its tests read one shape.\n *\n * @module utils/objectParties\n */\n\nimport { translate as t } from '@nextcloud/l10n'\nimport { readPath } from './readPath.js'\n\n/**\n * What a role is called: the app's own word (`roleLabels`), else the label\n * the listing declares, else the key. `other` is a party with no role.\n *\n * @param {string} key The role key.\n * @param {Array<{key: string, label?: string}>} roles The roles the listing declares.\n * @param {Record<string, string>} [roleLabels] The app's words, by key.\n * @return {string} The label.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function roleLabel(key, roles, roleLabels = {}) {\n\tif (roleLabels && typeof roleLabels[key] === 'string' && roleLabels[key] !== '') {\n\t\treturn roleLabels[key]\n\t}\n\tconst declared = (roles || []).find((role) => role && role.key === key)\n\tif (declared && declared.label) {\n\t\treturn declared.label\n\t}\n\treturn key === 'other' ? t('nextcloud-vue', 'No role') : key\n}\n\n/**\n * The parties of one role, the primary party first.\n *\n * @param {Array<object>} parties The role's rows.\n * @param {string|null} primary The primary party's uuid.\n * @return {Array<object>} The rows.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function partiesInOrder(parties, primary) {\n\tconst rows = Array.isArray(parties) ? parties.filter(Boolean) : []\n\tif (!primary) {\n\t\treturn rows\n\t}\n\treturn [\n\t\t...rows.filter((row) => row.partyUuid === primary),\n\t\t...rows.filter((row) => row.partyUuid !== primary),\n\t]\n}\n\n/**\n * The roles of a listing as groups, the group holding the primary party first.\n *\n * @param {object|null} listing The `/parties` answer.\n * @param {Record<string, string>} [roleLabels] The app's words for the roles.\n * @return {Array<{key: string, label: string, parties: Array<object>}>} The groups.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function rolesInOrder(listing, roleLabels = {}) {\n\tif (!listing || typeof listing !== 'object') {\n\t\treturn []\n\t}\n\tconst byRole = listing.byRole && typeof listing.byRole === 'object' ? listing.byRole : {}\n\tconst primary = listing.primary || null\n\tconst groups = Object.keys(byRole).map((key) => ({\n\t\tkey,\n\t\tlabel: roleLabel(key, listing.roles, roleLabels),\n\t\tparties: partiesInOrder(byRole[key], primary),\n\t}))\n\tconst holdsPrimary = (group) => !!primary && group.parties.some((party) => party.partyUuid === primary)\n\treturn [...groups.filter(holdsPrimary), ...groups.filter((group) => !holdsPrimary(group))]\n}\n\n/**\n * What an indicator means for what may be done: an indicator always carries\n * its verdict, never a bare chip. `refuse-publication` and `refuse-send` are\n * blocking (`error`); anything else asks to be read first (`warning`).\n *\n * @param {object} indicator The indicator (`{ key, label, effect }`).\n * @param {object} [labels] The app's words: `verdictPublication`, `verdictSend`, `verdictWarn`.\n * @return {{effect: string, severity: string, label: string, verdict: string}} The verdict.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorVerdict(indicator, labels = {}) {\n\tconst effect = String(indicator?.effect || '').trim()\n\tconst label = String(indicator?.label || indicator?.key || '').trim()\n\tif (effect === 'refuse-publication') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictPublication || t('nextcloud-vue', 'Publishing a file on this record is refused') }\n\t}\n\tif (effect === 'refuse-send') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictSend || t('nextcloud-vue', 'A message to this party is refused') }\n\t}\n\treturn { effect: effect === '' ? 'warn' : effect, severity: 'warning', label, verdict: labels.verdictWarn || t('nextcloud-vue', 'Read this before acting on the record') }\n}\n\n/**\n * Every indicator on a set of parties, each knowing whose it is.\n *\n * @param {Array<object>} parties The party records.\n * @return {Array<object>} The indicators with `party` and `partyName`.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorsOf(parties) {\n\tconst found = []\n\tfor (const party of parties || []) {\n\t\tif (!party) {\n\t\t\tcontinue\n\t\t}\n\t\tfor (const indicator of Array.isArray(party.indicators) ? party.indicators : []) {\n\t\t\tif (indicator) {\n\t\t\t\tfound.push({ ...indicator, party: party.id || party.uuid || '', partyName: party.name || party.displayName || '' })\n\t\t\t}\n\t\t}\n\t}\n\treturn found\n}\n\n/**\n * Who represents whom: participant uuid to the uuid of the party it acts for,\n * read from role rows (`{ participant, representedParty }`).\n *\n * @param {Array<object>|null} rows The role rows.\n * @return {Record<string, string>} The map.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function representedByMap(rows) {\n\tconst map = {}\n\tfor (const row of Array.isArray(rows) ? rows : []) {\n\t\tconst participant = String(row?.participant || '').trim()\n\t\tconst represented = String(row?.representedParty?.id || row?.representedParty || '').trim()\n\t\tif (participant !== '' && represented !== '') {\n\t\t\tmap[participant] = represented\n\t\t}\n\t}\n\treturn map\n}\n\n/**\n * The documents a party sent and received: sender is the party, or the party\n * is among the recipients.\n *\n * @param {Array<object>} documents The documents.\n * @param {string} identifier The party's uuid.\n * @param {{senderField?: string, recipientsField?: string}} [fields] Where a document names them.\n * @return {{sent: Array<object>, received: Array<object>}} The two lists.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function documentsOfParty(documents, identifier, fields = {}) {\n\tconst id = String(identifier || '').trim()\n\tconst rows = Array.isArray(documents) ? documents : []\n\tif (id === '') {\n\t\treturn { sent: [], received: [] }\n\t}\n\tconst sender = fields.senderField || 'sender'\n\tconst recipients = fields.recipientsField || 'recipients'\n\treturn {\n\t\tsent: rows.filter((row) => String(row?.[sender] || '').trim() === id),\n\t\treceived: rows.filter((row) => (Array.isArray(row?.[recipients]) ? row[recipients] : []).map((entry) => String(entry || '').trim()).includes(id)),\n\t}\n}\n\n/**\n * The code of a party kind (`code`, else `key`).\n *\n * @param {object} kind The kind.\n * @return {string} The code.\n */\nexport function kindCode(kind) {\n\treturn String(kind?.code || kind?.key || '')\n}\n\n/**\n * Write a value at a dotted path, creating the objects on the way.\n *\n * @param {object} target The object written into.\n * @param {string} path The dotted path (`name.surname`).\n * @param {unknown} value The value.\n * @return {void}\n */\nfunction writePath(target, path, value) {\n\tconst keys = String(path).split('.').filter((key) => key !== '')\n\tlet node = target\n\tkeys.slice(0, -1).forEach((key) => {\n\t\tif (!node[key] || typeof node[key] !== 'object') {\n\t\t\tnode[key] = {}\n\t\t}\n\t\tnode = node[key]\n\t})\n\tif (keys.length > 0) {\n\t\tnode[keys[keys.length - 1]] = value\n\t}\n}\n\n/**\n * The record a new party is saved as, from the fields a host declares.\n *\n * Each field `{ key, path?, address? }` writes its trimmed value at `path`\n * (default `key`); a field with `address: { path, kind, type }` instead adds\n * `{ kind, type, value }` to the list at that path, the shape OpenRegister's\n * party model reads as the party's addresses. `compose` names the paths a\n * derived field joins with a space, skipping the empty ones\n * (`{ displayName: [\"name.givenNames\", \"name.namePrefix\", \"name.surname\"] }`).\n * A field of `type: \"integer\"` is saved as a number when it reads as one.\n * An empty value is left out.\n *\n * @param {{fields?: Array<object>, compose?: Record<string, Array<string>>}} create The declaration.\n * @param {Record<string, string>} values The values by field key.\n * @return {object} The record.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function newPartyRecord(create, values) {\n\tconst record = {}\n\tfor (const field of Array.isArray(create?.fields) ? create.fields : []) {\n\t\tconst value = String(values?.[field?.key] ?? '').trim()\n\t\tif (!field || !field.key || value === '') {\n\t\t\tcontinue\n\t\t}\n\t\tif (field.address && field.address.path) {\n\t\t\tconst list = readPath(record, field.address.path)\n\t\t\tconst entry = { kind: field.address.kind || 'correspondence', type: field.address.type || 'email', value }\n\t\t\twritePath(record, field.address.path, [...(Array.isArray(list) ? list : []), entry])\n\t\t\tcontinue\n\t\t}\n\t\twritePath(record, field.path || field.key, field.type === 'integer' && /^-?\\d+$/.test(value) ? Number(value) : value)\n\t}\n\tfor (const [target, paths] of Object.entries(create?.compose && typeof create.compose === 'object' ? create.compose : {})) {\n\t\tconst joined = (Array.isArray(paths) ? paths : [])\n\t\t\t.map((path) => String(readPath(record, path) ?? '').trim())\n\t\t\t.filter((part) => part !== '')\n\t\t\t.join(' ')\n\t\tif (joined !== '') {\n\t\t\twritePath(record, target, joined)\n\t\t}\n\t}\n\treturn record\n}\n\n/**\n * The uuid a create answered with: `id`, `uuid` or `@self.id`.\n *\n * @param {object} saved The saved object.\n * @return {string} The uuid, or ''.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function savedUuid(saved) {\n\treturn String(saved?.['@self']?.id || saved?.uuid || saved?.id || '')\n}\n"],"names":["t"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,GAAG,EAAE,EAAE;AACvD,CAAC,IAAI,UAAU,IAAI,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE;AAClF,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC;AACxB,EAAE;AACF,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,GAAG,KAAK,GAAG,EAAC;AACxE,CAAC,IAAI,QAAQ,IAAI,QAAQ,CAAC,KAAK,EAAE;AACjC,EAAE,OAAO,QAAQ,CAAC,KAAK;AACvB,EAAE;AACF,CAAC,OAAO,GAAG,KAAK,OAAO,GAAGA,SAAC,CAAC,eAAe,EAAE,SAAS,CAAC,GAAG,GAAG;AAC7D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE;AACjD,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,OA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,IAAI,KAAK,EAAE,CAAC;AACjC,IAAI,IAAI,CAAC,GAAG,EAAC;AACb,EAAE,IAAI,MAAM,KAAK,EAAE,EAAE;AACrB,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAC;AACpC,GAAG;AACH,EAAE;AACF,CAAC,OAAO,MAAM;AACd,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,CAAC,OAAO,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,EAAE,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC;AACtE;;;;"}
1
+ {"version":3,"file":"objectParties.js","sources":["../../../src/utils/objectParties.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * objectParties — reading the parties of a record as OpenRegister's party\n * model answers them (`GET .../objects/{register}/{schema}/{id}/parties`:\n * `{ primary, roles, kinds, byRole, results }`, and `GET .../parties/{uuid}`\n * for one party with its indicators).\n *\n * Pure functions, so CnObjectPartiesWidget and its tests read one shape.\n *\n * @module utils/objectParties\n */\n\nimport { translate as t } from '@nextcloud/l10n'\nimport { readPath } from './readPath.js'\n\n/**\n * What a role is called: the app's own word (`roleLabels`), else the label\n * the listing declares, else the key. `other` is a party with no role.\n *\n * @param {string} key The role key.\n * @param {Array<{key: string, label?: string}>} roles The roles the listing declares.\n * @param {Record<string, string>} [roleLabels] The app's words, by key.\n * @return {string} The label.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function roleLabel(key, roles, roleLabels = {}) {\n\tif (roleLabels && typeof roleLabels[key] === 'string' && roleLabels[key] !== '') {\n\t\treturn roleLabels[key]\n\t}\n\tconst declared = (roles || []).find((role) => role && role.key === key)\n\tif (declared && declared.label) {\n\t\treturn declared.label\n\t}\n\treturn key === 'other' ? t('nextcloud-vue', 'No role') : key\n}\n\n/**\n * The parties of one role, the primary party first.\n *\n * @param {Array<object>} parties The role's rows.\n * @param {string|null} primary The primary party's uuid.\n * @return {Array<object>} The rows.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function partiesInOrder(parties, primary) {\n\tconst rows = Array.isArray(parties) ? parties.filter(Boolean) : []\n\tif (!primary) {\n\t\treturn rows\n\t}\n\treturn [\n\t\t...rows.filter((row) => row.partyUuid === primary),\n\t\t...rows.filter((row) => row.partyUuid !== primary),\n\t]\n}\n\n/**\n * The roles of a listing as groups, the group holding the primary party first.\n *\n * @param {object|null} listing The `/parties` answer.\n * @param {Record<string, string>} [roleLabels] The app's words for the roles.\n * @return {Array<{key: string, label: string, parties: Array<object>}>} The groups.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function rolesInOrder(listing, roleLabels = {}) {\n\tif (!listing || typeof listing !== 'object') {\n\t\treturn []\n\t}\n\tconst byRole = listing.byRole && typeof listing.byRole === 'object' ? listing.byRole : {}\n\tconst primary = listing.primary || null\n\tconst groups = Object.keys(byRole).map((key) => ({\n\t\tkey,\n\t\tlabel: roleLabel(key, listing.roles, roleLabels),\n\t\tparties: partiesInOrder(byRole[key], primary),\n\t}))\n\tconst holdsPrimary = (group) => !!primary && group.parties.some((party) => party.partyUuid === primary)\n\treturn [...groups.filter(holdsPrimary), ...groups.filter((group) => !holdsPrimary(group))]\n}\n\n/**\n * What an indicator means for what may be done: an indicator always carries\n * its verdict, never a bare chip. `refuse-publication` and `refuse-send` are\n * blocking (`error`); anything else asks to be read first (`warning`).\n *\n * @param {object} indicator The indicator (`{ key, label, effect }`).\n * @param {object} [labels] The app's words: `verdictPublication`, `verdictSend`, `verdictWarn`.\n * @return {{effect: string, severity: string, label: string, verdict: string}} The verdict.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorVerdict(indicator, labels = {}) {\n\tconst effect = String(indicator?.effect || '').trim()\n\tconst label = String(indicator?.label || indicator?.key || '').trim()\n\tif (effect === 'refuse-publication') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictPublication || t('nextcloud-vue', 'Publishing a file on this record is refused') }\n\t}\n\tif (effect === 'refuse-send') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictSend || t('nextcloud-vue', 'A message to this party is refused') }\n\t}\n\treturn { effect: effect === '' ? 'warn' : effect, severity: 'warning', label, verdict: labels.verdictWarn || t('nextcloud-vue', 'Read this before acting on the record') }\n}\n\n/**\n * Every indicator on a set of parties, each knowing whose it is.\n *\n * @param {Array<object>} parties The party records.\n * @return {Array<object>} The indicators with `party` and `partyName`.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorsOf(parties) {\n\tconst found = []\n\tfor (const party of parties || []) {\n\t\tif (!party) {\n\t\t\tcontinue\n\t\t}\n\t\tfor (const indicator of Array.isArray(party.indicators) ? party.indicators : []) {\n\t\t\tif (indicator) {\n\t\t\t\tfound.push({ ...indicator, party: party.id || party.uuid || '', partyName: party.name || party.displayName || '' })\n\t\t\t}\n\t\t}\n\t}\n\treturn found\n}\n\n/**\n * Who represents whom: participant uuid to the uuid of the party it acts for,\n * read from role rows (`{ participant, representedParty }`).\n *\n * @param {Array<object>|null} rows The role rows.\n * @return {Record<string, string>} The map.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function representedByMap(rows) {\n\tconst map = {}\n\tfor (const row of Array.isArray(rows) ? rows : []) {\n\t\tconst participant = String(row?.participant || '').trim()\n\t\tconst represented = String(row?.representedParty?.id || row?.representedParty || '').trim()\n\t\tif (participant !== '' && represented !== '') {\n\t\t\tmap[participant] = represented\n\t\t}\n\t}\n\treturn map\n}\n\n/**\n * The documents a party sent and received: sender is the party, or the party\n * is among the recipients.\n *\n * @param {Array<object>} documents The documents.\n * @param {string} identifier The party's uuid.\n * @param {{senderField?: string, recipientsField?: string}} [fields] Where a document names them.\n * @return {{sent: Array<object>, received: Array<object>}} The two lists.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function documentsOfParty(documents, identifier, fields = {}) {\n\tconst id = String(identifier || '').trim()\n\tconst rows = Array.isArray(documents) ? documents : []\n\tif (id === '') {\n\t\treturn { sent: [], received: [] }\n\t}\n\tconst sender = fields.senderField || 'sender'\n\tconst recipients = fields.recipientsField || 'recipients'\n\treturn {\n\t\tsent: rows.filter((row) => String(row?.[sender] || '').trim() === id),\n\t\treceived: rows.filter((row) => (Array.isArray(row?.[recipients]) ? row[recipients] : []).map((entry) => String(entry || '').trim()).includes(id)),\n\t}\n}\n\n/**\n * The code of a party kind (`code`, else `key`).\n *\n * @param {object} kind The kind.\n * @return {string} The code.\n */\nexport function kindCode(kind) {\n\treturn String(kind?.code || kind?.key || '')\n}\n\n/**\n * Whether a party's kind is among the kinds a record accepts. Two\n * vocabularies meet here: the party's kind is its schema's (`person`,\n * `organisation`, `colleague`), while the accepted kinds may be role kinds\n * that name the identity shapes they take (pipelinq's `aanvrager` with\n * `identityShapes: [\"naturalPerson\", \"organization\"]`). When the accepted\n * kinds name shapes, the party's own kind is matched by the shapes the\n * listing gives it; a kind that names none cannot be judged and passes.\n * Otherwise the codes are compared.\n *\n * @param {string} partyKind The party's kind key.\n * @param {Array<object>} accepted The accepted kinds.\n * @param {Array<object>} own The listing's own kinds (`{ key, identityShapes? }`).\n * @return {boolean} False only when the party is known not to fit.\n * @spec openspec/changes/parties-accepted-kinds-by-shape/specs/object-parties/spec.md#requirement-a-party-is-checked-against-the-accepted-kinds-in-one-vocabulary\n */\nexport function partyKindAccepted(partyKind, accepted, own) {\n\tconst kinds = Array.isArray(accepted) ? accepted : []\n\tconst shapes = new Set(kinds.flatMap((kind) => (Array.isArray(kind?.identityShapes) ? kind.identityShapes : [])))\n\tif (shapes.size === 0) {\n\t\treturn kinds.some((kind) => kindCode(kind) === partyKind)\n\t}\n\tconst mine = (Array.isArray(own) ? own : []).find((kind) => kindCode(kind) === partyKind)?.identityShapes\n\tif (!Array.isArray(mine) || mine.length === 0) {\n\t\treturn true\n\t}\n\treturn mine.some((shape) => shapes.has(shape))\n}\n\n/**\n * Write a value at a dotted path, creating the objects on the way.\n *\n * @param {object} target The object written into.\n * @param {string} path The dotted path (`name.surname`).\n * @param {unknown} value The value.\n * @return {void}\n */\nfunction writePath(target, path, value) {\n\tconst keys = String(path).split('.').filter((key) => key !== '')\n\tlet node = target\n\tkeys.slice(0, -1).forEach((key) => {\n\t\tif (!node[key] || typeof node[key] !== 'object') {\n\t\t\tnode[key] = {}\n\t\t}\n\t\tnode = node[key]\n\t})\n\tif (keys.length > 0) {\n\t\tnode[keys[keys.length - 1]] = value\n\t}\n}\n\n/**\n * The record a new party is saved as, from the fields a host declares.\n *\n * Each field `{ key, path?, address? }` writes its trimmed value at `path`\n * (default `key`); a field with `address: { path, kind, type }` instead adds\n * `{ kind, type, value }` to the list at that path, the shape OpenRegister's\n * party model reads as the party's addresses. `compose` names the paths a\n * derived field joins with a space, skipping the empty ones\n * (`{ displayName: [\"name.givenNames\", \"name.namePrefix\", \"name.surname\"] }`).\n * A field of `type: \"integer\"` is saved as a number when it reads as one.\n * An empty value is left out.\n *\n * @param {{fields?: Array<object>, compose?: Record<string, Array<string>>}} create The declaration.\n * @param {Record<string, string>} values The values by field key.\n * @return {object} The record.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function newPartyRecord(create, values) {\n\tconst record = {}\n\tfor (const field of Array.isArray(create?.fields) ? create.fields : []) {\n\t\tconst value = String(values?.[field?.key] ?? '').trim()\n\t\tif (!field || !field.key || value === '') {\n\t\t\tcontinue\n\t\t}\n\t\tif (field.address && field.address.path) {\n\t\t\tconst list = readPath(record, field.address.path)\n\t\t\tconst entry = { kind: field.address.kind || 'correspondence', type: field.address.type || 'email', value }\n\t\t\twritePath(record, field.address.path, [...(Array.isArray(list) ? list : []), entry])\n\t\t\tcontinue\n\t\t}\n\t\twritePath(record, field.path || field.key, field.type === 'integer' && /^-?\\d+$/.test(value) ? Number(value) : value)\n\t}\n\tfor (const [target, paths] of Object.entries(create?.compose && typeof create.compose === 'object' ? create.compose : {})) {\n\t\tconst joined = (Array.isArray(paths) ? paths : [])\n\t\t\t.map((path) => String(readPath(record, path) ?? '').trim())\n\t\t\t.filter((part) => part !== '')\n\t\t\t.join(' ')\n\t\tif (joined !== '') {\n\t\t\twritePath(record, target, joined)\n\t\t}\n\t}\n\treturn record\n}\n\n/**\n * The uuid a create answered with: `id`, `uuid` or `@self.id`.\n *\n * @param {object} saved The saved object.\n * @return {string} The uuid, or ''.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function savedUuid(saved) {\n\treturn String(saved?.['@self']?.id || saved?.uuid || saved?.id || '')\n}\n"],"names":["t"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,GAAG,EAAE,EAAE;AACvD,CAAC,IAAI,UAAU,IAAI,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE;AAClF,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC;AACxB,EAAE;AACF,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC,CA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