{"version":3,"sources":["../../../src/fields/config/sanitize.ts"],"sourcesContent":["import { deepMergeSimple } from '@payloadcms/translations/utilities'\n\nimport type {\n  CollectionConfig,\n  SanitizedJoin,\n  SanitizedJoins,\n} from '../../collections/config/types.js'\nimport type { Config, SanitizedConfig } from '../../config/types.js'\nimport type { GlobalConfig } from '../../globals/config/types.js'\nimport type { OrderableJoinInfo } from './sanitizeJoinField.js'\nimport type { Field } from './types.js'\n\nimport {\n  DuplicateFieldName,\n  InvalidConfiguration,\n  InvalidFieldName,\n  InvalidFieldRelationship,\n  MissingEditorProp,\n  MissingFieldType,\n} from '../../errors/index.js'\nimport { ReservedFieldName } from '../../errors/ReservedFieldName.js'\nimport { flattenAllFields } from '../../utilities/flattenAllFields.js'\nimport { formatLabels, toWords } from '../../utilities/formatLabels.js'\nimport { validateTimezones } from '../../utilities/validateTimezones.js'\nimport { baseBlockFields } from '../baseFields/baseBlockFields.js'\nimport { baseIDField } from '../baseFields/baseIDField.js'\nimport { baseTimezoneField } from '../baseFields/timezone/baseField.js'\nimport { defaultTimezones } from '../baseFields/timezone/defaultTimezones.js'\nimport { getFieldPaths } from '../getFieldPaths.js'\nimport { setDefaultBeforeDuplicate } from '../setDefaultBeforeDuplicate.js'\nimport { validations } from '../validations.js'\nimport {\n  reservedAPIKeyFieldNames,\n  reservedBaseAuthFieldNames,\n  reservedBaseUploadFieldNames,\n  reservedVerifyFieldNames,\n} from './reservedFieldNames.js'\nimport { sanitizeJoinField } from './sanitizeJoinField.js'\nimport { fieldAffectsData as _fieldAffectsData, fieldIsLocalized, tabHasName } from './types.js'\n\ntype SanitizeFieldsArgs = {\n  collectionConfig?: CollectionConfig\n  config: Config\n  existingFieldNames?: Set<string>\n  fields: Field[]\n  globalConfig?: GlobalConfig\n  /**\n   * Used to prevent unnecessary sanitization of fields that are not top-level.\n   */\n  isTopLevelField?: boolean\n  joinPath?: string\n  /**\n   * When not passed in, assume that join are not supported (globals, arrays, blocks)\n   */\n  joins?: SanitizedJoins\n  /**\n   * Tracker for orderable join fields - populated during sanitization\n   */\n  orderableJoins?: OrderableJoinInfo[]\n  /**\n   * A string of '-' separated indexes representing where\n   * to find this field in a given field schema array.\n   */\n  parentIndexPath?: string\n  parentIsLocalized: boolean\n  /**\n   * Path for parent fields relative to their position in the schema.\n   */\n  parentSchemaPath?: string\n  polymorphicJoins?: SanitizedJoin[]\n  /**\n   * If true, a richText field will require an editor property to be set, as the sanitizeFields function will not add it from the payload config if not present.\n   *\n   * @default false\n   */\n  requireFieldLevelRichTextEditor?: boolean\n  /**\n   * If this property is set, RichText fields won't be sanitized immediately. Instead, they will be added to this array as promises\n   * so that you can sanitize them together, after the config has been sanitized.\n   */\n  richTextSanitizationPromises?: Array<(config: SanitizedConfig) => Promise<void>>\n  /**\n   * If not null, will validate that upload and relationship fields do not relate to a collection that is not in this array.\n   * This validation will be skipped if validRelationships is null.\n   */\n  validRelationships: null | string[]\n}\n\nexport type SanitizeFieldArgs = {\n  collectionConfig?: CollectionConfig\n  config: Config\n  existingFieldNames: Set<string>\n  field: Field\n  globalConfig?: GlobalConfig\n  /**\n   * The index of this field in the parent fields array\n   */\n  index: number\n  /**\n   * Used to prevent unnecessary sanitization of fields that are not top-level.\n   */\n  isTopLevelField: boolean\n  joinPath: string\n  /**\n   * When not passed in, assume that joins are not supported (globals, arrays, blocks)\n   */\n  joins?: SanitizedJoins\n  /**\n   * Tracker for orderable join fields - populated during sanitization\n   */\n  orderableJoins?: OrderableJoinInfo[]\n  parentIndexPath: string\n  parentIsLocalized: boolean\n  parentSchemaPath: string\n  polymorphicJoins?: SanitizedJoin[]\n  requireFieldLevelRichTextEditor: boolean\n  richTextSanitizationPromises?: Array<(config: SanitizedConfig) => Promise<void>>\n  validRelationships: null | string[]\n}\n\ntype SanitizeFieldResult = {\n  /**\n   * Fields to insert after this field (e.g., timezone field)\n   */\n  fieldsToInsert?: Field[]\n}\n\n/**\n * Sanitize a single field. Handles all per-field logic including:\n * - Validation setup\n * - Hooks/access/admin defaults\n * - Type-specific handling\n * - Recursive sanitization of nested fields\n *\n * @returns Result containing any fields to insert after this one\n */\nexport const sanitizeField = async ({\n  collectionConfig,\n  config,\n  existingFieldNames,\n  field,\n  globalConfig,\n  index,\n  isTopLevelField,\n  joinPath,\n  joins,\n  orderableJoins,\n  parentIndexPath,\n  parentIsLocalized,\n  parentSchemaPath,\n  polymorphicJoins,\n  requireFieldLevelRichTextEditor,\n  richTextSanitizationPromises,\n  validRelationships,\n}: SanitizeFieldArgs): Promise<SanitizeFieldResult> => {\n  const result: SanitizeFieldResult = {}\n\n  if ('_sanitized' in field && field._sanitized === true) {\n    return result\n  }\n\n  if ('_sanitized' in field) {\n    field._sanitized = true\n  }\n\n  if (!field.type) {\n    throw new MissingFieldType(field)\n  }\n\n  const fieldAffectsData = _fieldAffectsData(field)\n\n  const { indexPath, schemaPath } = getFieldPaths({\n    field,\n    index,\n    parentIndexPath,\n    parentSchemaPath,\n  })\n\n  // Reserved field name checks\n  if (isTopLevelField && fieldAffectsData && field.name) {\n    if (collectionConfig && collectionConfig.upload) {\n      if (reservedBaseUploadFieldNames.includes(field.name)) {\n        throw new ReservedFieldName(field, field.name)\n      }\n    }\n\n    if (\n      collectionConfig &&\n      collectionConfig.auth &&\n      typeof collectionConfig.auth === 'object' &&\n      !collectionConfig.auth.disableLocalStrategy\n    ) {\n      if (reservedBaseAuthFieldNames.includes(field.name)) {\n        throw new ReservedFieldName(field, field.name)\n      }\n\n      if (collectionConfig.auth.verify) {\n        // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n        if (reservedAPIKeyFieldNames.includes(field.name)) {\n          throw new ReservedFieldName(field, field.name)\n        }\n\n        // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n        if (reservedVerifyFieldNames.includes(field.name)) {\n          throw new ReservedFieldName(field, field.name)\n        }\n      }\n    }\n  }\n\n  // Invalid field name check\n  if (fieldAffectsData && field.name.includes('.')) {\n    throw new InvalidFieldName(field, field.name)\n  }\n\n  // Auto-label\n  if (\n    'name' in field &&\n    field.name &&\n    typeof field.label !== 'object' &&\n    typeof field.label !== 'string' &&\n    typeof field.label !== 'function' &&\n    field.label !== false\n  ) {\n    field.label = toWords(field.name)\n  }\n\n  // Checkbox default\n  if (\n    field.type === 'checkbox' &&\n    typeof field.defaultValue === 'undefined' &&\n    field.required === true\n  ) {\n    field.defaultValue = false\n  }\n\n  // Join field sanitization\n  if (field.type === 'join') {\n    sanitizeJoinField({\n      config,\n      field,\n      joinPath,\n      joins,\n      orderableJoins,\n      parentIsLocalized,\n      polymorphicJoins,\n    })\n  }\n\n  // Relationship/upload validation\n  if (field.type === 'relationship' || field.type === 'upload') {\n    if (Array.isArray(field.relationTo) && field.relationTo.length === 0) {\n      throw new Error(\n        `Field \"${field.name}\" of type \"${field.type}\" has an empty relationTo array. At least one collection must be specified.`,\n      )\n    }\n\n    if (validRelationships) {\n      const relationships = Array.isArray(field.relationTo) ? field.relationTo : [field.relationTo]\n\n      relationships.forEach((relationship: string) => {\n        if (!validRelationships.includes(relationship)) {\n          throw new InvalidFieldRelationship(field, relationship)\n        }\n      })\n    }\n\n    if (field.min && !field.minRows) {\n      console.warn(\n        `(payload): The \"min\" property is deprecated for the Relationship field \"${field.name}\" and will be removed in a future version. Please use \"minRows\" instead.`,\n      )\n      field.minRows = field.min\n    }\n\n    if (field.max && !field.maxRows) {\n      console.warn(\n        `(payload): The \"max\" property is deprecated for the Relationship field \"${field.name}\" and will be removed in a future version. Please use \"maxRows\" instead.`,\n      )\n      field.maxRows = field.max\n    }\n  }\n\n  // Upload isSortable default\n  if (field.type === 'upload') {\n    if (!field.admin || !('isSortable' in field.admin)) {\n      field.admin = {\n        isSortable: true,\n        ...field.admin,\n      }\n    }\n  }\n\n  // Array ID field\n  if (field.type === 'array' && field.fields) {\n    const hasCustomID = field.fields.some((f) => 'name' in f && f.name === 'id')\n    if (!hasCustomID) {\n      field.fields.push(baseIDField)\n    }\n  }\n\n  // Blocks/array labels\n  if ((field.type === 'blocks' || field.type === 'array') && field.label) {\n    field.labels = field.labels || formatLabels(field.name)\n  }\n\n  if (fieldAffectsData) {\n    if (existingFieldNames.has(field.name)) {\n      throw new DuplicateFieldName(field.name)\n    } else if (!['blockName', 'id'].includes(field.name)) {\n      existingFieldNames.add(field.name)\n    }\n\n    if (typeof field.localized !== 'undefined') {\n      let shouldDisableLocalized = !config.localization\n\n      if (\n        process.env.NEXT_PUBLIC_PAYLOAD_COMPATIBILITY_allowLocalizedWithinLocalized !== 'true' &&\n        parentIsLocalized &&\n        // @todo PAYLOAD_DO_NOT_SANITIZE_LOCALIZED_PROPERTY=true will be the default in 4.0\n        process.env.PAYLOAD_DO_NOT_SANITIZE_LOCALIZED_PROPERTY !== 'true'\n      ) {\n        shouldDisableLocalized = true\n      }\n\n      if (shouldDisableLocalized) {\n        delete field.localized\n      }\n    }\n\n    if (typeof field.validate === 'undefined') {\n      if ('virtual' in field && field.virtual) {\n        field.validate = (): true => true\n      } else {\n        const defaultValidate = validations[field.type as keyof typeof validations]\n        if (defaultValidate) {\n          field.validate = (val: any, options: any) =>\n            defaultValidate(val, { ...field, ...options })\n        } else {\n          field.validate = (): true => true\n        }\n      }\n    }\n\n    if (!field.hooks) {\n      field.hooks = {}\n    }\n\n    if (!field.access) {\n      field.access = {}\n    }\n\n    setDefaultBeforeDuplicate(field, parentIsLocalized)\n  }\n\n  if (!field.admin) {\n    field.admin = {}\n  }\n\n  if ('virtual' in field && field.virtual && field.admin.readOnly !== false && fieldAffectsData) {\n    field.admin.readOnly = true\n  }\n\n  // Make sure that the richText field has an editor\n  if (field.type === 'richText') {\n    const sanitizeRichText = async (_config: SanitizedConfig) => {\n      if (!field.editor) {\n        if (_config.editor && !requireFieldLevelRichTextEditor) {\n          // config.editor should be sanitized at this point\n          field.editor = _config.editor\n        } else {\n          throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n        }\n      }\n\n      if (typeof field.editor === 'function') {\n        field.editor = await field.editor({\n          config: _config,\n          isRoot: requireFieldLevelRichTextEditor,\n          parentIsLocalized: (parentIsLocalized || field.localized)!,\n        })\n      }\n\n      if (field.editor.i18n && Object.keys(field.editor.i18n).length >= 0) {\n        config.i18n!.translations = deepMergeSimple(config.i18n!.translations!, field.editor.i18n)\n      }\n    }\n    if (richTextSanitizationPromises) {\n      richTextSanitizationPromises.push(sanitizeRichText)\n    } else {\n      await sanitizeRichText(config as unknown as SanitizedConfig)\n    }\n  }\n\n  if (field.type === 'blocks' && field.blocks) {\n    if (field.blockReferences && field.blocks?.length) {\n      throw new Error('You cannot have both blockReferences and blocks in the same blocks field')\n    }\n\n    const blockSlugs: string[] = []\n\n    for (const block of field.blockReferences ?? field.blocks) {\n      const blockSlug = typeof block === 'string' ? block : block.slug\n\n      if (blockSlugs.includes(blockSlug)) {\n        throw new DuplicateFieldName(blockSlug)\n      }\n\n      blockSlugs.push(blockSlug)\n\n      if (typeof block === 'string') {\n        continue\n      }\n\n      if (block._sanitized === true) {\n        continue\n      }\n\n      block._sanitized = true\n      block.fields = block.fields.concat(baseBlockFields)\n      block.labels = !block.labels ? formatLabels(block.slug) : block.labels\n\n      block.fields = await sanitizeFields({\n        collectionConfig,\n        config,\n        existingFieldNames: new Set(),\n        fields: block.fields,\n        isTopLevelField: false,\n        parentIndexPath: '',\n        parentIsLocalized: (parentIsLocalized || field.localized)!,\n        parentSchemaPath: schemaPath + '.' + block.slug,\n        requireFieldLevelRichTextEditor,\n        richTextSanitizationPromises,\n        validRelationships,\n      })\n    }\n  }\n\n  if ('fields' in field && field.fields) {\n    field.fields = await sanitizeFields({\n      collectionConfig,\n      config,\n      existingFieldNames: fieldAffectsData ? new Set() : existingFieldNames,\n      fields: field.fields,\n      isTopLevelField: isTopLevelField && !fieldAffectsData,\n      joinPath: fieldAffectsData ? `${joinPath ? joinPath + '.' : ''}${field.name}` : joinPath,\n      joins,\n      orderableJoins,\n      parentIndexPath: fieldAffectsData ? '' : indexPath,\n      parentIsLocalized: parentIsLocalized || fieldIsLocalized(field),\n      parentSchemaPath: schemaPath,\n      polymorphicJoins,\n      requireFieldLevelRichTextEditor,\n      richTextSanitizationPromises,\n      validRelationships,\n    })\n  }\n\n  if (field.type === 'tabs') {\n    for (let j = 0; j < field.tabs.length; j++) {\n      const tab = field.tabs[j]!\n\n      const isNamedTab = tabHasName(tab)\n\n      if (isNamedTab && typeof tab.label === 'undefined') {\n        tab.label = toWords(tab.name)\n      }\n\n      const { indexPath: tabIndexPath, schemaPath: tabSchemaPath } = getFieldPaths({\n        field: tab,\n        index: j,\n        parentIndexPath: indexPath,\n        parentSchemaPath: schemaPath,\n      })\n\n      if (\n        'admin' in tab &&\n        tab.admin?.condition &&\n        typeof tab.admin.condition === 'function' &&\n        !tab.id\n      ) {\n        tab.id = tabSchemaPath\n      }\n\n      tab.fields = await sanitizeFields({\n        collectionConfig,\n        config,\n        existingFieldNames: isNamedTab ? new Set() : existingFieldNames,\n        fields: tab.fields,\n        isTopLevelField: isTopLevelField && !isNamedTab,\n        joinPath: isNamedTab ? `${joinPath ? joinPath + '.' : ''}${tab.name}` : joinPath,\n        joins,\n        orderableJoins,\n        parentIndexPath: isNamedTab ? '' : tabIndexPath,\n        parentIsLocalized: parentIsLocalized || (isNamedTab && tab.localized)!,\n        parentSchemaPath: tabSchemaPath,\n        polymorphicJoins,\n        requireFieldLevelRichTextEditor,\n        richTextSanitizationPromises,\n        validRelationships,\n      })\n\n      field.tabs[j] = tab\n    }\n  }\n\n  if (field.type === 'ui' && typeof field.admin.disableBulkEdit === 'undefined') {\n    field.admin.disableBulkEdit = true\n  }\n\n  // Timezone field insertion\n  if (field.type === 'date' && field.timezone) {\n    const name = field.name + '_tz'\n\n    let defaultTimezone =\n      field.timezone && typeof field.timezone === 'object'\n        ? field.timezone.defaultTimezone\n        : config.admin?.timezones?.defaultTimezone\n\n    const required =\n      field.required ||\n      (field.timezone && typeof field.timezone === 'object' && field.timezone.required)\n\n    const supportedTimezones =\n      field.timezone && typeof field.timezone === 'object' && field.timezone.supportedTimezones\n        ? field.timezone.supportedTimezones\n        : config.admin?.timezones?.supportedTimezones\n\n    const options =\n      typeof supportedTimezones === 'function'\n        ? supportedTimezones({ defaultTimezones })\n        : supportedTimezones\n\n    validateTimezones({\n      source: `field \"${field.name}\" timezone.supportedTimezones`,\n      timezones: options,\n    })\n\n    if (options && options.length === 1 && options[0]?.value) {\n      defaultTimezone = options[0].value\n    }\n\n    // Generate label for timezone field\n    const timezoneLabel = typeof field.label === 'string' ? `${field.label} Tz` : toWords(name)\n\n    const baseField = baseTimezoneField({\n      name,\n      defaultValue: defaultTimezone,\n      label: timezoneLabel,\n      options,\n      required,\n    })\n\n    // Apply override if provided\n    const timezoneField =\n      typeof field.timezone === 'object' && typeof field.timezone.override === 'function'\n        ? field.timezone.override({ baseField })\n        : baseField\n\n    result.fieldsToInsert = [timezoneField]\n  }\n\n  // Virtual field handling\n  if ('virtual' in field && typeof field.virtual === 'string') {\n    const virtualField = field\n    const configFields = (collectionConfig || globalConfig)?.fields\n    if (configFields) {\n      let flattenFields = flattenAllFields({ fields: configFields })\n      const paths = field.virtual.split('.')\n      let isHasMany = false\n\n      for (const [idx, segment] of paths.entries()) {\n        const foundField = flattenFields.find((e) => e.name === segment)\n        if (!foundField) {\n          break\n        }\n\n        if (\n          foundField.type === 'group' ||\n          foundField.type === 'tab' ||\n          foundField.type === 'array'\n        ) {\n          flattenFields = foundField.flattenedFields\n        } else if (\n          (foundField.type === 'relationship' || foundField.type === 'upload') &&\n          idx !== paths.length - 1 &&\n          typeof foundField.relationTo === 'string'\n        ) {\n          if (\n            foundField.hasMany &&\n            (virtualField.type === 'text' ||\n              virtualField.type === 'number' ||\n              virtualField.type === 'select')\n          ) {\n            if (isHasMany) {\n              throw new InvalidConfiguration(\n                `Virtual field ${virtualField.name} in ${globalConfig ? `global ${globalConfig.slug}` : `collection ${collectionConfig?.slug}`} references 2 or more hasMany relationships on the path ${virtualField.virtual} which is not allowed.`,\n              )\n            }\n\n            isHasMany = true\n            virtualField.hasMany = true\n          }\n          const relatedCollection = config.collections?.find(\n            (e) => e.slug === foundField.relationTo,\n          )\n          if (relatedCollection) {\n            flattenFields = flattenAllFields({ fields: relatedCollection.fields })\n          }\n        }\n      }\n    }\n  }\n\n  return result\n}\n\nexport const sanitizeFields = async ({\n  collectionConfig,\n  config,\n  existingFieldNames = new Set(),\n  fields,\n  globalConfig,\n  isTopLevelField = true,\n  joinPath = '',\n  joins,\n  orderableJoins,\n  parentIndexPath = '',\n  parentIsLocalized,\n  parentSchemaPath = '',\n  polymorphicJoins,\n  requireFieldLevelRichTextEditor = false,\n  richTextSanitizationPromises,\n  validRelationships,\n}: SanitizeFieldsArgs): Promise<Field[]> => {\n  if (!fields) {\n    return []\n  }\n\n  for (let i = 0; i < fields.length; i++) {\n    const field = fields[i]!\n\n    const result = await sanitizeField({\n      collectionConfig,\n      config,\n      existingFieldNames,\n      field,\n      globalConfig,\n      index: i,\n      isTopLevelField,\n      joinPath,\n      joins,\n      orderableJoins,\n      parentIndexPath,\n      parentIsLocalized,\n      parentSchemaPath,\n      polymorphicJoins,\n      requireFieldLevelRichTextEditor,\n      richTextSanitizationPromises,\n      validRelationships,\n    })\n\n    fields[i] = field\n\n    if (result.fieldsToInsert?.length) {\n      fields.splice(i + 1, 0, ...result.fieldsToInsert)\n      i += result.fieldsToInsert.length\n    }\n  }\n\n  return fields\n}\n"],"names":["deepMergeSimple","DuplicateFieldName","InvalidConfiguration","InvalidFieldName","InvalidFieldRelationship","MissingEditorProp","MissingFieldType","ReservedFieldName","flattenAllFields","formatLabels","toWords","validateTimezones","baseBlockFields","baseIDField","baseTimezoneField","defaultTimezones","getFieldPaths","setDefaultBeforeDuplicate","validations","reservedAPIKeyFieldNames","reservedBaseAuthFieldNames","reservedBaseUploadFieldNames","reservedVerifyFieldNames","sanitizeJoinField","fieldAffectsData","_fieldAffectsData","fieldIsLocalized","tabHasName","sanitizeField","collectionConfig","config","existingFieldNames","field","globalConfig","index","isTopLevelField","joinPath","joins","orderableJoins","parentIndexPath","parentIsLocalized","parentSchemaPath","polymorphicJoins","requireFieldLevelRichTextEditor","richTextSanitizationPromises","validRelationships","result","_sanitized","type","indexPath","schemaPath","name","upload","includes","auth","disableLocalStrategy","verify","label","defaultValue","required","Array","isArray","relationTo","length","Error","relationships","forEach","relationship","min","minRows","console","warn","max","maxRows","admin","isSortable","fields","hasCustomID","some","f","push","labels","has","add","localized","shouldDisableLocalized","localization","process","env","NEXT_PUBLIC_PAYLOAD_COMPATIBILITY_allowLocalizedWithinLocalized","PAYLOAD_DO_NOT_SANITIZE_LOCALIZED_PROPERTY","validate","virtual","defaultValidate","val","options","hooks","access","readOnly","sanitizeRichText","_config","editor","isRoot","i18n","Object","keys","translations","blocks","blockReferences","blockSlugs","block","blockSlug","slug","concat","sanitizeFields","Set","j","tabs","tab","isNamedTab","tabIndexPath","tabSchemaPath","condition","id","disableBulkEdit","timezone","defaultTimezone","timezones","supportedTimezones","source","value","timezoneLabel","baseField","timezoneField","override","fieldsToInsert","virtualField","configFields","flattenFields","paths","split","isHasMany","idx","segment","entries","foundField","find","e","flattenedFields","hasMany","relatedCollection","collections","i","splice"],"mappings":"AAAA,SAASA,eAAe,QAAQ,qCAAoC;AAYpE,SACEC,kBAAkB,EAClBC,oBAAoB,EACpBC,gBAAgB,EAChBC,wBAAwB,EACxBC,iBAAiB,EACjBC,gBAAgB,QACX,wBAAuB;AAC9B,SAASC,iBAAiB,QAAQ,oCAAmC;AACrE,SAASC,gBAAgB,QAAQ,sCAAqC;AACtE,SAASC,YAAY,EAAEC,OAAO,QAAQ,kCAAiC;AACvE,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,mCAAkC;AAClE,SAASC,WAAW,QAAQ,+BAA8B;AAC1D,SAASC,iBAAiB,QAAQ,sCAAqC;AACvE,SAASC,gBAAgB,QAAQ,6CAA4C;AAC7E,SAASC,aAAa,QAAQ,sBAAqB;AACnD,SAASC,yBAA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