1import{v as M,A as _,ar as c,a$ as z,bh as B,a0 as k,aN as E,bb as $,bd as C,bk as H,l as T,k as I,m as O,by as q,bz as A,M as V,c as Y,b as j,$ as D,bl as L,H as N}from"./DTmc-LR8.js";function U(g){const{child:h,parent:n,from:p,to:l}=g,o=M(_,void 0),s=c(0),d=c(0),{height:v}=z(),i={height:v,top:c(0),left:c(0)},u=B(h),t=B(n),f=k(n)?t:i;function R(a){return{child:a.match(/^[a-z]+/)[0],parent:a.match(/[a-z]+$/)[0]}}function w(a){let e=0;const r=k(o?.y)||0,b=f.top.value,y=f.height.value,m=u.top.value,S=u.height.value;if(!S)return e;switch(a.child){case"top":e+=m+r;break;case"center":e+=m+S/2+r;break;case"bottom":e+=m+S+r;break}if(!f.height.value)return e;switch(a.parent){case"top":e-=b;break;case"center":e-=b+y/2;break;case"bottom":e-=b+y;break;case"initial":e-=m+r;break}return e}function x(){u.update(),t.update(),s.value=w(R(p)),d.value=w(R(l))}function P(){const a=k(o?.y)??0,e=Math.abs(d.value-s.value),r=a-s.value;return E(r/e,0,1)}return{getCalculations:x,getProgress:P}}const W={ref:"el",class:"magic-scroll-scene"},G={__name:"MagicScrollScene",props:$({from:{type:String,required:!1},to:{type:String,required:!1}},{from:"top-bottom",to:"bottom-top"}),setup(g){const h=C({prefix:"MagicScroll",source:"MagicScrollScene"}),n=M(_,void 0),p=M(L,void 0);h.assert(p,{message:"MagicScrollScene must be used within a MagicScrollProvider",errorCode:"missing_scroll_target"});const l=c(0),o=c(!1),s=H("el"),{getCalculations:d,getProgress:v}=U({child:s,parent:p,from:g.from,to:g.to});async function i(){d(),await N(),l.value=v()}T(()=>n?.y.value,()=>{o.value&&i()}),T(()=>n?.y.value,()=>{i()},{once:!0});const u=I(s,([t])=>{o.value=t?.isIntersecting??o.value,t?.isIntersecting&&i()},{rootMargin:"150% 0px 150% 0px",immediate:!0});return O(()=>{u.stop()}),q(V,A(l)),(t,f)=>(j(),Y("div",W,[D(t.$slots,"default",{progress:l.value})],512))}};export{G as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.