@danielgindi/virtual-list-helper 1.0.16 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/virtual-list-helper 1.0.16
2
+ * @danielgindi/virtual-list-helper 1.0.17
3
3
  * git://github.com/danielgindi/virtual-list-helper.git
4
4
  */
5
5
  'use strict';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/virtual-list-helper 1.0.16
2
+ * @danielgindi/virtual-list-helper 1.0.17
3
3
  * git://github.com/danielgindi/virtual-list-helper.git
4
4
  */
5
5
  "use strict";var t,e,r=require("@danielgindi/dom-utils/lib/Css.js"),n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={};function o(){if(e)return t;e=1;var r=function(t){return t&&t.Math===Math&&t};return t=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n&&n)||r("object"==typeof t&&t)||function(){return this}()||Function("return this")()}var u,s,a,c,l,f,h,d,p={};function m(){return s?u:(s=1,u=function(t){try{return!!t()}catch(t){return!0}})}function v(){if(c)return a;c=1;var t=m();return a=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function g(){if(f)return l;f=1;var t=m();return l=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function y(){if(d)return h;d=1;var t=g(),e=Function.prototype.call;return h=t?e.bind(e):function(){return e.apply(e,arguments)},h}var I,b,E,_,S,x,P,O,w,A,j,C,H,W,F,T,R,k,L,N,V,M,U,D,G,B,q,z,Y,$,X,J,K,Q,Z,tt,et,rt,nt,it,ot,ut={};function st(){return E?b:(E=1,b=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}})}function at(){if(S)return _;S=1;var t=g(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return _=t?n:function(t){return function(){return r.apply(t,arguments)}},_}function ct(){if(P)return x;P=1;var t=at(),e=t({}.toString),r=t("".slice);return x=function(t){return r(e(t),8,-1)}}function lt(){return j?A:(j=1,A=function(t){return null==t})}function ft(){if(H)return C;H=1;var t=lt(),e=TypeError;return C=function(r){if(t(r))throw new e("Can't call method on "+r);return r}}function ht(){if(F)return W;F=1;var t=function(){if(w)return O;w=1;var t=at(),e=m(),r=ct(),n=Object,i=t("".split);return O=e(function(){return!n("z").propertyIsEnumerable(0)})?function(t){return"String"===r(t)?i(t,""):n(t)}:n}(),e=ft();return W=function(r){return t(e(r))}}function dt(){if(R)return T;R=1;var t="object"==typeof document&&document.all;return T=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(t){return"function"==typeof t}}function pt(){if(L)return k;L=1;var t=dt();return k=function(e){return"object"==typeof e?null!==e:t(e)}}function mt(){if(V)return N;V=1;var t=o(),e=dt();return N=function(r,n){return arguments.length<2?(i=t[r],e(i)?i:void 0):t[r]&&t[r][n];var i},N}function vt(){if(U)return M;U=1;var t=at();return M=t({}.isPrototypeOf)}function gt(){if(Y)return z;Y=1;var t=function(){if(q)return B;q=1;var t,e,r=o(),n=function(){if(G)return D;G=1;var t=o().navigator,e=t&&t.userAgent;return D=e?String(e):""}(),i=r.process,u=r.Deno,s=i&&i.versions||u&&u.version,a=s&&s.v8;return a&&(e=(t=a.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!e&&n&&(!(t=n.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=n.match(/Chrome\/(\d+)/))&&(e=+t[1]),B=e}(),e=m(),r=o().String;return z=!!Object.getOwnPropertySymbols&&!e(function(){var e=Symbol("symbol detection");return!r(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function yt(){if(X)return $;X=1;var t=gt();return $=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function It(){if(K)return J;K=1;var t=mt(),e=dt(),r=vt(),n=yt(),i=Object;return J=n?function(t){return"symbol"==typeof t}:function(n){var o=t("Symbol");return e(o)&&r(o.prototype,i(n))}}function bt(){if(Z)return Q;Z=1;var t=String;return Q=function(e){try{return t(e)}catch(t){return"Object"}}}function Et(){if(et)return tt;et=1;var t=dt(),e=bt(),r=TypeError;return tt=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")}}function _t(){if(nt)return rt;nt=1;var t=Et(),e=lt();return rt=function(r,n){var i=r[n];return e(i)?void 0:t(i)}}function St(){if(ot)return it;ot=1;var t=y(),e=dt(),r=pt(),n=TypeError;return it=function(i,o){var u,s;if("string"===o&&e(u=i.toString)&&!r(s=t(u,i)))return s;if(e(u=i.valueOf)&&!r(s=t(u,i)))return s;if("string"!==o&&e(u=i.toString)&&!r(s=t(u,i)))return s;throw new n("Can't convert object to primitive value")}}var xt,Pt,Ot,wt,At,jt,Ct,Ht,Wt,Ft,Tt,Rt,kt,Lt,Nt,Vt,Mt,Ut,Dt,Gt,Bt,qt,zt,Yt,$t={exports:{}};function Xt(){return Pt?xt:(Pt=1,xt=!1)}function Jt(){if(wt)return Ot;wt=1;var t=o(),e=Object.defineProperty;return Ot=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch(e){t[r]=n}return n}}function Kt(){if(At)return $t.exports;At=1;var t=Xt(),e=o(),r=Jt(),n="__core-js_shared__",i=$t.exports=e[n]||r(n,{});return(i.versions||(i.versions=[])).push({version:"3.46.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"}),$t.exports}function Qt(){if(Ct)return jt;Ct=1;var t=Kt();return jt=function(e,r){return t[e]||(t[e]=r||{})}}function Zt(){if(Wt)return Ht;Wt=1;var t=ft(),e=Object;return Ht=function(r){return e(t(r))}}function te(){if(Tt)return Ft;Tt=1;var t=at(),e=Zt(),r=t({}.hasOwnProperty);return Ft=Object.hasOwn||function(t,n){return r(e(t),n)}}function ee(){if(kt)return Rt;kt=1;var t=at(),e=0,r=Math.random(),n=t(1.1.toString);return Rt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+n(++e+r,36)}}function re(){if(Nt)return Lt;Nt=1;var t=o(),e=Qt(),r=te(),n=ee(),i=gt(),u=yt(),s=t.Symbol,a=e("wks"),c=u?s.for||s:s&&s.withoutSetter||n;return Lt=function(t){return r(a,t)||(a[t]=i&&r(s,t)?s[t]:c("Symbol."+t)),a[t]}}function ne(){if(Mt)return Vt;Mt=1;var t=y(),e=pt(),r=It(),n=_t(),i=St(),o=re(),u=TypeError,s=o("toPrimitive");return Vt=function(o,a){if(!e(o)||r(o))return o;var c,l=n(o,s);if(l){if(void 0===a&&(a="default"),c=t(l,o,a),!e(c)||r(c))return c;throw new u("Can't convert object to primitive value")}return void 0===a&&(a="number"),i(o,a)}}function ie(){if(Dt)return Ut;Dt=1;var t=ne(),e=It();return Ut=function(r){var n=t(r,"string");return e(n)?n:n+""}}function oe(){if(Bt)return Gt;Bt=1;var t=o(),e=pt(),r=t.document,n=e(r)&&e(r.createElement);return Gt=function(t){return n?r.createElement(t):{}}}function ue(){if(zt)return qt;zt=1;var t=v(),e=m(),r=oe();return qt=!t&&!e(function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})}function se(){if(Yt)return p;Yt=1;var t=v(),e=y(),r=function(){if(I)return ut;I=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return ut.f=r?function(t){var r=e(this,t);return!!r&&r.enumerable}:t,ut}(),n=st(),i=ht(),o=ie(),u=te(),s=ue(),a=Object.getOwnPropertyDescriptor;return p.f=t?a:function(t,c){if(t=i(t),c=o(c),s)try{return a(t,c)}catch(t){}if(u(t,c))return n(!e(r.f,t,c),t[c])},p}$t.exports;var ae,ce,le,fe,he,de,pe,me={};function ve(){if(ce)return ae;ce=1;var t=v(),e=m();return ae=t&&e(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function ge(){if(fe)return le;fe=1;var t=pt(),e=String,r=TypeError;return le=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")}}function ye(){if(he)return me;he=1;var t=v(),e=ue(),r=ve(),n=ge(),i=ie(),o=TypeError,u=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a="enumerable",c="configurable",l="writable";return me.f=t?r?function(t,e,r){if(n(t),e=i(e),n(r),"function"==typeof t&&"prototype"===e&&"value"in r&&l in r&&!r[l]){var o=s(t,e);o&&o[l]&&(t[e]=r.value,r={configurable:c in r?r[c]:o[c],enumerable:a in r?r[a]:o[a],writable:!1})}return u(t,e,r)}:u:function(t,r,s){if(n(t),r=i(r),n(s),e)try{return u(t,r,s)}catch(t){}if("get"in s||"set"in s)throw new o("Accessors not supported");return"value"in s&&(t[r]=s.value),t},me}function Ie(){if(pe)return de;pe=1;var t=v(),e=ye(),r=st();return de=t?function(t,n,i){return e.f(t,n,r(1,i))}:function(t,e,r){return t[e]=r,t}}var be,Ee,_e,Se,xe,Pe,Oe,we,Ae,je,Ce,He,We,Fe,Te,Re={exports:{}};function ke(){if(Ee)return be;Ee=1;var t=v(),e=te(),r=Function.prototype,n=t&&Object.getOwnPropertyDescriptor,i=e(r,"name"),o=i&&"something"===function(){}.name,u=i&&(!t||t&&n(r,"name").configurable);return be={EXISTS:i,PROPER:o,CONFIGURABLE:u}}function Le(){if(Se)return _e;Se=1;var t=at(),e=dt(),r=Kt(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(t){return n(t)}),_e=r.inspectSource}function Ne(){if(we)return Oe;we=1;var t=Qt(),e=ee(),r=t("keys");return Oe=function(t){return r[t]||(r[t]=e(t))}}function Ve(){return je?Ae:(je=1,Ae={})}function Me(){if(He)return Ce;He=1;var t,e,r,n=function(){if(Pe)return xe;Pe=1;var t=o(),e=dt(),r=t.WeakMap;return xe=e(r)&&/native code/.test(String(r))}(),i=o(),u=pt(),s=Ie(),a=te(),c=Kt(),l=Ne(),f=Ve(),h="Object already initialized",d=i.TypeError,p=i.WeakMap;if(n||c.state){var m=c.state||(c.state=new p);m.get=m.get,m.has=m.has,m.set=m.set,t=function(t,e){if(m.has(t))throw new d(h);return e.facade=t,m.set(t,e),e},e=function(t){return m.get(t)||{}},r=function(t){return m.has(t)}}else{var v=l("state");f[v]=!0,t=function(t,e){if(a(t,v))throw new d(h);return e.facade=t,s(t,v,e),e},e=function(t){return a(t,v)?t[v]:{}},r=function(t){return a(t,v)}}return Ce={set:t,get:e,has:r,enforce:function(n){return r(n)?e(n):t(n,{})},getterFor:function(t){return function(r){var n;if(!u(r)||(n=e(r)).type!==t)throw new d("Incompatible receiver, "+t+" required");return n}}}}function Ue(){if(We)return Re.exports;We=1;var t=at(),e=m(),r=dt(),n=te(),i=v(),o=ke().CONFIGURABLE,u=Le(),s=Me(),a=s.enforce,c=s.get,l=String,f=Object.defineProperty,h=t("".slice),d=t("".replace),p=t([].join),g=i&&!e(function(){return 8!==f(function(){},"length",{value:8}).length}),y=String(String).split("String"),I=Re.exports=function(t,e,r){"Symbol("===h(l(e),0,7)&&(e="["+d(l(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!n(t,"name")||o&&t.name!==e)&&(i?f(t,"name",{value:e,configurable:!0}):t.name=e),g&&r&&n(r,"arity")&&t.length!==r.arity&&f(t,"length",{value:r.arity});try{r&&n(r,"constructor")&&r.constructor?i&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=a(t);return n(u,"source")||(u.source=p(y,"string"==typeof e?e:"")),t};return Function.prototype.toString=I(function(){return r(this)&&c(this).source||u(this)},"toString"),Re.exports}function De(){if(Te)return Fe;Te=1;var t=dt(),e=ye(),r=Ue(),n=Jt();return Fe=function(i,o,u,s){s||(s={});var a=s.enumerable,c=void 0!==s.name?s.name:o;if(t(u)&&r(u,c,s),s.global)a?i[o]=u:n(o,u);else{try{s.unsafe?i[o]&&(a=!0):delete i[o]}catch(t){}a?i[o]=u:e.f(i,o,{value:u,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return i}}Re.exports;var Ge,Be,qe,ze,Ye,$e,Xe,Je,Ke,Qe,Ze,tr,er,rr,nr,ir,or,ur={};function sr(){if(ze)return qe;ze=1;var t=function(){if(Be)return Ge;Be=1;var t=Math.ceil,e=Math.floor;return Ge=Math.trunc||function(r){var n=+r;return(n>0?e:t)(n)}}();return qe=function(e){var r=+e;return r!=r||0===r?0:t(r)}}function ar(){if($e)return Ye;$e=1;var t=sr(),e=Math.max,r=Math.min;return Ye=function(n,i){var o=t(n);return o<0?e(o+i,0):r(o,i)}}function cr(){if(Je)return Xe;Je=1;var t=sr(),e=Math.min;return Xe=function(r){var n=t(r);return n>0?e(n,9007199254740991):0}}function lr(){if(Qe)return Ke;Qe=1;var t=cr();return Ke=function(e){return t(e.length)}}function fr(){if(rr)return er;rr=1;var t=at(),e=te(),r=ht(),n=function(){if(tr)return Ze;tr=1;var t=ht(),e=ar(),r=lr(),n=function(n){return function(i,o,u){var s=t(i),a=r(s);if(0===a)return!n&&-1;var c,l=e(u,a);if(n&&o!=o){for(;a>l;)if((c=s[l++])!=c)return!0}else for(;a>l;l++)if((n||l in s)&&s[l]===o)return n||l||0;return!n&&-1}};return Ze={includes:n(!0),indexOf:n(!1)}}().indexOf,i=Ve(),o=t([].push);return er=function(t,u){var s,a=r(t),c=0,l=[];for(s in a)!e(i,s)&&e(a,s)&&o(l,s);for(;u.length>c;)e(a,s=u[c++])&&(~n(l,s)||o(l,s));return l}}function hr(){return ir?nr:(ir=1,nr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var dr,pr,mr,vr,gr,yr,Ir,br,Er,_r,Sr,xr,Pr,Or,wr,Ar,jr,Cr,Hr={};function Wr(){if(mr)return pr;mr=1;var t=mt(),e=at(),r=function(){if(or)return ur;or=1;var t=fr(),e=hr().concat("length","prototype");return ur.f=Object.getOwnPropertyNames||function(r){return t(r,e)},ur}(),n=(dr||(dr=1,Hr.f=Object.getOwnPropertySymbols),Hr),i=ge(),o=e([].concat);return pr=t("Reflect","ownKeys")||function(t){var e=r.f(i(t)),u=n.f;return u?o(e,u(t)):e}}function Fr(){if(gr)return vr;gr=1;var t=te(),e=Wr(),r=se(),n=ye();return vr=function(i,o,u){for(var s=e(o),a=n.f,c=r.f,l=0;l<s.length;l++){var f=s[l];t(i,f)||u&&t(u,f)||a(i,f,c(o,f))}}}function Tr(){if(Er)return br;Er=1;var t=o(),e=se().f,r=Ie(),n=De(),i=Jt(),u=Fr(),s=function(){if(Ir)return yr;Ir=1;var t=m(),e=dt(),r=/#|\.prototype\./,n=function(r,n){var a=o[i(r)];return a===s||a!==u&&(e(n)?t(n):!!n)},i=n.normalize=function(t){return String(t).replace(r,".").toLowerCase()},o=n.data={},u=n.NATIVE="N",s=n.POLYFILL="P";return yr=n}();return br=function(o,a){var c,l,f,h,d,p=o.target,m=o.global,v=o.stat;if(c=m?t:v?t[p]||i(p,{}):t[p]&&t[p].prototype)for(l in a){if(h=a[l],f=o.dontCallGetSet?(d=e(c,l))&&d.value:c[l],!s(m?l:p+(v?".":"#")+l,o.forced)&&void 0!==f){if(typeof h==typeof f)continue;u(h,f)}(o.sham||f&&f.sham)&&r(h,"sham",!0),n(c,l,h,o)}}}function Rr(){if(Pr)return xr;Pr=1;var t=function(){if(Sr)return _r;Sr=1;var t={};return t[re()("toStringTag")]="z",_r="[object z]"===String(t)}(),e=dt(),r=ct(),n=re()("toStringTag"),i=Object,o="Arguments"===r(function(){return arguments}());return xr=t?r:function(t){var u,s,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(s=function(t,e){try{return t[e]}catch(t){}}(u=i(t),n))?s:o?r(u):"Object"===(a=r(u))&&e(u.callee)?"Arguments":a}}function kr(){if(wr)return Or;wr=1;var t=Rr(),e=String;return Or=function(r){if("Symbol"===t(r))throw new TypeError("Cannot convert a Symbol value to a string");return e(r)}}function Lr(){if(jr)return Ar;jr=1;var t=Ue(),e=ye();return Ar=function(r,n,i){return i.get&&t(i.get,n,{getter:!0}),i.set&&t(i.set,n,{setter:!0}),e.f(r,n,i)}}!function(){if(Cr)return i;Cr=1;var t=Tr(),e=v(),r=o(),n=at(),u=te(),s=dt(),a=vt(),c=kr(),l=Lr(),f=Fr(),h=r.Symbol,d=h&&h.prototype;if(e&&s(h)&&(!("description"in d)||void 0!==h().description)){var p={},m=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:c(arguments[0]),e=a(d,this)?new h(t):void 0===t?h():h(t);return""===t&&(p[e]=!0),e};f(m,h),m.prototype=d,d.constructor=m;var g="Symbol(description detection)"===String(h("description detection")),y=n(d.valueOf),I=n(d.toString),b=/^Symbol\((.*)\)[^)]+$/,E=n("".replace),_=n("".slice);l(d,"description",{configurable:!0,get:function(){var t=y(this);if(u(p,t))return"";var e=I(t),r=g?_(e,7,-1):E(e,b,"$1");return""===r?void 0:r}}),t({global:!0,constructor:!0,forced:!0},{Symbol:m})}}();var Nr,Vr,Mr,Ur,Dr,Gr,Br,qr,zr,Yr,$r,Xr,Jr,Kr,Qr,Zr,tn,en,rn,nn,on,un,sn,an,cn,ln,fn,hn,dn,pn,mn,vn,gn,yn,In,bn,En,_n,Sn,xn,Pn={},On={};function wn(){if(Gr)return Dr;Gr=1;var t=fr(),e=hr();return Dr=Object.keys||function(r){return t(r,e)}}function An(){if(zr)return qr;zr=1;var t=mt();return qr=t("document","documentElement")}function jn(){if($r)return Yr;$r=1;var t,e=ge(),r=function(){if(Br)return On;Br=1;var t=v(),e=ve(),r=ye(),n=ge(),i=ht(),o=wn();return On.f=t&&!e?Object.defineProperties:function(t,e){n(t);for(var u,s=i(e),a=o(e),c=a.length,l=0;c>l;)r.f(t,u=a[l++],s[u]);return t},On}(),n=hr(),i=Ve(),o=An(),u=oe(),s=Ne(),a="prototype",c="script",l=s("IE_PROTO"),f=function(){},h=function(t){return"<"+c+">"+t+"</"+c+">"},d=function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var e,r,i;p="undefined"!=typeof document?document.domain&&t?d(t):(r=u("iframe"),i="java"+c+":",r.style.display="none",o.appendChild(r),r.src=String(i),(e=r.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F):d(t);for(var s=n.length;s--;)delete p[a][n[s]];return p()};return i[l]=!0,Yr=Object.create||function(t,n){var i;return null!==t?(f[a]=e(t),i=new f,f[a]=null,i[l]=t):i=p(),void 0===n?i:r.f(i,n)}}function Cn(){if(Jr)return Xr;Jr=1;var t=re(),e=jn(),r=ye().f,n=t("unscopables"),i=Array.prototype;return void 0===i[n]&&r(i,n,{configurable:!0,value:e(null)}),Xr=function(t){i[n][t]=!0}}function Hn(){return Qr?Kr:(Qr=1,Kr={})}function Wn(){if(rn)return en;rn=1;var t=te(),e=dt(),r=Zt(),n=Ne(),i=function(){if(tn)return Zr;tn=1;var t=m();return Zr=!t(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})}(),o=n("IE_PROTO"),u=Object,s=u.prototype;return en=i?u.getPrototypeOf:function(n){var i=r(n);if(t(i,o))return i[o];var a=i.constructor;return e(a)&&i instanceof a?a.prototype:i instanceof u?s:null}}function Fn(){if(on)return nn;on=1;var t,e,r,n=m(),i=dt(),o=pt(),u=jn(),s=Wn(),a=De(),c=re(),l=Xt(),f=c("iterator"),h=!1;return[].keys&&("next"in(r=[].keys())?(e=s(s(r)))!==Object.prototype&&(t=e):h=!0),!o(t)||n(function(){var e={};return t[f].call(e)!==e})?t={}:l&&(t=u(t)),i(t[f])||a(t,f,function(){return this}),nn={IteratorPrototype:t,BUGGY_SAFARI_ITERATORS:h}}function Tn(){if(sn)return un;sn=1;var t=ye().f,e=te(),r=re()("toStringTag");return un=function(n,i,o){n&&!o&&(n=n.prototype),n&&!e(n,r)&&t(n,r,{configurable:!0,value:i})}}function Rn(){if(dn)return hn;dn=1;var t=pt();return hn=function(e){return t(e)||null===e}}function kn(){if(mn)return pn;mn=1;var t=Rn(),e=String,r=TypeError;return pn=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")}}function Ln(){if(In)return yn;In=1;var t=Tr(),e=y(),r=Xt(),n=ke(),i=dt(),o=function(){if(cn)return an;cn=1;var t=Fn().IteratorPrototype,e=jn(),r=st(),n=Tn(),i=Hn(),o=function(){return this};return an=function(u,s,a,c){var l=s+" Iterator";return u.prototype=e(t,{next:r(+!c,a)}),n(u,l,!1,!0),i[l]=o,u}}(),u=Wn(),s=function(){if(gn)return vn;gn=1;var t=function(){if(fn)return ln;fn=1;var t=at(),e=Et();return ln=function(r,n,i){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[i]))}catch(t){}}}(),e=pt(),r=ft(),n=kn();return vn=Object.setPrototypeOf||("__proto__"in{}?function(){var i,o=!1,u={};try{(i=t(Object.prototype,"__proto__","set"))(u,[]),o=u instanceof Array}catch(t){}return function(t,u){return r(t),n(u),e(t)?(o?i(t,u):t.__proto__=u,t):t}}():void 0)}(),a=Tn(),c=Ie(),l=De(),f=re(),h=Hn(),d=Fn(),p=n.PROPER,m=n.CONFIGURABLE,v=d.IteratorPrototype,g=d.BUGGY_SAFARI_ITERATORS,I=f("iterator"),b="keys",E="values",_="entries",S=function(){return this};return yn=function(n,f,d,y,x,P,O){o(d,f,y);var w,A,j,C=function(t){if(t===x&&R)return R;if(!g&&t&&t in F)return F[t];switch(t){case b:case E:case _:return function(){return new d(this,t)}}return function(){return new d(this)}},H=f+" Iterator",W=!1,F=n.prototype,T=F[I]||F["@@iterator"]||x&&F[x],R=!g&&T||C(x),k="Array"===f&&F.entries||T;if(k&&(w=u(k.call(new n)))!==Object.prototype&&w.next&&(r||u(w)===v||(s?s(w,v):i(w[I])||l(w,I,S)),a(w,H,!0,!0),r&&(h[H]=S)),p&&x===E&&T&&T.name!==E&&(!r&&m?c(F,"name",E):(W=!0,R=function(){return e(T,this)})),x)if(A={values:C(E),keys:P?R:C(b),entries:C(_)},O)for(j in A)(g||W||!(j in F))&&l(F,j,A[j]);else t({target:f,proto:!0,forced:g||W},A);return r&&!O||F[I]===R||l(F,I,R,{name:x}),h[f]=R,A}}function Nn(){return En?bn:(En=1,bn=function(t,e){return{value:t,done:e}})}!function(){if(xn)return Pn;xn=1;var t=o(),e=Vr?Nr:(Vr=1,Nr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}),r=function(){if(Ur)return Mr;Ur=1;var t=oe()("span").classList,e=t&&t.constructor&&t.constructor.prototype;return Mr=e===Object.prototype?void 0:e}(),n=function(){if(Sn)return _n;Sn=1;var t=ht(),e=Cn(),r=Hn(),n=Me(),i=ye().f,o=Ln(),u=Nn(),s=Xt(),a=v(),c="Array Iterator",l=n.set,f=n.getterFor(c);_n=o(Array,"Array",function(e,r){l(this,{type:c,target:t(e),index:0,kind:r})},function(){var t=f(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,u(void 0,!0);switch(t.kind){case"keys":return u(r,!1);case"values":return u(e[r],!1)}return u([r,e[r]],!1)},"values");var h=r.Arguments=r.Array;if(e("keys"),e("values"),e("entries"),!s&&a&&"values"!==h.name)try{i(h,"name",{value:"values"})}catch(t){}return _n}(),i=Ie(),u=Tn(),s=re()("iterator"),a=n.values,c=function(t,r){if(t){if(t[s]!==a)try{i(t,s,a)}catch(e){t[s]=a}if(u(t,r,!0),e[r])for(var o in n)if(t[o]!==n[o])try{i(t,o,n[o])}catch(e){t[o]=n[o]}}};for(var l in e)c(t[l]&&t[l].prototype,l);c(r,"DOMTokenList")}();const Vn=Object.prototype.hasOwnProperty,Mn=void 0!==Element.prototype.insertAdjacentElement;function Un(t,e,r){e?!1===Mn||t instanceof DocumentFragment?r.insertBefore(t,e):e.insertAdjacentElement("beforebegin",t):r.appendChild(t)}function Dn(t,e,r,n){return t.parentNode!==n?(e||(e=document.createDocumentFragment()),e.appendChild(t)):(e&&e.childNodes.length>0&&(Un(e,r,n),e=null),t.nextSibling!==r&&Un(t,r,n)),e}const Gn=Symbol("index"),Bn=Symbol("reuse"),qn=()=>document.createElement("li"),zn=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,i=t.length;if(n<0&&(n+=i),n<=r)return n;for(;r<=n;){let o=Math.floor(r+(n-r)/2),u=t[o];if(u===e||u<=e&&o<i&&t[o+1]>e){for(;o>0&&t[o-1]===u;)o--;return o}u<e?r=o+1:n=o-1}return-1===n?0:i-1},Yn=function(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;if(i<0&&(i+=t),i<=n)return i;for(;n<=i;){let o=Math.floor(n+(i-n)/2),u=e(o);if(u===r||u<=r&&o<t&&e(o+1)>r){for(;o>0&&e(o-1)===u;)o--;return o}u<r?n=o+1:i=o-1}return-1===i?0:e(t-1)};let $n=null;module.exports=class{constructor(t){var e;const r=this._p={list:t.list||null,hookScrollEvent:void 0===t.hookScrollEvent||!!t.hookScrollEvent,count:t.count||0,virtual:void 0===t.virtual||!!t.virtual,userItemsParent:t.itemsParent||null,setVirtualWrapperWidth:null===(e=t.autoVirtualWrapperWidth)||void 0===e||e,estimatedItemHeight:20,buffer:5,itemHeightEstimatorFn:null,itemElementCreatorFn:qn,onItemRender:null,onItemUnrender:null,onScrollHeightChange:null,virtualWrapper:null,currentItemsParent:null,cachedItemHeights:[],cachedItemEstimatedHeights:[],cachedItemPositions:[],itemPositionsNeedsUpdate:0,boundRender:this.render.bind(this),existingEls:[]};r.currentItemsParent=r.userItemsParent||r.list,this._hookEvents(),"number"==typeof t.count&&this.setCount(t.count),"boolean"==typeof t.virtual&&this.setVirtual(t.virtual),"number"==typeof t.estimatedItemHeight&&this.setEstimatedItemHeight(t.estimatedItemHeight),"number"==typeof t.buffer&&this.setBuffer(t.buffer),"function"==typeof t.itemHeightEstimatorFn&&this.setItemHeightEstimatorFn(t.itemHeightEstimatorFn),"function"==typeof t.itemElementCreatorFn&&this.setItemElementCreatorFn(t.itemElementCreatorFn),"function"==typeof t.onItemRender&&this.setOnItemRender(t.onItemRender),"function"==typeof t.onItemUnrender&&this.setOnItemUnrender(t.onItemUnrender),"function"==typeof t.onScrollHeightChange&&this.setOnScrollHeightChange(t.onScrollHeightChange)}destroy(){this._unhookEvents().invalidate()._destroyElements()}setHookScrollEvent(t){const e=this._p;return t=void 0===t||!!t,e.hookScrollEvent===t||(e.hookScrollEvent=t,this._unhookEvents()._hookEvents()),this}isHookScrollEventEnabled(){return this._p.hookScrollEvent}setCount(t){return this._p.count=t,this.invalidate()}getCount(){return this._p.count}setVirtual(t){const e=this._p;return t=void 0===t||!!t,e.virtual===t||(e.virtual=t,this._hookEvents().invalidate()._destroyElements()),this}isVirtual(){return this._p.virtual}setEstimatedItemHeight(t){return this._p.estimatedItemHeight=Math.abs(("number"==typeof t?t:Number(t))||20),this}getEstimatedItemHeight(){return this._p.estimatedItemHeight}setAutoVirtualWrapperWidth(t){const e=this._p;return e.autoVirtualWrapperWidth=void 0===t||!!t,e.virtualWrapper&&e.autoVirtualWrapperWidth!==e.virtualWrapperWidthWasSet&&(e.virtualWrapper.style.width=e.autoVirtualWrapperWidth?"100%":"",e.virtualWrapperWidthWasSet=e.autoVirtualWrapperWidth),this}isAutoVirtualWrapperWidth(){return this._p.autoVirtualWrapperWidth}setBuffer(t){return this._p.buffer=Math.abs("number"==typeof t?t:Number(t)||5),this}getBuffer(){return this._p.buffer}setItemHeightEstimatorFn(t){return this._p.itemHeightEstimatorFn=t,this}setItemElementCreatorFn(t){return this._p.itemElementCreatorFn=t||qn,this}setOnItemRender(t){return this._p.onItemRender=t,this}setOnItemUnrender(t){return this._p.onItemUnrender=t,this}setOnScrollHeightChange(t){return this._p.onScrollHeightChange=t,this}estimateFullHeight(){const t=this._p;if(0===t.count)return 0;if(t.virtual)return this._calculateItemPosition(t.count)||0;{const e=t.existingEls;if(t.count===e.length){let t=e[0].getBoundingClientRect(),r=e[e.length-1].getBoundingClientRect();return r.top-t.top+r.height}return this._calculateItemPosition(t.count)||0}}invalidatePositions(){const t=this._p;return t.itemPositionsNeedsUpdate=0,t.cachedItemHeights=[],t.cachedItemEstimatedHeights=[],t.cachedItemPositions=[],t.cachedItemHeights.length=t.count,t.cachedItemEstimatedHeights.length=t.count,t.cachedItemPositions.length=t.count,this}invalidate(){const t=this._p;this.invalidatePositions(),t.virtual||this._destroyElements();for(let e of t.existingEls)delete e[Gn];return this}render(){const t=this._p,e=t.list,r=t.virtual;let n=t.virtualWrapper,i=t.currentItemsParent,o=e.scrollTop,u=o+e.clientHeight,s=t.count,a=t.buffer,c=t.onItemUnrender,l=t.existingEls,f=l.length;if(r){const r=e.clientWidth;n||(n=t.virtualWrapper=t.userItemsParent,n||(n=t.virtualWrapper=document.createElement("div"),e.appendChild(n)),this._resetCurrentItemsParent(),i=t.currentItemsParent,t.autoVirtualWrapperWidth?(n.style.width="100%",t.virtualWrapperWidthWasSet=!0):t.virtualWrapperWidthWasSet=!1);for(let t=0;t<f;t++)l[t][Bn]=!0;this._calculateItemPosition(t.count-1);let c=this._getExistingElsRange(),d=zn(t.cachedItemPositions,o),p=Math.max(0,d-a),m=p,v=this._calculateItemPosition(m),g=a,y=Math.max(m,zn(t.cachedItemPositions,u-1)+1+a),I=[],b=null,E=n.childNodes[0];const _=function(t){let e;return-1!==c.firstIndex&&t>=c.firstIndex&&t<=c.lastIndex&&(e=l.find(e=>e[Gn]===t&&!0===e[Bn])),void 0===e&&(e=(c.firstIndex<p||c.firstValidArrayIndex>0?l.find(t=>(t[Gn]<p||!1===Vn.call(t,Gn))&&!0===t[Bn]):void 0)||((t,e)=>{for(let r=t.length-1;r>=0;r--)if(e(t[r]))return t[r]})(l,t=>!0===t[Bn])),void 0!==e&&delete e[Bn],e};for(;m<s&&m<y;m++){let t=_(m);E&&E===t&&(E=E.nextSibling);const e=this._dequeueElementForIndex(t,m,E,!0);I.push([e,m]),b=Dn(e,b,E,i)}b&&b.childNodes.length>0&&Un(b,E,i);for(let e of I){const r=e[1];this._insertItemAndFlow(e[0],r,!1),v=t.cachedItemPositions[r]+t.cachedItemHeights[r]}if(v<u)for(;(v<u||g-- >0)&&m<s;m++){let e=_(m);E&&E===e&&(E=E.nextSibling),this._dequeueElementForIndex(e,m,E,!1),v=t.cachedItemPositions[m]+t.cachedItemHeights[m]}let S=this.estimateFullHeight(),x=S+"px";var h;n.style.height!==x&&(t.virtualWrapper.style.height=x,null===(h=t.onScrollHeightChange)||void 0===h||h.call(t,S)),r!==e.clientWidth&&this.render()}else if(s!==l.length){for(let t=0;t<f;t++)l[t][Bn]=!0;let t=i.childNodes[0],e=null;for(let r=0;r<s;r++){let n=l.find(t=>t[Gn]===r&&!0===t[Bn]);void 0!==n&&delete n[Bn],t&&t===n&&(t=t.nextSibling),e=Dn(this._dequeueElementForIndex(n,r,t,!0),e,t,i)}e&&e.childNodes.length>0&&Un(e,t,i)}f=l.length;for(let t=0;t<f;t++){const e=l[t];if(!0!==e[Bn])continue;let r=e.parentNode;r&&r.removeChild(e),c&&void 0!==e[Gn]&&c(e),l.splice(t,1),t--,f--}}addItemsAt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if("number"!=typeof t||t<=0)return this;const r=this._p;if((e<0||e>=r.count)&&(e=r.count),r.count+=t,r.virtual)e>=0&&e<r.count&&this._invalidateItemIndexesAt(e,-1);else{let n=r.existingEls;if(n.length!==r.count-t)return this;let i=this._getExistingElsRange();if(-1===i.firstValidArrayIndex)return this;const o=r.currentItemsParent;let u=i.firstValidArrayIndex+e-i.firstIndex;this._pushItemIndexesAt(e,t);let s=n[u-1]?n[u-1].nextSibling:n[0],a=null;for(let r=e,n=e+t;r<n;r++)a=Dn(this._dequeueElementForIndex(void 0,r,s,!0),a,s,o);a&&a.childNodes.length>0&&Un(a,s,o)}return this}removeItemsAt(t,e){const r=this._p;if("number"!=typeof t||"number"!=typeof e||t<=0||e<0||e>=r.count)return this;if(r.count-=Math.min(t,r.count-e),r.virtual)this._invalidateItemIndexesAt(e,-1);else{let n=r.existingEls;if(n.length!==r.count+t)return this;let i=this._getExistingElsRange();if(-1===i.firstValidArrayIndex)return this;this._pushItemIndexesAt(e+t,-t);const o=r.onItemUnrender;let u=i.firstValidArrayIndex+e-i.firstIndex;if(u<n.length){for(let e=0;e<t;e++){let t=n[u+e],r=t.parentNode;r&&r.removeChild(t),o&&void 0!==t[Gn]&&o(t)}n.splice(u,t)}}return this}refreshItemAt(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return this;if(e.virtual)this._invalidateItemIndexesAt(t,1);else{let r=e.existingEls;if(r.length!==e.count)return this;let n=this._getExistingElsRange();if(t>=n.firstIndex&&t<=n.lastIndex){let e=r[n.firstValidArrayIndex+t-n.firstIndex];delete e[Gn],this._dequeueElementForIndex(e,t,e.nextSibling,!1)}}return this}isItemRendered(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return!1;let r=this._getExistingElsRange();return t>=r.firstIndex&&t<=r.lastIndex}getItemElementAt(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return;let r=e.existingEls,n=this._getExistingElsRange();return t>=n.firstIndex&&t<=n.lastIndex?r[n.firstValidArrayIndex+t-n.firstIndex]:void 0}getItemPosition(t){const e=this._p;if(!("number"!=typeof t||t<0||t>=e.count)){if(e.virtual)return this._calculateItemPosition(t);{let n=this.getItemElementAt(t);if(void 0===n)return;const i=e.list;return r.getElementOffset(n).top-r.getElementOffset(i).top+i.scrollTop}}}getItemIndexFromElement(t){return t?t[Gn]:void 0}getItemSize(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return;let r=e.cachedItemHeights[t-1];return void 0===r&&(r=e.itemHeightEstimatorFn?e.itemHeightEstimatorFn(t-1):null,"number"!=typeof r&&(r=e.estimatedItemHeight),e.cachedItemEstimatedHeights[t-1]=r),r}getVisibleItemCount(){const t=this._p,e=t.list;let r,n,i=e.scrollTop,o=e.clientHeight;if(t.virtual)r=zn(t.cachedItemPositions,i),n=zn(t.cachedItemPositions,i+o,r);else{const e=t=>{let e=this.getItemPosition(t);return void 0===e&&(e=1/0),e};r=Yn(t.count,e,i),n=Yn(t.count,e,i+o,r)}return this.getItemPosition(n)===i+o&&n--,n-r+1}createGhostItemElement(t,e,r){const n=this._p;let i=this._dequeueElementForIndex(null,t,!1,!0);try{e&&n.currentItemsParent.appendChild(i),r(i)}finally{if(e){let t=i.parentNode;t&&t.removeChild(i)}n.onItemUnrender&&n.onItemUnrender(i)}}_resetCurrentItemsParent(){var t,e;const r=this._p;r.currentItemsParent=null!==(t=null!==(e=r.virtualWrapper)&&void 0!==e?e:r.userItemsParent)&&void 0!==t?t:r.list}_destroyElements(){const t=this._p,e=t.onItemUnrender,r=t.existingEls;for(let t=0;t<r.length;t++){const n=r[t];let i=n.parentNode;i&&i.removeChild(n),e&&void 0!==n[Gn]&&e(n)}return r.length=0,t.virtualWrapper&&(t.virtualWrapper!==t.userItemsParent&&t.virtualWrapper.parentNode&&t.virtualWrapper.parentNode.removeChild(t.virtualWrapper),t.virtualWrapper=null,this._resetCurrentItemsParent()),this}_invalidateItemIndexesAt(t,e){const r=this._p;this._setItemPositionsNeedsUpdate(t);let n=r.existingEls,i=n.length,o=this._getExistingElsRange();if(-1!==o.firstValidArrayIndex&&(-1===e&&(e=n.length),t>=o.firstIndex&&t<=o.lastIndex))for(let r=o.firstValidArrayIndex+t-o.firstIndex,u=0;r<i&&u<e;r++,u++)delete n[r][Gn]}_pushItemIndexesAt(t,e){let r=this._p.existingEls,n=r.length,i=this._getExistingElsRange();if(-1!==i.firstValidArrayIndex&&t>=i.firstIndex&&t<=i.lastIndex)for(let o=i.firstValidArrayIndex+t-i.firstIndex;o<n;o++)r[o][Gn]+=e}_hookEvents(){const t=this._p;return this._unhookEvents(),t.virtual&&t.hookScrollEvent&&t.list&&t.list.addEventListener("scroll",t.boundRender),this}_unhookEvents(){const t=this._p;return t.list&&t.list.removeEventListener("scroll",t.boundRender),this}_setItemPositionsNeedsUpdate(t){const e=this._p;t<e.itemPositionsNeedsUpdate&&(e.itemPositionsNeedsUpdate=t)}_calculateItemPosition(t){const e=this._p,r=e.cachedItemPositions;if(t>=e.itemPositionsNeedsUpdate){const n=e.count,i=e.cachedItemHeights,o=e.cachedItemEstimatedHeights,u=e.estimatedItemHeight,s=e.itemHeightEstimatorFn;i.length!==n&&(i.length=n,o.length=n,r.length=n);let a=e.itemPositionsNeedsUpdate,c=Math.min(t,n),l=0;a>0&&(l=r[a-1]);for(let t=a;t<=c;t++){if(0===t){r[t]=l;continue}const e=t-1;let n=i[e];void 0===n&&(n=s?s(e):null,"number"!=typeof n&&(n=u),o[e]=n),l+=n,r[t]=l}e.itemPositionsNeedsUpdate=c+1}if(t>0&&t===e.count){let n=e.cachedItemHeights[t-1];return void 0===n&&(n=e.itemHeightEstimatorFn?e.itemHeightEstimatorFn(t-1):null,"number"!=typeof n&&(n=e.estimatedItemHeight),e.cachedItemEstimatedHeights[t-1]=n),r[t-1]+n}return r[t]}_dequeueElementForIndex(t,e,r,n){const i=this._p,o=i.virtualWrapper,u=(i.currentItemsParent,i.existingEls),s=i.onItemRender,a=i.onItemUnrender,c=!t,l=c||e!==t[Gn];if(t?a&&l&&a(t):(t=i.itemElementCreatorFn(),o&&!1!==r&&(t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.right="0")),l&&(t.innerHTML="",s&&s(t,e)),!1!==r){if(r instanceof Node||(r=null),!c){let e=u.indexOf(t);-1!==e&&u.splice(e,1)}let i=r?u.indexOf(r):-1;-1===i?u.push(t):u.splice(i,0,t),n||this._insertItemAndFlow(t,e,r)}return t[Gn]=e,t}_insertItemAndFlow(t,e,r){const n=this._p,i=n.virtualWrapper,o=n.currentItemsParent;if(!1!==r&&(r instanceof Node||(r=null),t.parentNode===o&&t.nextSibling===r||Un(t,r,o)),i){let r=t.getBoundingClientRect().height,i=n.cachedItemHeights[e];i!==r&&(n.cachedItemHeights[e]=r),(void 0!==i&&r!==i||void 0===i&&r!==n.cachedItemEstimatedHeights[e])&&this._setItemPositionsNeedsUpdate(e+1);let o=this._calculateItemPosition(e);const u=(()=>{if(null===$n){let t=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],e=document.createElement("div");$n=!1;for(let r of t)if(e&&void 0!==e.style[r]){$n=r;break}}return $n})();!1===u?t.style.top="".concat(o,"px"):t.style[u]="translateY(".concat(o,"px)")}}_getExistingElsRange(){const t=this._p.existingEls;let e=-1,r=-1;for(let r=0,n=t.length;r<n;r++)if(!1!==Vn.call(t[r],Gn)){e=r;break}for(let e=t.length-1;e>=0;e--)if(!1!==Vn.call(t[e],Gn)){r=e;break}return{firstValidArrayIndex:e,lastValidArrayIndex:r,firstIndex:-1!==e?t[e][Gn]:-1,lastIndex:-1!==r?t[r][Gn]:-1}}};
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/virtual-list-helper 1.0.16
2
+ * @danielgindi/virtual-list-helper 1.0.17
3
3
  * git://github.com/danielgindi/virtual-list-helper.git
4
4
  */
5
5
  import { getElementOffset } from '@danielgindi/dom-utils/lib/Css.js';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/virtual-list-helper 1.0.16
2
+ * @danielgindi/virtual-list-helper 1.0.17
3
3
  * git://github.com/danielgindi/virtual-list-helper.git
4
4
  */
5
5
  import{getElementOffset as t}from"@danielgindi/dom-utils/lib/Css.js";const e=Object.prototype.hasOwnProperty,i=void 0!==Element.prototype.insertAdjacentElement;function n(t,e,n){e?!1===i||t instanceof DocumentFragment?n.insertBefore(t,e):e.insertAdjacentElement("beforebegin",t):n.appendChild(t)}function r(t,e,i,r){return t.parentNode!==r?(e||(e=document.createDocumentFragment()),e.appendChild(t)):(e&&e.childNodes.length>0&&(n(e,i,r),e=null),t.nextSibling!==i&&n(t,i,r)),e}class s{constructor(t){const e=this._p={list:t.list||null,hookScrollEvent:void 0===t.hookScrollEvent||!!t.hookScrollEvent,count:t.count||0,virtual:void 0===t.virtual||!!t.virtual,userItemsParent:t.itemsParent||null,setVirtualWrapperWidth:t.autoVirtualWrapperWidth??!0,estimatedItemHeight:20,buffer:5,itemHeightEstimatorFn:null,itemElementCreatorFn:a,onItemRender:null,onItemUnrender:null,onScrollHeightChange:null,virtualWrapper:null,currentItemsParent:null,cachedItemHeights:[],cachedItemEstimatedHeights:[],cachedItemPositions:[],itemPositionsNeedsUpdate:0,boundRender:this.render.bind(this),existingEls:[]};e.currentItemsParent=e.userItemsParent||e.list,this._hookEvents(),"number"==typeof t.count&&this.setCount(t.count),"boolean"==typeof t.virtual&&this.setVirtual(t.virtual),"number"==typeof t.estimatedItemHeight&&this.setEstimatedItemHeight(t.estimatedItemHeight),"number"==typeof t.buffer&&this.setBuffer(t.buffer),"function"==typeof t.itemHeightEstimatorFn&&this.setItemHeightEstimatorFn(t.itemHeightEstimatorFn),"function"==typeof t.itemElementCreatorFn&&this.setItemElementCreatorFn(t.itemElementCreatorFn),"function"==typeof t.onItemRender&&this.setOnItemRender(t.onItemRender),"function"==typeof t.onItemUnrender&&this.setOnItemUnrender(t.onItemUnrender),"function"==typeof t.onScrollHeightChange&&this.setOnScrollHeightChange(t.onScrollHeightChange)}destroy(){this._unhookEvents().invalidate()._destroyElements()}setHookScrollEvent(t){const e=this._p;return t=void 0===t||!!t,e.hookScrollEvent===t||(e.hookScrollEvent=t,this._unhookEvents()._hookEvents()),this}isHookScrollEventEnabled(){return this._p.hookScrollEvent}setCount(t){return this._p.count=t,this.invalidate()}getCount(){return this._p.count}setVirtual(t){const e=this._p;return t=void 0===t||!!t,e.virtual===t||(e.virtual=t,this._hookEvents().invalidate()._destroyElements()),this}isVirtual(){return this._p.virtual}setEstimatedItemHeight(t){return this._p.estimatedItemHeight=Math.abs(("number"==typeof t?t:Number(t))||20),this}getEstimatedItemHeight(){return this._p.estimatedItemHeight}setAutoVirtualWrapperWidth(t){const e=this._p;return e.autoVirtualWrapperWidth=void 0===t||!!t,e.virtualWrapper&&e.autoVirtualWrapperWidth!==e.virtualWrapperWidthWasSet&&(e.virtualWrapper.style.width=e.autoVirtualWrapperWidth?"100%":"",e.virtualWrapperWidthWasSet=e.autoVirtualWrapperWidth),this}isAutoVirtualWrapperWidth(){return this._p.autoVirtualWrapperWidth}setBuffer(t){return this._p.buffer=Math.abs("number"==typeof t?t:Number(t)||5),this}getBuffer(){return this._p.buffer}setItemHeightEstimatorFn(t){return this._p.itemHeightEstimatorFn=t,this}setItemElementCreatorFn(t){return this._p.itemElementCreatorFn=t||a,this}setOnItemRender(t){return this._p.onItemRender=t,this}setOnItemUnrender(t){return this._p.onItemUnrender=t,this}setOnScrollHeightChange(t){return this._p.onScrollHeightChange=t,this}estimateFullHeight(){const t=this._p;if(0===t.count)return 0;if(t.virtual)return this._calculateItemPosition(t.count)||0;{const e=t.existingEls;if(t.count===e.length){let t=e[0].getBoundingClientRect(),i=e[e.length-1].getBoundingClientRect();return i.top-t.top+i.height}return this._calculateItemPosition(t.count)||0}}invalidatePositions(){const t=this._p;return t.itemPositionsNeedsUpdate=0,t.cachedItemHeights=[],t.cachedItemEstimatedHeights=[],t.cachedItemPositions=[],t.cachedItemHeights.length=t.count,t.cachedItemEstimatedHeights.length=t.count,t.cachedItemPositions.length=t.count,this}invalidate(){const t=this._p;this.invalidatePositions(),t.virtual||this._destroyElements();for(let e of t.existingEls)delete e[o];return this}render(){const t=this._p,i=t.list,s=t.virtual;let a=t.virtualWrapper,d=t.currentItemsParent,m=i.scrollTop,c=m+i.clientHeight,p=t.count,f=t.buffer,I=t.onItemUnrender,g=t.existingEls,E=g.length;if(s){const s=i.clientWidth;a||(a=t.virtualWrapper=t.userItemsParent,a||(a=t.virtualWrapper=document.createElement("div"),i.appendChild(a)),this._resetCurrentItemsParent(),d=t.currentItemsParent,t.autoVirtualWrapperWidth?(a.style.width="100%",t.virtualWrapperWidthWasSet=!0):t.virtualWrapperWidthWasSet=!1);for(let t=0;t<E;t++)g[t][l]=!0;this._calculateItemPosition(t.count-1);let I=this._getExistingElsRange(),v=h(t.cachedItemPositions,m),_=Math.max(0,v-f),x=_,y=this._calculateItemPosition(x),H=f,b=Math.max(x,h(t.cachedItemPositions,c-1)+1+f),P=[],W=null,C=a.childNodes[0];const F=function(t){let i;return-1!==I.firstIndex&&t>=I.firstIndex&&t<=I.lastIndex&&(i=g.find(e=>e[o]===t&&!0===e[l])),void 0===i&&(i=(I.firstIndex<_||I.firstValidArrayIndex>0?g.find(t=>(t[o]<_||!1===e.call(t,o))&&!0===t[l]):void 0)||u(g,t=>!0===t[l])),void 0!==i&&delete i[l],i};for(;x<p&&x<b;x++){let t=F(x);C&&C===t&&(C=C.nextSibling);const e=this._dequeueElementForIndex(t,x,C,!0);P.push([e,x]),W=r(e,W,C,d)}W&&W.childNodes.length>0&&n(W,C,d);for(let e of P){const i=e[1];this._insertItemAndFlow(e[0],i,!1),y=t.cachedItemPositions[i]+t.cachedItemHeights[i]}if(y<c)for(;(y<c||H-- >0)&&x<p;x++){let e=F(x);C&&C===e&&(C=C.nextSibling),this._dequeueElementForIndex(e,x,C,!1),y=t.cachedItemPositions[x]+t.cachedItemHeights[x]}let A=this.estimateFullHeight(),S=A+"px";a.style.height!==S&&(t.virtualWrapper.style.height=S,t.onScrollHeightChange?.(A)),s!==i.clientWidth&&this.render()}else if(p!==g.length){for(let t=0;t<E;t++)g[t][l]=!0;let t=d.childNodes[0],e=null;for(let i=0;i<p;i++){let n=g.find(t=>t[o]===i&&!0===t[l]);void 0!==n&&delete n[l],t&&t===n&&(t=t.nextSibling),e=r(this._dequeueElementForIndex(n,i,t,!0),e,t,d)}e&&e.childNodes.length>0&&n(e,t,d)}E=g.length;for(let t=0;t<E;t++){const e=g[t];if(!0!==e[l])continue;let i=e.parentNode;i&&i.removeChild(e),I&&void 0!==e[o]&&I(e),g.splice(t,1),t--,E--}}addItemsAt(t,e=-1){if("number"!=typeof t||t<=0)return this;const i=this._p;if((e<0||e>=i.count)&&(e=i.count),i.count+=t,i.virtual)e>=0&&e<i.count&&this._invalidateItemIndexesAt(e,-1);else{let s=i.existingEls;if(s.length!==i.count-t)return this;let o=this._getExistingElsRange();if(-1===o.firstValidArrayIndex)return this;const l=i.currentItemsParent;let a=o.firstValidArrayIndex+e-o.firstIndex;this._pushItemIndexesAt(e,t);let h=s[a-1]?s[a-1].nextSibling:s[0],d=null;for(let i=e,n=e+t;i<n;i++)d=r(this._dequeueElementForIndex(void 0,i,h,!0),d,h,l);d&&d.childNodes.length>0&&n(d,h,l)}return this}removeItemsAt(t,e){const i=this._p;if("number"!=typeof t||"number"!=typeof e||t<=0||e<0||e>=i.count)return this;if(i.count-=Math.min(t,i.count-e),i.virtual)this._invalidateItemIndexesAt(e,-1);else{let n=i.existingEls;if(n.length!==i.count+t)return this;let r=this._getExistingElsRange();if(-1===r.firstValidArrayIndex)return this;this._pushItemIndexesAt(e+t,-t);const s=i.onItemUnrender;let l=r.firstValidArrayIndex+e-r.firstIndex;if(l<n.length){for(let e=0;e<t;e++){let t=n[l+e],i=t.parentNode;i&&i.removeChild(t),s&&void 0!==t[o]&&s(t)}n.splice(l,t)}}return this}refreshItemAt(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return this;if(e.virtual)this._invalidateItemIndexesAt(t,1);else{let i=e.existingEls;if(i.length!==e.count)return this;let n=this._getExistingElsRange();if(t>=n.firstIndex&&t<=n.lastIndex){let e=i[n.firstValidArrayIndex+t-n.firstIndex];delete e[o],this._dequeueElementForIndex(e,t,e.nextSibling,!1)}}return this}isItemRendered(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return!1;let i=this._getExistingElsRange();return t>=i.firstIndex&&t<=i.lastIndex}getItemElementAt(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return;let i=e.existingEls,n=this._getExistingElsRange();return t>=n.firstIndex&&t<=n.lastIndex?i[n.firstValidArrayIndex+t-n.firstIndex]:void 0}getItemPosition(e){const i=this._p;if(!("number"!=typeof e||e<0||e>=i.count)){if(i.virtual)return this._calculateItemPosition(e);{let n=this.getItemElementAt(e);if(void 0===n)return;const r=i.list;return t(n).top-t(r).top+r.scrollTop}}}getItemIndexFromElement(t){return t?t[o]:void 0}getItemSize(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return;let i=e.cachedItemHeights[t-1];return void 0===i&&(i=e.itemHeightEstimatorFn?e.itemHeightEstimatorFn(t-1):null,"number"!=typeof i&&(i=e.estimatedItemHeight),e.cachedItemEstimatedHeights[t-1]=i),i}getVisibleItemCount(){const t=this._p,e=t.list;let i,n,r=e.scrollTop,s=e.clientHeight;if(t.virtual)i=h(t.cachedItemPositions,r),n=h(t.cachedItemPositions,r+s,i);else{const e=t=>{let e=this.getItemPosition(t);return void 0===e&&(e=1/0),e};i=d(t.count,e,r),n=d(t.count,e,r+s,i)}return this.getItemPosition(n)===r+s&&n--,n-i+1}createGhostItemElement(t,e,i){const n=this._p;let r=this._dequeueElementForIndex(null,t,!1,!0);try{e&&n.currentItemsParent.appendChild(r),i(r)}finally{if(e){let t=r.parentNode;t&&t.removeChild(r)}n.onItemUnrender&&n.onItemUnrender(r)}}_resetCurrentItemsParent(){const t=this._p;t.currentItemsParent=t.virtualWrapper??t.userItemsParent??t.list}_destroyElements(){const t=this._p,e=t.onItemUnrender,i=t.existingEls;for(let t=0;t<i.length;t++){const n=i[t];let r=n.parentNode;r&&r.removeChild(n),e&&void 0!==n[o]&&e(n)}return i.length=0,t.virtualWrapper&&(t.virtualWrapper!==t.userItemsParent&&t.virtualWrapper.parentNode&&t.virtualWrapper.parentNode.removeChild(t.virtualWrapper),t.virtualWrapper=null,this._resetCurrentItemsParent()),this}_invalidateItemIndexesAt(t,e){const i=this._p;this._setItemPositionsNeedsUpdate(t);let n=i.existingEls,r=n.length,s=this._getExistingElsRange();if(-1!==s.firstValidArrayIndex&&(-1===e&&(e=n.length),t>=s.firstIndex&&t<=s.lastIndex))for(let i=s.firstValidArrayIndex+t-s.firstIndex,l=0;i<r&&l<e;i++,l++)delete n[i][o]}_pushItemIndexesAt(t,e){let i=this._p.existingEls,n=i.length,r=this._getExistingElsRange();if(-1!==r.firstValidArrayIndex&&t>=r.firstIndex&&t<=r.lastIndex)for(let s=r.firstValidArrayIndex+t-r.firstIndex;s<n;s++)i[s][o]+=e}_hookEvents(){const t=this._p;return this._unhookEvents(),t.virtual&&t.hookScrollEvent&&t.list&&t.list.addEventListener("scroll",t.boundRender),this}_unhookEvents(){const t=this._p;return t.list&&t.list.removeEventListener("scroll",t.boundRender),this}_setItemPositionsNeedsUpdate(t){const e=this._p;t<e.itemPositionsNeedsUpdate&&(e.itemPositionsNeedsUpdate=t)}_calculateItemPosition(t){const e=this._p,i=e.cachedItemPositions;if(t>=e.itemPositionsNeedsUpdate){const n=e.count,r=e.cachedItemHeights,s=e.cachedItemEstimatedHeights,o=e.estimatedItemHeight,l=e.itemHeightEstimatorFn;r.length!==n&&(r.length=n,s.length=n,i.length=n);let a=e.itemPositionsNeedsUpdate,h=Math.min(t,n),d=0;a>0&&(d=i[a-1]);for(let t=a;t<=h;t++){if(0===t){i[t]=d;continue}const e=t-1;let n=r[e];void 0===n&&(n=l?l(e):null,"number"!=typeof n&&(n=o),s[e]=n),d+=n,i[t]=d}e.itemPositionsNeedsUpdate=h+1}if(t>0&&t===e.count){let n=e.cachedItemHeights[t-1];return void 0===n&&(n=e.itemHeightEstimatorFn?e.itemHeightEstimatorFn(t-1):null,"number"!=typeof n&&(n=e.estimatedItemHeight),e.cachedItemEstimatedHeights[t-1]=n),i[t-1]+n}return i[t]}_dequeueElementForIndex(t,e,i,n){const r=this._p,s=r.virtualWrapper,l=(r.currentItemsParent,r.existingEls),a=r.onItemRender,h=r.onItemUnrender,d=!t,u=d||e!==t[o];if(t?h&&u&&h(t):(t=r.itemElementCreatorFn(),s&&!1!==i&&(t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.right="0")),u&&(t.innerHTML="",a&&a(t,e)),!1!==i){if(i instanceof Node||(i=null),!d){let e=l.indexOf(t);-1!==e&&l.splice(e,1)}let r=i?l.indexOf(i):-1;-1===r?l.push(t):l.splice(r,0,t),n||this._insertItemAndFlow(t,e,i)}return t[o]=e,t}_insertItemAndFlow(t,e,i){const r=this._p,s=r.virtualWrapper,o=r.currentItemsParent;if(!1!==i&&(i instanceof Node||(i=null),t.parentNode===o&&t.nextSibling===i||n(t,i,o)),s){let i=t.getBoundingClientRect().height,n=r.cachedItemHeights[e];n!==i&&(r.cachedItemHeights[e]=i),(void 0!==n&&i!==n||void 0===n&&i!==r.cachedItemEstimatedHeights[e])&&this._setItemPositionsNeedsUpdate(e+1);let s=this._calculateItemPosition(e);const o=c();!1===o?t.style.top=`${s}px`:t.style[o]=`translateY(${s}px)`}}_getExistingElsRange(){const t=this._p.existingEls;let i=-1,n=-1;for(let n=0,r=t.length;n<r;n++)if(!1!==e.call(t[n],o)){i=n;break}for(let i=t.length-1;i>=0;i--)if(!1!==e.call(t[i],o)){n=i;break}return{firstValidArrayIndex:i,lastValidArrayIndex:n,firstIndex:-1!==i?t[i][o]:-1,lastIndex:-1!==n?t[n][o]:-1}}}const o=Symbol("index"),l=Symbol("reuse"),a=()=>document.createElement("li"),h=(t,e,i=0,n=-1)=>{let r=t.length;if(n<0&&(n+=r),n<=i)return n;for(;i<=n;){let s=Math.floor(i+(n-i)/2),o=t[s];if(o===e||o<=e&&s<r&&t[s+1]>e){for(;s>0&&t[s-1]===o;)s--;return s}o<e?i=s+1:n=s-1}return-1===n?0:r-1},d=(t,e,i,n=0,r=-1)=>{if(r<0&&(r+=t),r<=n)return r;for(;n<=r;){let s=Math.floor(n+(r-n)/2),o=e(s);if(o===i||o<=i&&s<t&&e(s+1)>i){for(;s>0&&e(s-1)===o;)s--;return s}o<i?n=s+1:r=s-1}return-1===r?0:e(t-1)},u=(t,e)=>{for(let i=t.length-1;i>=0;i--)if(e(t[i]))return t[i]};let m=null;const c=()=>{if(null===m){let t=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],e=document.createElement("div");m=!1;for(let i of t)if(e&&void 0!==e.style[i]){m=i;break}}return m};export{s as default};
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/virtual-list-helper 1.0.16
2
+ * @danielgindi/virtual-list-helper 1.0.17
3
3
  * git://github.com/danielgindi/virtual-list-helper.git
4
4
  */
5
5
  (function (global, factory) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/virtual-list-helper 1.0.16
2
+ * @danielgindi/virtual-list-helper 1.0.17
3
3
  * git://github.com/danielgindi/virtual-list-helper.git
4
4
  */
5
5
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@danielgindi/dom-utils/lib/Css.js")):"function"==typeof define&&define.amd?define(["@danielgindi/dom-utils/lib/Css.js"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).VirtualListHelper=e(t.domUtilsCss)}(this,function(t){"use strict";var e,n,r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={};function o(){if(n)return e;n=1;var t=function(t){return t&&t.Math===Math&&t};return e=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof r&&r)||t("object"==typeof e&&e)||function(){return this}()||Function("return this")()}var u,s,a,c,l,f,h,d,p={};function m(){return s?u:(s=1,u=function(t){try{return!!t()}catch(t){return!0}})}function v(){if(c)return a;c=1;var t=m();return a=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function g(){if(f)return l;f=1;var t=m();return l=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function y(){if(d)return h;d=1;var t=g(),e=Function.prototype.call;return h=t?e.bind(e):function(){return e.apply(e,arguments)},h}var I,b,E,_,S,x,P,O,w,j,C,A,H,W,F,T,R,k,L,N,V,M,U,D,G,B,q,z,Y,$,X,J,K,Q,Z,tt,et,nt,rt,it,ot,ut={};function st(){return E?b:(E=1,b=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}})}function at(){if(S)return _;S=1;var t=g(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return _=t?r:function(t){return function(){return n.apply(t,arguments)}},_}function ct(){if(P)return x;P=1;var t=at(),e=t({}.toString),n=t("".slice);return x=function(t){return n(e(t),8,-1)}}function lt(){return C?j:(C=1,j=function(t){return null==t})}function ft(){if(H)return A;H=1;var t=lt(),e=TypeError;return A=function(n){if(t(n))throw new e("Can't call method on "+n);return n}}function ht(){if(F)return W;F=1;var t=function(){if(w)return O;w=1;var t=at(),e=m(),n=ct(),r=Object,i=t("".split);return O=e(function(){return!r("z").propertyIsEnumerable(0)})?function(t){return"String"===n(t)?i(t,""):r(t)}:r}(),e=ft();return W=function(n){return t(e(n))}}function dt(){if(R)return T;R=1;var t="object"==typeof document&&document.all;return T=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(t){return"function"==typeof t}}function pt(){if(L)return k;L=1;var t=dt();return k=function(e){return"object"==typeof e?null!==e:t(e)}}function mt(){if(V)return N;V=1;var t=o(),e=dt();return N=function(n,r){return arguments.length<2?(i=t[n],e(i)?i:void 0):t[n]&&t[n][r];var i},N}function vt(){if(U)return M;U=1;var t=at();return M=t({}.isPrototypeOf)}function gt(){if(Y)return z;Y=1;var t=function(){if(q)return B;q=1;var t,e,n=o(),r=function(){if(G)return D;G=1;var t=o().navigator,e=t&&t.userAgent;return D=e?String(e):""}(),i=n.process,u=n.Deno,s=i&&i.versions||u&&u.version,a=s&&s.v8;return a&&(e=(t=a.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!e&&r&&(!(t=r.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=r.match(/Chrome\/(\d+)/))&&(e=+t[1]),B=e}(),e=m(),n=o().String;return z=!!Object.getOwnPropertySymbols&&!e(function(){var e=Symbol("symbol detection");return!n(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function yt(){if(X)return $;X=1;var t=gt();return $=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function It(){if(K)return J;K=1;var t=mt(),e=dt(),n=vt(),r=yt(),i=Object;return J=r?function(t){return"symbol"==typeof t}:function(r){var o=t("Symbol");return e(o)&&n(o.prototype,i(r))}}function bt(){if(Z)return Q;Z=1;var t=String;return Q=function(e){try{return t(e)}catch(t){return"Object"}}}function Et(){if(et)return tt;et=1;var t=dt(),e=bt(),n=TypeError;return tt=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")}}function _t(){if(rt)return nt;rt=1;var t=Et(),e=lt();return nt=function(n,r){var i=n[r];return e(i)?void 0:t(i)}}function St(){if(ot)return it;ot=1;var t=y(),e=dt(),n=pt(),r=TypeError;return it=function(i,o){var u,s;if("string"===o&&e(u=i.toString)&&!n(s=t(u,i)))return s;if(e(u=i.valueOf)&&!n(s=t(u,i)))return s;if("string"!==o&&e(u=i.toString)&&!n(s=t(u,i)))return s;throw new r("Can't convert object to primitive value")}}var xt,Pt,Ot,wt,jt,Ct,At,Ht,Wt,Ft,Tt,Rt,kt,Lt,Nt,Vt,Mt,Ut,Dt,Gt,Bt,qt,zt,Yt,$t={exports:{}};function Xt(){return Pt?xt:(Pt=1,xt=!1)}function Jt(){if(wt)return Ot;wt=1;var t=o(),e=Object.defineProperty;return Ot=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch(e){t[n]=r}return r}}function Kt(){if(jt)return $t.exports;jt=1;var t=Xt(),e=o(),n=Jt(),r="__core-js_shared__",i=$t.exports=e[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.46.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"}),$t.exports}function Qt(){if(At)return Ct;At=1;var t=Kt();return Ct=function(e,n){return t[e]||(t[e]=n||{})}}function Zt(){if(Wt)return Ht;Wt=1;var t=ft(),e=Object;return Ht=function(n){return e(t(n))}}function te(){if(Tt)return Ft;Tt=1;var t=at(),e=Zt(),n=t({}.hasOwnProperty);return Ft=Object.hasOwn||function(t,r){return n(e(t),r)}}function ee(){if(kt)return Rt;kt=1;var t=at(),e=0,n=Math.random(),r=t(1.1.toString);return Rt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++e+n,36)}}function ne(){if(Nt)return Lt;Nt=1;var t=o(),e=Qt(),n=te(),r=ee(),i=gt(),u=yt(),s=t.Symbol,a=e("wks"),c=u?s.for||s:s&&s.withoutSetter||r;return Lt=function(t){return n(a,t)||(a[t]=i&&n(s,t)?s[t]:c("Symbol."+t)),a[t]}}function re(){if(Mt)return Vt;Mt=1;var t=y(),e=pt(),n=It(),r=_t(),i=St(),o=ne(),u=TypeError,s=o("toPrimitive");return Vt=function(o,a){if(!e(o)||n(o))return o;var c,l=r(o,s);if(l){if(void 0===a&&(a="default"),c=t(l,o,a),!e(c)||n(c))return c;throw new u("Can't convert object to primitive value")}return void 0===a&&(a="number"),i(o,a)}}function ie(){if(Dt)return Ut;Dt=1;var t=re(),e=It();return Ut=function(n){var r=t(n,"string");return e(r)?r:r+""}}function oe(){if(Bt)return Gt;Bt=1;var t=o(),e=pt(),n=t.document,r=e(n)&&e(n.createElement);return Gt=function(t){return r?n.createElement(t):{}}}function ue(){if(zt)return qt;zt=1;var t=v(),e=m(),n=oe();return qt=!t&&!e(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})}function se(){if(Yt)return p;Yt=1;var t=v(),e=y(),n=function(){if(I)return ut;I=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return ut.f=n?function(t){var n=e(this,t);return!!n&&n.enumerable}:t,ut}(),r=st(),i=ht(),o=ie(),u=te(),s=ue(),a=Object.getOwnPropertyDescriptor;return p.f=t?a:function(t,c){if(t=i(t),c=o(c),s)try{return a(t,c)}catch(t){}if(u(t,c))return r(!e(n.f,t,c),t[c])},p}$t.exports;var ae,ce,le,fe,he,de,pe,me={};function ve(){if(ce)return ae;ce=1;var t=v(),e=m();return ae=t&&e(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function ge(){if(fe)return le;fe=1;var t=pt(),e=String,n=TypeError;return le=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")}}function ye(){if(he)return me;he=1;var t=v(),e=ue(),n=ve(),r=ge(),i=ie(),o=TypeError,u=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a="enumerable",c="configurable",l="writable";return me.f=t?n?function(t,e,n){if(r(t),e=i(e),r(n),"function"==typeof t&&"prototype"===e&&"value"in n&&l in n&&!n[l]){var o=s(t,e);o&&o[l]&&(t[e]=n.value,n={configurable:c in n?n[c]:o[c],enumerable:a in n?n[a]:o[a],writable:!1})}return u(t,e,n)}:u:function(t,n,s){if(r(t),n=i(n),r(s),e)try{return u(t,n,s)}catch(t){}if("get"in s||"set"in s)throw new o("Accessors not supported");return"value"in s&&(t[n]=s.value),t},me}function Ie(){if(pe)return de;pe=1;var t=v(),e=ye(),n=st();return de=t?function(t,r,i){return e.f(t,r,n(1,i))}:function(t,e,n){return t[e]=n,t}}var be,Ee,_e,Se,xe,Pe,Oe,we,je,Ce,Ae,He,We,Fe,Te,Re={exports:{}};function ke(){if(Ee)return be;Ee=1;var t=v(),e=te(),n=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,i=e(n,"name"),o=i&&"something"===function(){}.name,u=i&&(!t||t&&r(n,"name").configurable);return be={EXISTS:i,PROPER:o,CONFIGURABLE:u}}function Le(){if(Se)return _e;Se=1;var t=at(),e=dt(),n=Kt(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(t){return r(t)}),_e=n.inspectSource}function Ne(){if(we)return Oe;we=1;var t=Qt(),e=ee(),n=t("keys");return Oe=function(t){return n[t]||(n[t]=e(t))}}function Ve(){return Ce?je:(Ce=1,je={})}function Me(){if(He)return Ae;He=1;var t,e,n,r=function(){if(Pe)return xe;Pe=1;var t=o(),e=dt(),n=t.WeakMap;return xe=e(n)&&/native code/.test(String(n))}(),i=o(),u=pt(),s=Ie(),a=te(),c=Kt(),l=Ne(),f=Ve(),h="Object already initialized",d=i.TypeError,p=i.WeakMap;if(r||c.state){var m=c.state||(c.state=new p);m.get=m.get,m.has=m.has,m.set=m.set,t=function(t,e){if(m.has(t))throw new d(h);return e.facade=t,m.set(t,e),e},e=function(t){return m.get(t)||{}},n=function(t){return m.has(t)}}else{var v=l("state");f[v]=!0,t=function(t,e){if(a(t,v))throw new d(h);return e.facade=t,s(t,v,e),e},e=function(t){return a(t,v)?t[v]:{}},n=function(t){return a(t,v)}}return Ae={set:t,get:e,has:n,enforce:function(r){return n(r)?e(r):t(r,{})},getterFor:function(t){return function(n){var r;if(!u(n)||(r=e(n)).type!==t)throw new d("Incompatible receiver, "+t+" required");return r}}}}function Ue(){if(We)return Re.exports;We=1;var t=at(),e=m(),n=dt(),r=te(),i=v(),o=ke().CONFIGURABLE,u=Le(),s=Me(),a=s.enforce,c=s.get,l=String,f=Object.defineProperty,h=t("".slice),d=t("".replace),p=t([].join),g=i&&!e(function(){return 8!==f(function(){},"length",{value:8}).length}),y=String(String).split("String"),I=Re.exports=function(t,e,n){"Symbol("===h(l(e),0,7)&&(e="["+d(l(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!r(t,"name")||o&&t.name!==e)&&(i?f(t,"name",{value:e,configurable:!0}):t.name=e),g&&n&&r(n,"arity")&&t.length!==n.arity&&f(t,"length",{value:n.arity});try{n&&r(n,"constructor")&&n.constructor?i&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=a(t);return r(u,"source")||(u.source=p(y,"string"==typeof e?e:"")),t};return Function.prototype.toString=I(function(){return n(this)&&c(this).source||u(this)},"toString"),Re.exports}function De(){if(Te)return Fe;Te=1;var t=dt(),e=ye(),n=Ue(),r=Jt();return Fe=function(i,o,u,s){s||(s={});var a=s.enumerable,c=void 0!==s.name?s.name:o;if(t(u)&&n(u,c,s),s.global)a?i[o]=u:r(o,u);else{try{s.unsafe?i[o]&&(a=!0):delete i[o]}catch(t){}a?i[o]=u:e.f(i,o,{value:u,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return i}}Re.exports;var Ge,Be,qe,ze,Ye,$e,Xe,Je,Ke,Qe,Ze,tn,en,nn,rn,on,un,sn={};function an(){if(ze)return qe;ze=1;var t=function(){if(Be)return Ge;Be=1;var t=Math.ceil,e=Math.floor;return Ge=Math.trunc||function(n){var r=+n;return(r>0?e:t)(r)}}();return qe=function(e){var n=+e;return n!=n||0===n?0:t(n)}}function cn(){if($e)return Ye;$e=1;var t=an(),e=Math.max,n=Math.min;return Ye=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)}}function ln(){if(Je)return Xe;Je=1;var t=an(),e=Math.min;return Xe=function(n){var r=t(n);return r>0?e(r,9007199254740991):0}}function fn(){if(Qe)return Ke;Qe=1;var t=ln();return Ke=function(e){return t(e.length)}}function hn(){if(nn)return en;nn=1;var t=at(),e=te(),n=ht(),r=function(){if(tn)return Ze;tn=1;var t=ht(),e=cn(),n=fn(),r=function(r){return function(i,o,u){var s=t(i),a=n(s);if(0===a)return!r&&-1;var c,l=e(u,a);if(r&&o!=o){for(;a>l;)if((c=s[l++])!=c)return!0}else for(;a>l;l++)if((r||l in s)&&s[l]===o)return r||l||0;return!r&&-1}};return Ze={includes:r(!0),indexOf:r(!1)}}().indexOf,i=Ve(),o=t([].push);return en=function(t,u){var s,a=n(t),c=0,l=[];for(s in a)!e(i,s)&&e(a,s)&&o(l,s);for(;u.length>c;)e(a,s=u[c++])&&(~r(l,s)||o(l,s));return l}}function dn(){return on?rn:(on=1,rn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var pn,mn,vn,gn,yn,In,bn,En,_n,Sn,xn,Pn,On,wn,jn,Cn,An,Hn,Wn={};function Fn(){if(vn)return mn;vn=1;var t=mt(),e=at(),n=function(){if(un)return sn;un=1;var t=hn(),e=dn().concat("length","prototype");return sn.f=Object.getOwnPropertyNames||function(n){return t(n,e)},sn}(),r=(pn||(pn=1,Wn.f=Object.getOwnPropertySymbols),Wn),i=ge(),o=e([].concat);return mn=t("Reflect","ownKeys")||function(t){var e=n.f(i(t)),u=r.f;return u?o(e,u(t)):e}}function Tn(){if(yn)return gn;yn=1;var t=te(),e=Fn(),n=se(),r=ye();return gn=function(i,o,u){for(var s=e(o),a=r.f,c=n.f,l=0;l<s.length;l++){var f=s[l];t(i,f)||u&&t(u,f)||a(i,f,c(o,f))}}}function Rn(){if(_n)return En;_n=1;var t=o(),e=se().f,n=Ie(),r=De(),i=Jt(),u=Tn(),s=function(){if(bn)return In;bn=1;var t=m(),e=dt(),n=/#|\.prototype\./,r=function(n,r){var a=o[i(n)];return a===s||a!==u&&(e(r)?t(r):!!r)},i=r.normalize=function(t){return String(t).replace(n,".").toLowerCase()},o=r.data={},u=r.NATIVE="N",s=r.POLYFILL="P";return In=r}();return En=function(o,a){var c,l,f,h,d,p=o.target,m=o.global,v=o.stat;if(c=m?t:v?t[p]||i(p,{}):t[p]&&t[p].prototype)for(l in a){if(h=a[l],f=o.dontCallGetSet?(d=e(c,l))&&d.value:c[l],!s(m?l:p+(v?".":"#")+l,o.forced)&&void 0!==f){if(typeof h==typeof f)continue;u(h,f)}(o.sham||f&&f.sham)&&n(h,"sham",!0),r(c,l,h,o)}}}function kn(){if(On)return Pn;On=1;var t=function(){if(xn)return Sn;xn=1;var t={};return t[ne()("toStringTag")]="z",Sn="[object z]"===String(t)}(),e=dt(),n=ct(),r=ne()("toStringTag"),i=Object,o="Arguments"===n(function(){return arguments}());return Pn=t?n:function(t){var u,s,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(s=function(t,e){try{return t[e]}catch(t){}}(u=i(t),r))?s:o?n(u):"Object"===(a=n(u))&&e(u.callee)?"Arguments":a}}function Ln(){if(jn)return wn;jn=1;var t=kn(),e=String;return wn=function(n){if("Symbol"===t(n))throw new TypeError("Cannot convert a Symbol value to a string");return e(n)}}function Nn(){if(An)return Cn;An=1;var t=Ue(),e=ye();return Cn=function(n,r,i){return i.get&&t(i.get,r,{getter:!0}),i.set&&t(i.set,r,{setter:!0}),e.f(n,r,i)}}!function(){if(Hn)return i;Hn=1;var t=Rn(),e=v(),n=o(),r=at(),u=te(),s=dt(),a=vt(),c=Ln(),l=Nn(),f=Tn(),h=n.Symbol,d=h&&h.prototype;if(e&&s(h)&&(!("description"in d)||void 0!==h().description)){var p={},m=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:c(arguments[0]),e=a(d,this)?new h(t):void 0===t?h():h(t);return""===t&&(p[e]=!0),e};f(m,h),m.prototype=d,d.constructor=m;var g="Symbol(description detection)"===String(h("description detection")),y=r(d.valueOf),I=r(d.toString),b=/^Symbol\((.*)\)[^)]+$/,E=r("".replace),_=r("".slice);l(d,"description",{configurable:!0,get:function(){var t=y(this);if(u(p,t))return"";var e=I(t),n=g?_(e,7,-1):E(e,b,"$1");return""===n?void 0:n}}),t({global:!0,constructor:!0,forced:!0},{Symbol:m})}}();var Vn,Mn,Un,Dn,Gn,Bn,qn,zn,Yn,$n,Xn,Jn,Kn,Qn,Zn,tr,er,nr,rr,ir,or,ur,sr,ar,cr,lr,fr,hr,dr,pr,mr,vr,gr,yr,Ir,br,Er,_r,Sr,xr,Pr={},Or={};function wr(){if(Bn)return Gn;Bn=1;var t=hn(),e=dn();return Gn=Object.keys||function(n){return t(n,e)}}function jr(){if(Yn)return zn;Yn=1;var t=mt();return zn=t("document","documentElement")}function Cr(){if(Xn)return $n;Xn=1;var t,e=ge(),n=function(){if(qn)return Or;qn=1;var t=v(),e=ve(),n=ye(),r=ge(),i=ht(),o=wr();return Or.f=t&&!e?Object.defineProperties:function(t,e){r(t);for(var u,s=i(e),a=o(e),c=a.length,l=0;c>l;)n.f(t,u=a[l++],s[u]);return t},Or}(),r=dn(),i=Ve(),o=jr(),u=oe(),s=Ne(),a="prototype",c="script",l=s("IE_PROTO"),f=function(){},h=function(t){return"<"+c+">"+t+"</"+c+">"},d=function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e},p=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var e,n,i;p="undefined"!=typeof document?document.domain&&t?d(t):(n=u("iframe"),i="java"+c+":",n.style.display="none",o.appendChild(n),n.src=String(i),(e=n.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F):d(t);for(var s=r.length;s--;)delete p[a][r[s]];return p()};return i[l]=!0,$n=Object.create||function(t,r){var i;return null!==t?(f[a]=e(t),i=new f,f[a]=null,i[l]=t):i=p(),void 0===r?i:n.f(i,r)}}function Ar(){if(Kn)return Jn;Kn=1;var t=ne(),e=Cr(),n=ye().f,r=t("unscopables"),i=Array.prototype;return void 0===i[r]&&n(i,r,{configurable:!0,value:e(null)}),Jn=function(t){i[r][t]=!0}}function Hr(){return Zn?Qn:(Zn=1,Qn={})}function Wr(){if(rr)return nr;rr=1;var t=te(),e=dt(),n=Zt(),r=Ne(),i=function(){if(er)return tr;er=1;var t=m();return tr=!t(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})}(),o=r("IE_PROTO"),u=Object,s=u.prototype;return nr=i?u.getPrototypeOf:function(r){var i=n(r);if(t(i,o))return i[o];var a=i.constructor;return e(a)&&i instanceof a?a.prototype:i instanceof u?s:null}}function Fr(){if(or)return ir;or=1;var t,e,n,r=m(),i=dt(),o=pt(),u=Cr(),s=Wr(),a=De(),c=ne(),l=Xt(),f=c("iterator"),h=!1;return[].keys&&("next"in(n=[].keys())?(e=s(s(n)))!==Object.prototype&&(t=e):h=!0),!o(t)||r(function(){var e={};return t[f].call(e)!==e})?t={}:l&&(t=u(t)),i(t[f])||a(t,f,function(){return this}),ir={IteratorPrototype:t,BUGGY_SAFARI_ITERATORS:h}}function Tr(){if(sr)return ur;sr=1;var t=ye().f,e=te(),n=ne()("toStringTag");return ur=function(r,i,o){r&&!o&&(r=r.prototype),r&&!e(r,n)&&t(r,n,{configurable:!0,value:i})}}function Rr(){if(dr)return hr;dr=1;var t=pt();return hr=function(e){return t(e)||null===e}}function kr(){if(mr)return pr;mr=1;var t=Rr(),e=String,n=TypeError;return pr=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")}}function Lr(){if(Ir)return yr;Ir=1;var t=Rn(),e=y(),n=Xt(),r=ke(),i=dt(),o=function(){if(cr)return ar;cr=1;var t=Fr().IteratorPrototype,e=Cr(),n=st(),r=Tr(),i=Hr(),o=function(){return this};return ar=function(u,s,a,c){var l=s+" Iterator";return u.prototype=e(t,{next:n(+!c,a)}),r(u,l,!1,!0),i[l]=o,u}}(),u=Wr(),s=function(){if(gr)return vr;gr=1;var t=function(){if(fr)return lr;fr=1;var t=at(),e=Et();return lr=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch(t){}}}(),e=pt(),n=ft(),r=kr();return vr=Object.setPrototypeOf||("__proto__"in{}?function(){var i,o=!1,u={};try{(i=t(Object.prototype,"__proto__","set"))(u,[]),o=u instanceof Array}catch(t){}return function(t,u){return n(t),r(u),e(t)?(o?i(t,u):t.__proto__=u,t):t}}():void 0)}(),a=Tr(),c=Ie(),l=De(),f=ne(),h=Hr(),d=Fr(),p=r.PROPER,m=r.CONFIGURABLE,v=d.IteratorPrototype,g=d.BUGGY_SAFARI_ITERATORS,I=f("iterator"),b="keys",E="values",_="entries",S=function(){return this};return yr=function(r,f,d,y,x,P,O){o(d,f,y);var w,j,C,A=function(t){if(t===x&&R)return R;if(!g&&t&&t in F)return F[t];switch(t){case b:case E:case _:return function(){return new d(this,t)}}return function(){return new d(this)}},H=f+" Iterator",W=!1,F=r.prototype,T=F[I]||F["@@iterator"]||x&&F[x],R=!g&&T||A(x),k="Array"===f&&F.entries||T;if(k&&(w=u(k.call(new r)))!==Object.prototype&&w.next&&(n||u(w)===v||(s?s(w,v):i(w[I])||l(w,I,S)),a(w,H,!0,!0),n&&(h[H]=S)),p&&x===E&&T&&T.name!==E&&(!n&&m?c(F,"name",E):(W=!0,R=function(){return e(T,this)})),x)if(j={values:A(E),keys:P?R:A(b),entries:A(_)},O)for(C in j)(g||W||!(C in F))&&l(F,C,j[C]);else t({target:f,proto:!0,forced:g||W},j);return n&&!O||F[I]===R||l(F,I,R,{name:x}),h[f]=R,j}}function Nr(){return Er?br:(Er=1,br=function(t,e){return{value:t,done:e}})}!function(){if(xr)return Pr;xr=1;var t=o(),e=Mn?Vn:(Mn=1,Vn={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}),n=function(){if(Dn)return Un;Dn=1;var t=oe()("span").classList,e=t&&t.constructor&&t.constructor.prototype;return Un=e===Object.prototype?void 0:e}(),r=function(){if(Sr)return _r;Sr=1;var t=ht(),e=Ar(),n=Hr(),r=Me(),i=ye().f,o=Lr(),u=Nr(),s=Xt(),a=v(),c="Array Iterator",l=r.set,f=r.getterFor(c);_r=o(Array,"Array",function(e,n){l(this,{type:c,target:t(e),index:0,kind:n})},function(){var t=f(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=null,u(void 0,!0);switch(t.kind){case"keys":return u(n,!1);case"values":return u(e[n],!1)}return u([n,e[n]],!1)},"values");var h=n.Arguments=n.Array;if(e("keys"),e("values"),e("entries"),!s&&a&&"values"!==h.name)try{i(h,"name",{value:"values"})}catch(t){}return _r}(),i=Ie(),u=Tr(),s=ne()("iterator"),a=r.values,c=function(t,n){if(t){if(t[s]!==a)try{i(t,s,a)}catch(e){t[s]=a}if(u(t,n,!0),e[n])for(var o in r)if(t[o]!==r[o])try{i(t,o,r[o])}catch(e){t[o]=r[o]}}};for(var l in e)c(t[l]&&t[l].prototype,l);c(n,"DOMTokenList")}();const Vr=Object.prototype.hasOwnProperty,Mr=void 0!==Element.prototype.insertAdjacentElement;function Ur(t,e,n){e?!1===Mr||t instanceof DocumentFragment?n.insertBefore(t,e):e.insertAdjacentElement("beforebegin",t):n.appendChild(t)}function Dr(t,e,n,r){return t.parentNode!==r?(e||(e=document.createDocumentFragment()),e.appendChild(t)):(e&&e.childNodes.length>0&&(Ur(e,n,r),e=null),t.nextSibling!==n&&Ur(t,n,r)),e}const Gr=Symbol("index"),Br=Symbol("reuse"),qr=()=>document.createElement("li"),zr=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,i=t.length;if(r<0&&(r+=i),r<=n)return r;for(;n<=r;){let o=Math.floor(n+(r-n)/2),u=t[o];if(u===e||u<=e&&o<i&&t[o+1]>e){for(;o>0&&t[o-1]===u;)o--;return o}u<e?n=o+1:r=o-1}return-1===r?0:i-1},Yr=function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;if(i<0&&(i+=t),i<=r)return i;for(;r<=i;){let o=Math.floor(r+(i-r)/2),u=e(o);if(u===n||u<=n&&o<t&&e(o+1)>n){for(;o>0&&e(o-1)===u;)o--;return o}u<n?r=o+1:i=o-1}return-1===i?0:e(t-1)};let $r=null;return class{constructor(t){var e;const n=this._p={list:t.list||null,hookScrollEvent:void 0===t.hookScrollEvent||!!t.hookScrollEvent,count:t.count||0,virtual:void 0===t.virtual||!!t.virtual,userItemsParent:t.itemsParent||null,setVirtualWrapperWidth:null===(e=t.autoVirtualWrapperWidth)||void 0===e||e,estimatedItemHeight:20,buffer:5,itemHeightEstimatorFn:null,itemElementCreatorFn:qr,onItemRender:null,onItemUnrender:null,onScrollHeightChange:null,virtualWrapper:null,currentItemsParent:null,cachedItemHeights:[],cachedItemEstimatedHeights:[],cachedItemPositions:[],itemPositionsNeedsUpdate:0,boundRender:this.render.bind(this),existingEls:[]};n.currentItemsParent=n.userItemsParent||n.list,this._hookEvents(),"number"==typeof t.count&&this.setCount(t.count),"boolean"==typeof t.virtual&&this.setVirtual(t.virtual),"number"==typeof t.estimatedItemHeight&&this.setEstimatedItemHeight(t.estimatedItemHeight),"number"==typeof t.buffer&&this.setBuffer(t.buffer),"function"==typeof t.itemHeightEstimatorFn&&this.setItemHeightEstimatorFn(t.itemHeightEstimatorFn),"function"==typeof t.itemElementCreatorFn&&this.setItemElementCreatorFn(t.itemElementCreatorFn),"function"==typeof t.onItemRender&&this.setOnItemRender(t.onItemRender),"function"==typeof t.onItemUnrender&&this.setOnItemUnrender(t.onItemUnrender),"function"==typeof t.onScrollHeightChange&&this.setOnScrollHeightChange(t.onScrollHeightChange)}destroy(){this._unhookEvents().invalidate()._destroyElements()}setHookScrollEvent(t){const e=this._p;return t=void 0===t||!!t,e.hookScrollEvent===t||(e.hookScrollEvent=t,this._unhookEvents()._hookEvents()),this}isHookScrollEventEnabled(){return this._p.hookScrollEvent}setCount(t){return this._p.count=t,this.invalidate()}getCount(){return this._p.count}setVirtual(t){const e=this._p;return t=void 0===t||!!t,e.virtual===t||(e.virtual=t,this._hookEvents().invalidate()._destroyElements()),this}isVirtual(){return this._p.virtual}setEstimatedItemHeight(t){return this._p.estimatedItemHeight=Math.abs(("number"==typeof t?t:Number(t))||20),this}getEstimatedItemHeight(){return this._p.estimatedItemHeight}setAutoVirtualWrapperWidth(t){const e=this._p;return e.autoVirtualWrapperWidth=void 0===t||!!t,e.virtualWrapper&&e.autoVirtualWrapperWidth!==e.virtualWrapperWidthWasSet&&(e.virtualWrapper.style.width=e.autoVirtualWrapperWidth?"100%":"",e.virtualWrapperWidthWasSet=e.autoVirtualWrapperWidth),this}isAutoVirtualWrapperWidth(){return this._p.autoVirtualWrapperWidth}setBuffer(t){return this._p.buffer=Math.abs("number"==typeof t?t:Number(t)||5),this}getBuffer(){return this._p.buffer}setItemHeightEstimatorFn(t){return this._p.itemHeightEstimatorFn=t,this}setItemElementCreatorFn(t){return this._p.itemElementCreatorFn=t||qr,this}setOnItemRender(t){return this._p.onItemRender=t,this}setOnItemUnrender(t){return this._p.onItemUnrender=t,this}setOnScrollHeightChange(t){return this._p.onScrollHeightChange=t,this}estimateFullHeight(){const t=this._p;if(0===t.count)return 0;if(t.virtual)return this._calculateItemPosition(t.count)||0;{const e=t.existingEls;if(t.count===e.length){let t=e[0].getBoundingClientRect(),n=e[e.length-1].getBoundingClientRect();return n.top-t.top+n.height}return this._calculateItemPosition(t.count)||0}}invalidatePositions(){const t=this._p;return t.itemPositionsNeedsUpdate=0,t.cachedItemHeights=[],t.cachedItemEstimatedHeights=[],t.cachedItemPositions=[],t.cachedItemHeights.length=t.count,t.cachedItemEstimatedHeights.length=t.count,t.cachedItemPositions.length=t.count,this}invalidate(){const t=this._p;this.invalidatePositions(),t.virtual||this._destroyElements();for(let e of t.existingEls)delete e[Gr];return this}render(){const t=this._p,e=t.list,n=t.virtual;let r=t.virtualWrapper,i=t.currentItemsParent,o=e.scrollTop,u=o+e.clientHeight,s=t.count,a=t.buffer,c=t.onItemUnrender,l=t.existingEls,f=l.length;if(n){const n=e.clientWidth;r||(r=t.virtualWrapper=t.userItemsParent,r||(r=t.virtualWrapper=document.createElement("div"),e.appendChild(r)),this._resetCurrentItemsParent(),i=t.currentItemsParent,t.autoVirtualWrapperWidth?(r.style.width="100%",t.virtualWrapperWidthWasSet=!0):t.virtualWrapperWidthWasSet=!1);for(let t=0;t<f;t++)l[t][Br]=!0;this._calculateItemPosition(t.count-1);let c=this._getExistingElsRange(),d=zr(t.cachedItemPositions,o),p=Math.max(0,d-a),m=p,v=this._calculateItemPosition(m),g=a,y=Math.max(m,zr(t.cachedItemPositions,u-1)+1+a),I=[],b=null,E=r.childNodes[0];const _=function(t){let e;return-1!==c.firstIndex&&t>=c.firstIndex&&t<=c.lastIndex&&(e=l.find(e=>e[Gr]===t&&!0===e[Br])),void 0===e&&(e=(c.firstIndex<p||c.firstValidArrayIndex>0?l.find(t=>(t[Gr]<p||!1===Vr.call(t,Gr))&&!0===t[Br]):void 0)||((t,e)=>{for(let n=t.length-1;n>=0;n--)if(e(t[n]))return t[n]})(l,t=>!0===t[Br])),void 0!==e&&delete e[Br],e};for(;m<s&&m<y;m++){let t=_(m);E&&E===t&&(E=E.nextSibling);const e=this._dequeueElementForIndex(t,m,E,!0);I.push([e,m]),b=Dr(e,b,E,i)}b&&b.childNodes.length>0&&Ur(b,E,i);for(let e of I){const n=e[1];this._insertItemAndFlow(e[0],n,!1),v=t.cachedItemPositions[n]+t.cachedItemHeights[n]}if(v<u)for(;(v<u||g-- >0)&&m<s;m++){let e=_(m);E&&E===e&&(E=E.nextSibling),this._dequeueElementForIndex(e,m,E,!1),v=t.cachedItemPositions[m]+t.cachedItemHeights[m]}let S=this.estimateFullHeight(),x=S+"px";var h;r.style.height!==x&&(t.virtualWrapper.style.height=x,null===(h=t.onScrollHeightChange)||void 0===h||h.call(t,S)),n!==e.clientWidth&&this.render()}else if(s!==l.length){for(let t=0;t<f;t++)l[t][Br]=!0;let t=i.childNodes[0],e=null;for(let n=0;n<s;n++){let r=l.find(t=>t[Gr]===n&&!0===t[Br]);void 0!==r&&delete r[Br],t&&t===r&&(t=t.nextSibling),e=Dr(this._dequeueElementForIndex(r,n,t,!0),e,t,i)}e&&e.childNodes.length>0&&Ur(e,t,i)}f=l.length;for(let t=0;t<f;t++){const e=l[t];if(!0!==e[Br])continue;let n=e.parentNode;n&&n.removeChild(e),c&&void 0!==e[Gr]&&c(e),l.splice(t,1),t--,f--}}addItemsAt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if("number"!=typeof t||t<=0)return this;const n=this._p;if((e<0||e>=n.count)&&(e=n.count),n.count+=t,n.virtual)e>=0&&e<n.count&&this._invalidateItemIndexesAt(e,-1);else{let r=n.existingEls;if(r.length!==n.count-t)return this;let i=this._getExistingElsRange();if(-1===i.firstValidArrayIndex)return this;const o=n.currentItemsParent;let u=i.firstValidArrayIndex+e-i.firstIndex;this._pushItemIndexesAt(e,t);let s=r[u-1]?r[u-1].nextSibling:r[0],a=null;for(let n=e,r=e+t;n<r;n++)a=Dr(this._dequeueElementForIndex(void 0,n,s,!0),a,s,o);a&&a.childNodes.length>0&&Ur(a,s,o)}return this}removeItemsAt(t,e){const n=this._p;if("number"!=typeof t||"number"!=typeof e||t<=0||e<0||e>=n.count)return this;if(n.count-=Math.min(t,n.count-e),n.virtual)this._invalidateItemIndexesAt(e,-1);else{let r=n.existingEls;if(r.length!==n.count+t)return this;let i=this._getExistingElsRange();if(-1===i.firstValidArrayIndex)return this;this._pushItemIndexesAt(e+t,-t);const o=n.onItemUnrender;let u=i.firstValidArrayIndex+e-i.firstIndex;if(u<r.length){for(let e=0;e<t;e++){let t=r[u+e],n=t.parentNode;n&&n.removeChild(t),o&&void 0!==t[Gr]&&o(t)}r.splice(u,t)}}return this}refreshItemAt(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return this;if(e.virtual)this._invalidateItemIndexesAt(t,1);else{let n=e.existingEls;if(n.length!==e.count)return this;let r=this._getExistingElsRange();if(t>=r.firstIndex&&t<=r.lastIndex){let e=n[r.firstValidArrayIndex+t-r.firstIndex];delete e[Gr],this._dequeueElementForIndex(e,t,e.nextSibling,!1)}}return this}isItemRendered(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return!1;let n=this._getExistingElsRange();return t>=n.firstIndex&&t<=n.lastIndex}getItemElementAt(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return;let n=e.existingEls,r=this._getExistingElsRange();return t>=r.firstIndex&&t<=r.lastIndex?n[r.firstValidArrayIndex+t-r.firstIndex]:void 0}getItemPosition(e){const n=this._p;if(!("number"!=typeof e||e<0||e>=n.count)){if(n.virtual)return this._calculateItemPosition(e);{let r=this.getItemElementAt(e);if(void 0===r)return;const i=n.list;return t.getElementOffset(r).top-t.getElementOffset(i).top+i.scrollTop}}}getItemIndexFromElement(t){return t?t[Gr]:void 0}getItemSize(t){const e=this._p;if("number"!=typeof t||t<0||t>=e.count)return;let n=e.cachedItemHeights[t-1];return void 0===n&&(n=e.itemHeightEstimatorFn?e.itemHeightEstimatorFn(t-1):null,"number"!=typeof n&&(n=e.estimatedItemHeight),e.cachedItemEstimatedHeights[t-1]=n),n}getVisibleItemCount(){const t=this._p,e=t.list;let n,r,i=e.scrollTop,o=e.clientHeight;if(t.virtual)n=zr(t.cachedItemPositions,i),r=zr(t.cachedItemPositions,i+o,n);else{const e=t=>{let e=this.getItemPosition(t);return void 0===e&&(e=1/0),e};n=Yr(t.count,e,i),r=Yr(t.count,e,i+o,n)}return this.getItemPosition(r)===i+o&&r--,r-n+1}createGhostItemElement(t,e,n){const r=this._p;let i=this._dequeueElementForIndex(null,t,!1,!0);try{e&&r.currentItemsParent.appendChild(i),n(i)}finally{if(e){let t=i.parentNode;t&&t.removeChild(i)}r.onItemUnrender&&r.onItemUnrender(i)}}_resetCurrentItemsParent(){var t,e;const n=this._p;n.currentItemsParent=null!==(t=null!==(e=n.virtualWrapper)&&void 0!==e?e:n.userItemsParent)&&void 0!==t?t:n.list}_destroyElements(){const t=this._p,e=t.onItemUnrender,n=t.existingEls;for(let t=0;t<n.length;t++){const r=n[t];let i=r.parentNode;i&&i.removeChild(r),e&&void 0!==r[Gr]&&e(r)}return n.length=0,t.virtualWrapper&&(t.virtualWrapper!==t.userItemsParent&&t.virtualWrapper.parentNode&&t.virtualWrapper.parentNode.removeChild(t.virtualWrapper),t.virtualWrapper=null,this._resetCurrentItemsParent()),this}_invalidateItemIndexesAt(t,e){const n=this._p;this._setItemPositionsNeedsUpdate(t);let r=n.existingEls,i=r.length,o=this._getExistingElsRange();if(-1!==o.firstValidArrayIndex&&(-1===e&&(e=r.length),t>=o.firstIndex&&t<=o.lastIndex))for(let n=o.firstValidArrayIndex+t-o.firstIndex,u=0;n<i&&u<e;n++,u++)delete r[n][Gr]}_pushItemIndexesAt(t,e){let n=this._p.existingEls,r=n.length,i=this._getExistingElsRange();if(-1!==i.firstValidArrayIndex&&t>=i.firstIndex&&t<=i.lastIndex)for(let o=i.firstValidArrayIndex+t-i.firstIndex;o<r;o++)n[o][Gr]+=e}_hookEvents(){const t=this._p;return this._unhookEvents(),t.virtual&&t.hookScrollEvent&&t.list&&t.list.addEventListener("scroll",t.boundRender),this}_unhookEvents(){const t=this._p;return t.list&&t.list.removeEventListener("scroll",t.boundRender),this}_setItemPositionsNeedsUpdate(t){const e=this._p;t<e.itemPositionsNeedsUpdate&&(e.itemPositionsNeedsUpdate=t)}_calculateItemPosition(t){const e=this._p,n=e.cachedItemPositions;if(t>=e.itemPositionsNeedsUpdate){const r=e.count,i=e.cachedItemHeights,o=e.cachedItemEstimatedHeights,u=e.estimatedItemHeight,s=e.itemHeightEstimatorFn;i.length!==r&&(i.length=r,o.length=r,n.length=r);let a=e.itemPositionsNeedsUpdate,c=Math.min(t,r),l=0;a>0&&(l=n[a-1]);for(let t=a;t<=c;t++){if(0===t){n[t]=l;continue}const e=t-1;let r=i[e];void 0===r&&(r=s?s(e):null,"number"!=typeof r&&(r=u),o[e]=r),l+=r,n[t]=l}e.itemPositionsNeedsUpdate=c+1}if(t>0&&t===e.count){let r=e.cachedItemHeights[t-1];return void 0===r&&(r=e.itemHeightEstimatorFn?e.itemHeightEstimatorFn(t-1):null,"number"!=typeof r&&(r=e.estimatedItemHeight),e.cachedItemEstimatedHeights[t-1]=r),n[t-1]+r}return n[t]}_dequeueElementForIndex(t,e,n,r){const i=this._p,o=i.virtualWrapper,u=(i.currentItemsParent,i.existingEls),s=i.onItemRender,a=i.onItemUnrender,c=!t,l=c||e!==t[Gr];if(t?a&&l&&a(t):(t=i.itemElementCreatorFn(),o&&!1!==n&&(t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.right="0")),l&&(t.innerHTML="",s&&s(t,e)),!1!==n){if(n instanceof Node||(n=null),!c){let e=u.indexOf(t);-1!==e&&u.splice(e,1)}let i=n?u.indexOf(n):-1;-1===i?u.push(t):u.splice(i,0,t),r||this._insertItemAndFlow(t,e,n)}return t[Gr]=e,t}_insertItemAndFlow(t,e,n){const r=this._p,i=r.virtualWrapper,o=r.currentItemsParent;if(!1!==n&&(n instanceof Node||(n=null),t.parentNode===o&&t.nextSibling===n||Ur(t,n,o)),i){let n=t.getBoundingClientRect().height,i=r.cachedItemHeights[e];i!==n&&(r.cachedItemHeights[e]=n),(void 0!==i&&n!==i||void 0===i&&n!==r.cachedItemEstimatedHeights[e])&&this._setItemPositionsNeedsUpdate(e+1);let o=this._calculateItemPosition(e);const u=(()=>{if(null===$r){let t=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],e=document.createElement("div");$r=!1;for(let n of t)if(e&&void 0!==e.style[n]){$r=n;break}}return $r})();!1===u?t.style.top="".concat(o,"px"):t.style[u]="translateY(".concat(o,"px)")}}_getExistingElsRange(){const t=this._p.existingEls;let e=-1,n=-1;for(let n=0,r=t.length;n<r;n++)if(!1!==Vr.call(t[n],Gr)){e=n;break}for(let e=t.length-1;e>=0;e--)if(!1!==Vr.call(t[e],Gr)){n=e;break}return{firstValidArrayIndex:e,lastValidArrayIndex:n,firstIndex:-1!==e?t[e][Gr]:-1,lastIndex:-1!==n?t[n][Gr]:-1}}}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielgindi/virtual-list-helper",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "A collection of dom utilities. So you can work natively with the dom without dom frameworks.",
5
5
  "main": "dist/virtual-list-helper.cjs.min.js",
6
6
  "module": "lib/index.js",
@@ -39,19 +39,23 @@ export default defineComponent({
39
39
  // --- Rendering individual list items ---
40
40
  const onItemRender = (el, index) => {
41
41
  const data = { index: index };
42
- if (props.items) {
42
+ if (props.items)
43
43
  data.item = props.items[index];
44
- }
44
+
45
+ // Always create fresh slot VNode
46
+ const slotVnode = slots.default?.(data);
47
+ if (!slotVnode) return;
45
48
 
46
49
  let vnode = el[VueInstanceSymbol];
47
50
  if (!vnode) {
48
- let slotVnode = slots.default(data);
49
51
  vnode = createVNode({
50
52
  render() {
51
53
  return slotVnode;
52
54
  },
53
55
  });
54
56
  el[VueInstanceSymbol] = vnode;
57
+ } else {
58
+ vnode.type.render = () => slotVnode;
55
59
  }
56
60
 
57
61
  render(vnode, el);