@open-pioneer/runtime 4.8.0-dev.20260910101405 → 4.8.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 (34) hide show
  1. package/CHANGELOG.md +174 -174
  2. package/CustomElement.js.map +1 -1
  3. package/DeclaredService.js.map +1 -1
  4. package/Service.js.map +1 -1
  5. package/_virtual/source-info.js.map +1 -1
  6. package/app/AppInstance.js.map +1 -1
  7. package/app/gatherConfig.js.map +1 -1
  8. package/app/logErrors.js.map +1 -1
  9. package/builtin-services/ApiServiceImpl.js.map +1 -1
  10. package/builtin-services/ApplicationContextImpl.js.map +1 -1
  11. package/builtin-services/ApplicationLifecycleEventService.js.map +1 -1
  12. package/builtin-services/LocaleServiceImpl.js.map +1 -1
  13. package/builtin-services/NumberParserServiceImpl.js.map +1 -1
  14. package/builtin-services/ThemeServiceImpl.js.map +1 -1
  15. package/builtin-services/index.js.map +1 -1
  16. package/dom/index.js.map +1 -1
  17. package/errors.js.map +1 -1
  18. package/i18n/AppIntl.js.map +1 -1
  19. package/i18n/PackageIntl.js.map +1 -1
  20. package/i18n/intl-locale.js.map +1 -1
  21. package/i18n/pick.js.map +1 -1
  22. package/metadata/ObservableBox.js.map +1 -1
  23. package/package.json +7 -7
  24. package/react-integration/ChakraProvider.js.map +1 -1
  25. package/react-integration/ErrorScreen.js.map +1 -1
  26. package/react-integration/PackageContext.js.map +1 -1
  27. package/react-integration/ReactIntegration.js.map +1 -1
  28. package/react-integration/hooks.js.map +1 -1
  29. package/service-layer/InterfaceSpec.js.map +1 -1
  30. package/service-layer/PackageRepr.js.map +1 -1
  31. package/service-layer/ServiceLayer.js.map +1 -1
  32. package/service-layer/ServiceLookup.js.map +1 -1
  33. package/service-layer/ServiceRepr.js.map +1 -1
  34. package/service-layer/verifyDependencies.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"verifyDependencies.js","sources":["verifyDependencies.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Error } from \"@open-pioneer/core\";\nimport { ErrorId } from \"../errors\";\nimport { InterfaceSpec, ReferenceSpec, renderInterfaceSpec } from \"./InterfaceSpec\";\nimport {\n AmbiguousChoice,\n ReadonlyServiceLookup,\n renderAmbiguousServiceChoices,\n ServiceLookup\n} from \"./ServiceLookup\";\nimport { ServiceRepr } from \"./ServiceRepr\";\n\nexport interface DependencyOptions {\n /**\n * All services known to the service layer.\n */\n services?: readonly ServiceRepr[];\n\n /**\n * References that must be satisfied by the services.\n */\n requiredReferences?: readonly RequiredReference[];\n}\n\nexport type RequiredReference = UIDependency | FrameworkDependency;\n\nexport type UIDependency = { type: \"ui\"; packageName: string } & ReferenceSpec;\n\nexport type FrameworkDependency = { type: \"framework\" } & ReferenceSpec;\n\nexport type ComputedServiceDependencies = Record<string, ServiceRepr | ServiceRepr[]>;\n\nexport interface VerifyDependenciesResult {\n /**\n * Precomputed dependencies for every service.\n *\n * Key: service id.\n */\n serviceDependencies: Map<string, ComputedServiceDependencies>;\n\n /**\n * Index structure mapping interface names to service instances.\n */\n serviceLookup: ReadonlyServiceLookup;\n}\n\n/**\n * Visits all services and ensures that their dependencies can be satisfied by each other without a cycle.\n *\n * Throws an error if a cycle is detected or if a required service is never implemented.\n *\n * @returns an object containing the service index and precomputed dependency information\n */\nexport function verifyDependencies(options: DependencyOptions): VerifyDependenciesResult {\n const verifier = new Verifier(options);\n verifier.verify();\n return {\n serviceLookup: verifier.getServiceLookup(),\n serviceDependencies: verifier.getComputedDependencies()\n };\n}\n\ninterface GraphItem {\n state: ItemState;\n service: ServiceRepr;\n dependencies: ComputedServiceDependencies;\n}\n\ntype ItemState = \"not-visited\" | \"pending\" | \"done\";\n\n/** The reason why a graph node is being visited. */\ntype ItemVisitReason = \"root\" | InterfaceReference;\n\ntype InterfaceReference =\n | {\n type: \"framework-reference\";\n value: ReferenceSpec;\n }\n | {\n type: \"ui-reference\";\n packageName: string;\n value: ReferenceSpec;\n }\n | {\n type: \"service-reference\";\n service: ServiceRepr;\n referenceName: string;\n value: ReferenceSpec;\n };\n\nclass Verifier {\n #requiredReferences: readonly RequiredReference[];\n #items: GraphItem[];\n #serviceLookup = new ServiceLookup();\n #serviceToGraphItem = new Map<ServiceRepr, GraphItem>();\n\n // Stack of visited nodes\n #stack: [item: GraphItem, reason: ItemVisitReason][] = [];\n\n constructor(options: DependencyOptions) {\n this.#requiredReferences = options.requiredReferences ?? [];\n const services = options.services ?? [];\n const items = (this.#items = services.map<GraphItem>((service) => {\n return {\n service: service,\n state: \"not-visited\",\n dependencies: {}\n };\n }));\n\n for (const item of items) {\n for (const spec of item.service.interfaces) {\n this.#registerService(item, spec);\n }\n }\n }\n\n verify() {\n for (const ref of this.#requiredReferences) {\n let interfaceRef: InterfaceReference;\n switch (ref.type) {\n case \"framework\":\n interfaceRef = { type: \"framework-reference\", value: ref };\n break;\n case \"ui\":\n interfaceRef = {\n type: \"ui-reference\",\n packageName: ref.packageName,\n value: ref\n };\n break;\n }\n this.#visitReference(interfaceRef);\n }\n for (const item of this.#items) {\n this.#visitItem(item, \"root\");\n }\n }\n\n getServiceLookup() {\n return this.#serviceLookup;\n }\n\n getComputedDependencies() {\n return new Map(\n this.#items.map<[string, ComputedServiceDependencies]>((item) => {\n return [item.service.id, item.dependencies];\n })\n );\n }\n\n #visitItem(item: GraphItem, reason: ItemVisitReason) {\n const stack = this.#stack;\n const state = item.state;\n if (state === \"done\") {\n return; // Item is initialized, cycle impossible\n }\n if (state === \"pending\") {\n this.#throwCycleError(item, reason);\n }\n\n stack.push([item, reason]);\n item.state = \"pending\";\n for (const dep of item.service.dependencies) {\n item.dependencies[dep.referenceName] = this.#visitReference({\n type: \"service-reference\",\n service: item.service,\n referenceName: dep.referenceName,\n value: dep\n });\n }\n item.state = \"done\";\n stack.pop();\n }\n\n #visitReference(ref: InterfaceReference) {\n const itemOrItems = this.#findServices(ref);\n if (Array.isArray(itemOrItems)) {\n for (const child of itemOrItems) {\n this.#visitItem(child, ref);\n }\n return itemOrItems.map((item) => item.service);\n } else {\n this.#visitItem(itemOrItems, ref);\n return itemOrItems.service;\n }\n }\n\n #registerService(item: GraphItem, spec: InterfaceSpec) {\n this.#serviceLookup.register(item.service, spec);\n this.#serviceToGraphItem.set(item.service, item);\n }\n\n #findServices(ref: InterfaceReference): GraphItem | GraphItem[] {\n const spec = ref.value;\n const lookupResult = this.#serviceLookup.lookup(spec);\n switch (lookupResult.type) {\n case \"unimplemented\": {\n const message = unimplementedInterfaceMessage(ref);\n throw new Error(ErrorId.INTERFACE_NOT_FOUND, message);\n }\n case \"ambiguous\": {\n const message = ambiguousInterfaceMessage(ref, lookupResult.choices);\n throw new Error(ErrorId.AMBIGUOUS_DEPENDENCY, message);\n }\n }\n\n const value = lookupResult.value;\n if (Array.isArray(value)) {\n return value.map((service) => this.#getGraphItem(service));\n } else {\n return this.#getGraphItem(value);\n }\n }\n\n #getGraphItem(service: ServiceRepr): GraphItem {\n const graphItem = this.#serviceToGraphItem.get(service);\n if (!graphItem || graphItem.service !== service) {\n throw new Error(\n ErrorId.INTERNAL,\n `Failed to find matching graph item for service '${service.id}'.`\n );\n }\n return graphItem;\n }\n\n #throwCycleError(item: GraphItem, reason: ItemVisitReason) {\n // Find the item on the stack (it must be there because we detected a cycle).\n const stack = this.#stack;\n const ownIndex = stack.findIndex((entry) => entry[0] === item);\n if (ownIndex === -1) {\n throw new Error(ErrorId.INTERNAL, \"Failed to find cycle participant on the stack.\");\n }\n\n const cycleInfo = stack\n .slice(ownIndex)\n .concat([[item, reason]])\n .map<string>((entry, index) => {\n const item = entry[0];\n const reason = index === 0 ? \"root\" : entry[1]; // info before the cycle does not matter\n\n let message = `'${item.service.id}'`;\n if (typeof reason === \"object\") {\n message += ` (${referenceDetail(reason)})`;\n }\n return message;\n });\n throw new Error(\n ErrorId.DEPENDENCY_CYCLE,\n `Detected dependency cycle: ${cycleInfo.join(\" => \")}.`\n );\n }\n}\n\nfunction unimplementedInterfaceMessage(ref: InterfaceReference): string {\n const interfaceText = renderInterfaceSpec(ref.value);\n switch (ref.type) {\n case \"service-reference\":\n return `Service '${ref.service.id}' requires an unimplemented interface ${interfaceText} as dependency '${ref.referenceName}'.`;\n case \"ui-reference\":\n return `The UI of package '${ref.packageName}' requires an unimplemented interface ${interfaceText}.`;\n case \"framework-reference\":\n return `The framework requires an unimplemented interface ${interfaceText}.`;\n }\n}\n\nfunction ambiguousInterfaceMessage(ref: InterfaceReference, choices: AmbiguousChoice[]): string {\n const interfaceText = renderInterfaceSpec(ref.value);\n const serviceChoices = renderAmbiguousServiceChoices(choices);\n\n let message = \"\";\n switch (ref.type) {\n case \"service-reference\":\n message = `Service '${ref.service.id}' requires the ambiguous interface ${interfaceText} as dependency '${ref.referenceName}'.`;\n break;\n case \"ui-reference\":\n message = `The UI of package '${ref.packageName}' requires the ambiguous interface ${interfaceText}.`;\n break;\n case \"framework-reference\":\n message = `The framework requires the ambiguous interface ${interfaceText}.`;\n break;\n }\n message += ` Possible choices are ${serviceChoices}.`;\n return message;\n}\n\nfunction referenceDetail(reason: InterfaceReference) {\n switch (reason.type) {\n case \"service-reference\":\n return `'${reason.referenceName}' providing '${reason.value.interfaceName}'`;\n case \"ui-reference\":\n return `UI of package '${reason.packageName}' requiring '${reason.value.interfaceName}'`;\n case \"framework-reference\":\n return `framework requiring '${reason.value.interfaceName}'`;\n }\n}\n"],"names":["item","reason"],"mappings":";;;;;AAuDO,SAAS,mBAAmB,OAAA,EAAsD;AACrF,EAAA,MAAM,QAAA,GAAW,IAAI,QAAA,CAAS,OAAO,CAAA;AACrC,EAAA,QAAA,CAAS,MAAA,EAAO;AAChB,EAAA,OAAO;AAAA,IACH,aAAA,EAAe,SAAS,gBAAA,EAAiB;AAAA,IACzC,mBAAA,EAAqB,SAAS,uBAAA;AAAwB,GAC1D;AACJ;AA8BA,MAAM,QAAA,CAAS;AAAA,EACX,mBAAA;AAA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AQ,IAAI,IAAA;AAAM,IACd,KAAK,mBAAA;AACD,MAAA,OAAA,GAAU,CAAA,SAAA,EAAY,IAAI,OAAA,CAAQ,EAAE,sCAAsC,aAAa,CAAA,gBAAA,EAAmB,IAAI,aAAa,CAAA,EAAA,CAAA;AAC3H,MAAA;AAAA,IACJ,KAAK,cAAA;AACD,MAAA,OAAA,GAAU,CAAA,mBAAA,EAAsB,GAAA,CAAI,WAAW,CAAA,mCAAA,EAAsC,aAAa,CAAA,CAAA,CAAA;AAClG,MAAA;AAAA,IACJ,KAAK,qBAAA;AACD,MAAA,OAAA,GAAU,kDAAkD,aAAa,CAAA,CAAA,CAAA;AACzE,MAAA;AAAA;AAER,EAAA,OAAA,IAAW,yBAAyB,cAAc,CAAA,CAAA,CAAA;AAClD,EAAA,OAAO,OAAA;AACX;AAEA,SAAS,gBAAgB,MAAA,EAA4B;AACjD,EAAA,QAAQ,OAAO,IAAA;AAAM,IACjB,KAAK,mBAAA;AACD,MAAA,OAAO,IAAI,MAAA,CAAO,aAAa,CAAA,aAAA,EAAgB,MAAA,CAAO,MAAM,aAAa,CAAA,CAAA,CAAA;AAAA,IAC7E,KAAK,cAAA;AACD,MAAA,OAAO,kBAAkB,MAAA,CAAO,WAAW,CAAA,aAAA,EAAgB,MAAA,CAAO,MAAM,aAAa,CAAA,CAAA,CAAA;AAAA,IACzF,KAAK,qBAAA;AACD,MAAA,OAAO,CAAA,qBAAA,EAAwB,MAAA,CAAO,KAAA,CAAM,aAAa,CAAA,CAAA,CAAA;AAAA;AAErE;;;;"}
