import{A as R,a as z}from"./AppSidebar-1e60a60d.js";import{d as A,r as v,c as E,o as B,L as K,A as I,n as _,J as M,w as u,e as k,f as y,h as l,j as c,t as x,i as L,C as Y,k as N,T as q,z as V,m as D,O as F,P as U,Q as W,R as H}from"./index-a0da86f0.js";import{I as $}from"./iconify-56cbf3ff.js";import{_ as O}from"./_plugin-vue_export-helper-c27b6911.js";import"./logo-a60c622a.js";import"./menu-ab8139a9.js";import"./slug-3db6ff8f.js";import"./DynamicIcon.vue_vue_type_script_setup_true_lang-623d7dfb.js";const j=["aria-label","title","onKeydown"],J={class:"progress-ring",viewBox:"0 0 48 48"},Q=["stroke-dasharray","stroke-dashoffset"],G=300,X=23,Z=A({__name:"BackToTop",setup(P){const t=v(!1),n=v(0),r=v([]),p=E(()=>2*Math.PI*X),h=E(()=>p.value*(1-n.value)),w=()=>{const o=[window],e=document.querySelector(".content-wrapper");return e&&o.push(e),document.querySelectorAll('[class*="scroll"], [class*="content"], [class*="wrapper"]').forEach(m=>{const a=window.getComputedStyle(m);(a.overflowY==="auto"||a.overflowY==="scroll"||a.overflow==="auto"||a.overflow==="scroll")&&(o.includes(m)||o.push(m))}),o},g=o=>{if(o===window)return{scrollTop:window.pageYOffset||document.documentElement.scrollTop||0,scrollHeight:document.documentElement.scrollHeight||document.body.scrollHeight||0,clientHeight:window.innerHeight||document.documentElement.clientHeight||0};{const e=o;return{scrollTop:e.scrollTop||0,scrollHeight:e.scrollHeight||0,clientHeight:e.clientHeight||0}}},i=()=>{r.value.forEach(e=>{e===window?window.scrollTo({top:0,behavior:"smooth"}):e.scrollTo({top:0,behavior:"smooth"})})};let s=null;const d=()=>{s===null&&(s=requestAnimationFrame(()=>{const o=r.value;if(o.length===0){s=null;return}let e=0,f=0;o.forEach(m=>{const a=g(m),b=a.scrollTop,S=a.scrollHeight-a.clientHeight;if(b>e&&(e=b),S>0){const T=Math.min(b/S,1);T>f&&(f=T)}}),n.value=f,t.value=e>G,s=null}))};return B(()=>{K(()=>{const o=w();r.value=o,o.forEach(e=>{e.addEventListener("scroll",d,{passive:!0})}),d()})}),I(()=>{r.value.forEach(o=>{o.removeEventListener("scroll",d)}),r.value=[],s!==null&&(cancelAnimationFrame(s),s=null)}),(o,e)=>(_(),M(q,{name:"back-to-top-fade"},{default:u(()=>[t.value?(_(),k("div",{key:0,class:"back-to-top-btn",role:"button",tabindex:"0","aria-label":c(x)("Back to top"),title:c(x)("Back to top"),onClick:i,onKeydown:[L(i,["enter"]),L(Y(i,["prevent"]),["space"])]},[(_(),k("svg",J,[e[0]||(e[0]=y("circle",{class:"progress-ring-bg",cx:"24",cy:"24",r:"23",fill:"none",stroke:"#d1d5db","stroke-width":"2"},null,-1)),y("circle",{class:"progress-ring-progress",cx:"24",cy:"24",r:"23",fill:"none",stroke:"#22c55e","stroke-width":"2","stroke-linecap":"round","stroke-dasharray":p.value,"stroke-dashoffset":h.value},null,8,Q)])),l(c($),{icon:"tabler:arrow-up",width:20,height:20,class:"arrow-icon"})],40,j)):N("",!0)]),_:1}))}});const ee=O(Z,[["__scopeId","data-v-1b4f2300"]]),oe={class:"content-wrapper"},C="app.sidebar.collapsed",te=A({__name:"AppLayout",setup(P){const t=v(localStorage.getItem(C)==="true"),n=v(!1),r=()=>{n.value=window.innerWidth<768,n.value&&(t.value=!0)},p=()=>{t.value=!t.value},h=()=>{t.value=!0},w=()=>{t.value=!1},g=()=>{n.value&&(t.value=!0)},i=()=>{r()};return B(()=>{r(),window.addEventListener("resize",i)}),I(()=>{window.removeEventListener("resize",i)}),V(t,s=>{localStorage.setItem(C,String(s))}),(s,d)=>{const o=D("router-view");return _(),M(c(H),{"has-sider":"",class:"app-layout"},{default:u(()=>[l(c(F),{bordered:"","collapse-mode":"width","collapsed-width":64,width:240,collapsed:t.value,"onUpdate:collapsed":d[0]||(d[0]=e=>t.value=e),"show-trigger":!n.value,responsive:!0,breakpoint:768,onCollapse:h,onExpand:w},{default:u(()=>[l(R,{collapsed:t.value,onMenuSelect:g},null,8,["collapsed"])]),_:1},8,["collapsed","show-trigger"]),l(c(H),null,{default:u(()=>[l(c(U),{bordered:""},{default:u(()=>[l(z,{onToggleSidebar:p})]),_:1}),l(c(W),null,{default:u(()=>[y("div",oe,[l(o)])]),_:1})]),_:1}),n.value&&!t.value?(_(),k("div",{key:0,class:"mobile-overlay",onClick:p})):N("",!0),l(ee)]),_:1})}}});const ue=O(te,[["__scopeId","data-v-7c9a0753"]]);export{ue as default};
