{"version":3,"file":"SEOSchema.BTDB2aBe.mjs","names":["__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","c","init_jsx_runtime","ce","addPropertyControls","init_framer_DxfB3JJo","ControlType","clean","o","r","k","v","SEOSchema","url","img","p","iso","d","data","SITE","ORG","m","id","elId","el","init_SEOSchema"],"sources":["https:/framerusercontent.com/modules/NdpBqey2sfFmMpyIhZfu/oRttc53Lg7xtP3XAnBHh/SEOSchema.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const SITE=\"BA Pipeline\";const ORG={\"@type\":\"SportsOrganization\",name:\"Baseball Alberta\",url:\"https://www.baseballalberta.com\",sport:\"Baseball\"};function clean(o){if(Array.isArray(o))return o.map(clean);if(o&&typeof o===\"object\"){const r={};for(const k of Object.keys(o)){const v=clean(o[k]);if(v!==\"\"&&v!==undefined&&v!==null&&!(typeof v===\"object\"&&!Array.isArray(v)&&Object.keys(v).length===0))r[k]=v;}return r;}return o;}/**\n * Adds schema.org structured data to the page head so search engines can read players, articles and videos.\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function SEOSchema(p){useEffect(()=>{if(typeof document===\"undefined\")return;const url=window.location.origin+window.location.pathname;const img=p.image?.src||\"\";const iso=(()=>{const d=new Date(p.date);return p.date&&!isNaN(d.getTime())?d.toISOString().slice(0,10):\"\";})();let data;if(p.kind===\"site\"){data=[{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",name:SITE,url:window.location.origin,publisher:ORG},{\"@context\":\"https://schema.org\",...ORG,subOrganization:{\"@type\":\"Organization\",name:SITE,url:window.location.origin}}];}else if(p.kind===\"person\"){data={\"@context\":\"https://schema.org\",\"@type\":\"Person\",name:p.name,url,image:img,description:p.description,jobTitle:[p.classYear&&\"Class of \"+p.classYear,p.position,\"Baseball Player\"].filter(Boolean).join(\" \"),knowsAbout:\"Baseball\",homeLocation:{\"@type\":\"Place\",name:\"Alberta, Canada\"},memberOf:p.team?{\"@type\":\"SportsTeam\",name:p.team,sport:\"Baseball\"}:undefined,alumniOf:undefined,affiliation:p.school?{\"@type\":\"CollegeOrUniversity\",name:p.school}:undefined,subjectOf:{\"@type\":\"WebPage\",name:p.name+\" | \"+SITE,url}};}else if(p.kind===\"article\"){data={\"@context\":\"https://schema.org\",\"@type\":\"NewsArticle\",headline:p.name,description:p.description,image:img?[img]:undefined,datePublished:iso,author:{\"@type\":p.author&&p.author!==\"BA Pipeline Staff\"?\"Person\":\"Organization\",name:p.author||SITE},publisher:{\"@type\":\"Organization\",name:SITE,parentOrganization:ORG},mainEntityOfPage:url};}else if(p.kind===\"video\"){const m=String(p.video||\"\").match(/(?:youtu\\.be\\/|v=|embed\\/|shorts\\/|live\\/)([\\w-]{11})/);const id=m?m[1]:\"\";data={\"@context\":\"https://schema.org\",\"@type\":\"VideoObject\",name:p.name,description:p.description||p.name+\" on \"+SITE,thumbnailUrl:id?\"https://i.ytimg.com/vi/\"+id+\"/hqdefault.jpg\":undefined,uploadDate:iso,embedUrl:id?\"https://www.youtube.com/embed/\"+id:undefined,contentUrl:id?\"https://www.youtube.com/watch?v=\"+id:undefined,publisher:{\"@type\":\"Organization\",name:SITE}};}if(!data)return;const elId=\"ba-schema-\"+p.kind;let el=document.getElementById(elId);if(!el){el=document.createElement(\"script\");el.type=\"application/ld+json\";el.id=elId;document.head.appendChild(el);}el.textContent=JSON.stringify(clean(data));},[p.kind,p.name,p.description,p.image?.src,p.date,p.author,p.team,p.position,p.classYear,p.school,p.video]);return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{...p.style,pointerEvents:\"none\"}});}SEOSchema.defaultProps={kind:\"site\",name:\"\",description:\"\",date:\"\",author:\"\",team:\"\",position:\"\",classYear:\"\",school:\"\",video:\"\"};addPropertyControls(SEOSchema,{kind:{type:ControlType.Enum,title:\"Type\",options:[\"site\",\"person\",\"article\",\"video\"]},name:{type:ControlType.String,title:\"Name\"},description:{type:ControlType.String,title:\"Description\"},image:{type:ControlType.ResponsiveImage,title:\"Image\"},date:{type:ControlType.String,title:\"Date\"},author:{type:ControlType.String,title:\"Author\"},team:{type:ControlType.String,title:\"Team\"},position:{type:ControlType.String,title:\"Position\"},classYear:{type:ControlType.String,title:\"Class\"},school:{type:ControlType.String,title:\"School\"},video:{type:ControlType.String,title:\"Video URL\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SEOSchema\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SEOSchema.map"],"mappings":"A,wLAA6Q,SAASU,EAAM,EAAE,CAAC,GAAG,MAAM,QAAQC,CAAC,EAAE,OAAOA,EAAE,IAAID,CAAK,EAAE,GAAGC,GAAG,OAAOA,GAAI,SAAS,CAAC,IAAMC,EAAE,CAAC,EAAE,IAAI,IAAMC,KAAK,OAAO,KAAKF,CAAC,EAAE,CAAC,IAAMG,EAAEJ,EAAMC,EAAEE,EAAE,EAAKC,IAAI,IAAIA,GAAmB,OAAQ,OAAOA,GAAI,UAAW,MAAM,QAAQA,CAAC,GAAG,OAAO,KAAKA,CAAC,CAAC,CAAC,SAAS,KAAG,EAAED,GAAGC,EAAE,CAAC,OAAOF,CAAE,CAAC,OAAOD,CAAE,CAIjiB,SAAwBI,EAAU,EAAE,CAA6uE,OAA5uET,MAAc,CAAC,GAAG,OAAO,SAAW,IAAY,OAAO,IAAMU,EAAIb,EAAO,SAAS,OAAOA,EAAO,SAAS,SAAec,EAAIC,EAAE,OAAO,KAAK,GAASC,OAAS,CAAC,IAAMC,EAAE,IAAI,KAAKF,EAAE,IAAI,EAAE,OAAOA,EAAE,MAAM,CAAC,MAAME,EAAE,QAAQ,CAAC,EAAEA,EAAE,YAAY,CAAC,CAAC,MA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