import{I as x,k as D,m as C,u as B}from"./index-D88CvPWT.js";import{e as I,f as g,aG as $,r as L}from"./vendor-ui-CGT0cG1n.js";import{v as S,aA as z,ab as o,j as l,aO as c,l as R,ai as w,k as _,i as y,ap as h,ax as a,r as v,Z as M,af as k,aC as A,aD as O,ac as T,a7 as N,a9 as V,aF as P,p as K,q as b,g as j}from"./vendor-core-BKehvho7.js";/* empty css                */import{_ as F}from"./index.vue_vue_type_style_index_0_lang-BZ1LzI3x.js";import{u as E}from"./useTeamHeaders-DxHN7-t0.js";import{c as H,a as U}from"./index.vue_vue_type_script_setup_true_lang-CmmAEEXC.js";const Y={class:"flex items-center justify-between px-3 py-2 select-none"},q={class:"text-sm font-medium"},G={class:"flex gap-[6px]"},Z={key:0,class:"flex-1 p-2 overflow-auto"},J=S({__name:"BasePane",props:{title:{type:String,default:""},actions:{type:Array,default:()=>["close","maximize","minimize"]}},emits:["close","maximize","minimize"],setup(t,{emit:i}){const{t:p}=z(),m=t,n=i,e=k(!1),d=k(!1);function f(){n("close")}function u(){e.value=!e.value,n("maximize",e.value)}function s(r){return m.actions.includes(r)}return(r,ee)=>(o(),l(a(g),{"body-class":"pane-body","header-class":"pane-header",class:M(["pane-card w-full h-full",{"pane-maximized":e.value}])},{header:c(()=>[y("div",Y,[y("div",q,h(t.title),1),y("div",G,[w(r.$slots,"beforeActions",{},void 0,!0),s("close")?(o(),l(a(I),{key:0,type:"primary",circle:"",onClick:f},{default:c(()=>[v(a(x),{icon:"material-symbols:close"})]),_:1})):_("",!0),s("maximize")?(o(),l(a(I),{key:1,type:"primary",circle:"",title:a(p)("common.maximizeRestore"),onClick:u},{default:c(()=>[e.value?(o(),l(a(x),{key:1,icon:"material-symbols:fullscreen-exit"})):(o(),l(a(x),{key:0,icon:"material-symbols:fullscreen"}))]),_:1},8,["title"])):_("",!0)])])]),default:c(()=>[d.value?_("",!0):(o(),R("div",Z,[w(r.$slots,"default",{isMaximized:e.value},void 0,!0)]))]),_:3},8,["class"]))}}),re=D(J,[["__scopeId","data-v-5116a325"]]),Q={class:"min-h-[400px]"},W=S({__name:"index",setup(t){const i=A(),p=O(),{compId:m}=i.params,{headers:n}=E(),e=H(i.path)();T(C.PROVIDE_KEY_COMP_LIST_STORE,e);const d=new Map;T(C.PROVIDE_KEY_CALLBACKS,d);const f=async()=>{if(e.setLoading(!0),!m)return;const s=await B.v1Comp.compcontrollerSimilarcomps({compId:m},{headers:n}),{rows:r}=s.data||{};await e.renderList(r),e.setLoading(!1)};function u(s){p.push({path:`/preview/${s}`})}return N(()=>{f()}),V(()=>{e.$reset()}),(s,r)=>(o(),R("div",Q,[v(U,{compType:a(C).IFRAME_ROUTES.CONTAINER.SIMILAR,onPreview:u},null,8,["compType"])]))}}),X={ref:"similarComp",class:"mt-[10px] overflow-hidden"},le=S({__name:"index",props:{mdSrc:{type:String,default:""},compDesc:{type:String,default:""},scrollContainer:{type:String,default:""},stickyTopDistance:{type:Number,default:45},showSimilarComp:{type:Boolean,default:!0}},setup(t){const{t:i}=z(),{teamId:p}=E(),m=j(()=>i(p?"team.similarCompInTeam":"team.similarComp")),n=k(!1),e=P("similarComp");return $(e,([d])=>{n.value||(n.value=d?.isIntersecting||!1)}),(d,f)=>{const u=L,s=g;return o(),l(F,{showToc:!0,src:t.mdSrc,scrollContainer:t.scrollContainer,stickyTopDistance:t.stickyTopDistance},K({empty:c(()=>[b(h(t.compDesc||a(i)("common.noReadme")),1)]),_:2},[t.showSimilarComp?{name:"footer",fn:c(()=>[y("div",X,[v(u,{"content-position":"center"},{default:c(()=>[b(h(m.value),1)]),_:1}),v(s,{"body-class":"!p-1",class:"mt-[10px]"},{default:c(()=>[n.value?(o(),l(W,{key:0})):_("",!0)]),_:1})],512)]),key:"0"}:void 0]),1032,["src","scrollContainer","stickyTopDistance"])}}});export{re as B,le as _};
