{"version":3,"file":"components-db0d034e.js","sources":["../../../byoc/build/utils.js","../../../byoc/build/schema.js","../../../byoc/build/datasources.js","../../../byoc/build/components.js"],"sourcesContent":["/** Converts the keys of an object to kebab case. */\nexport const objectKeysToKebabCase = (object = {}) => Object.keys(object).reduce((acc, key) => Object.assign(acc, {\n [toKebabCase(key)]: object[key]\n}), {});\nexport const objectKeysToCamelCase = (object = {}) => Object.keys(object).reduce((acc, key) => Object.assign(acc, {\n [toCamelCase(key)]: object[key]\n}), {});\nexport function toKebabCase(str) {\n const KEBAB_REGEX = /[A-Z\\u00C0-\\u00D6\\u00D8-\\u00DE]/g;\n return toCamelCase(str).replace(KEBAB_REGEX, function (match) {\n return '-' + match.toLowerCase();\n });\n}\nexport function toCamelCase(input) {\n input = input.replace(/[-_ ]+/g, ' ');\n input = input.charAt(0).toLowerCase() + input.slice(1);\n return input\n .split(/\\s+/)\n .map((word, index) => (index === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1)))\n .join('');\n}\n//# sourceMappingURL=utils.js.map","import { toCamelCase, toKebabCase } from './utils.js';\n/**\n * Normalizes schema and assigns default values\n */\nexport function transformSchema(schema, defaults = {}) {\n /** 1. Ensure that properties is not null */\n const properties = schema.properties || {};\n const required = schema.required || [];\n return Object.assign(Object.assign({ \n /** 2. Assign schema type unless given */\n type: 'object' }, schema), { required, properties: Object.keys(properties).reduce((acc, key) => {\n const property = Object.assign(Object.assign({}, properties[key]), { \n /** 3. Assign default value from the explicit defaults object*/\n default: defaults.hasOwnProperty(key) ? defaults[key] : properties[key].default, \n /** 4. Generate fallback title */\n title: properties[key].title ||\n toKebabCase(key)\n .split('-')\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ') });\n if (property.default === undefined) {\n delete property.default;\n }\n if ('required' in property && typeof property.required == 'boolean') {\n if (required.indexOf(key) == -1) {\n required.push(key);\n }\n delete property.required;\n }\n return Object.assign(acc, {\n [key]: property\n });\n }, {}) });\n}\n/** Make UI schema assumptions to improve the ui */\nexport const transformUiSchema = (uiSchema, properties) => {\n let transformed = Object.assign({}, uiSchema);\n /* use updown input widget as default for numbers */\n const numberProperties = Object.keys(properties).filter((key) => /(integer|number)/.test(properties[key].type));\n numberProperties.forEach((propertyName) => {\n var _a;\n if (!((_a = transformed[propertyName]) === null || _a === void 0 ? void 0 : _a['ui:widget']))\n transformed[propertyName] = Object.assign(Object.assign({}, transformed[propertyName]), { 'ui:widget': 'updown' });\n });\n return transformed;\n};\n/** Parses a property value based on its property name and type defined in the JSON properties object. */\nexport function parseValue(value, type) {\n switch (type) {\n case 'string':\n return value;\n case 'object':\n try {\n return typeof value == 'object' && value != null ? value : JSON.parse(value);\n }\n catch (e) {\n return null;\n }\n case 'array':\n try {\n return Array.isArray(value) ? value : JSON.parse(value);\n }\n catch (e) {\n return null;\n }\n case 'number':\n return parseFloat(value);\n case 'integer':\n return parseInt(value);\n case 'boolean':\n return value == 'true' || value == '1';\n default:\n return value;\n }\n}\n/** Transform properties to match the schema types of a specified component. It will parse json for objects and arrays. */\nexport function parseSchemaProperties(schema, props) {\n return Object.keys(props).reduce((prev, name) => {\n const value = props[name];\n const prop = toCamelCase(name);\n const definition = schema === null || schema === void 0 ? void 0 : schema.properties[prop];\n const type = definition === null || definition === void 0 ? void 0 : definition.type;\n const parsed = parseValue(value, type);\n if (parsed != null && !name.startsWith('data-attribute') && !['class', 'id', 'contenteditable'].includes(name)) {\n return Object.assign(Object.assign({}, prev), { [prop]: parsed });\n }\n else {\n return prev;\n }\n }, {});\n}\n/**\n * 1. Transform properties to match the schema types of a specified component. It will parse json for objects and arrays.\n * 2. Combine it with default values as defined by the schema\n */\nexport function getSchemaProperties(schema, props) {\n return Object.assign(Object.assign({}, getSchemaDefaults(schema)), parseSchemaProperties(schema, props));\n}\n/** Get properties with their default non-null values*/\nexport function getSchemaDefaults(schema) {\n return Object.keys(schema.properties).reduce((prev, prop) => {\n var _a, _b;\n if (((_a = schema.properties[prop]) === null || _a === void 0 ? void 0 : _a.default) != null) {\n return Object.assign(Object.assign({}, prev), { [prop]: (_b = schema.properties[prop]) === null || _b === void 0 ? void 0 : _b.default });\n }\n else {\n return prev;\n }\n }, {});\n}\n//# sourceMappingURL=schema.js.map","import { transformSchema } from './schema.js';\n// Store registered datasources in a global variable BYOCDatasources for external access\n// On the clientside the datasource registry is shared via global variable, on server it doesnt to avoid breaking next.js\nexport const registeredDatasources = typeof window != 'undefined' ? (window.BYOCDatasources || (window.BYOCDatasources = {})) : {};\n/**\n * Registers a custom datasource with the provided function and schema.\n *\n * @param handler - A function that returns the DataSettings settings.\n * @param options - Options for the datasource. Includes the datasource id, schema, and other\n * metadata.\n * @param {string} options.id - Unique identifier of the datasource.\n * @param {string} [options.name] - (Optional) Internal name of a datasource. Defaults to the id.\n * @param {string} [options.sample] - (Optional) Sample data for the datasource (alternative to schema).\n * @param {string} [options.type] - (Optional) JSON Schema type (array or object).\n * @param {string} [options.properties] - (Optional) JSON Schema properties definition.\n * @param {string} [options.schema] - (Optional) Whole JSON Schema definition.\n * @returns Void.\n * @example\n *\n * // HTTP-based datasource, described by schema\n *\n * registerDatasource(\n * () => ({\n * url: 'https://api.sampleapis.com/wines/reds'\n * }),\n * {\n * id: 'http-and-schema',\n * name: 'Wines via HTTP',\n * description: 'List of red wines fetched by HTTP, each with `wine`, `price` and `id` property',\n * type: 'array',\n * properties: {\n * wine: { type: 'string' },\n * price: { type: 'string' },\n * id: { type: 'number' }\n * }\n * }\n * )\n *\n * @example\n *\n * // When datasource is registered with ID of a datasource that exist in the library, it can adjust the data settings of the\n * original request.\n *\n * registerDatasource(\n * // settings will contain DataSettings as specified via UI in Components app\n * (settings) => ({\n * ...settings,\n * params: {\n * // add ?page=2 parameter to the original URL\n * ...settings.params,\n * page: 2\n * },\n * headers: {\n * // add Authorization header in addition to original headers\n * ...settings.headers,\n * Authorization: 'Bearer token'\n * }\n * }),\n * {\n * // ID of a datasource as created in UI (can be visible in the address bar URL) to be extended\n * // No other options are specified in this case.\n * id: 'aBcDaaa23a'\n * }\n * )\n *\n * @example\n *\n * import { promises as fs } from 'fs'\n * // Async handlers supposed to return data itself instead of DataSettings\n *\n * registerDatasource(\n * async () => {\n * return JSON.parse(await fs.readFile('wines.json', 'utf-8'))\n * },\n * {\n * id: 'file-and-sample',\n * name: 'Wines from JSON file',\n * description: 'JSON file read and parsed from file (no HTTP request is made), with sample data',\n * sample: [\n * { wine: 'Emporda 2012', id: 1, price: '$250' },\n * { wine: 'Pêra-Manca Tinto 1990', id: 2, price: '$312' }\n * ]\n * }\n * )\n *\n */\nexport function registerDatasource(handler, options) {\n if (typeof handler !== 'function') {\n throw new Error(`The first argument of registerDatasource must be a function returning DataSettings or Promise of data`);\n }\n if (!options.id) {\n throw new Error(`Missing 'id' property in input`);\n }\n const idRegex = /^[a-zA-Z0-9-_]+$/;\n if (!idRegex.test(options.id)) {\n throw new Error(`Invalid 'id' property in input. 'id' should only contain alphanumeric characters, hyphens, and underscores.`);\n }\n //if (getDatasource(options.id)?.handler != null) {\n // throw new Error(`Datasource with id ${options.id} already registered`)\n //}\n registeredDatasources[options.id] = Object.assign(Object.assign({}, normalizeDatasourceOptions(options)), { handler });\n setRegistrationCallback();\n}\n/**\n * Returns the registered datasource with the provided id.\n *\n * @param id - The id of the registered datasource.\n * @returns The registered datasource.\n */\nexport function getDatasource(id) {\n return registeredDatasources[id];\n}\n/**\n * Normalizes the datasource options. If the schema is not provided, it will be derived from the properties.\n *\n * @param datasourceOptions - The datasource options.\n * @returns The normalized datasource options.\n */\nfunction normalizeDatasourceOptions(datasourceOptions) {\n const { id, name, title, properties, sample, schema, description = null, type = 'object' } = datasourceOptions;\n return {\n id,\n description,\n sample,\n name: name || title || id,\n handler: ((settings) => settings),\n schema: schema || properties\n ? transformSchema(Object.assign(Object.assign({}, (schema || { properties, type })), { title: (schema === null || schema === void 0 ? void 0 : schema.title) || title || name }))\n : undefined\n };\n}\nvar registrationCallback;\nfunction setRegistrationCallback() {\n clearTimeout(registrationCallback);\n if (typeof window !== 'undefined' && window.parent !== window) {\n registrationCallback = setTimeout(() => {\n var _a;\n // send datasources from iframe to parent window\n (_a = window.parent) === null || _a === void 0 ? void 0 : _a.postMessage(JSON.stringify({\n action: 'register-datasources',\n data: Object.values(registeredDatasources)\n }), '*');\n }, 30);\n }\n}\nsetRegistrationCallback();\n/**\n * For given datasource id and original settings, either returns adjusted settings or a promise of data.\n */\nexport function customizeDataSettings(id, settings) {\n const datasource = registeredDatasources[id];\n if (datasource === null || datasource === void 0 ? void 0 : datasource.handler) {\n return datasource.handler(settings);\n }\n return settings;\n}\n//# sourceMappingURL=datasources.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { getDatasource, registerDatasource } from './datasources.js';\nimport { transformSchema, transformUiSchema, getSchemaProperties, parseValue } from './schema.js';\nimport { toKebabCase, objectKeysToKebabCase } from './utils.js';\nexport function normalizeOptions(options, component, defaults) {\n /**\n * Usually property schema *is* the options, and ui schema is in `options.ui` property. This function normalizes schemas,\n * as stores them as `uiSchema` and `schema` properties respectively. The registerComponent() call can be made with previously\n * normalized properties (e.g. in parent frame), so it has to supports those as well.\n */\n const { thumbnail = 'https://feaasstatic.blob.core.windows.net/assets/thumbnails/byoc.svg', name, id = options.name, group = null, ui, isHidden = false, datasourceIds = [], links = {}, meta = {}, uiSchema: explicitUISchema, schema: explicitSchema } = options, schemaOptions = __rest(options, [\"thumbnail\", \"name\", \"id\", \"group\", \"ui\", \"isHidden\", \"datasourceIds\", \"links\", \"meta\", \"uiSchema\", \"schema\"]);\n const schemaBase = explicitSchema || schemaOptions || {};\n const useSchemaBase = explicitUISchema || ui || {};\n const schema = transformSchema(Object.assign(Object.assign({ description: 'External component' }, schemaBase), { type: 'object' }), defaults);\n const uiSchema = transformUiSchema(useSchemaBase, schema.properties || {});\n return {\n component: component || (() => null),\n name,\n schema,\n uiSchema,\n thumbnail,\n group: group || 'Default collection',\n isHidden,\n id,\n datasourceIds,\n links,\n meta,\n title: (schema === null || schema === void 0 ? void 0 : schema.title) || (schemaOptions === null || schemaOptions === void 0 ? void 0 : schemaOptions.title) || name\n };\n}\nvar registrationCallback;\n// Shim in case it's required in node.js environment\nexport const WebComponent = (typeof HTMLElement != 'undefined'\n ? HTMLElement\n : // @ts-ignore\n typeof windowJSDOM != 'undefined'\n ? // @ts-ignore\n windowJSDOM.HTMLElement\n : class {\n setAttribute() { }\n });\n// Store registered components in a global variable BYOCComponents for external access\n// On the clientside the component registry is shared via global variable, on server it doesnt to avoid breaking next.js\nexport const registered = typeof window != 'undefined' ? (window.BYOCComponents || (window.BYOCComponents = {})) : {};\n/**\n * Register React component to be renderable as Sitecore component (in Components and Pages). Properties are defined as\n * {@link https://json-schema.org JSON Schema}, from which a configuration form will be produced using\n * {@link https://rjsf-team.github.io/react-jsonschema-form/ RJSF library}. The library allows passing a\n * {@link https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema UI Schema} that allows tight\n * customization of form widgets, styles and behavior.\n *\n * Schema properties supports `default` option which provides a fallback value. Alternatively default properties can be\n * passed as plain javascript object as third argument to `registerComponent` call.\n *\n * It is possible to generate same component and schema with different defaults, as separate components by altering the\n * `id` property. This is used for to expand generic component like Form into different specific Form instances.\n *\n * @param {React.ComponentType} component React component that will be rendered.\n * @param {string} options.title Component name as presented to the user.\n * @param {JSONSchema['properties']} options.properties Object of properties.\n * @param {JSONSchema['type']} options.properties[].type JSON Schema type of a property.\n * @param {string} [options.properties[].title] Optional title displayed to the user.\n * @param {string} [options.group] Optional Image to be displayed in the UI.\n * @param {string} [options.thumbnail] Optional title displayed to the user.\n * @param {string} [options.isHidden] Optionally hide from the UI.\n * @param {UISchema} [options.ui] Optional component groupping.\n * @param {string[]} [options.datasourceIds] List of datasource id component requires.\n * @see https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema\n * @see https://json-schema.org\n * @example\n *\n * FEAAS.External.registerComponent(\n * MyComponent,\n * {\n * // Name of a component as it will be used internally\n * name: 'MyComponent',\n * // Title of a component as it will be presented to the user\n * title: 'My Component',\n * // Optional: Thumbnail image for component to be displayed in UI\n * thumbnail: 'http://examaple.com/component.jpg',\n * // Optional: Group components in the UI\n * group: 'Assorted components',\n * // Definitions of three configurable properties that MyComponent accepts\n * properties: {\n * // Color is a string, but only Red/Green/Blue are allowed\n * color: { type: 'string', enum: ['red', 'green', 'blue'] },\n * // Text is a property labelled as \"Text summary\"\n * text: { type: 'string', title: 'Text summary' },\n * // Count is a number with 1 as default value\n * count: { type: 'number', default: 1 }\n * },\n * // Optional UI schema customization\n * ui: {\n * // Present color choices as radio buttons\n * color: { 'ui:widget': 'radio' },\n * // Text is a textarea with 5 rows\n * text: { 'ui:widget': 'textarea', 'ui:options': { rows: 5 } },\n * // Count is a number field with spinner button\n * count: { 'ui:widget': 'updown' }\n * },\n * // Color and text area required properties\n * required: ['color', 'text']\n * },\n * { text: 'Default text' }\n * )\n *\n */\nexport function registerComponent(component, options, defaults = {}) {\n if (!(options === null || options === void 0 ? void 0 : options.name))\n throw new Error('Could not register external component. Please make sure you provide a name in the options' +\n JSON.stringify(options));\n const normalizedOptions = normalizeOptions(options, component, defaults);\n registered[normalizedOptions.id] = normalizedOptions;\n if (isWebComponent(component)) {\n BYOCRegistration.register('byoc-' + toKebabCase(options.name), undefined, component);\n }\n setRegistrationCallback();\n}\nexport function isWebComponent(object) {\n return object && 'prototype' in object && 'setAttribute' in object.prototype;\n}\n/** Transform properties to proper types and merge them with default values */\nexport function getComponentProperties(id, props = {}) {\n var _a;\n const schema = (_a = getComponent(id)) === null || _a === void 0 ? void 0 : _a.schema;\n return schema ? getSchemaProperties(schema, props) : props;\n}\nexport function getComponentConfigurablePropertyNames(id) {\n const definition = getComponent(id);\n return Object.keys((definition === null || definition === void 0 ? void 0 : definition.schema.properties) || {}).filter((prop) => {\n var _a, _b;\n return ((_b = (_a = definition === null || definition === void 0 ? void 0 : definition.uiSchema) === null || _a === void 0 ? void 0 : _a[prop]) === null || _b === void 0 ? void 0 : _b['ui:widget']) != 'hidden';\n });\n}\n/**\n * Resolve a component by its id in one of two formats:\n * - Simple id like `ComponentName` returns the registered component\n * - Complex id like `ComponentName?prop=value` returns a combination of:\n * - `ComponentName` component if registered\n * - `ComponentName?prop=value` component if registered\n * - Default values provided in query string\n *\n * The latter approach allows registering a generic component under simple name, and its overloads\n * which will be presented as individual components to the user.\n */\nexport function getComponent(id) {\n if (typeof id != 'string') {\n if (id && 'schema' in id)\n return id;\n throw new Error(`Component name should be a string, got ${typeof id}`);\n }\n const [name, query] = id.split('?');\n var base = registered[name];\n // Deal with query string\n if (query) {\n // if component is registered with query string, merge two component definitions\n const overload = registered[id];\n if (!overload && !base)\n return null;\n if (overload)\n base = Object.assign(Object.assign(Object.assign({}, base), overload), { component: overload.component || (base === null || base === void 0 ? void 0 : base.component) });\n // merge query string as default values\n query.split(/\\&/g).forEach((pair) => {\n var _a, _b, _c;\n const [k, v] = pair.split('=');\n const propertyDefinition = ((_a = base.schema.properties) === null || _a === void 0 ? void 0 : _a[k]) || {\n type: 'string'\n };\n // merge in k/v pair as default value\n base = Object.assign(Object.assign({}, base), { schema: Object.assign(Object.assign({}, base.schema), { properties: Object.assign(Object.assign({}, base.schema.properties), { [k]: Object.assign(Object.assign({}, propertyDefinition), { default: parseValue(decodeURIComponent(v), propertyDefinition.type) }) }) }), uiSchema: Object.assign(Object.assign({}, base.uiSchema), { \n // hide preconfigured properties\n [k]: Object.assign(Object.assign({}, base.uiSchema[k]), { 'ui:widget': (_c = (_b = base.uiSchema[k]) === null || _b === void 0 ? void 0 : _b['ui:widget']) !== null && _c !== void 0 ? _c : 'hidden' }) }) });\n });\n }\n return base;\n}\n/**\n * Retrieves properties for a component, including context properties component's defaults.\n *\n * @param props - The component props.\n * @returns An object containing the attributes, properties, and merged properties.\n */\nexport function getMergedComponentProperties(props) {\n const { componentName, className, fallbackWrapper, fallback, suppressHydrationWarning, _dynamic, datasources } = props, givenProps = __rest(props, [\"componentName\", \"className\", \"fallbackWrapper\", \"fallback\", \"suppressHydrationWarning\", \"_dynamic\", \"datasources\"]);\n try {\n var parsedDatasources = typeof datasources == 'string' ? JSON.parse(datasources) : datasources;\n }\n catch (e) { }\n // find first datasources with object data, use it as a source of properties\n const dataProperties = Object.values(parsedDatasources || {}).find((v) => v && !Array.isArray(v) && Object.keys(v).length > 0);\n const properties = Object.assign(Object.assign(Object.assign({}, dataProperties), getComponentProperties(componentName, Object.assign(Object.assign({}, dataProperties), givenProps))), (parsedDatasources ? { datasources: parsedDatasources } : {}));\n const attributes = Object.assign(Object.assign({ 'data-external-id': componentName }, objectKeysToKebabCase(properties)), { suppressHydrationWarning: true, class: className });\n serializedContextProperties.forEach((key) => {\n Object.assign(attributes, { [toKebabCase(key)]: contextProperties[key] });\n });\n // serialize json properties\n Object.keys(attributes).forEach((key) => {\n const value = attributes[key];\n if (value && typeof value == 'object' && key != 'class' && key != 'children') {\n try {\n Object.assign(attributes, { [key]: JSON.stringify(value) });\n }\n catch (e) {\n delete attributes[key];\n }\n }\n if (typeof value == 'function' || value == null) {\n delete attributes[key];\n }\n });\n return {\n /** HTML attributes in kebab case, including strings and explicitly passed objects in json format */\n attributes,\n /** React properties combined with datasources */\n properties,\n /** React properties combined with datasources and context properties */\n merged: Object.assign(Object.assign({}, contextProperties), properties)\n };\n}\nexport function setRegistrationCallback() {\n clearTimeout(registrationCallback);\n if (typeof window !== 'undefined' && window.parent !== window) {\n registrationCallback = setTimeout(() => {\n var _a;\n // send components from iframe to parent window\n (_a = window.parent) === null || _a === void 0 ? void 0 : _a.postMessage(JSON.stringify({\n action: 'register-components',\n data: Object.values(registered)\n }), '*');\n }, 30);\n }\n}\nsetRegistrationCallback();\n// Register schemas passed as \n// It extends the web component in case it already was registered by different name\nexport class BYOCRegistration extends WebComponent {\n connectedCallback() {\n try {\n ;\n JSON.parse(String(this.getAttribute('components'))).forEach((component) => {\n if (!getComponent(component.id))\n registerComponent(null, component);\n });\n JSON.parse(String(this.getAttribute('datasources'))).forEach((datasource) => {\n if (!getDatasource(datasource.id))\n registerDatasource((settings) => settings, datasource);\n });\n }\n catch (e) { }\n }\n static register(tagName, win, component = this) {\n if (win == null)\n win = typeof window != 'undefined' ? window : undefined;\n if (win && !win.customElements.get(tagName)) {\n win.customElements.define(tagName, class extends component {\n });\n }\n }\n}\nexport var contextProperties = {};\nexport function setContextProperties(props) {\n contextProperties = props;\n}\nexport const serializedContextProperties = ['sitecoreEdgeUrl', 'sitecoreEdgeContextId'];\nBYOCRegistration.register('byoc-registration');\n//# sourceMappingURL=components.js.map"],"names":["objectKeysToKebabCase","object","acc","key","toKebabCase","objectKeysToCamelCase","toCamelCase","str","KEBAB_REGEX","match","input","word","index","transformSchema","schema","defaults","properties","required","property","transformUiSchema","uiSchema","transformed","propertyName","_a","parseValue","value","type","parseSchemaProperties","props","prev","name","prop","definition","parsed","getSchemaProperties","getSchemaDefaults","_b","registeredDatasources","registerDatasource","handler","options","normalizeDatasourceOptions","setRegistrationCallback","getDatasource","id","datasourceOptions","title","sample","description","settings","registrationCallback","customizeDataSettings","datasource","__rest","this","s","e","t","p","normalizeOptions","component","thumbnail","group","ui","isHidden","datasourceIds","links","meta","explicitUISchema","explicitSchema","schemaOptions","schemaBase","useSchemaBase","WebComponent","registered","registerComponent","normalizedOptions","isWebComponent","BYOCRegistration","getComponentProperties","getComponent","getComponentConfigurablePropertyNames","query","base","overload","pair","_c","k","v","propertyDefinition","getMergedComponentProperties","componentName","className","fallbackWrapper","fallback","suppressHydrationWarning","_dynamic","datasources","givenProps","parsedDatasources","dataProperties","attributes","serializedContextProperties","contextProperties","tagName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