import{_ as h}from"./Ba76BwjT.js";import{e as y,x as w,K as g,j as k,c as r,f as s,a as n,b as p,t as N,w as B,H as C,h as I,L as Q,i as l,G as V,E as M,o as u,d as T,_ as b}from"./DpdQcRr7.js";import{Q as E}from"./C6h_BhZr.js";import{M as L}from"./DAqvLAaI.js";import{u as R}from"./DuJ0NDcC.js";import"./BcpEzrWT.js";import"./D1zzHZdQ.js";const j={key:0,class:"quest-loading has-text-centered py-6"},A={class:"icon is-large"},D={key:1,class:"quest-error"},G={class:"notification is-warning"},H=y({__name:"[id]",setup(K){const _=w(),m=V(()=>_.params.id),c=l(!0),o=l(null),d=l([]),a=l(null),i=async()=>{c.value=!0,a.value=null;try{const e=await R(`/api/admin/quests/${m.value}`);e!=null&&e.quest?(o.value=new E(e.quest),d.value=(e.mod_templates||[]).map(t=>new L(t))):(a.value="クエストが見つかりませんでした",o.value=null)}catch(e){console.error("クエストの取得に失敗しました:",e),a.value="クエストの取得に失敗しました",o.value=null}finally{c.value=!1}},f=()=>{i()};return g(m,()=>{i()}),k(async()=>{await i()}),(e,t)=>{const v=M("Icon"),q=h,x=Q;return u(),r("div",null,[s(c)?(u(),r("div",j,[n("span",A,[p(v,{icon:"mdi:loading",class:"mdi-spin"})]),t[0]||(t[0]=n("p",null,"読み込み中...",-1))])):s(a)?(u(),r("div",D,[n("div",G,[n("p",null,N(s(a)),1),p(q,{to:"/admin/quests",class:"button is-small mt-3"},{default:B(()=>[...t[1]||(t[1]=[T(" 一覧に戻る ",-1)])]),_:1})])])):s(o)?(u(),C(x,{key:2,quest:s(o),"mod-templates":s(d),"refetch-quest":f},null,8,["quest","mod-templates"])):I("",!0)])}}}),U=b(H,[["__scopeId","data-v-05e10d8f"]]);export{U as default};
