import { defineComponent, ref, reactive, mergeProps, unref, withCtx, createVNode, createBlock, openBlock, createTextVNode, toDisplayString, useSSRContext } from 'vue'; import { ssrRenderComponent, ssrRenderAttrs, ssrInterpolate } from 'vue/server-renderer'; import { u as useRouter, a as useConfigStore, b as useUserStore, A as APP_Milady_Date, h as generateOtp, e as api$1, v as verifyOtp, d as setToken, s as supabase, j as setPassword, k as setBirthday, m as setNames } from './server.mjs'; import OtpInput from 'vue3-otp-input'; import { _ as _sfc_main$2 } from './BasicInput-BEP6ZgUl.mjs'; import { _ as _sfc_main$1$1, a as _sfc_main$3 } from './BaseDatePicker-CBTFfZPt.mjs'; import { _ as _sfc_main$4 } from './BasicButton-B-4QDu9v.mjs'; import { B as BasicIconOld } from './BasicIconOld-I4c2ShMu.mjs'; import { _ as __nuxt_component_1 } from './FormItem-DY7uTw8_.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 'pinia'; import 'vue-router'; import '@supabase/supabase-js'; import '@babel/runtime/helpers/esm/extends'; import '@babel/runtime/helpers/esm/objectSpread2'; import '@ant-design/colors'; import '@ctrl/tinycolor'; import 'stylis'; import 'vue-types'; import 'lodash-es'; import 'axios'; import '@ant-design/icons-vue'; import 'vue3-lazyload'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; import 'unhead/plugins'; 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 './raf-ruCY1ktO.mjs'; import 'moment-jalaali'; import 'dayjalali'; import './index-BLBX3jXD.mjs'; import './index-Dxyzjwb5.mjs'; import 'dom-align'; import './useMergedState-BZEfJ8Fl.mjs'; import './move-BSi4LOZX.mjs'; import './shallowequal-DbdDzF9p.mjs'; import './slide-Bfj4jnqX.mjs'; import './_plugin-vue_export-helper-1tPrXgE0.mjs'; import './index-DqCYDGJX.mjs'; import 'throttle-debounce'; import 'lodash-es/cloneDeep.js'; import 'async-validator'; import 'lodash-es/find.js'; import './collapseMotion-cQ2SGjCA.mjs'; const _sfc_main$1 = /* @__PURE__ */ defineComponent({ __name: "index", __ssrInlineRender: true, setup(__props) { const router = useRouter(); const step = ref("mobile"); const config = useConfigStore(); const isBack = ref(false); const loading = ref(false); const user = useUserStore(); const form = reactive({ mobile: void 0, otp: void 0, password: void 0, first_name: void 0, last_name: void 0, birthday: void 0, agree: void 0 }); function handleOnChange(value) { } async function handleOnComplete(value) { form.otp = value; } const goNext = async () => { var _a; try { loading.value = true; if (step.value === "mobile") { const res = await generateOtp(form.mobile, "signup"); if ((_a = res == null ? void 0 : res.user) == null ? void 0 : _a.id) { api$1.error(config.useString("userHaveAccount")); router.push({ name: "auth-login" }); return; } isBack.value = false; step.value = "otp"; } else if (step.value === "otp") { const res = await verifyOtp(form.mobile, form.otp); console.log("res ===>", res); setToken(res.session.access_token); await supabase.auth.setSession(res.session); user.getUserInfo(); isBack.value = false; step.value = "password"; } else if (step.value === "password") { if (form.password.length < 6) { api$1.error(config.useString("minPassIs6")); return; } const res = await setPassword(form.password); isBack.value = false; step.value = "birthday"; } else if (step.value === "birthday") { const res = await setBirthday(form.birthday); isBack.value = false; step.value = "name"; } else if (step.value === "name") { const res = await setNames(form.first_name, form.last_name); isBack.value = false; step.value = "agree"; } else if (step.value === "agree") { await router.push({ name: "home" }); } } catch (e) { console.log("e ===>", e); } finally { loading.value = false; } }; return (_ctx, _push, _parent, _attrs) => { const _component_a_form_item = __nuxt_component_1; _push(`