@onecx/integration-interface 8.0.0-rc.1 → 8.0.0-rc.11

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 (152) hide show
  1. package/README.md +12 -7
  2. package/dist/index.cjs +1359 -0
  3. package/dist/index.mjs +1328 -0
  4. package/package.json +20 -15
  5. package/src/index.d.ts +17 -0
  6. package/src/index.js +61 -47
  7. package/src/index.js.map +1 -1
  8. package/src/lib/declarations.d.ts +5 -0
  9. package/src/lib/declarations.js +2 -0
  10. package/src/lib/declarations.js.map +1 -0
  11. package/src/lib/models/shell-capability.model.d.ts +11 -0
  12. package/src/lib/models/shell-capability.model.js +8 -0
  13. package/src/lib/models/shell-capability.model.js.map +1 -0
  14. package/src/lib/services/dynamic-translation.service.d.ts +87 -0
  15. package/src/lib/services/dynamic-translation.service.js +275 -0
  16. package/src/lib/services/dynamic-translation.service.js.map +1 -0
  17. package/src/lib/services/icon.service.d.ts +15 -0
  18. package/src/lib/services/icon.service.js +50 -0
  19. package/src/lib/services/icon.service.js.map +1 -0
  20. package/src/lib/services/image-repository.service.js +5 -9
  21. package/src/lib/services/image-repository.service.js.map +1 -1
  22. package/src/lib/services/notification.service.d.ts +7 -0
  23. package/src/lib/services/notification.service.js +15 -0
  24. package/src/lib/services/notification.service.js.map +1 -0
  25. package/src/lib/topics/configuration/v1/configuration.topic.js +2 -6
  26. package/src/lib/topics/configuration/v1/configuration.topic.js.map +1 -1
  27. package/src/lib/topics/current-location/v1/current-location.model.js +0 -2
  28. package/src/lib/topics/current-location/v1/current-location.topic.d.ts +1 -4
  29. package/src/lib/topics/current-location/v1/current-location.topic.js +2 -12
  30. package/src/lib/topics/current-location/v1/current-location.topic.js.map +1 -1
  31. package/src/lib/topics/current-mfe/v1/current-mfe.topic.js +2 -6
  32. package/src/lib/topics/current-mfe/v1/current-mfe.topic.js.map +1 -1
  33. package/src/lib/topics/current-mfe/v1/mfe-info.model.js +0 -2
  34. package/src/lib/topics/current-page/v1/current-page.topic.js +9 -11
  35. package/src/lib/topics/current-page/v1/current-page.topic.js.map +1 -1
  36. package/src/lib/topics/current-page/v1/page-info.model.js +0 -2
  37. package/src/lib/topics/current-theme/v1/current-theme.topic.js +2 -6
  38. package/src/lib/topics/current-theme/v1/current-theme.topic.js.map +1 -1
  39. package/src/lib/topics/current-theme/v1/theme-override.model.d.ts +8 -0
  40. package/src/lib/topics/current-theme/v1/theme-override.model.js +6 -0
  41. package/src/lib/topics/current-theme/v1/theme-override.model.js.map +1 -0
  42. package/src/lib/topics/current-theme/v1/theme.model.d.ts +2 -0
  43. package/src/lib/topics/current-theme/v1/theme.model.js +0 -2
  44. package/src/lib/topics/current-workspace/v1/current-workspace.topic.js +2 -6
  45. package/src/lib/topics/current-workspace/v1/current-workspace.topic.js.map +1 -1
  46. package/src/lib/topics/current-workspace/v1/endpoint.model.js +0 -2
  47. package/src/lib/topics/current-workspace/v1/mfe-portal-registration.model.js +0 -2
  48. package/src/lib/topics/current-workspace/v1/route.model.js +0 -2
  49. package/src/lib/topics/current-workspace/v1/workspace.model.js +0 -2
  50. package/src/lib/topics/dynamic-translations/v1/dynamic-translations.model.d.ts +15 -0
  51. package/src/lib/topics/dynamic-translations/v1/dynamic-translations.model.js +6 -0
  52. package/src/lib/topics/dynamic-translations/v1/dynamic-translations.model.js.map +1 -0
  53. package/src/lib/topics/dynamic-translations/v1/dynamic-translations.topic.d.ts +6 -0
  54. package/src/lib/topics/dynamic-translations/v1/dynamic-translations.topic.js +7 -0
  55. package/src/lib/topics/dynamic-translations/v1/dynamic-translations.topic.js.map +1 -0
  56. package/src/lib/topics/events/v1/event-type.js +2 -5
  57. package/src/lib/topics/events/v1/event-type.js.map +1 -1
  58. package/src/lib/topics/events/v1/events-topic.d.ts +1 -4
  59. package/src/lib/topics/events/v1/events-topic.js +2 -12
  60. package/src/lib/topics/events/v1/events-topic.js.map +1 -1
  61. package/src/lib/topics/events/v1/navigated-event-payload.js +0 -2
  62. package/src/lib/topics/events/v1/navigated-event-type.js +0 -2
  63. package/src/lib/topics/events/v1/topic-event-type.js +0 -2
  64. package/src/lib/topics/global-error/v1/global-error.topic.js +2 -6
  65. package/src/lib/topics/global-error/v1/global-error.topic.js.map +1 -1
  66. package/src/lib/topics/global-loading/v1/global-loading.topic.js +2 -6
  67. package/src/lib/topics/global-loading/v1/global-loading.topic.js.map +1 -1
  68. package/src/lib/topics/icons/v1/icon.model.d.ts +15 -0
  69. package/src/lib/topics/icons/v1/icon.model.js +1 -0
  70. package/src/lib/topics/icons/v1/icon.model.js.map +1 -0
  71. package/src/lib/topics/icons/v1/icon.topic.d.ts +5 -0
  72. package/src/lib/topics/icons/v1/icon.topic.js +7 -0
  73. package/src/lib/topics/icons/v1/icon.topic.js.map +1 -0
  74. package/src/lib/topics/image-repository/image-repository.model.js +0 -2
  75. package/src/lib/topics/image-repository/image-repository.topic.js +2 -6
  76. package/src/lib/topics/image-repository/image-repository.topic.js.map +1 -1
  77. package/src/lib/topics/is-authenticated/v1/isAuthenticated.topic.js +2 -6
  78. package/src/lib/topics/is-authenticated/v1/isAuthenticated.topic.js.map +1 -1
  79. package/src/lib/topics/message/v1/message.model.js +0 -2
  80. package/src/lib/topics/message/v1/message.topic.js +2 -6
  81. package/src/lib/topics/message/v1/message.topic.js.map +1 -1
  82. package/src/lib/topics/notification/v1/notification.model.d.ts +21 -0
  83. package/src/lib/topics/notification/v1/notification.model.js +1 -0
  84. package/src/lib/topics/notification/v1/notification.model.js.map +1 -0
  85. package/src/lib/topics/notification/v1/notification.topic.d.ts +5 -0
  86. package/src/lib/topics/notification/v1/notification.topic.js +7 -0
  87. package/src/lib/topics/notification/v1/notification.topic.js.map +1 -0
  88. package/src/lib/topics/parameters/v1/parameters.topic.d.ts +1 -4
  89. package/src/lib/topics/parameters/v1/parameters.topic.js +2 -12
  90. package/src/lib/topics/parameters/v1/parameters.topic.js.map +1 -1
  91. package/src/lib/topics/permissions/v1/permissions.topic.js +2 -6
  92. package/src/lib/topics/permissions/v1/permissions.topic.js.map +1 -1
  93. package/src/lib/topics/permissions-rpc/v1/permissions-rpc.model.js +0 -2
  94. package/src/lib/topics/permissions-rpc/v1/permissions-rpc.topic.js +2 -6
  95. package/src/lib/topics/permissions-rpc/v1/permissions-rpc.topic.js.map +1 -1
  96. package/src/lib/topics/remote-components/v1/remote-component.model.d.ts +1 -0
  97. package/src/lib/topics/remote-components/v1/remote-component.model.js +2 -5
  98. package/src/lib/topics/remote-components/v1/remote-component.model.js.map +1 -1
  99. package/src/lib/topics/remote-components/v1/remote-components-info.model.js +0 -2
  100. package/src/lib/topics/remote-components/v1/remote-components.topic.js +2 -6
  101. package/src/lib/topics/remote-components/v1/remote-components.topic.js.map +1 -1
  102. package/src/lib/topics/remote-components/v1/slot.model.js +0 -2
  103. package/src/lib/topics/resized-events/v1/resized-event-type.js +2 -5
  104. package/src/lib/topics/resized-events/v1/resized-event-type.js.map +1 -1
  105. package/src/lib/topics/resized-events/v1/resized-events.topic.d.ts +1 -5
  106. package/src/lib/topics/resized-events/v1/resized-events.topic.js +9 -14
  107. package/src/lib/topics/resized-events/v1/resized-events.topic.js.map +1 -1
  108. package/src/lib/topics/resized-events/v1/resized-update-requested-type.js +0 -2
  109. package/src/lib/topics/resized-events/v1/slot-groups-resized-type.js +0 -2
  110. package/src/lib/topics/resized-events/v1/slots-resized-type.js +0 -2
  111. package/src/lib/topics/resized-events/v1/topic-resized-event-type.js +0 -2
  112. package/src/lib/topics/user-profile/v1/user-profile.model.js +2 -5
  113. package/src/lib/topics/user-profile/v1/user-profile.model.js.map +1 -1
  114. package/src/lib/topics/user-profile/v1/user-profile.topic.js +2 -6
  115. package/src/lib/topics/user-profile/v1/user-profile.topic.js.map +1 -1
  116. package/src/lib/utils/configuration.utils.d.ts +41 -0
  117. package/src/lib/utils/configuration.utils.js +52 -0
  118. package/src/lib/utils/configuration.utils.js.map +1 -0
  119. package/src/lib/utils/logger.utils.d.ts +1 -0
  120. package/src/lib/utils/logger.utils.js +4 -0
  121. package/src/lib/utils/logger.utils.js.map +1 -0
  122. package/src/lib/utils/parameters.utils.d.ts +14 -0
  123. package/src/lib/utils/parameters.utils.js +15 -0
  124. package/src/lib/utils/parameters.utils.js.map +1 -0
  125. package/src/lib/utils/portal-message.utils.d.ts +54 -0
  126. package/src/lib/utils/portal-message.utils.js +49 -0
  127. package/src/lib/utils/portal-message.utils.js.map +1 -0
  128. package/src/lib/utils/shell-capability.utils.d.ts +21 -0
  129. package/src/lib/utils/shell-capability.utils.js +30 -0
  130. package/src/lib/utils/shell-capability.utils.js.map +1 -0
  131. package/src/lib/utils/user-language.utils.d.ts +30 -0
  132. package/src/lib/utils/user-language.utils.js +56 -0
  133. package/src/lib/utils/user-language.utils.js.map +1 -0
  134. package/src/lib/utils/workspace.utils.d.ts +76 -0
  135. package/src/lib/utils/workspace.utils.js +199 -0
  136. package/src/lib/utils/workspace.utils.js.map +1 -0
  137. package/src/version.d.ts +2 -0
  138. package/src/version.js +3 -0
  139. package/src/version.js.map +1 -0
  140. package/migrations/index.d.ts +0 -3
  141. package/migrations/index.js +0 -7
  142. package/migrations/index.js.map +0 -1
  143. package/migrations/v5/warn-for-events-publisher-navigated.d.ts +0 -2
  144. package/migrations/v5/warn-for-events-publisher-navigated.js +0 -33
  145. package/migrations/v5/warn-for-events-publisher-navigated.js.map +0 -1
  146. package/migrations/v5/warn-for-events-topic-navigated.d.ts +0 -2
  147. package/migrations/v5/warn-for-events-topic-navigated.js +0 -34
  148. package/migrations/v5/warn-for-events-topic-navigated.js.map +0 -1
  149. package/migrations/v6/migrate-onecx-to-v6.d.ts +0 -2
  150. package/migrations/v6/migrate-onecx-to-v6.js +0 -8
  151. package/migrations/v6/migrate-onecx-to-v6.js.map +0 -1
  152. package/migrations.json +0 -46
