{"version":3,"file":"client-only.20615fc9.js","sources":["../../../../node_modules/nuxt/dist/app/components/client-only.js"],"sourcesContent":["import { createElementBlock, createElementVNode, defineComponent, h, mergeProps, onMounted, ref } from \"vue\";\nexport default defineComponent({\n name: \"ClientOnly\",\n inheritAttrs: false,\n // eslint-disable-next-line vue/require-prop-types\n props: [\"fallback\", \"placeholder\", \"placeholderTag\", \"fallbackTag\"],\n setup(_, { slots, attrs }) {\n const mounted = ref(false);\n onMounted(() => {\n mounted.value = true;\n });\n return (props) => {\n if (mounted.value) {\n return slots.default?.();\n }\n const slot = slots.fallback || slots.placeholder;\n if (slot) {\n return slot();\n }\n const fallbackStr = props.fallback || props.placeholder || \"\";\n const fallbackTag = props.fallbackTag || props.placeholderTag || \"span\";\n return createElementBlock(fallbackTag, attrs, fallbackStr);\n };\n }\n});\nconst cache = /* @__PURE__ */ new WeakMap();\nexport function createClientOnly(component) {\n if (cache.has(component)) {\n return cache.get(component);\n }\n const clone = { ...component };\n if (clone.render) {\n clone.render = (ctx, ...args) => {\n if (ctx.mounted$) {\n const res = component.render(ctx, ...args);\n return res.children === null || typeof res.children === \"string\" ? createElementVNode(res.type, res.props, res.children, res.patchFlag, res.dynamicProps, res.shapeFlag) : h(res);\n } else {\n return h(\"div\", mergeProps(ctx.$attrs ?? ctx._.attrs, { key: \"placeholder-key\" }));\n }\n };\n } else if (clone.template) {\n clone.template = `\n \n \n `;\n }\n clone.setup = (props, ctx) => {\n const mounted$ = ref(false);\n onMounted(() => {\n mounted$.value = true;\n });\n return Promise.resolve(component.setup?.(props, ctx) || {}).then((setupState) => {\n return typeof setupState !== \"function\" ? { ...setupState, mounted$ } : (...args) => {\n if (mounted$.value) {\n const res = setupState(...args);\n return res.children === null || typeof res.children === \"string\" ? createElementVNode(res.type, res.props, res.children, res.patchFlag, res.dynamicProps, res.shapeFlag) : h(res);\n } else {\n return h(\"div\", mergeProps(ctx.attrs, { key: \"placeholder-key\" }));\n }\n };\n });\n };\n cache.set(component, clone);\n return clone;\n}\n"],"names":["__nuxt_component_0","_","slots","attrs","mounted","ref","onMounted","props","_a","slot","fallbackStr","fallbackTag","createElementBlock"],"mappings":"6DACA,MAAeA,IAAgB,CAC7B,KAAM,aACN,aAAc,GAEd,MAAO,CAAC,WAAY,cAAe,iBAAkB,aAAa,EAClE,MAAMC,EAAG,CAAE,MAAAC,EAAO,MAAAC,CAAK,EAAI,CACzB,MAAMC,EAAUC,EAAI,EAAK,EACzB,OAAAC,EAAU,IAAM,CACdF,EAAQ,MAAQ,EACtB,CAAK,EACOG,GAAU,OAChB,GAAIH,EAAQ,MACV,OAAOI,EAAAN,EAAM,UAAN,YAAAM,EAAA,KAAAN,GAET,MAAMO,EAAOP,EAAM,UAAYA,EAAM,YACrC,GAAIO,EACF,OAAOA,EAAI,EAEb,MAAMC,EAAcH,EAAM,UAAYA,EAAM,aAAe,GACrDI,EAAcJ,EAAM,aAAeA,EAAM,gBAAkB,OACjE,OAAOK,EAAmBD,EAAaR,EAAOO,CAAW,CAC/D,CACG,CACH,CAAC","x_google_ignoreList":[0]}