mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-23 02:10:35 +03:00
1 line
21 KiB
JavaScript
1 line
21 KiB
JavaScript
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).OverlayScrollbars=t()}(this,(function(){"use strict";var n=function(n,t){var r,e=t||{},i=e.o,o=e.u,u=e.v,a=o;return{s:function(t,e){var o=a,c=n?n(e,a,r):e,f=t||(i?!i(o,c):o!==c);return(f||u)&&(a=c,r=o),{_:a,g:r,p:f}},m:function(n){return{_:a,g:r,p:!!n}}}},t=Node.ELEMENT_NODE,r=Object.prototype,e=r.toString,i=r.hasOwnProperty;function o(n){return void 0===n}function u(n){return null===n}var a=function(n){return o(n)||u(n)?""+n:e.call(n).replace(/^\[object (.+)\]$/,"$1").toLowerCase()};function c(n){return"number"==typeof n}function f(n){return"string"==typeof n}function l(n){return"boolean"==typeof n}function v(n){return"function"==typeof n}function d(n){return Array.isArray(n)}function s(n){return"object"==typeof n&&!d(n)&&!u(n)}function _(n){var t=!!n&&n.length,r=c(t)&&t>-1&&t%1==0;return!!(d(n)||!v(n)&&r)&&(!(t>0&&s(n))||t-1 in n)}function g(n){if(!n||!s(n)||"object"!==a(n))return!1;var t,r="constructor",e=n[r],u=e&&e.prototype,c=i.call(n,r),f=u&&i.call(u,"isPrototypeOf");if(e&&!c&&!f)return!1;for(t in n);return o(t)||i.call(n,t)}function h(n){var r=window.Element;return!!n&&(r?n instanceof r:n.nodeType===t)}function p(n,t){if(_(n))for(var r=0;r<n.length&&!1!==t(n[r],r,n);r++);else n&&p(Object.keys(n),(function(r){return t(n[r],r,n)}));return n}var w=function(n,t,r){return r||f(t)||!_(t)?n.push(t):Array.prototype.push.apply(n,t),n},b=function(n){if(Array.from)return Array.from(n);var t=[];return p(n,(function(n){w(t,n)})),t},m=function(n){return n&&0===n.length},y=function(n,t){var r=function(n){return n&&n(t)};n instanceof Set?n.forEach(r):p(n,r)},S=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},x=function(n){return n?Object.keys(n):[]};function O(n,t,r,e,i,o,a){var c=[t,r,e,i,o,a];return"object"==typeof n&&!u(n)||v(n)||(n={}),p(c,(function(t){p(x(t),(function(r){var e=t[r];if(n===e)return!0;var i=d(e);if(e&&(g(e)||i)){var o=n[r],u=o;i&&!d(o)?u=[]:i||g(o)||(u={}),n[r]=O(u,e)}else n[r]=e}))})),n}function C(n){for(var t in n)return!1;return!0}function z(n,t,r,e){if(o(e))return r?r[n]:t;r&&(r[n]=e)}function A(n,t,r){if(o(r))return n?n.getAttribute(t):null;n&&n.setAttribute(t,r)}function L(n,t){return z("scrollLeft",0,n,t)}function M(n,t){return z("scrollTop",0,n,t)}var T,I=Element.prototype,j=function(n,t){var r=[],e=t?h(t)?t:null:document;return e?w(r,e.querySelectorAll(n)):r},R=function(n,t){return!!h(n)&&(I.matches||I.msMatchesSelector).call(n,t)},V=function(n){return n?b(n.childNodes):[]},E=function(n){return n?n.parentElement:null},B=function(n,t){if(h(n)){var r=I.closest;if(r)return r.call(n,t);do{if(R(n,t))return n;n=E(n)}while(n)}return null},D=function(n,t,r){var e=n&&B(n,t),i=n&&function(n,t){var r=t?h(t)?t:null:document;return r?r.querySelector(n):null}(r,e);return!(!e||!i)&&(e===n||i===n||B(B(n,r),t)!==e)},F=function(n,t,r){if(r){var e,i=t;n&&(_(r)?(e=document.createDocumentFragment(),p(r,(function(n){n===i&&(i=n.previousSibling),e.appendChild(n)}))):e=r,t&&(i?i!==t&&(i=i.nextSibling):i=n.firstChild),n.insertBefore(e,i||null))}},q=function(n,t){F(n,null,t)},P=function(n,t){F(n,n&&n.firstChild,t)},k=function(n,t){F(E(n),n&&n.nextSibling,t)},H=function n(t){if(_(t))p(b(t),(function(t){return n(t)}));else if(t){var r=E(t);r&&r.removeChild(t)}},Y=function(n){var t=document.createElement("div");return n&&A(t,"class",n),t},N=function(n){var t=Y();return t.innerHTML=n.trim(),p(V(t),(function(n){return H(n)}))},X=function(n){return n.charAt(0).toUpperCase()+n.slice(1)},U=["-webkit-","-moz-","-o-","-ms-"],W=["WebKit","Moz","O","MS","webkit","moz","o","ms"],$={},G={},J=function(n){var t=G[n];if(S(G,n))return t;var r=X(n),e=Y().style;return p(U,(function(i){var o=i.replace(/-/g,""),u=[n,i+n,o+r,X(o)+r];return!(t=u.find((function(n){return void 0!==e[n]})))})),G[n]=t||""},K=function(n){var t=$[n]||window[n];return S($,n)||(p(W,(function(r){return!(t=t||window[r+X(n)])})),$[n]=t),t},Q=K("MutationObserver"),Z=K("IntersectionObserver"),nn=K("ResizeObserver"),tn=K("cancelAnimationFrame"),rn=K("requestAnimationFrame"),en=/[^\x20\t\r\n\f]+/g,on=function(n,t,r){var e,i=0,o=!1;if(n&&f(t)){var u=t.match(en)||[];for(o=u.length>0;e=u[i++];)o=!!r(n.classList,e)&&o}return o},un=function(n,t){on(n,t,(function(n,t){return n.add(t)}))},an=function(n,t){on(n,t,(function(n,t){return n.remove(t)}))},cn={w:0,h:0},fn=function(){return{w:window.innerWidth,h:window.innerHeight}},ln=function(n){return n?{w:n.offsetWidth,h:n.offsetHeight}:cn},vn=function(n){return n?{w:n.clientWidth,h:n.clientHeight}:cn},dn=function(n){return n?{w:n.scrollWidth,h:n.scrollHeight}:cn},sn=function(n){return n.getBoundingClientRect()},_n=function(n){return n.split(" ")},gn=function(n,t,r,e){p(_n(t),(function(t){n.removeEventListener(t,r,e)}))},hn=function(n,t,r,e){var i=function(){if(o(T)){T=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){T=!0}}))}catch(n){}}return T}(),u=i&&e&&e.S||!1,a=e&&e.O||!1,c=e&&e.C||!1,f=[],l=i?{passive:u,capture:a}:a;return p(_n(t),(function(t){var e=c?function(i){n.removeEventListener(t,e,a),r&&r(i)}:r;w(f,gn.bind(null,n,t,e,a)),n.addEventListener(t,e,l)})),y.bind(0,f)},pn=function(n){return function(n){return n.stopPropagation()}(n)||function(n){return n.preventDefault()}(n)},wn=function(n,t,r,e){if(n&&t){var i=!0;return p(r,(function(r){(e?e(n[r]):n[r])!==(e?e(t[r]):t[r])&&(i=!1)})),i}return!1},bn=function(n,t){return wn(n,t,["w","h"])},mn=function(n,t){return wn(n,t,["t","r","b","l"])},yn=function(n,t,r){return wn(n,t,["width","height"],r&&function(n){return Math.round(n)})},Sn=function(){},xn={opacity:1,zindex:1},On=function(n,t){var r=t?parseFloat(n):parseInt(n,10);return Number.isNaN(r)?0:r},Cn=function(n,t,r){return null!=t?t[r]||t.getPropertyValue(r):n.style[r]},zn=function(n,t,r){try{if(n){var e=n.style;o(e[t])?e.setProperty(t,r):e[t]=function(n,t){return!xn[n.toLowerCase()]&&c(t)?t+"px":t}(t,r)}}catch(i){}};function An(n,t){var r=f(t);if(d(t)||r){var e=r?"":{};if(n){var i=window.getComputedStyle(n,null);e=r?Cn(n,i,t):t.reduce((function(t,r){return t[r]=Cn(n,i,r),t}),e)}return e}p(x(t),(function(r){return zn(n,r,t[r])}))}var Ln=function(n,t,r){var e=t?t+"-":"",i=r?"-"+r:"",o=e+"top"+i,u=e+"right"+i,a=e+"bottom"+i,c=e+"left"+i,f=An(n,[o,u,a,c]);return{t:On(f[o]),r:On(f[u]),b:On(f[a]),l:On(f[c])}},Mn={x:0,y:0},Tn=function(n){var t=n?sn(n):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:Mn};var In,jn=function(n){var t={exports:{}};return n(t,t.exports),t.exports}((function(n){function t(){return n.exports=t=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n},t.apply(this,arguments)}n.exports=t})),Rn=JSON.stringify,Vn=["__TPL_","_TYPE__"],En=["boolean","number","string","array","object","function","null"].reduce((function(n,t){return n[t]=Vn[0]+t+Vn[1],n}),{}),Bn=function(n,t,r,e){return function n(t,r,e,i,u){var c={},l=jn({},t);return p(x(r).filter((function(n){return S(t,n)})),(function(v){var s=o(e[v])?{}:e[v],_=t[v],h=r[v],b=g(h),m=u?u+".":"";if(b&&g(_)){var y=n(_,h,s,i,m+v);c[v]=y.A,l[v]=y.L,p([l,c],(function(n){C(n[v])&&delete n[v]}))}else if(!b){var S=!1,x=[],O=[],z=a(_);if(p(d(h)?h:[h],(function(n){var t;p(En,(function(r,e){r===n&&(t=e)}));var r=o(t);if(r&&f(_)){var e=n.split(" ");S=!!e.find((function(n){return n===_})),w(x,e)}else S=En[z]===n;return w(O,r?En.string:t),!S})),S)(d(_)||g(_)?Rn(_)!==Rn(s):_!==s)&&(c[v]=_);else i&&console.warn('The option "'+m+v+"\" wasn't set, because it doesn't accept the type [ "+z.toUpperCase()+' ] with the value of "'+_+'".\r\n'+"Accepted types are: [ "+O.join(", ").toUpperCase()+" ].\r\n"+(x.length>0?"\r\nValid strings are: [ "+x.join(", ")+" ].":""));delete l[v]}})),{L:l,A:c}}(n,t,r||{},e||!1)},Dn="os-environment",Fn=Dn+"-flexbox-glue",qn=Fn+"-max",Pn="os-host",kn="os-padding",Hn="os-viewport",Yn=Hn+"-arrange",Nn="os-content",Xn=Hn+"-scrollbar-styled",Un="os-size-observer",Wn=Un+"-appear",$n=Un+"-listener",Gn=$n+"-scroll",Jn=$n+"-item",Kn=Jn+"-final",Qn="os-trinsic-observer",Zn=En.number,nt=[En.string,En.array,En.null],tt=[!0,En.boolean],rt=[!1,En.boolean],et="hidden scroll visible visible-hidden",it=function n(t){var r={M:{},T:{}};return p(x(t),(function(e){var i=t[e];if(d(i))r.M[e]=i[1],r.T[e]=i[0];else{var o=n(i);r.M[e]=o.M,r.T[e]=o.T}})),r}({resize:["none","none both horizontal vertical"],paddingAbsolute:rt,updating:{elementEvents:[[["img","load"]],[En.array,En.null]],contentMutationDebounce:[80,Zn],hostMutationDebounce:[0,Zn],resizeDebounce:[0,Zn]},overflow:{x:["scroll",et],y:["scroll",et]},scrollbars:{visibility:["auto","visible hidden auto"],autoHide:["never","never scroll leavemove"],autoHideDelay:[800,Zn],dragScroll:tt,clickScroll:rt,touch:tt},textarea:{dynWidth:rt,dynHeight:rt,inheritedAttrs:[["style","class"],nt]},nativeScrollbarsOverlaid:{show:rt,initialize:rt},callbacks:{onUpdated:[null,[En.function,En.null]]}}),ot=it.M,ut=it.T,at=Math.abs,ct=Math.round,ft=function(n,t){q(n,t);var r=vn(t),e=ln(t);return{x:e.h-r.h,y:e.w-r.w}},lt=function(n,t){var r="hidden";An(n,{overflowX:r,overflowY:r,direction:"rtl"}),L(n,0);var e=Tn(n),i=Tn(t);L(n,-999);var o=Tn(t);return{i:e.x===i.x,n:i.x!==o.x}},vt=function(n,t){un(n,Fn);var r=sn(n),e=sn(t),i=yn(e,r,!0);un(n,qn);var o=sn(n),u=sn(t),a=yn(u,o,!0);return i&&a},dt=function(){var n=window.screen.deviceXDPI||0,t=window.screen.logicalXDPI||1;return window.devicePixelRatio||n/t},st=function(){var n,t,r=document.body,e=N('<div class="'+Dn+'"><div></div></div>')[0],i=e.firstChild,o=new Set,u=ft(r,e),a=function(n){var t=!1;un(n,Xn);try{t="none"===An(n,J("scrollbar-width"))||"none"===window.getComputedStyle(n,"::-webkit-scrollbar").getPropertyValue("display")}catch(r){}return t}(e),c={x:0===u.x,y:0===u.y},f=function(n){return{I:!n,j:!1}}(a),l=f,v=ut,d={R:u,V:c,B:a,D:"-1"===An(e,"zIndex"),F:lt(e,i),q:vt(e,i),P:function(n){o.add(n)},k:function(n){o.delete(n)},H:function(){return jn({},l)},Y:function(n){l=O({},l,n)},N:function(){return jn({},v)},X:function(n){v=O({},v,n)},U:f,W:v};if(t="style",(n=e)&&n.removeAttribute(t),H(e),!(a||c.x&&c.y)){var s=fn(),_=dt(),g=u;window.addEventListener("resize",(function(){if(o.size){var n=fn(),t={w:n.w-s.w,h:n.h-s.h};if(0===t.w&&0===t.h)return;var i={w:at(t.w),h:at(t.h)},u={w:at(ct(n.w/(s.w/100))),h:at(ct(n.h/(s.h/100)))},a=dt(),c=i.w>2&&i.h>2,f=(v=u.h,d=at(u.w),h=at(v),!(d!==h&&d+1!==h&&d-1!==h));if(c&&f&&(a!==_&&_>0)){var l=In.R=ft(r,e);H(e),g.x===l.x&&g.y===l.y||y(o),g=l}s=n,_=a}var v,d,h}))}return d},_t=function(){return In||(In=st()),In},gt=function(n){q(E(n),V(n)),H(n)},ht=0,pt=function(n,t){var r=l(n);return r||o(n)?(r?n:t)&&void 0:n},wt=function(n){var r=_t(),e=r.H,i=r.B,u=r.V,a=r.D,c=e(),f=c.I,l=c.j,v=function(n){var r=window.HTMLElement;return!!n&&(r?n instanceof r:n.nodeType===t)}(n),d=v?{}:{$:n.host,G:n.target,J:n.viewport,I:pt(n.padding,f),j:pt(n.content,l)};if(v){var s=Y(Hn),_=f&&Y(kn),g=l&&Y(Nn);d.G=n,d.I=_,d.J=s,d.j=g}var h=d.G,p=d.I,b=d.J,m=d.j,S=[],x=R(h,"textarea"),O=!x&&R(h,"body"),C=x?d.$||Y():h,z=function(n){return x?h:V(n)};if(x&&C!==d.$&&(k(h,C),w(S,(function(){k(C,h),H(C)}))),v){var L=m||b;q(L,z(h)),q(C,p),q(p||C,b),q(b,m),w(S,(function(){q(C,V(L)),H(p||b),an(C,Pn)}))}else{var M=m||b||p||C,T=o(p),I=o(b),j=o(m),B=z(M);p=d.I=T?Y():p,b=d.J=I?Y():b,m=d.j=j?Y():m,q(C,p),q(p||C,b),q(b,m),q(m||b,B),w(S,(function(){j&>(m),I&>(b),T&>(p),an(C,Pn),an(p,kn),an(b,Hn),an(m,Nn)}))}un(C,Pn),un(p,kn),un(b,Hn),un(m,Nn);var D,P,N,X=h.ownerDocument,U=X.body,W={K:X.defaultView,Z:X,nn:E(U),tn:U,rn:x,en:O},$=jn({},d,{$:C});if(i)w(S,an.bind(0,b,Xn));else if(!a&&(u.x||u.y)){var G=(A(N=document.createElement("style"),"id",Yn+"-"+ht),ht++,N);P=G,F(E(D=b),D,P),w(S,H.bind(0,G)),$.in=G}return{on:$,un:W,an:function(){y(S)}}},bt=function(n){var t=n.cn.on.j;return function(n){var r=n.fn,e=r._,i=r.p;return i&&An(t,{height:e?"":"100%",display:e?"":"inline"}),{ln:i,vn:i}}},mt=function(t){var r=t.cn,e=t.dn,i=r.on,o=i.$,u=i.I,a=i.J,c=n(Ln.bind(0,o,"padding"),{o:mn,u:Ln()}),f=c.s,l=c.m;return function(n,t,r){var i=l(r),o=i._,c=i.p,v=_t(),d=v.B,s=v.q,_=n.ln,g=n.sn,h=n.vn,p=g._,w=g.p,b=t("paddingAbsolute"),m=b._,y=b.p;if(_||c||!s&&h){var S=f(r);o=S._,c=S.p}var x=y||w||c;if(x){var O=!m||!u&&!d,C=o.r+o.l,z=o.t+o.b,A={marginRight:O&&!p?-C:0,marginBottom:O?-z:0,marginLeft:O&&p?-C:0,top:O?-o.t:0,right:O?p?-o.r:"auto":0,left:O?p?"auto":-o.l:0,width:O?"calc(100% + "+C+"px)":""},L={paddingTop:O?o.t:0,paddingRight:O?o.r:0,paddingBottom:O?o.b:0,paddingLeft:O?o.l:0};An(u||a,A),An(a,L),e({_n:{gn:!O,I:o},hn:u?L:jn({},A,L)})}return{pn:x}}},yt=Math.max,St=Math.abs,xt=Math.round,Ot=42,Ct={o:bn,u:{w:0,h:0}},zt=function(n){var t=ln(n),r=sn(n);return{w:r.width-t.w,h:r.height-t.h}},At=function(n,t,r,e){var i=n?"overflowX":"overflowY",o=0===r.indexOf("visible"),u="visible-hidden"===r,a="scroll"===r,c=t>0;return o&&(e[i]="visible"),a&&c&&(e[i]=r),{wn:o,bn:u?"hidden":"scroll"}},Lt=function(t){var r=t.cn,e=t.mn,i=t.yn,o=t.dn,u=r.on,a=u.$,c=u.J,f=u.in,l=n(zt.bind(0,c),Ct),v=l.s,d=l.m,s=n(dn.bind(0,c),Ct),_=s.s,g=s.m,h=n((function(n){var t=n.Sn,r=n.xn,e=n.On;return{w:xt(yt(0,t.w-r.w)-yt(0,e.w)),h:xt(yt(0,t.h-r.h)-yt(0,e.h))}}),Ct),w=h.s,b=h.m,m=function(n,t){if(An(c,{height:""}),t){var r=i()._n,e=r.gn,o=r.I,u=n.Cn,f=n.zn,l=zt(a),v=vn(a),d=e||"content-box"===An(c,"boxSizing")?o.b+o.t:0,s=v.h+(St(l.h)<1?l.h:0);An(c,{height:s+(u.x?f.x:0)-d})}},y=function(n,t){var r=_t(),e=r.R,i=r.V,o=r.B,u=i.x,a=i.y,f=o||n?0:Ot,l=!t?An(c,["overflowX","overflowY"]):t,v={x:"scroll"===l.overflowX,y:"scroll"===l.overflowY};return{Cn:v,An:{x:u&&!!f,y:a&&!!f},zn:{x:v.x&&!o?u?f:e.x:0,y:v.y&&!o?a?f:e.y:0}}},S=function(n,t,r,o){if(e){var u=n.zn,a=n.An,l=a.x,v=a.y,d=u.x,s=u.y,_=i().hn,g=_[o?"paddingRight":"paddingLeft"],h=_.paddingTop,p=t.w+(St(r.w)<1?r.w:0),w=t.h+(St(r.h)<1?r.h:0),b={w:s&&v?s+p-g+"px":"",h:d&&l?d+w-h+"px":""};if(f){var m=f.sheet;if(m){var y=m.cssRules;if(y){y.length||m.insertRule("#"+A(f,"id")+" + ."+Yn+"::before {}",0);var S=y[0].style;S.width=b.w,S.height=b.h}}}else An(c,{"--os-vaw":b.w,"--os-vah":b.h})}return e},O=function(n,t,r,e){var o=n.zn,u=n.An,a=u.x,c=u.y,f=o.x,l=o.y,v=i().hn,d=t?"marginLeft":"marginRight",s=t?"paddingLeft":"paddingRight",_=v[d],g=v.marginBottom,h=v[s],p=v.paddingBottom;e.width="calc(100% + "+(l+-1*_)+"px)",e[d]=-l+_,e.marginBottom=-f+g,r&&(e[s]=h+(c?l:0),e.paddingBottom=p+(a?f:0))};return function(n,t,r){var u,a=n.sn,f=n.fn,l=n.ln,s=n.Ln,h=n.vn,C=n.pn,z=_t(),A=z.q,L=z.B,M=z.V,T=f._,I=f.p,j=a._,R=a.p,V=t("nativeScrollbarsOverlaid.show"),E=V._,B=V.p,D=E&&M.x&&M.y,F=!A&&(l||h||s||B||I),q=d(r),P=g(r),k=b(r);if(B&&L&&(D?an(c,Xn):un(c,Xn)),F&&(u=y(D),m(u,!!T)),l||C||h||B||R){var H=function(n,t,r){if(e){var o=r||y(n),u=i().hn,a=_t().q,f=o.An,l=f.x,v=f.y,d={},s=function(n){return p(n.split(" "),(function(n){d[n]=u[n]}))};a||(d.height=""),l&&s("marginBottom paddingTop paddingBottom"),v&&s("marginLeft marginRight paddingLeft paddingRight");var _=An(c,x(d));return an(c,Yn),An(c,d),{Mn:function(){O(o,t,e,_),An(c,_),un(c,Yn)},Tn:o}}return{Mn:Sn}}(D,j,u),Y=H.Mn,N=H.Tn,X=q=v(r),U=X._,W=X.p,$=P=_(r),G=$._,J=$.p,K=vn(c),Q=G,Z=K;Y(),(J||W||B)&&N&&!D&&S(N,G,U,j)&&(Z=vn(c),Q=dn(c)),k=w(r,{On:U,Sn:{w:yt(G.w,Q.w),h:yt(G.h,Q.h)},xn:{w:Z.w+yt(0,K.w-G.w),h:Z.h+yt(0,K.h-G.h)}})}var nn=q,tn=nn._,rn=nn.p,en=P,on=en._,cn=en.p,fn=k,ln=fn._,sn=fn.p,_n=t("overflow"),gn=_n._,hn=_n.p;if(C||rn||cn||sn||hn||B||R||F){var pn={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},wn=function(n,t,r,e){var i=At(!0,t.w,r.x,e),o=i.wn,u=i.bn,a=At(!1,t.h,r.y,e),c=a.wn,f=a.bn;return o&&!c&&(e.overflowX=u),c&&!o&&(e.overflowY=f),y(n,e)}(D,ln,gn,pn),bn=S(wn,on,tn,j);O(wn,j,bn,pn),F&&m(wn,!!T),An(c,pn),o({In:wn.Cn,jn:ln})}}},Mt="animationstart",Tt="scroll",It=3333333,jt=function(n){return"rtl"===An(n,"direction")},Rt=function(n){return n&&(n.height||n.width)},Vt=function(t,r,e){var i,o=e||{},u=o.Rn,a=void 0!==u&&u,c=o.Vn,f=void 0!==c&&c,v=_t().F,s=N('<div class="'+Un+'"><div class="'+$n+'"></div></div>')[0],_=s.firstChild,g=n(0,{v:!0,o:function(n,t){return!(!n||!Rt(n)&&Rt(t))}}).s,h=function(n){var t=n&&l(n._),e=!1;if(d(n)&&n.length>0){var i=g(0,n.pop().contentRect),o=i.g,u=i._;i.p;e=!o||!Rt(u)}else t&&n.p;if(a){var c=t?n._:jt(s);L(s,c?v.n?-It:v.i?0:It:It),M(s,It)}e||r(t?n:void 0)},p=[],b=!!f&&h;if(nn){var m=new nn(h);m.observe(_),w(p,(function(){return m.disconnect()}))}else{var S=N('<div class="'+Jn+'" dir="ltr"><div class="'+Jn+'"><div class="'+Kn+'"></div></div><div class="'+Jn+'"><div class="'+Kn+'" style="width: 200%; height: 200%"></div></div></div>');q(_,S),un(_,Gn);var x,O=S[0],C=O.lastChild,z=O.firstChild,A=null==z?void 0:z.firstChild,T=ln(O),I=T,j=!1,R=function(){L(z,It),M(z,It),L(C,It),M(C,It)},V=function(){x=0,j&&(T=I,h())},E=function(n){I=ln(O),j=!n||!bn(I,T),n?(pn(n),j&&!x&&(tn(x),x=rn(V))):V(),R()};w(p,[hn(z,Tt,E),hn(C,Tt,E)]),An(A,{width:It,height:It}),R(),b=f?E.bind(0,!1):R}if(a){var B=(i=n(jt.bind(0,s))).s;w(p,hn(s,Tt,(function(n){var t=B(),r=t._;t.p&&(an(_,"ltr rtl"),un(_,r?"rtl":"ltr"),h(t)),pn(n)})))}return b&&(un(s,Wn),w(p,hn(s,Mt,b,{C:!!nn}))),P(t,s),{an:function(){y(p),H(s)},En:function(n){return{sn:i?i.m(n):{_:!1,g:!1,p:!1}}}}},Et=function(n,t,r,e){var i,u,a,l,d,s,_,g,h,b,y=!1,S=e||{},x=S.Bn,O=S.Dn,C=S.Fn,z=S.qn,L=S.Pn,M=S.kn,T=S.Hn,I=function(n,t,r){var e,i,u=function(){e&&(e.forEach((function(n,t){return gn(t,n,r)})),e.clear())},a=function(t){e&&i&&p(i.reduce((function(r,e){if(e){var i=e[0],o=e[1],u=o&&i&&(t?t(i):j(i,n)),a=v(o)?o(u):o;u&&u.length&&a&&f(a)&&w(r,[u,a.trim()],!0)}return r}),[]),(function(n){return p(n[0],(function(t){var i=n[1],u=e.get(t),a=!o(u)&&i!==u,c=a?u+" "+i:i;a&&gn(t,u,r),e.set(t,c),hn(t,c,r)}))}))},c=function(n){e=e||new Map,i=n,u(),a()};return t&&c(t),{an:u,Yn:a,Nn:c}}(n,t&&C,(i=function(){y&&r(!0)},s=c(u=84)&&u>0,_=c(a)&&a>0,g=s?window.clearTimeout:tn,h=s?window.setTimeout:rn,b=function(n){d=_?performance.now():0,l&&g(l),i.apply(this,n)},function(){var n=b.bind(this,arguments),t=!!_&&performance.now()-d>=a;l&&g(l),l=t?n():h(n,u)})),V=I.an,E=I.Yn,B=I.Nn,D=O||[],F=(x||[]).concat(D),q=function(i){var o=(t?M:L)||Sn,u=T||Sn,a=[],c=[],l=!1,v=!1,d=!1;p(i,(function(r){var i,s,_=r.attributeName,g=r.target,h=r.type,p=r.oldValue,b=r.addedNodes,m="attributes"===h,y="childList"===h,S=n===g,x=m&&f(_)?A(g,_):0,O=0!==x&&p!==x,C=(i=_,D.indexOf(i,s)>-1&&O);if(t&&!S){var L=!m,M=m&&C,T=M&&z&&R(g,z),I=(T?!o(g,_,p,x):L||M)&&!u(r,!!T,n,e);w(c,b),v=v||I,d=d||y}!t&&S&&O&&!o(g,_,p,x)&&(w(a,_),l=l||C)})),d&&!m(c)&&E((function(n){return c.reduce((function(t,r){return w(t,j(n,r)),R(r,n)?w(t,r):t}),[])})),t?v&&r(v):m(a)&&!l||r(a,l)},P=new Q(q);return P.observe(n,{attributes:!0,attributeOldValue:!0,attributeFilter:F,subtree:t,childList:t,characterData:t}),y=!0,{an:function(){y&&(V(),P.disconnect(),y=!1)},Nn:function(n){B(y&&t&&n)},s:function(){y&&q(P.takeRecords())}}},Bt=function(n,t){return n?t.split(".").reduce((function(n,t){return n&&S(n,t)?n[t]:void 0}),n):void 0},Dt="os-",Ft="."+Pn,qt="."+Hn,Pt="."+Nn,kt=["id","class","style","open"],Ht=function(n,t,r,e){var i,o,u,a,c;return!("class"!==t||!r||!e)&&!!(o=e,u=(i=r)&&i.split(" "),a=o&&o.split(" "),c={},p(u,(function(n){c[n]=1})),p(a,(function(n){c[n]?delete c[n]:c[n]=1})),x(c)).find((function(n){return 0!==n.indexOf(Dt)}))},Yt={_:!1,g:!1,p:!1},Nt={_:!1,g:!1,p:!1},Xt={_n:{gn:!1,I:{t:0,r:0,b:0,l:0}},In:{x:!1,y:!1},jn:{w:0,h:0},hn:{marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0}},Ut=function(t,r){var e=Xt,i=r.on,o=i.$,u=i.J,a=i.j,f=_t(),l=f.B,v=f.V,d=f.q,s=f.P,_=f.k,g=!l&&(v.x||v.y),h={T:t,cn:r,mn:g,yn:function(){return e},dn:function(n){e=O({},e,n)}},b=[bt(h),mt(h),Lt(h)],m=function(n,r,e){var i=n||{},o=i.sn,a=i.fn,f=i.ln,l=void 0===f?e||!1:f,v=i.Ln,s=void 0===v?e||!1:v,_=i.vn,h=void 0===_?e||!1:_,w=i.pn,m=void 0===w?e||!1:w,y=o||(x?x.En(e).sn:Yt),O=a||(S?S.En(e).fn:Nt),C=function(n){return{_:Bt(t,n),p:e||void 0!==Bt(r,n)}},z=g||!d,A=z&&L(u),T=z&&M(u);p(b,(function(n){var t=n({sn:y,fn:O,ln:l,Ln:s,vn:h,pn:m},C,!!e)||{},r=t.ln,i=t.Ln,o=t.vn,u=t.pn;l=r||l,s=i||s,h=o||h,m=u||m})),c(A)&&L(u,A),c(T)&&M(u,T),t.callbacks.onUpdated&&t.callbacks.onUpdated()},S=(a||!d)&&function(t,r){var e=Y(Qn),i=[],o=n((function(n){return 0===n.h||n.isIntersecting||n.intersectionRatio>0}),{u:!1}),u=o.s,a=o.m;if(Z){var c=new Z((function(n){if(n&&n.length>0){var t=n.pop();if(t){var e=u(0,t);e.p&&r(e)}}}),{root:t});c.observe(e),w(i,(function(){return c.disconnect()}))}else{var f=function(){var n=ln(e),t=u(0,n);t.p&&r(t)};w(i,Vt(e,f).an),f()}return P(t,e),{an:function(){y(i),H(e)},En:function(n){return{fn:a(n)}}}}(o,(function(n){m({fn:n})})),x=Vt(o,(function(n){m({sn:n,ln:!n})}),{Vn:!0,Rn:!l}),C=(Et(o,!1,(function(){requestAnimationFrame((function(){m({Ln:!0})}))}),{Dn:kt,Bn:kt,Pn:Ht}),Et(a||u,!0,(function(){requestAnimationFrame((function(){m({vn:!0})}))}),{Dn:kt,Bn:kt,Fn:t.updating.elementEvents,qn:Ft,Hn:function(n,t){var r=n.target,e=n.attributeName;return!t&&(!!e&&(D(r,Ft,qt)||D(r,Ft,Pt)))},kn:Ht}),function(n,t){m(null,n,t)}),z=C.bind(null,null,!0);return s(z),console.log(_t()),{s:C,Xn:function(){return{Un:e.jn}},an:function(){_(z)}}};return function(n,t,r){var e=O({},(0,_t().N)(),Bn(t||{},ot,null,!0).A),i=wt(n),o=Ut(e,i),u={options:function(n){if(n){var t=Bn(n,ot,e,!0).A;C(t)||(O(e,t),o.s(t))}return e},state:function(){return o.Xn()},update:function(n){o.s(null,n)}};return u.update(!0),u}})); |