import{_ as C}from"./Ba76BwjT.js";import{u as N}from"./DuJ0NDcC.js";import{e as I,j as V,v as A,c as e,a as t,b as a,w as B,f as d,t as r,F as m,r as p,i as f,E,o,n as S,d as y,h as T,_ as $}from"./DpdQcRr7.js";import"./D1zzHZdQ.js";import"./BcpEzrWT.js";const D={class:"quest-page"},F={class:"quest-header"},L={class:"container header-inner"},M={class:"container quest-content"},Q={key:0,class:"state-box"},R={key:1,class:"state-box state-error"},j={key:2,class:"state-box"},z={key:3,class:"quest-list"},G=["onClick"],U={class:"quest-thumb"},H=["src","alt"],J={key:1,class:"no-image"},K={class:"quest-body"},O={class:"quest-top"},P={class:"quest-title"},W={class:"quest-stars"},X={class:"quest-desc"},Y={class:"quest-footer"},Z={class:"quest-meta"},tt={key:0,class:"quest-meta"},st={class:"quest-arrow"},et=I({__name:"index",setup(ot){const _=f([]),h=f(!1),c=f(null),k=async()=>{var l;h.value=!0,c.value=null;try{const s=await N("/api/user/quests",{method:"GET",params:{offset:0,limit:100}});s&&(_.value=s.items.filter(n=>n.unit==="A"))}catch(s){c.value=((l=s.data)==null?void 0:l.detail)||"予期せぬエラーが発生しました"}finally{h.value=!1}};V(()=>k());const w=A(),x=l=>w.push(`/user/quests/${l}`),v=l=>{const s=Math.min(l,5);return{filled:s,empty:5-s}};return(l,s)=>{const n=E("Icon"),b=C;return o(),e("div",D,[t("header",F,[t("div",L,[a(b,{to:"/user",class:"back-link"},{default:B(()=>[a(n,{icon:"mdi:arrow-left",width:20,height:20})]),_:1}),s[0]||(s[0]=t("span",{class:"unit-label"},"Unit A",-1)),s[1]||(s[1]=t("div",null,[t("h1",{class:"header-title"},"ワールド・エディター"),t("p",{class:"header-sub"},"既存変数の数値を書き換え、世界のルールを変える")],-1))])]),t("div",M,[d(h)?(o(),e("div",Q,[a(n,{icon:"mdi:loading",width:40,height:40,class:"spin"}),s[2]||(s[2]=t("p",null,"読み込み中...",-1))])):d(c)?(o(),e("div",R,[a(n,{icon:"mdi:alert-circle",width:40,height:40}),t("p",null,r(d(c)),1)])):d(_).length===0?(o(),e("div",j,[a(n,{icon:"mdi:folder-open-outline",width:40,height:40}),s[3]||(s[3]=t("p",null,"クエストはまだありません",-1))])):(o(),e("div",z,[(o(!0),e(m,null,p(d(_),(i,q)=>{var g;return o(),e("div",{key:i.id,class:"quest-card",style:S({"--delay":`${q*60}ms`}),onClick:u=>x(i.id)},[t("div",U,[i.image?(o(),e("img",{key:0,src:i.image,alt:i.title},null,8,H)):(o(),e("div",J,[a(n,{icon:"mdi:image-off",width:32,height:32}),s[4]||(s[4]=t("span",null,"No Image",-1))]))]),t("div",K,[t("div",O,[t("h2",P,r(i.title),1),t("div",W,[(o(!0),e(m,null,p(v(i.level).filled,u=>(o(),e("span",{key:"f"+u,class:"star filled"},"★"))),128)),(o(!0),e(m,null,p(v(i.level).empty,u=>(o(),e("span",{key:"e"+u,class:"star empty"},"☆"))),128))])]),t("p",X,r(i.description),1),t("div",Y,[t("span",Z,[a(n,{icon:"mdi:clock-outline",width:14,height:14}),y(" "+r(i.required_hour)+"時間 ",1)]),(g=i.quest_steps)!=null&&g.length?(o(),e("span",tt,[a(n,{icon:"mdi:format-list-numbered",width:14,height:14}),y(" "+r(i.quest_steps.length)+"ステップ ",1)])):T("",!0)])]),t("div",st,[a(n,{icon:"mdi:chevron-right",width:20,height:20})])],12,G)}),128))]))])])}}}),rt=$(et,[["__scopeId","data-v-1d945d6b"]]);export{rt as default};
