@conduction/nextcloud-vue 2.154.0 → 2.155.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 (64) hide show
  1. package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js.map +1 -1
  2. package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js +2 -2
  3. package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js.map +1 -1
  4. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue.js +1 -1
  5. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js +10 -5
  6. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js.map +1 -1
  7. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue3.js.map +1 -1
  8. package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue.js +1 -1
  9. package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue2.js.map +1 -1
  10. package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue3.js +2 -0
  11. package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue3.js.map +1 -1
  12. package/dist/esm/components/CnChoiceCards/CnChoiceCards.vue.js +1 -1
  13. package/dist/esm/components/CnChoiceCards/CnChoiceCards.vue2.js.map +1 -1
  14. package/dist/esm/components/CnChoiceCards/CnChoiceCards.vue3.js.map +1 -1
  15. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
  16. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
  17. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
  18. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
  19. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  20. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  21. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  22. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +9 -8
  23. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  24. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  25. package/dist/esm/components/CnMapWidget/CnMapWidget.vue.js +1 -1
  26. package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js +37 -0
  27. package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js.map +1 -1
  28. package/dist/esm/components/CnMapWidget/CnMapWidget.vue3.js +16 -7
  29. package/dist/esm/components/CnMapWidget/CnMapWidget.vue3.js.map +1 -1
  30. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  31. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +2 -1
  32. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  33. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +1 -1
  34. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  35. package/dist/esm/components/CnSavedViewMenuSettings/CnSavedViewMenuSettings.vue.js +1 -1
  36. package/dist/esm/components/CnSavedViewMenuSettings/CnSavedViewMenuSettings.vue2.js.map +1 -1
  37. package/dist/esm/components/CnSavedViewMenuSettings/CnSavedViewMenuSettings.vue3.js.map +1 -1
  38. package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue.js +1 -1
  39. package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue2.js.map +1 -1
  40. package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue3.js.map +1 -1
  41. package/dist/esm/library-style.js +1 -1
  42. package/dist/esm/nextcloud-vue.css +562 -349
  43. package/dist/esm/utils/groupSublines.js +30 -12
  44. package/dist/esm/utils/groupSublines.js.map +1 -1
  45. package/dist/nextcloud-vue.cjs.js +141 -68
  46. package/dist/nextcloud-vue.cjs.js.map +2 -2
  47. package/dist/nextcloud-vue.css +562 -349
  48. package/package.json +1 -1
  49. package/src/components/CnAppRoot/CnAppRoot.vue +2 -2
  50. package/src/components/CnAssignDialog/CnAssignDialog.vue +10 -5
  51. package/src/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue +2 -6
  52. package/src/components/CnChoiceCards/CnChoiceCards.vue +9 -0
  53. package/src/components/CnCountdownWidget/CnCountdownWidget.vue +3 -0
  54. package/src/components/CnDashboardPage/CnDashboardPage.vue +4 -1
  55. package/src/components/CnFactsWidget/CnFactsWidget.vue +9 -8
  56. package/src/components/CnMapWidget/CnMapWidget.vue +55 -1
  57. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +3 -2
  58. package/src/components/CnSavedViewMenuSettings/CnSavedViewMenuSettings.vue +3 -1
  59. package/src/components/CnUserSettingsDialog/CnUserSettingsDialog.vue +4 -1
  60. package/src/css/dialog.css +43 -0
  61. package/src/css/look-board-detail.css +42 -0
  62. package/src/css/look-board-index.css +8 -0
  63. package/src/css/look-board.css +96 -3
  64. package/src/utils/groupSublines.js +29 -11
@@ -53,15 +53,16 @@ async function memberCounts(query) {
53
53
  }
54
54
 
