{"version":3,"file":"VideoSchema.DUkBWE5W.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/QrstHRZnqgoxsgH7Mxwe/rR5bDsN4xbbhC1bGkbSQ/VideoSchema.js"],"sourcesContent":["/**\n * User request:\n * Create a new Framer code component named \"VideoSchema\".\n * Purpose: output SEO structured data (JSON-LD) for a single video on CMS detail pages.\n * Render only an invisible/zero-footprint <script type=\"application/ld+json\"> tag with a schema.org VideoObject.\n * Render on static export (SSR) by outputting the script directly in JSX.\n * Omit fields whose values are empty.\n * Expose string property controls for:\n * name, description, thumbnailUrl, uploadDate, contentUrl, embedUrl, duration.\n * Normalize uploadDate when it is only a year (e.g. \"2025\" -> \"2025-01-01\").\n * Keep minimal and dependency-free.\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function VideoSchema(props){const toSafeString=value=>{if(value===null||value===undefined)return\"\";if(typeof value===\"string\")return value;if(typeof value===\"number\"||typeof value===\"boolean\"){return String(value);}if(typeof value===\"object\"){const candidate=value;if(typeof candidate.src===\"string\")return candidate.src;if(typeof candidate.url===\"string\")return candidate.url;if(typeof candidate.href===\"string\")return candidate.href;}return\"\";};const{name:rawName=\"\",description:rawDescription=\"\",thumbnailUrl:rawThumbnailUrl=\"\",uploadDate:rawUploadDate=\"\",contentUrl:rawContentUrl=\"\",embedUrl:rawEmbedUrl=\"\",duration:rawDuration=\"\"}=props;const name=toSafeString(rawName);const description=toSafeString(rawDescription);const thumbnailUrl=toSafeString(rawThumbnailUrl);const uploadDate=toSafeString(rawUploadDate);const contentUrl=toSafeString(rawContentUrl);const embedUrl=toSafeString(rawEmbedUrl);const duration=toSafeString(rawDuration);const normalizedUploadDate=useMemo(()=>{const trimmed=uploadDate.trim();if(/^\\d{4}$/.test(trimmed))return`${trimmed}-01-01`;return trimmed;},[uploadDate]);const schemaJson=useMemo(()=>{const videoObject={\"@context\":\"https://schema.org\",\"@type\":\"VideoObject\"};if(name.trim())videoObject.name=name.trim();if(description.trim())videoObject.description=description.trim();if(thumbnailUrl.trim())videoObject.thumbnailUrl=thumbnailUrl.trim();if(normalizedUploadDate)videoObject.uploadDate=normalizedUploadDate;if(contentUrl.trim())videoObject.contentUrl=contentUrl.trim();if(embedUrl.trim())videoObject.embedUrl=embedUrl.trim();if(duration.trim())videoObject.duration=duration.trim();return JSON.stringify(videoObject);},[name,description,thumbnailUrl,normalizedUploadDate,contentUrl,embedUrl,duration]);return /*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:schemaJson}});}addPropertyControls(VideoSchema,{name:{type:ControlType.String,title:\"Name\",defaultValue:\"\"},description:{type:ControlType.String,title:\"Description\",defaultValue:\"\",displayTextArea:true},thumbnailUrl:{type:ControlType.String,title:\"Thumbnail URL\",defaultValue:\"\"},uploadDate:{type:ControlType.String,title:\"Upload Date\",defaultValue:\"\"},contentUrl:{type:ControlType.String,title:\"Content URL\",defaultValue:\"\"},embedUrl:{type:ControlType.String,title:\"Embed URL\",defaultValue:\"\"},duration:{type:ControlType.String,title:\"Duration\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoSchema\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoSchema.map"],"mappings":"0KAcG,SAAwB,EAAY,EAAM,CAAC,IAAM,EAAa,GAAO,CAAC,GAAG,GAAQ,KAAwB,MAAM,GAAG,GAAG,OAAO,GAAQ,SAAS,OAAO,EAAM,GAAG,OAAO,GAAQ,UAAU,OAAO,GAAQ,UAAW,OAAO,OAAO,EAAM,CAAE,GAAG,OAAO,GAAQ,SAAS,CAAC,IAAM,EA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