@@ -0,0 +1,54 @@
1
+ export type PortalMessage = {
2
+ summaryKey?: string;
3
+ summaryParameters?: object;
4
+ detailKey?: string;
5
+ detailParameters?: object;
6
+ id?: any;
7
+ key?: string;
8
+ life?: number;
9
+ sticky?: boolean;
10
+ closable?: boolean;
11
+ data?: any;
12
+ icon?: string;
13
+ contentStyleClass?: string;
14
+ styleClass?: string;
15
+ };
16
+ type TranslateFn = (key: string, params?: object) => Promise<string> | string | undefined;
17
+ /**
18
+ * Builds a portal message payload with resolved summary and detail.
19
+ *
20
+ * @param severity - Message severity.
21
+ * @param message - Original message payload.
22
+ * @param summary - Resolved summary string.
23
+ * @param detail - Resolved detail string.
24
+ * @returns Message payload ready for publish.
25
+ */
26
+ declare const buildPortalMessagePayload: (severity: string, message: PortalMessage, summary?: string, detail?: string) => PortalMessage & {
27
+ severity: string;
28
+ summary?: string;
29
+ detail?: string;
30
+ };
31
+ /**
32
+ * Resolves a translated string for the given message key.
33
+ *
34
+ * @param translate - Translation function to use.
35
+ * @param key - Translation key.
36
+ * @param params - Translation parameters.
37
+ * @returns Translated string or undefined when no key exists.
38
+ */
39
+ declare const resolveTranslation: (translate: TranslateFn | undefined, key?: string, params?: object) => Promise<string | undefined>;
40
+ /**
41
+ * Builds a translated message payload with resolved summary and detail.
42
+ *
43
+ * @param severity - Message severity.
44
+ * @param message - Original message payload.
45
+ * @param translate - Optional translation helper.
46
+ * @returns Message payload ready for publish.
47
+ */
48
+ declare const buildTranslatedMessage: (severity: string, message: PortalMessage, translate?: TranslateFn) => Promise<PortalMessage & {
49
+ severity: string;
50
+ summary?: string;
51
+ detail?: string;
52
+ }>;
53
+ export { buildPortalMessagePayload, buildTranslatedMessage, resolveTranslation };
54
+ export type { TranslateFn };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Builds a portal message payload with resolved summary and detail.
3
+ *
4
+ * @param severity - Message severity.
5
+ * @param message - Original message payload.
6
+ * @param summary - Resolved summary string.
7
+ * @param detail - Resolved detail string.
8
+ * @returns Message payload ready for publish.
9
+ */
10
+ const buildPortalMessagePayload = (severity, message, summary, detail) => ({
11
+ ...message,
12
+ severity,
13
+ summary,
14
+ detail,
15
+ });
16
+ /**
17
+ * Resolves a translated string for the given message key.
18
+ *
19
+ * @param translate - Translation function to use.
20
+ * @param key - Translation key.
21
+ * @param params - Translation parameters.
22
+ * @returns Translated string or undefined when no key exists.
23
+ */
24
+ const resolveTranslation = async (translate, key, params) => {
25
+ if (!key) {
26
+ return undefined;
27
+ }
28
+ if (!translate) {
29
+ return key;
30
+ }
31
+ return await translate(key, params);
32
+ };
33
+ /**
34
+ * Builds a translated message payload with resolved summary and detail.
35
+ *
36
+ * @param severity - Message severity.
37
+ * @param message - Original message payload.
38
+ * @param translate - Optional translation helper.
39
+ * @returns Message payload ready for publish.
40
+ */
41
+ const buildTranslatedMessage = async (severity, message, translate) => {
42
+ const [summary, detail] = await Promise.all([
43
+ resolveTranslation(translate, message.summaryKey, message.summaryParameters),
44
+ resolveTranslation(translate, message.detailKey, message.detailParameters),
45
+ ]);
46
+ return buildPortalMessagePayload(severity, message, summary, detail);
47
+ };
48
+ export { buildPortalMessagePayload, buildTranslatedMessage, resolveTranslation };
49
+ //# sourceMappingURL=portal-message.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-message.utils.js","sourceRoot":"","sources":["../../../../../../libs/integration-interface/src/lib/utils/portal-message.utils.ts"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,MAAM,yBAAyB,GAAG,CAChC,QAAgB,EAChB,OAAsB,EACtB,OAAgB,EAChB,MAAe,EAC0D,EAAE,CAAC,CAAC;IAC7E,GAAG,OAAO;IACV,QAAQ;IACR,OAAO;IACP,MAAM;CACP,CAAC,CAAA;AAEF;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,KAAK,EAC9B,SAAkC,EAClC,GAAY,EACZ,MAAe,EACc,EAAE;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,OAAO,MAAM,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;AACrC,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,sBAAsB,GAAG,KAAK,EAClC,QAAgB,EAChB,OAAsB,EACtB,SAAuB,EAC2D,EAAE;IACpF,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1C,kBAAkB,CAAC,SAAS,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC;QAC5E,kBAAkB,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC;KAC3E,CAAC,CAAA;IAEF,OAAO,yBAAyB,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AACtE,CAAC,CAAA;AAED,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { ShellCapability } from '../models/shell-capability.model';
2
+ /**
3
+ * Registers shell capabilities globally for the host application.
4
+ *
5
+ * @param capabilities - List of capabilities provided by the host shell.
6
+ */
7
+ declare const setShellCapabilities: (capabilities: ShellCapability[]) => void;
8
+ /**
9
+ * Returns currently registered shell capabilities.
10
+ *
11
+ * @returns Capability list or undefined.
12
+ */
13
+ declare const getShellCapabilities: () => ShellCapability[] | undefined;
14
+ /**
15
+ * Checks if the host application provides a capability.
16
+ *
17
+ * @param capability - Capability to verify.
18
+ * @returns True if capability is present.
19
+ */
20
+ declare const hasShellCapability: (capability: ShellCapability) => boolean;
21
+ export { getShellCapabilities, hasShellCapability, setShellCapabilities };
@@ -0,0 +1,30 @@
1
+ const SHELL_CAPABILITIES_KEY = 'onecx-shell-capabilities';
2
+ /**
3
+ * Registers shell capabilities globally for the host application.
4
+ *
5
+ * @param capabilities - List of capabilities provided by the host shell.
6
+ */
7
+ const setShellCapabilities = (capabilities) => {
8
+ ;
9
+ globalThis[SHELL_CAPABILITIES_KEY] =
10
+ capabilities;
11
+ };
12
+ /**
13
+ * Returns currently registered shell capabilities.
14
+ *
15
+ * @returns Capability list or undefined.
16
+ */
17
+ const getShellCapabilities = () => {
18
+ return globalThis[SHELL_CAPABILITIES_KEY];
19
+ };
20
+ /**
21
+ * Checks if the host application provides a capability.
22
+ *
23
+ * @param capability - Capability to verify.
24
+ * @returns True if capability is present.
25
+ */
26
+ const hasShellCapability = (capability) => {
27
+ return getShellCapabilities()?.includes(capability) ?? false;
28
+ };
29
+ export { getShellCapabilities, hasShellCapability, setShellCapabilities };
30
+ //# sourceMappingURL=shell-capability.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-capability.utils.js","sourceRoot":"","sources":["../../../../../../libs/integration-interface/src/lib/utils/shell-capability.utils.ts"],"names":[],"mappings":"AAEA,MAAM,sBAAsB,GAAG,0BAA0B,CAAA;AAEzD;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,CAAC,YAA+B,EAAQ,EAAE;IACrE,CAAC;IAAC,UAAmF,CAAC,sBAAsB,CAAC;QAC3G,YAAY,CAAA;AAChB,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,GAAkC,EAAE;IAC/D,OAAQ,UAAmF,CAAC,sBAAsB,CAAC,CAAA;AACrH,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,CAAC,UAA2B,EAAW,EAAE;IAClE,OAAO,oBAAoB,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,CAAA;AAC9D,CAAC,CAAA;AAED,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,CAAA"}
@@ -0,0 +1,30 @@
1
+ import type { UserProfile } from '../topics/user-profile/v1/user-profile.model';
2
+ type GetNormalizedBrowserLocales = () => string[];
3
+ type DetermineBrowserLanguage = () => string | undefined;
4
+ /**
5
+ * Determines the browser language using globalThis.
6
+ *
7
+ * @returns Browser language code or undefined when unavailable.
8
+ */
9
+ declare const determineBrowserLanguage: () => string | undefined;
10
+ /**
11
+ * Resolves legacy language settings from the profile.
12
+ *
13
+ * @param profile - User profile payload.
14
+ * @param defaultLang - Default language fallback.
15
+ * @param determineLang - Optional browser language resolver.
16
+ * @returns Resolved language code.
17
+ */
18
+ declare const resolveLegacyLanguage: (profile: UserProfile, defaultLang: string, determineLang?: DetermineBrowserLanguage) => string;
19
+ /**
20
+ * Resolves the preferred language from the profile settings.
21
+ *
22
+ * @param profile - User profile payload.
23
+ * @param defaultLang - Default language fallback.
24
+ * @param getNormalizedLocales - Function returning normalized browser locales.
25
+ * @param determineLang - Optional browser language resolver.
26
+ * @returns Resolved language code.
27
+ */
28
+ declare const resolveProfileLanguage: (profile: UserProfile, defaultLang: string, getNormalizedLocales: GetNormalizedBrowserLocales, determineLang?: DetermineBrowserLanguage) => string;
29
+ export { determineBrowserLanguage, resolveLegacyLanguage, resolveProfileLanguage };
30
+ export type { DetermineBrowserLanguage, GetNormalizedBrowserLocales };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Determines the browser language using globalThis.
3
+ *
4
+ * @returns Browser language code or undefined when unavailable.
5
+ */
6
+ const determineBrowserLanguage = () => {
7
+ const windowRef = globalThis.window;
8
+ if (!windowRef || !windowRef.navigator) {
9
+ return undefined;
10
+ }
11
+ let browserLang = windowRef.navigator.languages?.[0];
12
+ browserLang = browserLang || windowRef.navigator.language;
13
+ if (!browserLang) {
14
+ return undefined;
15
+ }
16
+ if (browserLang.includes('-')) {
17
+ browserLang = browserLang.split('-')[0];
18
+ }
19
+ if (browserLang.includes('_')) {
20
+ browserLang = browserLang.split('_')[0];
21
+ }
22
+ return browserLang;
23
+ };
24
+ /**
25
+ * Resolves legacy language settings from the profile.
26
+ *
27
+ * @param profile - User profile payload.
28
+ * @param defaultLang - Default language fallback.
29
+ * @param determineLang - Optional browser language resolver.
30
+ * @returns Resolved language code.
31
+ */
32
+ const resolveLegacyLanguage = (profile, defaultLang, determineLang = determineBrowserLanguage) => {
33
+ return profile.accountSettings?.localeAndTimeSettings?.locale ?? determineLang() ?? defaultLang;
34
+ };
35
+ /**
36
+ * Resolves the preferred language from the profile settings.
37
+ *
38
+ * @param profile - User profile payload.
39
+ * @param defaultLang - Default language fallback.
40
+ * @param getNormalizedLocales - Function returning normalized browser locales.
41
+ * @param determineLang - Optional browser language resolver.
42
+ * @returns Resolved language code.
43
+ */
44
+ const resolveProfileLanguage = (profile, defaultLang, getNormalizedLocales, determineLang = determineBrowserLanguage) => {
45
+ let locales = profile.settings?.locales;
46
+ if (!locales) {
47
+ return resolveLegacyLanguage(profile, defaultLang, determineLang);
48
+ }
49
+ if (locales.length === 0) {
50
+ locales = getNormalizedLocales();
51
+ }
52
+ const firstLang = locales.find((lang) => lang.length === 2);
53
+ return firstLang ?? defaultLang;
54
+ };
55
+ export { determineBrowserLanguage, resolveLegacyLanguage, resolveProfileLanguage };
56
+ //# sourceMappingURL=user-language.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-language.utils.js","sourceRoot":"","sources":["../../../../../../libs/integration-interface/src/lib/utils/user-language.utils.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,wBAAwB,GAAG,GAAuB,EAAE;IACxD,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAA;IACnC,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;QACvC,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,IAAI,WAAW,GAAuB,SAAS,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAA;IACxE,WAAW,GAAG,WAAW,IAAI,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAA;IAEzD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACzC,CAAC;IAED,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACzC,CAAC;IAED,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,qBAAqB,GAAG,CAC5B,OAAoB,EACpB,WAAmB,EACnB,gBAA0C,wBAAwB,EAC1D,EAAE;IACV,OAAO,OAAO,CAAC,eAAe,EAAE,qBAAqB,EAAE,MAAM,IAAI,aAAa,EAAE,IAAI,WAAW,CAAA;AACjG,CAAC,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,sBAAsB,GAAG,CAC7B,OAAoB,EACpB,WAAmB,EACnB,oBAAiD,EACjD,gBAA0C,wBAAwB,EAC1D,EAAE;IACV,IAAI,OAAO,GAAG,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAA;IAEvC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,qBAAqB,CAAC,OAAO,EAAE,WAAW,EAAE,aAAa,CAAC,CAAA;IACnE,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,GAAG,oBAAoB,EAAE,CAAA;IAClC,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAA;IAC3D,OAAO,SAAS,IAAI,WAAW,CAAA;AACjC,CAAC,CAAA;AAED,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,CAAA"}
@@ -0,0 +1,76 @@
1
+ import { Endpoint } from '../topics/current-workspace/v1/endpoint.model';
2
+ import { Route } from '../topics/current-workspace/v1/route.model';
3
+ import type { Workspace } from '../topics/current-workspace/v1/workspace.model';
4
+ type EndpointParameters = Record<string, unknown>;
5
+ type WarnHandler = (message: string) => void;
6
+ /**
7
+ * Builds the base URL from the workspace, with warnings on missing values.
8
+ *
9
+ * @param workspace - Workspace definition.
10
+ * @returns Base URL string or empty string if missing.
11
+ */
12
+ declare const constructBaseUrlFromWorkspace: (workspace: Workspace, warn: WarnHandler) => string;
13
+ /**
14
+ * Finds a route entry for a product/app pair.
15
+ *
16
+ * @param routes - Available route definitions.
17
+ * @param appId - Application identifier.
18
+ * @param productName - Product name identifier.
19
+ * @returns Matched route or undefined.
20
+ */
21
+ declare const filterRouteFromList: (routes: Array<Route> | undefined, appId: string, productName: string, warn: WarnHandler) => Route | undefined;
22
+ /**
23
+ * Resolves endpoint aliases to the final endpoint definition.
24
+ *
25
+ * @param endpointName - Endpoint name or alias.
26
+ * @param endpoints - Available endpoint definitions.
27
+ * @returns Resolved endpoint or undefined.
28
+ */
29
+ declare const dissolveEndpoint: (endpointName: string, endpoints: Array<Endpoint>) => Endpoint | undefined;
30
+ /**
31
+ * Normalizes parameter values into strings for URL interpolation.
32
+ *
33
+ * @param value - Parameter value to normalize.
34
+ * @returns Normalized string value.
35
+ */
36
+ declare const getStringFromUnknown: (value: unknown) => string;
37
+ /**
38
+ * Replaces path parameters with the provided endpoint parameter values.
39
+ *
40
+ * @param path - Endpoint path template.
41
+ * @param endpointParameters - Parameters to inject.
42
+ * @returns Path with parameters resolved, or empty string on failure.
43
+ */
44
+ declare const fillParamsForPath: (path: string, endpointParameters: EndpointParameters, warn: WarnHandler) => string;
45
+ /**
46
+ * Constructs a URL path for a concrete endpoint, resolving aliases and params.
47
+ *
48
+ * @param route - Route definition.
49
+ * @param endpointName - Endpoint name or alias.
50
+ * @param endpointParameters - Endpoint parameters for interpolation.
51
+ * @returns Endpoint URL path string.
52
+ */
53
+ declare const constructEndpointUrl: (route: Route, endpointName: string, endpointParameters: EndpointParameters | undefined, warn?: WarnHandler) => string;
54
+ /**
55
+ * Constructs a full route URL for a workspace, app, and optional endpoint.
56
+ *
57
+ * @param workspace - Workspace definition.
58
+ * @param appId - Application identifier.
59
+ * @param productName - Product name identifier.
60
+ * @param endpointName - Optional endpoint name.
61
+ * @param endpointParameters - Optional endpoint parameters.
62
+ * @returns Resolved route URL string.
63
+ */
64
+ declare const constructRouteUrl: (workspace: Workspace, appId: string, productName: string, endpointName?: string, endpointParameters?: EndpointParameters, warn?: WarnHandler) => string;
65
+ /**
66
+ * Checks whether a route or endpoint URL exists for the given identifiers.
67
+ *
68
+ * @param workspace - Workspace definition.
69
+ * @param productName - Product name identifier.
70
+ * @param appId - Application identifier.
71
+ * @param endpointName - Optional endpoint name to validate.
72
+ * @returns True if the URL exists.
73
+ */
74
+ declare const doesUrlExistForWorkspace: (workspace: Workspace, productName: string, appId: string, endpointName?: string, warn?: WarnHandler) => boolean;
75
+ export type { EndpointParameters };
76
+ export { constructBaseUrlFromWorkspace, constructEndpointUrl, constructRouteUrl, doesUrlExistForWorkspace, dissolveEndpoint, fillParamsForPath, filterRouteFromList, getStringFromUnknown, };
@@ -0,0 +1,199 @@
1
+ const aliasStart = '[[';
2
+ const aliasEnd = ']]';
3
+ const paramStart = '{';
4
+ const paramEnd = '}';
5
+ /**
6
+ * Joins base and path segments with a single slash.
7
+ *
8
+ * @param base - Base URL segment.
9
+ * @param path - Path segment to append.
10
+ * @returns Joined URL string.
11
+ */
12
+ const joinWithSlash = (base, path) => {
13
+ let normalizedBase = base;
14
+ let normalizedPath = path;
15
+ if (!normalizedBase.endsWith('/')) {
16
+ normalizedBase += '/';
17
+ }
18
+ if (normalizedPath.startsWith('/')) {
19
+ normalizedPath = normalizedPath.slice(1);
20
+ }
21
+ return normalizedBase + normalizedPath;
22
+ };
23
+ /**
24
+ * Builds the base URL from the workspace, with warnings on missing values.
25
+ *
26
+ * @param workspace - Workspace definition.
27
+ * @returns Base URL string or empty string if missing.
28
+ */
29
+ const constructBaseUrlFromWorkspace = (workspace, warn) => {
30
+ if (workspace.baseUrl === undefined) {
31
+ warn('There was no baseUrl for received workspace.');
32
+ return '';
33
+ }
34
+ return workspace.baseUrl;
35
+ };
36
+ /**
37
+ * Finds a route entry for a product/app pair.
38
+ *
39
+ * @param routes - Available route definitions.
40
+ * @param appId - Application identifier.
41
+ * @param productName - Product name identifier.
42
+ * @returns Matched route or undefined.
43
+ */
44
+ const filterRouteFromList = (routes, appId, productName, warn) => {
45
+ if (!routes) {
46
+ return undefined;
47
+ }
48
+ const productRoutes = routes.filter((route) => route.appId === appId && route.productName === productName);
49
+ if (productRoutes.length === 0) {
50
+ return undefined;
51
+ }
52
+ if (productRoutes.length > 1) {
53
+ warn('There were more than one route. First route has been used.');
54
+ }
55
+ return productRoutes[0];
56
+ };
57
+ /**
58
+ * Resolves endpoint aliases to the final endpoint definition.
59
+ *
60
+ * @param endpointName - Endpoint name or alias.
61
+ * @param endpoints - Available endpoint definitions.
62
+ * @returns Resolved endpoint or undefined.
63
+ */
64
+ const dissolveEndpoint = (endpointName, endpoints) => {
65
+ let endpoint = endpoints.find((ep) => ep.name === endpointName);
66
+ if (!endpoint) {
67
+ return undefined;
68
+ }
69
+ while (endpoint.path?.includes(aliasStart)) {
70
+ const path = endpoint.path;
71
+ const startIdx = path.indexOf(aliasStart) + aliasStart.length;
72
+ const endIdx = path.lastIndexOf(aliasEnd);
73
+ if (endIdx <= startIdx) {
74
+ return undefined;
75
+ }
76
+ const aliasName = path.substring(startIdx, endIdx);
77
+ endpoint = endpoints.find((ep) => ep.name === aliasName);
78
+ if (!endpoint) {
79
+ return undefined;
80
+ }
81
+ }
82
+ return endpoint;
83
+ };
84
+ /**
85
+ * Normalizes parameter values into strings for URL interpolation.
86
+ *
87
+ * @param value - Parameter value to normalize.
88
+ * @returns Normalized string value.
89
+ */
90
+ const getStringFromUnknown = (value) => {
91
+ if (value === null || value === undefined) {
92
+ return '';
93
+ }
94
+ if (typeof value === 'string') {
95
+ return value;
96
+ }
97
+ return String(value);
98
+ };
99
+ /**
100
+ * Replaces path parameters with the provided endpoint parameter values.
101
+ *
102
+ * @param path - Endpoint path template.
103
+ * @param endpointParameters - Parameters to inject.
104
+ * @returns Path with parameters resolved, or empty string on failure.
105
+ */
106
+ const fillParamsForPath = (path, endpointParameters, warn) => {
107
+ while (path.includes(paramStart)) {
108
+ const paramName = path.substring(path.indexOf(paramStart) + paramStart.length, path.indexOf(paramEnd));
109
+ const paramValue = getStringFromUnknown(endpointParameters[paramName]);
110
+ if (paramValue && paramValue.length > 0) {
111
+ path = path.replace(paramStart.concat(paramName).concat(paramEnd), paramValue);
112
+ }
113
+ else {
114
+ warn(`Searched param "${paramName}" was not found in given param list `);
115
+ return '';
116
+ }
117
+ }
118
+ return path;
119
+ };
120
+ /**
121
+ * Constructs a URL path for a concrete endpoint, resolving aliases and params.
122
+ *
123
+ * @param route - Route definition.
124
+ * @param endpointName - Endpoint name or alias.
125
+ * @param endpointParameters - Endpoint parameters for interpolation.
126
+ * @returns Endpoint URL path string.
127
+ */
128
+ const constructEndpointUrl = (route, endpointName, endpointParameters, warn = console.warn) => {
129
+ if (!route.endpoints) {
130
+ return '';
131
+ }
132
+ const finalEndpoint = dissolveEndpoint(endpointName, route.endpoints);
133
+ if (!finalEndpoint?.path) {
134
+ warn('No endpoint or endpoint.path could be found');
135
+ return '';
136
+ }
137
+ const paramsFilled = fillParamsForPath(finalEndpoint.path, endpointParameters ?? {}, warn);
138
+ if (paramsFilled === undefined) {
139
+ warn('Params could not be filled correctly');
140
+ return '';
141
+ }
142
+ return paramsFilled;
143
+ };
144
+ /**
145
+ * Constructs a full route URL for a workspace, app, and optional endpoint.
146
+ *
147
+ * @param workspace - Workspace definition.
148
+ * @param appId - Application identifier.
149
+ * @param productName - Product name identifier.
150
+ * @param endpointName - Optional endpoint name.
151
+ * @param endpointParameters - Optional endpoint parameters.
152
+ * @returns Resolved route URL string.
153
+ */
154
+ const constructRouteUrl = (workspace, appId, productName, endpointName, endpointParameters, warn = console.warn) => {
155
+ const route = filterRouteFromList(workspace.routes, appId, productName, warn);
156
+ let url = constructBaseUrlFromWorkspace(workspace, warn);
157
+ if (!route) {
158
+ warn(`No route.baseUrl could be found for given appId "${appId}" and productName "${productName}"`);
159
+ return url;
160
+ }
161
+ if (route.baseUrl?.length) {
162
+ url = route.baseUrl;
163
+ }
164
+ if (endpointName == undefined) {
165
+ return url;
166
+ }
167
+ const endpointPath = constructEndpointUrl(route, endpointName, endpointParameters, warn);
168
+ if (!endpointPath.length) {
169
+ return url;
170
+ }
171
+ url = joinWithSlash(url, endpointPath);
172
+ return url;
173
+ };
174
+ /**
175
+ * Checks whether a route or endpoint URL exists for the given identifiers.
176
+ *
177
+ * @param workspace - Workspace definition.
178
+ * @param productName - Product name identifier.
179
+ * @param appId - Application identifier.
180
+ * @param endpointName - Optional endpoint name to validate.
181
+ * @returns True if the URL exists.
182
+ */
183
+ const doesUrlExistForWorkspace = (workspace, productName, appId, endpointName, warn = console.warn) => {
184
+ const checkEndpoint = endpointName !== undefined && endpointName.length > 0;
185
+ if (!workspace.routes) {
186
+ return false;
187
+ }
188
+ const route = filterRouteFromList(workspace.routes, appId, productName, warn);
189
+ if (checkEndpoint) {
190
+ if (!route?.endpoints?.length) {
191
+ return false;
192
+ }
193
+ const endpoint = route.endpoints.find((ep) => ep.name === endpointName);
194
+ return !!endpoint?.path?.length;
195
+ }
196
+ return !!route?.baseUrl?.length;
197
+ };
198
+ export { constructBaseUrlFromWorkspace, constructEndpointUrl, constructRouteUrl, doesUrlExistForWorkspace, dissolveEndpoint, fillParamsForPath, filterRouteFromList, getStringFromUnknown, };
199
+ //# sourceMappingURL=workspace.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.utils.js","sourceRoot":"","sources":["../../../../../../libs/integration-interface/src/lib/utils/workspace.utils.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,GAAG,IAAI,CAAA;AACvB,MAAM,QAAQ,GAAG,IAAI,CAAA;AACrB,MAAM,UAAU,GAAG,GAAG,CAAA;AACtB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AAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,wBAAwB,GAAG,CAC/B,SAAoB,EACpB,WAAmB,EACnB,KAAa,EACb,YAAqB,EACrB,OAAoB,OAAO,CAAC,IAAI,EACvB,EAAE;IACX,MAAM,aAAa,GAAG,YAAY,KAAK,SAAS,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,CAAA;IAE3E,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;QACtB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,KAAK,GAAG,mBAAmB,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,CAAA;IAE7E,IAAI,aAAa,EAAE,CAAC;QAClB,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAA;QACd,CAAC;QAED,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,YAAY,CAAC,CAAA;QACvE,OAAO,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAA;IACjC,CAAC;IAED,OAAO,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAA;AACjC,CAAC,CAAA;AAGD,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,GACrB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const LIB_NAME = "@onecx/integration-interface";
2
+ export declare const LIB_VERSION = "8.0.0-rc.11";
package/src/version.js ADDED
@@ -0,0 +1,3 @@
1
+ export const LIB_NAME = '@onecx/integration-interface';
2
+ export const LIB_VERSION = '8.0.0-rc.11';
3
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../libs/integration-interface/src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,8BAA8B,CAAA;AACtD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './v6/migrate-onecx-to-v6';
2
- export * from './v5/warn-for-events-topic-navigated';
3
- export * from './v5/warn-for-events-publisher-navigated';
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./v6/migrate-onecx-to-v6"), exports);
5
- tslib_1.__exportStar(require("./v5/warn-for-events-topic-navigated"), exports);
6
- tslib_1.__exportStar(require("./v5/warn-for-events-publisher-navigated"), exports);
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/integration-interface/migrations/index.ts"],"names":[],"mappings":";;;AAAA,mEAAwC;AACxC,+EAAoD;AACpD,mFAAwD"}
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function warnForEventsPublisherNavigated(tree: Tree): Promise<void>;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = warnForEventsPublisherNavigated;
4
- const nx_migration_utils_1 = require("@onecx/nx-migration-utils");
5
- function argsMatchExpectedPayload(callExpression) {
6
- return callExpression.arguments.some((arg) => {
7
- const argText = arg.getText();
8
- return /type:\s*['"]navigated['"]/.test(argText);
9
- });
10
- }
11
- async function warnForEventsPublisherNavigated(tree) {
12
- const warningForPotentialMatches = '⚠️ EventsPublisher usages were detected. Please double-check if EventsPublisher is used for publishing navigation events and switch to CurrentLocationPublisher if so.';
13
- const warningForExactMatches = '⚠️ You are using EventsPublisher to publish navigation events. Please switch to using CurrentLocationPublisher.';
14
- const potentialMatches = (0, nx_migration_utils_1.detectMethodCallsInFiles)(tree, './src', 'publish', 'EventsPublisher');
15
- const exactMatches = new Map();
16
- const remainingPotentialMatches = new Map();
17
- potentialMatches.forEach((calls, file) => {
18
- const filteredCalls = calls.filter((call) => argsMatchExpectedPayload(call));
19
- if (filteredCalls.length > 0) {
20
- exactMatches.set(file, filteredCalls);
21
- }
22
- else {
23
- remainingPotentialMatches.set(file, calls);
24
- }
25
- });
26
- if (exactMatches.size > 0) {
27
- (0, nx_migration_utils_1.printWarnings)(warningForExactMatches, Array.from(exactMatches.keys()));
28
- }
29
- if (remainingPotentialMatches.size > 0) {
30
- (0, nx_migration_utils_1.printWarnings)(warningForPotentialMatches, Array.from(remainingPotentialMatches.keys()));
31
- }
32
- }
33
- //# sourceMappingURL=warn-for-events-publisher-navigated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"warn-for-events-publisher-navigated.js","sourceRoot":"","sources":["../../../../../libs/integration-interface/migrations/v5/warn-for-events-publisher-navigated.ts"],"names":[],"mappings":";;AAWA,kDA2BC;AArCD,kEAAmF;AAGnF,SAAS,wBAAwB,CAAC,cAA8B;IAC9D,OAAO,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;QAC3C,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAA;QAC7B,OAAO,2BAA2B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAClD,CAAC,CAAC,CAAA;AACJ,CAAC;AAEc,KAAK,UAAU,+BAA+B,CAAC,IAAU;IACtE,MAAM,0BAA0B,GAC9B,wKAAwK,CAAA;IAE1K,MAAM,sBAAsB,GAC1B,iHAAiH,CAAA;IAEnH,MAAM,gBAAgB,GAAG,IAAA,6CAAwB,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAA;IAE9F,MAAM,YAAY,GAAG,IAAI,GAAG,EAA4B,CAAA;IACxD,MAAM,yBAAyB,GAAG,IAAI,GAAG,EAA4B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