import { defineComponent, ref, computed, withAsyncContext, watch, resolveDirective, unref, withCtx, createVNode, createBlock, openBlock, toDisplayString, createTextVNode, mergeProps, useSSRContext } from 'vue'; import { ssrRenderComponent, ssrRenderAttrs, ssrInterpolate, ssrRenderAttr, ssrRenderList, ssrGetDirectiveProps, ssrRenderStyle } from 'vue/server-renderer'; import { _ as _imports_0, a as _imports_1 } from './cart-DMkYna66.mjs'; import { _ as __nuxt_component_1, a as _sfc_main$6, b as _imports_2, c as _imports_3, d as _sfc_main$5, H as Highlights } from './Highlights-DaFoTGEN.mjs'; import { u as useRouter$1, a as useConfigStore, b as useUserStore, p as useCartStore, n as useIntersectionObserver, q as APP_TYPE, t as reactiveProjectName, o as getToken, x as getSupabaseStorageUrl, c as appName } from './server.mjs'; import { B as BasicIconOld } from './BasicIconOld-I4c2ShMu.mjs'; import numbro from 'numbro'; import { _ as _sfc_main$3 } from './BasicButton-BAlnoE_w.mjs'; import { U as UserProfilePic } from './UserProfilePic-DXA233hi.mjs'; import { l as loadGray, _ as _sfc_main$4 } from './gray-BanKC00A.mjs'; import { _ as _sfc_main$7 } from './FullScreenStories-QnVpPJpC.mjs'; import { u as useMediaStore } from './media-kxpEX2xr.mjs'; import { u as useUserPostStore } from './userPostsStore-CTOjnW_T.mjs'; import { u as useAsyncData } from './asyncData-C9E5x-0d.mjs'; import { B as Badge } from './index-CjBj1lyG.mjs'; import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs'; import '@babel/runtime/helpers/esm/objectSpread2'; import '@babel/runtime/helpers/esm/extends'; import './index-Dxyzjwb5.mjs'; import './raf-ruCY1ktO.mjs'; import 'dom-align'; import './media-BbtM6xvT.mjs'; import 'swiper/vue'; import './empty_user-BaUNCdgf.mjs'; import './post_loading-BiySI7bp.mjs'; import '../_/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:url'; import 'consola'; import 'ipx'; import 'node:path'; import 'node:crypto'; import './index-DVD7vSfp.mjs'; import '@vueuse/gesture'; import '@headlessui/vue'; import 'framesync'; import 'popmotion'; import 'style-value-types'; import 'lodash-es'; import 'pinia'; import '@supabase/supabase-js'; import '@ant-design/colors'; import '@ctrl/tinycolor'; import 'stylis'; import 'vue-types'; import 'axios'; import '@ant-design/icons-vue'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; import 'unhead/plugins'; import './index-DqCYDGJX.mjs'; import 'throttle-debounce'; import 'vue-content-loader'; import './BasicInput-BEP6ZgUl.mjs'; import './usePrice-B-5-jXKQ.mjs'; import './index--Q-kfs0Q.mjs'; import './FormItemContext-CDDW52IT.mjs'; import './statusUtils-C3ZNzkeD.mjs'; import './BaseInput-_gwhwanN.mjs'; import 'resize-observer-polyfill'; import './index-C1mihc8c.mjs'; import '../_/SearchOutlined.mjs'; import 'lodash-es/isPlainObject.js'; import './like-BhIOg3YL.mjs'; import 'swiper/modules'; const _sfc_main$2 = /* @__PURE__ */ defineComponent({ __name: "Seller", __ssrInlineRender: true, async setup(__props) { let __temp, __restore; const router = useRouter$1(); const selectedStoryId = ref(null); const visibleAdd = ref(false); const config = useConfigStore(); const user = useUserStore(); const mediaStore = useMediaStore(); const cartStore = useCartStore(); const userPost = useUserPostStore(); const seller = computed(() => { var _a; return (_a = config.sellerConfig) == null ? void 0 : _a.store; }); const userStory = computed(() => { return mediaStore.users.find((x) => { var _a; return x.id === ((_a = seller.value) == null ? void 0 : _a.id); }); }); const formatNumber = (num) => { if (num < 9999) return num; return numbro(num).format({ average: true, // Converts 11230 -> 11.2K, 1000000 -> 1M mantissa: 1 // Number of decimal places }); }; const videoThumbnails = ref({}); async function shareProfile() { var _a; if ((void 0).share) { try { await (void 0).share({ title: `${config.lang === "fa" ? `${appName.fa}` : `${appName.en}`}`, text: `${(_a = seller.value) == null ? void 0 : _a.bio}`, url: `${(void 0).location.origin}/user` }); } catch (error) { console.error("Sharing failed", error); } } else { alert("Web Share API not supported in this browser."); } } const observer = ref(); useIntersectionObserver(observer, async ([{ isIntersecting }]) => { if (isIntersecting && !userPost.loading && !userPost.endPage) { setTimeout(async () => { var _a; const nextPage = userPost.currentPage + 1; const data2 = await userPost.loadPosts((_a = seller.value) == null ? void 0 : _a.user_id, nextPage); userPost.loadStateNextPage(data2); }, 100); } }); const { data } = ([__temp, __restore] = withAsyncContext(async () => useAsyncData("productMainSeller", async () => { var _a; userPost.reset(); return await userPost.loadPosts((_a = seller.value) == null ? void 0 : _a.user_id, 1); })), __temp = await __temp, __restore(), __temp); watch(data, () => { if (data) { userPost.loadStateNextPage(data.value); } }); return (_ctx, _push, _parent, _attrs) => { var _a2, _b2, _c2, _d2; var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w; const _component_a_badge = Badge; const _component_a_popover = __nuxt_component_1; const _directive_lazy = resolveDirective("lazy"); let _temp0; _push(`