{"version":3,"file":"SEOJsonLd.DpSebjfM.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/45CG3vzFneAApSPICCNO/XR3qprDajCgQQqZAVYQu/SEOJsonLd.js"],"sourcesContent":["// User request: Create a new Framer code component file named SEOJsonLd.tsx with display name “SEO JSON-LD”. It must render SSR-visible <script type=\"application/ld+json\"> directly in returned JSX, with no useEffect, document, window, or DOM mutation. The component should visually occupy no space. Expose Framer property controls for schemaType with options Organization, SoftwareApplication, Article, FAQPage, and VideoObject; and editable string controls needed to populate each type: name, description, url, logoUrl, imageUrl, authorName, datePublished, dateModified, applicationCategory, operatingSystem, offersPrice, offersCurrency, faqJson, videoThumbnailUrl, videoUploadDate, videoDuration, videoEmbedUrl. Generate only the selected valid schema shape, omit empty optional fields, include @context and @type, parse faqJson safely as an array of {question, answer}, and escape < characters in serialized output to prevent script termination. Do not add client-only behavior. Keep all content editable through controls.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";function withOptional(base){const result={};for(const[key,value]of Object.entries(base)){if(value===undefined||value===null)continue;if(typeof value===\"string\"&&value.trim()===\"\")continue;if(Array.isArray(value)&&value.length===0)continue;result[key]=value;}return result;}function safeString(value){if(typeof value!==\"string\")return undefined;const trimmed=value.trim();return trimmed.length>0?trimmed:undefined;}function parseFaqItems(faqJson){try{const parsed=JSON.parse(faqJson);if(!Array.isArray(parsed))return[];return parsed.map(item=>{if(!item||typeof item!==\"object\")return null;const question=\"question\"in item&&typeof item.question===\"string\"?item.question.trim():\"\";const answer=\"answer\"in item&&typeof item.answer===\"string\"?item.answer.trim():\"\";if(!question||!answer)return null;return{\"@type\":\"Question\",name:question,acceptedAnswer:{\"@type\":\"Answer\",text:answer}};}).filter(Boolean);}catch{return[];}}function normalizeDateValue(value){if(value===undefined||value===null)return undefined;if(value instanceof Date){return Number.isNaN(value.getTime())?undefined:value.toISOString();}if(typeof value===\"number\"){const dateFromNumber=new Date(value);return Number.isNaN(dateFromNumber.getTime())?undefined:dateFromNumber.toISOString();}if(typeof value===\"string\"){const trimmed=value.trim();if(!trimmed)return undefined;const parsedDate=new Date(trimmed);return Number.isNaN(parsedDate.getTime())?undefined:parsedDate.toISOString();}return undefined;}/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function SEOJsonLd(props){const{schemaType,name,description,url,logoUrl,imageUrl,authorName,datePublished,dateModified,applicationCategory,operatingSystem,offersPrice,offersCurrency,faqJson,videoThumbnailUrl,videoUploadDate,videoDuration,videoEmbedUrl}=props;const normalizedDatePublished=useMemo(()=>normalizeDateValue(datePublished),[datePublished]);const normalizedDateModified=useMemo(()=>normalizeDateValue(dateModified),[dateModified]);const normalizedVideoUploadDate=useMemo(()=>normalizeDateValue(videoUploadDate),[videoUploadDate]);const normalizedName=useMemo(()=>safeString(name),[name]);const normalizedDescription=useMemo(()=>safeString(description),[description]);const normalizedUrl=useMemo(()=>safeString(url),[url]);const normalizedLogoUrl=useMemo(()=>safeString(logoUrl),[logoUrl]);const normalizedImageUrl=useMemo(()=>safeString(imageUrl),[imageUrl]);const normalizedAuthorName=useMemo(()=>safeString(authorName),[authorName]);const normalizedApplicationCategory=useMemo(()=>safeString(applicationCategory),[applicationCategory]);const normalizedOperatingSystem=useMemo(()=>safeString(operatingSystem),[operatingSystem]);const normalizedOffersPrice=useMemo(()=>safeString(offersPrice),[offersPrice]);const normalizedOffersCurrency=useMemo(()=>safeString(offersCurrency),[offersCurrency]);const normalizedVideoThumbnailUrl=useMemo(()=>safeString(videoThumbnailUrl),[videoThumbnailUrl]);const normalizedVideoDuration=useMemo(()=>safeString(videoDuration),[videoDuration]);const normalizedVideoEmbedUrl=useMemo(()=>safeString(videoEmbedUrl),[videoEmbedUrl]);const schemaObject=useMemo(()=>{if(schemaType===\"Organization\"){return withOptional({\"@context\":\"https://schema.org\",\"@type\":\"Organization\",name:normalizedName,description:normalizedDescription,url:normalizedUrl,logo:normalizedLogoUrl,image:normalizedImageUrl});}if(schemaType===\"SoftwareApplication\"){const offers=normalizedOffersPrice&&normalizedOffersCurrency?withOptional({\"@type\":\"Offer\",price:normalizedOffersPrice,priceCurrency:normalizedOffersCurrency}):undefined;return withOptional({\"@context\":\"https://schema.org\",\"@type\":\"SoftwareApplication\",name:normalizedName,description:normalizedDescription,url:normalizedUrl,applicationCategory:normalizedApplicationCategory,operatingSystem:normalizedOperatingSystem,offers});}if(schemaType===\"Article\"){return withOptional({\"@context\":\"https://schema.org\",\"@type\":\"Article\",headline:normalizedName,description:normalizedDescription,url:normalizedUrl,image:normalizedImageUrl,author:normalizedAuthorName?{\"@type\":\"Person\",name:normalizedAuthorName}:undefined,datePublished:normalizedDatePublished,dateModified:normalizedDateModified});}if(schemaType===\"FAQPage\"){const mainEntity=parseFaqItems(faqJson);return withOptional({\"@context\":\"https://schema.org\",\"@type\":\"FAQPage\",mainEntity});}return withOptional({\"@context\":\"https://schema.org\",\"@type\":\"VideoObject\",name:normalizedName,description:normalizedDescription,thumbnailUrl:normalizedVideoThumbnailUrl||normalizedImageUrl,uploadDate:normalizedVideoUploadDate,duration:normalizedVideoDuration,embedUrl:normalizedVideoEmbedUrl,url:normalizedUrl});},[schemaType,normalizedName,normalizedDescription,normalizedUrl,normalizedLogoUrl,normalizedImageUrl,normalizedAuthorName,normalizedDatePublished,normalizedDateModified,normalizedApplicationCategory,normalizedOperatingSystem,normalizedOffersPrice,normalizedOffersCurrency,faqJson,normalizedVideoThumbnailUrl,normalizedVideoUploadDate,normalizedVideoDuration,normalizedVideoEmbedUrl]);const serializedSchema=useMemo(()=>{return JSON.stringify(schemaObject).replace(/</g,\"\\\\u003c\");},[schemaObject]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:0,height:0,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",children:serializedSchema})});}SEOJsonLd.displayName=\"SEO JSON-LD\";addPropertyControls(SEOJsonLd,{schemaType:{type:ControlType.Enum,title:\"Schema Type\",defaultValue:\"Organization\",options:[\"Organization\",\"SoftwareApplication\",\"Article\",\"FAQPage\",\"VideoObject\"]},name:{type:ControlType.String,title:\"Name\",defaultValue:\"Example Name\"},description:{type:ControlType.String,title:\"Description\",defaultValue:\"Example description\",displayTextArea:true},url:{type:ControlType.String,title:\"URL\",defaultValue:\"https://example.com\"},logoUrl:{type:ControlType.String,title:\"Logo URL\",defaultValue:\"\"},imageUrl:{type:ControlType.String,title:\"Image URL\",defaultValue:\"\"},authorName:{type:ControlType.String,title:\"Author\",defaultValue:\"\"},datePublished:{type:ControlType.Date,title:\"Published\",defaultValue:\"2024-01-01T00:00:00.000Z\",displayTime:true},dateModified:{type:ControlType.Date,title:\"Modified\",defaultValue:\"2024-01-01T00:00:00.000Z\",displayTime:true},applicationCategory:{type:ControlType.String,title:\"App Category\",defaultValue:\"\"},operatingSystem:{type:ControlType.String,title:\"OS\",defaultValue:\"\"},offersPrice:{type:ControlType.String,title:\"Price\",defaultValue:\"\"},offersCurrency:{type:ControlType.String,title:\"Currency\",defaultValue:\"\",placeholder:\"USD\"},faqJson:{type:ControlType.String,title:\"FAQ JSON\",defaultValue:'[{\"question\":\"What is this?\",\"answer\":\"An example FAQ item.\"}]',displayTextArea:true},videoThumbnailUrl:{type:ControlType.String,title:\"Video Thumb\",defaultValue:\"\"},videoUploadDate:{type:ControlType.Date,title:\"Upload Date\",defaultValue:\"2024-01-01T00:00:00.000Z\",displayTime:true},videoDuration:{type:ControlType.String,title:\"Duration\",defaultValue:\"\",placeholder:\"PT2M30S\"},videoEmbedUrl:{type:ControlType.String,title:\"Embed URL\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SEOJsonLd\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}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