{"version":3,"file":"JSON_LD_Schema.DBQAGL4K.mjs","names":[],"sources":["https:/framerusercontent.com/modules/Sw0Diks9rVQN68mFtDuv/OOB4VYMKn4OzW8pGCQDi/JSON_LD_Schema.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";// Accepts raw JSON or a full <script type=\"application/ld+json\"> block\nfunction toJsonLd(input){const raw=(input??\"\").replace(/<script[^>]*>/gi,\"\").replace(/<\\/script>/gi,\"\").trim();if(!raw)return{ok:false,html:\"\",summary:\"Empty\"};try{const data=JSON.parse(raw);const type=Array.isArray(data)?\"Array\":data[\"@type\"]??\"Unknown\";const count=Array.isArray(data?.mainEntity)?` \\xb7 ${data.mainEntity.length} items`:\"\";// Escape \"<\" so content can never close the script tag early\nconst html=JSON.stringify(data).replace(/</g,\"\\\\u003c\");return{ok:true,html,summary:`${type}${count}`};}catch(error){return{ok:false,html:\"\",summary:\"Invalid JSON\"};}}/**\n * Outputs JSON-LD structured data into the page HTML.\n * Invisible on the published site; shows a small label on the canvas.\n *\n * @framerIntrinsicWidth 160\n * @framerIntrinsicHeight 24\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function JsonLdSchema(props){const{json=\"\"}=props;const{ok,html,summary}=toJsonLd(json);const isCanvas=RenderTarget.current()===RenderTarget.canvas;if(isCanvas){return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",minWidth:\"max-content\",padding:\"4px 8px\",borderRadius:6,fontSize:11,fontFamily:\"monospace\",color:ok?\"#0B6B3A\":\"#A61B1B\",background:ok?\"#E3F6EA\":\"#FBE4E4\"},children:`JSON-LD: ${summary}`});}if(!ok)return null;return /*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:html}});}addPropertyControls(JsonLdSchema,{json:{type:ControlType.String,title:\"JSON-LD\",displayTextArea:true,defaultValue:\"\",placeholder:'{\"@context\":\"https://schema.org\", ...}'}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"JsonLdSchema\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"160\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"24\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./JSON_LD_Schema.map"],"mappings":"oKACA,SAAS,EAAS,EAAM,CAAC,IAAM,GAAK,GAAO,GAAA,CAAI,QAAQ,kBAAkB,EAAE,CAAC,CAAC,QAAQ,eAAe,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,EAAI,MAAM,CAAC,GAAG,GAAM,KAAK,GAAG,QAAQ,OAAO,EAAE,GAAG,CAAC,IAAM,EAAK,KAAK,MAAM,CAAG,EAAQ,EAAK,MAAM,QAAQ,CAAI,EAAE,QAAQ,EAAK,UAAU,UAAgB,EAAM,MAAM,QAAQ,GAAM,UAAU,EAAE,SAAS,EAAK,WAAW,OAAO,QAAQ,GAC3R,MAAM,CAAC,GAAG,GAAK,KAA5D,KAAK,UAAU,CAAI,CAAC,CAAC,QAAQ,KAAK,SAA6B,EAAE,QAAQ,GAAG,IAAO,GAAO,CAAE,MAAa,CAAC,MAAM,CAAC,GAAG,GAAM,KAAK,GAAG,QAAQ,cAAc,CAAE,CAAC,CASnK,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,IAAI,EAAW,CAAC,KAAG,OAAK,WAAS,EAAS,CAAI,EAAsV,OAArU,EAAa,QAAQ,IAAI,EAAa,OAAwC,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,SAAS,cAAc,QAAQ,UAAU,aAAa,EAAE,SAAS,GAAG,WAAW,YAAY,MAAM,EAAG,UAAU,UAAU,WAAW,EAAG,UAAU,SAAS,EAAE,SAAS,YAAY,GAAS,CAAC,EAAO,EAAmC,EAAK,SAAS,CAAC,KAAK,sBAAsB,wBAAwB,CAAC,OAAO,CAAI,CAAC,CAAC,EAAzG,IAA2G,iBAX1f,IAAiE,EAW0b,EAAoB,EAAa,CAAC,KAAK,CAAC,KAAK,EAAY,OAAO,MAAM,UAAU,gBAAgB,GAAK,aAAa,GAAG,YAAY,wCAAwC,CAAC,CAAC"}