import{a as p,r as _,aB as y,f as d,w as m,at as w,c as n,o,b as I,R as k,a9 as O,t as v,L as c,S as L,K as R,T as b,ap as x}from"./vue.D1BjjNmv.js";const B={class:"layout-padding layout-padding-unset layout-iframe"},S={class:"layout-padding-auto layout-padding-view"},T=["src","data-url"],K=p({name:"layoutIframeView"}),V=p({...K,props:{refreshKey:{type:String,default:()=>""},name:{type:String,default:()=>"slide-right"},list:{type:Array,default:()=>[]}},setup(f){const r=f,l=_(),i=y(),h=d(()=>r.list.filter(e=>{var t;return(t=e.meta)==null?void 0:t.isIframeOpen})),g=d(()=>i.path),u=(e,t)=>{v(()=>{if(!l.value)return!1;l.value.forEach(s=>{s.dataset.url===e&&(s.onload=()=>{var a;(a=t.meta)!=null&&a.isIframeOpen&&t.meta.loading&&(t.meta.loading=!1)})})})};return m(()=>i.fullPath,e=>{const t=r.list.find(s=>s.path===e);if(!t)return!1;t.meta.isIframeOpen||(t.meta.isIframeOpen=!0),u(e,t)},{immediate:!0}),m(()=>r.refreshKey,()=>{const e=r.list.find(t=>t.path===i.path);if(!e)return!1;e.meta.isIframeOpen&&(e.meta.isIframeOpen=!1),setTimeout(()=>{e.meta.isIframeOpen=!0,e.meta.loading=!0,u(i.fullPath,e)})},{deep:!0}),(e,t)=>{const s=w("loading");return o(),n("div",B,[I("div",S,[(o(!0),n(k,null,O(h.value,a=>c((o(),n("div",{class:"w100",key:a.path,"element-loading-background":"white"},[L(x,{name:f.name,mode:"out-in"},{default:R(()=>[c((o(),n("iframe",{src:a.meta.isLink,key:a.path,frameborder:"0",height:"100%",width:"100%",style:{position:"absolute"},"data-url":a.path,ref_for:!0,ref_key:"iframeRef",ref:l},null,8,T)),[[b,g.value===a.path]])]),_:2},1032,["name"])])),[[s,a.meta.loading]])),128))])])}}});export{V as default};
