import{r as c,w as G,_ as b,aH as w,o as f,c as p,aa as V,p as k,t as x,bH as B}from"./index.8d733f79.js";import{E as C}from"./el-image.a7c44d35.js";import"./el-image-viewer.42b4b63f.js";const j="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABwklEQVR4AdSTvS9DURjGn/f6iI1NB4OxEoJIhI0Y+Af8ATajjUQb37GyEQajwcAgBhEGiRaJm5CwWQxtYqikQ6Pc43n7cfX0FhVdnLxP7nufc87vfDuocflnwP4VMzqwbG6pxyp1P7hgRkp3zVqyGMwD6KTaAzII0UtTpXVhrw7L9PywgHSbqFwYg10mD1Q+BDuxLHo9g0kaGaoYfh81yoHqgbBE8g0TCQKYT9G8M4L5PkHLZVQ2kUUH/T36gagIFIFCEGrENMGbsYh0JV/xUl+P44Elc8plNsejMg7gcwX80QgAOXKCMztobcAquKehBtz0L5puhQvQA8GQ48Al+AhAmLIiAOTsQgoRQPdKG4cdQYzwGf3xJRjz85LEBho8GMClMlQxd7l/mqtc+pY4kLVsC+gYbHAwvTpVy6nL9WG3fFhAz8Eal7r/G3ke1lBSLKD6PJRnLnGqkli/Tem12s/VG6RQVgJAHko6PivrlcRLfVjof6b1bPsjUJ9W21fvmFuxVQBGtA3zNnoW1Jqhx9fAUzvnSaYqiXfwib5b+Gqba3n/5i1fzcpJLCrD8Yj0VqnBizk54Uz9sGbou39Iag78AAAA//8axopiAAAABklEQVQDAFpe/SmXUICOAAAAAElFTkSuQmCC";function P(d={}){const{maxConcurrent:u=4,autoStart:i=!0}=d,n=c([]),s=c([]),l=c(0),a=c({}),r=()=>{for(;l.value<u&&s.value.length>0;){const e=s.value.shift();a.value[e]="loading",l.value++,Q("load",e)}};G(n,e=>{const o=e.map(t=>t.imageId);s.value=o.filter(t=>!["loading","success"].includes(a.value[t])),i&&r()},{immediate:!0});const v=e=>{a.value[e]="success",l.value--,r()},g=e=>{a.value[e]="error",l.value--,r()},m=e=>{a.value[e]!=="loading"&&(s.value.unshift(e),r())},_=()=>{const e=Object.entries(a.value).filter(([o,t])=>t==="error").map(([o])=>o);s.value=[...e,...s.value],r()},h=e=>{a.value={},l.value=0,n.value=e},I=e=>{const o={};(e||[]).forEach(t=>{a.value[t.imageId]&&(o[t.imageId]=a.value[t.imageId])}),a.value=o,l.value=Object.values(a.value).filter(t=>t==="loading").length,n.value=e},A=c({load:[]}),L=(e,o)=>{A.value[e]&&A.value[e].push(o)},Q=(e,...o)=>{var t;(t=A.value[e])==null||t.forEach(E=>E(...o))};return{createImageList:h,updateImageList:I,loadStatus:a,handleLoadSuccess:v,handleLoadError:g,retryImage:m,retryAllFailed:_,on:L}}const S={class:"progressive-image","element-loading-background":"rgba(0,0,0,0.2)"},U={key:0,class:"original-img"},q={__name:"progressiveImage",props:{fit:{type:String,default:"cover"},imageId:{type:String,required:!0,default:""},status:{type:String,default:"initial"}},emits:["load","error"],setup(d,{emit:u}){const i=d,n="./",s=()=>`${n}/equipment-web/file/downloadImage?fileId=${i.imageId}`,l=()=>{u("load")},a=()=>{u("error")};return(r,v)=>{const g=C,m=B;return w((f(),p("div",S,[["initial","error"].includes(i.status)?x("",!0):(f(),p("div",U,[V(r.$slots,"default",{url:s()},()=>[k(g,{src:s(),fit:i.fit,onLoad:l,onError:a},null,8,["src","fit"])],!0)]))])),[[m,i.status==="initial"]])}}},R=b(q,[["__scopeId","data-v-66d3fe02"]]);export{j as _,R as p,P as u};