1
+ {"version":3,"file":"verifyDependencies.js","sources":["verifyDependencies.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023-2025 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Error } from \"@open-pioneer/core\";\nimport { ErrorId } from \"../errors\";\nimport { InterfaceSpec, ReferenceSpec, renderInterfaceSpec } from \"./InterfaceSpec\";\nimport {\n AmbiguousChoice,\n ReadonlyServiceLookup,\n renderAmbiguousServiceChoices,\n ServiceLookup\n} from \"./ServiceLookup\";\nimport { ServiceRepr } from \"./ServiceRepr\";\n\nexport interface DependencyOptions {\n /**\n * All services known to the service layer.\n */\n services?: readonly ServiceRepr[];\n\n /**\n * References that must be satisfied by the services.\n */\n requiredReferences?: readonly RequiredReference[];\n}\n\nexport type RequiredReference = UIDependency | FrameworkDependency;\n\nexport type UIDependency = { type: \"ui\"; packageName: string } & ReferenceSpec;\n\nexport type FrameworkDependency = { type: \"framework\" } & ReferenceSpec;\n\nexport type ComputedServiceDependencies = Record<string, ServiceRepr | ServiceRepr[]>;\n\nexport interface VerifyDependenciesResult {\n /**\n * Precomputed dependencies for every service.\n *\n * Key: service id.\n */\n serviceDependencies: Map<string, ComputedServiceDependencies>;\n\n /**\n * Index structure mapping interface names to service instances.\n */\n serviceLookup: ReadonlyServiceLookup;\n}\n\n/**\n * Visits all services and ensures that their dependencies can be satisfied by each other without a cycle.\n *\n * Throws an error if a cycle is detected or if a required service is never implemented.\n *\n * @returns an object containing the service index and precomputed dependency information\n */\nexport function verifyDependencies(options: DependencyOptions): VerifyDependenciesResult {\n const verifier = new Verifier(options);\n verifier.verify();\n return {\n serviceLookup: verifier.getServiceLookup(),\n serviceDependencies: verifier.getComputedDependencies()\n };\n}\n\ninterface GraphItem {\n state: ItemState;\n service: ServiceRepr;\n dependencies: ComputedServiceDependencies;\n}\n\ntype ItemState = \"not-visited\" | \"pending\" | \"done\";\n\n/** The reason why a graph node is being visited. */\ntype ItemVisitReason = \"root\" | InterfaceReference;\n\ntype InterfaceReference =\n | {\n type: \"framework-reference\";\n value: ReferenceSpec;\n }\n | {\n type: \"ui-reference\";\n packageName: string;\n value: ReferenceSpec;\n }\n | {\n type: \"service-reference\";\n service: ServiceRepr;\n referenceName: string;\n value: ReferenceSpec;\n };\n\nclass Verifier {\n #requiredReferences: readonly RequiredReference[];\n #items: GraphItem[];\n #serviceLookup = new ServiceLookup();\n #serviceToGraphItem = new Map<ServiceRepr, GraphItem>();\n\n // Stack of visited nodes\n #stack: [item: GraphItem, reason: ItemVisitReason][] = [];\n\n constructor(options: DependencyOptions) {\n this.#requiredReferences = options.requiredReferences ?? [];\n const services = options.services ?? [];\n const items = (this.#items = services.map<GraphItem>((service) => {\n return {\n service: service,\n state: \"not-visited\",\n dependencies: {}\n };\n }));\n\n for (const item of items) {\n for (const spec of item.service.interfaces) {\n this.#registerService(item, spec);\n }\n }\n }\n\n verify() {\n for (const ref of this.#requiredReferences) {\n let interfaceRef: InterfaceReference;\n switch (ref.type) {\n case \"framework\":\n interfaceRef = { type: \"framework-reference\", value: ref };\n break;\n case \"ui\":\n interfaceRef = {\n type: \"ui-reference\",\n packageName: ref.packageName,\n value: ref\n };\n break;\n }\n this.#visitReference(interfaceRef);\n }\n for (const item of this.#items) {\n this.#visitItem(item, \"root\");\n }\n }\n\n getServiceLookup() {\n return this.#serviceLookup;\n }\n\n getComputedDependencies() {\n return new Map(\n this.#items.map<[string, ComputedServiceDependencies]>((item) => {\n return [item.service.id, item.dependencies];\n })\n );\n }\n\n #visitItem(item: GraphItem, reason: ItemVisitReason) {\n const stack = this.#stack;\n const state = item.state;\n if (state === \"done\") {\n return; // Item is initialized, cycle impossible\n }\n if (state === \"pending\") {\n this.#throwCycleError(item, reason);\n }\n\n stack.push([item, reason]);\n item.state = \"pending\";\n for (const dep of item.service.dependencies) {\n item.dependencies[dep.referenceName] = this.#visitReference({\n type: \"service-reference\",\n service: item.service,\n referenceName: dep.referenceName,\n value: dep\n });\n }\n item.state = \"done\";\n stack.pop();\n }\n\n #visitReference(ref: InterfaceReference) {\n const itemOrItems = this.#findServices(ref);\n if (Array.isArray(itemOrItems)) {\n for (const child of itemOrItems) {\n this.#visitItem(child, ref);\n }\n return itemOrItems.map((item) => item.service);\n } else {\n this.#visitItem(itemOrItems, ref);\n return itemOrItems.service;\n }\n }\n\n #registerService(item: GraphItem, spec: InterfaceSpec) {\n this.#serviceLookup.register(item.service, spec);\n this.#serviceToGraphItem.set(item.service, item);\n }\n\n #findServices(ref: InterfaceReference): GraphItem | GraphItem[] {\n const spec = ref.value;\n const lookupResult = this.#serviceLookup.lookup(spec);\n switch (lookupResult.type) {\n case \"unimplemented\": {\n const message = unimplementedInterfaceMessage(ref);\n throw new Error(ErrorId.INTERFACE_NOT_FOUND, message);\n }\n case \"ambiguous\": {\n const message = ambiguousInterfaceMessage(ref, lookupResult.choices);\n throw new Error(ErrorId.AMBIGUOUS_DEPENDENCY, message);\n }\n }\n\n const value = lookupResult.value;\n if (Array.isArray(value)) {\n return value.map((service) => this.#getGraphItem(service));\n } else {\n return this.#getGraphItem(value);\n }\n }\n\n #getGraphItem(service: ServiceRepr): GraphItem {\n const graphItem = this.#serviceToGraphItem.get(service);\n if (!graphItem || graphItem.service !== service) {\n throw new Error(\n ErrorId.INTERNAL,\n `Failed to find matching graph item for service '${service.id}'.`\n );\n }\n return graphItem;\n }\n\n #throwCycleError(item: GraphItem, reason: ItemVisitReason) {\n // Find the item on the stack (it must be there because we detected a cycle).\n const stack = this.#stack;\n const ownIndex = stack.findIndex((entry) => entry[0] === item);\n if (ownIndex === -1) {\n throw new Error(ErrorId.INTERNAL, \"Failed to find cycle participant on the stack.\");\n }\n\n const cycleInfo = stack\n .slice(ownIndex)\n .concat([[item, reason]])\n .map<string>((entry, index) => {\n const item = entry[0];\n const reason = index === 0 ? \"root\" : entry[1]; // info before the cycle does not matter\n\n let message = `'${item.service.id}'`;\n if (typeof reason === \"object\") {\n message += ` (${referenceDetail(reason)})`;\n }\n return message;\n });\n throw new Error(\n ErrorId.DEPENDENCY_CYCLE,\n `Detected dependency cycle: ${cycleInfo.join(\" => \")}.`\n );\n }\n}\n\nfunction unimplementedInterfaceMessage(ref: InterfaceReference): string {\n const interfaceText = renderInterfaceSpec(ref.value);\n switch (ref.type) {\n case \"service-reference\":\n return `Service '${ref.service.id}' requires an unimplemented interface ${interfaceText} as dependency '${ref.referenceName}'.`;\n case \"ui-reference\":\n return `The UI of package '${ref.packageName}' requires an unimplemented interface ${interfaceText}.`;\n case \"framework-reference\":\n return `The framework requires an unimplemented interface ${interfaceText}.`;\n }\n}\n\nfunction ambiguousInterfaceMessage(ref: InterfaceReference, choices: AmbiguousChoice[]): string {\n const interfaceText = renderInterfaceSpec(ref.value);\n const serviceChoices = renderAmbiguousServiceChoices(choices);\n\n let message = \"\";\n switch (ref.type) {\n case \"service-reference\":\n message = `Service '${ref.service.id}' requires the ambiguous interface ${interfaceText} as dependency '${ref.referenceName}'.`;\n break;\n case \"ui-reference\":\n message = `The UI of package '${ref.packageName}' requires the ambiguous interface ${interfaceText}.`;\n break;\n case \"framework-reference\":\n message = `The framework requires the ambiguous interface ${interfaceText}.`;\n break;\n }\n message += ` Possible choices are ${serviceChoices}.`;\n return message;\n}\n\nfunction referenceDetail(reason: InterfaceReference) {\n switch (reason.type) {\n case \"service-reference\":\n return `'${reason.referenceName}' providing '${reason.value.interfaceName}'`;\n case \"ui-reference\":\n return `UI of package '${reason.packageName}' requiring '${reason.value.interfaceName}'`;\n case \"framework-reference\":\n return `framework requiring '${reason.value.interfaceName}'`;\n }\n}\n"],"names":["item","reason"],"mappings":";;;;;AAuDO,SAAS,mBAAmB,OAAA,EAAsD;AACrF,EAAA,MAAM,QAAA,GAAW,IAAI,QAAA,CAAS,OAAO,CAAA;AACrC,EAAA,QAAA,CAAS,MAAA,EAAO;AAChB,EAAA,OAAO;AAAA,IACH,aAAA,EAAe,SAAS,gBAAA,EAAiB;AAAA,IACzC,mBAAA,EAAqB,SAAS,uBAAA;AAAwB,GAC1D;AACJ;AA8BA,MAAM,QAAA,CAAS;AAAA,EACX,mBAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA,GAAiB,IAAI,aAAA,EAAc;AAAA,EACnC,mBAAA,uBAA0B,GAAA,EAA4B;AAAA;AAAA,EAGtD,SAAuD,EAAC;AAAA,EAExD,YAAY,OAAA,EAA4B;AACpC,IAAA,IAAA,CAAK,mBAAA,GAAsB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