UNPKG

overlayscrollbars

Version:

A javascript scrollbar plugin that hides the native scrollbars, provides custom styleable overlay scrollbars, and preserves the native functionality and feel.

10 lines 29.8 kB
/*! * OverlayScrollbars * Version: 2.11.4 * * Copyright (c) Rene Haas | KingSora. * https://github.com/KingSora * * Released under the MIT license. */ var OverlayScrollbarsGlobal=function(t){"use strict";const e=(t,e)=>{const{o:n,i:r,u:o}=t;let s,i=n;const c=(t,e)=>{const n=i,c=t,l=e||(r?!r(n,c):n!==c);return(l||o)&&(i=c,s=n),[i,l,s]};return[e?t=>c(e(i,s),t):c,t=>[i,!!t,s]]},n="undefined"!=typeof window&&"undefined"!=typeof HTMLElement&&window.document?window:{},r=Math.max,o=Math.min,s=Math.round,i=Math.abs,c=Math.sign,l=n.cancelAnimationFrame,a=n.requestAnimationFrame,u=n.setTimeout,d=n.clearTimeout,p=t=>void 0!==n[t]?n[t]:void 0,y=p("MutationObserver"),h=p("IntersectionObserver"),f=p("ResizeObserver"),v=p("ScrollTimeline"),b=t=>void 0===t,x=t=>null===t,g=t=>"number"==typeof t,w=t=>"string"==typeof t,m=t=>"boolean"==typeof t,$=t=>"function"==typeof t,S=t=>Array.isArray(t),M=t=>"object"==typeof t&&!S(t)&&!x(t),O=t=>{const e=!!t&&t.length,n=g(e)&&e>-1&&e%1==0;return!(!(S(t)||!$(t)&&n)||e>0&&M(t)&&!(e-1 in t))},C=t=>!!t&&t.constructor===Object,L=t=>t instanceof HTMLElement,D=t=>t instanceof Element,T=()=>performance.now(),k=(t,e,n,o,s)=>{let i=0;const c=T(),u=r(0,n),d=n=>{const l=T(),p=l-c>=u,y=n?1:1-(r(0,c+u-l)/u||0),h=(e-t)*($(s)?s(y,y*u,0,1,u):y)+t,f=p||1===y;o&&o(h,y,f),i=f?0:a((()=>d()))};return d(),t=>{l(i),t&&d(t)}};function A(t,e){if(O(t))for(let n=0;n<t.length&&!1!==e(t[n],n,t);n++);else t&&A(Object.keys(t),(n=>e(t[n],n,t)));return t}const I=(t,e)=>t.indexOf(e)>=0,P=(t,e)=>t.concat(e),H=(t,e,n)=>(!w(e)&&O(e)?Array.prototype.push.apply(t,e):t.push(e),t),R=t=>Array.from(t||[]),z=t=>S(t)?t:!w(t)&&O(t)?R(t):[t],E=t=>!!t&&!t.length,j=t=>R(new Set(t)),V=(t,e,n)=>{A(t,(t=>!t||t.apply(void 0,e||[]))),n||(t.length=0)},_="paddingTop",F="paddingRight",N="paddingLeft",U="paddingBottom",B="marginLeft",Y="marginRight",q="marginBottom",K="overflowX",X="overflowY",W="width",Q="height",Z="visible",G="hidden",J="scroll",tt=(t,e,n,r)=>{if(t&&e){let r=!0;return A(n,(n=>{t[n]!==e[n]&&(r=!1)})),r}return!1},et=(t,e)=>tt(t,e,["w","h"]),nt=(t,e)=>tt(t,e,["x","y"]),rt=(t,e)=>tt(t,e,["t","r","b","l"]),ot=(t,...e)=>t.bind(0,...e),st=t=>{let e;const n=t?u:a,r=t?d:l;return[o=>{r(e),e=n((()=>o()),$(t)?t():t)},()=>r(e)]},it=t=>{const e=$(t)?t():t;if(g(e)){const t=e?u:a,n=e?d:l;return r=>{const o=t((()=>r()),e);return()=>{n(o)}}}return e&&e._},ct=(t,e)=>{const{p:n,v:r,S:o,m:s}=e||{};let i,c,l,a,u;const d=function(e){c&&c(),i&&i(),u=c=i=l=void 0,t.apply(this,e)},p=t=>s&&l?s(l,t):t,y=()=>{c&&d(p(a)||a)},h=function(){const t=R(arguments),e=it(n);if(e){const n=it(r),s=p(t)||t,h=d.bind(0,s);c&&c(),o&&!u?(h(),u=!0,c=e((()=>u=void 0))):(c=e(h),n&&!i&&(i=n(y))),l=a=s}else d(t)};return h.O=y,h},lt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),at=t=>t?Object.keys(t):[],ut=(t,e,n,r,o,s,i)=>{const c=[e,n,r,o,s,i];return"object"==typeof t&&!x(t)||$(t)||(t={}),A(c,(e=>{A(e,((n,r)=>{const o=e[r];if(t===o)return!0;const s=S(o);if(o&&C(o)){const e=t[r];let n=e;s&&!S(e)?n=[]:s||C(e)||(n={}),t[r]=ut(n,o)}else t[r]=s?o.slice():o}))})),t},dt=(t,e)=>A(ut({},t),((t,e,n)=>{void 0===t?delete n[e]:t&&C(t)&&(n[e]=dt(t))})),pt=t=>!at(t).length,yt=()=>{},ht=(t,e,n)=>r(t,o(e,n)),ft=t=>j((S(t)?t:(t||"").split(" ")).filter((t=>t))),vt=(t,e)=>t&&t.getAttribute(e),bt=(t,e)=>t&&t.hasAttribute(e),xt=(t,e,n)=>{A(ft(e),(e=>{t&&t.setAttribute(e,String(n||""))}))},gt=(t,e)=>{A(ft(e),(e=>t&&t.removeAttribute(e)))},wt=(t,e)=>{const n=ft(vt(t,e)),r=ot(xt,t,e),o=(t,e)=>{const r=new Set(n);return A(ft(t),(t=>{r[e](t)})),R(r).join(" ")};return{$:t=>r(o(t,"delete")),C:t=>r(o(t,"add")),H:t=>{const e=ft(t);return e.reduce(((t,e)=>t&&n.includes(e)),e.length>0)}}},mt=(t,e,n)=>(wt(t,e).$(n),ot($t,t,e,n)),$t=(t,e,n)=>(wt(t,e).C(n),ot(mt,t,e,n)),St=(t,e,n,r)=>(r?$t:mt)(t,e,n),Mt=(t,e,n)=>wt(t,e).H(n),Ot=t=>wt(t,"class"),Ct=(t,e)=>{Ot(t).$(e)},Lt=(t,e)=>(Ot(t).C(e),ot(Ct,t,e)),Dt=(t,e)=>{const n=e?D(e)&&e:document;return n?R(n.querySelectorAll(t)):[]},Tt=(t,e)=>D(t)&&t.matches(e),kt=t=>Tt(t,"body"),At=t=>t?R(t.childNodes):[],It=t=>t&&t.parentElement,Pt=(t,e)=>D(t)&&t.closest(e),Ht=t=>document.activeElement,Rt=t=>{A(z(t),(t=>{const e=It(t);t&&e&&e.removeChild(t)}))},zt=(t,e)=>ot(Rt,t&&e&&A(z(e),(e=>{e&&t.appendChild(e)})));let Et;const jt=t=>{const e=document.createElement("div");return xt(e,"class",t),e},Vt=t=>{const e=jt(),n=Et,r=t.trim();return e.innerHTML=n?n.createHTML(r):r,A(At(e),(t=>Rt(t)))},_t=(t,e)=>t.getPropertyValue(e)||t[e]||"",Ft=t=>{const e=t||0;return isFinite(e)?e:0},Nt=t=>Ft(parseFloat(t||"")),Ut=t=>Math.round(1e4*t)/1e4,Bt=t=>`${Ut(Ft(t))}px`;function Yt(t,e){t&&e&&A(e,((e,n)=>{try{const r=t.style,o=x(e)||m(e)?"":g(e)?Bt(e):e;0===n.indexOf("--")?r.setProperty(n,o):r[n]=o}catch(r){}}))}function qt(t,e,r){const o=w(e);let s=o?"":{};if(t){const i=n.getComputedStyle(t,r)||t.style;s=o?_t(i,e):R(e).reduce(((t,e)=>(t[e]=_t(i,e),t)),s)}return s}const Kt=(t,e,n)=>{const r=e?`${e}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,i=`${r}right${o}`,c=`${r}bottom${o}`,l=`${r}left${o}`,a=qt(t,[s,i,c,l]);return{t:Nt(a[s]),r:Nt(a[i]),b:Nt(a[c]),l:Nt(a[l])}},Xt=(t,e)=>`translate${M(t)?`(${t.x},${t.y})`:`${e?"X":"Y"}(${t})`}`,Wt={w:0,h:0},Qt=(t,e)=>e?{w:e[`${t}Width`],h:e[`${t}Height`]}:Wt,Zt=t=>Qt("inner",t||n),Gt=ot(Qt,"offset"),Jt=ot(Qt,"client"),te=ot(Qt,"scroll"),ee=t=>{const e=parseFloat(qt(t,W))||0,n=parseFloat(qt(t,Q))||0;return{w:e-s(e),h:n-s(n)}},ne=t=>t.getBoundingClientRect(),re=t=>!(!t||!t[Q]&&!t[W]),oe=(t,e)=>{const n=re(t);return!re(e)&&n},se=(t,e,n,r)=>{A(ft(e),(e=>{t&&t.removeEventListener(e,n,r)}))},ie=(t,e,n,r)=>{var o;const s=null==(o=r&&r.T)||o,i=r&&r.I||!1,c=r&&r.A||!1,l={passive:s,capture:i};return ot(V,ft(e).map((e=>{const r=c?o=>{se(t,e,r,i),n&&n(o)}:n;return t&&t.addEventListener(e,r,l),ot(se,t,e,r,i)})))},ce=t=>t.stopPropagation(),le=t=>t.preventDefault(),ae=t=>ce(t)||le(t),ue=(t,e)=>{const{x:n,y:r}=g(e)?{x:e,y:e}:e||{};g(n)&&(t.scrollLeft=n),g(r)&&(t.scrollTop=r)},de=t=>({x:t.scrollLeft,y:t.scrollTop}),pe=(t,e)=>{const{D:n,M:r}=t,{w:o,h:s}=e,l=(t,e,n)=>{let r=c(t)*n,o=c(e)*n;if(r===o){const n=i(t),s=i(e);o=n>s?0:o,r=n<s?0:r}return r=r===o?0:r,[r+0,o+0]},[a,u]=l(n.x,r.x,o),[d,p]=l(n.y,r.y,s);return{D:{x:a,y:d},M:{x:u,y:p}}},ye=({D:t,M:e})=>{const n=(t,e)=>0===t&&t<=e;return{x:n(t.x,e.x),y:n(t.y,e.y)}},he=({D:t,M:e},n)=>{const r=(t,e,n)=>ht(0,1,(t-n)/(t-e)||0);return{x:r(t.x,e.x,n.x),y:r(t.y,e.y,n.y)}},fe=t=>{t&&t.focus&&t.focus({preventScroll:!0})},ve=(t,e)=>{A(z(e),t)},be=t=>{const e=new Map,n=(t,n)=>{if(t){const r=e.get(t);ve((t=>{r&&r[t?"delete":"clear"](t)}),n)}else e.forEach((t=>{t.clear()})),e.clear()},r=(t,o)=>{if(w(t)){const r=e.get(t)||new Set;return e.set(t,r),ve((t=>{$(t)&&r.add(t)}),o),ot(n,t,o)}m(o)&&o&&n();const s=at(t),i=[];return A(s,(e=>{const n=t[e];n&&H(i,r(e,n))})),ot(V,i)};return r(t||{}),[r,n,(t,n)=>{A(R(e.get(t)),(t=>{n&&!E(n)?t.apply(0,n):t()}))}]},xe={},ge={},we=(t,e,n)=>at(t).map((r=>{const{static:o,instance:s}=t[r],[i,c,l]=n||[],a=n?s:o;if(a){const t=n?a(i,c,e):a(e);return(l||ge)[r]=t}})),me=t=>ge[t],$e="__osOptionsValidationPlugin",Se=`data-overlayscrollbars`,Me="os-environment",Oe=`${Me}-scrollbar-hidden`,Ce=`${Se}-initialize`,Le="noClipping",De=`${Se}-body`,Te=Se,ke="host",Ae=`${Se}-viewport`,Ie=K,Pe=X,He="arrange",Re="measuring",ze="scrolling",Ee="scrollbarHidden",je="noContent",Ve=`${Se}-padding`,_e=`${Se}-content`,Fe="os-size-observer",Ne=`${Fe}-appear`,Ue=`${Fe}-listener`,Be=`${Ue}-scroll`,Ye=`${Ue}-item`,qe=`${Ye}-final`,Ke="os-trinsic-observer",Xe="os-theme-none",We="os-scrollbar",Qe=`${We}-rtl`,Ze=`${We}-horizontal`,Ge=`${We}-vertical`,Je=`${We}-track`,tn=`${We}-handle`,en=`${We}-visible`,nn=`${We}-cornerless`,rn=`${We}-interaction`,on=`${We}-unusable`,sn=`${We}-auto-hide`,cn=`${sn}-hidden`,ln=`${We}-wheel`,an=`${Je}-interactive`,un=`${tn}-interactive`,dn="__osSizeObserverPlugin",pn=(()=>({[dn]:{static:()=>(t,e,n)=>{const r=3333333,o="scroll",s=Vt(`<div class="${Ye}" dir="ltr"><div class="${Ye}"><div class="${qe}"></div></div><div class="${Ye}"><div class="${qe}" style="width: 200%; height: 200%"></div></div></div>`),i=s[0],c=i.lastChild,u=i.firstChild,d=null==u?void 0:u.firstChild;let p,y=Gt(i),h=y,f=!1;const v=()=>{ue(u,r),ue(c,r)},b=t=>{p=0,f&&(y=h,e(!0===t))},x=t=>{h=Gt(i),f=!t||!et(h,y),t?(ce(t),f&&!p&&(l(p),p=a(b))):b(!1===t),v()},g=[zt(t,s),ie(u,o,x),ie(c,o,x)];return Lt(t,Be),Yt(d,{[W]:r,[Q]:r}),a(v),[n?ot(x,!1):v,g]}}}))(),yn=(t,e)=>{const{k:n}=e,[r,o]=t("showNativeOverlaidScrollbars");return[r&&n.x&&n.y,o]},hn=t=>0===t.indexOf(Z),fn=(t,e)=>{if("auto"===t)return e?J:G;const n=t||G;return[G,J,Z].includes(n)?n:G},vn=(t,e)=>{const{overflowX:n,overflowY:r}=qt(t,[K,X]);return{x:fn(n,e.x),y:fn(r,e.y)}},bn="__osScrollbarsHidingPlugin",xn=(()=>({[bn]:{static:()=>({R:(t,e,n,r,o)=>{const{V:s,L:i}=t,{U:c,k:l,P:a}=r,u=!s&&!c&&(l.x||l.y),[d]=yn(o,r),p=t=>{const e=c||d?0:42,n=(t,n,r)=>[n&&!c?t?e:r:0,t&&!!e],[r,o]=n(l.x,t.x===J,a.x),[s,i]=n(l.y,t.y===J,a.y);return{N:{x:r,y:s},q:{x:o,y:i}}},y=t=>{if(!s){const{j:r}=n,o=ut({},{[Y]:0,[q]:0,[B]:0}),{N:s,q:i}=p(t),{x:c,y:l}=i,{x:a,y:d}=s,{B:y}=e,h=r?B:Y,f=r?N:F,v=y[h],b=y[q],x=y[f],g=y[U];return o[W]=`calc(100% + ${d+-1*v}px)`,o[h]=-d+v,o[q]=-a+b,u&&(o[f]=x+(l?d:0),o[U]=g+(c?a:0)),o}};return{X:(t,r,o)=>{if(u){const{B:s}=e,{N:c,q:l}=p(t),{x:a,y:u}=l,{x:d,y}=c,{j:h}=n,f=s[h?F:N],v=s.paddingTop,b=r.w+o.w,x=r.h+o.h,g={w:y&&u?`${y+b-f}px`:"",h:d&&a?`${d+x-v}px`:""};Yt(i,{"--os-vaw":g.w,"--os-vah":g.h})}return u},Y:()=>{if(u){const{F:t,B:n}=e,r=vn(i,t),{q:o}=p(r),{x:s,y:c}=o,l={},a=t=>A(t,(t=>{l[t]=n[t]}));s&&a([q,_,U]),c&&a([B,Y,N,F]);const u=qt(i,at(l)),d=mt(i,Ae,He);return Yt(i,l),()=>{Yt(i,ut({},u,y(r))),d()}}return yt},W:y}}})}}))(),gn="__osClickScrollPlugin",wn=(()=>({[gn]:{static:()=>(t,e,n,r)=>{let o=!1,s=yt;const i=133,c=222,[l,a]=st(i),u=Math.sign(e),d=n*u,p=d/2,y=t=>1-(1-t)*(1-t),h=(e,n)=>k(e,n,c,t,y),f=(n,r)=>k(n,e-d,i*r,((n,r,o)=>{t(n),o&&(s=h(n,e))})),v=k(0,d,c,((i,c,a)=>{if(t(i),a&&(r(o),!o)){const t=e-i;Math.sign(t-p)===u&&l((()=>{const r=t-d,o=Math.sign(r)===u;s=o?f(i,Math.abs(r)/n):h(i,e)}))}}),y);return t=>{o=!0,t&&v(),a(),s()}}}}))(),mn=t=>JSON.stringify(t,((t,e)=>{if($(e))throw 0;return e})),$n=(t,e)=>t?`${e}`.split(".").reduce(((t,e)=>t&&lt(t,e)?t[e]:void 0),t):void 0,Sn={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:[0,33],attributes:null,ignoreMutation:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},Mn=(t,e)=>{const n={};return A(P(at(e),at(t)),(r=>{const o=t[r],s=e[r];if(M(o)&&M(s))ut(n[r]={},Mn(o,s)),pt(n[r])&&delete n[r];else if(lt(e,r)&&s!==o){let t=!0;if(S(o)||S(s))try{mn(o)===mn(s)&&(t=!1)}catch(i){}t&&(n[r]=s)}})),n},On=(t,e,n)=>r=>[$n(t,r),n||void 0!==$n(e,r)];let Cn,Ln;const Dn=()=>(Ln||(Ln=(()=>{const t=(t,e,n)=>{zt(document.body,t),zt(document.body,t);const r=Jt(t),o=Gt(t),s=ee(e);return n&&Rt(t),{x:o.h-r.h+s.h,y:o.w-r.w+s.w}},r=Vt(`<div class="${Me}"><div></div><style>${`.${Me}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${Me} div{width:200%;height:200%;margin:10px 0}.${Oe}{scrollbar-width:none!important}.${Oe}::-webkit-scrollbar,.${Oe}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`}</style></div>`)[0],o=r.firstChild,s=r.lastChild,i=Cn;i&&(s.nonce=i);const[c,,l]=be(),[a,u]=e({o:t(r,o),i:nt},ot(t,r,o,!0)),[d]=u(),p=(t=>{let e=!1;const n=Lt(t,Oe);try{e="none"===qt(t,"scrollbar-width")||"none"===qt(t,"display","::-webkit-scrollbar")}catch(r){}return n(),e})(r),y={x:0===d.x,y:0===d.y},h={elements:{host:null,padding:!p,viewport:t=>p&&kt(t)&&t,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},f=ut({},Sn),b=ot(ut,{},f),x=ot(ut,{},h),g={P:d,k:y,U:p,G:!!v,J:ot(c,"r"),K:x,Z:t=>ut(h,t)&&x(),tt:b,nt:t=>ut(f,t)&&b(),ot:ut({},h),st:ut({},f)};if(gt(r,"style"),Rt(r),ie(n,"resize",(()=>{l("r",[])})),$(n.matchMedia)&&!p&&(!y.x||!y.y)){const t=e=>{const r=n.matchMedia(`(resolution: ${n.devicePixelRatio}dppx)`);ie(r,"change",(()=>{e(),t(e)}),{A:!0})};t((()=>{const[t,e]=a();ut(g.P,t),l("r",[e])}))}return g})()),Ln),Tn=(t,e,n,r)=>{let o=!1;const{et:s,ct:i,rt:c,it:l,lt:a,ut:u}=r||{},d=ct((()=>o&&n(!0)),{p:33,v:99}),[p,h]=((t,e,n)=>{let r=!1;const o=!!n&&new WeakMap,s=s=>{if(o&&n){const i=n.map((e=>{const[n,r]=e||[];return[r&&n?(s||Dt)(n,t):[],r]}));A(i,(n=>A(n[0],(s=>{const i=n[1],c=o.get(s)||[];if(t.contains(s)&&i){const t=ie(s,i,(n=>{r?(t(),o.delete(s)):e(n)}));o.set(s,H(c,t))}else V(c),o.delete(s)}))))}};return s(),[()=>{r=!0},s]})(t,d,c),f=i||[],v=P(s||[],f),b=(o,s)=>{if(!E(s)){const i=a||yt,c=u||yt,d=[],p=[];let y=!1,v=!1;if(A(s,(n=>{const{attributeName:o,target:s,type:a,oldValue:u,addedNodes:h,removedNodes:b}=n,x="attributes"===a,g="childList"===a,m=t===s,$=x&&o,S=$&&vt(s,o||""),M=w(S)?S:null,O=$&&u!==M,C=I(f,o)&&O;if(e&&(g||!m)){const e=x&&O,a=e&&l&&Tt(s,l),p=(a?!i(s,o,u,M):!x||e)&&!c(n,!!a,t,r);A(h,(t=>H(d,t))),A(b,(t=>H(d,t))),v=v||p}!e&&m&&O&&!i(s,o,u,M)&&(H(p,o),y=y||C)})),h((t=>j(d).reduce(((e,n)=>(H(e,Dt(t,n)),Tt(n,t)?H(e,n):e)),[]))),e)return!o&&v&&n(!1),[!1];if(!E(p)||y){const t=[j(p),y];return o||n.apply(0,t),t}}},x=new y(ot(b,!1));return[()=>(x.observe(t,{attributes:!0,attributeOldValue:!0,attributeFilter:v,subtree:e,childList:e,characterData:e}),o=!0,()=>{o&&(p(),x.disconnect(),o=!1)}),()=>{if(o)return d.O(),b(!0,x.takeRecords())}]};let kn=null;const An=(t,n,r)=>{const{ft:o}=r||{},s=me(dn),[i]=e({o:!1,u:!0});return()=>{const e=[],r=Vt(`<div class="${Fe}"><div class="${Ue}"></div></div>`)[0],c=r.firstChild,l=t=>{let e=!1,r=!1;if(S(t)&&!E(t)){const n=t[0],[o,,s]=i(n.contentRect),c=re(o);r=oe(o,s),e=!r&&!c}else r=!0===t;e||n({_t:!0,ft:r})};if(f){if(!m(kn)){const e=new f(yt);e.observe(t,{get box(){kn=!0}}),kn=kn||!1,e.disconnect()}const n=ct(l,{p:0,v:0}),o=t=>n(t),s=new f(o);if(s.observe(kn?t:c),H(e,[()=>{s.disconnect()},!kn&&zt(t,r)]),kn){const n=new f(o);n.observe(t,{box:"border-box"}),H(e,(()=>n.disconnect()))}}else{if(!s)return yt;{const[n,i]=s(c,l,o);H(e,P([Lt(r,Ne),ie(r,"animationstart",n),zt(t,r)],i))}}return ot(V,e)}},In=(t,n)=>{let r;const o=jt(Ke),[s]=e({o:!1}),i=(t,e)=>{if(t){const r=s((t=>0===t.h||t.isIntersecting||t.intersectionRatio>0)(t)),[,o]=r;return o&&!e&&n(r)&&[r]}},c=(t,e)=>i(e.pop(),t);return[()=>{const e=[];if(h)r=new h(ot(c,!1),{root:t}),r.observe(o),H(e,(()=>{r.disconnect()}));else{const t=()=>{const t=Gt(o);i(t)};H(e,An(o,t)()),t()}return ot(V,H(e,zt(t,o)))},()=>r&&c(!0,r.takeRecords())]},Pn=(t,n,r,o)=>{let s,i,c,l,a,u;const d=`[${Te}]`,p=`[${Ae}]`,y=["id","class","style","open","wrap","cols","rows"],{dt:h,vt:v,L:b,gt:x,ht:w,V:m,bt:M,wt:O,yt:C,St:L}=t,T=t=>"rtl"===qt(t,"direction"),k={Ot:!1,j:T(h)},A=Dn(),I=me(bn),[H]=e({i:et,o:{w:0,h:0}},(()=>{const e=I&&I.R(t,n,k,A,r).Y,o=!(M&&m)&&Mt(v,Te,Le),s=!m&&O(He),i=s&&de(x),c=i&&L(),l=C(Re,o),a=s&&e&&e(),u=te(b),d=ee(b);return a&&a(),ue(x,i),c&&c(),o&&l(),{w:u.w+d.w,h:u.h+d.h}})),R=ct(o,{p:()=>s,v:()=>i,m(t,e){const[n]=t,[r]=e;return[P(at(n),at(r)).reduce(((t,e)=>(t[e]=n[e]||r[e],t)),{})]}}),z=t=>{const e=T(h);ut(t,{$t:u!==e}),ut(k,{j:e}),u=e},E=(t,e)=>{const[n,r]=t,s={Ct:r};return ut(k,{Ot:n}),e||o(s),s},j=({_t:t,ft:e})=>{const n=t&&!e||!A.U?o:R,r={_t:t||e,ft:e};z(r),n(r)},V=(t,e)=>{const[,n]=H(),r={xt:n};return z(r),n&&!e&&(t?o:R)(r),r},_=(t,e,n)=>{const r={Ht:e};return z(r),e&&!n&&R(r),r},[F,N]=w?In(v,E):[],U=!m&&An(v,j,{ft:!0}),[B,Y]=Tn(v,!1,_,{ct:y,et:y}),q=m&&f&&new f((t=>{const e=t[t.length-1].contentRect;j({_t:!0,ft:oe(e,a)}),a=e})),K=ct((()=>{const[,t]=H();o({xt:t})}),{p:222,S:!0});return[()=>{q&&q.observe(v);const t=U&&U(),e=F&&F(),n=B(),r=A.J((t=>{t?R({Et:t}):K()}));return()=>{q&&q.disconnect(),t&&t(),e&&e(),l&&l(),n(),r()}},({zt:t,Tt:e,It:n})=>{const r={},[o]=t("update.ignoreMutation"),[a,u]=t("update.attributes"),[h,f]=t("update.elementEvents"),[v,x]=t("update.debounce"),M=e||n;if(f||u){c&&c(),l&&l();const[t,e]=Tn(w||b,!0,V,{et:P(y,a||[]),rt:h,it:d,ut:(t,e)=>{const{target:n,attributeName:r}=t;return!(e||!r||m)&&((t,e,n)=>{const r=Pt(t,e),o=t&&((t,e)=>{const n=e?D(e)&&e:document;return n&&n.querySelector(t)})(n,r),s=Pt(o,e)===r;return!(!r||!o)&&(r===t||o===t||s&&Pt(Pt(t,n),e)!==r)})(n,d,p)||!!Pt(n,`.${We}`)||!!(t=>$(o)&&o(t))(t)}});l=t(),c=e}if(x)if(R.O(),S(v)){const t=v[0],e=v[1];s=g(t)&&t,i=g(e)&&e}else g(v)?(s=v,i=!1):(s=!1,i=!1);if(M){const t=Y(),e=N&&N(),n=c&&c();t&&ut(r,_(t[0],t[1],M)),e&&ut(r,E(e[0],M)),n&&ut(r,V(n[0],M))}return z(r),r},k]},Hn=(t,e)=>$(e)?e.apply(0,t):e,Rn=(t,e,n,r)=>{const o=b(r)?n:r;return Hn(t,o)||e.apply(0,t)},zn=(t,e,n,r)=>{const o=b(r)?n:r,s=Hn(t,o);return!!s&&(L(s)?s:e.apply(0,t))},En=(t,e,n,r)=>{const o="--os-viewport-percent",s="--os-scroll-percent",i="--os-scroll-direction",{K:c}=Dn(),{scrollbars:l}=c(),{slot:a}=l,{dt:u,vt:d,L:p,At:y,gt:h,bt:f,V:b}=e,{scrollbars:x}=y?{}:t,{slot:g}=x||{},w=[],$=[],S=[],M=zn([u,d,p],(()=>b&&f?u:d),a,g),O=t=>{if(v){let e=null,r=[];const o=new v({source:h,axis:t}),s=()=>{e&&e.cancel(),e=null},i=i=>{const{Dt:c}=n,l=ye(c)[t],a="x"===t,u=[Xt(0,a),Xt(`calc(100cq${a?"w":"h"} + -100%)`,a)],d=l?u:u.reverse();return r[0]===d[0]&&r[1]===d[1]||(s(),r=d,e=i.Mt.animate({clear:["left"],transform:d},{timeline:o})),s};return{kt:i}}},C={x:O("x"),y:O("y")},L=(t,e,n)=>{const r=n?Lt:Ct;A(t,(t=>{r(t.Lt,e)}))},D=(t,e)=>{A(t,(t=>{const[n,r]=e(t);Yt(n,r)}))},T=(t,e,n)=>{const r=m(n),o=!r||!n;(!r||n)&&L($,t,e),o&&L(S,t,e)},k=t=>{const e=t?"x":"y",n=jt(`${We} ${t?Ze:Ge}`),o=jt(Je),s=jt(tn),i={Lt:n,Ut:o,Mt:s},c=C[e];return H(t?$:S,i),H(w,[zt(n,o),zt(o,s),ot(Rt,n),c&&c.kt(i),r(i,T,t)]),i},I=ot(k,!0),P=ot(k,!1);return I(),P(),[{Pt:()=>{const t=(()=>{const{Rt:t,Vt:e}=n,r=(t,e)=>ht(0,1,t/(t+e)||0);return{x:r(e.x,t.x),y:r(e.y,t.y)}})(),e=t=>e=>[e.Lt,{[o]:Ut(t)+""}];D($,e(t.x)),D(S,e(t.y))},Nt:()=>{if(!v){const{Dt:t}=n,e=he(t,de(h)),r=t=>e=>[e.Lt,{[s]:Ut(t)+""}];D($,r(e.x)),D(S,r(e.y))}},qt:()=>{const{Dt:t}=n,e=ye(t),r=t=>e=>[e.Lt,{[i]:t?"0":"1"}];D($,r(e.x)),D(S,r(e.y)),v&&($.forEach(C.x.kt),S.forEach(C.y.kt))},jt:()=>{if(b&&!f){const{Rt:t,Dt:e}=n,r=ye(e),o=he(e,de(h)),s=e=>{const{Lt:n}=e,s=It(n)===p&&n,i=(t,e,n)=>{const r=e*t;return Bt(n?r:-r)};return[s,s&&{transform:Xt({x:i(o.x,t.x,r.x),y:i(o.y,t.y,r.y)})}]};D($,s),D(S,s)}},Bt:T,Ft:{Xt:$,Yt:I,Wt:ot(D,$)},Gt:{Xt:S,Yt:P,Wt:ot(D,S)}},()=>(zt(M,$[0].Lt),zt(M,S[0].Lt),ot(V,w))]},jn=(t,e,n,r)=>(o,c,l)=>{const{vt:a,L:d,V:p,gt:y,Jt:h,St:f}=e,{Lt:v,Ut:b,Mt:x}=o,[g,w]=st(333),[m,S]=st(444),M=t=>{$(y.scrollBy)&&y.scrollBy({behavior:"smooth",left:t.x,top:t.y})};let O=!0;return ot(V,[ie(x,"pointermove pointerleave",r),ie(v,"pointerenter",(()=>{c(rn,!0)})),ie(v,"pointerleave pointercancel",(()=>{c(rn,!1)})),!p&&ie(v,"mousedown",(()=>{const t=Ht();(bt(t,Ae)||bt(t,Te)||t===document.body)&&u(ot(fe,d),25)})),ie(v,"wheel",(t=>{const{deltaX:e,deltaY:n,deltaMode:r}=t;O&&0===r&&It(v)===a&&M({x:e,y:n}),O=!1,c(ln,!0),g((()=>{O=!0,c(ln)})),le(t)}),{T:!1,I:!0}),ie(v,"pointerdown",(()=>{const t=ie(h,"click",(t=>{e(),ae(t)}),{A:!0,I:!0,T:!1}),e=ie(h,"pointerup pointercancel",(()=>{e(),setTimeout(t,150)}),{I:!0,T:!0})}),{I:!0,T:!0}),(()=>{const e="pointerup pointercancel lostpointercapture",r=`client${l?"X":"Y"}`,o=l?W:Q,c=l?"left":"top",a=l?"w":"h",u=l?"x":"y",d=(t,e)=>r=>{const{Rt:o}=n,s=Gt(b)[a]-Gt(x)[a],i=e*r/s*o[u];ue(y,{[u]:t+i})},p=[];return ie(b,"pointerdown",(n=>{const l=Pt(n.target,`.${tn}`)===x,v=l?x:b,g=t.scrollbars,w=g[l?"dragScroll":"clickScroll"],{button:$,isPrimary:O,pointerType:C}=n,{pointers:L}=g;if(0===$&&O&&w&&(L||[]).includes(C)){V(p),S();const t=!l&&(n.shiftKey||"instant"===w),g=ot(ne,x),$=ot(ne,b),O=(t,e)=>(t||g())[c]-(e||$())[c],C=s(ne(y)[o])/Gt(y)[a]||1,L=d(de(y)[u],1/C),D=n[r],T=g(),k=$(),A=T[o],I=O(T,k)+A/2,P=D-k[c],R=l?0:P-I,z=t=>{V(_),v.releasePointerCapture(t.pointerId)},E=l||t,j=f(),_=[ie(h,e,z),ie(h,"selectstart",(t=>le(t)),{T:!1}),ie(b,e,z),E&&ie(b,"pointermove",(t=>L(R+(t[r]-D)))),E&&(()=>{const t=de(y);j();const e=de(y),n={x:e.x-t.x,y:e.y-t.y};(i(n.x)>3||i(n.y)>3)&&(f(),ue(y,t),M(n),m(j))})];if(v.setPointerCapture(n.pointerId),t)L(R);else if(!l){const t=me(gn);if(t){const e=t(L,R,A,(t=>{t?j():H(_,j)}));H(_,e),H(p,ot(e,!0))}}}}))})(),w,S])},Vn=t=>{const e=Dn(),{K:r,U:o}=e,{elements:s}=r(),{padding:i,viewport:c,content:l}=s,a=L(t),u=a?{}:t,{elements:d}=u,{padding:p,viewport:y,content:h}=d||{},f=a?t:u.target,v=kt(f),b=f.ownerDocument,x=b.documentElement,g=()=>b.defaultView||n,w=ot(Rn,[f]),m=ot(zn,[f]),$=ot(jt,""),S=ot(w,$,c),M=ot(m,$,l),O=S(y),C=O===f,D=C&&v,T=!C&&M(h),k=!C&&O===T,A=D?x:O,P=D?A:f,R=!C&&m($,i,p),z=!k&&T,E=[z,A,R,P].map((t=>L(t)&&!It(t)&&t)),j=t=>t&&I(E,t),_=!j(A)&&(t=>{const e=Gt(t),n=te(t),r=qt(t,K),o=qt(t,X);return n.w-e.w>0&&!hn(r)||n.h-e.h>0&&!hn(o)})(A)?A:f,F=D?x:A,N={dt:f,vt:P,L:A,rn:R,ht:z,gt:F,Kt:D?b:A,ln:v?x:_,Jt:b,bt:v,At:a,V:C,an:g,wt:t=>Mt(A,Ae,t),yt:(t,e)=>St(A,Ae,t,e),St:()=>St(F,Ae,ze,!0)},{dt:U,vt:B,rn:Y,L:q,ht:W}=N,Q=[()=>{gt(B,[Te,Ce]),gt(U,Ce),v&&gt(x,[Ce,Te])}];let Z=At([W,q,Y,B,U].find((t=>t&&!j(t))));const G=D?U:W||q,J=ot(V,Q);return[N,()=>{const t=g(),e=Ht(),n=t=>{zt(It(t),At(t)),Rt(t)},r=t=>ie(t,"focusin focusout focus blur",ae,{I:!0,T:!1}),s="tabindex",i=vt(q,s),c=r(e);return xt(B,Te,C?"":ke),xt(Y,Ve,""),xt(q,Ae,""),xt(W,_e,""),C||(xt(q,s,i||"-1"),v&&xt(x,De,"")),zt(G,Z),zt(B,Y),zt(Y||B,!C&&q),zt(q,W),H(Q,[c,()=>{const t=Ht(),e=j(q),o=e&&t===q?U:t,c=r(o);gt(Y,Ve),gt(W,_e),gt(q,Ae),v&&gt(x,De),i?xt(q,s,i):gt(q,s),j(W)&&n(W),e&&n(q),j(Y)&&n(Y),fe(o),c()}]),o&&!C&&($t(q,Ae,Ee),H(Q,ot(gt,q,Ae))),fe(!C&&v&&e===U&&t.top===t?q:e),c(),Z=0,J},J]},_n=({ht:t})=>({Qt:e,un:n,It:r})=>{const{Ct:o}=e||{},{Ot:s}=n;t&&(o||r)&&Yt(t,{[Q]:s&&"100%"})},Fn=({vt:t,rn:n,L:r,V:o},s)=>{const[i,c]=e({i:rt,o:Kt()},ot(Kt,t,"padding",""));return({zt:t,Qt:e,un:l,It:a})=>{let[u,d]=c(a);const{U:p}=Dn(),{_t:y,xt:h,$t:f}=e||{},{j:v}=l,[b,x]=t("paddingAbsolute");(y||d||a||h)&&([u,d]=i(a));const g=!o&&(x||f||d);if(g){const t=!b||!n&&!p,e=u.r+u.l,o=u.t+u.b,i={[Y]:t&&!v?-e:0,[q]:t?-o:0,[B]:t&&v?-e:0,top:t?-u.t:0,right:t?v?-u.r:"auto":0,left:t?v?"auto":-u.l:0,[W]:t&&`calc(100% + ${e}px)`},c={[_]:t?u.t:0,[F]:t?u.r:0,[U]:t?u.b:0,[N]:t?u.l:0};Yt(n||r,i),Yt(r,c),ut(s,{rn:u,fn:!t,B:n?c:ut({},i,c)})}return{_n:g}}},Nn=(t,o)=>{const s=Dn(),{vt:i,rn:c,L:l,V:u,Kt:d,gt:p,bt:y,yt:h,an:f}=t,{U:v}=s,b=y&&u,x=ot(r,0),g={display:()=>!1,direction:t=>"ltr"!==t,flexDirection:t=>t.endsWith("-reverse"),writingMode:t=>"horizontal-tb"!==t},w=at(g),m={i:et,o:{w:0,h:0}},$={i:nt,o:{}},S=t=>{h(Re,!b&&t)},M=t=>{const e=w.some((e=>{const n=t[e];return n&&g[e](n)}));if(!e)return{D:{x:0,y:0},M:{x:1,y:1}};S(!0);const n=de(p),r=h(je,!0),o=ie(d,J,(t=>{const e=de(p);t.isTrusted&&e.x===n.x&&e.y===n.y&&ce(t)}),{I:!0,A:!0});ue(p,{x:0,y:0}),r();const s=de(p),i=te(p);ue(p,{x:i.w,y:i.h});const c=de(p);ue(p,{x:c.x-s.x<1&&-i.w,y:c.y-s.y<1&&-i.h});const l=de(p);return ue(p,n),a((()=>o())),{D:s,M:l}},O=(t,e)=>{const r=n.devicePixelRatio%1!=0?1:0,o={w:x(t.w-e.w),h:x(t.h-e.h)};return{w:o.w>r?o.w:0,h:o.h>r?o.h:0}},C=(t,e)=>{const n=(t,e,n,r)=>{const o=t===Z?G:(t=>t.replace(`${Z}-`,""))(t),s=hn(t),i=hn(n);return e||r?s&&i?Z:s?e&&r?o:e?Z:G:e?o:i&&r?Z:G:G};return{x:n(e.x,t.x,e.y,t.y),y:n(e.y,t.y,e.x,t.x)}},L=t=>{const e=t=>[Z,G,J].map((e=>N(fn(e),t))),n=e(!0).concat(e()).join(" ");h(n),h(at(t).map((e=>N(t[e],"x"===e))).join(" "),!0)},[D,T]=e(m,ot(ee,l)),[k,A]=e(m,ot(te,l)),[I,P]=e(m),[H]=e($),[R,z]=e(m),[E]=e($),[j]=e({i:(t,e)=>tt(t,e,w),o:{}},(()=>(t=>!!t&&(t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))(t))(l)?qt(l,w):{})),[V,_]=e({i:(t,e)=>nt(t.D,e.D)&&nt(t.M,e.M),o:{D:{x:0,y:0},M:{x:0,y:0}}}),F=me(bn),N=(t,e)=>`${e?Ie:Pe}${(t=>{const e=String(t||"");return e?e[0].toUpperCase()+e.slice(1):""})(t)}`;return({zt:e,Qt:n,un:r,It:a},{_n:u})=>{const{_t:d,Ht:p,xt:y,$t:g,ft:w,Et:m}=n||{},$=F&&F.R(t,o,r,s,e),{X:N,Y:U,W:B}=$||{},[Y,q]=yn(e,s),[K,X]=e("overflow"),W=hn(K.x),Q=hn(K.y),Z=d||u||y||g||m||q;let G=T(a),J=A(a),tt=P(a),et=z(a);if(q&&v&&h(Ee,!Y),Z){Mt(i,Te,Le)&&S(!0);const t=U&&U(),[e]=G=D(a),[n]=J=k(a),r=Jt(l),o=b&&Zt(f()),s={w:x(n.w+e.w),h:x(n.h+e.h)},c={w:x((o?o.w:r.w+x(r.w-n.w))+e.w),h:x((o?o.h:r.h+x(r.h-n.h))+e.h)};t&&t(),et=R(c),tt=I(O(s,c),a)}const[nt,rt]=et,[ot,st]=tt,[it,ct]=J,[lt,at]=G,[dt,pt]=H({x:ot.w>0,y:ot.h>0}),yt=W&&Q&&(dt.x||dt.y)||W&&dt.x&&!dt.y||Q&&dt.y&&!dt.x,ht=u||g||m||at||ct||rt||st||X||q||Z||p&&b,[ft,vt]=j(a),bt=g||w||vt||pt||a,[xt,gt]=bt?V(M(ft),a):_();let wt=C(dt,K);S(!1),ht&&(L(wt),wt=vn(l,dt),B&&N&&(N(wt,it,lt),Yt(l,B(wt))));const[mt,$t]=E(wt);return St(i,Te,Le,yt),St(c,Ve,Le,yt),ut(o,{cn:mt,Vt:{x:nt.w,y:nt.h},Rt:{x:ot.w,y:ot.h},F:dt,Dt:pe(xt,ot)}),{sn:$t,tn:rt,nn:st,en:gt||st,dn:bt}}},Un=t=>{const[e,n,r]=Vn(t),o={rn:{t:0,r:0,b:0,l:0},fn:!1,B:{[Y]:0,[q]:0,[B]:0,[_]:0,[F]:0,[U]:0,[N]:0},Vt:{x:0,y:0},Rt:{x:0,y:0},cn:{x:G,y:G},F:{x:!1,y:!1},Dt:{D:{x:0,y:0},M:{x:0,y:0}}},{dt:s,gt:i,V:c,St:l}=e,{U:a,k:u}=Dn(),d=!a&&(u.x||u.y),p=[_n(e),Fn(e,o),Nn(e,o)];return[n,t=>{const e={},n=d&&de(i),r=n&&l();return A(p,(n=>{ut(e,n(t,e)||{})})),ue(i,n),r&&r(),c||ue(s,0),e},o,e,r]},Bn=new WeakMap,Yn=t=>Bn.get(t),qn=(t,e,n)=>{const{tt:r}=Dn(),o=L(t),s=o?t:t.target,i=Yn(s);if(e&&!i){let i=!1;const c=[],l={},a=t=>{const e=dt(t),n=me($e);return n?n(e,!0):e},u=ut({},r(),a(e)),[d,p,y]=be(),[h,f,v]=be(n),g=(t,e)=>{v(t,e),y(t,e)},[w,m,$,S,M]=((t,e,n,r)=>{let o=!1;const s=On(e,{}),[i,c,l,a,u]=Un(t),[d,p,y]=Pn(a,l,s,(t=>{x({},t)})),[h,f,,v]=((t,e,n,r,o,s)=>{let i,c,l,a,u,d=yt,p=0;const y=["mouse","pen"],h=t=>y.includes(t.pointerType),[f,v]=st(),[b,x]=st(100),[g,w]=st(100),[m,$]=st((()=>p)),[S,M]=En(t,o,r,jn(e,o,r,(t=>h(t)&&R()))),{vt:O,Kt:C,bt:L}=o,{Bt:D,Pt:T,Nt:k,qt:A,jt:I}=S,P=(t,e)=>{if($(),t)D(cn);else{const t=ot(D,cn,!0);p>0&&!e?m(t):t()}},R=()=>{(l?i:a)||(P(!0),b((()=>{P(!1)})))},z=t=>{D(sn,t,!0),D(sn,t,!1)},E=t=>{h(t)&&(i=l,l&&P(!0))},j=[$,x,w,v,()=>d(),ie(O,"pointerover",E,{A:!0}),ie(O,"pointerenter",E),ie(O,"pointerleave",(t=>{h(t)&&(i=!1,l&&P(!1))})),ie(O,"pointermove",(t=>{h(t)&&c&&R()})),ie(C,"scroll",(t=>{f((()=>{k(),R()})),s(t),I()}))];return[()=>ot(V,H(j,M())),({zt:t,It:e,Qt:o,Zt:s})=>{const{tn:i,nn:y,sn:h,en:f}=s||{},{$t:v,ft:b}=o||{},{j:x}=n,{k:w}=Dn(),{cn:m,F:$}=r,[S,M]=t("showNativeOverlaidScrollbars"),[O,H]=t("scrollbars.theme"),[R,E]=t("scrollbars.visibility"),[j,V]=t("scrollbars.autoHide"),[_,F]=t("scrollbars.autoHideSuspend"),[N]=t("scrollbars.autoHideDelay"),[U,B]=t("scrollbars.dragScroll"),[Y,q]=t("scrollbars.clickScroll"),[K,X]=t("overflow"),W=b&&!e,Q=$.x||$.y,G=i||y||f||v||e,tt=h||E||X,et=S&&w.x&&w.y,nt=(t,e,n)=>{const r=t.includes(J)&&(R===Z||"auto"===R&&e===J);return D(en,r,n),r};if(p=N,W&&(_&&Q?(z(!1),d(),g((()=>{d=ie(C,"scroll",ot(z,!0),{A:!0})}))):z(!0)),M&&D(Xe,et),H&&(D(u),D(O,!0),u=O),F&&!_&&z(!0),V&&(c="move"===j,l="leave"===j,a="never"===j,P(a,!0)),B&&D(un,U),q&&D(an,!!Y),tt){const t=nt(K.x,m.x,!0),e=nt(K.y,m.y,!1);D(nn,!(t&&e))}G&&(k(),T(),I(),f&&A(),D(on,!$.x,!0),D(on,!$.y,!1),D(Qe,x&&!L))},{},S]})(t,e,y,l,a,(t=>g("scroll",[C,t]))),b=t=>at(t).some((e=>!!t[e])),x=(t,s)=>{if(n())return!1;const{pn:i,It:l,Tt:a,vn:u}=t,d=i||{},h=!!l||!o,v={zt:On(e,d,h),pn:d,It:h};if(u)return f(v),!1;const x=s||p(ut({},v,{Tt:a})),g=c(ut({},v,{un:y,Qt:x}));f(ut({},v,{Qt:x,Zt:g}));const w=b(x),m=b(g),$=w||m||!pt(d)||h;return o=!0,$&&r(t,{Qt:x,Zt:g}),$};return[()=>{const{ln:t,gt:e,St:n}=a,r=de(t),o=[d(),i(),h()],s=n();return ue(e,r),s(),ot(V,o)},x,()=>({gn:y,hn:l}),{bn:a,wn:v},u]})(t,u,(()=>i),(({pn:t,It:e},{Qt:n,Zt:r})=>{const{_t:o,$t:s,Ct:i,xt:c,Ht:l,ft:a}=n,{tn:u,nn:d,sn:p,en:y}=r;g("updated",[C,{updateHints:{sizeChanged:!!o,directionChanged:!!s,heightIntrinsicChanged:!!i,overflowEdgeChanged:!!u,overflowAmountChanged:!!d,overflowStyleChanged:!!p,scrollCoordinatesChanged:!!y,contentMutation:!!c,hostMutation:!!l,appear:!!a},changedOptions:t||{},force:!!e}])})),O=t=>{(t=>{Bn.delete(t)})(s),V(c),i=!0,g("destroyed",[C,t]),p(),f()},C={options(t,e){if(t){const n=e?r():{},o=Mn(u,ut(n,a(t)));pt(o)||(ut(u,o),m({pn:o}))}return ut({},u)},on:h,off:(t,e)=>{t&&e&&f(t,e)},state(){const{gn:t,hn:e}=$(),{j:n}=t,{Vt:r,Rt:o,cn:s,F:c,rn:l,fn:a,Dt:u}=e;return ut({},{overflowEdge:r,overflowAmount:o,overflowStyle:s,hasOverflow:c,scrollCoordinates:{start:u.D,end:u.M},padding:l,paddingAbsolute:a,directionRTL:n,destroyed:i})},elements(){const{dt:t,vt:e,rn:n,L:r,ht:o,gt:s,Kt:i}=S.bn,{Ft:c,Gt:l}=S.wn,a=t=>{const{Mt:e,Ut:n,Lt:r}=t;return{scrollbar:r,track:n,handle:e}},u=t=>{const{Xt:e,Yt:n}=t,r=a(e[0]);return ut({},r,{clone:()=>{const t=a(n());return m({vn:!0}),t}})};return ut({},{target:t,host:e,padding:n||r,viewport:r,content:o||r,scrollOffsetElement:s,scrollEventElement:i,scrollbarHorizontal:u(c),scrollbarVertical:u(l)})},update:t=>m({It:t,Tt:!0}),destroy:ot(O,!1),plugin:t=>l[at(t)[0]]};return H(c,[M]),((t,e)=>{Bn.set(t,e)})(s,C),we(xe,qn,[C,d,l]),((t,e)=>{const{nativeScrollbarsOverlaid:n,body:r}=e||{},{k:o,U:s,K:i}=Dn(),{nativeScrollbarsOverlaid:c,body:l}=i().cancel,a=null!=n?n:c,u=b(r)?l:r,d=(o.x||o.y)&&a,p=t&&(x(u)?!s:u);return!!d||!!p})(S.bn.bt,!o&&t.cancel)?(O(!0),C):(H(c,w()),g("initialized",[C]),C.update(),C)}return i};return qn.plugin=t=>{const e=S(t),n=e?t:[t],r=n.map((t=>we(t,qn)[0]));return(t=>{A(t,(t=>A(t,((e,n)=>{xe[n]=t[n]}))))})(n),e?r:r[0]},qn.valid=t=>{const e=t&&t.elements,n=$(e)&&e();return C(n)&&!!Yn(n.target)},qn.env=()=>{const{P:t,k:e,U:n,G:r,ot:o,st:s,K:i,Z:c,tt:l,nt:a}=Dn();return ut({},{scrollbarsSize:t,scrollbarsOverlaid:e,scrollbarsHiding:n,scrollTimeline:r,staticDefaultInitialization:o,staticDefaultOptions:s,getDefaultInitialization:i,setDefaultInitialization:c,getDefaultOptions:l,setDefaultOptions:a})},qn.nonce=t=>{Cn=t},qn.trustedTypePolicy=t=>{Et=t},t.ClickScrollPlugin=wn,t.OverlayScrollbars=qn,t.ScrollbarsHidingPlugin=xn,t.SizeObserverPlugin=pn,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});