/* Copyright © 2024 Melbet - All Rights Reserved */ import{getCurrentInstance as d,unref as l,computed as f}from"../../../../shared-assets/__shared_vue_deps_4ZTCVFCX.js";import{useLogger as L}from"./entry-ABm-H_wC.js";const P=t=>t.replace(/\/{2,}/g,"/").replace(/\/$/,""),m=t=>P(t.toLowerCase()),y=()=>{var t,r,e;const a=d();return(e=(r=(t=a==null?void 0:a.appContext)==null?void 0:t.app)==null?void 0:r.$nuxt)==null?void 0:e._route},O=()=>{var t,r,e;const a=d();return(e=(r=(t=a==null?void 0:a.appContext)==null?void 0:t.app)==null?void 0:r.$nuxt)==null?void 0:e.$router};var w={},W=Object.defineProperty,b=Object.defineProperties,$=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,_=(t,r,e)=>r in t?W(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,g=(t,r)=>{for(var e in r||(r={}))x.call(r,e)&&_(t,e,r[e]);if(v)for(var e of v(r))I.call(r,e)&&_(t,e,r[e]);return t},h=(t,r)=>b(t,$(r));const N=t=>{const r=O(),e=y(),a=L(),i=o=>{var n,u;const s=l(o);if(typeof s=="string"){const p=`/${l(t)}`;return s.startsWith(p)||!s.startsWith("/")?s:`${p}${s}`}return h(g({},s),{params:h(g({},s.params),{lng:(u=(n=s.params)==null?void 0:n.lng)!=null?u:l(t)})})},c=o=>{try{return w.IS_LANDING?r.resolve(i(o)).fullPath:m(r.resolve(i(o)).fullPath)}catch(n){return"/"}};return{getLocationWithLang:i,getLinkWithLang:c,routerPushWithLang:async o=>{const n=c(o);try{return l(e).fullPath===n?void 0:await r.push(n)}catch(u){a.error("routerPushWithLang: ",u)}},routerReplaceWithLang:async o=>{const n=c(o);try{return l(e).fullPath===n?void 0:await r.replace(n)}catch(u){a.error("routerReplaceWithLang: ",u)}},useLangLocation:o=>f(()=>c(o))}};export{N as useRouterMethodsWithLang};