import{c as S,o as B,q as R,t as T,d as C,r as h,bE as N,x as b,bF as _,K as F,g as H,h as I,j as i,A as U,bG as k,bH as W,L as j,C as y,s as q,n as P,bI as A}from"./index-6199309f.js";import{u as G}from"./index-ecb0d945.js";const[K,f,M]=S("list"),V={error:Boolean,offset:B(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:R("down"),loadingText:String,finishedText:String,immediateCheck:T};var z=C({name:K,props:V,emits:["load","update:error","update:loading"],setup(e,{emit:c,slots:n}){const a=h(e.loading),r=h(),d=h(),o=G(),l=N(r),s=()=>{U(()=>{if(a.value||e.finished||e.disabled||e.error||(o==null?void 0:o.value)===!1)return;const{direction:t}=e,g=+e.offset,u=k(l);if(!u.height||W(r))return;let v=!1;const m=k(d);t==="up"?v=u.top-m.top<=g:v=m.bottom-u.bottom<=g,v&&(a.value=!0,c("update:loading",!0),c("load"))})},w=()=>{if(e.finished){const t=n.finished?n.finished():e.finishedText;if(t)return i("div",{class:f("finished-text")},[t])}},$=()=>{c("update:error",!1),s()},E=()=>{if(e.error){const t=n.error?n.error():e.errorText;if(t)return i("div",{role:"button",class:f("error-text"),tabindex:0,onClick:$},[t])}},L=()=>{if(a.value&&!e.finished&&!e.disabled)return i("div",{class:f("loading")},[n.loading?n.loading():i(j,{class:f("loading-icon")},{default:()=>[e.loadingText||M("loading")]})])};return b(()=>[e.loading,e.finished,e.error],s),o&&b(o,t=>{t&&s()}),_(()=>{a.value=e.loading}),F(()=>{e.immediateCheck&&s()}),H({check:s}),I("scroll",s,{target:l,passive:!0}),()=>{var t;const g=(t=n.default)==null?void 0:t.call(n),u=i("div",{ref:d,class:f("placeholder")},null);return i("div",{ref:r,role:"feed",class:f(),"aria-busy":a.value},[e.direction==="down"?g:u,L(),w(),E(),e.direction==="up"?g:u])}}});const Y=y(z),[D,x]=S("progress"),J={color:String,inactive:Boolean,pivotText:String,textColor:String,showPivot:T,pivotColor:String,trackColor:String,strokeWidth:P,percentage:{type:P,default:0,validator:e=>+e>=0&&+e<=100}};var O=C({name:D,props:J,setup(e){const c=q(()=>e.inactive?void 0:e.color),n=()=>{const{textColor:a,pivotText:r,pivotColor:d,percentage:o}=e,l=r!=null?r:`${o}%`;if(e.showPivot&&l){const s={color:a,left:`${+o}%`,transform:`translate(-${+o}%,-50%)`,background:d||c.value};return i("span",{style:s,class:x("pivot",{inactive:e.inactive})},[l])}};return()=>{const{trackColor:a,percentage:r,strokeWidth:d}=e,o={background:a,height:A(d)},l={width:`${r}%`,background:c.value};return i("div",{class:x(),style:o},[i("span",{class:x("portion",{inactive:e.inactive}),style:l},null),n()])}}});const Z=y(O);export{Y as L,Z as P};