import{M as y,b as g,_ as w}from"./app-QjDgb7aF.js";import{b as B,w as b,a as r,E as f,j as l,g as M,i as m,p as d,k as v,y as $,q as i,J as k,D as h,T as C}from"./vue-Cm77DuTi.js";const F=B({components:{MkButton:y},props:{p:{type:Function,required:!0}},setup(e,t){const s=r(!0),n=r(!1),o=r(!1),u=r(null),a=()=>{if(e.p==null)return;const p=e.p();s.value=!0,n.value=!1,o.value=!1,p.then(_=>{s.value=!1,n.value=!0,u.value=_}),p.catch(()=>{s.value=!1,o.value=!0})};return b(()=>e.p,()=>{a()},{immediate:!0}),{pending:s,resolved:n,rejected:o,result:u,retry:()=>{a()},i18n:g}}}),N={key:0},S={key:1},T={key:2},V={class:"wszdbhzo"};function j(e,t,s,n,o,u){const a=f("MkLoading"),c=f("MkButton");return l(),M(C,{name:e.$store.state.animation?"fade":"",mode:"out-in"},{default:m(()=>[e.pending?(l(),d("div",N,[v(a)])):e.resolved?(l(),d("div",S,[$(e.$slots,"default",{result:e.result},void 0,!0)])):(l(),d("div",T,[i("div",V,[i("div",null,[t[0]||(t[0]=i("i",{class:"ph-warning ph-bold ph-lg"},null,-1)),k(" "+h(e.i18n.ts.somethingHappened),1)]),v(c,{inline:"",class:"retry",onClick:e.retry},{default:m(()=>[t[1]||(t[1]=i("i",{class:"ph-arrow-clockwise ph-bold ph-lg"},null,-1)),k(" "+h(e.i18n.ts.retry),1)]),_:1},8,["onClick"])])]))]),_:3},8,["name"])}const D=w(F,[["render",j],["__scopeId","data-v-f2e69c0b"]]);export{D as F};
//# sourceMappingURL=suspense-jJyLIr98.js.map
