{"version":3,"file":"ContentDoc.Bj32JgmO.js","sources":["../../../../node_modules/@nuxt/content/dist/runtime/composables/head.js","../../../../node_modules/@nuxt/content/dist/runtime/components/ContentDoc.vue"],"sourcesContent":["import { hasProtocol, joinURL, withTrailingSlash, withoutTrailingSlash } from \"ufo\";\nimport { useRoute, nextTick, useHead, unref, watch, useRuntimeConfig } from \"#imports\";\nexport const useContentHead = (_content, to = useRoute()) => {\n const content = unref(_content);\n const config = useRuntimeConfig();\n const refreshHead = (data = content) => {\n if (!to.path || !data) {\n return;\n }\n const head = Object.assign({}, data?.head || {});\n head.meta = [...head.meta || []];\n head.link = [...head.link || []];\n const title = head.title || data?.title;\n if (title) {\n head.title = title;\n if (process.server && !head.meta.some((m) => m.property === \"og:title\")) {\n head.meta.push({\n property: \"og:title\",\n content: title\n });\n }\n }\n const host = config.public.content.host;\n if (process.server && host) {\n const _url = joinURL(host ?? \"/\", config.app.baseURL, to.fullPath);\n const url = config.public.content.trailingSlash ? withTrailingSlash(_url) : withoutTrailingSlash(_url);\n if (!head.meta.some((m) => m.property === \"og:url\")) {\n head.meta.push({\n property: \"og:url\",\n content: url\n });\n }\n if (!head.link.some((m) => m.rel === \"canonical\")) {\n head.link.push({\n rel: \"canonical\",\n href: url\n });\n }\n }\n const description = head?.description || data?.description;\n if (description && head.meta.filter((m) => m.name === \"description\").length === 0) {\n head.meta.push({\n name: \"description\",\n content: description\n });\n }\n if (process.server && description && !head.meta.some((m) => m.property === \"og:description\")) {\n head.meta.push({\n property: \"og:description\",\n content: description\n });\n }\n const image = head?.image || data?.image;\n if (process.server && image && head.meta.filter((m) => m.property === \"og:image\").length === 0) {\n if (typeof image === \"string\") {\n head.meta.push({\n property: \"og:image\",\n // @ts-ignore - We expect `head.image` from Nuxt configurations...\n content: host && !hasProtocol(image) ? new URL(joinURL(config.app.baseURL, image), host).href : image\n });\n }\n if (typeof image === \"object\") {\n const imageKeys = [\n \"src\",\n \"secure_url\",\n \"type\",\n \"width\",\n \"height\",\n \"alt\"\n ];\n for (const key of imageKeys) {\n if (key === \"src\" && image.src) {\n const isAbsoluteURL = hasProtocol(image.src);\n const imageURL = isAbsoluteURL ? image.src : joinURL(config.app.baseURL, image.src ?? \"/\");\n head.meta.push({\n property: \"og:image\",\n content: host && !isAbsoluteURL ? new URL(imageURL, host).href : imageURL\n });\n } else if (image[key]) {\n head.meta.push({\n property: `og:image:${key}`,\n content: image[key]\n });\n }\n }\n }\n }\n if (process.client) {\n nextTick(() => useHead(head));\n } else {\n useHead(head);\n }\n };\n watch(() => unref(_content), refreshHead, { immediate: true });\n};\n","\n"],"names":["useContentHead","_content","to","useRoute","content","unref","config","useRuntimeConfig","watch","data","head","title","description","nextTick","useHead","ContentDoc","defineComponent","ctx","contentHead","slots","useSlots","tag","excerpt","path","query","shouldInjectContentHead","contentQueryProps","withTrailingSlash","emptyNode","slot","h","ContentQuery","refresh","isPartial","_a","ContentRenderer","bindings"],"mappings":"ksBAEO,MAAMA,EAAiB,CAACC,EAAUC,EAAKC,MAAe,CACrD,MAAAC,EAAUC,EAAMJ,CAAQ,EACxBK,EAASC,IAyFTC,EAAA,IAAMH,EAAMJ,CAAQ,EAxFN,CAACQ,EAAOL,IAAY,CACtC,GAAI,CAACF,EAAG,MAAQ,CAACO,EACf,OAEI,MAAAC,EAAO,OAAO,OAAO,IAAID,GAAA,YAAAA,EAAM,OAAQ,CAAA,CAAE,EAC/CC,EAAK,KAAO,CAAC,GAAGA,EAAK,MAAQ,CAAE,CAAA,EAC/BA,EAAK,KAAO,CAAC,GAAGA,EAAK,MAAQ,CAAE,CAAA,EACzB,MAAAC,EAAQD,EAAK,QAASD,GAAA,YAAAA,EAAM,OAC9BE,IACFD,EAAK,MAAQC,GAQFL,EAAO,OAAO,QAAQ,KAiB7B,MAAAM,GAAcF,GAAA,YAAAA,EAAM,eAAeD,GAAA,YAAAA,EAAM,aAC3CG,GAAeF,EAAK,KAAK,OAAQ,GAAM,EAAE,OAAS,aAAa,EAAE,SAAW,GAC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