{"version":3,"file":"index.js","names":["getTranslation","FieldDiffContainer","getHTMLDiffComponents","React","generateLabelFromValue","baseClass","Relationship","comparisonValue","valueFrom","field","i18n","locale","nestingLevel","parentIsLocalized","req","versionValue","valueTo","hasMany","Array","isArray","polymorphic","relationTo","_jsx","ManyRelationshipDiff","SingleRelationshipDiff","args","ReactDOMServer","default","localeToUse","payload","config","localization","defaultLocale","titleFrom","titleTo","Promise","all","value","resolve","FromComponent","RelationshipDocumentDiff","showPill","title","ToComponent","fromHTML","renderToStaticMarkup","toHTML","diff","tokenizeByCharacter","className","From","label","To","fromArr","toArr","titlesFrom","titlesTo","map","val","makeNodes","list","titles","idx","fromNodes","length","toNodes","pillLabel","collectionConfig","collections","labels","singular","slug","_jsxs","id"],"sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Relationship/index.tsx"],"sourcesContent":["import type {\n PayloadRequest,\n RelationshipField,\n RelationshipFieldDiffServerComponent,\n TypeWithID,\n} from 'payload'\n\nimport { getTranslation, type I18nClient } from '@payloadcms/translations'\nimport { FieldDiffContainer, getHTMLDiffComponents } from '@payloadcms/ui/rsc'\n\nimport './index.scss'\n\nimport React from 'react'\n\nimport { generateLabelFromValue } from './generateLabelFromValue.js'\n\nconst baseClass = 'relationship-diff'\n\nexport type RelationshipValue =\n | { relationTo: string; value: number | string | TypeWithID }\n | (number | string | TypeWithID)\n\nexport const Relationship: RelationshipFieldDiffServerComponent = ({\n comparisonValue: valueFrom,\n field,\n i18n,\n locale,\n nestingLevel,\n parentIsLocalized,\n req,\n versionValue: valueTo,\n}) => {\n const hasMany =\n ('hasMany' in field && field.hasMany) ||\n // Check data structure (handles block swaps where schema may not match data)\n Array.isArray(valueFrom) ||\n Array.isArray(valueTo)\n const polymorphic = Array.isArray(field.relationTo)\n\n if (hasMany) {\n return (\n