55
55
  /**
56
- * Descriptions by group id from the app's records. Read once per source.
56
+ * The app's records about groups, read once per source: the description by
57
+ * group id, and every group id a record names (with or without a text).
57
58
  *
58
59
  * @param {{register?: string, schema?: string, groupField?: string, textField?: string}|null} describe The source.
59
- * @return {Promise<Record<string, string>>} Descriptions by group id.
60
+ * @return {Promise<{texts: Record<string, string>, ids: Set<string>}>} What the records say.
60
61
  * @spec openspec/changes/assign-team-option-subline/specs/assign-dialog/spec.md
61
62
  */
62
- async function descriptions(describe) {
63
+ async function groupRecords(describe) {
63
64
  if (!describe || !describe.register || !describe.schema) {
64
- return {}
65
+ return { texts: {}, ids: new Set() }
65
66
  }
66
67
  const groupField = describe.groupField || 'ncGroupId';
67
68
  const textField = describe.textField || 'description';
@@ -69,24 +70,41 @@ async function descriptions(describe) {
69
70
  if (!descriptionCache.has(key)) {
70
71
  descriptionCache.set(key, fetchReferenceObjects({ register: describe.register, schema: describe.schema, limit: 500 })
71
72
  .then((rows) => {
72
- const out = {};
73
+ const texts = {};
74
+ const ids = new Set();
73
75
  for (const row of rows) {
74
76
  const gid = row && row[groupField];
75
- const text = row && typeof row[textField] === 'string' ? row[textField].trim() : '';
76
- if (gid && text && out[String(gid)] === undefined) {
77
- out[String(gid)] = text;
77
+ if (!gid) {
78
+ continue
79
+ }
80
+ ids.add(String(gid));
81
+ const text = typeof row[textField] === 'string' ? row[textField].trim() : '';
82
+ if (text && texts[String(gid)] === undefined) {
83
+ texts[String(gid)] = text;
78
84
  }
79
85
  }
80
- return out
86
+ return { texts, ids }
81
87
  })
82
88
  .catch(() => {
83
89
  descriptionCache.delete(key);
84
- return {}
90
+ return { texts: {}, ids: new Set() }
85
91
  }));
86
92
  }
87
93
  return descriptionCache.get(key)
88
94
  }
89
95
 
96
+ /**
97
+ * The groups an app keeps a record for (its teams), for a picker that lists
98
+ * only those. Empty when the app names no source or holds no record.
99
+ *
100
+ * @param {object|null} describe Where the app keeps its groups' records.
101
+ * @return {Promise<Set<string>>} The group ids.
102
+ * @spec openspec/changes/assign-team-option-subline/specs/assign-dialog/spec.md
103
+ */
104
+ async function describedGroupIds(describe) {
105
+ return (await groupRecords(describe)).ids
106
+ }
107
+
90
108
  /**
91
109
  * The line under each group: its member count and its description, joined by
92
110
  * " · ", either left out when unknown.
@@ -101,7 +119,7 @@ async function groupSublines(ids, query, describe = null) {
101
119
  if (!Array.isArray(ids) || ids.length === 0) {
102
120
  return {}
103
121
  }
104
- const [counts, texts] = await Promise.all([memberCounts(query), descriptions(describe)]);
122
+ const [counts, { texts }] = await Promise.all([memberCounts(query), groupRecords(describe)]);
105
123
  const out = {};
106
124
  for (const id of ids) {
107
125
  const parts = [];
@@ -116,5 +134,5 @@ async function groupSublines(ids, query, describe = null) {
116
134
  return out
117
135
  }
118
136
 
119
- export { groupSublines };
137
+ export { describedGroupIds, groupSublines };
120
138
  //# sourceMappingURL=groupSublines.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"groupSublines.js","sources":["../../../src/utils/groupSublines.js"],"sourcesContent":["/**\n * The line under a team in a picker: how many members it has and what it is\n * for (\"6 leden · bezwaar, beroep en Woo-advies\", board DqOverdragen).\n *\n * The count comes from Nextcloud's group details; that endpoint answers\n * administrators and group admins only, so for anyone else the count is left\n * out rather than guessed. Nextcloud keeps no description for a group, so the\n * text comes from an app's own records when the app names them (`describe`:\n * `{ register, schema, groupField?, textField? }`, by default the record's\n * `ncGroupId` and `description`).\n *\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * @module utils/groupSublines\n * @spec openspec/changes/assign-team-option-subline/specs/assign-dialog/spec.md\n */\n\nimport axios from '@nextcloud/axios'\nimport { translatePlural as n } from '@nextcloud/l10n'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { fetchReferenceObjects } from './boardReferenceColumns.js'\n\nconst descriptionCache = new Map()\n\n/**\n * Member counts by group id for the groups a search finds. Fails soft to `{}`.\n *\n * @param {string} query The search term.\n * @return {Promise<Record<string, number>>} Counts by group id.\n * @spec openspec/changes/assign-team-option-subline/specs/assign-dialog/spec.md\n */\nasync function memberCounts(query) {\n\ttry {\n\t\tconst response = await axios.get(generateOcsUrl('cloud/groups/details'), {\n\t\t\theaders: { 'OCS-APIRequest': 'true', Accept: 'application/json' },\n\t\t\tparams: { search: query || '', limit: 50 },\n\t\t})\n\t\tconst data = response && response.data && response.data.ocs ? response.data.ocs.data : (response && response.data)\n\t\tconst groups = data && Array.isArray(data.groups) ? data.groups : []\n\t\tconst out = {}\n\t\tfor (const group of groups) {\n\t\t\tconst count = Number(group && group.usercount)\n\t\t\tif (group && group.id && Number.isFinite(count)) {\n\t\t\t\tout[String(group.id)] = count\n\t\t\t}\n\t\t}\n\t\treturn out\n\t} catch {\n\t\treturn {}\n\t}\n}\n\n/**\n * Descriptions by group id from the app's records. Read once per source.\n *\n * @param {{register?: string, schema?: string, groupField?: string, textField?: string}|null} describe The source.\n * @return {Promise<Record<string, string>>} Descriptions by group id.\n * @spec openspec/changes/assign-team-option-subline/specs/assign-dialog/spec.md\n */\nasync function descriptions(describe) {\n\tif (!describe || !describe.register || !describe.schema) {\n\t\treturn {}\n\t}\n\tconst groupField = describe.groupField || 'ncGroupId'\n\tconst textField = describe.textField || 'description'\n\tconst key = [describe.register, describe.schema, groupField, textField].join('/')\n\tif (!descriptionCache.has(key)) {\n\t\tdescriptionCache.set(key, fetchReferenceObjects({ register: describe.register, schema: describe.schema, limit: 500 })\n\t\t\t.then((rows) => {\n\t\t\t\tconst out = {}\n\t\t\t\tfor (const row of rows) {\n\t\t\t\t\tconst gid = row && row[groupField]\n\t\t\t\t\tconst text = row && typeof row[textField] === 'string' ? row[textField].trim() : ''\n\t\t\t\t\tif (gid && text && out[String(gid)] === undefined) {\n\t\t\t\t\t\tout[String(gid)] = text\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn out\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\tdescriptionCache.delete(key)\n\t\t\t\treturn {}\n\t\t\t}))\n\t}\n\treturn descriptionCache.get(key)\n}\n\n/**\n * The line under each group: its member count and its description, joined by\n * \" · \", either left out when unknown.\n *\n * @param {string[]} ids The group ids to describe.\n * @param {string} query The search the groups came from.\n * @param {object|null} [describe] Where the app keeps a group's description.\n * @return {Promise<Record<string, string>>} The line by group id ('' when nothing is known).\n * @spec openspec/changes/assign-team-option-subline/specs/assign-dialog/spec.md\n */\nexport async function groupSublines(ids, query, describe = null) {\n\tif (!Array.isArray(ids) || ids.length === 0) {\n\t\treturn {}\n\t}\n\tconst [counts, texts] = await Promise.all([memberCounts(query), descriptions(describe)])\n\tconst out = {}\n\tfor (const id of ids) {\n\t\tconst parts = []\n\t\tif (counts[id] !== undefined) {\n\t\t\tparts.push(n('nextcloud-vue', '{count} member', '{count} members', counts[id], { count: counts[id] }))\n\t\t}\n\t\tif (texts[id]) {\n\t\t\tparts.push(texts[id])\n\t\t}\n\t\tout[id] = parts.join(' · ')\n\t}\n\treturn out\n}\n\n/**\n * Forget the cached descriptions (tests, or after the source changed).\n *\n * @return {void}\n */\nexport function clearGroupSublineCache() {\n\tdescriptionCache.clear()\n}\n"],"names":["axios","n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA,MAAM,gBAAgB,GAAG,IAAI,GAAG,GAAE;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY,CAAC,KAAK,EAAE;AACnC,CAAC,IAAI;AACL,EAAE,MAAM,QAAQ,GAAG,MAAMA,cAAK,CAAC,GAAG,CAAC,cAAc,CAAC,sBAAsB,CAAC,EAAE;AAC3E,GAAG,OAAO,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE;AACpE,GAAG,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;AAC7C,GAAG,EAAC;AACJ,EAAE,MAAM,IAAI,GAAG,QAAQ,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAC;AACpH,EAAE,MAAM,MAAM,GAAG,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,GAAE;AACtE,EAAE,MAAM,GAAG,GAAG,GAAE;AAChB,EAAE,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;AAC9B,GAAG,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,KAAK,CAAC,SAA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,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC;AACzG,GAAG;AACH,EAAE,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE;AACjB,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAC;AACxB,GAAG;AACH,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAC;AAC7B,EAAE;AACF,CAAC,OAAO,GAAG;AACX;;;;"}
1
+ {"version":3,"file":"groupSublines.js","sources":["../../../src/utils/groupSublines.js"],"sourcesContent":["/**\n * The line under a team in a picker: how many members it has and what it is\n * for (\"6 leden · bezwaar, beroep en Woo-advies\", board DqOverdragen).\n *\n * The count comes from Nextcloud's group details; that endpoint answers\n * administrators and group admins only, so for anyone else the count is left\n * out rather than guessed. Nextcloud keeps no description for a group, so the\n * text comes from an app's own records when the app names them (`describe`:\n * `{ register, schema, groupField?, textField? }`, by default the record's\n * `ncGroupId` and `description`).\n *\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * @module utils/groupSublines\n * @spec openspec/changes/assign-team-option-subline/specs/assign-dialog/spec.md\n */\n\nimport axios from '@nextcloud/axios'\nimport { translatePlural as n } from '@nextcloud/l10n'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { fetchReferenceObjects } from './boardReferenceColumns.js'\n\nconst descriptionCache = new Map()\n\n/**\n * Member counts by group id for the groups a search finds. Fails soft to `{}`.\n *\n * @param {string} query The search term.\n * @return {Promise<Record<string, number>>} Counts by group id.\n * @spec openspec/changes/assign-team-option-subline/specs/assign-dialog/spec.md\n */\nasync function memberCounts(query) {\n\ttry {\n\t\tconst response = await axios.get(generateOcsUrl('cloud/groups/details'), {\n\t\t\theaders: { 'OCS-APIRequest': 'true', Accept: 'application/json' },\n\t\t\tparams: { search: query || '', limit: 50 },\n\t\t})\n\t\tconst data = response && response.data && response.data.ocs ? response.data.ocs.data : (response && response.data)\n\t\tconst groups = data && Array.isArray(data.groups) ? data.groups : []\n\t\tconst out = {}\n\t\tfor (const group of groups) {\n\t\t\tconst count = Number(group && group.usercount)\n\t\t\tif (group && group.id && Number.isFinite(count)) {\n\t\t\t\tout[String(group.id)] = count\n\t\t\t}\n\t\t}\n\t\treturn out\n\t} catch {\n\t\treturn {}\n\t}\n}\n\n/**\n * The app's records about groups, read once per source: the description by\n * group id, and every group id a record names (with or without a text).\n *\n * @param {{register?: string, schema?: string, groupField?: string, textField?: string}|null} describe The source.\n * @return {Promise<{texts: Record<string, string>, ids: Set<string>}>} What the records say.\n * @spec openspec/changes/assign-team-option-subline/specs/assign-dialog/spec.md\n */\nasync function groupRecords(describe) {\n\tif (!describe || !describe.register || !describe.schema) {\n\t\treturn { texts: {}, ids: new Set() }\n\t}\n\tconst groupField = describe.groupField || 'ncGroupId'\n\tconst textField = describe.textField || 'description'\n\tconst key = [describe.register, describe.schema, groupField, textField].join('/')\n\tif (!descriptionCache.has(key)) {\n\t\tdescriptionCache.set(key, fetchReferenceObjects({ register: describe.register, schema: describe.schema, limit: 500 })\n\t\t\t.then((rows) => {\n\t\t\t\tconst texts = {}\n\t\t\t\tconst ids = new Set()\n\t\t\t\tfor (const row of rows) {\n\t\t\t\t\tconst gid = row && row[groupField]\n\t\t\t\t\tif (!gid) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tids.add(String(gid))\n\t\t\t\t\tconst text = typeof row[textField] === 'string' ? row[textField].trim() : ''\n\t\t\t\t\tif (text && texts[String(gid)] === undefined) {\n\t\t\t\t\t\ttexts[String(gid)] = text\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn { texts, ids }\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\tdescriptionCache.delete(key)\n\t\t\t\treturn { texts: {}, ids: new Set() }\n\t\t\t}))\n\t}\n\treturn descriptionCache.get(key)\n}\n\n/**\n * The groups an app keeps a record for (its teams), for a picker that lists\n * only those. Empty when the app names no source or holds no record.\n *\n * @param {object|null} describe Where the app keeps its groups' records.\n * @return {Promise<Set<string>>} The group ids.\n * @spec openspec/changes/assign-team-option-subline/specs/assign-dialog/spec.md\n */\nexport async function describedGroupIds(describe) {\n\treturn (await groupRecords(describe)).ids\n}\n\n/**\n * The line under each group: its member count and its description, joined by\n * \" · \", either left out when unknown.\n *\n * @param {string[]} ids The group ids to describe.\n * @param {string} query The search the groups came from.\n * @param {object|null} [describe] Where the app keeps a group's description.\n * @return {Promise<Record<string, string>>} The line by group id ('' when nothing is known).\n * @spec openspec/changes/assign-team-option-subline/specs/assign-dialog/spec.md\n */\nexport async function groupSublines(ids, query, describe = null) {\n\tif (!Array.isArray(ids) || ids.length === 0) {\n\t\treturn {}\n\t}\n\tconst [counts, { texts }] = await Promise.all([memberCounts(query), groupRecords(describe)])\n\tconst out = {}\n\tfor (const id of ids) {\n\t\tconst parts = []\n\t\tif (counts[id] !== undefined) {\n\t\t\tparts.push(n('nextcloud-vue', '{count} member', '{count} members', counts[id], { count: counts[id] }))\n\t\t}\n\t\tif (texts[id]) {\n\t\t\tparts.push(texts[id])\n\t\t}\n\t\tout[id] = parts.join(' · ')\n\t}\n\treturn out\n}\n\n/**\n * Forget the cached descriptions (tests, or after the source changed).\n *\n * @return {void}\n */\nexport function clearGroupSublineCache() {\n\tdescriptionCache.clear()\n}\n"],"names":["axios","n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA,MAAM,gBAAgB,GAAG,IAAI,GAAG,GAAE;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY,CAAC,KAAK,EAAE;AACnC,CAAC,IAAI;AACL,EAAE,MAAM,QAAQ,GAAG,MAAMA,cAAK,CAAC,GAAG,C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