UNPKG

sui-explorer-local

Version:
2 lines (1 loc) 18 kB
const St=["top","right","bottom","left"],V=Math.min,C=Math.max,tt=Math.round,Z=Math.floor,z=t=>({x:t,y:t}),Dt={left:"right",right:"left",bottom:"top",top:"bottom"},Pt={start:"end",end:"start"};function st(t,e,o){return C(t,V(e,o))}function F(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function j(t){return t.split("-")[1]}function ct(t){return t==="x"?"y":"x"}function lt(t){return t==="y"?"height":"width"}function X(t){return["top","bottom"].includes(W(t))?"y":"x"}function ft(t){return ct(X(t))}function Mt(t,e,o){o===void 0&&(o=!1);const n=j(t),s=ft(t),i=lt(s);let r=s==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(r=et(r)),[r,et(r)]}function kt(t){const e=et(t);return[rt(t),e,rt(e)]}function rt(t){return t.replace(/start|end/g,e=>Pt[e])}function Ft(t,e,o){const n=["left","right"],s=["right","left"],i=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return o?e?s:n:e?n:s;case"left":case"right":return e?i:r;default:return[]}}function Wt(t,e,o,n){const s=j(t);let i=Ft(W(t),o==="start",n);return s&&(i=i.map(r=>r+"-"+s),e&&(i=i.concat(i.map(rt)))),i}function et(t){return t.replace(/left|right|bottom|top/g,e=>Dt[e])}function Ht(t){return{top:0,right:0,bottom:0,left:0,...t}}function yt(t){return typeof t!="number"?Ht(t):{top:t,right:t,bottom:t,left:t}}function nt(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function mt(t,e,o){let{reference:n,floating:s}=t;const i=X(e),r=ft(e),l=lt(r),c=W(e),f=i==="y",d=n.x+n.width/2-s.width/2,u=n.y+n.height/2-s.height/2,h=n[l]/2-s[l]/2;let a;switch(c){case"top":a={x:d,y:n.y-s.height};break;case"bottom":a={x:d,y:n.y+n.height};break;case"right":a={x:n.x+n.width,y:u};break;case"left":a={x:n.x-s.width,y:u};break;default:a={x:n.x,y:n.y}}switch(j(e)){case"start":a[r]-=h*(o&&f?-1:1);break;case"end":a[r]+=h*(o&&f?-1:1);break}return a}const Bt=async(t,e,o)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:r}=o,l=i.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let f=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:u}=mt(f,n,c),h=n,a={},m=0;for(let g=0;g<l.length;g++){const{name:x,fn:p}=l[g],{x:w,y,data:v,reset:b}=await p({x:d,y:u,initialPlacement:n,placement:h,strategy:s,middlewareData:a,rects:f,platform:r,elements:{reference:t,floating:e}});d=w??d,u=y??u,a={...a,[x]:{...a[x],...v}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(h=b.placement),b.rects&&(f=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):b.rects),{x:d,y:u}=mt(f,h,c)),g=-1)}return{x:d,y:u,placement:h,strategy:s,middlewareData:a}};async function G(t,e){var o;e===void 0&&(e={});const{x:n,y:s,platform:i,rects:r,elements:l,strategy:c}=t,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:a=0}=F(e,t),m=yt(a),x=l[h?u==="floating"?"reference":"floating":u],p=nt(await i.getClippingRect({element:(o=await(i.isElement==null?void 0:i.isElement(x)))==null||o?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:f,rootBoundary:d,strategy:c})),w=u==="floating"?{...r.floating,x:n,y:s}:r.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),v=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},b=nt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:y,strategy:c}):w);return{top:(p.top-b.top+m.top)/v.y,bottom:(b.bottom-p.bottom+m.bottom)/v.y,left:(p.left-b.left+m.left)/v.x,right:(b.right-p.right+m.right)/v.x}}const Nt=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:n,placement:s,rects:i,platform:r,elements:l,middlewareData:c}=e,{element:f,padding:d=0}=F(t,e)||{};if(f==null)return{};const u=yt(d),h={x:o,y:n},a=ft(s),m=lt(a),g=await r.getDimensions(f),x=a==="y",p=x?"top":"left",w=x?"bottom":"right",y=x?"clientHeight":"clientWidth",v=i.reference[m]+i.reference[a]-h[a]-i.floating[m],b=h[a]-i.reference[a],A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(f));let O=A?A[y]:0;(!O||!await(r.isElement==null?void 0:r.isElement(A)))&&(O=l.floating[y]||i.floating[m]);const S=v/2-b/2,N=O/2-g[m]/2-1,q=V(u[p],N),U=V(u[w],N),T=q,K=O-g[m]-U,R=O/2-g[m]/2+S,D=st(T,R,K),P=!c.arrow&&j(s)!=null&&R!==D&&i.reference[m]/2-(R<T?q:U)-g[m]/2<0,k=P?R<T?R-T:R-K:0;return{[a]:h[a]+k,data:{[a]:D,centerOffset:R-D-k,...P&&{alignmentOffset:k}},reset:P}}}),Vt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;const{placement:s,middlewareData:i,rects:r,initialPlacement:l,platform:c,elements:f}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:a="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...x}=F(t,e);if((o=i.arrow)!=null&&o.alignmentOffset)return{};const p=W(s),w=W(l)===l,y=await(c.isRTL==null?void 0:c.isRTL(f.floating)),v=h||(w||!g?[et(l)]:kt(l));!h&&m!=="none"&&v.push(...Wt(l,g,m,y));const b=[l,...v],A=await G(e,x),O=[];let S=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&O.push(A[p]),u){const T=Mt(s,r,y);O.push(A[T[0]],A[T[1]])}if(S=[...S,{placement:s,overflows:O}],!O.every(T=>T<=0)){var N,q;const T=(((N=i.flip)==null?void 0:N.index)||0)+1,K=b[T];if(K)return{data:{index:T,overflows:S},reset:{placement:K}};let R=(q=S.filter(D=>D.overflows[0]<=0).sort((D,P)=>D.overflows[1]-P.overflows[1])[0])==null?void 0:q.placement;if(!R)switch(a){case"bestFit":{var U;const D=(U=S.map(P=>[P.placement,P.overflows.filter(k=>k>0).reduce((k,Lt)=>k+Lt,0)]).sort((P,k)=>P[1]-k[1])[0])==null?void 0:U[0];D&&(R=D);break}case"initialPlacement":R=l;break}if(s!==R)return{reset:{placement:R}}}return{}}}};function ht(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function gt(t){return St.some(e=>t[e]>=0)}const zt=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:o}=e,{strategy:n="referenceHidden",...s}=F(t,e);switch(n){case"referenceHidden":{const i=await G(e,{...s,elementContext:"reference"}),r=ht(i,o.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:gt(r)}}}case"escaped":{const i=await G(e,{...s,altBoundary:!0}),r=ht(i,o.floating);return{data:{escapedOffsets:r,escaped:gt(r)}}}default:return{}}}}};async function $t(t,e){const{placement:o,platform:n,elements:s}=t,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),r=W(o),l=j(o),c=X(o)==="y",f=["left","top"].includes(r)?-1:1,d=i&&c?-1:1,u=F(e,t);let{mainAxis:h,crossAxis:a,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return l&&typeof m=="number"&&(a=l==="end"?m*-1:m),c?{x:a*d,y:h*f}:{x:h*f,y:a*d}}const fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var o,n;const{x:s,y:i,placement:r,middlewareData:l}=e,c=await $t(e,t);return r===((o=l.offset)==null?void 0:o.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:r}}}}},It=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:n,placement:s}=e,{mainAxis:i=!0,crossAxis:r=!1,limiter:l={fn:x=>{let{x:p,y:w}=x;return{x:p,y:w}}},...c}=F(t,e),f={x:o,y:n},d=await G(e,c),u=X(W(s)),h=ct(u);let a=f[h],m=f[u];if(i){const x=h==="y"?"top":"left",p=h==="y"?"bottom":"right",w=a+d[x],y=a-d[p];a=st(w,a,y)}if(r){const x=u==="y"?"top":"left",p=u==="y"?"bottom":"right",w=m+d[x],y=m-d[p];m=st(w,m,y)}const g=l.fn({...e,[h]:a,[u]:m});return{...g,data:{x:g.x-o,y:g.y-n}}}}},_t=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:o,y:n,placement:s,rects:i,middlewareData:r}=e,{offset:l=0,mainAxis:c=!0,crossAxis:f=!0}=F(t,e),d={x:o,y:n},u=X(s),h=ct(u);let a=d[h],m=d[u];const g=F(l,e),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const y=h==="y"?"height":"width",v=i.reference[h]-i.floating[y]+x.mainAxis,b=i.reference[h]+i.reference[y]-x.mainAxis;a<v?a=v:a>b&&(a=b)}if(f){var p,w;const y=h==="y"?"width":"height",v=["top","left"].includes(W(s)),b=i.reference[u]-i.floating[y]+(v&&((p=r.offset)==null?void 0:p[u])||0)+(v?0:x.crossAxis),A=i.reference[u]+i.reference[y]+(v?0:((w=r.offset)==null?void 0:w[u])||0)-(v?x.crossAxis:0);m<b?m=b:m>A&&(m=A)}return{[h]:a,[u]:m}}}},Yt=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:o,rects:n,platform:s,elements:i}=e,{apply:r=()=>{},...l}=F(t,e),c=await G(e,l),f=W(o),d=j(o),u=X(o)==="y",{width:h,height:a}=n.floating;let m,g;f==="top"||f==="bottom"?(m=f,g=d===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(g=f,m=d==="end"?"top":"bottom");const x=a-c[m],p=h-c[g],w=!e.middlewareData.shift;let y=x,v=p;if(u){const A=h-c.left-c.right;v=d||w?V(p,A):A}else{const A=a-c.top-c.bottom;y=d||w?V(x,A):A}if(w&&!d){const A=C(c.left,0),O=C(c.right,0),S=C(c.top,0),N=C(c.bottom,0);u?v=h-2*(A!==0||O!==0?A+O:C(c.left,c.right)):y=a-2*(S!==0||N!==0?S+N:C(c.top,c.bottom))}await r({...e,availableWidth:v,availableHeight:y});const b=await s.getDimensions(i.floating);return h!==b.width||a!==b.height?{reset:{rects:!0}}:{}}}};function $(t){return vt(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function B(t){var e;return(e=(vt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function vt(t){return t instanceof Node||t instanceof E(t).Node}function H(t){return t instanceof Element||t instanceof E(t).Element}function M(t){return t instanceof HTMLElement||t instanceof E(t).HTMLElement}function pt(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function Q(t){const{overflow:e,overflowX:o,overflowY:n,display:s}=L(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+o)&&!["inline","contents"].includes(s)}function jt(t){return["table","td","th"].includes($(t))}function at(t){const e=ut(),o=L(t);return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!e&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!e&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function Xt(t){let e=Y(t);for(;M(e)&&!ot(e);){if(at(e))return e;e=Y(e)}return null}function ut(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ot(t){return["html","body","#document"].includes($(t))}function L(t){return E(t).getComputedStyle(t)}function it(t){return H(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Y(t){if($(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pt(t)&&t.host||B(t);return pt(e)?e.host:e}function bt(t){const e=Y(t);return ot(e)?t.ownerDocument?t.ownerDocument.body:t.body:M(e)&&Q(e)?e:bt(e)}function J(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=!0);const s=bt(t),i=s===((n=t.ownerDocument)==null?void 0:n.body),r=E(s);return i?e.concat(r,r.visualViewport||[],Q(s)?s:[],r.frameElement&&o?J(r.frameElement):[]):e.concat(s,J(s,[],o))}function At(t){const e=L(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=M(t),i=s?t.offsetWidth:o,r=s?t.offsetHeight:n,l=tt(o)!==i||tt(n)!==r;return l&&(o=i,n=r),{width:o,height:n,$:l}}function dt(t){return H(t)?t:t.contextElement}function _(t){const e=dt(t);if(!M(e))return z(1);const o=e.getBoundingClientRect(),{width:n,height:s,$:i}=At(e);let r=(i?tt(o.width):o.width)/n,l=(i?tt(o.height):o.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const qt=z(0);function Ot(t){const e=E(t);return!ut()||!e.visualViewport?qt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ut(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==E(t)?!1:e}function I(t,e,o,n){e===void 0&&(e=!1),o===void 0&&(o=!1);const s=t.getBoundingClientRect(),i=dt(t);let r=z(1);e&&(n?H(n)&&(r=_(n)):r=_(t));const l=Ut(i,o,n)?Ot(i):z(0);let c=(s.left+l.x)/r.x,f=(s.top+l.y)/r.y,d=s.width/r.x,u=s.height/r.y;if(i){const h=E(i),a=n&&H(n)?E(n):n;let m=h,g=m.frameElement;for(;g&&n&&a!==m;){const x=_(g),p=g.getBoundingClientRect(),w=L(g),y=p.left+(g.clientLeft+parseFloat(w.paddingLeft))*x.x,v=p.top+(g.clientTop+parseFloat(w.paddingTop))*x.y;c*=x.x,f*=x.y,d*=x.x,u*=x.y,c+=y,f+=v,m=E(g),g=m.frameElement}}return nt({width:d,height:u,x:c,y:f})}const Kt=[":popover-open",":modal"];function Rt(t){return Kt.some(e=>{try{return t.matches(e)}catch{return!1}})}function Gt(t){let{elements:e,rect:o,offsetParent:n,strategy:s}=t;const i=s==="fixed",r=B(n),l=e?Rt(e.floating):!1;if(n===r||l&&i)return o;let c={scrollLeft:0,scrollTop:0},f=z(1);const d=z(0),u=M(n);if((u||!u&&!i)&&(($(n)!=="body"||Q(r))&&(c=it(n)),M(n))){const h=I(n);f=_(n),d.x=h.x+n.clientLeft,d.y=h.y+n.clientTop}return{width:o.width*f.x,height:o.height*f.y,x:o.x*f.x-c.scrollLeft*f.x+d.x,y:o.y*f.y-c.scrollTop*f.y+d.y}}function Jt(t){return Array.from(t.getClientRects())}function Ct(t){return I(B(t)).left+it(t).scrollLeft}function Qt(t){const e=B(t),o=it(t),n=t.ownerDocument.body,s=C(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=C(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let r=-o.scrollLeft+Ct(t);const l=-o.scrollTop;return L(n).direction==="rtl"&&(r+=C(e.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:l}}function Zt(t,e){const o=E(t),n=B(t),s=o.visualViewport;let i=n.clientWidth,r=n.clientHeight,l=0,c=0;if(s){i=s.width,r=s.height;const f=ut();(!f||f&&e==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:i,height:r,x:l,y:c}}function te(t,e){const o=I(t,!0,e==="fixed"),n=o.top+t.clientTop,s=o.left+t.clientLeft,i=M(t)?_(t):z(1),r=t.clientWidth*i.x,l=t.clientHeight*i.y,c=s*i.x,f=n*i.y;return{width:r,height:l,x:c,y:f}}function xt(t,e,o){let n;if(e==="viewport")n=Zt(t,o);else if(e==="document")n=Qt(B(t));else if(H(e))n=te(e,o);else{const s=Ot(t);n={...e,x:e.x-s.x,y:e.y-s.y}}return nt(n)}function Et(t,e){const o=Y(t);return o===e||!H(o)||ot(o)?!1:L(o).position==="fixed"||Et(o,e)}function ee(t,e){const o=e.get(t);if(o)return o;let n=J(t,[],!1).filter(l=>H(l)&&$(l)!=="body"),s=null;const i=L(t).position==="fixed";let r=i?Y(t):t;for(;H(r)&&!ot(r);){const l=L(r),c=at(r);!c&&l.position==="fixed"&&(s=null),(i?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Q(r)&&!c&&Et(t,r))?n=n.filter(d=>d!==r):s=l,r=Y(r)}return e.set(t,n),n}function ne(t){let{element:e,boundary:o,rootBoundary:n,strategy:s}=t;const r=[...o==="clippingAncestors"?ee(e,this._c):[].concat(o),n],l=r[0],c=r.reduce((f,d)=>{const u=xt(e,d,s);return f.top=C(u.top,f.top),f.right=V(u.right,f.right),f.bottom=V(u.bottom,f.bottom),f.left=C(u.left,f.left),f},xt(e,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function oe(t){const{width:e,height:o}=At(t);return{width:e,height:o}}function ie(t,e,o){const n=M(e),s=B(e),i=o==="fixed",r=I(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=z(0);if(n||!n&&!i)if(($(e)!=="body"||Q(s))&&(l=it(e)),n){const u=I(e,!0,i,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else s&&(c.x=Ct(s));const f=r.left+l.scrollLeft-c.x,d=r.top+l.scrollTop-c.y;return{x:f,y:d,width:r.width,height:r.height}}function wt(t,e){return!M(t)||L(t).position==="fixed"?null:e?e(t):t.offsetParent}function Tt(t,e){const o=E(t);if(!M(t)||Rt(t))return o;let n=wt(t,e);for(;n&&jt(n)&&L(n).position==="static";)n=wt(n,e);return n&&($(n)==="html"||$(n)==="body"&&L(n).position==="static"&&!at(n))?o:n||Xt(t)||o}const se=async function(t){const e=this.getOffsetParent||Tt,o=this.getDimensions;return{reference:ie(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await o(t.floating)}}};function re(t){return L(t).direction==="rtl"}const ce={convertOffsetParentRelativeRectToViewportRelativeRect:Gt,getDocumentElement:B,getClippingRect:ne,getOffsetParent:Tt,getElementRects:se,getClientRects:Jt,getDimensions:oe,getScale:_,isElement:H,isRTL:re};function le(t,e){let o=null,n;const s=B(t);function i(){var l;clearTimeout(n),(l=o)==null||l.disconnect(),o=null}function r(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:f,top:d,width:u,height:h}=t.getBoundingClientRect();if(l||e(),!u||!h)return;const a=Z(d),m=Z(s.clientWidth-(f+u)),g=Z(s.clientHeight-(d+h)),x=Z(f),w={rootMargin:-a+"px "+-m+"px "+-g+"px "+-x+"px",threshold:C(0,V(1,c))||1};let y=!0;function v(b){const A=b[0].intersectionRatio;if(A!==c){if(!y)return r();A?r(!1,A):n=setTimeout(()=>{r(!1,1e-7)},100)}y=!1}try{o=new IntersectionObserver(v,{...w,root:s.ownerDocument})}catch{o=new IntersectionObserver(v,w)}o.observe(t)}return r(!0),i}function ae(t,e,o,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,f=dt(t),d=s||i?[...f?J(f):[],...J(e)]:[];d.forEach(p=>{s&&p.addEventListener("scroll",o,{passive:!0}),i&&p.addEventListener("resize",o)});const u=f&&l?le(f,o):null;let h=-1,a=null;r&&(a=new ResizeObserver(p=>{let[w]=p;w&&w.target===f&&a&&(a.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=a)==null||y.observe(e)})),o()}),f&&!c&&a.observe(f),a.observe(e));let m,g=c?I(t):null;c&&x();function x(){const p=I(t);g&&(p.x!==g.x||p.y!==g.y||p.width!==g.width||p.height!==g.height)&&o(),g=p,m=requestAnimationFrame(x)}return o(),()=>{var p;d.forEach(w=>{s&&w.removeEventListener("scroll",o),i&&w.removeEventListener("resize",o)}),u==null||u(),(p=a)==null||p.disconnect(),a=null,c&&cancelAnimationFrame(m)}}const ue=It,de=Vt,me=Yt,he=zt,ge=Nt,pe=_t,xe=(t,e,o)=>{const n=new Map,s={platform:ce,...o},i={...s.platform,_c:n};return Bt(t,e,{...s,platform:i})};export{ae as a,ge as b,xe as c,me as d,de as f,J as g,he as h,pe as l,fe as o,ue as s};