const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Login.Bjji7XFF.js","assets/axios-vendor.B9ygI19o.js","assets/vue-vendor.CH68WEXx.js","assets/charts-vendor.DStlN2dP.js","assets/frontend-components.ChQM5M_M.js","assets/frontend-components.BVznxoVo.css","assets/Login.BnHMxjfl.css","assets/frontend-templates.CXFAUBcN.js"])))=>i.map(i=>d[i]); import{g as h,a as T,o as E,h as _,F as b,y,z as $,A,B as O}from"./vue-vendor.CH68WEXx.js";import{_ as g,b as v,a as s}from"./frontend-components.ChQM5M_M.js";import{a as d}from"./axios-vendor.B9ygI19o.js";import"./charts-vendor.DStlN2dP.js";(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))u(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&u(a)}).observe(document,{childList:!0,subtree:!0});function i(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function u(e){if(e.ep)return;e.ep=!0;const r=i(e);fetch(e.href,r)}})();const w={name:"App",components:{Toast:v},mounted(){this.$root.$on("update-seo-tags",t=>{this.updateSEOTags(t)})},beforeUnmount(){this.$root.$off("update-seo-tags")},watch:{$route(t){this.$nextTick(()=>{this.updateSEOTags(t),setTimeout(()=>{this.updateSEOTags(this.$route)},200)})},"$route.meta.seo":{handler(t){t&&this.updateSEOTags(this.$route)},deep:!0}},mounted(){d.get("/auth/csrf-token",{__skipCsrf:!0}).then(t=>{t.data&&t.data.success&&t.data.csrf_token&&window.csrfToken===void 0&&(window.csrfToken=t.data.csrf_token)}).catch(t=>{console.error("Error fetching CSRF token:",t)}),this.$nextTick(()=>{this.updateSEOTags(this.$route)}),setTimeout(()=>{this.updateSEOTags(this.$route)},100),this.$nextTick(()=>{this.$refs.toast&&(this.$root.$toast=this.$refs.toast,window.$toast=this.$refs.toast)}),setTimeout(()=>{this.$refs.toast&&(this.$root.$toast=this.$refs.toast,window.$toast=this.$refs.toast)},100)},methods:{updateSEOTags(t){var i,u,e,r;const o=((i=t.meta)==null?void 0:i.seo)||((e=(u=t.meta)==null?void 0:u.componentData)==null?void 0:e.menuItem)||((r=t.meta)==null?void 0:r.componentData);if(o){const a=o.meta_title||o.title;a&&a.trim()!==""&&a!=="CMS Site"&&(document.title=a);let n=document.querySelector('meta[name="description"]');const p=o.meta_description||o.description||"";p?n?n.setAttribute("content",p):(n=document.createElement("meta"),n.setAttribute("name","description"),n.setAttribute("content",p),document.head.appendChild(n)):n&&n.remove();let c=document.querySelector('meta[name="keywords"]');const m=o.meta_keywords||"";m?c?c.setAttribute("content",m):(c=document.createElement("meta"),c.setAttribute("name","keywords"),c.setAttribute("content",m),document.head.appendChild(c)):c&&c.remove()}}}};function L(t,o,i,u,e,r){const a=h("router-view"),n=h("Toast");return E(),T(b,null,[_(a),_(n,{ref:"toast"},null,512)],64)}const P=g(w,[["render",L]]),R=[{path:"/login",name:"Login",component:()=>s(()=>import("./Login.Bjji7XFF.js"),__vite__mapDeps([0,1,2,3,4,5,6]))},{path:"/",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5]))},{path:"/article/:alias",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5]))},{path:"/content/:alias",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5]))},{path:"/category/:alias",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5]))},{path:"/user/dashboard",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5])),meta:{userTab:"dashboard"}},{path:"/user/chatbots",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5])),meta:{userTab:"landings"}},{path:"/user/clients",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5])),meta:{userTab:"leads"}},{path:"/user/leads",redirect:"/user/clients"},{path:"/user/analytics",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5])),meta:{userTab:"analytics"}},{path:"/user/subscriptions",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5])),meta:{userTab:"subscriptions"}},{path:"/user/chatbots/edit/:id",name:"ChatbotEditorPage",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5])),meta:{userTab:"chatbot-editor"}},{path:"/user/landings",redirect:"/user/chatbots"},{path:"/user/landings/edit/:id",redirect:t=>`/user/chatbots/edit/${t.params.id}`},{path:"/user/subscriptions",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5])),meta:{userTab:"subscriptions"}},{path:"/user/options",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5])),meta:{userTab:"profile"}},{path:"/user",redirect:"/user/dashboard"},{path:"/:pathMatch(.*)*",component:()=>s(()=>import("./frontend-templates.CXFAUBcN.js").then(t=>t.T),__vite__mapDeps([7,4,2,3,1,5]))}];function D(){return y({history:typeof window>"u"?$():A("/"),routes:R})}let l=null;typeof window<"u"&&(l=D());const S=l;d.defaults.baseURL="/frontend/api";d.defaults.withCredentials=!0;d.defaults.headers.common["Content-Type"]="application/json";d.defaults.headers.common.Accept="application/json";d.interceptors.request.use(t=>{var o,i;return t.data instanceof FormData&&(typeof((o=t.headers)==null?void 0:o.delete)=="function"?t.headers.delete("Content-Type"):(delete t.headers["Content-Type"],(i=t.headers)!=null&&i.common&&delete t.headers.common["Content-Type"])),t});const f=O(P);f.use(S);f.mount("#app");