import{v as _,ab as v,l as C,r as c,ax as p,aC as x,ac as D,a7 as I,aO as R,k,af as P,g as O}from"./vendor-core-BKehvho7.js";import{c as V,p as z}from"./index-B9hCLAJk.js";import{m as E,z as F,u as N,r as f}from"./index-D88CvPWT.js";import{_ as $}from"./index.vue_vue_type_script_setup_true_lang-BXNbK11E.js";import{_ as B}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./vendor-ui-CGT0cG1n.js";import"./useMessage-Cbhfk7Nk.js";const L={class:"size-full"},j=_({__name:"index",props:{version:{type:String,default:""},compAttrs:{type:Object,default:()=>({})}},setup(e){return(m,a)=>(v(),C("div",L,[c($,{compAttrs:e.compAttrs,version:e.version,bgColor:e.compAttrs?.bgColor,compType:p(E).IFRAME_ROUTES.ITEM.PREVIEW_REMOTE},null,8,["compAttrs","version","bgColor","compType"])]))}}),K={key:0,class:"size-full"},Q=_({__name:"index",setup(e){const m=x(),a=F(),A=new Map;D(E.PROVIDE_KEY_CALLBACKS,A);const{compId:t,version:r=""}=m.params,l=P(!1),o=V(t)(),d=O(()=>o.detail[r]);async function g(){if(await a.initSetting(),!t)throw new Error("compId is required");const n=await N.v1Comp.compcontrollerCompdetail({compId:t,version:r}),{objectId:u,version:s,files:y,dep:b}=n.data,w={objectId:u,version:s,files:y.map(i=>i.path)},S=await f.v1Comp.compcontrollerCompfilesosssignedurl(w),h=z(b,a.deps).map(i=>i.name),M=await f.v1Module.modulecontrollerPrebuild({deps:h}),{entryNameToFile:T={}}=M.data;o.setDetail(s,{...n.data,_id:t}),o.setDepEntryNameToFile(s,T),o.setVersionToFileAccessPath(s,S.data.signedUrls)}return I(async()=>{await g(),l.value=!0}),(n,u)=>l.value?(v(),C("div",K,[c(p(B),{isEmpty:!d.value,class:"size-full"},{default:R(()=>[c(j,{compAttrs:d.value,version:p(r)},null,8,["compAttrs","version"])]),_:1},8,["isEmpty"])])):k("",!0)}});export{Q as default};
