UNPKG

@visualjs/grid

Version:
1 lines 110 kB
var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,s)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,__spreadValues=(e,t)=>{for(var s in t||(t={}))__hasOwnProp.call(t,s)&&__defNormalProp(e,s,t[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(t))__propIsEnum.call(t,s)&&__defNormalProp(e,s,t[s]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t));!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VisualJS={})}(this,(function(e){var t,s;class o{}class n extends o{}class i extends o{isPopup(){return!1}}class r{}var l,a,h,d,u,c,p,g={},f=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function _(e,t){for(var s in t)e[s]=t[s];return e}function w(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,s){var o,n,i,r={};for(i in t)"key"==i?o=t[i]:"ref"==i?n=t[i]:r[i]=t[i];if(arguments.length>2&&(r.children=arguments.length>3?l.call(arguments,2):s),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===r[i]&&(r[i]=e.defaultProps[i]);return C(e,r,o,n,null)}function C(e,t,s,o,n){var i={type:e,props:t,key:s,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==n?++h:n};return null!=a.vnode&&a.vnode(i),i}function y(e){return e.children}function R(e,t){this.props=e,this.context=t}function b(e,t){if(null==t)return e.__?b(e.__,e.__.__k.indexOf(e)+1):null;for(var s;t<e.__k.length;t++)if(null!=(s=e.__k[t])&&null!=s.__e)return s.__e;return"function"==typeof e.type?b(e):null}function x(e){var t,s;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(s=e.__k[t])&&null!=s.__e){e.__e=e.__c.base=s.__e;break}return x(e)}}function S(e){(!e.__d&&(e.__d=!0)&&d.push(e)&&!E.__r++||c!==a.debounceRendering)&&((c=a.debounceRendering)||u)(E)}function E(){for(var e;E.__r=d.length;)e=d.sort((function(e,t){return e.__v.__b-t.__v.__b})),d=[],e.some((function(e){var t,s,o,n,i,r;e.__d&&(i=(n=(t=e).__v).__e,(r=t.__P)&&(s=[],(o=_({},n)).__v=n.__v+1,T(r,n,o,t.__n,void 0!==r.ownerSVGElement,null!=n.__h?[i]:null,s,null==i?b(n):i,n.__h),V(s,n),n.__e!=i&&x(n)))}))}function M(e,t,s,o,n,i,r,l,a,h){var d,u,c,p,m,_,w,v=o&&o.__k||f,R=v.length;for(s.__k=[],d=0;d<t.length;d++)if(null!=(p=s.__k[d]=null==(p=t[d])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?C(null,p,null,null,p):Array.isArray(p)?C(y,{children:p},null,null,null):p.__b>0?C(p.type,p.props,p.key,null,p.__v):p)){if(p.__=s,p.__b=s.__b+1,null===(c=v[d])||c&&p.key==c.key&&p.type===c.type)v[d]=void 0;else for(u=0;u<R;u++){if((c=v[u])&&p.key==c.key&&p.type===c.type){v[u]=void 0;break}c=null}T(e,p,c=c||g,n,i,r,l,a,h),m=p.__e,(u=p.ref)&&c.ref!=u&&(w||(w=[]),c.ref&&w.push(c.ref,null,p),w.push(u,p.__c||m,p)),null!=m?(null==_&&(_=m),"function"==typeof p.type&&null!=p.__k&&p.__k===c.__k?p.__d=a=D(p,a,e):a=z(e,p,c,v,m,a),h||"option"!==s.type?"function"==typeof s.type&&(s.__d=a):e.value=""):a&&c.__e==a&&a.parentNode!=e&&(a=b(c))}for(s.__e=_,d=R;d--;)null!=v[d]&&("function"==typeof s.type&&null!=v[d].__e&&v[d].__e==s.__d&&(s.__d=b(o,d+1)),B(v[d],v[d]));if(w)for(d=0;d<w.length;d++)L(w[d],w[++d],w[++d])}function D(e,t,s){var o,n;for(o=0;o<e.__k.length;o++)(n=e.__k[o])&&(n.__=e,t="function"==typeof n.type?D(n,t,s):z(s,n,n,e.__k,n.__e,t));return t}function N(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){N(e,t)})):t.push(e)),t}function z(e,t,s,o,n,i){var r,l,a;if(void 0!==t.__d)r=t.__d,t.__d=void 0;else if(null==s||n!=i||null==n.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(n),r=null;else{for(l=i,a=0;(l=l.nextSibling)&&a<o.length;a+=2)if(l==n)break e;e.insertBefore(n,i),r=i}return void 0!==r?r:n.nextSibling}function k(e,t,s){"-"===t[0]?e.setProperty(t,s):e[t]=null==s?"":"number"!=typeof s||m.test(t)?s:s+"px"}function I(e,t,s,o,n){var i;e:if("style"===t)if("string"==typeof s)e.style.cssText=s;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)s&&t in s||k(e.style,t,"");if(s)for(t in s)o&&s[t]===o[t]||k(e.style,t,s[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=s,s?o||e.addEventListener(t,i?O:P,i):e.removeEventListener(t,i?O:P,i);else if("dangerouslySetInnerHTML"!==t){if(n)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==s?"":s;break e}catch(r){}"function"==typeof s||(null!=s&&(!1!==s||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,s):e.removeAttribute(t))}}function P(e){this.l[e.type+!1](a.event?a.event(e):e)}function O(e){this.l[e.type+!0](a.event?a.event(e):e)}function T(e,t,s,o,n,i,r,h,d){var u,c,p,f,m,v,C,x,S,E,D,N=t.type;if(void 0!==t.constructor)return null;null!=s.__h&&(d=s.__h,h=t.__e=s.__e,t.__h=null,i=[h]),(u=a.__b)&&u(t);try{e:if("function"==typeof N){if(x=t.props,S=(u=N.contextType)&&o[u.__c],E=u?S?S.props.value:u.__:o,s.__c?C=(c=t.__c=s.__c).__=c.__E:("prototype"in N&&N.prototype.render?t.__c=c=new N(x,E):(t.__c=c=new R(x,E),c.constructor=N,c.render=H),S&&S.sub(c),c.props=x,c.state||(c.state={}),c.context=E,c.__n=o,p=c.__d=!0,c.__h=[]),null==c.__s&&(c.__s=c.state),null!=N.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=_({},c.__s)),_(c.__s,N.getDerivedStateFromProps(x,c.__s))),f=c.props,m=c.state,p)null==N.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==N.getDerivedStateFromProps&&x!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(x,E),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(x,c.__s,E)||t.__v===s.__v){c.props=x,c.state=c.__s,t.__v!==s.__v&&(c.__d=!1),c.__v=t,t.__e=s.__e,t.__k=s.__k,t.__k.forEach((function(e){e&&(e.__=t)})),c.__h.length&&r.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(x,c.__s,E),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,m,v)}))}c.context=E,c.props=x,c.state=c.__s,(u=a.__r)&&u(t),c.__d=!1,c.__v=t,c.__P=e,u=c.render(c.props,c.state,c.context),c.state=c.__s,null!=c.getChildContext&&(o=_(_({},o),c.getChildContext())),p||null==c.getSnapshotBeforeUpdate||(v=c.getSnapshotBeforeUpdate(f,m)),D=null!=u&&u.type===y&&null==u.key?u.props.children:u,M(e,Array.isArray(D)?D:[D],t,s,o,n,i,r,h,d),c.base=t.__e,t.__h=null,c.__h.length&&r.push(c),C&&(c.__E=c.__=null),c.__e=!1}else null==i&&t.__v===s.__v?(t.__k=s.__k,t.__e=s.__e):t.__e=function(e,t,s,o,n,i,r,a){var h,d,u,c=s.props,p=t.props,f=t.type,m=0;if("svg"===f&&(n=!0),null!=i)for(;m<i.length;m++)if((h=i[m])&&(h===e||(f?h.localName==f:3==h.nodeType))){e=h,i[m]=null;break}if(null==e){if(null===f)return document.createTextNode(p);e=n?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,p.is&&p),i=null,a=!1}if(null===f)c===p||a&&e.data===p||(e.data=p);else{if(i=i&&l.call(e.childNodes),d=(c=s.props||g).dangerouslySetInnerHTML,u=p.dangerouslySetInnerHTML,!a){if(null!=i)for(c={},m=0;m<e.attributes.length;m++)c[e.attributes[m].name]=e.attributes[m].value;(u||d)&&(u&&(d&&u.__html==d.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,s,o,n){var i;for(i in s)"children"===i||"key"===i||i in t||I(e,i,null,s[i],o);for(i in t)n&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||s[i]===t[i]||I(e,i,t[i],s[i],o)}(e,p,c,n,a),u)t.__k=[];else if(m=t.props.children,M(e,Array.isArray(m)?m:[m],t,s,o,n&&"foreignObject"!==f,i,r,i?i[0]:s.__k&&b(s,0),a),null!=i)for(m=i.length;m--;)null!=i[m]&&w(i[m]);a||("value"in p&&void 0!==(m=p.value)&&(m!==e.value||"progress"===f&&!m)&&I(e,"value",m,c.value,!1),"checked"in p&&void 0!==(m=p.checked)&&m!==e.checked&&I(e,"checked",m,c.checked,!1))}return e}(s.__e,t,s,o,n,i,r,d);(u=a.diffed)&&u(t)}catch(z){t.__v=null,(d||null!=i)&&(t.__e=h,t.__h=!!d,i[i.indexOf(h)]=null),a.__e(z,t,s)}}function V(e,t){a.__c&&a.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(s){a.__e(s,t.__v)}}))}function L(e,t,s){try{"function"==typeof e?e(t):e.current=t}catch(o){a.__e(o,s)}}function B(e,t,s){var o,n;if(a.unmount&&a.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||L(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){a.__e(i,t)}o.base=o.__P=null}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&B(o[n],t,"function"!=typeof e.type);s||null==e.__e||w(e.__e),e.__e=e.__d=void 0}function H(e,t,s){return this.constructor(e,s)}function A(e,t){var s,o,n,i,r,h;s=e,o=t,n=A,a.__&&a.__(s,o),r=(i="function"==typeof n)?null:n&&n.__k||o.__k,h=[],T(o,s=(!i&&n||o).__k=v(y,null,[s]),r||g,g,void 0!==o.ownerSVGElement,!i&&n?[n]:r?null:o.firstChild?l.call(o.childNodes):null,h,!i&&n?n:r?r.__e:o.firstChild,i),V(h,s)}l=f.slice,a={__e:function(e,t){for(var s,o,n;t=t.__;)if((s=t.__c)&&!s.__)try{if((o=s.constructor)&&null!=o.getDerivedStateFromError&&(s.setState(o.getDerivedStateFromError(e)),n=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e),n=s.__d),n)return s.__E=s}catch(i){e=i}throw e}},h=0,R.prototype.setState=function(e,t){var s;s=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof e&&(e=e(_({},s),this.props)),e&&_(s,e),null!=e&&this.__v&&(t&&this.__h.push(t),S(this))},R.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),S(this))},R.prototype.render=y,d=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,E.__r=0,p=0;const $=(W={__c:F="__cC"+p++,__:void 0,Consumer:function(e,t){return e.children(t)},Provider:function(e){var t,s;return this.getChildContext||(t=[],(s={})[F]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&t.some(S)},this.sub=function(e){t.push(e);var s=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(e),1),s&&s.call(e)}}),e.children}}).Provider.__=W.Consumer.contextType=W;var F,W;function j(e){return v($.Provider,{value:e.grid},e.children)}var X,U,Y,G=0,K=[],q=a.__b,Q=a.__r,J=a.diffed,Z=a.__c,ee=a.unmount;function te(e,t){a.__h&&a.__h(U,e,G||t),G=0;var s=U.__H||(U.__H={__:[],__h:[]});return e>=s.__.length&&s.__.push({}),s.__[e]}function se(e){return G=1,function(e,t,s){var o=te(X++,2);return o.t=e,o.__c||(o.__=[s?s(t):pe(void 0,t),function(e){var t=o.t(o.__[0],e);o.__[0]!==t&&(o.__=[t,o.__[1]],o.__c.setState({}))}],o.__c=U),o.__}(pe,e)}function oe(e,t){var s=te(X++,4);!a.__s&&function(e,t){return!e||e.length!==t.length||t.some((function(t,s){return t!==e[s]}))}(s.__H,t)&&(s.__=e,s.__H=t,U.__h.push(s))}function ne(e){var t=U.context[e.__c],s=te(X++,9);return s.c=e,t?(null==s.__&&(s.__=!0,t.sub(U)),t.props.value):e.__}function ie(){K.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(ue),e.__H.__h.forEach(ce),e.__H.__h=[]}catch(W){e.__H.__h=[],a.__e(W,e.__v)}})),K=[]}a.__b=function(e){U=null,q&&q(e)},a.__r=function(e){Q&&Q(e),X=0;var t=(U=e.__c).__H;t&&(t.__h.forEach(ue),t.__h.forEach(ce),t.__h=[])},a.diffed=function(e){J&&J(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==K.push(t)&&Y===a.requestAnimationFrame||((Y=a.requestAnimationFrame)||function(e){var t,s=function(){clearTimeout(o),de&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(s,100);de&&(t=requestAnimationFrame(s))})(ie)),U=void 0},a.__c=function(e,t){t.some((function(e){try{e.__h.forEach(ue),e.__h=e.__h.filter((function(e){return!e.__||ce(e)}))}catch(s){t.some((function(e){e.__h&&(e.__h=[])})),t=[],a.__e(s,e.__v)}})),Z&&Z(e,t)},a.unmount=function(e){ee&&ee(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(ue)}catch(s){a.__e(s,t.__v)}};var re,le,ae,he,de="function"==typeof requestAnimationFrame;function ue(e){var t=U;"function"==typeof e.__c&&e.__c(),U=t}function ce(e){var t=U;e.__c=e.__(),U=t}function pe(e,t){return"function"==typeof t?t(e):t}function ge(e){var t,s,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(s=ge(e[t]))&&(o&&(o+=" "),o+=s);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function fe(){for(var e,t,s=0,o="";s<arguments.length;)(e=arguments[s++])&&(t=ge(e))&&(o&&(o+=" "),o+=t);return o}let me;function _e(){return null==me&&function(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let s=t.offsetWidth-t.clientWidth;0===s&&0===t.clientWidth&&(s=null),t.parentNode&&t.parentNode.removeChild(t),null!=s&&(me=0===s)}(),me}(le=re||(re={}))[le.Left=0]="Left",le[le.Middle=1]="Middle",le[le.Right=2]="Right",(he=ae||(ae={})).clean=function(e){e.innerHTML=""},he.appendClassName=function(e,t){const s=e.className.split(" ");-1===s.findIndex((e=>e===t))&&(s.push(t),e.className=s.join(" "))},he.removeClassName=function(e,t){const s=e.className.split(" "),o=s.findIndex((e=>e===t));-1!==o&&(s.splice(o,1),e.className=s.join(" "))},he.setClassNames=function(e,t){e.className=be(t)},he.isInViewport=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)};const we="undefined"==typeof navigator?void 0:navigator,ve=null==we?void 0:we.clipboard,Ce=null==(t=null==ve?void 0:ve.readText)?void 0:t.bind(ve),ye=null==(s=null==ve?void 0:ve.writeText)?void 0:s.bind(ve);function Re(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function be(...e){return fe(...e)}function xe(){var e=0;return function(){return e++}}function Se(e,...t){return e.filter((e=>t.every((t=>t.indexOf(e)<0))))}function Ee(e,...t){return e.filter((e=>t.every((t=>-1!==t.indexOf(e)))))}function Me(e){return e.filter(((t,s)=>e.indexOf(t,0)===s))}function De(e,t,s){const o=t<0?e.length+t:t;if(o>=0&&o<e.length){const o=s<0?e.length+s:s,[n]=e.splice(t,1);e.splice(o,0,n)}}function Ne(e,t,s,o){const n={state:t(e.getState(),o),getState:()=>n.state,cancel:()=>{}};return n.cancel=e.subscribeAny((()=>{const i=t(e.getState(),o);(function(e,t){if(Re(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(let n=0;n<s.length;n++)if(!Object.prototype.hasOwnProperty.call(t,s[n])||!Re(e[s[n]],t[s[n]]))return!1;return!0})(i,n.state)||(n.state=i,s(n.state))})),n}function ze(e,t){return function(s){return function(o){const n=ne($),[i,r]=se(e(n.getState(),{grid:n,props:o})),l=t?t(n):void 0;return oe((()=>Ne(n.getRoot(),e,(e=>{r(e)}),{grid:n,props:o}).cancel),[]),v(s,__spreadValues(__spreadValues(__spreadValues({},i),o),l))}}}function ke(e){return function(t){const s=ne($);return v(e,__spreadValues({grid:s},t))}}class Ie extends R{constructor(){super(...arguments),this.refs={}}createRef(e){const t={current:null};return this.refs[e]=t,t}}function Pe(e,t){for(var s in e)if("__source"!==s&&!(s in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function Oe(e){this.props=e}(Oe.prototype=new R).isPureReactComponent=!0,Oe.prototype.shouldComponentUpdate=function(e,t){return Pe(this.props,e)||Pe(this.state,t)};var Te=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Te&&Te(e)};var Ve=a.__e;a.__e=function(e,t,s){if(e.then)for(var o,n=t;n=n.__;)if((o=n.__c)&&o.__c)return null==t.__e&&(t.__e=s.__e,t.__k=s.__k),o.__c(e,t);Ve(e,t,s)};var Le=a.unmount;function Be(){this.__u=0,this.t=null,this.__b=null}function He(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function Ae(){this.u=null,this.o=null}a.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),Le&&Le(e)},(Be.prototype=new R).__c=function(e,t){var s=t.__c,o=this;null==o.t&&(o.t=[]),o.t.push(s);var n=He(o.__v),i=!1,r=function(){i||(i=!0,s.__R=null,n?n(l):l())};s.__R=r;var l=function(){if(!--o.__u){if(o.state.__e){var e=o.state.__e;o.__v.__k[0]=function e(t,s,o){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,s,o)})),t.__c&&t.__c.__P===s&&(t.__e&&o.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=o)),t}(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__e:o.__b=null});t=o.t.pop();)t.forceUpdate()}},a=!0===t.__h;o.__u++||a||o.setState({__e:o.__b=o.__v.__k[0]}),e.then(r,r)},Be.prototype.componentWillUnmount=function(){this.t=[]},Be.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var s=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,s,o){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=function(e,t){for(var s in t)e[s]=t[s];return e}({},t)).__c&&(t.__c.__P===o&&(t.__c.__P=s),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,s,o)}))),t}(this.__b,s,o.__O=o.__P)}this.__b=null}var n=t.__e&&v(y,null,e.fallback);return n&&(n.__h=null),[v(y,null,t.__e?null:e.children),n]};var $e=function(e,t,s){if(++s[1]===s[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(s=e.u;s;){for(;s.length>3;)s.pop()();if(s[1]<s[0])break;e.u=s=s[2]}};(Ae.prototype=new R).__e=function(e){var t=this,s=He(t.__v),o=t.o.get(e);return o[0]++,function(n){var i=function(){t.props.revealOrder?(o.push(n),$e(t,e,o)):n()};s?s(i):i()}},Ae.prototype.render=function(e){this.u=null,this.o=new Map;var t=N(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var s=t.length;s--;)this.o.set(t[s],this.u=[1,0,this.u]);return e.children},Ae.prototype.componentDidUpdate=Ae.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,s){$e(e,s,t)}))};var Fe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,We=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,je=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};R.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(R.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Xe=a.event;function Ue(){}function Ye(){return this.cancelBubble}function Ge(){return this.defaultPrevented}a.event=function(e){return Xe&&(e=Xe(e)),e.persist=Ue,e.isPropagationStopped=Ye,e.isDefaultPrevented=Ge,e.nativeEvent=e};var Ke={configurable:!0,get:function(){return this.class}},qe=a.vnode;a.vnode=function(e){var t=e.type,s=e.props,o=s;if("string"==typeof t){for(var n in o={},s){var i=s[n];"value"===n&&"defaultValue"in s&&null==i||("defaultValue"===n&&"value"in s&&null==s.value?n="value":"download"===n&&!0===i?i="":/ondoubleclick/i.test(n)?n="ondblclick":/^onchange(textarea|input)/i.test(n+t)&&!je(s.type)?n="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(n)?n=n.toLowerCase():We.test(n)?n=n.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===i&&(i=void 0),o[n]=i)}"select"==t&&o.multiple&&Array.isArray(o.value)&&(o.value=N(s.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==t&&null!=o.defaultValue&&(o.value=N(s.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),e.props=o}t&&s.class!=s.className&&(Ke.enumerable="className"in s,null!=s.className&&(o.class=s.className),Object.defineProperty(o,"className",Ke)),e.$$typeof=Fe,qe&&qe(e)};var Qe=a.__r;a.__r=function(e){Qe&&Qe(e)};class Je extends Oe{constructor(){super(...arguments),this.refs={}}createRef(e){const t={current:null};return this.refs[e]=t,t}}var Ze="v-grid-menu",et="v-grid-menu-separator",tt="v-grid-menu-item",st="v-grid-menu-disabled-item",ot="v-grid-menu-item-icon",nt="v-grid-menu-item-title";class it extends Ie{constructor(){super(...arguments),this.handleClick=e=>{this.props.disabled||this.props.subMenus||(this.props.action&&this.props.action(),this.props.onClick&&this.props.onClick(e))},this.showSubMenus=()=>{const e=this.refs.self.current,t=e.getBoundingClientRect(),s={x:t.left+e.offsetWidth-2,y:t.top};this.setState({subMenuCoord:s,subMenuVisible:!0})},this.hideSubMenus=()=>{this.setState({subMenuVisible:!1})}}get hasSubMenus(){return this.props.subMenus&&!this.props.disabled}render(){return this.props.separator?v("div",{className:et}):v("div",{className:this.props.disabled?st:tt,onClick:this.handleClick,onMouseOver:this.hasSubMenus?this.showSubMenus:void 0,onMouseLeave:this.hasSubMenus?this.hideSubMenus:void 0,ref:this.createRef("self")},v("span",{className:ot},v("span",{className:this.props.icon})),v("span",{className:nt},this.props.name),this.hasSubMenus&&v("span",{className:"vg-cheveron-right"}),this.state.subMenuVisible&&v(rt,{onMenuItemClicked:this.props.onClick,coord:this.state.subMenuCoord,items:this.props.subMenus}))}}class rt extends Ie{constructor(){super(...arguments),this.componentDidMount=()=>{document.addEventListener("click",this.handleClickoutside),this.edgeCheck()},this.componentWillUnmount=()=>{document.removeEventListener("click",this.handleClickoutside)},this.componentDidUpdate=()=>{this.edgeCheck()},this.handleClickoutside=e=>{this.props.onClickOutside&&!this.refs.self.current.contains(e.target)&&setTimeout((()=>{this.props.onClickOutside()}),0)},this.handleMenuItemClicked=e=>{this.props.onMenuItemClicked&&setTimeout((()=>{this.props.onMenuItemClicked(e)}),0)}}get coord(){return this.props.coord?this.props.coord:{x:0,y:0}}edgeCheck(){if(!ae.isInViewport(this.refs.self.current)){const e=this.coord.x-this.refs.self.current.offsetWidth+"px";this.refs.self.current.style.left=e}if(!ae.isInViewport(this.refs.self.current)){const e=this.coord.y-this.refs.self.current.offsetHeight+"px";this.refs.self.current.style.top=e}}render(){return v("div",{ref:this.createRef("self"),style:{left:this.coord.x,top:this.coord.y},className:Ze},this.props.items.map((e=>v(it,__spreadValues({onClick:this.handleMenuItemClicked},e)))))}}var lt="v-grid-header-column",at="v-grid-header-column-content",ht="v-grid-header-name",dt="v-grid-column-icon",ut="v-grid-column-drag-handle",ct="v-grid-column-resize-holder";var pt=ze(((e,{props:t})=>({options:e.column.columns,data:e.column.groupsData[t.value]})))(ke(class extends Je{constructor(){super(...arguments),this.toggleCollapsed=()=>{this.props.grid.toggleGroupCollapsed(this.props.value)}}get data(){return this.props.data}render(){const e=this.props.grid.store("column").getGroupWidth(this.props.value,this.props.columns);if(0===e.width)return null;const t={width:e.width};e.flex&&(t.flexGrow=e.flex);const s=be([dt,this.data.collapsed?"vg-cheveron-right":"vg-cheveron-left"]);return v("div",{className:lt,style:t},v("div",{className:at},v("span",null,this.data.headerName),this.data.collapsible&&v("span",{onClick:this.toggleCollapsed,className:s})))}}));var gt=ze(((e,{props:t})=>({options:e.column.columns[t.value]})))(ke(class extends Je{constructor(){super(...arguments),this.bindMetaData=()=>{this.self.__isColumn=!0,this.self.__field=this.options.field},this.handleDragStart=e=>{this.props.onDragStart&&this.props.onDragStart(this.options.field,this.self,e)},this.handleMouseDown=e=>{this.props.onResize&&this.props.onResize(this.options.field,this.self.offsetWidth,e)},this.handleContextMenu=e=>{this.props.onContextMenu&&this.props.onContextMenu(this.props.value,e)}}get options(){return this.props.options}componentDidMount(){this.bindMetaData()}componentDidUpdate(){this.bindMetaData()}render(){const e={width:this.options.width,minWidth:this.options.minWidth};this.options.flex&&(e.flexGrow=this.options.flex);const t={column:this.props.value,grid:this.props.grid},s=fe(at,this.options.headerClass||[],this.options.getHeaderClass?this.options.getHeaderClass(t):[]),o=__spreadValues(__spreadValues({},this.options.headerStyle),this.options.getHeaderStyle?this.options.getHeaderStyle(t):{});return v("div",{ref:e=>this.self=e,className:lt,style:e},v("div",{className:s,style:o},this.options.sortable&&v("span",{onMouseDown:this.handleDragStart,className:fe(["vg-move",dt,ut])}),v("span",{className:ht},this.options.headerName),this.props.onContextMenu&&v("span",{onClick:this.handleContextMenu,className:`${dt} vg-menu`}),!this.options.flex&&this.options.resizable&&v("div",{ref:this.createRef("resizer"),onMouseDown:this.handleMouseDown,className:ct})))}}));var ft="v-grid-header",mt="v-grid-header-columns",_t="v-grid-header-container",wt="v-grid-normal-columns",vt="v-grid-pinned-right-columns",Ct="v-grid-pinned-left-columns",yt="v-grid-column-drag-indicator",Rt="v-grid-column-drag-ghost",bt="v-grid-ghost-icon";var xt=ze((e=>({height:e.column.height,groups:e.column.groups,groupsData:e.column.groupsData})))(ke(class extends R{constructor(){super(...arguments),this.getActiveColumn=e=>{let t,s=e.target;for(;s!=this.columnsRoot&&s;){if(s.__field&&!0===s.__isColumn){t=s.__field;break}s=s.parentElement}if(t)return s},this.handleDragStart=(e,t,s)=>{var o;if(!this.props.grid.trigger("beforeColumnDragStart",e))return;this.ghost||(this.ghost=document.createElement("div"),this.ghost.className=Rt);const n=(null==(o=this.props.grid.getColumnOptions(e))?void 0:o.headerName)||"";this.ghost.innerHTML=`\n <span class="vg-move ${bt}"></span>\n <span>${n}</span>\n `,this.props.grid.appendChild(this.ghost),document.addEventListener("mousemove",this.handleDragMove),document.addEventListener("mouseup",this.handleDragEnd),this.currentDragStartField=e,this.dragIndicator.style.display="block",this.updateDragEndField(t),this.updateDragGhost(s),this.props.grid.trigger("afterColumnDragStart",e)},this.handleDragMove=e=>{this.updateDragGhost(e),this.updateDragEndField(this.getActiveColumn(e))},this.handleDragEnd=()=>{document.removeEventListener("mousemove",this.handleDragMove),document.removeEventListener("mouseup",this.handleDragEnd),this.props.grid.removeChild(this.ghost),this.dragIndicator.style.display="none";const e=this.currentDragStartField,t=this.currentDragEndField;this.currentDragStartField=this.currentDragEndField=void 0,this.props.grid.trigger("beforeColumnDragEnd",e,t)&&(this.props.grid.store("column").moveColumn(e,t),this.props.grid.trigger("afterColumnDragEnd",e,t))},this.updateDragGhost=e=>{if(!this.ghost)return;const t=this.props.grid.getRootElement().getBoundingClientRect();this.ghost.style.left=e.clientX-t.left+10+"px",this.ghost.style.top=e.clientY-t.top+10+"px"},this.updateDragEndField=e=>{if(!e)return;const t=this.columnsRoot.getBoundingClientRect(),s=e.getBoundingClientRect();this.currentDragEndField=e.__field,this.dragIndicator.style.left=s.left-t.left+"px",this.dragIndicator.style.height=s.height+"px",this.dragIndicator.style.width=s.width+"px"}}render(){const{columns:e,groups:t}=this.props,s={height:this.props.height,minHeight:this.props.height};return v(y,null,t.map((t=>v("div",{className:mt,style:s},t.map(((t,s)=>v(pt,{key:t+String(s),value:t,columns:e})))))),v("div",{ref:e=>this.columnsRoot=e,className:mt,style:s},v("div",{ref:e=>this.dragIndicator=e,className:yt}),e.map((e=>{const t=this.props.grid.getColumnMenuItems(e).length>0;return v(gt,{key:e,value:e,onResize:this.props.onColumnResizeStart,onDragStart:this.handleDragStart,onContextMenu:t?this.props.onColumnContextMenu:void 0})}))))}}));var St=ze((e=>({pinnedLeftColumns:e.column.pinnedLeftColumns,pinnedRightColumns:e.column.pinnedRightColumns,normalColumns:e.column.normalColumns})))(ke(class extends Je{constructor(){super(...arguments),this.componentDidMount=()=>{this.resize()},this.componentDidUpdate=()=>{this.resize()},this.resize=()=>{this.props.headerContainerRef.current.style.width="",this.props.headerContainerRef.current.style.width=this.props.headerContainerRef.current.scrollWidth+"px"},this.handleColumnContextMenu=(e,t)=>{const s=this.props.grid.getColumnMenuItems(e);0!==s.length&&(this.setState({isMenuVisible:!0,contextMenuItems:s,contextMenuCoord:{x:t.clientX,y:t.clientY}}),t.stopPropagation())},this.hideContextMenu=()=>{this.state.isMenuVisible&&this.setState({isMenuVisible:!1})}}render(){return v("div",{ref:this.props.headerRef,className:ft},this.props.pinnedLeftColumns.length>0&&v("div",{ref:this.props.pinnedLeftColumnsRef,className:be([Ct])},v(xt,{columns:this.props.pinnedLeftColumns,onColumnResizeStart:this.props.handleColumnResizeStart,onColumnContextMenu:this.handleColumnContextMenu})),v("div",{ref:this.props.normalColumnsRef,className:wt},v("div",{ref:this.props.headerContainerRef,className:be([_t])},v(xt,{columns:this.props.normalColumns,onColumnResizeStart:this.props.handleColumnResizeStart,onColumnContextMenu:this.handleColumnContextMenu}))),this.props.pinnedRightColumns.length>0&&v("div",{ref:this.props.pinnedRightColumnsRef,className:be([vt])},v(xt,{columns:this.props.pinnedRightColumns,onColumnResizeStart:this.props.handleColumnResizeStart,onColumnContextMenu:this.handleColumnContextMenu})),this.state.isMenuVisible&&v(rt,{onMenuItemClicked:this.hideContextMenu,onClickOutside:this.hideContextMenu,coord:this.state.contextMenuCoord,items:this.state.contextMenuItems}))}}));class Et{each(e){for(let t=this.minY;t<=this.maxY;t++)for(let s=this.minX;s<=this.maxX;s++)if(!1===e({x:s,y:t},{x:s-this.minX,y:t-this.minY}))return}eachRow(e){for(let t=this.minY;t<=this.maxY;t++)if(!1===e(t,t-this.minY))return}getStartCoord(){return{x:this.minX,y:this.minY}}getEndCoord(){return{x:this.maxX,y:this.maxY}}getGlobalCoord(e){return{x:this.minX+e.x,y:this.minY+e.y}}getCellCount(){return(this.maxX-this.minX+1)*(this.maxY-this.minY+1)}contains(e){return!this.isEmpty()&&(e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY)}isLeft(e){return!this.isEmpty()&&e.x==this.minX}isRight(e){return!this.isEmpty()&&e.x==this.maxX}isTop(e){return!this.isEmpty()&&e.y==this.minY}isBottom(e){return!this.isEmpty()&&e.y==this.maxY}}class Mt extends Et{constructor(e,t){super(),this.start=e,this.end=t,e&&t&&(this.minX=Math.min(e.x,t.x),this.minY=Math.min(e.y,t.y),this.maxX=Math.max(e.x,t.x),this.maxY=Math.max(e.y,t.y))}isEmpty(){return!this.start||!this.end}}class Dt extends Et{constructor(e,t,s){super(),this.ref=e,this.current=t,this.limit=s,void 0!==this.limit&&e&&t&&!e.contains(t)&&("xy"===this.limit&&(this.limit=Math.abs(t.x-e.end.x)>Math.abs(t.y-e.end.y)?"x":"y"),this.start=e.getStartCoord(),this.end=t,"x"===this.limit?(this.end.y=e.end.y,this.start.x=t.x<e.start.x?e.start.x-1:e.end.x+1):(this.end.x=e.end.x,this.start.y=t.y<e.start.y?e.start.y-1:e.end.y+1),this.minX=Math.min(this.start.x,this.end.x),this.minY=Math.min(this.start.y,this.end.y),this.maxX=Math.max(this.start.x,this.end.x),this.maxY=Math.max(this.start.y,this.end.y))}isEmpty(){return!this.start||!this.end}getReference(){return this.ref}chunk(e){if(this.isEmpty())return;const t=this.ref.getStartCoord(),s=this.ref.getEndCoord(),o=this.minX<t.x||this.minY<t.y;let n=[],i=s.y-t.y,r=o?this.minY:this.maxY,l=o?this.maxY:this.minY;for("x"===this.limit&&(i=s.x-t.x,r=o?this.minX:this.maxX,l=o?this.maxX:this.minX);;){const e="x"===this.limit?{x:l,y:this.minY}:{x:this.minX,y:l};l=o?Math.max(l-i,r):Math.min(l+i,r);const t="x"===this.limit?{x:l,y:this.maxY}:{x:this.maxX,y:l};if(n.push(new Mt(e,t)),l==r)break;l+=o?-1:1}n.forEach((t=>{e(t)}))}}var Nt="v-grid-row-cells",zt="v-grid-row-stripe-cells",kt="v-grid-row-cells-hover",It="v-grid-row-cells-select";var Pt=ke(class extends Je{constructor(){super(...arguments),this.self={current:null},this.updateState=()=>{if(!this.self.current)return;const e=this.props.grid.store("row").getRowIndex(this.props.value),t=this.props.grid.state("row").hoveredRow===this.props.value,s=-1!==this.props.grid.state("row").selectedRows.indexOf(this.props.value);e%2==0?ae.appendClassName(this.self.current,zt):ae.removeClassName(this.self.current,zt),t?ae.appendClassName(this.self.current,kt):ae.removeClassName(this.self.current,kt),s?ae.appendClassName(this.self.current,It):ae.removeClassName(this.self.current,It)}}componentDidMount(){this.unsubscribe=this.props.grid.store("row").subscribeAny(this.updateState),this.updateState()}componentWillUnmount(){this.unsubscribe()}render(){const e={row:this.props.value,grid:this.props.grid};let t=__spreadValues(__spreadValues({},this.props.grid.state("row").rowStyle),this.props.style);this.props.grid.state("row").getRowStyle&&(t=Object.assign({},t,this.props.grid.state("row").getRowStyle(e)));let s=this.props.grid.state("row").rowClass||[];return s.push(Nt),this.props.grid.state("row").getRowClass&&(s=s.concat(this.props.grid.state("row").getRowClass(e))),s=Me(s),v("div",{ref:this.self,style:t,className:fe(s)},this.props.children)}});var Ot="v-grid-cell",Tt="v-grid-cell-content",Vt="v-grid-cell-editing",Lt="v-grid-cell-selected",Bt="v-grid-cell-filling",Ht="v-grid-cell-filling-left-boundary",At="v-grid-cell-filling-right-boundary",$t="v-grid-cell-filling-top-boundary",Ft="v-grid-cell-filling-bottom-boundary",Wt="v-grid-cell-left-boundary",jt="v-grid-cell-right-boundary",Xt="v-grid-cell-top-boundary",Ut="v-grid-cell-bottom-boundary",Yt="v-grid-cell-editing-wrapper",Gt="v-grid-cell-popup-container",Kt="v-grid-cell-drag-handle",qt="v-grid-cell-fill-handler",Qt="v-grid-row-resize-holder";var Jt,Zt,es,ts,ss,os,ns,is,rs=ke(class extends Je{constructor(){super(...arguments),this.cellContent={current:null},this.popup=null,this.isEditing=!1,this.unsubscribes=[],this.componentDidMount=()=>{this.bindMetaData(),this.doRender(),this.unsubscribes.push(this.props.grid.store("cell").subscribeAny((()=>{var e;const t=this.grid.getSelectBoundary(this.props.row,this.props.column),s=(null==(e=this.options)?void 0:e.readonly)?void 0:this.grid.getFillingBoundary(this.props.row,this.props.column);this.setState({fillable:this.grid.state("grid").fillable,isSelected:void 0!==t,isLeftSelected:t&&t.left,isRightSelected:t&&t.right,isTopSelected:t&&t.top,isBottomSelected:t&&t.bottom,isFilling:void 0!==s,isLeftFilling:s&&s.left,isRightFilling:s&&s.right,isTopFilling:s&&s.top,isBottomFilling:s&&s.bottom})}))),this.options.cellEditor&&!this.options.readonly&&this.unsubscribes.push(this.props.grid.store("cell").subscribeAny((()=>{const e=this.props.grid.state("cell").editing,t=Boolean(e&&e.row===this.props.row&&e.column===this.props.column);this.isEditing!==t&&(this.isEditing=t,this.handleCellEditing())})))},this.componentWillUnmount=()=>{this.unsubscribes.forEach((e=>e())),this.props.grid.removeChild(this.popup),this.cellRender&&this.cellRender.beforeDestroy&&this.cellRender.beforeDestroy(),this.cellEditor&&this.cellEditor.beforeDestroy&&this.cellEditor.beforeDestroy()},this.componentDidUpdate=()=>{this.doRender(),this.bindMetaData()},this.bindMetaData=()=>{this.cell.__isCell=!0,this.cell.__column=this.props.column,this.cell.__row=this.props.row,this.dragHandle&&(this.dragHandle.__dragHandle=!0,this.dragHandle.__column=this.props.column,this.dragHandle.__row=this.props.row),this.filler&&(this.filler.__filler=!0,this.filler.__column=this.props.column,this.filler.__row=this.props.row),this.resizer&&(this.resizer.__resizer=!0,this.resizer.__column=this.props.column,this.resizer.__row=this.props.row)},this.handleCellEditing=()=>{if(!this.isEditing)return void(this.cellEditor&&(ae.setClassNames(this.cellContent.current,[Tt]),this.setValue(this.cellEditor.getValue()),this.doRender()));const e=document.createElement("div");ae.clean(this.cellContent.current),ae.appendClassName(this.cellContent.current,Vt),this.cellEditor&&this.cellEditor.beforeDestroy&&this.cellEditor.beforeDestroy(),this.cellEditor=new this.options.cellEditor,this.cellEditor.init&&this.cellEditor.init({props:this.options.cellParams,value:this.getValue(!0),column:this.options,row:this.props.row,gird:this.props.grid}),e.appendChild(this.cellEditor.gui()),e.className=Yt,this.cellEditor.isPopup()?this.createPopup(e):this.cellContent.current.appendChild(e),this.cellEditor.afterAttached&&this.cellEditor.afterAttached()},this.createPopup=e=>{this.popup||(this.popup=document.createElement("div"),this.popup.className=Gt),ae.clean(this.popup);const t=this.props.grid.getRootElement().getBoundingClientRect(),s=this.cell.getBoundingClientRect();this.popup.style.left=s.left-t.left+"px",this.popup.style.top=s.top-t.top+"px",this.popup.style.minWidth=s.width+"px",this.popup.style.minHeight=s.height+"px",this.popup.appendChild(e),this.props.grid.appendChild(this.popup)}}get grid(){return this.props.grid}get options(){return this.grid.getColumnOptions(this.props.column,this.props.row)}getValue(e=!1){return e?this.grid.getRawCellValue(this.props.row,this.props.column):this.props.grid.getCellValue(this.props.row,this.props.column)}setValue(e){this.props.grid.setCellValue(this.props.row,this.props.column,e)}doRender(){this.isEditing||(this.options.cellRender?(this.cellRender&&this.cellRender.beforeDestroy&&this.cellRender.beforeDestroy(),this.cellRender=new this.options.cellRender,this.cellRender.init&&this.cellRender.init({props:this.options.cellParams,value:this.getValue(!0),column:this.options,row:this.props.row,gird:this.props.grid}),this.cellContent.current&&(this.props.grid.removeChild(this.popup),ae.clean(this.cellContent.current),this.cellContent.current.appendChild(this.cellRender.gui()),this.cellRender.afterAttached&&this.cellRender.afterAttached())):this.cellContent.current&&(this.cellContent.current.textContent=this.getValue()))}render(){let e=!0===this.options.rowDragable;"function"==typeof this.options.rowDragable&&(e=this.options.rowDragable({row:this.props.row,column:this.props.column,grid:this.props.grid}));const t={column:this.props.column,row:this.props.row,grid:this.props.grid},s=be(this.options.cellClass||[],this.options.getCellClass?this.options.getCellClass(t):[],{[Ot]:!0,[Lt]:this.state.isSelected,[Wt]:this.state.isLeftSelected,[jt]:this.state.isRightSelected,[Xt]:this.state.isTopSelected,[Ut]:this.state.isBottomSelected,[Bt]:this.state.isFilling,[Ht]:this.state.isLeftFilling,[At]:this.state.isRightFilling,[$t]:this.state.isTopFilling,[Ft]:this.state.isBottomFilling});let o=__spreadValues({},this.props.style);this.options.cellStyle&&(o=Object.assign({},o,this.options.cellStyle)),this.options.getCellStyle&&(o=Object.assign({},o,this.options.getCellStyle(t))),this.options.flex&&(o.flexGrow=this.options.flex);const n=void 0!==this.state.fillable&&this.state.isBottomSelected&&this.state.isRightSelected;let i=this.grid.state("grid").rowResizable;return"function"==typeof i&&(i=i(this.props.row)),v("div",{ref:e=>this.cell=e,className:s,style:o},e&&v("div",{ref:e=>this.dragHandle=e,className:Kt},v("span",{className:"vg-move"})),v("div",{ref:this.cellContent,className:Tt}),!!i&&v("div",{ref:e=>this.resizer=e,className:Qt}),n&&v("div",{ref:e=>this.filler=e,className:qt}))}});(Zt=Jt||(Jt={})).AUTO="auto",Zt.START="start",Zt.CENTER="center",Zt.END="end",(ts=es||(es={})).OBSERVED="observed",ts.REQUESTED="requested",(os=ss||(ss={})).Horizontal="horizontal",os.Vertical="vertical",(is=ns||(ns={})).Vertical="onScrollVertical",is.Horizontal="onScrollHorizontal";const ls={[ss.Vertical]:ns.Vertical,[ss.Horizontal]:ns.Horizontal};var as,hs,ds,us;(hs=as||(as={})).Vertical="scrollTop",hs.Horizontal="scrollLeft",ss.Vertical,as.Vertical,ss.Horizontal,as.Horizontal,(us=ds||(ds={})).Vertical="top",us.Horizontal="left";const cs={[ss.Vertical]:ds.Vertical,[ss.Horizontal]:ds.Horizontal};var ps,gs;(gs=ps||(ps={})).Vertical="offsetTop",gs.Horizontal="offsetLeft";const fs={[ss.Vertical]:ps.Vertical,[ss.Horizontal]:ps.Horizontal};var ms,_s;(_s=ms||(ms={})).Vertical="scrollYNode",_s.Horizontal="scrollXNode";const ws={[ss.Vertical]:ms.Vertical,[ss.Horizontal]:ms.Horizontal};class vs{constructor({itemCount:e,itemSizeGetter:t}){this.itemSizeGetter=t,this.itemCount=e,this.itemSizeAndPositionData={},this.lastMeasuredIndex=-1}updateConfig({itemCount:e,itemSizeGetter:t}){null!=e&&(this.itemCount=e),null!=t&&(this.itemSizeGetter=t)}getLastMeasuredIndex(){return this.lastMeasuredIndex}getSizeAndPositionForIndex(e){if(e<0||e>=this.itemCount){if(0===this.itemCount)return{offset:0,size:0};throw Error(`Requested index ${e} is outside of range 0..${this.itemCount}`)}if(e>this.lastMeasuredIndex){const t=this.getSizeAndPositionOfLastMeasuredItem();let s=t.offset+t.size;for(let o=this.lastMeasuredIndex+1;o<=e;o++){const e=this.itemSizeGetter(o);if(null==e||isNaN(e))throw Error(`Invalid size returned for index ${o} of value ${e}`);this.itemSizeAndPositionData[o]={offset:s,size:e},s+=e}this.lastMeasuredIndex=e}return this.itemSizeAndPositionData[e]}getSizeAndPositionOfLastMeasuredItem(){return this.lastMeasuredIndex>=0?this.itemSizeAndPositionData[this.lastMeasuredIndex]:{offset:0,size:0}}getTotalSize(){const e=this.getSizeAndPositionForIndex(Math.max(this.itemCount-1,0));return e.offset+e.size}getUpdatedOffsetForIndex({align:e=Jt.START,containerSize:t,currentOffset:s,targetIndex:o}){if(t<=0)return 0;const n=this.getSizeAndPositionForIndex(o),i=n.offset,r=i-t+n.size;let l;switch(e){case Jt.END:l=r;break;case Jt.CENTER:l=i-(t-n.size)/2;break;case Jt.START:l=i;break;default:l=Math.max(r,Math.min(i,s))}const a=this.getTotalSize();return Math.max(0,Math.min(a-t,l))}getVisibleRange({containerSize:e,offset:t,overscanCount:s}){if(0===this.getTotalSize())return{};const o=t+e;let n=this.findNearestItem(t);if(void 0===n)throw Error(`Invalid offset ${t} specified`);const i=this.getSizeAndPositionForIndex(n);t=i.offset+i.size;let r=n;for(;t<o&&r<this.itemCount-1;)r++,t+=this.getSizeAndPositionForIndex(r).size;return s&&(n=Math.max(0,n-s),r=Math.min(r+s,this.itemCount-1)),{start:n,stop:r}}resetItem(e){this.lastMeasuredIndex=Math.min(this.lastMeasuredIndex,e-1)}findNearestItem(e){if(isNaN(e))throw Error(`Invalid offset ${e} specified`);e=Math.max(0,e);const t=this.getSizeAndPositionOfLastMeasuredItem(),s=Math.max(0,this.lastMeasuredIndex);return t.offset>=e?this.binarySearch({high:s,low:0,offset:e}):this.exponentialSearch({index:s,offset:e})}binarySearch({low:e,high:t,offset:s}){let o=0,n=0;for(;e<=t;){if(o=e+Math.floor((t-e)/2),n=this.getSizeAndPositionForIndex(o).offset,n===s)return o;n<s?e=o+1:n>s&&(t=o-1)}return e>0?e-1:0}exponentialSearch({index:e,offset:t}){let s=1;for(;e<this.itemCount&&this.getSizeAndPositionForIndex(e).offset<t;)e+=s,s*=2;return this.binarySearch({high:Math.min(e,this.itemCount-1),low:Math.floor(e/2),offset:t})}}function Cs(e,t,s,...o){let n,i=new Date;return function(...r){let l=new Date;clearTimeout(n),l.getTime()-i.getTime()>=s?(e(...r,...o),i=l):n=setTimeout((()=>{e(...r,...o)}),t)}}const ys={width:"100%",height:"100%"},Rs={overflowY:"auto",overflowX:"hidden",width:"100%",height:"100%",display:"flex"},bs={position:"relative",overflowX:"auto",overflowY:"hidden",flexGrow:1,minHeight:"100%"},xs={position:"relative",height:"100%"},Ss={position:"relative",flexShrink:0,boxSizing:"content-box"},Es={height:"100%",width:"100%"},Ms={position:"absolute",top:0,left:0,height:"100%",width:"100%"},Ds=100,Ns=100,zs=3,ks=1;class Is extends Oe{constructor(){super(...arguments),this.itemSizeGetter=(e,t)=>s=>this.getSize(t(s),e),this.rowManager=new vs({itemCount:this.props.rows.length,itemSizeGetter:this.itemSizeGetter(this.props.rowHeight,(e=>this.props.rows[e]))}),this.columnManager=new vs({itemCount:this.props.columns.length,itemSizeGetter:this.itemSizeGetter(this.props.columnWidth,(e=>this.props.columns[e]))}),this.rowStyleCache={},this.columnStyleCache={},this.state={offsetLeft:this.props.scrollLeftOffset||null!=this.props.scrollToColumnIndex&&this.getOffsetForColumn(this.props.scrollToColumnIndex)||0,offsetTop:this.props.scrollTopOffset||null!=this.props.scrollToRowIndex&&this.getOffsetForRow(this.props.scrollToRowIndex)||0,scrollChangeReason:es.REQUESTED},this.handleMouseWheel=e=>{0!=e.deltaX&&(e.preventDefault(),0==e.deltaY&&this.props.onWheelHorizontal&&this.props.onWheelHorizontal(e))},this.handleScroll=(e,t)=>{"function"==typeof this.props[ls[t]]&&this.props[ls[t]](e);const s=this.getNodeOffset();s[cs[t]]<0||e.target!==this[ws[t]]||this.state[fs[t]]===s[cs[t]]||this.setState({[fs[t]]:s[cs[t]],scrollChangeReason:es.OBSERVED})},this.getRootRef=e=>{this.rootNode=e},this.getScrollYRef=e=>{this.scrollYNode=e,this.props.getScrollYNode&&this.props.getScrollYNode(e)},this.getScrollXRef=e=>{this.scrollXNode=e,this.props.getScrollXNode&&this.props.getScrollXNode(e)},this.getPinnedLeftWidth=()=>this.props.pinnedLeftColumns.reduce(((e,t)=>e+this.getSize(t,this.props.columnWidth)),0),this.getPinnedRightWidth=()=>this.props.pinnedRightColumns.reduce(((e,t)=>e+this.getSize(t,this.props.columnWidth)),0)}componentDidMount(){var e,t,s;const{throttleRate:o=Ds,throttleTimeout:n=Ns,scrollLeftOffset:i,scrollToColumnIndex:r,scrollTopOffset:l,scrollToRowIndex:a}=this.props;let h,d;this.onScrollVertical=Cs(this.handleScroll,n,o,ss.Vertical),this.onScrollHorizontal=Cs(this.handleScroll,n,o,ss.Horizontal),null==(e=this.scrollYNode)||e.addEventListener("scroll",this.onScrollVertical,{passive:!0}),null==(t=this.scrollXNode)||t.addEventListener("scroll",this.onScrollHorizontal,{passive:!0}),null==(s=this.scrollXNode)||s.addEventListener("wheel",this.handleMouseWheel,{passive:!1}),null!=i?h=i:null!=r&&(h=this.getOffsetForColumn(r)),null!=l?d=l:null!=a&&(d=this.getOffsetForRow(a)),this.scrollTo({left:h,top:d}),this.forceUpdate()}componentWillReceiveProps(e){const{rows:t,columns:s,rowHeight:o,columnWidth:n,scrollTopOffset:i,scrollLeftOffset:r,scrollToRowAlignment:l,scrollToColumnAlignment:a,scrollToRowIndex:h,scrollToColumnIndex:d}=this.props,u=e.scrollToRowIndex!==h||e.scrollToColumnIndex!==d||e.scrollToRowAlignment!==l||e.scrollToColumnAlignment!==a,c=e.rows!==t||e.columns!==s||e.rowHeight!==o||e.columnWidth!==n;e.rowHeight!==o&&this.rowManager.updateConfig({itemSizeGetter:this.itemSizeGetter(e.rowHeight,(t=>e.rows[t]))}),e.columnWidth!==n&&this.columnManager.updateConfig({itemSizeGetter:this.itemSizeGetter(e.columnWidth,(t=>e.columns[t]))}),e.rows!==t&&this.rowManager.updateConfig({itemCount:e.rows.length}),e.columns!==s&&this.columnManager.updateConfig({itemCount:e.columns.length}),c&&this.recomputeSizes(),e.scrollLeftOffset!==r||e.scrollTopOffset!=i?this.setState({offsetLeft:e.scrollLeftOffset||0,offsetTop:e.scrollTopOffset||0,scrollChangeReason:es.REQUESTED}):u?this.setState({offsetLeft:this.getOffsetForColumn(e.scrollToColumnIndex||0,e.scrollToColumnAlignment,e.columns.length),offsetTop:this.getOffsetForRow(e.scrollToRowIndex||0,e.scrollToRowAlignment,e.rows.length),scrollChangeReason:es.REQUESTED}):c&&this.forceUpdate()}componentDidUpdate(e,t){const s=this.scrollXNode.parentNode,o=Math.max(this.scrollXNode.offsetHeight-this.scrollXNode.clientHeight,17);this.scrollXNode.style.height=s.offsetHeight+o+"px";const{offsetLeft:n,offsetTop:i,scrollChangeReason:r}=this.state;t.offsetLeft===n&&t.offsetTop==i||r!==es.REQUESTED||this.scrollTo({left:n,top:i})}componentWillUnmount(){var e,t,s;null==(e=this.scrollYNode)||e.removeEventListener("scroll",this.onScrollVertical),null==(t=this.scrollXNode)||t.removeEventListener("scroll",this.onScrollHorizontal),null==(s=this.scrollXNode)||s.removeEventListener("wheel",this.handleMouseWheel)}scrollTo({top:e,left:t}){null!=e&&this.scrollYNode&&(this.scrollYNode.scrollTop=e),null!=t&&this.scrollXNode&&(this.scrollXNode.scrollLeft=t)}getOffsetForColumn(e,t=this.props.scrollToColumnAlignment,s=this.props.columns.length){var o;return(e<0||e>=s)&&(e=0),this.columnManager.getUpdatedOffsetForIndex({align:t,containerSize:(null==(o=this.scrollXNode)?void 0:o.offsetWidth)||0,currentOffset:this.state&&this.state.offsetLeft||0,targetIndex:e})}getOffsetForRow(e,t=this.props.scrollToRowAlignment,s=this.props.rows.length){var o;return(e<0||e>=s)&&(e=0),this.rowManager.getUpdatedOffsetForIndex({align:t,containerSize:(null==(o=this.rootNode)?void 0:o.offsetHeight)||0,currentOffset:this.state&&this.state.offsetTop||0,targetIndex:e})}recomputeSizes(e=0,t=0){this.rowStyleCache={},this.columnStyleCache={},this.rowManager.resetItem(e),this.columnManager.resetItem(t)}getSize(e,t){return"function"==typeof t?t(e):"number"==typeof t?t:t[e]}getRowStyle(e){const t=this.props.rows[e],s=this.rowStyleCache[t];if(s)return s;const{size:o,offset:n}=this.rowManager.getSizeAndPositionForIndex(e);return this.rowStyleCache[t]=__spreadProps(__spreadValues({},Ms),{height:o,transform:`translateY(${n}px)`})}getColumnStyle(e){const t=this.props.columns[e],s=this.columnStyleCache[t];if(s)return s;const{size:o,offset:n}=this.columnManager.getSizeAndPositionForIndex(e);return this.columnStyleCache[t]=__spreadProps(__spreadValues({},Ms),{width:o,left:n})}getPinnedColumnStyle(e){const t=this.columnStyleCache[e];if(t)return t;const s=this.getSize(e,this.props.columnWidth);return this.columnStyleCache[e]=__spreadProps(__spreadValues({},Es),{width:s})}getNodeOffset(){var e,t;return{top:(null==(e=this.scrollYNode)?void 0:e.scrollTop)||0,left:(null==(t=this.scrollXNode)?void 0:t.scrollLeft)||0}}render(){var e,t;const{style:s,pinnedLeftColumns:o=[],pinnedRightColumns:n=[],overscanRowCount:i=zs,overscanColumnCount:r=ks,renderRow:l,renderCell:a}=this.props,h={className:this.props.className,children:this.props.children},{offsetLeft:d,offsetTop:u}=this.state,c=this.rowManager.getVisibleRange({containerSize:(null==(e=this.rootNode)?void 0:e.offsetHeight)||0,offset:u,overscanCount:i}),p=this.columnManager.getVisibleRange({containerSize:(null==(t=this.scrollXNode)?void 0:t.offsetWidth)||0,offset:d,overscanCount:r}),g=this.colu