import t from"@arcgis/core/popup/content/AttachmentsContent";import o from"@arcgis/core/popup/content/ExpressionContent";import r from"@arcgis/core/popup/content/FieldsContent";import e from"@arcgis/core/popup/content/MediaContent";import n from"@arcgis/core/popup/content/RelationshipContent";import i from"@arcgis/core/popup/content/TextContent";import{checkArg as p}from"../utilities/checkArg.js";import{deepClone as s}from"../utilities/object.js";export function jsonToContent(c){p("json",c).isNotMissing();const m=s(c);switch(c.type){case"attachments":return t.fromJSON(m);case"expression":return o.fromJSON(m);case"fields":return r.fromJSON(m);case"media":return e.fromJSON(m);case"text":return i.fromJSON(m);case"relationship":return n.fromJSON(m);default:throw new Error(`Unknown PopupContent type: ${JSON.stringify(m)}`)}}