import{d as l,ah as p,ag as d,r as g,Z as m,$ as u,c as e,aj as h,L as y,m as v,g as f}from"./index.8f93de0e.js";import{g as b}from"./index.9f3d4e65.js";import{s as c}from"./index.module.8ffd3a0e.js";import{I as x}from"./index.a2e558d4.js";var O=l({name:"accompany",setup(I,A){const s=p(),n=d(),t=g({childPath:"",svgs:[],musicTreeActive:""}),i=async()=>{try{const a=await v.get(f.platformApi+"/musicSheetCategories/queryTree?enable=true");Array.isArray(a==null?void 0:a.data)&&(t.svgs=a.data.map((o,C)=>({...o,id:o.id,icon:o.coverImg,btnIcon:b("b2.svg"),color:"#9881FF",title:o.name,subtitle:"",btnText:"GO >"})),console.log("\u{1F680} ~ data.svgs",t.svgs))}catch(a){console.log(a)}r()},r=()=>{const a=(s==null?void 0:s.path)||"accompany";t.childPath=a.replace(/\//g,"")||"accompany",console.log("\u{1F680} ~ route.path",t.childPath)};return m(()=>s.path,()=>{r()}),u(()=>{i()}),()=>e("div",{class:c.accompany},[e(h,null,null),e("div",{class:c.accompanyCategory},[t.svgs.map(a=>e("div",{class:c.container,onClick:()=>{n.push({path:"/musicList",query:{categorieid:a.id}})}},[e(x,{src:a.icon,width:"100%",height:"100%"},{loading:()=>e(y,{type:"spinner",size:"20"},null)})]))])])}});export{O as default};
