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